diff --git a/.buildkite/ftr_oblt_stateful_configs.yml b/.buildkite/ftr_oblt_stateful_configs.yml index eed465472503..1a2797795828 100644 --- a/.buildkite/ftr_oblt_stateful_configs.yml +++ b/.buildkite/ftr_oblt_stateful_configs.yml @@ -12,14 +12,14 @@ disabled: - x-pack/plugins/observability_solution/profiling/e2e/ftr_config.ts #FTR configs - - x-pack/plugins/observability_solution/uptime/e2e/config.ts + - x-pack/solutions/observability/plugins/uptime/e2e/config.ts # Elastic Synthetics configs - - x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.ts - - x-pack/plugins/observability_solution/synthetics/e2e/config.ts - - x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts - - x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts - - x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts + - x-pack/solutions/observability/plugins/uptime/e2e/uptime/synthetics_run.ts + - x-pack/solutions/observability/plugins/synthetics/e2e/config.ts + - x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.ts + - x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.ts + - x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.ts - x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts defaultQueue: 'n2-4-spot' diff --git a/.buildkite/ftr_platform_stateful_configs.yml b/.buildkite/ftr_platform_stateful_configs.yml index af04aef1e091..d02d3d198a2e 100644 --- a/.buildkite/ftr_platform_stateful_configs.yml +++ b/.buildkite/ftr_platform_stateful_configs.yml @@ -264,7 +264,6 @@ enabled: - x-pack/test/functional/apps/security/config.ts - x-pack/test/functional/apps/snapshot_restore/config.ts - x-pack/test/functional/apps/spaces/config.ts - - x-pack/test/functional/apps/spaces/solution_view_flag_enabled/config.ts - x-pack/test/functional/apps/status_page/config.ts - x-pack/test/functional/apps/transform/creation/index_pattern/config.ts - x-pack/test/functional/apps/transform/creation/runtime_mappings_saved_search/config.ts diff --git a/.buildkite/ftr_security_stateful_configs.yml b/.buildkite/ftr_security_stateful_configs.yml index bd8bc9e922f0..84a9c815bf56 100644 --- a/.buildkite/ftr_security_stateful_configs.yml +++ b/.buildkite/ftr_security_stateful_configs.yml @@ -101,4 +101,5 @@ enabled: - x-pack/test/cloud_security_posture_functional/config.ts - x-pack/test/cloud_security_posture_functional/config.agentless.ts - x-pack/test/cloud_security_posture_functional/data_views/config.ts - - x-pack/test/automatic_import_api_integration/security/config_basic.ts + - x-pack/test/automatic_import_api_integration/apis/config_basic.ts + - x-pack/test/automatic_import_api_integration/apis/config_graphs.ts diff --git a/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing-9-dot-0.yml b/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing-9-dot-0.yml new file mode 100644 index 000000000000..f4d01a939b40 --- /dev/null +++ b/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing-9-dot-0.yml @@ -0,0 +1,43 @@ +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: bk-kibana-es-forward-compatibility-testing-9-dot-0 + description: Forward compatibility testing between Kibana 8.18 and ES 9+ + links: + - url: 'https://buildkite.com/elastic/kibana-es-forward-compatibility-testing-9-dot-0' + title: Pipeline link +spec: + type: buildkite-pipeline + system: buildkite + owner: 'group:kibana-operations' + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: kibana / ES Forward Compatibility Testing 9.0 + description: Forward compatibility testing between Kibana 8.18 and ES 9+ + spec: + env: + SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts' + ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true' + REPORT_FAILED_TESTS_TO_GITHUB: 'true' + allow_rebuilds: false + branch_configuration: main + default_branch: main + repository: elastic/kibana + pipeline_file: .buildkite/pipelines/es_forward_9_dot_0.yml # Note: this file exists in 8.x only and should be moved into 8.18 once the branch is cut + provider_settings: + prefix_pull_request_fork_branch_names: false + trigger_mode: none + teams: + kibana-operations: + access_level: MANAGE_BUILD_AND_READ + appex-qa: + access_level: MANAGE_BUILD_AND_READ + kibana-tech-leads: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: BUILD_AND_READ + tags: + - kibana diff --git a/.buildkite/pipeline-resource-definitions/locations.yml b/.buildkite/pipeline-resource-definitions/locations.yml index 11c0195902ee..dc4e044ce63c 100644 --- a/.buildkite/pipeline-resource-definitions/locations.yml +++ b/.buildkite/pipeline-resource-definitions/locations.yml @@ -18,6 +18,7 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-console-definitions-sync.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-coverage-daily.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-deploy-project.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing-9-dot-0.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-forward-testing.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-serverless-snapshots.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-es-snapshots.yml @@ -25,6 +26,7 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-fips-daily.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-flaky.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-fleet-packages-daily.yml + - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-gen-ai-daily.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-migration-staging.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-on-merge-unsupported-ftrs.yml - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-on-merge.yml @@ -50,4 +52,3 @@ spec: - https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/security-solution-quality-gate/kibana-serverless-security-solution-quality-gate-investigations.yml - 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-gen-ai-daily.yml diff --git a/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml b/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml index 8dd486c3176c..22567675a513 100644 --- a/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml +++ b/.buildkite/pipeline-resource-definitions/trigger-version-dependent-jobs.yml @@ -51,6 +51,11 @@ spec: message: Trigger ES forward compatibility tests env: TRIGGER_PIPELINE_SET: es-forward + Trigger ES forward compatibility tests 9.0: + cronline: 0 5 * * * + message: Trigger ES forward compatibility tests 9.0 + env: + TRIGGER_PIPELINE_SET: es-forward-9-dot-0 Trigger artifact staging builds: cronline: 0 7 * * * America/New_York message: Trigger artifact staging builds diff --git a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml index a7800fcc92dc..8903254ff4e8 100644 --- a/.buildkite/pipelines/on_merge_unsupported_ftrs.yml +++ b/.buildkite/pipelines/on_merge_unsupported_ftrs.yml @@ -73,7 +73,7 @@ steps: depends_on: build timeout_in_minutes: 120 artifact_paths: - - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml index 05fc218080cd..cf0cbd7e2012 100644 --- a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml +++ b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml @@ -14,7 +14,7 @@ steps: - check_oas_snapshot timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/exploratory_view/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/scout_ui_tests.yml b/.buildkite/pipelines/pull_request/scout_ui_tests.yml new file mode 100644 index 000000000000..37ea1567c4f4 --- /dev/null +++ b/.buildkite/pipelines/pull_request/scout_ui_tests.yml @@ -0,0 +1,18 @@ +steps: + - command: .buildkite/scripts/steps/functional/scout_ui_tests.sh + label: 'Scout UI Tests' + agents: + machineType: n2-standard-4 + preemptible: true + depends_on: + - build + - quick_checks + - checks + - linting + - linting_with_types + - check_types + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '-1' + limit: 2 diff --git a/.buildkite/pipelines/pull_request/synthetics_plugin.yml b/.buildkite/pipelines/pull_request/synthetics_plugin.yml index b4079b9fac30..5018dad0e58f 100644 --- a/.buildkite/pipelines/pull_request/synthetics_plugin.yml +++ b/.buildkite/pipelines/pull_request/synthetics_plugin.yml @@ -14,7 +14,7 @@ steps: - check_oas_snapshot timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/uptime_plugin.yml b/.buildkite/pipelines/pull_request/uptime_plugin.yml index 4c1e05d7476f..f38a59969b45 100644 --- a/.buildkite/pipelines/pull_request/uptime_plugin.yml +++ b/.buildkite/pipelines/pull_request/uptime_plugin.yml @@ -14,7 +14,7 @@ steps: - check_oas_snapshot timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/synthetics/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml index 4bade14464f3..b6f51351c62b 100644 --- a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml +++ b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml @@ -14,7 +14,7 @@ steps: - check_oas_snapshot timeout_in_minutes: 60 artifact_paths: - - 'x-pack/plugins/observability_solution/ux/e2e/.journeys/**/*' + - 'x-pack/solutions/observability/plugins/ux/e2e/.journeys/**/*' retry: automatic: - exit_status: '-1' diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 3c404083174b..162484865032 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -89,7 +89,7 @@ const getPipeline = (filename: string, removeSteps = true) => { if ( (await doAnyChangesMatch([ - /^x-pack\/plugins\/observability_solution\/observability_onboarding/, + /^x-pack\/solutions\/observability\/plugins\/observability_onboarding/, /^x-pack\/plugins\/fleet/, ])) || GITHUB_PR_LABELS.includes('ci:all-cypress-suites') @@ -114,7 +114,7 @@ const getPipeline = (filename: string, removeSteps = true) => { } if ( - (await doAnyChangesMatch([/^x-pack\/plugins\/observability_solution\/exploratory_view/])) || + (await doAnyChangesMatch([/^x-pack\/solutions\/observability\/plugins\/exploratory_view/])) || GITHUB_PR_LABELS.includes('ci:synthetics-runner-suites') ) { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/exploratory_view_plugin.yml')); @@ -122,8 +122,8 @@ const getPipeline = (filename: string, removeSteps = true) => { if ( (await doAnyChangesMatch([ - /^x-pack\/plugins\/observability_solution\/synthetics/, - /^x-pack\/plugins\/observability_solution\/exploratory_view/, + /^x-pack\/solutions\/observability\/plugins\/synthetics/, + /^x-pack\/solutions\/observability\/plugins\/exploratory_view/, ])) || GITHUB_PR_LABELS.includes('ci:synthetics-runner-suites') ) { @@ -133,8 +133,8 @@ const getPipeline = (filename: string, removeSteps = true) => { if ( (await doAnyChangesMatch([ - /^x-pack\/plugins\/observability_solution\/ux/, - /^x-pack\/plugins\/observability_solution\/exploratory_view/, + /^x-pack\/solutions\/observability\/plugins\/ux/, + /^x-pack\/solutions\/observability\/plugins\/exploratory_view/, ])) || GITHUB_PR_LABELS.includes('ci:synthetics-runner-suites') ) { @@ -248,7 +248,7 @@ const getPipeline = (filename: string, removeSteps = true) => { /^x-pack\/plugins\/security_solution_ess/, /^x-pack\/plugins\/security_solution_serverless/, /^x-pack\/plugins\/task_manager/, - /^x-pack\/plugins\/timelines/, + /^x-pack\/solutions\/security\/plugins\/timelines/, /^x-pack\/plugins\/triggers_actions_ui\/public\/application\/sections\/action_connector_form/, /^x-pack\/plugins\/triggers_actions_ui\/public\/application\/context\/actions_connectors_context\.tsx/, /^x-pack\/plugins\/triggers_actions_ui\/server\/connector_types\/openai/, @@ -290,7 +290,7 @@ const getPipeline = (filename: string, removeSteps = true) => { /^packages\/kbn-es-query/, /^packages\/kbn-i18n/, /^packages\/kbn-i18n-react/, - /^packages\/kbn-expandable-flyout/, + /^x-pack\/solutions\/security\/packages\/expandable-flyout/, /^packages\/kbn-grouping/, /^packages\/kbn-resizable-layout/, /^packages\/kbn-rison/, @@ -334,8 +334,8 @@ const getPipeline = (filename: string, removeSteps = true) => { /^x-pack\/plugins\/security_solution_ess/, /^x-pack\/plugins\/security_solution_serverless/, /^x-pack\/plugins\/task_manager/, - /^x-pack\/plugins\/threat_intelligence/, - /^x-pack\/plugins\/timelines/, + /^x-pack\/solutions\/security\/plugins\/threat_intelligence/, + /^x-pack\/solutions\/security\/plugins\/timelines/, /^x-pack\/plugins\/triggers_actions_ui/, /^x-pack\/plugins\/usage_collection\/public/, /^x-pack\/test\/functional\/es_archives\/security_solution/, @@ -378,6 +378,16 @@ const getPipeline = (filename: string, removeSteps = true) => { ); } + if ( + (await doAnyChangesMatch([ + /^x-pack\/plugins\/discover_enhanced\/ui_tests/, + /^packages\/kbn-scout/, + ])) || + GITHUB_PR_LABELS.includes('ci:scout-ui-tests') + ) { + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/scout_ui_tests.yml')); + } + pipeline.push(getPipeline('.buildkite/pipelines/pull_request/post_build.yml')); // remove duplicated steps diff --git a/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts index eace1bcdd55c..34ad833e4195 100755 --- a/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts +++ b/.buildkite/scripts/pipelines/trigger_version_dependent_jobs/pipeline.ts @@ -12,6 +12,7 @@ import { getVersionsFile, BuildkiteTriggerStep } from '#pipeline-utils'; const pipelineSets = { 'es-forward': 'kibana-es-forward-compatibility-testing', + 'es-forward-9-dot-0': 'kibana-es-forward-compatibility-testing-9-dot-0', 'artifacts-snapshot': 'kibana-artifacts-snapshot', 'artifacts-staging': 'kibana-artifacts-staging', 'artifacts-trigger': 'kibana-artifacts-trigger', @@ -40,6 +41,10 @@ async function main() { pipelineSteps.push(...getESForwardPipelineTriggers()); break; } + case 'es-forward-9-dot-0': { + pipelineSteps.push(...getESForward9Dot0PipelineTriggers()); + break; + } case 'artifacts-snapshot': { pipelineSteps.push(...getArtifactSnapshotPipelineTriggers()); break; @@ -90,6 +95,40 @@ export function getESForwardPipelineTriggers(): BuildkiteTriggerStep[] { }); } +/** + * This pipeline is testing the forward compatibility of Kibana with different versions of Elasticsearch for 9.0. + * Should be triggered for combinations of (Kibana@8.18 + ES@9.x {current open branches on the same major}) + */ +export function getESForward9Dot0PipelineTriggers(): BuildkiteTriggerStep[] { + const versions = getVersionsFile(); + const KIBANA_8_X = versions.versions.find((v) => v.branch === '8.x'); + if (!KIBANA_8_X) { + throw new Error( + 'Update ES forward compatibility 9.0 pipeline to remove 8.x and add version 8.18' + ); + } + const targetESVersions = versions.versions.filter( + (v) => v.branch.startsWith('9.') || (v.branch.includes('main') && v.version.startsWith('9.0.0')) + ); + + return targetESVersions.map(({ version }) => { + return { + trigger: pipelineSets['es-forward-9-dot-0'], + async: true, + label: `Triggering Kibana ${KIBANA_8_X.version} + ES ${version} forward compatibility`, + build: { + message: process.env.MESSAGE || `ES forward-compatibility test for ES ${version}`, + branch: KIBANA_8_X.branch, + commit: 'HEAD', + env: { + ES_SNAPSHOT_MANIFEST: `https://storage.googleapis.com/kibana-ci-es-snapshots-daily/${version}/manifest-latest-verified.json`, + DRY_RUN: process.env.DRY_RUN, + }, + }, + } as BuildkiteTriggerStep; + }); +} + /** * This pipeline creates Kibana artifact snapshots for all open branches. * Should be triggered for all open branches in the versions.json diff --git a/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh b/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh index adee8986bc74..e685f84ed230 100755 --- a/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh +++ b/.buildkite/scripts/steps/functional/exploratory_view_plugin.sh @@ -14,4 +14,4 @@ echo "--- Exploratory View plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node solutions/observability/plugins/exploratory_view/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/scout_ui_tests.sh b/.buildkite/scripts/steps/functional/scout_ui_tests.sh new file mode 100755 index 000000000000..bee4ec402088 --- /dev/null +++ b/.buildkite/scripts/steps/functional/scout_ui_tests.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source .buildkite/scripts/steps/functional/common.sh + +export JOB=kibana-scout-ui-tests + +TEST_CONFIG="x-pack/plugins/discover_enhanced/ui_tests/playwright.config.ts" +KIBANA_DIR="$KIBANA_BUILD_LOCATION" + +declare -A TESTS=( + ["Stateful"]="--stateful" + ["Serverless Elasticsearch"]="--serverless=es" + ["Serverless Observability"]="--serverless=oblt" + ["Serverless Security"]="--serverless=security" +) + +ORDER=("Stateful" "Serverless Elasticsearch" "Serverless Observability" "Serverless Security") + +EXIT_CODE=0 + +for TEST_NAME in "${ORDER[@]}"; do + RUN_MODE="${TESTS[$TEST_NAME]}" + echo "--- $TEST_NAME: 'discover_enhanced' plugin UI Tests" + if ! node scripts/scout run-tests "$RUN_MODE" --config "$TEST_CONFIG" --kibana-install-dir "$KIBANA_DIR"; then + echo "$TEST_NAME: failed" + EXIT_CODE=1 + else + echo "$TEST_NAME: passed" + fi +done + +exit $EXIT_CODE diff --git a/.buildkite/scripts/steps/functional/synthetics.sh b/.buildkite/scripts/steps/functional/synthetics.sh index aa388096fc40..261b1d5bf28b 100644 --- a/.buildkite/scripts/steps/functional/synthetics.sh +++ b/.buildkite/scripts/steps/functional/synthetics.sh @@ -14,4 +14,4 @@ echo "--- synthetics @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*" +node solutions/observability/plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --grep "MonitorManagement-monitor*" diff --git a/.buildkite/scripts/steps/functional/synthetics_plugin.sh b/.buildkite/scripts/steps/functional/synthetics_plugin.sh index 3e31b92011ad..34be251cbfc2 100755 --- a/.buildkite/scripts/steps/functional/synthetics_plugin.sh +++ b/.buildkite/scripts/steps/functional/synthetics_plugin.sh @@ -14,4 +14,4 @@ echo "--- Synthetics plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node solutions/observability/plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/uptime_plugin.sh b/.buildkite/scripts/steps/functional/uptime_plugin.sh index b4cdd0fb5738..50cf33149b85 100755 --- a/.buildkite/scripts/steps/functional/uptime_plugin.sh +++ b/.buildkite/scripts/steps/functional/uptime_plugin.sh @@ -14,4 +14,4 @@ echo "--- Uptime plugin @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node solutions/observability/plugins/uptime/scripts/uptime_e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh b/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh index bcc5b7114960..2c165d7274e3 100755 --- a/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh +++ b/.buildkite/scripts/steps/functional/ux_synthetics_e2e.sh @@ -14,4 +14,4 @@ echo "--- User Experience @elastic/synthetics Tests" cd "$XPACK_DIR" -node plugins/observability_solution/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +node solutions/observability/plugins/ux/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/storybooks/build_and_upload.ts b/.buildkite/scripts/steps/storybooks/build_and_upload.ts index b1135490a202..52aaa7e087a0 100644 --- a/.buildkite/scripts/steps/storybooks/build_and_upload.ts +++ b/.buildkite/scripts/steps/storybooks/build_and_upload.ts @@ -26,7 +26,6 @@ const STORYBOOKS = [ 'dashboard_enhanced', 'dashboard', 'data', - 'embeddable', 'esql_editor', 'expression_error', 'expression_image', diff --git a/.eslintrc.js b/.eslintrc.js index 0fe79513a994..9f1b14e4a5d1 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -915,10 +915,11 @@ module.exports = { { files: [ 'x-pack/plugins/observability_solution/apm/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/observability_solution/observability/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/observability_solution/exploratory_view/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/observability_solution/ux/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/observability/plugins/observability/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/observability/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/observability/plugins/ux/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/observability_solution/slo/**/*.{js,mjs,ts,tsx}', + 'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}', ], rules: { 'no-console': ['warn', { allow: ['error'] }], @@ -935,9 +936,10 @@ module.exports = { { files: [ 'x-pack/plugins/observability_solution/apm/**/*.stories.*', - 'x-pack/plugins/observability_solution/observability/**/*.stories.*', - 'x-pack/plugins/observability_solution/exploratory_view/**/*.stories.*', + 'x-pack/solutions/observability/plugins/observability/**/*.stories.*', + 'x-pack/solutions/observability/plugins/exploratory_view/**/*.stories.*', 'x-pack/plugins/observability_solution/slo/**/*.stories.*', + 'x-pack/packages/observability/**/*.{js,mjs,ts,tsx}', ], rules: { 'react/function-component-definition': [ @@ -1011,7 +1013,7 @@ module.exports = { { // disable imports from legacy uptime plugin files: [ - 'x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/**/*.{js,mjs,ts,tsx}', ], rules: { 'no-restricted-imports': [ @@ -1100,15 +1102,15 @@ module.exports = { 'x-pack/plugins/elastic_assistant/common/**/*.{js,mjs,ts,tsx}', 'x-pack/packages/kbn-elastic-assistant/**/*.{js,mjs,ts,tsx}', 'x-pack/packages/kbn-elastic-assistant-common/**/*.{js,mjs,ts,tsx}', - 'x-pack/packages/security-solution/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/packages/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution/public/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_ess/public/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_serverless/public/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution/common/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_ess/common/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_serverless/common/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/timelines/public/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/timelines/common/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/public/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/common/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/public/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/common/**/*.{js,mjs,ts,tsx}', 'packages/kbn-cell-actions/**/*.{js,mjs,ts,tsx}', @@ -1138,11 +1140,11 @@ module.exports = { 'x-pack/packages/kbn-elastic-assistant/**/*.{ts,tsx}', 'x-pack/packages/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/packages/kbn-langchain/**/*.{ts,tsx}', - 'x-pack/packages/security-solution/**/*.{ts,tsx}', + 'x-pack/solutions/security/packages/**/*.{ts,tsx}', 'x-pack/plugins/security_solution/**/*.{ts,tsx}', 'x-pack/plugins/security_solution_ess/**/*.{ts,tsx}', 'x-pack/plugins/security_solution_serverless/**/*.{ts,tsx}', - 'x-pack/plugins/timelines/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/**/*.{ts,tsx}', 'x-pack/plugins/cases/**/*.{ts,tsx}', 'packages/kbn-cell-actions/**/*.{js,mjs,ts,tsx}', ], @@ -1153,11 +1155,11 @@ module.exports = { 'x-pack/packages/kbn-elastic-assistant/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/packages/kbn-elastic-assistant-common/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/packages/kbn-langchain/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/packages/security-solution/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/solutions/security/packages/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/plugins/security_solution/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/plugins/security_solution_ess/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/plugins/security_solution_serverless/**/*.{test,mock,test_helper}.{ts,tsx}', - 'x-pack/plugins/timelines/**/*.{test,mock,test_helper}.{ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/**/*.{test,mock,test_helper}.{ts,tsx}', 'x-pack/plugins/cases/**/*.{test,mock,test_helper}.{ts,tsx}', 'packages/kbn-cell-actions/**/*.{test,mock,test_helper}.{ts,tsx}', ], @@ -1174,11 +1176,11 @@ module.exports = { 'x-pack/packages/kbn-elastic-assistant/**/*.{ts,tsx}', 'x-pack/packages/kbn-elastic-assistant-common/**/*.{ts,tsx}', 'x-pack/packages/kbn-langchain/**/*.{ts,tsx}', - 'x-pack/packages/security-solution/**/*.{ts,tsx}', + 'x-pack/solutions/security/packages/**/*.{ts,tsx}', 'x-pack/plugins/security_solution/**/*.{ts,tsx}', 'x-pack/plugins/security_solution_ess/**/*.{ts,tsx}', 'x-pack/plugins/security_solution_serverless/**/*.{ts,tsx}', - 'x-pack/plugins/timelines/**/*.{ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/**/*.{ts,tsx}', 'x-pack/plugins/cases/**/*.{ts,tsx}', 'packages/kbn-cell-actions/**/*.{ts,tsx}', ], @@ -1208,13 +1210,13 @@ module.exports = { 'x-pack/packages/kbn-elastic-assistant/**/*.{js,mjs,ts,tsx}', 'x-pack/packages/kbn-elastic-assistant-common/**/*.{js,mjs,ts,tsx}', 'x-pack/packages/kbn-langchain/**/*.{js,mjs,ts,tsx}', - 'x-pack/packages/security-solution/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/packages/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', - 'x-pack/plugins/timelines/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/plugins/timelines/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/**/*.{js,mjs,ts,tsx}', - 'packages/kbn-data-stream-adapter/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/packages/data-stream-adapter/**/*.{js,mjs,ts,tsx}', 'packages/kbn-cell-actions/**/*.{js,mjs,ts,tsx}', ], plugins: ['eslint-plugin-node', 'react'], @@ -1307,14 +1309,14 @@ module.exports = { overrides: [ { files: [ - 'x-pack/packages/security-solution/features/**/*.{js,mjs,ts,tsx}', - 'x-pack/packages/security-solution/navigation/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/packages/features/**/*.{js,mjs,ts,tsx}', + 'x-pack/solutions/security/packages/navigation/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_ess/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/security_solution_serverless/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/cases/**/*.{js,mjs,ts,tsx}', 'x-pack/plugins/ecs_data_quality_dashboard/**/*.{js,mjs,ts,tsx}', - 'x-pack/packages/kbn-data-stream-adapter/**/*.{js,mjs,ts,tsx}', + 'x-pack/x-pack/solutions/security/packages/data-stream-adapter/**/*.{js,mjs,ts,tsx}', 'packages/kbn-cell-actions/**/*.{js,mjs,ts,tsx}', ], rules: { diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4e1cb694a66c..25eb595f45da 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -265,7 +265,6 @@ packages/deeplinks/analytics @elastic/kibana-data-discovery @elastic/kibana-pres packages/deeplinks/devtools @elastic/kibana-management packages/deeplinks/fleet @elastic/fleet packages/deeplinks/management @elastic/kibana-management -packages/deeplinks/observability @elastic/obs-ux-management-team packages/deeplinks/search @elastic/search-kibana packages/deeplinks/security @elastic/security-solution packages/deeplinks/shared @elastic/appex-sharedux @@ -324,7 +323,6 @@ packages/kbn-custom-icons @elastic/obs-ux-logs-team packages/kbn-custom-integrations @elastic/obs-ux-logs-team packages/kbn-cypress-config @elastic/kibana-operations packages/kbn-data-service @elastic/kibana-visualizations @elastic/kibana-data-discovery -packages/kbn-data-stream-adapter @elastic/security-threat-hunting packages/kbn-data-view-utils @elastic/kibana-data-discovery packages/kbn-datemath @elastic/kibana-data-discovery packages/kbn-dependency-ownership @elastic/kibana-security @@ -352,7 +350,6 @@ packages/kbn-eslint-plugin-imports @elastic/kibana-operations packages/kbn-eslint-plugin-telemetry @elastic/obs-knowledge-team packages/kbn-event-annotation-common @elastic/kibana-visualizations packages/kbn-event-annotation-components @elastic/kibana-visualizations -packages/kbn-expandable-flyout @elastic/security-threat-hunting-investigations packages/kbn-expect @elastic/kibana-operations @elastic/appex-qa packages/kbn-failed-test-reporter-cli @elastic/kibana-operations @elastic/appex-qa packages/kbn-field-types @elastic/kibana-data-discovery @@ -378,9 +375,7 @@ packages/kbn-i18n @elastic/kibana-core packages/kbn-i18n-react @elastic/kibana-core packages/kbn-import-locator @elastic/kibana-operations packages/kbn-import-resolver @elastic/kibana-operations -packages/kbn-index-adapter @elastic/security-threat-hunting packages/kbn-interpreter @elastic/kibana-visualizations -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-item-buffer @elastic/appex-sharedux @@ -421,6 +416,7 @@ packages/kbn-openapi-common @elastic/security-detection-rule-management packages/kbn-openapi-generator @elastic/security-detection-rule-management packages/kbn-optimizer @elastic/kibana-operations packages/kbn-optimizer-webpack-helpers @elastic/kibana-operations +packages/kbn-palettes @elastic/kibana-visualizations packages/kbn-panel-loader @elastic/kibana-presentation packages/kbn-peggy @elastic/kibana-operations packages/kbn-peggy-loader @elastic/kibana-operations @@ -434,6 +430,7 @@ packages/kbn-react-field @elastic/kibana-data-discovery packages/kbn-react-hooks @elastic/obs-ux-logs-team packages/kbn-react-mute-legacy-root-warning @elastic/appex-sharedux packages/kbn-recently-accessed @elastic/appex-sharedux +packages/kbn-relocate @elastic/kibana-core packages/kbn-repo-file-maps @elastic/kibana-operations packages/kbn-repo-info @elastic/kibana-operations packages/kbn-repo-linter @elastic/kibana-operations @@ -621,15 +618,16 @@ src/platform/packages/private/default-nav/ml @elastic/ml-ui src/platform/packages/private/kbn-esql-editor @elastic/kibana-esql src/platform/packages/private/kbn-language-documentation @elastic/kibana-esql src/platform/packages/shared/deeplinks/ml @elastic/ml-ui +src/platform/packages/shared/deeplinks/observability @elastic/obs-ux-management-team src/platform/packages/shared/kbn-doc-links @elastic/docs src/platform/packages/shared/kbn-esql-ast @elastic/kibana-esql src/platform/packages/shared/kbn-esql-utils @elastic/kibana-esql src/platform/packages/shared/kbn-esql-validation-autocomplete @elastic/kibana-esql src/platform/packages/shared/kbn-osquery-io-ts-types @elastic/security-asset-management +src/platform/plugins/shared/ai_assistant_management/selection @elastic/obs-ai-assistant src/platform/plugins/shared/esql @elastic/kibana-esql src/platform/plugins/shared/esql_datagrid @elastic/kibana-esql src/plugins/advanced_settings @elastic/appex-sharedux @elastic/kibana-management -src/plugins/ai_assistant_management/selection @elastic/obs-ai-assistant src/plugins/bfetch @elastic/appex-sharedux src/plugins/chart_expressions/common @elastic/kibana-visualizations src/plugins/chart_expressions/expression_gauge @elastic/kibana-visualizations @@ -786,34 +784,18 @@ x-pack/packages/kbn-alerting-state-types @elastic/response-ops x-pack/packages/kbn-cloud-security-posture/common @elastic/kibana-cloud-security-posture x-pack/packages/kbn-cloud-security-posture/graph @elastic/kibana-cloud-security-posture x-pack/packages/kbn-cloud-security-posture/public @elastic/kibana-cloud-security-posture -x-pack/packages/kbn-data-forge @elastic/obs-ux-management-team x-pack/packages/kbn-elastic-assistant @elastic/security-generative-ai x-pack/packages/kbn-elastic-assistant-common @elastic/security-generative-ai -x-pack/packages/kbn-infra-forge @elastic/obs-ux-management-team x-pack/packages/kbn-langchain @elastic/security-generative-ai x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations -x-pack/packages/kbn-slo-schema @elastic/obs-ux-management-team x-pack/packages/kbn-synthetics-private-location @elastic/obs-ux-management-team x-pack/packages/maps/vector_tile_utils @elastic/kibana-presentation -x-pack/packages/observability/alert_details @elastic/obs-ux-management-team -x-pack/packages/observability/alerting_rule_utils @elastic/obs-ux-management-team -x-pack/packages/observability/alerting_test_data @elastic/obs-ux-management-team -x-pack/packages/observability/get_padded_alert_time_range_util @elastic/obs-ux-management-team x-pack/packages/observability/logs_overview @elastic/obs-ux-logs-team x-pack/packages/observability/observability_utils/observability_utils_browser @elastic/observability-ui x-pack/packages/observability/observability_utils/observability_utils_common @elastic/observability-ui x-pack/packages/observability/observability_utils/observability_utils_server @elastic/observability-ui -x-pack/packages/observability/synthetics_test_data @elastic/obs-ux-management-team x-pack/packages/rollup @elastic/kibana-management x-pack/packages/search/shared_ui @elastic/search-kibana -x-pack/packages/security-solution/data_table @elastic/security-threat-hunting-investigations -x-pack/packages/security-solution/distribution_bar @elastic/kibana-cloud-security-posture -x-pack/packages/security-solution/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore -x-pack/packages/security-solution/features @elastic/security-threat-hunting-explore -x-pack/packages/security-solution/navigation @elastic/security-threat-hunting-explore -x-pack/packages/security-solution/side_nav @elastic/security-threat-hunting-explore -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/packages/security/api_key_management @elastic/kibana-security x-pack/packages/security/authorization_core @elastic/kibana-security x-pack/packages/security/authorization_core_common @elastic/kibana-security @@ -824,6 +806,7 @@ x-pack/packages/security/plugin_types_server @elastic/kibana-security x-pack/packages/security/role_management_model @elastic/kibana-security x-pack/packages/security/ui_components @elastic/kibana-security x-pack/performance @elastic/appex-qa +x-pack/platform/packages/private/kbn-infra-forge @elastic/obs-ux-management-team x-pack/platform/packages/private/ml/agg_utils @elastic/ml-ui x-pack/platform/packages/private/ml/aiops_change_point_detection @elastic/ml-ui x-pack/platform/packages/private/ml/aiops_components @elastic/ml-ui @@ -856,7 +839,9 @@ x-pack/platform/packages/private/ml/url_state @elastic/ml-ui x-pack/platform/packages/private/ml/validators @elastic/ml-ui x-pack/platform/packages/shared/ai-infra/inference-common @elastic/appex-ai-infra x-pack/platform/packages/shared/ai-infra/product-doc-common @elastic/appex-ai-infra +x-pack/platform/packages/shared/kbn-data-forge @elastic/obs-ux-management-team x-pack/platform/packages/shared/kbn-entities-schema @elastic/obs-entities +x-pack/platform/packages/shared/kbn-slo-schema @elastic/obs-ux-management-team x-pack/platform/packages/shared/ml/aiops_common @elastic/ml-ui x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis @elastic/ml-ui x-pack/platform/packages/shared/ml/aiops_log_rate_analysis @elastic/ml-ui @@ -867,6 +852,8 @@ x-pack/platform/packages/shared/ml/random_sampler_utils @elastic/ml-ui x-pack/platform/packages/shared/ml/response_stream @elastic/ml-ui x-pack/platform/packages/shared/ml/runtime_field_utils @elastic/ml-ui x-pack/platform/packages/shared/ml/trained_models_utils @elastic/ml-ui +x-pack/platform/packages/shared/observability/alerting_rule_utils @elastic/obs-ux-management-team +x-pack/platform/plugins/private/data_usage @elastic/obs-ai-assistant @elastic/security-solution x-pack/platform/plugins/private/data_visualizer @elastic/ml-ui x-pack/platform/plugins/private/transform @elastic/ml-ui x-pack/platform/plugins/private/translations @elastic/kibana-localization @@ -876,6 +863,7 @@ x-pack/platform/plugins/shared/aiops @elastic/ml-ui x-pack/platform/plugins/shared/entity_manager @elastic/obs-entities x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra x-pack/platform/plugins/shared/ml @elastic/ml-ui +x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant x-pack/plugins/actions @elastic/response-ops x-pack/plugins/alerting @elastic/response-ops x-pack/plugins/asset_inventory @elastic/kibana-cloud-security-posture @@ -894,7 +882,6 @@ x-pack/plugins/cross_cluster_replication @elastic/kibana-management x-pack/plugins/custom_branding @elastic/appex-sharedux x-pack/plugins/dashboard_enhanced @elastic/kibana-presentation x-pack/plugins/data_quality @elastic/obs-ux-logs-team -x-pack/plugins/data_usage @elastic/obs-ai-assistant @elastic/security-solution x-pack/plugins/discover_enhanced @elastic/kibana-data-discovery x-pack/plugins/drilldowns/url_drilldown @elastic/appex-sharedux x-pack/plugins/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore @@ -931,31 +918,20 @@ x-pack/plugins/observability_solution/apm @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/apm_data_access @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/apm/ftr_e2e @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/dataset_quality @elastic/obs-ux-logs-team -x-pack/plugins/observability_solution/exploratory_view @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/observability_solution/inventory @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/inventory/e2e @elastic/obs-ux-infra_services-team -x-pack/plugins/observability_solution/investigate @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/investigate_app @elastic/obs-ux-management-team x-pack/plugins/observability_solution/logs_data_access @elastic/obs-ux-logs-team x-pack/plugins/observability_solution/logs_explorer @elastic/obs-ux-logs-team x-pack/plugins/observability_solution/logs_shared @elastic/obs-ux-logs-team x-pack/plugins/observability_solution/metrics_data_access @elastic/obs-ux-infra_services-team -x-pack/plugins/observability_solution/observability @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant -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_logs_explorer @elastic/obs-ux-logs-team -x-pack/plugins/observability_solution/observability_onboarding @elastic/obs-ux-logs-team @elastic/obs-ux-onboarding-team -x-pack/plugins/observability_solution/observability_onboarding/e2e @elastic/obs-ux-logs-team @elastic/obs-ux-onboarding-team +x-pack/plugins/observability_solution/observability_onboarding @elastic/obs-ux-logs-team +x-pack/plugins/observability_solution/observability_onboarding/e2e @elastic/obs-ux-logs-team x-pack/plugins/observability_solution/observability_shared @elastic/observability-ui x-pack/plugins/observability_solution/profiling @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/profiling_data_access @elastic/obs-ux-infra_services-team x-pack/plugins/observability_solution/slo @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/synthetics @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/synthetics/e2e @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/uptime @elastic/obs-ux-management-team -x-pack/plugins/observability_solution/ux @elastic/obs-ux-infra_services-team x-pack/plugins/osquery @elastic/security-defend-workflows x-pack/plugins/painless_lab @elastic/kibana-management x-pack/plugins/remote_clusters @elastic/kibana-management @@ -979,24 +955,52 @@ x-pack/plugins/security_solution @elastic/security-solution x-pack/plugins/security_solution_ess @elastic/security-solution x-pack/plugins/security_solution_serverless @elastic/security-solution x-pack/plugins/serverless @elastic/appex-sharedux -x-pack/plugins/serverless_observability @elastic/obs-ux-management-team x-pack/plugins/serverless_search @elastic/search-kibana x-pack/plugins/session_view @elastic/kibana-cloud-security-posture x-pack/plugins/snapshot_restore @elastic/kibana-management x-pack/plugins/spaces @elastic/kibana-security x-pack/plugins/stack_alerts @elastic/response-ops x-pack/plugins/stack_connectors @elastic/response-ops -x-pack/plugins/streams @elastic/streams-program-team -x-pack/plugins/streams_app @elastic/streams-program-team x-pack/plugins/task_manager @elastic/response-ops x-pack/plugins/telemetry_collection_xpack @elastic/kibana-core -x-pack/plugins/threat_intelligence @elastic/security-threat-hunting-investigations -x-pack/plugins/timelines @elastic/security-threat-hunting-investigations x-pack/plugins/triggers_actions_ui @elastic/response-ops x-pack/plugins/upgrade_assistant @elastic/kibana-management x-pack/plugins/watcher @elastic/kibana-management +x-pack/solutions/observability/packages/alert_details @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/alerting_test_data @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/get_padded_alert_time_range_util @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/kbn-investigation-shared @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/observability_ai/observability_ai_common @elastic/obs-ai-assistant +x-pack/solutions/observability/packages/observability_ai/observability_ai_server @elastic/obs-ai-assistant +x-pack/solutions/observability/packages/synthetics_test_data @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/exploratory_view @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/investigate @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/investigate_app @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/observability @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/observability_ai_assistant_app @elastic/obs-ai-assistant +x-pack/solutions/observability/plugins/observability_ai_assistant_management @elastic/obs-ai-assistant x-pack/solutions/observability/plugins/observability_solution/entities_data_access @elastic/obs-entities x-pack/solutions/observability/plugins/observability_solution/entity_manager_app @elastic/obs-entities +x-pack/solutions/observability/plugins/serverless_observability @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/streams @elastic/streams-program-team +x-pack/solutions/observability/plugins/streams_app @elastic/streams-program-team +x-pack/solutions/observability/plugins/synthetics @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/synthetics/e2e @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/uptime @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/ux @elastic/obs-ux-management-team +x-pack/solutions/security/packages/data_table @elastic/security-threat-hunting-investigations +x-pack/solutions/security/packages/data-stream-adapter @elastic/security-threat-hunting +x-pack/solutions/security/packages/distribution_bar @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/expandable-flyout @elastic/security-threat-hunting-investigations +x-pack/solutions/security/packages/features @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/index-adapter @elastic/security-threat-hunting +x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/side_nav @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/storybook/config @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/upselling @elastic/security-threat-hunting-explore +x-pack/solutions/security/plugins/threat_intelligence @elastic/security-threat-hunting-investigations +x-pack/solutions/security/plugins/timelines @elastic/security-threat-hunting-investigations x-pack/test x-pack/test_serverless x-pack/test/alerting_api_integration/common/plugins/aad @elastic/response-ops @@ -1142,6 +1146,8 @@ x-pack/test_serverless/api_integration/test_suites/common/platform_security @ela /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 +# TODO: this deprecation_logs folder should be owned by kibana management team after 9.0 +src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs @elastic/kibana-data-discovery @elastic/kibana-core src/plugins/discover/public/context_awareness/profile_providers/observability @elastic/kibana-data-discovery @elastic/obs-ux-logs-team # Platform Docs @@ -1352,6 +1358,9 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql /x-pack/test/api_integration/deployment_agnostic/apis/observability/slo/ @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/api_integration/deployment_agnostic/apis/observability/synthetics/ @elastic/obs-ux-management-team +/x-pack/test/api_integration/deployment_agnostic/services/synthetics_monitors @elastic/obs-ux-management-team +/x-pack/test/api_integration/deployment_agnostic/services/synthetics_private_location @elastic/obs-ux-management-team # Elastic Stack Monitoring /x-pack/test/monitoring_api_integration @elastic/stack-monitoring @@ -1840,7 +1849,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib # Kibana Localization /src/dev/i18n_tools/ @elastic/kibana-localization @elastic/kibana-core /src/core/public/i18n/ @elastic/kibana-localization @elastic/kibana-core -#CC# /x-pack/plugins/translations/ @elastic/kibana-localization @elastic/kibana-core +#CC# /x-pack/platform/plugins/private/translations/ @elastic/kibana-localization @elastic/kibana-core # Kibana Platform Security # security @@ -2013,7 +2022,7 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints /x-pack/test/stack_functional_integration/apps/ccs @elastic/kibana-management /x-pack/test/functional/services/data_stream.ts @elastic/kibana-management /x-pack/test/functional/page_objects/watcher_page.ts @elastic/kibana-management -/x-pack/test/functional/page_objects/upgrade_assistant_page.ts @elastic/kibana-management +/x-pack/test/functional/page_objects/upgrade_assistant_page.ts @elastic/kibana-core /x-pack/test/functional/page_objects/snapshot_restore_page.ts @elastic/kibana-management /x-pack/test/functional/page_objects/rollup_page.ts @elastic/kibana-management /x-pack/test/functional/page_objects/ingest_pipelines_page.ts @elastic/kibana-management @@ -2036,7 +2045,7 @@ x-pack/test/api_integration/apis/management/index_management/inference_endpoints /x-pack/test/functional/apps/upgrade_assistant @elastic/kibana-core /x-pack/test/functional/apps/dev_tools @elastic/kibana-management /test/plugin_functional/test_suites/management @elastic/kibana-management -/x-pack/test/upgrade_assistant_integration @elastic/kibana-management +/x-pack/test/upgrade_assistant_integration @elastic/kibana-core /test/plugin_functional/plugins/management_test_plugin @elastic/kibana-management /test/functional/page_objects/management/*.ts @elastic/kibana-management /test/functional/page_objects/embedded_console.ts @elastic/kibana-management @@ -2122,6 +2131,7 @@ x-pack/test_serverless/functional/test_suites/security/index.mki_only.ts @elasti /x-pack/test/functional/es_archives/auditbeat/default @elastic/security-solution /x-pack/test/functional/es_archives/auditbeat/hosts @elastic/security-solution /x-pack/test_serverless/functional/page_objects/svl_management_page.ts @elastic/security-solution +/x-pack/test_serverless/functional/page_objects/svl_data_usage.ts @elastic/security-solution @elastic/obs-ai-assistant /x-pack/test_serverless/api_integration/test_suites/security @elastic/security-solution /x-pack/test_serverless/functional/test_suites/security/index.feature_flags.ts @elastic/security-solution @@ -2484,7 +2494,7 @@ x-pack/test/automatic_import_api_integration @elastic/security-scalability ## Packages x-pack/packages/kbn-cloud-security-posture @elastic/kibana-cloud-security-posture -x-pack/packages/security-solution/distribution_bar @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/distribution_bar @elastic/kibana-cloud-security-posture ## Plugins x-pack/plugins/cloud_defend @elastic/kibana-cloud-security-posture x-pack/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture @@ -2560,7 +2570,7 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur /src/plugins/home/public/application/components/guided_onboarding @elastic/appex-sharedux # Changes to translation files should not ping code reviewers -x-pack/plugins/translations/translations +x-pack/platform/plugins/private/translations/translations # Profiling api integration testing x-pack/test/profiling_api_integration @elastic/obs-ux-infra_services-team @@ -2647,6 +2657,735 @@ x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics /.github/workflows/oblt-github-commands @elastic/observablt-robots @elastic/kibana-operations /.github/workflows/undeploy-my-kibana.yml @elastic/observablt-robots @elastic/kibana-operations +# Sustainable kibana - Temporary placeholder for new folders +# To be removed as folders are moved into their new home. +# see https://github.com/elastic/kibana/pull/203682 + +src/core/packages/analytics/browser @elastic/kibana-core +src/core/packages/analytics/browser-internal @elastic/kibana-core +src/core/packages/analytics/server @elastic/kibana-core +src/core/packages/analytics/server-internal @elastic/kibana-core +src/core/packages/application/browser @elastic/kibana-core +src/core/packages/application/browser-internal @elastic/kibana-core +src/core/packages/application/common @elastic/kibana-core +src/core/packages/apps/browser-internal @elastic/kibana-core +src/core/packages/apps/server-internal @elastic/kibana-core +src/core/packages/base/browser-internal @elastic/kibana-core +src/core/packages/base/common @elastic/kibana-core +src/core/packages/base/common-internal @elastic/kibana-core +src/core/packages/base/server-internal @elastic/kibana-core +src/core/packages/capabilities/browser-internal @elastic/kibana-core +src/core/packages/capabilities/common @elastic/kibana-core +src/core/packages/capabilities/server @elastic/kibana-core +src/core/packages/capabilities/server-internal @elastic/kibana-core +src/core/packages/chrome/browser @elastic/appex-sharedux +src/core/packages/chrome/browser-internal @elastic/appex-sharedux +src/core/packages/config/server-internal @elastic/kibana-core +src/core/packages/custom-branding/browser @elastic/appex-sharedux +src/core/packages/custom-branding/browser-internal @elastic/appex-sharedux +src/core/packages/custom-branding/browser-mocks @elastic/appex-sharedux +src/core/packages/custom-branding/common @elastic/appex-sharedux +src/core/packages/custom-branding/server @elastic/appex-sharedux +src/core/packages/custom-branding/server-internal @elastic/appex-sharedux +src/core/packages/custom-branding/server-mocks @elastic/appex-sharedux +src/core/packages/deprecations/browser @elastic/kibana-core +src/core/packages/deprecations/browser-internal @elastic/kibana-core +src/core/packages/deprecations/common @elastic/kibana-core +src/core/packages/deprecations/server @elastic/kibana-core +src/core/packages/deprecations/server-internal @elastic/kibana-core +src/core/packages/doc-links/browser @elastic/kibana-core +src/core/packages/doc-links/browser-internal @elastic/kibana-core +src/core/packages/doc-links/server @elastic/kibana-core +src/core/packages/doc-links/server-internal @elastic/kibana-core +src/core/packages/elasticsearch/client-server-internal @elastic/kibana-core +src/core/packages/elasticsearch/server @elastic/kibana-core +src/core/packages/elasticsearch/server-internal @elastic/kibana-core +src/core/packages/environment/server-internal @elastic/kibana-core +src/core/packages/execution-context/browser @elastic/kibana-core +src/core/packages/execution-context/browser-internal @elastic/kibana-core +src/core/packages/execution-context/common @elastic/kibana-core +src/core/packages/execution-context/server @elastic/kibana-core +src/core/packages/execution-context/server-internal @elastic/kibana-core +src/core/packages/fatal-errors/browser @elastic/kibana-core +src/core/packages/fatal-errors/browser-internal @elastic/kibana-core +src/core/packages/feature-flags/browser @elastic/kibana-core +src/core/packages/feature-flags/browser-internal @elastic/kibana-core +src/core/packages/feature-flags/browser-mocks @elastic/kibana-core +src/core/packages/feature-flags/server @elastic/kibana-core +src/core/packages/feature-flags/server-internal @elastic/kibana-core +src/core/packages/feature-flags/server-mocks @elastic/kibana-core +src/core/packages/http/browser @elastic/kibana-core +src/core/packages/http/browser-internal @elastic/kibana-core +src/core/packages/http/common @elastic/kibana-core +src/core/packages/http/context-server-internal @elastic/kibana-core +src/core/packages/http/request-handler-context-server @elastic/kibana-core +src/core/packages/http/request-handler-context-server-internal @elastic/kibana-core +src/core/packages/http/resources-server @elastic/kibana-core +src/core/packages/http/resources-server-internal @elastic/kibana-core +src/core/packages/http/router-server-internal @elastic/kibana-core +src/core/packages/http/server @elastic/kibana-core +src/core/packages/http/server-internal @elastic/kibana-core +src/core/packages/http/server-utils @elastic/kibana-core +src/core/packages/i18n/browser @elastic/kibana-core +src/core/packages/i18n/browser-internal @elastic/kibana-core +src/core/packages/i18n/server @elastic/kibana-core +src/core/packages/i18n/server-internal @elastic/kibana-core +src/core/packages/injected-metadata/browser-internal @elastic/kibana-core +src/core/packages/injected-metadata/common-internal @elastic/kibana-core +src/core/packages/integrations/browser-internal @elastic/kibana-core +src/core/packages/lifecycle/browser @elastic/kibana-core +src/core/packages/lifecycle/browser-internal @elastic/kibana-core +src/core/packages/lifecycle/server @elastic/kibana-core +src/core/packages/lifecycle/server-internal @elastic/kibana-core +src/core/packages/logging/browser-internal @elastic/kibana-core +src/core/packages/logging/common-internal @elastic/kibana-core +src/core/packages/logging/server @elastic/kibana-core +src/core/packages/logging/server-internal @elastic/kibana-core +src/core/packages/metrics/collectors-server-internal @elastic/kibana-core +src/core/packages/metrics/server @elastic/kibana-core +src/core/packages/metrics/server-internal @elastic/kibana-core +src/core/packages/mount-utils/browser @elastic/kibana-core +src/core/packages/mount-utils/browser-internal @elastic/kibana-core +src/core/packages/node/server @elastic/kibana-core +src/core/packages/node/server-internal @elastic/kibana-core +src/core/packages/notifications/browser @elastic/kibana-core +src/core/packages/notifications/browser-internal @elastic/kibana-core +src/core/packages/overlays/browser @elastic/kibana-core +src/core/packages/overlays/browser-internal @elastic/kibana-core +src/core/packages/plugins/base-server-internal @elastic/kibana-core +src/core/packages/plugins/browser @elastic/kibana-core +src/core/packages/plugins/browser-internal @elastic/kibana-core +src/core/packages/plugins/contracts-browser @elastic/kibana-core +src/core/packages/plugins/contracts-server @elastic/kibana-core +src/core/packages/plugins/server @elastic/kibana-core +src/core/packages/plugins/server-internal @elastic/kibana-core +src/core/packages/preboot/server @elastic/kibana-core +src/core/packages/preboot/server-internal @elastic/kibana-core +src/core/packages/rendering/browser @elastic/kibana-core +src/core/packages/rendering/browser-internal @elastic/kibana-core +src/core/packages/rendering/server-internal @elastic/kibana-core +src/core/packages/root/browser-internal @elastic/kibana-core +src/core/packages/root/server-internal @elastic/kibana-core +src/core/packages/saved-objects/api-browser @elastic/kibana-core +src/core/packages/saved-objects/api-server @elastic/kibana-core +src/core/packages/saved-objects/api-server-internal @elastic/kibana-core +src/core/packages/saved-objects/base-server-internal @elastic/kibana-core +src/core/packages/saved-objects/browser @elastic/kibana-core +src/core/packages/saved-objects/browser-internal @elastic/kibana-core +src/core/packages/saved-objects/common @elastic/kibana-core +src/core/packages/saved-objects/import-export-server-internal @elastic/kibana-core +src/core/packages/saved-objects/migration-server-internal @elastic/kibana-core +src/core/packages/saved-objects/server @elastic/kibana-core +src/core/packages/saved-objects/server-internal @elastic/kibana-core +src/core/packages/saved-objects/utils-server @elastic/kibana-core +src/core/packages/security/browser @elastic/kibana-core +src/core/packages/security/browser-internal @elastic/kibana-core +src/core/packages/security/browser-mocks @elastic/kibana-core +src/core/packages/security/common @elastic/kibana-core @elastic/kibana-security +src/core/packages/security/server @elastic/kibana-core +src/core/packages/security/server-internal @elastic/kibana-core +src/core/packages/security/server-mocks @elastic/kibana-core +src/core/packages/status/common @elastic/kibana-core +src/core/packages/status/server @elastic/kibana-core +src/core/packages/status/server-internal @elastic/kibana-core +src/core/packages/test-helpers/deprecations-getters @elastic/kibana-core +src/core/packages/test-helpers/http-setup-browser @elastic/kibana-core +src/core/packages/test-helpers/so-type-serializer @elastic/kibana-core +src/core/packages/test-helpers/test-utils @elastic/kibana-core +src/core/packages/theme/browser @elastic/kibana-core +src/core/packages/theme/browser-internal @elastic/kibana-core +src/core/packages/ui-settings/browser @elastic/appex-sharedux +src/core/packages/ui-settings/browser-internal @elastic/appex-sharedux +src/core/packages/ui-settings/common @elastic/appex-sharedux +src/core/packages/ui-settings/server @elastic/appex-sharedux +src/core/packages/ui-settings/server-internal @elastic/appex-sharedux +src/core/packages/usage-data/base-server-internal @elastic/kibana-core +src/core/packages/usage-data/server @elastic/kibana-core +src/core/packages/usage-data/server-internal @elastic/kibana-core +src/core/packages/user-profile/browser @elastic/kibana-core +src/core/packages/user-profile/browser-internal @elastic/kibana-core +src/core/packages/user-profile/browser-mocks @elastic/kibana-core +src/core/packages/user-profile/common @elastic/kibana-core +src/core/packages/user-profile/server @elastic/kibana-core +src/core/packages/user-profile/server-internal @elastic/kibana-core +src/core/packages/user-profile/server-mocks @elastic/kibana-core +src/core/packages/user-settings/server @elastic/kibana-security +src/core/packages/user-settings/server-internal @elastic/kibana-security +src/core/packages/user-settings/server-mocks @elastic/kibana-security +src/platform/packages/private/analytics/utils/analytics_collection_utils @elastic/kibana-core +src/platform/packages/private/content-management/favorites/favorites_common @elastic/appex-sharedux +src/platform/packages/private/content-management/tabbed_table_list_view @elastic/appex-sharedux +src/platform/packages/private/default-nav/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations +src/platform/packages/private/default-nav/devtools @elastic/kibana-management +src/platform/packages/private/default-nav/management @elastic/kibana-management +src/platform/packages/private/default-nav/ml @elastic/ml-ui +src/platform/packages/private/kbn-apm-config-loader @elastic/kibana-core @vigneshshanmugam +src/platform/packages/private/kbn-config-mocks @elastic/kibana-core +src/platform/packages/private/kbn-esql-editor @elastic/kibana-esql +src/platform/packages/private/kbn-generate-csv @elastic/appex-sharedux +src/platform/packages/private/kbn-handlebars @elastic/kibana-security +src/platform/packages/private/kbn-hapi-mocks @elastic/kibana-core +src/platform/packages/private/kbn-health-gateway-server @elastic/kibana-core +src/platform/packages/private/kbn-item-buffer @elastic/appex-sharedux +src/platform/packages/private/kbn-language-documentation @elastic/kibana-esql +src/platform/packages/private/kbn-lens-formula-docs @elastic/kibana-visualizations +src/platform/packages/private/kbn-managed-content-badge @elastic/kibana-visualizations +src/platform/packages/private/kbn-management/settings/application @elastic/kibana-management +src/platform/packages/private/kbn-management/settings/components/field_category @elastic/kibana-management +src/platform/packages/private/kbn-management/settings/components/form @elastic/kibana-management +src/platform/packages/private/kbn-mapbox-gl @elastic/kibana-presentation +src/platform/packages/private/kbn-panel-loader @elastic/kibana-presentation +src/platform/packages/private/kbn-repo-packages @elastic/kibana-operations +src/platform/packages/private/kbn-reporting/common @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/csv @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/csv_common @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/pdf @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/pdf_common @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/png @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/export_types/png_common @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/get_csv_panel_actions @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/mocks_server @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/public @elastic/appex-sharedux +src/platform/packages/private/kbn-reporting/server @elastic/appex-sharedux +src/platform/packages/private/kbn-saved-objects-settings @elastic/appex-sharedux +src/platform/packages/private/kbn-screenshotting-server @elastic/appex-sharedux +src/platform/packages/private/kbn-sse-utils-server @elastic/obs-knowledge-team +src/platform/packages/private/kbn-timelion-grammar @elastic/kibana-visualizations +src/platform/packages/private/kbn-tinymath @elastic/kibana-visualizations +src/platform/packages/private/kbn-transpose-utils @elastic/kibana-visualizations +src/platform/packages/private/kbn-ui-shared-deps-npm @elastic/kibana-operations +src/platform/packages/private/kbn-ui-shared-deps-src @elastic/kibana-operations +src/platform/packages/private/kbn-unsaved-changes-badge @elastic/kibana-data-discovery +src/platform/packages/private/react/kibana_context/root @elastic/appex-sharedux +src/platform/packages/private/response-ops/rule_params @elastic/response-ops +src/platform/packages/private/serverless/project_switcher @elastic/appex-sharedux +src/platform/packages/private/serverless/settings/common @elastic/appex-sharedux @elastic/kibana-management +src/platform/packages/private/serverless/types @elastic/appex-sharedux +src/platform/packages/private/shared-ux/button/exit_full_screen @elastic/appex-sharedux +src/platform/packages/private/shared-ux/modal/tabbed @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/analytics_no_data/impl @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/analytics_no_data/mocks @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/analytics_no_data/types @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/kibana_no_data/impl @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/kibana_no_data/mocks @elastic/appex-sharedux +src/platform/packages/private/shared-ux/page/kibana_no_data/types @elastic/appex-sharedux +src/platform/packages/private/shared-ux/prompt/no_data_views/impl @elastic/appex-sharedux +src/platform/packages/private/shared-ux/prompt/no_data_views/mocks @elastic/appex-sharedux +src/platform/packages/private/shared-ux/table_persist @elastic/appex-sharedux +src/platform/packages/shared/cloud @elastic/kibana-core +src/platform/packages/shared/content-management/content_editor @elastic/appex-sharedux +src/platform/packages/shared/content-management/content_insights/content_insights_public @elastic/appex-sharedux +src/platform/packages/shared/content-management/content_insights/content_insights_server @elastic/appex-sharedux +src/platform/packages/shared/content-management/favorites/favorites_public @elastic/appex-sharedux +src/platform/packages/shared/content-management/favorites/favorites_server @elastic/appex-sharedux +src/platform/packages/shared/content-management/table_list_view @elastic/appex-sharedux +src/platform/packages/shared/content-management/table_list_view_common @elastic/appex-sharedux +src/platform/packages/shared/content-management/table_list_view_table @elastic/appex-sharedux +src/platform/packages/shared/content-management/user_profiles @elastic/appex-sharedux +src/platform/packages/shared/deeplinks/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations +src/platform/packages/shared/deeplinks/devtools @elastic/kibana-management +src/platform/packages/shared/deeplinks/fleet @elastic/fleet +src/platform/packages/shared/deeplinks/management @elastic/kibana-management +src/platform/packages/shared/deeplinks/ml @elastic/ml-ui +src/platform/packages/shared/deeplinks/observability @elastic/obs-ux-management-team +src/platform/packages/shared/deeplinks/search @elastic/search-kibana +src/platform/packages/shared/deeplinks/security @elastic/security-solution +src/platform/packages/shared/deeplinks/shared @elastic/appex-sharedux +src/platform/packages/shared/home/sample_data_card @elastic/appex-sharedux +src/platform/packages/shared/home/sample_data_tab @elastic/appex-sharedux +src/platform/packages/shared/home/sample_data_types @elastic/appex-sharedux +src/platform/packages/shared/kbn-actions-types @elastic/response-ops +src/platform/packages/shared/kbn-alerting-types @elastic/response-ops +src/platform/packages/shared/kbn-alerts-as-data-utils @elastic/response-ops +src/platform/packages/shared/kbn-alerts-ui-shared @elastic/response-ops +src/platform/packages/shared/kbn-analytics @elastic/kibana-core +src/platform/packages/shared/kbn-apm-data-view @elastic/obs-ux-infra_services-team +src/platform/packages/shared/kbn-apm-utils @elastic/obs-ux-infra_services-team +src/platform/packages/shared/kbn-avc-banner @elastic/security-defend-workflows +src/platform/packages/shared/kbn-bfetch-error @elastic/appex-sharedux +src/platform/packages/shared/kbn-calculate-width-from-char-count @elastic/kibana-visualizations +src/platform/packages/shared/kbn-cases-components @elastic/response-ops +src/platform/packages/shared/kbn-cbor @elastic/kibana-operations +src/platform/packages/shared/kbn-cell-actions @elastic/security-threat-hunting-explore +src/platform/packages/shared/kbn-chart-icons @elastic/kibana-visualizations +src/platform/packages/shared/kbn-coloring @elastic/kibana-visualizations +src/platform/packages/shared/kbn-config @elastic/kibana-core +src/platform/packages/shared/kbn-config-schema @elastic/kibana-core +src/platform/packages/shared/kbn-content-management-utils @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-crypto @elastic/kibana-security +src/platform/packages/shared/kbn-crypto-browser @elastic/kibana-core +src/platform/packages/shared/kbn-custom-icons @elastic/obs-ux-logs-team +src/platform/packages/shared/kbn-data-service @elastic/kibana-visualizations @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-data-view-utils @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-datemath @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-discover-contextual-components @elastic/obs-ux-logs-team @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-discover-utils @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-doc-links @elastic/docs +src/platform/packages/shared/kbn-dom-drag-drop @elastic/kibana-visualizations @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-ebt-tools @elastic/kibana-core +src/platform/packages/shared/kbn-elastic-agent-utils @elastic/obs-ux-logs-team +src/platform/packages/shared/kbn-es-errors @elastic/kibana-core +src/platform/packages/shared/kbn-es-query @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-es-types @elastic/kibana-core @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-esql-ast @elastic/kibana-esql +src/platform/packages/shared/kbn-esql-utils @elastic/kibana-esql +src/platform/packages/shared/kbn-esql-validation-autocomplete @elastic/kibana-esql +src/platform/packages/shared/kbn-event-annotation-common @elastic/kibana-visualizations +src/platform/packages/shared/kbn-event-annotation-components @elastic/kibana-visualizations +src/platform/packages/shared/kbn-field-types @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-field-utils @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-flot-charts @elastic/kibana-presentation @elastic/stack-monitoring +src/platform/packages/shared/kbn-grouping @elastic/response-ops +src/platform/packages/shared/kbn-guided-onboarding @elastic/appex-sharedux +src/platform/packages/shared/kbn-i18n @elastic/kibana-core +src/platform/packages/shared/kbn-i18n-react @elastic/kibana-core +src/platform/packages/shared/kbn-interpreter @elastic/kibana-visualizations +src/platform/packages/shared/kbn-io-ts-utils @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-lens-embeddable-utils @elastic/obs-ux-infra_services-team @elastic/kibana-visualizations +src/platform/packages/shared/kbn-logging @elastic/kibana-core +src/platform/packages/shared/kbn-logging-mocks @elastic/kibana-core +src/platform/packages/shared/kbn-management/cards_navigation @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/components/field_input @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/components/field_row @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/field_definition @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/section_registry @elastic/appex-sharedux @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/setting_ids @elastic/appex-sharedux @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/types @elastic/kibana-management +src/platform/packages/shared/kbn-management/settings/utilities @elastic/kibana-management +src/platform/packages/shared/kbn-monaco @elastic/appex-sharedux +src/platform/packages/shared/kbn-object-versioning @elastic/appex-sharedux +src/platform/packages/shared/kbn-object-versioning-utils @elastic/appex-sharedux +src/platform/packages/shared/kbn-openapi-common @elastic/security-detection-rule-management +src/platform/packages/shared/kbn-osquery-io-ts-types @elastic/security-asset-management +src/platform/packages/shared/kbn-profiling-utils @elastic/obs-ux-infra_services-team +src/platform/packages/shared/kbn-react-field @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-react-hooks @elastic/obs-ux-logs-team +src/platform/packages/shared/kbn-recently-accessed @elastic/appex-sharedux +src/platform/packages/shared/kbn-repo-info @elastic/kibana-operations +src/platform/packages/shared/kbn-resizable-layout @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-rison @elastic/kibana-operations +src/platform/packages/shared/kbn-router-to-openapispec @elastic/kibana-core +src/platform/packages/shared/kbn-router-utils @elastic/obs-ux-logs-team +src/platform/packages/shared/kbn-rrule @elastic/response-ops +src/platform/packages/shared/kbn-rule-data-utils @elastic/security-detections-response @elastic/response-ops @elastic/obs-ux-management-team +src/platform/packages/shared/kbn-safer-lodash-set @elastic/kibana-security +src/platform/packages/shared/kbn-search-api-panels @elastic/search-kibana +src/platform/packages/shared/kbn-search-connectors @elastic/search-kibana +src/platform/packages/shared/kbn-search-errors @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-search-response-warnings @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-search-types @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-security-hardening @elastic/kibana-security +src/platform/packages/shared/kbn-securitysolution-ecs @elastic/security-threat-hunting-explore +src/platform/packages/shared/kbn-securitysolution-es-utils @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-io-ts-types @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-io-ts-utils @elastic/security-detection-engine +src/platform/packages/shared/kbn-securitysolution-rules @elastic/security-detection-engine +src/platform/packages/shared/kbn-server-http-tools @elastic/kibana-core +src/platform/packages/shared/kbn-server-route-repository @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-server-route-repository-client @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-server-route-repository-utils @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-shared-svg @elastic/obs-ux-infra_services-team +src/platform/packages/shared/kbn-shared-ux-utility @elastic/appex-sharedux +src/platform/packages/shared/kbn-sort-predicates @elastic/kibana-visualizations +src/platform/packages/shared/kbn-sse-utils @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-sse-utils-client @elastic/obs-knowledge-team +src/platform/packages/shared/kbn-std @elastic/kibana-core +src/platform/packages/shared/kbn-triggers-actions-ui-types @elastic/response-ops +src/platform/packages/shared/kbn-try-in-console @elastic/search-kibana +src/platform/packages/shared/kbn-typed-react-router-config @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team +src/platform/packages/shared/kbn-ui-actions-browser @elastic/appex-sharedux +src/platform/packages/shared/kbn-ui-theme @elastic/kibana-operations +src/platform/packages/shared/kbn-unified-data-table @elastic/kibana-data-discovery @elastic/security-threat-hunting-investigations +src/platform/packages/shared/kbn-unified-doc-viewer @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-unified-field-list @elastic/kibana-data-discovery +src/platform/packages/shared/kbn-unsaved-changes-prompt @elastic/kibana-management +src/platform/packages/shared/kbn-user-profile-components @elastic/kibana-security +src/platform/packages/shared/kbn-utility-types @elastic/kibana-core +src/platform/packages/shared/kbn-utility-types-jest @elastic/kibana-operations +src/platform/packages/shared/kbn-utils @elastic/kibana-operations +src/platform/packages/shared/kbn-visualization-ui-components @elastic/kibana-visualizations +src/platform/packages/shared/kbn-visualization-utils @elastic/kibana-visualizations +src/platform/packages/shared/kbn-zod @elastic/kibana-core +src/platform/packages/shared/kbn-zod-helpers @elastic/security-detection-rule-management +src/platform/packages/shared/presentation/presentation_containers @elastic/kibana-presentation +src/platform/packages/shared/presentation/presentation_publishing @elastic/kibana-presentation +src/platform/packages/shared/react/kibana_context/common @elastic/appex-sharedux +src/platform/packages/shared/react/kibana_context/render @elastic/appex-sharedux +src/platform/packages/shared/react/kibana_context/styled @elastic/appex-sharedux +src/platform/packages/shared/react/kibana_context/theme @elastic/appex-sharedux +src/platform/packages/shared/react/kibana_mount @elastic/appex-sharedux +src/platform/packages/shared/serverless/settings/observability_project @elastic/appex-sharedux @elastic/kibana-management @elastic/obs-ux-management-team +src/platform/packages/shared/serverless/settings/search_project @elastic/search-kibana @elastic/kibana-management +src/platform/packages/shared/serverless/settings/security_project @elastic/security-solution @elastic/kibana-management +src/platform/packages/shared/shared-ux/avatar/solution @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/button_toolbar @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/card/no_data/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/card/no_data/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/card/no_data/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/chrome/navigation @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/code_editor/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/code_editor/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/error_boundary @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/context @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/file_picker/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/file_upload/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/image/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/image/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/file/util @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/link/redirect_app/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/link/redirect_app/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/link/redirect_app/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/markdown/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/markdown/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/markdown/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/kibana_template/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/kibana_template/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/kibana_template/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data_config/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data_config/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data_config/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data/mocks @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/no_data/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/page/solution_nav @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/prompt/no_data_views/types @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/prompt/not_found @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/router/impl @elastic/appex-sharedux +src/platform/packages/shared/shared-ux/storybook/mock @elastic/appex-sharedux +src/platform/packages/shared/Users/gsoldevila/Work/kibana-secondary/Users/gsoldevila/Work/kibana-secondary/src/core @elastic/kibana-core +src/platform/packages/shared/Users/gsoldevila/Work/kibana-secondary/Users/gsoldevila/Work/kibana-secondary/src/plugins/chart_expressions/common @elastic/kibana-visualizations +src/platform/plugins/private/advanced_settings @elastic/appex-sharedux @elastic/kibana-management +src/platform/plugins/private/event_annotation @elastic/kibana-visualizations +src/platform/plugins/private/event_annotation_listing @elastic/kibana-visualizations +src/platform/plugins/private/files_management @elastic/appex-sharedux +src/platform/plugins/private/ftr_apis @elastic/kibana-core +src/platform/plugins/private/image_embeddable @elastic/appex-sharedux +src/platform/plugins/private/input_control_vis @elastic/kibana-presentation +src/platform/plugins/private/interactive_setup @elastic/kibana-security +src/platform/plugins/private/kibana_overview @elastic/appex-sharedux +src/platform/plugins/private/kibana_usage_collection @elastic/kibana-core +src/platform/plugins/private/links @elastic/kibana-presentation +src/platform/plugins/private/maps_ems @elastic/kibana-presentation +src/platform/plugins/private/no_data_page @elastic/appex-sharedux +src/platform/plugins/private/presentation_panel @elastic/kibana-presentation +src/platform/plugins/private/url_forwarding @elastic/kibana-visualizations +src/platform/plugins/private/vis_default_editor @elastic/kibana-visualizations +src/platform/plugins/private/vis_type_markdown @elastic/kibana-presentation +src/platform/plugins/private/vis_types/gauge @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/heatmap @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/metric @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/pie @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/table @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/tagcloud @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/timelion @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/vega @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/vislib @elastic/kibana-visualizations +src/platform/plugins/private/vis_types/xy @elastic/kibana-visualizations +src/platform/plugins/shared/ai_assistant_management/selection @elastic/obs-ai-assistant +src/platform/plugins/shared/bfetch @elastic/appex-sharedux +src/platform/plugins/shared/chart_expressions/expression_gauge @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_heatmap @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_legacy_metric @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_metric @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_partition_vis @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_tagcloud @elastic/kibana-visualizations +src/platform/plugins/shared/chart_expressions/expression_xy @elastic/kibana-visualizations +src/platform/plugins/shared/charts @elastic/kibana-visualizations +src/platform/plugins/shared/console @elastic/kibana-management +src/platform/plugins/shared/content_management @elastic/appex-sharedux +src/platform/plugins/shared/controls @elastic/kibana-presentation +src/platform/plugins/shared/custom_integrations @elastic/fleet +src/platform/plugins/shared/dashboard @elastic/kibana-presentation +src/platform/plugins/shared/data @elastic/kibana-visualizations @elastic/kibana-data-discovery +src/platform/plugins/shared/data_view_editor @elastic/kibana-data-discovery +src/platform/plugins/shared/data_view_field_editor @elastic/kibana-data-discovery +src/platform/plugins/shared/data_view_management @elastic/kibana-data-discovery +src/platform/plugins/shared/data_views @elastic/kibana-data-discovery +src/platform/plugins/shared/dev_tools @elastic/kibana-management +src/platform/plugins/shared/discover @elastic/kibana-data-discovery +src/platform/plugins/shared/discover_shared @elastic/kibana-data-discovery @elastic/obs-ux-logs-team +src/platform/plugins/shared/embeddable @elastic/kibana-presentation +src/platform/plugins/shared/es_ui_shared @elastic/kibana-management +src/platform/plugins/shared/esql @elastic/kibana-esql +src/platform/plugins/shared/esql_datagrid @elastic/kibana-esql +src/platform/plugins/shared/expression_error @elastic/kibana-presentation +src/platform/plugins/shared/expression_image @elastic/kibana-presentation +src/platform/plugins/shared/expression_metric @elastic/kibana-presentation +src/platform/plugins/shared/expression_repeat_image @elastic/kibana-presentation +src/platform/plugins/shared/expression_reveal_image @elastic/kibana-presentation +src/platform/plugins/shared/expression_shape @elastic/kibana-presentation +src/platform/plugins/shared/expressions @elastic/kibana-visualizations +src/platform/plugins/shared/field_formats @elastic/kibana-data-discovery +src/platform/plugins/shared/files @elastic/appex-sharedux +src/platform/plugins/shared/guided_onboarding @elastic/appex-sharedux +src/platform/plugins/shared/home @elastic/appex-sharedux +src/platform/plugins/shared/inspector @elastic/kibana-presentation +src/platform/plugins/shared/kibana_react @elastic/appex-sharedux +src/platform/plugins/shared/kibana_utils @elastic/appex-sharedux +src/platform/plugins/shared/management @elastic/kibana-management +src/platform/plugins/shared/navigation @elastic/appex-sharedux +src/platform/plugins/shared/newsfeed @elastic/kibana-core +src/platform/plugins/shared/presentation_util @elastic/kibana-presentation +src/platform/plugins/shared/saved_objects @elastic/appex-sharedux +src/platform/plugins/shared/saved_objects_finder @elastic/kibana-data-discovery +src/platform/plugins/shared/saved_objects_management @elastic/kibana-core +src/platform/plugins/shared/saved_objects_tagging_oss @elastic/appex-sharedux +src/platform/plugins/shared/saved_search @elastic/kibana-data-discovery +src/platform/plugins/shared/screenshot_mode @elastic/appex-sharedux +src/platform/plugins/shared/share @elastic/appex-sharedux +src/platform/plugins/shared/telemetry @elastic/kibana-core +src/platform/plugins/shared/telemetry_collection_manager @elastic/kibana-core +src/platform/plugins/shared/telemetry_management_section @elastic/kibana-core +src/platform/plugins/shared/ui_actions @elastic/appex-sharedux +src/platform/plugins/shared/ui_actions_enhanced @elastic/appex-sharedux +src/platform/plugins/shared/unified_doc_viewer @elastic/kibana-data-discovery +src/platform/plugins/shared/unified_histogram @elastic/kibana-data-discovery +src/platform/plugins/shared/unified_search @elastic/kibana-visualizations +src/platform/plugins/shared/usage_collection @elastic/kibana-core +src/platform/plugins/shared/vis_types/timeseries @elastic/kibana-visualizations +src/platform/plugins/shared/visualizations @elastic/kibana-visualizations +x-pack/platform/packages/private/kbn-alerting-state-types @elastic/response-ops +x-pack/platform/packages/private/kbn-infra-forge @elastic/obs-ux-management-team +x-pack/platform/packages/private/kbn-random-sampling @elastic/kibana-visualizations +x-pack/platform/packages/private/maps/vector_tile_utils @elastic/kibana-presentation +x-pack/platform/packages/private/ml/agg_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/aiops_change_point_detection @elastic/ml-ui +x-pack/platform/packages/private/ml/aiops_components @elastic/ml-ui +x-pack/platform/packages/private/ml/aiops_test_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/cancellable_search @elastic/ml-ui +x-pack/platform/packages/private/ml/category_validator @elastic/ml-ui +x-pack/platform/packages/private/ml/creation_wizard_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/data_frame_analytics_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/data_grid @elastic/ml-ui +x-pack/platform/packages/private/ml/data_view_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/date_picker @elastic/ml-ui +x-pack/platform/packages/private/ml/date_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/field_stats_flyout @elastic/ml-ui +x-pack/platform/packages/private/ml/in_memory_table @elastic/ml-ui +x-pack/platform/packages/private/ml/inference_integration_flyout @elastic/ml-ui +x-pack/platform/packages/private/ml/is_defined @elastic/ml-ui +x-pack/platform/packages/private/ml/is_populated_object @elastic/ml-ui +x-pack/platform/packages/private/ml/json_schemas @elastic/ml-ui +x-pack/platform/packages/private/ml/kibana_theme @elastic/ml-ui +x-pack/platform/packages/private/ml/local_storage @elastic/ml-ui +x-pack/platform/packages/private/ml/nested_property @elastic/ml-ui +x-pack/platform/packages/private/ml/number_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/parse_interval @elastic/ml-ui +x-pack/platform/packages/private/ml/query_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/route_utils @elastic/ml-ui +x-pack/platform/packages/private/ml/string_hash @elastic/ml-ui +x-pack/platform/packages/private/ml/time_buckets @elastic/ml-ui +x-pack/platform/packages/private/ml/ui_actions @elastic/ml-ui +x-pack/platform/packages/private/ml/url_state @elastic/ml-ui +x-pack/platform/packages/private/ml/validators @elastic/ml-ui +x-pack/platform/packages/private/rollup @elastic/kibana-management +x-pack/platform/packages/private/security/authorization_core @elastic/kibana-security +x-pack/platform/packages/private/security/authorization_core_common @elastic/kibana-security +x-pack/platform/packages/private/security/role_management_model @elastic/kibana-security +x-pack/platform/packages/private/security/ui_components @elastic/kibana-security +x-pack/platform/packages/shared/ai-infra/inference-common @elastic/appex-ai-infra +x-pack/platform/packages/shared/ai-infra/product-doc-common @elastic/appex-ai-infra +x-pack/platform/packages/shared/index-lifecycle-management/index_lifecycle_management_common_shared @elastic/kibana-management +x-pack/platform/packages/shared/index-management/index_management_shared_types @elastic/kibana-management +x-pack/platform/packages/shared/kbn-ai-assistant @elastic/search-kibana +x-pack/platform/packages/shared/kbn-ai-assistant-common @elastic/search-kibana +x-pack/platform/packages/shared/kbn-alerting-comparators @elastic/response-ops +x-pack/platform/packages/shared/kbn-cloud-security-posture/common @elastic/kibana-cloud-security-posture +x-pack/platform/packages/shared/kbn-data-forge @elastic/obs-ux-management-team +x-pack/platform/packages/shared/kbn-elastic-assistant @elastic/security-generative-ai +x-pack/platform/packages/shared/kbn-elastic-assistant-common @elastic/security-generative-ai +x-pack/platform/packages/shared/kbn-entities-schema @elastic/obs-entities +x-pack/platform/packages/shared/kbn-langchain @elastic/security-generative-ai +x-pack/platform/packages/shared/kbn-slo-schema @elastic/obs-ux-management-team +x-pack/platform/packages/shared/ml/aiops_common @elastic/ml-ui +x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis @elastic/ml-ui +x-pack/platform/packages/shared/ml/aiops_log_rate_analysis @elastic/ml-ui +x-pack/platform/packages/shared/ml/anomaly_utils @elastic/ml-ui +x-pack/platform/packages/shared/ml/chi2test @elastic/ml-ui +x-pack/platform/packages/shared/ml/error_utils @elastic/ml-ui +x-pack/platform/packages/shared/ml/random_sampler_utils @elastic/ml-ui +x-pack/platform/packages/shared/ml/response_stream @elastic/ml-ui +x-pack/platform/packages/shared/ml/runtime_field_utils @elastic/ml-ui +x-pack/platform/packages/shared/ml/trained_models_utils @elastic/ml-ui +x-pack/platform/packages/shared/observability/alerting_rule_utils @elastic/obs-ux-management-team +x-pack/platform/packages/shared/security/api_key_management @elastic/kibana-security +x-pack/platform/packages/shared/security/form_components @elastic/kibana-security +x-pack/platform/packages/shared/security/plugin_types_common @elastic/kibana-security +x-pack/platform/packages/shared/security/plugin_types_public @elastic/kibana-security +x-pack/platform/packages/shared/security/plugin_types_server @elastic/kibana-security +x-pack/platform/plugins/private/banners @elastic/appex-sharedux +x-pack/platform/plugins/private/canvas @elastic/kibana-presentation +x-pack/platform/plugins/private/cloud_integrations/cloud_chat @elastic/kibana-core +x-pack/platform/plugins/private/cloud_integrations/cloud_data_migration @elastic/kibana-management +x-pack/platform/plugins/private/cloud_integrations/cloud_full_story @elastic/kibana-core +x-pack/platform/plugins/private/cloud_integrations/cloud_links @elastic/kibana-core +x-pack/platform/plugins/private/cross_cluster_replication @elastic/kibana-management +x-pack/platform/plugins/private/custom_branding @elastic/appex-sharedux +x-pack/platform/plugins/private/data_usage @elastic/obs-ai-assistant @elastic/security-solution +x-pack/platform/plugins/private/data_visualizer @elastic/ml-ui +x-pack/platform/plugins/private/discover_enhanced @elastic/kibana-data-discovery +x-pack/platform/plugins/private/drilldowns/url_drilldown @elastic/appex-sharedux +x-pack/platform/plugins/private/file_upload @elastic/kibana-presentation @elastic/ml-ui +x-pack/platform/plugins/private/global_search_bar @elastic/appex-sharedux +x-pack/platform/plugins/private/global_search_providers @elastic/appex-sharedux +x-pack/platform/plugins/private/graph @elastic/kibana-visualizations +x-pack/platform/plugins/private/grokdebugger @elastic/kibana-management +x-pack/platform/plugins/private/index_lifecycle_management @elastic/kibana-management +x-pack/platform/plugins/private/license_api_guard @elastic/kibana-management +x-pack/platform/plugins/private/logstash @elastic/logstash +x-pack/platform/plugins/private/monitoring @elastic/stack-monitoring +x-pack/platform/plugins/private/monitoring_collection @elastic/stack-monitoring +x-pack/platform/plugins/private/painless_lab @elastic/kibana-management +x-pack/platform/plugins/private/remote_clusters @elastic/kibana-management +x-pack/platform/plugins/private/reporting @elastic/appex-sharedux +x-pack/platform/plugins/private/rollup @elastic/kibana-management +x-pack/platform/plugins/private/runtime_fields @elastic/kibana-management +x-pack/platform/plugins/private/saved_objects_tagging @elastic/appex-sharedux +x-pack/platform/plugins/private/snapshot_restore @elastic/kibana-management +x-pack/platform/plugins/private/telemetry_collection_xpack @elastic/kibana-core +x-pack/platform/plugins/private/transform @elastic/ml-ui +x-pack/platform/plugins/private/upgrade_assistant @elastic/kibana-core +x-pack/platform/plugins/private/watcher @elastic/kibana-management +x-pack/platform/plugins/shared/actions @elastic/response-ops +x-pack/platform/plugins/shared/ai_infra/llm_tasks @elastic/appex-ai-infra +x-pack/platform/plugins/shared/ai_infra/product_doc_base @elastic/appex-ai-infra +x-pack/platform/plugins/shared/aiops @elastic/ml-ui +x-pack/platform/plugins/shared/alerting @elastic/response-ops +x-pack/platform/plugins/shared/cases @elastic/response-ops +x-pack/platform/plugins/shared/cloud @elastic/kibana-core +x-pack/platform/plugins/shared/cloud_integrations/cloud_experiments @elastic/kibana-core +x-pack/platform/plugins/shared/dashboard_enhanced @elastic/kibana-presentation +x-pack/platform/plugins/shared/embeddable_enhanced @elastic/kibana-presentation +x-pack/platform/plugins/shared/encrypted_saved_objects @elastic/kibana-security +x-pack/platform/plugins/shared/entity_manager @elastic/obs-entities +x-pack/platform/plugins/shared/event_log @elastic/response-ops +x-pack/platform/plugins/shared/features @elastic/kibana-core +x-pack/platform/plugins/shared/fields_metadata @elastic/obs-ux-logs-team +x-pack/platform/plugins/shared/fleet @elastic/fleet +x-pack/platform/plugins/shared/global_search @elastic/appex-sharedux +x-pack/platform/plugins/shared/index_management @elastic/kibana-management +x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra +x-pack/platform/plugins/shared/ingest_pipelines @elastic/kibana-management +x-pack/platform/plugins/shared/integration_assistant @elastic/security-scalability +x-pack/platform/plugins/shared/lens @elastic/kibana-visualizations +x-pack/platform/plugins/shared/license_management @elastic/kibana-management +x-pack/platform/plugins/shared/licensing @elastic/kibana-core +x-pack/platform/plugins/shared/maps @elastic/kibana-presentation +x-pack/platform/plugins/shared/ml @elastic/ml-ui +x-pack/platform/plugins/shared/notifications @elastic/appex-sharedux +x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant +x-pack/platform/plugins/shared/osquery @elastic/security-defend-workflows +x-pack/platform/plugins/shared/rule_registry @elastic/response-ops @elastic/obs-ux-management-team +x-pack/platform/plugins/shared/screenshotting @elastic/kibana-reporting-services +x-pack/platform/plugins/shared/searchprofiler @elastic/kibana-management +x-pack/platform/plugins/shared/security @elastic/kibana-security +x-pack/platform/plugins/shared/serverless @elastic/appex-sharedux +x-pack/platform/plugins/shared/spaces @elastic/kibana-security +x-pack/platform/plugins/shared/stack_alerts @elastic/response-ops +x-pack/platform/plugins/shared/stack_connectors @elastic/response-ops +x-pack/platform/plugins/shared/task_manager @elastic/response-ops +x-pack/platform/plugins/shared/triggers_actions_ui @elastic/response-ops +x-pack/solutions/observability/packages/alert_details @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/alerting_test_data @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/get_padded_alert_time_range_util @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/kbn-alerts-grouping @elastic/response-ops +x-pack/solutions/observability/packages/kbn-apm-types @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/packages/kbn-custom-integrations @elastic/obs-ux-logs-team +x-pack/solutions/observability/packages/kbn-investigation-shared @elastic/obs-ux-management-team +x-pack/solutions/observability/packages/kbn-timerange @elastic/obs-ux-logs-team +x-pack/solutions/observability/packages/kbn-xstate-utils @elastic/obs-ux-logs-team +x-pack/solutions/observability/packages/logs_overview @elastic/obs-ux-logs-team +x-pack/solutions/observability/packages/observability_ai/observability_ai_common @elastic/obs-ai-assistant +x-pack/solutions/observability/packages/observability_ai/observability_ai_server @elastic/obs-ai-assistant +x-pack/solutions/observability/packages/observability_utils/observability_utils_browser @elastic/observability-ui +x-pack/solutions/observability/packages/observability_utils/observability_utils_common @elastic/observability-ui +x-pack/solutions/observability/packages/observability_utils/observability_utils_server @elastic/observability-ui +x-pack/solutions/observability/packages/synthetics_test_data @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/apm @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/apm_data_access @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/data_quality @elastic/obs-ux-logs-team +x-pack/solutions/observability/plugins/dataset_quality @elastic/obs-ux-logs-team +x-pack/solutions/observability/plugins/entities_data_access @elastic/obs-entities +x-pack/solutions/observability/plugins/entity_manager_app @elastic/obs-entities +x-pack/solutions/observability/plugins/exploratory_view @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/infra @elastic/obs-ux-logs-team @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/inventory @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/investigate @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/investigate_app @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/logs_explorer @elastic/obs-ux-logs-team +x-pack/solutions/observability/plugins/metrics_data_access @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/observability @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/observability_ai_assistant_app @elastic/obs-ai-assistant +x-pack/solutions/observability/plugins/observability_ai_assistant_management @elastic/obs-ai-assistant +x-pack/solutions/observability/plugins/observability_logs_explorer @elastic/obs-ux-logs-team +x-pack/solutions/observability/plugins/observability_onboarding @elastic/obs-ux-logs-team @elastic/obs-ux-onboarding-team +x-pack/solutions/observability/plugins/observability_shared @elastic/observability-ui +x-pack/solutions/observability/plugins/profiling @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/profiling_data_access @elastic/obs-ux-infra_services-team +x-pack/solutions/observability/plugins/serverless_observability @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/slo @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/streams @elastic/streams-program-team +x-pack/solutions/observability/plugins/streams_app @elastic/streams-program-team +x-pack/solutions/observability/plugins/synthetics @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/uptime @elastic/obs-ux-management-team +x-pack/solutions/observability/plugins/ux @elastic/obs-ux-infra_services-team +x-pack/solutions/search/packages/kbn-ipynb @elastic/search-kibana +x-pack/solutions/search/packages/kbn-search-api-keys-components @elastic/search-kibana +x-pack/solutions/search/packages/kbn-search-api-keys-server @elastic/search-kibana +x-pack/solutions/search/packages/kbn-search-index-documents @elastic/search-kibana +x-pack/solutions/search/packages/search/shared_ui @elastic/search-kibana +x-pack/solutions/search/plugins/enterprise_search @elastic/search-kibana +x-pack/solutions/search/plugins/search_assistant @elastic/search-kibana +x-pack/solutions/search/plugins/search_connectors @elastic/search-kibana +x-pack/solutions/search/plugins/search_homepage @elastic/search-kibana +x-pack/solutions/search/plugins/search_indices @elastic/search-kibana +x-pack/solutions/search/plugins/search_inference_endpoints @elastic/search-kibana +x-pack/solutions/search/plugins/search_notebooks @elastic/search-kibana +x-pack/solutions/search/plugins/search_playground @elastic/search-kibana +x-pack/solutions/search/plugins/search_solution/search_navigation @elastic/search-kibana +x-pack/solutions/search/plugins/serverless_search @elastic/search-kibana +x-pack/solutions/security/packages/data_table @elastic/security-threat-hunting-investigations +x-pack/solutions/security/packages/distribution_bar @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/features @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/kbn-cloud-security-posture/graph @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/kbn-cloud-security-posture/public @elastic/kibana-cloud-security-posture +x-pack/solutions/security/packages/data-stream-adapter @elastic/security-threat-hunting +x-pack/solutions/security/packages/expandable-flyout @elastic/security-threat-hunting-investigations +x-pack/solutions/security/packages/index-adapter @elastic/security-threat-hunting +x-pack/solutions/security/packages/kbn-securitysolution-autocomplete @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-endpoint-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-exception-list-components @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-exceptions-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-hook-utils @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-io-ts-list-types @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-api @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-constants @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-hooks @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-list-utils @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-lists-common @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-t-grid @elastic/security-detection-engine +x-pack/solutions/security/packages/kbn-securitysolution-utils @elastic/security-detection-engine +x-pack/solutions/security/packages/navigation @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/side_nav @elastic/security-threat-hunting-explore +x-pack/solutions/security/packages/upselling @elastic/security-threat-hunting-explore +x-pack/solutions/security/plugins/asset_inventory @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/cloud_defend @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/cloud_security_posture @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/ecs_data_quality_dashboard @elastic/security-threat-hunting-explore +x-pack/solutions/security/plugins/elastic_assistant @elastic/security-generative-ai +x-pack/solutions/security/plugins/kubernetes_security @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/lists @elastic/security-detection-engine +x-pack/solutions/security/plugins/security_solution @elastic/security-solution +x-pack/solutions/security/plugins/security_solution_ess @elastic/security-solution +x-pack/solutions/security/plugins/security_solution_serverless @elastic/security-solution +x-pack/solutions/security/plugins/session_view @elastic/kibana-cloud-security-posture +x-pack/solutions/security/plugins/threat_intelligence @elastic/security-threat-hunting-investigations +x-pack/solutions/security/plugins/timelines @elastic/security-threat-hunting-investigations + #### ## These rules are always last so they take ultimate priority over everything else #### diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index e7120dc82fd7..73c969cd4b2b 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -84,6 +84,6 @@ paths-ignore: - x-pack/plugins/osquery/scripts - x-pack/plugins/rule_registry/scripts - x-pack/plugins/security_solution/scripts - - x-pack/plugins/threat_intelligence/scripts + - x-pack/solutions/security/plugins/threat_intelligence/scripts - x-pack/scripts - x-pack/test diff --git a/.github/paths-labeller.yml b/.github/paths-labeller.yml index dbbefda24c9a..43e9445b5767 100644 --- a/.github/paths-labeller.yml +++ b/.github/paths-labeller.yml @@ -14,23 +14,23 @@ - 'packages/kbn-apm-synthtrace/**/*.*' - 'packages/kbn-apm-synthtrace-client/**/*.*' - 'packages/kbn-apm-utils/**/*.*' - - 'x-pack/plugins/observability_solution/ux/**/*.*' + - 'x-pack/solutions/observability/plugins/ux/**/*.*' - 'Team:Fleet': - 'x-pack/plugins/fleet/**/*.*' - 'x-pack/test/fleet_api_integration/**/*.*' - 'Team:obs-ux-management': - - 'x-pack/plugins/observability_solution/observability/**/*.*' + - 'x-pack/solutions/observability/plugins/observability/**/*.*' - 'x-pack/plugins/observability_solution/slo/**/*.*' - - 'x-pack/plugins/observability_solution/synthetics/**/*.*' - - 'x-pack/plugins/observability_solution/exploratory_view/**/*.*' + - 'x-pack/solutions/observability/plugins/synthetics/**/*.*' + - 'x-pack/solutions/observability/plugins/exploratory_view/**/*.*' - 'Team:Obs AI Assistant': - - 'x-pack/plugins/observability_solution/observability_ai_assistant/**/*.*' + - 'x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/**/*.*' - 'x-pack/plugins/observability_solution/observability_ai_assistant_*/**/*.*' - 'x-pack/test/observability_ai_assistant_api_integration/**/*.*' - 'x-pack/test/observability_ai_assistant_functional/**/*.*' - 'ci:project-deploy-observability': - 'packages/kbn-apm-*/**/*.*' - 'x-pack/plugins/observability_solution/**/*.*' - - 'x-pack/plugins/serverless_observability/**/*.*' + - 'x-pack/solutions/observability/plugins/serverless_observability/**/*.*' - 'x-pack/test/apm_api_integration/**/*.*' - 'x-pack/test/observability_*/**/*.*' diff --git a/.i18nrc.json b/.i18nrc.json index c11b62229183..c0241fec37af 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -1,7 +1,7 @@ { "paths": { "advancedSettings": "src/plugins/advanced_settings", - "aiAssistantManagementSelection": "src/plugins/ai_assistant_management/selection", + "aiAssistantManagementSelection": "src/platform/plugins/shared/ai_assistant_management/selection", "alerts": "packages/kbn-alerts/src", "alertsUIShared": "packages/kbn-alerts-ui-shared/src", "alertingTypes": "packages/kbn-alerting-types", @@ -23,7 +23,7 @@ "domDragDrop": "packages/kbn-dom-drag-drop", "controls": "src/plugins/controls", "data": "src/plugins/data", - "observabilityAlertDetails": "x-pack/packages/observability/alert_details", + "observabilityAlertDetails": "x-pack/solutions/observability/packages/alert_details", "dataViews": "src/plugins/data_views", "defaultNavigation": [ "packages/default-nav", @@ -38,7 +38,6 @@ "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", "expressionGauge": "src/plugins/chart_expressions/expression_gauge", "expressionHeatmap": "src/plugins/chart_expressions/expression_heatmap", @@ -118,7 +117,7 @@ "searchIndexDocuments": "packages/kbn-search-index-documents", "searchResponseWarnings": "packages/kbn-search-response-warnings", "searchTypes": "packages/kbn-search-types", - "securitySolutionPackages": "x-pack/packages/security-solution", + "securitySolutionPackages": "x-pack/solutions/security/packages", "serverlessPackages": "packages/serverless", "sse": ["packages/kbn-sse-utils"], "coloring": "packages/kbn-coloring/src", diff --git a/api_docs/actions.mdx b/api_docs/actions.mdx index e6073f007605..c9d1ccca3c3c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions'] --- import actionsObj from './actions.devdocs.json'; diff --git a/api_docs/advanced_settings.mdx b/api_docs/advanced_settings.mdx index 997ee6a63ef4..741954c423f6 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings'] --- import advancedSettingsObj from './advanced_settings.devdocs.json'; diff --git a/api_docs/ai_assistant_management_selection.devdocs.json b/api_docs/ai_assistant_management_selection.devdocs.json index c7233a2b94ec..5740a2b25fb0 100644 --- a/api_docs/ai_assistant_management_selection.devdocs.json +++ b/api_docs/ai_assistant_management_selection.devdocs.json @@ -12,7 +12,7 @@ "tags": [], "label": "AIAssistantType", "description": [], - "path": "src/plugins/ai_assistant_management/selection/common/ai_assistant_type.ts", + "path": "src/platform/plugins/shared/ai_assistant_management/selection/common/ai_assistant_type.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -27,7 +27,7 @@ "tags": [], "label": "AIAssistantManagementSelectionPluginPublicSetup", "description": [], - "path": "src/plugins/ai_assistant_management/selection/public/plugin.ts", + "path": "src/platform/plugins/shared/ai_assistant_management/selection/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -41,7 +41,7 @@ "tags": [], "label": "AIAssistantManagementSelectionPluginPublicStart", "description": [], - "path": "src/plugins/ai_assistant_management/selection/public/plugin.ts", + "path": "src/platform/plugins/shared/ai_assistant_management/selection/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -58,7 +58,7 @@ "AIAssistantType", ">" ], - "path": "src/plugins/ai_assistant_management/selection/public/plugin.ts", + "path": "src/platform/plugins/shared/ai_assistant_management/selection/public/plugin.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/ai_assistant_management_selection.mdx b/api_docs/ai_assistant_management_selection.mdx index c4ad90deeffb..91828448de7c 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-12-10 +date: 2024-12-13 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 e6b8e7795ce8..c0965ba2b75f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops'] --- import aiopsObj from './aiops.devdocs.json'; diff --git a/api_docs/alerting.mdx b/api_docs/alerting.mdx index ef112becf2f5..8c9110c574a3 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting'] --- import alertingObj from './alerting.devdocs.json'; diff --git a/api_docs/apm.mdx b/api_docs/apm.mdx index e503010b398a..f8f2dd5fd3ea 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm'] --- import apmObj from './apm.devdocs.json'; diff --git a/api_docs/apm_data_access.mdx b/api_docs/apm_data_access.mdx index 14883b4493db..88bc83fed188 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apmDataAccess'] --- import apmDataAccessObj from './apm_data_access.devdocs.json'; diff --git a/api_docs/asset_inventory.mdx b/api_docs/asset_inventory.mdx index 819e37b1619c..d20480c00708 100644 --- a/api_docs/asset_inventory.mdx +++ b/api_docs/asset_inventory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/assetInventory title: "assetInventory" image: https://source.unsplash.com/400x175/?github description: API docs for the assetInventory plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'assetInventory'] --- import assetInventoryObj from './asset_inventory.devdocs.json'; diff --git a/api_docs/banners.mdx b/api_docs/banners.mdx index 5c291cd78b05..ccdd9f547154 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-12-10 +date: 2024-12-13 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 ac5e1f981534..c7c32d5a2878 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-12-10 +date: 2024-12-13 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 91afdb4e2bb2..758d921080fa 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-12-10 +date: 2024-12-13 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 8499d2f7a715..df54c2083bf7 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-12-10 +date: 2024-12-13 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 4fdf943a868f..0e9adb3e303c 100644 --- a/api_docs/charts.devdocs.json +++ b/api_docs/charts.devdocs.json @@ -153,6 +153,71 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "charts", + "id": "def-public.decreaseOpacity", + "type": "Function", + "tags": [], + "label": "decreaseOpacity", + "description": [ + "\nReduces color opacity, by mixing color with background color.\n\nThis is used when the resulting color needs to be opaque (i.e. alpha of 1)." + ], + "signature": [ + "(baseColor: string, step: number, totalSteps: number) => string" + ], + "path": "src/plugins/charts/public/services/palettes/decrease_opacity.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "charts", + "id": "def-public.decreaseOpacity.$1", + "type": "string", + "tags": [], + "label": "baseColor", + "description": [], + "signature": [ + "string" + ], + "path": "src/plugins/charts/public/services/palettes/decrease_opacity.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.decreaseOpacity.$2", + "type": "number", + "tags": [], + "label": "step", + "description": [], + "signature": [ + "number" + ], + "path": "src/plugins/charts/public/services/palettes/decrease_opacity.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "charts", + "id": "def-public.decreaseOpacity.$3", + "type": "number", + "tags": [], + "label": "totalSteps", + "description": [], + "signature": [ + "number" + ], + "path": "src/plugins/charts/public/services/palettes/decrease_opacity.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "charts", "id": "def-public.EmptyPlaceholder", diff --git a/api_docs/charts.mdx b/api_docs/charts.mdx index edee4b592c72..dde3d7064409 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'charts'] --- import chartsObj from './charts.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 | |-------------------|-----------|------------------------|-----------------| -| 267 | 2 | 252 | 9 | +| 271 | 2 | 255 | 9 | ## Client diff --git a/api_docs/cloud.mdx b/api_docs/cloud.mdx index 7ed607fc3407..6b4c7f4324a5 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-12-10 +date: 2024-12-13 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 ee698cda129a..590ba976e29c 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-12-10 +date: 2024-12-13 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 f34a611a7c22..d19199df2af7 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cloudDefend'] --- import cloudDefendObj from './cloud_defend.devdocs.json'; diff --git a/api_docs/cloud_security_posture.mdx b/api_docs/cloud_security_posture.mdx index 63a2c567ea78..ae51569ee624 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-12-10 +date: 2024-12-13 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 72d4a88a1e65..9190c20f1bc1 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-12-10 +date: 2024-12-13 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 8029dbb584f4..5ce56d9c046e 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-12-10 +date: 2024-12-13 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 5a0a3ae38133..87e8b0489a1b 100644 --- a/api_docs/controls.devdocs.json +++ b/api_docs/controls.devdocs.json @@ -1272,7 +1272,13 @@ "text": "HasSaveNotification" }, " & ", - "PublishesReload", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesReload", + "text": "PublishesReload" + }, "> & { allowExpensiveQueries$: ", { "pluginId": "@kbn/presentation-publishing", @@ -1524,7 +1530,13 @@ "text": "HasSaveNotification" }, " & ", - "PublishesReload", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesReload", + "text": "PublishesReload" + }, "> & { allowExpensiveQueries$: ", { "pluginId": "@kbn/presentation-publishing", @@ -1867,6 +1879,22 @@ "text": "HasUniqueId" }, " & ", + { + "pluginId": "@kbn/presentation-containers", + "scope": "public", + "docId": "kibKbnPresentationContainersPluginApi", + "section": "def-public.HasSerializableState", + "text": "HasSerializableState" + }, + "<", + { + "pluginId": "controls", + "scope": "common", + "docId": "kibControlsPluginApi", + "section": "def-common.DefaultControlState", + "text": "DefaultControlState" + }, + "> & ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -1906,23 +1934,7 @@ "section": "def-common.ControlWidth", "text": "ControlWidth" }, - " | undefined>; serializeState: () => ", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.SerializedPanelState", - "text": "SerializedPanelState" - }, - "<", - { - "pluginId": "controls", - "scope": "common", - "docId": "kibControlsPluginApi", - "section": "def-common.DefaultControlState", - "text": "DefaultControlState" - }, - ">; } & Omit<", + " | undefined>; } & Omit<", { "pluginId": "@kbn/presentation-publishing", "scope": "public", diff --git a/api_docs/controls.mdx b/api_docs/controls.mdx index 37e528ee2882..115e4fe3d022 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'controls'] --- import controlsObj from './controls.devdocs.json'; diff --git a/api_docs/custom_integrations.mdx b/api_docs/custom_integrations.mdx index abf8aae7443f..a116a2ab74bc 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-12-10 +date: 2024-12-13 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 79542dae8529..932fe862f871 100644 --- a/api_docs/dashboard.devdocs.json +++ b/api_docs/dashboard.devdocs.json @@ -393,7 +393,7 @@ "description": [], "signature": [ "(() => Partial<", - "SavedDashboardInput", + "DashboardState", ">) | undefined" ], "path": "src/plugins/dashboard/public/dashboard_api/types.ts", @@ -857,6 +857,14 @@ "text": "HasAppContext" }, " & ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.HasExecutionContext", + "text": "HasExecutionContext" + }, + " & ", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -865,6 +873,14 @@ "text": "HasRuntimeChildState" }, " & ", + { + "pluginId": "@kbn/presentation-containers", + "scope": "public", + "docId": "kibKbnPresentationContainersPluginApi", + "section": "def-public.HasSaveNotification", + "text": "HasSaveNotification" + }, + " & ", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -881,6 +897,14 @@ "text": "HasType" }, "<\"dashboard\"> & ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.HasUniqueId", + "text": "HasUniqueId" + }, + " & ", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -889,6 +913,14 @@ "text": "PresentationContainer" }, " & ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesDataLoading", + "text": "PublishesDataLoading" + }, + " & ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -913,6 +945,14 @@ "text": "PublishesPanelTitle" }, ", \"panelTitle\"> & ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesReload", + "text": "PublishesReload" + }, + " & ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -921,6 +961,16 @@ "text": "PublishesSavedObjectId" }, " & ", + "PublishesSearchSession", + " & ", + { + "pluginId": "@kbn/presentation-containers", + "scope": "public", + "docId": "kibKbnPresentationContainersPluginApi", + "section": "def-public.PublishesSettings", + "text": "PublishesSettings" + }, + " & ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -968,23 +1018,31 @@ "section": "def-public.PublishesViewMode", "text": "PublishesViewMode" }, - " & ", + " & { setViewMode: (viewMode: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.ViewMode", + "text": "ViewMode" + }, + ") => void; } & ", { "pluginId": "@kbn/presentation-containers", "scope": "public", "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.TracksOverlays", - "text": "TracksOverlays" + "section": "def-public.TrackContentfulRender", + "text": "TrackContentfulRender" }, - " & { addFromLibrary: () => void; animatePanelTransforms$: ", + " & ", { - "pluginId": "@kbn/presentation-publishing", + "pluginId": "@kbn/presentation-containers", "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" + "docId": "kibKbnPresentationContainersPluginApi", + "section": "def-public.TracksOverlays", + "text": "TracksOverlays" }, - "; asyncResetToLastSavedState: () => Promise; controlGroupApi$: ", + " & { asyncResetToLastSavedState: () => Promise; controlGroupApi$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -1016,27 +1074,9 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; forceRefresh: () => void; getRuntimeStateForControlGroup: () => ", - "UnsavedPanelState", - " | undefined; getSerializedStateForControlGroup: () => ", - { - "pluginId": "@kbn/presentation-containers", - "scope": "public", - "docId": "kibKbnPresentationContainersPluginApi", - "section": "def-public.SerializedPanelState", - "text": "SerializedPanelState" - }, - "<", - { - "pluginId": "controls", - "scope": "common", - "docId": "kibControlsPluginApi", - "section": "def-common.ControlGroupSerializedState", - "text": "ControlGroupSerializedState" - }, - ">; getSettings: () => ", + "; forceRefresh: () => void; getSettings: () => ", "DashboardStateFromSettingsFlyout", - "; getDashboardPanelFromId: (id: string) => Promise<", + "; getDashboardPanelFromId: (id: string) => ", { "pluginId": "dashboard", "scope": "common", @@ -1052,15 +1092,7 @@ "section": "def-common.SavedObjectEmbeddableInput", "text": "SavedObjectEmbeddableInput" }, - ">>; hasOverlays$: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" - }, - "; hasRunMigrations$: ", + ">; hasOverlays$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -1084,15 +1116,23 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; isEmbeddedExternally: boolean; managed$: ", + "; isEmbeddedExternally: boolean; isManaged: boolean; locator?: Pick<", { - "pluginId": "@kbn/presentation-publishing", + "pluginId": "share", + "scope": "common", + "docId": "kibSharePluginApi", + "section": "def-common.LocatorPublic", + "text": "LocatorPublic" + }, + "<", + { + "pluginId": "dashboard", "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" + "docId": "kibDashboardPluginApi", + "section": "def-public.DashboardLocatorParams", + "text": "DashboardLocatorParams" }, - "; panels$: ", + ">, \"navigate\" | \"getRedirectUrl\"> | undefined; panels$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -1108,23 +1148,7 @@ "section": "def-common.DashboardPanelMap", "text": "DashboardPanelMap" }, - ">; registerChildApi: (api: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.DefaultEmbeddableApi", - "text": "DefaultEmbeddableApi" - }, - ") => void; runInteractiveSave: (interactionMode: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ") => Promise<", + ">; runInteractiveSave: () => Promise<", "SaveDashboardReturn", " | undefined>; runQuickSave: () => Promise; scrollToPanel: (panelRef: HTMLDivElement) => void; scrollToPanelId$: ", { @@ -1134,17 +1158,7 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; scrollToTop: () => void; setControlGroupApi: (controlGroupApi: ", - { - "pluginId": "controls", - "scope": "public", - "docId": "kibControlsPluginApi", - "section": "def-public.ControlGroupApi", - "text": "ControlGroupApi" - }, - ") => void; setSettings: (settings: ", - "DashboardStateFromSettingsFlyout", - ") => void; setFilters: (filters?: ", + "; scrollToTop: () => void; setFilters: (filters?: ", { "pluginId": "@kbn/es-query", "scope": "common", @@ -1152,7 +1166,7 @@ "section": "def-common.Filter", "text": "Filter" }, - "[] | undefined) => void; setFullScreenMode: (fullScreenMode: boolean) => void; setPanels: (panels: ", + "[] | undefined) => void; setFullScreenMode: (fullScreenMode: boolean) => void; setHighlightPanelId: (id: string | undefined) => void; setPanels: (panels: ", { "pluginId": "dashboard", "scope": "common", @@ -1168,7 +1182,9 @@ "section": "def-common.Query", "text": "Query" }, - " | undefined) => void; setTags: (tags: string[]) => void; setTimeRange: (timeRange?: ", + " | undefined) => void; setScrollToPanelId: (id: string | undefined) => void; setSettings: (settings: ", + "DashboardStateFromSettingsFlyout", + ") => void; setTags: (tags: string[]) => void; setTimeRange: (timeRange?: ", { "pluginId": "@kbn/es-query", "scope": "common", @@ -1176,15 +1192,7 @@ "section": "def-common.TimeRange", "text": "TimeRange" }, - " | undefined) => void; setViewMode: (viewMode: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.ViewMode", - "text": "ViewMode" - }, - ") => void; useMargins$: ", + " | undefined) => void; unifiedSearchFilters$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -1192,15 +1200,15 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; uuid$: ", + "<", { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" }, - "; untilEmbeddableLoaded: (id: string) => Promise<", + "[] | undefined>; untilEmbeddableLoaded: (id: string) => Promise<", { "pluginId": "embeddable", "scope": "public", diff --git a/api_docs/dashboard.mdx b/api_docs/dashboard.mdx index bca62b080c88..6031f8395d50 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dashboard'] --- import dashboardObj from './dashboard.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 | |-------------------|-----------|------------------------|-----------------| -| 114 | 0 | 111 | 14 | +| 114 | 0 | 111 | 13 | ## Client diff --git a/api_docs/dashboard_enhanced.mdx b/api_docs/dashboard_enhanced.mdx index dcae3865b0ef..9d4dedd85222 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-12-10 +date: 2024-12-13 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 cfb349a3c4ce..955840da3eca 100644 --- a/api_docs/data.devdocs.json +++ b/api_docs/data.devdocs.json @@ -8073,6 +8073,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core-saved-objects-api-server-internal", "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" @@ -8085,10 +8089,6 @@ "plugin": "@kbn/core-saved-objects-server-internal", "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -12660,14 +12660,14 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" @@ -19195,14 +19195,14 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" @@ -24610,6 +24610,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core-saved-objects-api-server-internal", "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" @@ -24622,10 +24626,6 @@ "plugin": "@kbn/core-saved-objects-server-internal", "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" diff --git a/api_docs/data.mdx b/api_docs/data.mdx index cdf2c82320ff..107942ce7d96 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-12-10 +date: 2024-12-13 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 ba1938c7b69d..5219a61119b2 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-12-10 +date: 2024-12-13 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 eec375eb6427..fede5071491b 100644 --- a/api_docs/data_query.devdocs.json +++ b/api_docs/data_query.devdocs.json @@ -4534,7 +4534,7 @@ "\nConverts QueryState to expression AST" ], "signature": [ - "({\n filters,\n query,\n inputQuery,\n time,\n dataView,\n titleForInspector,\n descriptionForInspector,\n}: Args) => Promise<", + "({\n filters,\n query,\n inputQuery,\n time,\n timeFieldName,\n titleForInspector,\n descriptionForInspector,\n}: Args) => Promise<", { "pluginId": "expressions", "scope": "common", @@ -4553,7 +4553,7 @@ "id": "def-common.textBasedQueryStateToAstWithValidation.$1", "type": "Object", "tags": [], - "label": "{\n filters,\n query,\n inputQuery,\n time,\n dataView,\n titleForInspector,\n descriptionForInspector,\n}", + "label": "{\n filters,\n query,\n inputQuery,\n time,\n timeFieldName,\n titleForInspector,\n descriptionForInspector,\n}", "description": [], "signature": [ "Args" diff --git a/api_docs/data_query.mdx b/api_docs/data_query.mdx index 0f4e5dde3268..4417f17c22c9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.query'] --- import dataQueryObj from './data_query.devdocs.json'; diff --git a/api_docs/data_search.mdx b/api_docs/data_search.mdx index 5eb53062eff1..973bc1e69945 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'data.search'] --- import dataSearchObj from './data_search.devdocs.json'; diff --git a/api_docs/data_usage.devdocs.json b/api_docs/data_usage.devdocs.json index fa0dd73eb8c2..1be50a255535 100644 --- a/api_docs/data_usage.devdocs.json +++ b/api_docs/data_usage.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "DataUsagePublicSetup", "description": [], - "path": "x-pack/plugins/data_usage/public/types.ts", + "path": "x-pack/platform/plugins/private/data_usage/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "DataUsagePublicStart", "description": [], - "path": "x-pack/plugins/data_usage/public/types.ts", + "path": "x-pack/platform/plugins/private/data_usage/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "DataUsageServerSetup", "description": [], - "path": "x-pack/plugins/data_usage/server/types/types.ts", + "path": "x-pack/platform/plugins/private/data_usage/server/types/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "DataUsageServerStart", "description": [], - "path": "x-pack/plugins/data_usage/server/types/types.ts", + "path": "x-pack/platform/plugins/private/data_usage/server/types/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -88,7 +88,7 @@ "signature": [ "\"/api/data_usage/\"" ], - "path": "x-pack/plugins/data_usage/common/constants.ts", + "path": "x-pack/platform/plugins/private/data_usage/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -100,7 +100,7 @@ "tags": [], "label": "DATA_USAGE_DATA_STREAMS_API_ROUTE", "description": [], - "path": "x-pack/plugins/data_usage/common/constants.ts", + "path": "x-pack/platform/plugins/private/data_usage/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -112,7 +112,7 @@ "tags": [], "label": "DATA_USAGE_METRICS_API_ROUTE", "description": [], - "path": "x-pack/plugins/data_usage/common/constants.ts", + "path": "x-pack/platform/plugins/private/data_usage/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -127,7 +127,7 @@ "signature": [ "50" ], - "path": "x-pack/plugins/data_usage/common/constants.ts", + "path": "x-pack/platform/plugins/private/data_usage/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -142,7 +142,7 @@ "signature": [ "\"data_usage\"" ], - "path": "x-pack/plugins/data_usage/common/constants.ts", + "path": "x-pack/platform/plugins/private/data_usage/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/data_usage.mdx b/api_docs/data_usage.mdx index 6701cddffed8..3a94ff7563fe 100644 --- a/api_docs/data_usage.mdx +++ b/api_docs/data_usage.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/dataUsage title: "dataUsage" image: https://source.unsplash.com/400x175/?github description: API docs for the dataUsage plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataUsage'] --- import dataUsageObj from './data_usage.devdocs.json'; diff --git a/api_docs/data_view_editor.mdx b/api_docs/data_view_editor.mdx index cadeae686004..d10542eef742 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-12-10 +date: 2024-12-13 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 d11847beba42..b47236d8eee7 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-12-10 +date: 2024-12-13 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 7857c22209fa..9ca9347549bf 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-12-10 +date: 2024-12-13 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 44f3daa2ba27..1cad15bd5413 100644 --- a/api_docs/data_views.devdocs.json +++ b/api_docs/data_views.devdocs.json @@ -427,14 +427,14 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" @@ -8301,14 +8301,14 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" @@ -14159,32 +14159,36 @@ "path": "x-pack/plugins/graph/public/state_management/persistence.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" }, { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" + }, + { + "plugin": "timelines", + "path": "x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx" }, { "plugin": "stackAlerts", @@ -14198,22 +14202,6 @@ "plugin": "stackAlerts", "path": "x-pack/plugins/stack_alerts/public/rule_types/components/data_view_select_popover.tsx" }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/sourcerer/containers/create_sourcerer_data_view.ts" - }, - { - "plugin": "timelines", - "path": "x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts" - }, { "plugin": "upgradeAssistant", "path": "x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx" @@ -14223,16 +14211,16 @@ "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, { - "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" }, { - "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/common/index_patterns_utils.ts" }, { - "plugin": "ux", - "path": "x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts" + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/get_fields.ts" }, { "plugin": "maps", @@ -14243,52 +14231,64 @@ "path": "x-pack/plugins/enterprise_search/public/applications/analytics/utils/find_or_create_data_view.test.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/public/app/hooks/use_data_view_exists.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts" + "plugin": "ml", + "path": "x-pack/platform/plugins/shared/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" }, { - "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts" + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx" + }, + { + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx" + }, + { + "plugin": "ux", + "path": "x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/common/filter_agg/components/filter_term_form.tsx" + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/public/app/hooks/use_data_view_exists.ts" + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts" }, { - "plugin": "ml", - "path": "x-pack/platform/plugins/shared/ml/public/application/services/new_job_capabilities/remove_nested_field_children.test.ts" + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/public/app/sections/create_transform/components/step_define/common/common.test.ts" + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts" }, { "plugin": "dataViewManagement", @@ -16824,14 +16824,14 @@ "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" - }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/state_management/datasource.test.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/lib/search_strategies/strategies/abstract_search_strategy.ts" + }, { "plugin": "graph", "path": "x-pack/plugins/graph/public/services/persistence/deserialize.test.ts" @@ -26028,6 +26028,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core-saved-objects-api-server-internal", "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" @@ -26040,10 +26044,6 @@ "plugin": "@kbn/core-saved-objects-server-internal", "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" diff --git a/api_docs/data_views.mdx b/api_docs/data_views.mdx index 6515a5af9a5f..911c601c877f 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-12-10 +date: 2024-12-13 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 d25f0a7edcdd..1b43d7dd3076 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'dataVisualizer'] --- import dataVisualizerObj from './data_visualizer.devdocs.json'; diff --git a/api_docs/dataset_quality.mdx b/api_docs/dataset_quality.mdx index 2ad67db089ee..79d9cd83666d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'datasetQuality'] --- import datasetQualityObj from './dataset_quality.devdocs.json'; diff --git a/api_docs/deprecations_by_api.mdx b/api_docs/deprecations_by_api.mdx index 9a20272c7302..a4352b0a598c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -17,12 +17,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Referencing plugin(s) | Remove By | | ---------------|-----------|-----------| | | ml, stackAlerts | - | -| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, controls, lens, @kbn/lens-embeddable-utils, triggersActionsUi, dataVisualizer, canvas, fleet, ml, @kbn/ml-data-view-utils, enterpriseSearch, graph, visTypeTimeseries, exploratoryView, stackAlerts, securitySolution, timelines, upgradeAssistant, uptime, ux, maps, transform, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | +| | data, @kbn/search-errors, savedObjectsManagement, unifiedSearch, @kbn/unified-field-list, controls, lens, @kbn/lens-embeddable-utils, triggersActionsUi, dataVisualizer, canvas, fleet, ml, @kbn/ml-data-view-utils, enterpriseSearch, graph, securitySolution, timelines, exploratoryView, stackAlerts, upgradeAssistant, visTypeTimeseries, maps, transform, uptime, ux, dataViewManagement, eventAnnotationListing, inputControlVis, visDefaultEditor, visTypeTimelion, visTypeVega | - | | | ml, securitySolution | - | | | actions, savedObjectsTagging, ml, enterpriseSearch | - | -| | @kbn/core-saved-objects-browser-internal, @kbn/core, visualizations, aiops, dataVisualizer, ml, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-http-router-server-internal, @kbn/core-http-server-internal, @kbn/core-metrics-server-internal, @kbn/core-status-server-internal, @kbn/core-i18n-server-internal, @kbn/core-rendering-server-internal, @kbn/core-capabilities-server-internal, @kbn/core-apps-server-internal, usageCollection, taskManager, security, monitoringCollection, files, banners, telemetry, securitySolution, @kbn/test-suites-xpack, cloudFullStory, customBranding, enterpriseSearch, interactiveSetup, mockIdpPlugin, spaces, ml | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core, visualizations, aiops, dataVisualizer, ml, dashboardEnhanced, graph, lens, securitySolution, eventAnnotation | - | | | @kbn/core, embeddable, savedObjects, 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, taskManager, dataViews, spaces, share, actions, data, alerting, dashboard, @kbn/core-saved-objects-migration-server-mocks, savedSearch, canvas, lens, cases, fleet, cloudSecurityPosture, ml, graph, lists, maps, visualizations, apmDataAccess, infra, securitySolution, apm, slo, synthetics, uptime, 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, dataViews, spaces, share, actions, data, alerting, dashboard, @kbn/core-saved-objects-migration-server-mocks, savedSearch, canvas, lens, cases, fleet, cloudSecurityPosture, ml, graph, lists, maps, securitySolution, apmDataAccess, apm, visualizations, infra, slo, synthetics, uptime, 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 | - | | | dataVisualizer, stackAlerts, expressionPartitionVis | - | @@ -33,8 +34,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | ruleRegistry, securitySolution, slo | - | | | security, actions, alerting, ruleRegistry, files, cases, fleet, securitySolution | - | | | alerting, securitySolution | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-browser-mocks, fleet, graph, lists, osquery, securitySolution, alerting | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-browser-mocks, fleet, graph, lists, osquery, securitySolution, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | | | alerting, securitySolution | - | | | securitySolution | - | | | cloudDefend, securitySolution, synthetics | - | @@ -46,10 +47,10 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/securitysolution-data-table, securitySolution | - | | | securitySolution | - | | | securitySolution | - | -| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, @kbn/core-saved-objects-browser-mocks, fleet, graph, lists, osquery, securitySolution, alerting | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-server-internal, fleet, graph, lists, osquery, securitySolution, alerting | - | | | @kbn/core-saved-objects-common, @kbn/core-saved-objects-server, @kbn/core, @kbn/alerting-types, alerting, actions, 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, savedObjectsTagging, home, canvas, savedObjectsTaggingOss, lists, securitySolution, upgradeAssistant, savedObjectsManagement, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-ui-settings-server-internal | - | -| | @kbn/core-saved-objects-migration-server-internal, dataViews, actions, data, alerting, dashboard, savedSearch, canvas, lens, cases, savedObjectsTagging, graph, lists, maps, visualizations, securitySolution, @kbn/core-test-helpers-so-type-serializer | - | +| | @kbn/core-saved-objects-api-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-api-server, @kbn/core-saved-objects-browser-mocks, @kbn/core, savedObjectsTagging, home, canvas, savedObjectsTaggingOss, lists, securitySolution, upgradeAssistant, savedObjectsManagement, @kbn/core-saved-objects-import-export-server-internal, @kbn/core-ui-settings-server-internal | - | +| | @kbn/core-saved-objects-migration-server-internal, dataViews, actions, data, alerting, dashboard, savedSearch, canvas, lens, cases, savedObjectsTagging, graph, lists, maps, securitySolution, visualizations, @kbn/core-test-helpers-so-type-serializer | - | | | security, securitySolution, cloudLinks, cases | - | | | security, cases, searchPlayground, securitySolution | - | | | lists, securitySolution, @kbn/securitysolution-io-ts-list-types | - | @@ -66,13 +67,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | securitySolution | - | | | @kbn/monaco, securitySolution | - | | | cloudSecurityPosture, securitySolution | - | -| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, entityManager, apm, serverlessSearch, upgradeAssistant, synthetics, transform, security | - | +| | alerting, observabilityAIAssistant, fleet, cloudSecurityPosture, apm, serverlessSearch, upgradeAssistant, entityManager, transform, synthetics, security | - | | | actions, alerting | - | | | monitoring | - | +| | observabilityShared, monitoring | - | | | @kbn/core-saved-objects-api-browser, @kbn/core, savedObjectsManagement, savedObjects, visualizations, savedObjectsTagging, eventAnnotation, lens, maps, graph, dashboard, kibanaUtils, expressions, data, savedObjectsTaggingOss, embeddable, uiActionsEnhanced, controls, canvas, dashboardEnhanced, globalSearchProviders | - | -| | @kbn/core-saved-objects-browser, @kbn/core-saved-objects-browser-internal, @kbn/core, home, visualizations, lens, visTypeTimeseries, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-saved-objects-browser, @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core, home, visualizations, lens, visTypeTimeseries | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks | - | -| | home, @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-browser-internal | - | +| | @kbn/core-saved-objects-browser-mocks, home, @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, visualizations | - | | | @kbn/core-saved-objects-browser-mocks, @kbn/core-saved-objects-browser-internal | - | | | @kbn/core-saved-objects-browser-mocks, dashboardEnhanced, @kbn/core-saved-objects-browser-internal | - | @@ -97,15 +99,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal, @kbn/core | - | | | @kbn/core-saved-objects-browser-internal | - | -| | @kbn/core-lifecycle-browser, @kbn/core-saved-objects-browser-internal, @kbn/core, visualizations, exploratoryView, transform, @kbn/core-saved-objects-browser-mocks | - | +| | @kbn/core-saved-objects-browser-internal, @kbn/core-saved-objects-browser-mocks, @kbn/core-lifecycle-browser, @kbn/core, visualizations, exploratoryView, transform | - | +| | @kbn/core-saved-objects-browser-mocks, @kbn/core-root-browser-internal | - | | | @kbn/core-saved-objects-api-server-internal | - | | | @kbn/core-saved-objects-api-server-internal | - | | | @kbn/core-saved-objects-api-server-internal, canvas | - | | | @kbn/core-saved-objects-api-server-internal, @kbn/core-saved-objects-migration-server-internal, spaces, data, dashboard, savedSearch, cloudSecurityPosture, visualizations, @kbn/core-test-helpers-so-type-serializer | - | -| | @kbn/core-root-browser-internal, @kbn/core-saved-objects-browser-mocks | - | -| | fleet, exploratoryView, osquery, synthetics | - | +| | fleet, osquery, exploratoryView, synthetics | - | | | @kbn/security-plugin-types-server, telemetry, fleet, profiling, @kbn/security-authorization-core, security | - | -| | @kbn/core-application-browser-internal, management, @kbn/core-application-browser-mocks, assetInventory, fleet, security, kibanaOverview, @kbn/core | - | +| | @kbn/core-application-browser-internal, @kbn/core-application-browser-mocks, management, assetInventory, fleet, security, kibanaOverview, @kbn/core | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement, dataViews | - | | | graph, visTypeTimeseries, dataViewManagement | - | @@ -123,12 +125,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | lens, dashboard, maps | - | | | dataViewManagement | - | | | dataViewManagement | - | -| | data, discover, imageEmbeddable, embeddable | - | +| | data, discover, imageEmbeddable | - | | | spaces, savedObjectsManagement | - | | | unifiedSearch | - | | | unifiedSearch | - | | | @kbn/core, lens | - | -| | dashboard, canvas | - | | | canvas | - | | | canvas | - | | | canvas | - | @@ -142,21 +143,17 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | canvas | - | | | enterpriseSearch | - | | | @kbn/core-elasticsearch-server-internal, @kbn/core-plugins-server-internal, enterpriseSearch, observabilityOnboarding, console | - | -| | dashboard, investigateApp | - | -| | dashboard | - | -| | embeddable, dashboard | - | -| | embeddableEnhanced | - | -| | embeddableEnhanced | - | | | uiActionsEnhanced | - | | | visTypeGauge | - | | | visTypePie | - | | | visTypePie | - | | | @kbn/core-logging-server-internal, security | - | | | security | - | -| | observabilityShared | - | | | aiAssistantManagementSelection, observabilityAiAssistantManagement | - | | | @kbn/react-kibana-context-styled, kibanaReact | - | | | indexLifecycleManagement | - | +| | dashboard | - | +| | embeddable, dashboard | - | | | @kbn/reporting-public, discover | - | | | discover, @kbn/management-settings-field-definition | - | | | @kbn/content-management-table-list-view, filesManagement | - | @@ -177,7 +174,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | fleet, apm, security, securitySolution | 8.8.0 | | | fleet, apm, security, securitySolution | 8.8.0 | | | spaces, @kbn/security-authorization-core, security, alerting, cases, @kbn/security-role-management-model | 8.8.0 | -| | embeddable, presentationUtil, lens, dashboard, discover, graph, links | 8.8.0 | +| | presentationUtil, visualizations, lens, dashboard, discover, graph, links | 8.8.0 | | | security, @kbn/security-role-management-model | 8.8.0 | | | security | 8.8.0 @@ -205,8 +202,10 @@ Safe to remove. | | data | | | data | | | data | -| | embeddableEnhanced | +| | embeddable | +| | embeddable | | | embeddable | +| | embeddable | | | expressionGauge | | | expressionGauge | | | expressions | diff --git a/api_docs/deprecations_by_plugin.mdx b/api_docs/deprecations_by_plugin.mdx index 3f8958aabf46..c4b4d684447d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -75,6 +75,22 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/core-apps-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [bundles_route.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts#:~:text=authRequired), [core_app.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-server-internal/src/core_app.ts#:~:text=authRequired), [core_app.ts](https://github.com/elastic/kibana/tree/main/packages/core/apps/core-apps-server-internal/src/core_app.ts#:~:text=authRequired) | - | + + + +## @kbn/core-capabilities-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [resolve_capabilities.ts](https://github.com/elastic/kibana/tree/main/packages/core/capabilities/core-capabilities-server-internal/src/routes/resolve_capabilities.ts#:~:text=authRequired) | - | + + + ## @kbn/core-elasticsearch-server-internal | Deprecated API | Reference location(s) | Remove By | @@ -83,6 +99,30 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/core-http-router-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [security_route_config_validator.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts#:~:text=authRequired), [security_route_config_validator.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts#:~:text=authRequired), [core_versioned_route.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_route.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired), [request.test.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-router-server-internal/src/request.test.ts#:~:text=authRequired)+ 3 more | - | + + + +## @kbn/core-http-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [http_server.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-server-internal/src/http_server.ts#:~:text=authRequired), [http_server.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-server-internal/src/http_server.ts#:~:text=authRequired), [auth.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-server-internal/src/lifecycle/auth.ts#:~:text=authRequired), [auth.ts](https://github.com/elastic/kibana/tree/main/packages/core/http/core-http-server-internal/src/lifecycle/auth.ts#:~:text=authRequired) | - | + + + +## @kbn/core-i18n-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [translations.ts](https://github.com/elastic/kibana/tree/main/packages/core/i18n/core-i18n-server-internal/src/routes/translations.ts#:~:text=authRequired) | - | + + + ## @kbn/core-lifecycle-browser | Deprecated API | Reference location(s) | Remove By | @@ -107,6 +147,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/core-metrics-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [elu_history.ts](https://github.com/elastic/kibana/tree/main/packages/core/metrics/core-metrics-server-internal/src/routes/elu_history.ts#:~:text=authRequired) | - | + + + ## @kbn/core-plugins-browser-internal | Deprecated API | Reference location(s) | Remove By | @@ -125,6 +173,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/core-rendering-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [register_bootstrap_route.ts](https://github.com/elastic/kibana/tree/main/packages/core/rendering/core-rendering-server-internal/src/bootstrap/register_bootstrap_route.ts#:~:text=authRequired) | - | + + + ## @kbn/core-root-browser-internal | Deprecated API | Reference location(s) | Remove By | @@ -310,6 +366,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/core-status-server-internal + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [status.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status.ts#:~:text=authRequired), [status_preboot.ts](https://github.com/elastic/kibana/tree/main/packages/core/status/core-status-server-internal/src/routes/status_preboot.ts#:~:text=authRequired) | - | + + + ## @kbn/core-test-helpers-so-type-serializer | Deprecated API | Reference location(s) | Remove By | @@ -456,9 +520,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | -| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=DeprecatedRowRenderer) | - | -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [mock_source.ts](https://github.com/elastic/kibana/tree/main/x-pack/packages/security-solution/data_table/mock/mock_source.ts#:~:text=BrowserFields)+ 1 more | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=DeprecatedCellValueElementProps), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=DeprecatedCellValueElementProps) | - | +| | [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=DeprecatedRowRenderer), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=DeprecatedRowRenderer) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts#:~:text=BrowserFields), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [helpers.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [index.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx#:~:text=BrowserFields), [mock_source.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/data_table/mock/mock_source.ts#:~:text=BrowserFields)+ 1 more | - | @@ -472,6 +536,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## @kbn/test-suites-xpack + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [pagerduty_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/pagerduty_simulation.ts#:~:text=authRequired), [servicenow_oauth_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_oauth_simulation.ts#:~:text=authRequired), [jira_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts#:~:text=authRequired), [jira_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts#:~:text=authRequired), [jira_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts#:~:text=authRequired), [jira_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts#:~:text=authRequired), [jira_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts#:~:text=authRequired), [resilient_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts#:~:text=authRequired), [resilient_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts#:~:text=authRequired), [resilient_simulation.ts](https://github.com/elastic/kibana/tree/main/x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts#:~:text=authRequired)+ 8 more | - | + + + ## @kbn/unified-field-list | Deprecated API | Reference location(s) | Remove By | @@ -498,7 +570,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [mount_section.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx#:~:text=wrapWithTheme), [mount_section.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx#:~:text=wrapWithTheme) | - | +| | [mount_section.tsx](https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx#:~:text=wrapWithTheme), [mount_section.tsx](https://github.com/elastic/kibana/tree/main/src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx#:~:text=wrapWithTheme) | - | @@ -561,13 +633,20 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## banners + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [info.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/banners/server/routes/info.ts#:~:text=authRequired) | - | + + + ## canvas | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [datasource_component.js](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/datasource/datasource_component.js#:~:text=title) | - | -| | [embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx#:~:text=EmbeddablePanel), [embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx#:~:text=EmbeddablePanel) | - | -| | [embeddable.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx#:~:text=getEmbeddableFactories), [editor_menu.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/workpad_header/editor_menu/editor_menu.tsx#:~:text=getEmbeddableFactories) | - | +| | [editor_menu.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/components/workpad_header/editor_menu/editor_menu.tsx#:~:text=getEmbeddableFactories) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/server/demodata/index.ts#:~:text=context), [embeddable.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/external/embeddable.ts#:~:text=context), [escount.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/escount.ts#:~:text=context), [esdocs.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/browser/esdocs.ts#:~:text=context), [filters.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/common/functions/filters.ts#:~:text=context), [neq.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/common/neq.ts#:~:text=context), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/canvas_plugin_src/functions/server/pointseries/index.ts#:~:text=context) | - | | | [setup_expressions.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/public/setup_expressions.ts#:~:text=getFunction) | - | | | [functions.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/functions/functions.ts#:~:text=getFunctions), [functions.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/functions/functions.ts#:~:text=getFunctions), [functions.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/canvas/server/routes/functions/functions.test.ts#:~:text=getFunctions) | - | @@ -613,6 +692,14 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## cloudFullStory + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [fullstory.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud_integrations/cloud_full_story/server/routes/fullstory.ts#:~:text=authRequired) | - | + + + ## cloudLinks | Deprecated API | Reference location(s) | Remove By | @@ -657,12 +744,18 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] +## customBranding + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [info.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/custom_branding/server/routes/info.ts#:~:text=authRequired) | - | + + + ## dashboard | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [dashboard_grid_item.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx#:~:text=EmbeddablePanel), [dashboard_grid_item.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx#:~:text=EmbeddablePanel) | - | -| | [migrate_dashboard_input.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.ts#:~:text=getEmbeddableFactory), [dashboard_container.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#:~:text=getEmbeddableFactory), [dashboard_container.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx#:~:text=getEmbeddableFactory), [create_dashboard.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts#:~:text=getEmbeddableFactory), [create_dashboard.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts#:~:text=getEmbeddableFactory), [create_dashboard.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts#:~:text=getEmbeddableFactory), [migrate_dashboard_input.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts#:~:text=getEmbeddableFactory), [migrate_dashboard_input.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts#:~:text=getEmbeddableFactory), [migrate_dashboard_input.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts#:~:text=getEmbeddableFactory), [migrate_dashboard_input.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts#:~:text=getEmbeddableFactory)+ 1 more | - | | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | | | [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/common/bwc/types.ts#:~:text=SavedObjectReference), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/common/bwc/types.ts#:~:text=SavedObjectReference) | - | | | [dashboard_saved_object.ts](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/server/dashboard_saved_object/dashboard_saved_object.ts#:~:text=migrations) | - | @@ -761,23 +854,12 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | -| | [helpers.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/tests/helpers.ts#:~:text=executeTriggerActions), [container.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/tests/container.test.ts#:~:text=executeTriggerActions), [container.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/tests/container.test.ts#:~:text=executeTriggerActions), [container.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/tests/container.test.ts#:~:text=executeTriggerActions), [explicit_input.test.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/tests/explicit_input.test.ts#:~:text=executeTriggerActions) | - | | | [default_embeddable_factory_provider.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts#:~:text=SavedObjectAttributes), [default_embeddable_factory_provider.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/embeddables/default_embeddable_factory_provider.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/types.ts#:~:text=SavedObjectAttributes), [types.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/types.ts#:~:text=SavedObjectAttributes) | - | | | [migrate_base_input.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/common/lib/migrate_base_input.ts#:~:text=SavedObjectReference), [migrate_base_input.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/common/lib/migrate_base_input.ts#:~:text=SavedObjectReference), [migrate_base_input.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/common/lib/migrate_base_input.ts#:~:text=SavedObjectReference), [inject.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/common/lib/inject.ts#:~:text=SavedObjectReference), [inject.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/common/lib/inject.ts#:~:text=SavedObjectReference) | - | | | [i_embeddable.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts#:~:text=HasLegacyLibraryTransforms), [i_embeddable.ts](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/embeddables/i_embeddable.ts#:~:text=HasLegacyLibraryTransforms) | - | -## embeddableEnhanced - -| Deprecated API | Reference location(s) | Remove By | -| ---------------|-----------|-----------| -| | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/embeddable_enhanced/public/plugin.ts#:~:text=EmbeddableContext), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/embeddable_enhanced/public/plugin.ts#:~:text=EmbeddableContext), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/embeddable_enhanced/public/plugin.ts#:~:text=EmbeddableContext) | - | -| | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/embeddable_enhanced/public/plugin.ts#:~:text=setCustomEmbeddableFactoryProvider) | - | - - - ## encryptedSavedObjects | Deprecated API | Reference location(s) | Remove By | @@ -794,6 +876,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [account_settings.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/account_settings/account_settings.tsx#:~:text=uiApi), [account_settings.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/account_settings/account_settings.tsx#:~:text=uiApi), [account_settings.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/account_settings/account_settings.tsx#:~:text=uiApi), [account_settings.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/account_settings/account_settings.tsx#:~:text=uiApi) | - | | | [check_access.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/lib/check_access.ts#:~:text=authz), [check_access.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/lib/check_access.ts#:~:text=authz), [check_access.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/lib/check_access.ts#:~:text=authz) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/plugin.ts#:~:text=legacy) | - | +| | [route_config_helpers.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts#:~:text=authRequired) | - | | | [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes), [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes), [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes), [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes), [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes), [telemetry.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts#:~:text=SavedObjectAttributes) | - | @@ -828,9 +911,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [observability_data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.ts#:~:text=title), [report_definition_field.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx#:~:text=title), [use_filter_values.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts#:~:text=title), [filter_value_btn.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx#:~:text=title), [sample_attribute.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts#:~:text=title), [sample_attribute_kpi.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts#:~:text=title), [sample_attribute_with_reference_lines.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts#:~:text=title), [test_formula_metric_attribute.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts#:~:text=title), [single_metric_attributes.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts#:~:text=title), [single_metric_attributes.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts#:~:text=title)+ 2 more | - | -| | [use_discover_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx#:~:text=indexPatternId) | - | -| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts#:~:text=SavedObjectsStart), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts#:~:text=SavedObjectsStart) | - | +| | [observability_data_views.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts#:~:text=title), [report_definition_field.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx#:~:text=title), [use_filter_values.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts#:~:text=title), [filter_value_btn.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx#:~:text=title), [sample_attribute.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts#:~:text=title), [sample_attribute_kpi.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts#:~:text=title), [sample_attribute_with_reference_lines.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts#:~:text=title), [test_formula_metric_attribute.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts#:~:text=title), [single_metric_attributes.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts#:~:text=title), [single_metric_attributes.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts#:~:text=title)+ 2 more | - | +| | [use_discover_link.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx#:~:text=indexPatternId) | - | +| | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts#:~:text=SavedObjectsStart), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts#:~:text=SavedObjectsStart) | - | @@ -862,6 +945,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [download.ts](https://github.com/elastic/kibana/tree/main/src/plugins/files/server/routes/public_facing/download.ts#:~:text=authRequired) | - | | | [file_service_factory.ts](https://github.com/elastic/kibana/tree/main/src/plugins/files/server/file_service/file_service_factory.ts#:~:text=audit), [file_service_factory.ts](https://github.com/elastic/kibana/tree/main/src/plugins/files/server/file_service/file_service_factory.ts#:~:text=audit) | - | @@ -973,11 +1057,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] -## investigateApp +## interactiveSetup | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [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) | - | +| | [configure.ts](https://github.com/elastic/kibana/tree/main/src/plugins/interactive_setup/server/routes/configure.ts#:~:text=authRequired), [enroll.ts](https://github.com/elastic/kibana/tree/main/src/plugins/interactive_setup/server/routes/enroll.ts#:~:text=authRequired), [ping.ts](https://github.com/elastic/kibana/tree/main/src/plugins/interactive_setup/server/routes/ping.ts#:~:text=authRequired), [status.ts](https://github.com/elastic/kibana/tree/main/src/plugins/interactive_setup/server/routes/status.ts#:~:text=authRequired), [verify.ts](https://github.com/elastic/kibana/tree/main/src/plugins/interactive_setup/server/routes/verify.ts#:~:text=authRequired) | - | @@ -1107,17 +1191,35 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/plugin.ts#:~:text=license%24) | 8.8.0 | | | [annotations.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/routes/annotations.ts#:~:text=authc) | - | | | [initialization.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/saved_objects/initialization/initialization.ts#:~:text=authz), [sync_task.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/saved_objects/sync_task.ts#:~:text=authz), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/plugin.ts#:~:text=authz), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/plugin.ts#:~:text=authz) | - | +| | [capabilities_switcher.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/lib/capabilities/capabilities_switcher.ts#:~:text=authRequired) | - | | | [kibana.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/common/types/kibana.ts#:~:text=SimpleSavedObject), [kibana.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/common/types/kibana.ts#:~:text=SimpleSavedObject) | - | | | [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/common/types/modules.ts#:~:text=SavedObjectAttributes), [modules.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/common/types/modules.ts#:~:text=SavedObjectAttributes) | - | | | [saved_objects.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/saved_objects/saved_objects.ts#:~:text=migrations), [saved_objects.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/saved_objects/saved_objects.ts#:~:text=migrations), [saved_objects.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/ml/server/saved_objects/saved_objects.ts#:~:text=migrations) | - | +## mockIdpPlugin + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-mock-idp-plugin/server/plugin.ts#:~:text=authRequired), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-mock-idp-plugin/server/plugin.ts#:~:text=authRequired), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-mock-idp-plugin/server/plugin.ts#:~:text=authRequired), [plugin.ts](https://github.com/elastic/kibana/tree/main/packages/kbn-mock-idp-plugin/server/plugin.ts#:~:text=authRequired) | - | + + + ## monitoring | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [url_state.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/public/url_state.ts#:~:text=syncQueryStateWithUrl), [url_state.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/public/url_state.ts#:~:text=syncQueryStateWithUrl) | - | +| | [header_menu_portal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx#:~:text=toMountPoint), [header_menu_portal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx#:~:text=toMountPoint) | - | + + + +## monitoringCollection + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [get_metrics_by_type.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts#:~:text=authRequired), [get_metrics.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts#:~:text=authRequired) | - | @@ -1125,7 +1227,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts#:~:text=authc), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts#:~:text=authc) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts#:~:text=authc), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts#:~:text=authc) | - | @@ -1133,7 +1235,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx#:~:text=wrapWithTheme), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx#:~:text=wrapWithTheme) | - | +| | [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx#:~:text=wrapWithTheme), [app.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx#:~:text=wrapWithTheme) | - | @@ -1314,6 +1416,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [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.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/plugin.ts#:~:text=license%24) | 8.8.0 | | | [logout_app.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/authentication/logout/logout_app.test.ts#:~:text=appBasePath) | - | +| | [common.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/common.ts#:~:text=authRequired), [common.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/common.ts#:~:text=authRequired), [oidc.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/oidc.ts#:~:text=authRequired), [oidc.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/oidc.ts#:~:text=authRequired), [oidc.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/oidc.ts#:~:text=authRequired), [oidc.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/oidc.ts#:~:text=authRequired), [oidc.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/oidc.ts#:~:text=authRequired), [saml.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authentication/saml.ts#:~:text=authRequired), [reset_session_page.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/authorization/reset_session_page.ts#:~:text=authRequired), [capture_url.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/routes/views/capture_url.ts#:~:text=authRequired)+ 12 more | - | | | [config.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/server/config.ts#:~:text=max) | - | | | [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/plugin.tsx#:~:text=authc) | - | | | [plugin.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security/public/plugin.tsx#:~:text=authc) | - | @@ -1352,6 +1455,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | | [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)+ 70 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) | - | +| | [agent_status_handler.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [resolver.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts#:~:text=authRequired), [update_insight.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts#:~:text=authRequired), [get_insights.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts#:~:text=authRequired), [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts#:~:text=authRequired)+ 19 more | - | | | [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) | - | | | [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion), [host_risk_score_dashboards.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/risk_score/prebuilt_saved_objects/saved_object/host_risk_score_dashboards.ts#:~:text=migrationVersion)+ 34 more | - | | | [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_types.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes), [legacy_migrations.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_migrations.ts#:~:text=SavedObjectAttributes) | - | @@ -1418,6 +1522,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | ---------------|-----------|-----------| | | [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) | 8.8.0 | | | [spaces_usage_collector.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/plugin.ts#:~:text=license%24), [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/plugin.ts#:~:text=license%24), [spaces_usage_collector.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/usage_collection/spaces_usage_collector.test.ts#:~:text=license%24) | 8.8.0 | +| | [capabilities_switcher.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/capabilities/capabilities_switcher.ts#:~:text=authRequired) | - | | | [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/legacy_urls/types.ts#:~:text=ResolvedSimpleSavedObject), [types.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/legacy_urls/types.ts#:~:text=ResolvedSimpleSavedObject) | - | | | [copy_to_space_flyout_internal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx#:~:text=createNewCopy) | - | | | [saved_objects_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts#:~:text=migrations), [saved_objects_service.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/spaces/server/saved_objects/saved_objects_service.ts#:~:text=migrations) | - | @@ -1442,11 +1547,11 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [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) | - | -| | [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [enablement.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts#:~:text=authc), [enablement.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc)+ 6 more | - | -| | [synthetics_monitor.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts#:~:text=migrations) | - | +| | [stderr_logs.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/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/solutions/observability/plugins/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/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts#:~:text=policy_id) | - | +| | [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [enablement.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts#:~:text=authc), [enablement.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc), [get_api_key.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts#:~:text=authc)+ 6 more | - | +| | [synthetics_monitor.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor.ts#:~:text=migrations) | - | @@ -1454,6 +1559,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| +| | [background_task_utilization.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/routes/background_task_utilization.ts#:~:text=authRequired), [background_task_utilization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts#:~:text=authRequired), [background_task_utilization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts#:~:text=authRequired), [background_task_utilization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts#:~:text=authRequired), [background_task_utilization.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts#:~:text=authRequired) | - | | | [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes), [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes), [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes), [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes), [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes), [task_store.test.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/task_store.test.ts#:~:text=SavedObjectAttributes) | - | | | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/task_manager/server/saved_objects/index.ts#:~:text=migrations) | - | @@ -1464,6 +1570,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [telemetry_usage_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/telemetry/server/routes/telemetry_usage_stats.ts#:~:text=get), [telemetry_usage_stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/telemetry/server/routes/telemetry_usage_stats.ts#:~:text=get) | - | +| | [telemetry_config.ts](https://github.com/elastic/kibana/tree/main/src/plugins/telemetry/server/routes/telemetry_config.ts#:~:text=authRequired) | - | @@ -1471,7 +1578,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions) | - | +| | [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions), [add_to_timeline.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx#:~:text=getHoverActions) | - | @@ -1479,7 +1586,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts#:~:text=title) | - | +| | [index.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts#:~:text=title) | - | @@ -1541,8 +1648,16 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title) | - | -| | [uptime_settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts#:~:text=migrations) | - | +| | [filter_group.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx#:~:text=title), [filters_expression_select.tsx](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx#:~:text=title) | - | +| | [uptime_settings.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts#:~:text=migrations) | - | + + + +## usageCollection + +| Deprecated API | Reference location(s) | Remove By | +| ---------------|-----------|-----------| +| | [stats.ts](https://github.com/elastic/kibana/tree/main/src/plugins/usage_collection/server/routes/stats/stats.ts#:~:text=authRequired) | - | @@ -1550,7 +1665,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| -| | [use_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts#:~:text=title) | - | +| | [use_data_view.ts](https://github.com/elastic/kibana/tree/main/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts#:~:text=title) | - | @@ -1612,6 +1727,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Deprecated API | Reference location(s) | Remove By | | ---------------|-----------|-----------| | | [search_selection.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/wizard/search_selection/search_selection.tsx#:~:text=includeFields), [visualize_embeddable_factory.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx#:~:text=includeFields) | - | +| | [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=savedObjects), [visualize_listing.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx#:~:text=savedObjects) | - | | | [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=SavedObjectsClientContract), [plugin.ts](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/plugin.ts#:~:text=SavedObjectsClientContract) | - | | | [visualize_listing.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/visualize_app/components/visualize_listing.tsx#:~:text=delete) | - | diff --git a/api_docs/deprecations_by_team.mdx b/api_docs/deprecations_by_team.mdx index 9d0be81c71e9..b9d8bc0329a3 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -42,7 +42,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| -| dashboard | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | +| presentationUtil | | [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [saved_object_save_modal_dashboard.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_container/embeddable/api/overlays/save_modal.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [add_to_library_action.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/dashboard/public/dashboard_actions/add_to_library_action.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal), [save_to_library.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/links/public/content_management/save_to_library.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | @@ -72,7 +72,7 @@ migrates to using the Kibana Privilege model: https://github.com/elastic/kibana/ | Plugin | Deprecated API | Reference location(s) | Remove By | | --------|-------|-----------|-----------| | graph | | [plugin.ts](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/server/plugin.ts#:~:text=license%24) | 8.8.0 | -| graph | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_action.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx#:~:text=SavedObjectSaveModal), [save_action.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | +| graph | | [save_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_modal.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/graph/public/components/save_modal.tsx#:~:text=SavedObjectSaveModal), [save_action.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx#:~:text=SavedObjectSaveModal), [save_action.tsx](https://github.com/elastic/kibana/tree/main/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal), [attribute_service.tsx](https://github.com/elastic/kibana/tree/main/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx#:~:text=SavedObjectSaveModal) | 8.8.0 | diff --git a/api_docs/dev_tools.mdx b/api_docs/dev_tools.mdx index 120607e83301..12fab76810c3 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-12-10 +date: 2024-12-13 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 8536402e375e..68d38c469b44 100644 --- a/api_docs/discover.devdocs.json +++ b/api_docs/discover.devdocs.json @@ -1171,6 +1171,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "discover", + "id": "def-public.DiscoverServices.userProfile", + "type": "Object", + "tags": [], + "label": "userProfile", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-user-profile-browser", + "scope": "public", + "docId": "kibKbnCoreUserProfileBrowserPluginApi", + "section": "def-public.UserProfileService", + "text": "UserProfileService" + } + ], + "path": "src/plugins/discover/public/build_services.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "discover", "id": "def-public.DiscoverServices.filterManager", @@ -3699,7 +3719,11 @@ "section": "def-public.SerializedTimeRange", "text": "SerializedTimeRange" }, - " & { savedObjectTitle?: string | undefined; savedObjectId?: string | undefined; savedObjectDescription?: string | undefined; nonPersistedDisplayOptions?: ", + " & { rawSavedObjectAttributes?: Partial> | undefined; savedObjectTitle?: string | undefined; savedObjectId?: string | undefined; savedObjectDescription?: string | undefined; nonPersistedDisplayOptions?: ", { "pluginId": "discover", "scope": "public", @@ -4710,10 +4734,6 @@ "plugin": "fleet", "path": "x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/multi_page_layout/hooks/use_get_logs_discover_link.tsx" }, - { - "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" - }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/public/packs/pack_queries_status_table.tsx" @@ -4726,9 +4746,13 @@ "plugin": "osquery", "path": "x-pack/plugins/osquery/public/common/hooks/use_discover_link.tsx" }, + { + "plugin": "exploratoryView", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx" + }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx" + "path": "x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx" } ] }, diff --git a/api_docs/discover.mdx b/api_docs/discover.mdx index 65ee06b1e48b..b2e8aa2958db 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 214 | 0 | 166 | 30 | +| 215 | 0 | 167 | 30 | ## Client diff --git a/api_docs/discover_enhanced.mdx b/api_docs/discover_enhanced.mdx index db1b8f1e5cc3..6175a1a6256c 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-12-10 +date: 2024-12-13 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 174c8d511341..be00d181f7fe 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-12-10 +date: 2024-12-13 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 b6eeb24fdb05..294da8133f5a 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-12-10 +date: 2024-12-13 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 6292df433806..953a10650dc7 100644 --- a/api_docs/elastic_assistant.devdocs.json +++ b/api_docs/elastic_assistant.devdocs.json @@ -1944,26 +1944,6 @@ "deprecated": false, "trackAdoption": false }, - { - "parentPluginId": "elasticAssistant", - "id": "def-server.ElasticAssistantPluginStartDependencies.security", - "type": "Object", - "tags": [], - "label": "security", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-security-server", - "scope": "server", - "docId": "kibKbnCoreSecurityServerPluginApi", - "section": "def-server.SecurityServiceStart", - "text": "SecurityServiceStart" - } - ], - "path": "x-pack/plugins/elastic_assistant/server/types.ts", - "deprecated": false, - "trackAdoption": false - }, { "parentPluginId": "elasticAssistant", "id": "def-server.ElasticAssistantPluginStartDependencies.licensing", diff --git a/api_docs/elastic_assistant.mdx b/api_docs/elastic_assistant.mdx index 6b43f2332caf..3bf57bc43b9c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'elasticAssistant'] --- import elasticAssistantObj from './elastic_assistant.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 | |-------------------|-----------|------------------------|-----------------| -| 56 | 0 | 41 | 2 | +| 55 | 0 | 40 | 2 | ## Server diff --git a/api_docs/embeddable.devdocs.json b/api_docs/embeddable.devdocs.json index 23bb84e398ae..4e5cef1a2d21 100644 --- a/api_docs/embeddable.devdocs.json +++ b/api_docs/embeddable.devdocs.json @@ -2,377 +2,6 @@ "id": "embeddable", "client": { "classes": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService", - "type": "Class", - "tags": [], - "label": "AttributeService", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.AttributeService", - "text": "AttributeService" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.Unnamed.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.Unnamed.$2", - "type": "Object", - "tags": [], - "label": "toasts", - "description": [], - "signature": [ - { - "pluginId": "@kbn/core-notifications-browser", - "scope": "public", - "docId": "kibKbnCoreNotificationsBrowserPluginApi", - "section": "def-public.IToasts", - "text": "IToasts" - } - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.Unnamed.$3", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "AttributeServiceOptions", - "" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.Unnamed.$4", - "type": "Function", - "tags": [], - "label": "getEmbeddableFactory", - "description": [], - "signature": [ - "((embeddableFactoryId: string) => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableFactory", - "text": "EmbeddableFactory" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any>, ", - { - "pluginId": "savedObjectsFinder", - "scope": "common", - "docId": "kibSavedObjectsFinderPluginApi", - "section": "def-common.FinderAttributes", - "text": "FinderAttributes" - }, - ">) | undefined" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.unwrapAttributes", - "type": "Function", - "tags": [], - "label": "unwrapAttributes", - "description": [], - "signature": [ - "(input: ValType | RefType) => Promise<", - "AttributeServiceUnwrapResult", - ">" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.unwrapAttributes.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "ValType | RefType" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.wrapAttributes", - "type": "Function", - "tags": [], - "label": "wrapAttributes", - "description": [], - "signature": [ - "(newAttributes: SavedObjectAttributes, useRefType: boolean, input?: ValType | RefType | undefined) => Promise>" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.wrapAttributes.$1", - "type": "Uncategorized", - "tags": [], - "label": "newAttributes", - "description": [], - "signature": [ - "SavedObjectAttributes" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.wrapAttributes.$2", - "type": "boolean", - "tags": [], - "label": "useRefType", - "description": [], - "signature": [ - "boolean" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.wrapAttributes.$3", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "ValType | RefType | undefined" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.inputIsRefType", - "type": "Function", - "tags": [], - "label": "inputIsRefType", - "description": [], - "signature": [ - "(input: ValType | RefType) => input is RefType" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.inputIsRefType.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "ValType | RefType" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.getInputAsValueType", - "type": "Function", - "tags": [], - "label": "getInputAsValueType", - "description": [], - "signature": [ - "(input: ValType | RefType) => Promise" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.getInputAsValueType.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "ValType | RefType" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.getInputAsRefType", - "type": "Function", - "tags": [], - "label": "getInputAsRefType", - "description": [], - "signature": [ - "(input: ValType | RefType, saveOptions?: { showSaveModal: boolean; saveModalTitle?: string | undefined; } | { title: string; } | undefined) => Promise" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.getInputAsRefType.$1", - "type": "CompoundType", - "tags": [], - "label": "input", - "description": [], - "signature": [ - "ValType | RefType" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.AttributeService.getInputAsRefType.$2", - "type": "CompoundType", - "tags": [], - "label": "saveOptions", - "description": [], - "signature": [ - "{ showSaveModal: boolean; saveModalTitle?: string | undefined; } | { title: string; } | undefined" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.Container", @@ -8176,142 +7805,32 @@ "parentPluginId": "embeddable", "id": "def-public.EmbeddablePanel", "type": "Function", - "tags": [ - "deprecated" - ], - "label": "EmbeddablePanel", - "description": [], - "signature": [ - "(props: ", - "EmbeddablePanelProps", - ") => React.JSX.Element" - ], - "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", - "deprecated": true, - "trackAdoption": false, - "references": [ - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx" - }, - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx" - } - ], - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddablePanel.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [], - "signature": [ - "EmbeddablePanelProps" - ], - "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableRenderer", - "type": "Function", - "tags": [], - "label": "EmbeddableRenderer", - "description": [ - "\nHelper react component to render an embeddable\nCan be used if you have an embeddable object or an embeddable factory\nSupports updating input by passing `input` prop\n" - ], - "signature": [ - "(props: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableRendererProps", - "text": "EmbeddableRendererProps" - }, - ") => React.JSX.Element" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableRenderer.$1", - "type": "CompoundType", - "tags": [], - "label": "props", - "description": [ - "- {@link EmbeddableRendererProps }" - ], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableRendererProps", - "text": "EmbeddableRendererProps" - }, - "" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableRoot", - "type": "Function", - "tags": [], - "label": "EmbeddableRoot", + "tags": [ + "deprecated" + ], + "label": "EmbeddablePanel", "description": [], "signature": [ - "({ embeddable, loading, error, input }: Props) => React.JSX.Element" + "(props: ", + "EmbeddablePanelProps", + ") => React.JSX.Element" ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx", - "deprecated": false, + "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", + "deprecated": true, "trackAdoption": false, + "references": [], "children": [ { "parentPluginId": "embeddable", - "id": "def-public.EmbeddableRoot.$1", - "type": "Object", + "id": "def-public.EmbeddablePanel.$1", + "type": "CompoundType", "tags": [], - "label": "{ embeddable, loading, error, input }", + "label": "props", "description": [], "signature": [ - "Props" + "EmbeddablePanelProps" ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx", + "path": "src/plugins/embeddable/public/embeddable_panel/embeddable_panel.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9163,7 +8682,7 @@ "section": "def-public.PresentationPanelProps", "text": "PresentationPanelProps" }, - ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\" | \"getActions\"> | undefined; hidePanelChrome?: boolean | undefined; onAnyStateChange?: ((state: ", + ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\" | \"getActions\" | \"setDragHandles\"> | undefined; hidePanelChrome?: boolean | undefined; onAnyStateChange?: ((state: ", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -9277,7 +8796,7 @@ "section": "def-public.PresentationPanelProps", "text": "PresentationPanelProps" }, - ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\" | \"getActions\"> | undefined" + ", \"showShadow\" | \"showBorder\" | \"showBadges\" | \"showNotifications\" | \"hideLoader\" | \"hideHeader\" | \"hideInspector\" | \"getActions\" | \"setDragHandles\"> | undefined" ], "path": "src/plugins/embeddable/public/react_embeddable_system/react_embeddable_renderer.tsx", "deprecated": false, @@ -9565,63 +9084,6 @@ "returnComment": [], "initialIsOpen": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.useEmbeddableFactory", - "type": "Function", - "tags": [], - "label": "useEmbeddableFactory", - "description": [], - "signature": [ - "({\n input,\n factory,\n onInputUpdated,\n}: EmbeddableRendererWithFactory) => readonly [", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.ErrorEmbeddable", - "text": "ErrorEmbeddable" - }, - " | ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - " | undefined, boolean, string | undefined]" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.useEmbeddableFactory.$1", - "type": "Object", - "tags": [], - "label": "{\n input,\n factory,\n onInputUpdated,\n}", - "description": [], - "signature": [ - "EmbeddableRendererWithFactory" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.withEmbeddableSubscription", @@ -10011,20 +9473,7 @@ "path": "src/plugins/embeddable/public/lib/triggers/triggers.ts", "deprecated": true, "trackAdoption": false, - "references": [ - { - "plugin": "embeddableEnhanced", - "path": "x-pack/plugins/embeddable_enhanced/public/plugin.ts" - }, - { - "plugin": "embeddableEnhanced", - "path": "x-pack/plugins/embeddable_enhanced/public/plugin.ts" - }, - { - "plugin": "embeddableEnhanced", - "path": "x-pack/plugins/embeddable_enhanced/public/plugin.ts" - } - ], + "references": [], "children": [ { "parentPluginId": "embeddable", @@ -13455,23 +12904,6 @@ } ], "misc": [ - { - "parentPluginId": "embeddable", - "id": "def-public.ATTRIBUTE_SERVICE_KEY", - "type": "string", - "tags": [], - "label": "ATTRIBUTE_SERVICE_KEY", - "description": [ - "\nThe attribute service is a shared, generic service that embeddables can use to provide the functionality\nrequired to fulfill the requirements of the ReferenceOrValueEmbeddable interface. The attribute_service\ncan also be used as a higher level wrapper to transform an embeddable input shape that references a saved object\ninto an embeddable input shape that contains that saved object's attributes by value." - ], - "signature": [ - "\"attributes\"" - ], - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.CELL_VALUE_TRIGGER", @@ -13648,23 +13080,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableRendererProps", - "type": "Type", - "tags": [], - "label": "EmbeddableRendererProps", - "description": [ - "\nThis type is a publicly exposed props of {@link EmbeddableRenderer}\nUnion is used to validate that or factory or embeddable is passed in, but it can't be both simultaneously\nIn case when embeddable is passed in, input is optional, because there is already an input inside of embeddable object\nIn case when factory is used, then input is required, because it will be used as initial input to create an embeddable object" - ], - "signature": [ - "EmbeddableRendererPropsWithEmbeddable | EmbeddableRendererWithFactory" - ], - "path": "src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "embeddable", "id": "def-public.MULTI_VALUE_CLICK_TRIGGER", @@ -14747,48 +14162,6 @@ } ], "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableSetup.setCustomEmbeddableFactoryProvider", - "type": "Function", - "tags": [ - "deprecated" - ], - "label": "setCustomEmbeddableFactoryProvider", - "description": [], - "signature": [ - "(customProvider: ", - "EmbeddableFactoryProvider", - ") => void" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": true, - "trackAdoption": false, - "references": [ - { - "plugin": "embeddableEnhanced", - "path": "x-pack/plugins/embeddable_enhanced/public/plugin.ts" - } - ], - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableSetup.setCustomEmbeddableFactoryProvider.$1", - "type": "Function", - "tags": [], - "label": "customProvider", - "description": [], - "signature": [ - "EmbeddableFactoryProvider" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] } ], "lifecycle": "setup", @@ -14831,40 +14204,6 @@ "deprecated": false, "trackAdoption": false, "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStart.reactEmbeddableRegistryHasKey", - "type": "Function", - "tags": [], - "label": "reactEmbeddableRegistryHasKey", - "description": [ - "\nChecks if a {@link ReactEmbeddableFactory} has been registered using {@link registerReactEmbeddableFactory}" - ], - "signature": [ - "(type: string) => boolean" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStart.reactEmbeddableRegistryHasKey.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, { "parentPluginId": "embeddable", "id": "def-public.EmbeddableStart.getEmbeddableFactory", @@ -14944,56 +14283,7 @@ "path": "src/plugins/embeddable/public/plugin.tsx", "deprecated": true, "trackAdoption": false, - "references": [ - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx" - }, - { - "plugin": "investigateApp", - "path": "x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts" - }, - { - "plugin": "dashboard", - "path": "src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts" - } - ], + "references": [], "children": [ { "parentPluginId": "embeddable", @@ -15085,10 +14375,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "canvas", - "path": "x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx" - }, { "plugin": "canvas", "path": "x-pack/plugins/canvas/public/components/workpad_header/editor_menu/editor_menu.tsx" @@ -15150,96 +14436,6 @@ } ], "returnComment": [] - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStart.getAttributeService", - "type": "Function", - "tags": [], - "label": "getAttributeService", - "description": [], - "signature": [ - "(type: string, options: ", - "AttributeServiceOptions", - ") => ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.AttributeService", - "text": "AttributeService" - }, - "" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStart.getAttributeService.$1", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "string" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "embeddable", - "id": "def-public.EmbeddableStart.getAttributeService.$2", - "type": "Object", - "tags": [], - "label": "options", - "description": [], - "signature": [ - "AttributeServiceOptions", - "" - ], - "path": "src/plugins/embeddable/public/plugin.tsx", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] } ], "lifecycle": "start", diff --git a/api_docs/embeddable.mdx b/api_docs/embeddable.mdx index 322a77db05fd..27188dbca2db 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddable'] --- import embeddableObj from './embeddable.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 | |-------------------|-----------|------------------------|-----------------| -| 571 | 1 | 462 | 9 | +| 537 | 1 | 433 | 6 | ## Client diff --git a/api_docs/embeddable_enhanced.devdocs.json b/api_docs/embeddable_enhanced.devdocs.json index a9e2fd9be15e..c8578b855fb3 100644 --- a/api_docs/embeddable_enhanced.devdocs.json +++ b/api_docs/embeddable_enhanced.devdocs.json @@ -70,92 +70,6 @@ } ], "interfaces": [ - { - "parentPluginId": "embeddableEnhanced", - "id": "def-public.EnhancedEmbeddableContext", - "type": "Interface", - "tags": [ - "deprecated" - ], - "label": "EnhancedEmbeddableContext", - "description": [], - "path": "x-pack/plugins/embeddable_enhanced/public/types.ts", - "deprecated": true, - "trackAdoption": false, - "references": [], - "children": [ - { - "parentPluginId": "embeddableEnhanced", - "id": "def-public.EnhancedEmbeddableContext.embeddable", - "type": "CompoundType", - "tags": [], - "label": "embeddable", - "description": [], - "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.IEmbeddable", - "text": "IEmbeddable" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", any> & Partial<{ enhancements: { dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "public", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-public.DynamicActionManager", - "text": "DynamicActionManager" - }, - "; }; setDynamicActions: (newState: { dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "common", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-common.DynamicActionsState", - "text": "DynamicActionsState" - }, - "; } | undefined) => void; dynamicActionsState$: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" - }, - "<{ dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "common", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-common.DynamicActionsState", - "text": "DynamicActionsState" - }, - "; } | undefined>; }>" - ], - "path": "x-pack/plugins/embeddable_enhanced/public/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, { "parentPluginId": "embeddableEnhanced", "id": "def-public.SetupDependencies", @@ -267,75 +181,6 @@ ], "enums": [], "misc": [ - { - "parentPluginId": "embeddableEnhanced", - "id": "def-public.drilldownGrouping", - "type": "Array", - "tags": [], - "label": "drilldownGrouping", - "description": [], - "signature": [ - { - "pluginId": "@kbn/ui-actions-browser", - "scope": "common", - "docId": "kibKbnUiActionsBrowserPluginApi", - "section": "def-common.PresentableGroup", - "text": "PresentableGroup" - }, - "[]" - ], - "path": "x-pack/plugins/embeddable_enhanced/public/actions/drilldown_grouping.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "embeddableEnhanced", - "id": "def-public.EnhancedEmbeddable", - "type": "Type", - "tags": [], - "label": "EnhancedEmbeddable", - "description": [], - "signature": [ - "E & Partial<{ enhancements: { dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "public", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-public.DynamicActionManager", - "text": "DynamicActionManager" - }, - "; }; setDynamicActions: (newState: { dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "common", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-common.DynamicActionsState", - "text": "DynamicActionsState" - }, - "; } | undefined) => void; dynamicActionsState$: ", - { - "pluginId": "@kbn/presentation-publishing", - "scope": "public", - "docId": "kibKbnPresentationPublishingPluginApi", - "section": "def-public.PublishingSubject", - "text": "PublishingSubject" - }, - "<{ dynamicActions: ", - { - "pluginId": "uiActionsEnhanced", - "scope": "common", - "docId": "kibUiActionsEnhancedPluginApi", - "section": "def-common.DynamicActionsState", - "text": "DynamicActionsState" - }, - "; } | undefined>; }>" - ], - "path": "x-pack/plugins/embeddable_enhanced/public/types.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "embeddableEnhanced", "id": "def-public.HasDynamicActions", diff --git a/api_docs/embeddable_enhanced.mdx b/api_docs/embeddable_enhanced.mdx index 27b652f7f4ea..f0fad4aaa5be 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'embeddableEnhanced'] --- import embeddableEnhancedObj from './embeddable_enhanced.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 | |-------------------|-----------|------------------------|-----------------| -| 19 | 0 | 19 | 2 | +| 15 | 0 | 15 | 2 | ## Client diff --git a/api_docs/encrypted_saved_objects.mdx b/api_docs/encrypted_saved_objects.mdx index 82b512914871..7b721c186ea9 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-12-10 +date: 2024-12-13 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 f5e294b71240..64965db5c00d 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-12-10 +date: 2024-12-13 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 4fc0397643c0..de7aa14d10fe 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'entitiesDataAccess'] --- import entitiesDataAccessObj from './entities_data_access.devdocs.json'; diff --git a/api_docs/entity_manager.devdocs.json b/api_docs/entity_manager.devdocs.json index 9359e3ca7c1d..3d7cc496fbc2 100644 --- a/api_docs/entity_manager.devdocs.json +++ b/api_docs/entity_manager.devdocs.json @@ -21,7 +21,7 @@ "label": "repositoryClient", "description": [], "signature": [ - "(endpoint: TEndpoint, ...args: MaybeOptionalArgs<", + "(endpoint: TEndpoint, ...args: MaybeOptionalArgs<", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -29,7 +29,25 @@ "section": "def-common.ClientRequestParamsOf", "text": "ClientRequestParamsOf" }, - "<{ \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", + "<{ \"POST /internal/entities/v2/_count\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/entities/v2/_count\", Zod.ZodObject<{ body: Zod.ZodObject<{ types: Zod.ZodOptional>; filters: Zod.ZodOptional>; start: Zod.ZodEffects>, string, string | undefined>; end: Zod.ZodEffects>, string, string | undefined>; }, \"strip\", Zod.ZodTypeAny, { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }, { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { body: { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }; }, { body: { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }; }>, ", + "EntityManagerRouteHandlerResources", + ", ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, + "<{ total: number; types: Record; errors: string[]; }>, undefined>; \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -65,7 +83,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ source: { id: string; filters: string[]; metadata_fields: string[]; type_id: string; index_patterns: string[]; identity_fields: string[]; timestamp_field?: string | undefined; display_name?: string | undefined; }; }>, undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", + ", undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -75,7 +93,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ types: { id: string; }[]; }>>; security?: ", + "<{ types: { id: string; display_name: string; }[]; }>>; security?: ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -91,7 +109,7 @@ "section": "def-common.ServerRoute", "text": "ServerRoute" }, - "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; }; }, { type: { id: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; }; }; }, { body: { type: { id: string; }; }; }>, ", + "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; display_name: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; display_name: string; }, { id: string; display_name: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; display_name: string; }; }, { type: { id: string; display_name: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; display_name: string; }; }; }, { body: { type: { id: string; display_name: string; }; }; }>, ", "EntityManagerRouteHandlerResources", ", ", { @@ -127,7 +145,7 @@ "section": "def-common.EntityV2", "text": "EntityV2" }, - "[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", + "[]; errors: string[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -449,7 +467,25 @@ "section": "def-common.ReturnOf", "text": "ReturnOf" }, - "<{ \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", + "<{ \"POST /internal/entities/v2/_count\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/entities/v2/_count\", Zod.ZodObject<{ body: Zod.ZodObject<{ types: Zod.ZodOptional>; filters: Zod.ZodOptional>; start: Zod.ZodEffects>, string, string | undefined>; end: Zod.ZodEffects>, string, string | undefined>; }, \"strip\", Zod.ZodTypeAny, { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }, { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { body: { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }; }, { body: { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }; }>, ", + "EntityManagerRouteHandlerResources", + ", ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, + "<{ total: number; types: Record; errors: string[]; }>, undefined>; \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -485,7 +521,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ source: { id: string; filters: string[]; metadata_fields: string[]; type_id: string; index_patterns: string[]; identity_fields: string[]; timestamp_field?: string | undefined; display_name?: string | undefined; }; }>, undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", + ", undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -495,7 +531,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ types: { id: string; }[]; }>>; security?: ", + "<{ types: { id: string; display_name: string; }[]; }>>; security?: ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -511,7 +547,7 @@ "section": "def-common.ServerRoute", "text": "ServerRoute" }, - "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; }; }, { type: { id: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; }; }; }, { body: { type: { id: string; }; }; }>, ", + "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; display_name: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; display_name: string; }, { id: string; display_name: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; display_name: string; }; }, { type: { id: string; display_name: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; display_name: string; }; }; }, { body: { type: { id: string; display_name: string; }; }; }>, ", "EntityManagerRouteHandlerResources", ", ", { @@ -547,7 +583,7 @@ "section": "def-common.EntityV2", "text": "EntityV2" }, - "[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", + "[]; errors: string[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -1458,7 +1494,25 @@ "label": "EntityManagerRouteRepository", "description": [], "signature": [ - "{ \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", + "{ \"POST /internal/entities/v2/_count\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/entities/v2/_count\", Zod.ZodObject<{ body: Zod.ZodObject<{ types: Zod.ZodOptional>; filters: Zod.ZodOptional>; start: Zod.ZodEffects>, string, string | undefined>; end: Zod.ZodEffects>, string, string | undefined>; }, \"strip\", Zod.ZodTypeAny, { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }, { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { body: { start: string; end: string; filters?: string[] | undefined; types?: string[] | undefined; }; }, { body: { start?: string | undefined; end?: string | undefined; filters?: string[] | undefined; types?: string[] | undefined; }; }>, ", + "EntityManagerRouteHandlerResources", + ", ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.IKibanaResponse", + "text": "IKibanaResponse" + }, + "<{ total: number; types: Record; errors: string[]; }>, undefined>; \"GET /internal/entities/v2/definitions/sources\": { endpoint: \"GET /internal/entities/v2/definitions/sources\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -1494,7 +1548,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ source: { id: string; filters: string[]; metadata_fields: string[]; type_id: string; index_patterns: string[]; identity_fields: string[]; timestamp_field?: string | undefined; display_name?: string | undefined; }; }>, undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", + ", undefined>; \"GET /internal/entities/v2/definitions/types\": { endpoint: \"GET /internal/entities/v2/definitions/types\"; handler: ServerRouteHandler<", "EntityManagerRouteHandlerResources", ", undefined, ", { @@ -1504,7 +1558,7 @@ "section": "def-server.IKibanaResponse", "text": "IKibanaResponse" }, - "<{ types: { id: string; }[]; }>>; security?: ", + "<{ types: { id: string; display_name: string; }[]; }>>; security?: ", { "pluginId": "@kbn/core-http-server", "scope": "server", @@ -1520,7 +1574,7 @@ "section": "def-common.ServerRoute", "text": "ServerRoute" }, - "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; }; }, { type: { id: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; }; }; }, { body: { type: { id: string; }; }; }>, ", + "<\"POST /internal/entities/v2/definitions/types\", Zod.ZodObject<{ body: Zod.ZodObject<{ type: Zod.ZodObject<{ id: Zod.ZodString; display_name: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; display_name: string; }, { id: string; display_name: string; }>; }, \"strip\", Zod.ZodTypeAny, { type: { id: string; display_name: string; }; }, { type: { id: string; display_name: string; }; }>; }, \"strip\", Zod.ZodTypeAny, { body: { type: { id: string; display_name: string; }; }; }, { body: { type: { id: string; display_name: string; }; }; }>, ", "EntityManagerRouteHandlerResources", ", ", { @@ -1556,7 +1610,7 @@ "section": "def-common.EntityV2", "text": "EntityV2" }, - "[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", + "[]; errors: string[]; }>, undefined>; \"POST /internal/entities/v2/_search\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", diff --git a/api_docs/entity_manager.mdx b/api_docs/entity_manager.mdx index ae6ffb373ccb..cd2e53a31e97 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-12-10 +date: 2024-12-13 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 c829036ad027..7a1680fcb11b 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-12-10 +date: 2024-12-13 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 b4ff3ce93c73..e7e84deda4af 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-12-10 +date: 2024-12-13 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 b5060fdb0518..cd1de4f90654 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'esqlDataGrid'] --- import esqlDataGridObj from './esql_data_grid.devdocs.json'; diff --git a/api_docs/event_annotation.mdx b/api_docs/event_annotation.mdx index 11a33d66f096..7f10b62c71e3 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-12-10 +date: 2024-12-13 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 02d5d22af7bc..e87f3f1a2f79 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventAnnotationListing'] --- import eventAnnotationListingObj from './event_annotation_listing.devdocs.json'; diff --git a/api_docs/event_log.mdx b/api_docs/event_log.mdx index 9aa079d38af3..b337fc465171 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'eventLog'] --- import eventLogObj from './event_log.devdocs.json'; diff --git a/api_docs/exploratory_view.devdocs.json b/api_docs/exploratory_view.devdocs.json index 1e5af66252fb..3aed42a57a9a 100644 --- a/api_docs/exploratory_view.devdocs.json +++ b/api_docs/exploratory_view.devdocs.json @@ -23,7 +23,7 @@ }, "; }, baseHref: string) => string" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -34,7 +34,7 @@ "tags": [], "label": "{ reportType, allSeries }", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -48,7 +48,7 @@ "signature": [ "\"heatmap\" | \"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, "trackAdoption": false }, @@ -69,7 +69,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, "trackAdoption": false } @@ -85,7 +85,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -106,7 +106,7 @@ "ExploratoryViewPageProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -120,7 +120,7 @@ "signature": [ "ExploratoryViewPageProps" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -141,7 +141,7 @@ "FilterValueLabelProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -155,7 +155,7 @@ "signature": [ "FilterValueLabelProps" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -174,7 +174,7 @@ "signature": [ "(query: Record) => string" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -188,7 +188,7 @@ "signature": [ "Record" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -209,7 +209,7 @@ "SelectableUrlListProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -223,7 +223,7 @@ "signature": [ "SelectableUrlListProps" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -244,7 +244,7 @@ "ParsedQuery", "" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -258,7 +258,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -276,7 +276,7 @@ "tags": [], "label": "ConfigProps", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -297,7 +297,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -318,7 +318,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -332,7 +332,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false } @@ -346,7 +346,7 @@ "tags": [], "label": "ExploratoryEmbeddableProps", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -360,7 +360,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -374,7 +374,7 @@ "signature": [ "JSX.Element | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -395,7 +395,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -416,7 +416,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -437,7 +437,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -451,7 +451,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -465,7 +465,7 @@ "signature": [ "{ from: string; to: string; } | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -481,7 +481,7 @@ "AppDataType", ", string>> | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -495,7 +495,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -509,7 +509,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -524,7 +524,7 @@ "Position", " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -538,7 +538,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -552,7 +552,7 @@ "signature": [ "((param: { range: number[]; }) => void) | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -563,7 +563,7 @@ "tags": [], "label": "param", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -577,7 +577,7 @@ "signature": [ "number[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false } @@ -596,7 +596,7 @@ "signature": [ "((loading: boolean) => void) | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -610,7 +610,7 @@ "signature": [ "boolean" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -628,7 +628,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -643,7 +643,7 @@ "ReportConfigMap", " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -657,7 +657,7 @@ "signature": [ "\"heatmap\" | \"data-distribution\" | \"kpi-over-time\" | \"core-web-vitals\" | \"device-data-distribution\" | \"single-metric\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -671,7 +671,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -685,7 +685,7 @@ "signature": [ "string | JSX.Element | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -701,7 +701,7 @@ "ActionTypes", "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -715,7 +715,7 @@ "signature": [ "\"right\" | \"center\" | \"left\" | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -729,7 +729,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -743,7 +743,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -757,7 +757,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -771,7 +771,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -785,7 +785,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -799,7 +799,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false }, @@ -814,7 +814,7 @@ "QueryDslQueryContainer", "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx", "deprecated": false, "trackAdoption": false } @@ -828,7 +828,7 @@ "tags": [], "label": "ExploratoryViewPublicPluginsSetup", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -848,7 +848,7 @@ "text": "DataPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -896,7 +896,7 @@ }, ") => void; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -916,7 +916,7 @@ "text": "TriggersAndActionsUIPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -936,7 +936,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -957,7 +957,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false } @@ -971,7 +971,7 @@ "tags": [], "label": "ExploratoryViewPublicPluginsStart", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -991,7 +991,7 @@ "text": "CasesPublicStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1014,7 +1014,7 @@ "ActiveCursor", "; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1034,7 +1034,7 @@ "text": "DataPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1054,7 +1054,7 @@ "text": "DataViewsServicePublic" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1074,7 +1074,7 @@ "text": "DiscoverStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1094,7 +1094,7 @@ "text": "EmbeddableStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1114,7 +1114,7 @@ "text": "LensPublicStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1134,7 +1134,7 @@ "text": "LicensingPluginStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1178,7 +1178,7 @@ }, ">; }) => void; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1198,7 +1198,7 @@ "text": "SecurityPluginStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1238,7 +1238,7 @@ }, ">): void; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1259,7 +1259,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1279,7 +1279,7 @@ "text": "TriggersAndActionsUIPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1299,7 +1299,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1319,7 +1319,7 @@ "text": "UnifiedSearchPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1340,7 +1340,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -1361,7 +1361,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false } @@ -1375,7 +1375,7 @@ "tags": [], "label": "SeriesConfig", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1386,7 +1386,7 @@ "tags": [], "label": "reportType", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1416,7 +1416,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1438,7 +1438,7 @@ }, ">[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1452,7 +1452,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1466,7 +1466,7 @@ "signature": [ "\"area\" | \"line\" | \"bar\" | \"bar_stacked\" | \"area_stacked\" | \"bar_horizontal\" | \"bar_percentage_stacked\" | \"bar_horizontal_stacked\" | \"area_percentage_stacked\" | \"bar_horizontal_percentage_stacked\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1480,7 +1480,7 @@ "signature": [ "(string | { field: string; nested?: string | undefined; isNegated?: boolean | undefined; })[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1501,7 +1501,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1539,7 +1539,7 @@ }, ")[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1577,7 +1577,7 @@ }, ")[] | undefined; })[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1591,7 +1591,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1609,7 +1609,7 @@ "MetricOption", "[]; columnType?: string | undefined; })[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1623,7 +1623,7 @@ "signature": [ "{ [x: string]: string; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1634,7 +1634,7 @@ "tags": [], "label": "hasOperationType", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1655,7 +1655,7 @@ }, "<{ [key: string]: unknown; }> | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1669,7 +1669,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1690,7 +1690,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1704,7 +1704,7 @@ "signature": [ "{ query: string; language: \"kuery\"; } | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false } @@ -1718,7 +1718,7 @@ "tags": [], "label": "SeriesUrl", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1729,7 +1729,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1743,7 +1743,7 @@ "signature": [ "{ to: string; from: string; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1757,7 +1757,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1778,7 +1778,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1799,7 +1799,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1813,7 +1813,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1827,7 +1827,7 @@ "signature": [ "\"uptime\" | \"alerts\" | \"apm\" | \"synthetics\" | \"ux\" | \"infra_logs\" | \"infra_metrics\" | \"mobile\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1842,7 +1842,7 @@ "URLReportDefinition", " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1857,7 +1857,7 @@ "URLTextReportDefinition", " | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1871,7 +1871,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1885,7 +1885,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1899,7 +1899,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1913,7 +1913,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false } @@ -1927,7 +1927,7 @@ "tags": [], "label": "UrlFilter", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1938,7 +1938,7 @@ "tags": [], "label": "field", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1952,7 +1952,7 @@ "signature": [ "(string | number)[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1966,7 +1966,7 @@ "signature": [ "(string | number)[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1980,7 +1980,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1994,7 +1994,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts", "deprecated": false, "trackAdoption": false } @@ -2010,7 +2010,7 @@ "tags": [], "label": "ReportTypes", "description": [], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2027,7 +2027,7 @@ "signature": [ "\"ALL_VALUES\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2049,7 +2049,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2064,7 +2064,7 @@ "signature": [ "\"/app/exploratory-view\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2079,7 +2079,7 @@ "signature": [ "\"ENVIRONMENT_ALL\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2094,7 +2094,7 @@ "signature": [ "\"FILTER_RECORDS\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2109,7 +2109,7 @@ "signature": [ "\"operation\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2124,7 +2124,7 @@ "signature": [ "\"___records___\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2139,7 +2139,7 @@ "signature": [ "\"RecordsPercentage\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2154,7 +2154,7 @@ "signature": [ "\"REPORT_METRIC_FIELD\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2169,7 +2169,7 @@ "signature": [ "\"TERMS_COLUMN\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2184,7 +2184,7 @@ "signature": [ "\"USE_BREAK_DOWN_COLUMN\"" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2205,7 +2205,7 @@ "DataHandler", ") => void; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "setup", @@ -2249,7 +2249,7 @@ }, ") => React.JSX.Element | null; }" ], - "path": "x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", diff --git a/api_docs/exploratory_view.mdx b/api_docs/exploratory_view.mdx index 0747f3abccb9..4f5ad95234a9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'exploratoryView'] --- import exploratoryViewObj from './exploratory_view.devdocs.json'; diff --git a/api_docs/expression_error.devdocs.json b/api_docs/expression_error.devdocs.json index 62ffbcbfcbc9..dba511e558d2 100644 --- a/api_docs/expression_error.devdocs.json +++ b/api_docs/expression_error.devdocs.json @@ -16,10 +16,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -45,10 +45,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx", "deprecated": false, @@ -72,10 +71,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -103,10 +102,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_error/public/expression_renderers/error_renderer.tsx", "deprecated": false, @@ -125,17 +123,15 @@ "label": "getDebugRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -154,19 +150,16 @@ "id": "def-public.getDebugRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx", "deprecated": false, @@ -185,17 +178,15 @@ "label": "getErrorRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -216,19 +207,16 @@ "id": "def-public.getErrorRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_error/public/expression_renderers/error_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_error.mdx b/api_docs/expression_error.mdx index c73e5e84b358..fbaf21b7d213 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-12-10 +date: 2024-12-13 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 c635b5fe388e..716c3cbbb1d9 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-12-10 +date: 2024-12-13 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 b093aa04f77e..7aa4e53441fc 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionHeatmap'] --- import expressionHeatmapObj from './expression_heatmap.devdocs.json'; diff --git a/api_docs/expression_image.devdocs.json b/api_docs/expression_image.devdocs.json index 538b4756896a..3fc201e16595 100644 --- a/api_docs/expression_image.devdocs.json +++ b/api_docs/expression_image.devdocs.json @@ -11,17 +11,15 @@ "label": "getImageRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -48,19 +46,16 @@ "id": "def-public.getImageRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_image/public/expression_renderers/image_renderer.tsx", "deprecated": false, @@ -84,10 +79,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -121,10 +116,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_image/public/expression_renderers/image_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_image.mdx b/api_docs/expression_image.mdx index 89335338a43b..2d359df448be 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-12-10 +date: 2024-12-13 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 2e322f639583..d290aa9f89b8 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionLegacyMetricVis'] --- import expressionLegacyMetricVisObj from './expression_legacy_metric_vis.devdocs.json'; diff --git a/api_docs/expression_metric.devdocs.json b/api_docs/expression_metric.devdocs.json index 22138d1d9d74..a5d21f774988 100644 --- a/api_docs/expression_metric.devdocs.json +++ b/api_docs/expression_metric.devdocs.json @@ -11,17 +11,15 @@ "label": "getMetricRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -48,19 +46,16 @@ "id": "def-public.getMetricRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx", "deprecated": false, @@ -84,10 +79,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -121,10 +116,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_metric.mdx b/api_docs/expression_metric.mdx index d7280c0b2816..3be92147e413 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionMetric'] --- import expressionMetricObj from './expression_metric.devdocs.json'; diff --git a/api_docs/expression_metric_vis.devdocs.json b/api_docs/expression_metric_vis.devdocs.json index 8383126e6833..943695ad45e6 100644 --- a/api_docs/expression_metric_vis.devdocs.json +++ b/api_docs/expression_metric_vis.devdocs.json @@ -773,6 +773,14 @@ "label": "palette", "description": [], "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteOutput", + "text": "PaletteOutput" + }, + "<", { "pluginId": "charts", "scope": "common", @@ -780,7 +788,7 @@ "section": "def-common.CustomPaletteState", "text": "CustomPaletteState" }, - " | undefined" + "> | undefined" ], "path": "src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts", "deprecated": false, diff --git a/api_docs/expression_metric_vis.mdx b/api_docs/expression_metric_vis.mdx index 9977283084d0..83465806af12 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-12-10 +date: 2024-12-13 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 312c988229f0..974a5f5eda1f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionPartitionVis'] --- import expressionPartitionVisObj from './expression_partition_vis.devdocs.json'; diff --git a/api_docs/expression_repeat_image.devdocs.json b/api_docs/expression_repeat_image.devdocs.json index 10a6801189d8..65a50ddeb388 100644 --- a/api_docs/expression_repeat_image.devdocs.json +++ b/api_docs/expression_repeat_image.devdocs.json @@ -11,17 +11,15 @@ "label": "getRepeatImageRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -48,19 +46,16 @@ "id": "def-public.getRepeatImageRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx", "deprecated": false, @@ -84,10 +79,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -121,10 +116,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_repeat_image.mdx b/api_docs/expression_repeat_image.mdx index 4535d413fc81..7fd0073d96b2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRepeatImage'] --- import expressionRepeatImageObj from './expression_repeat_image.devdocs.json'; diff --git a/api_docs/expression_reveal_image.devdocs.json b/api_docs/expression_reveal_image.devdocs.json index bc0a3212309f..cdda11e92d9f 100644 --- a/api_docs/expression_reveal_image.devdocs.json +++ b/api_docs/expression_reveal_image.devdocs.json @@ -11,17 +11,15 @@ "label": "getRevealImageRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -42,19 +40,16 @@ "id": "def-public.getRevealImageRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx", "deprecated": false, @@ -78,10 +73,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -109,10 +104,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_reveal_image.mdx b/api_docs/expression_reveal_image.mdx index 7d1ab6f4a9a3..0572f730ab33 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressionRevealImage'] --- import expressionRevealImageObj from './expression_reveal_image.devdocs.json'; diff --git a/api_docs/expression_shape.devdocs.json b/api_docs/expression_shape.devdocs.json index 2c47953861b5..f1790eef4a61 100644 --- a/api_docs/expression_shape.devdocs.json +++ b/api_docs/expression_shape.devdocs.json @@ -35,17 +35,15 @@ "label": "getProgressRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -72,19 +70,16 @@ "id": "def-public.getProgressRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx", "deprecated": false, @@ -103,17 +98,15 @@ "label": "getShapeRenderer", "description": [], "signature": [ - "(theme$: ", - "Observable", - "<", + "(core: ", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ">) => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -140,19 +133,16 @@ "id": "def-public.getShapeRenderer.$1", "type": "Object", "tags": [], - "label": "theme$", + "label": "core", "description": [], "signature": [ - "Observable", - "<", { - "pluginId": "@kbn/core-theme-browser", + "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", - "docId": "kibKbnCoreThemeBrowserPluginApi", - "section": "def-public.CoreTheme", - "text": "CoreTheme" - }, - ">" + "docId": "kibKbnCoreLifecycleBrowserPluginApi", + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx", "deprecated": false, @@ -224,10 +214,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -261,10 +251,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx", "deprecated": false, @@ -336,10 +325,10 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" + "section": "def-public.CoreStart", + "text": "CoreStart" }, - ") => () => ", + ") => () => ", { "pluginId": "expressions", "scope": "common", @@ -373,10 +362,9 @@ "pluginId": "@kbn/core-lifecycle-browser", "scope": "public", "docId": "kibKbnCoreLifecycleBrowserPluginApi", - "section": "def-public.CoreSetup", - "text": "CoreSetup" - }, - "" + "section": "def-public.CoreStart", + "text": "CoreStart" + } ], "path": "src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx", "deprecated": false, diff --git a/api_docs/expression_shape.mdx b/api_docs/expression_shape.mdx index eff56c07d1a1..baf81d0931fa 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-12-10 +date: 2024-12-13 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 734153b77ee3..b2db4fc4745d 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-12-10 +date: 2024-12-13 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 fdf09df0f53f..cf9b09afdcc2 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-12-10 +date: 2024-12-13 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 8228e8852171..40ac83b1371e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'expressions'] --- import expressionsObj from './expressions.devdocs.json'; diff --git a/api_docs/features.mdx b/api_docs/features.mdx index c561174f5ce5..c38784e96f2b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'features'] --- import featuresObj from './features.devdocs.json'; diff --git a/api_docs/field_formats.devdocs.json b/api_docs/field_formats.devdocs.json index b4cab8626387..f12fc9280b47 100644 --- a/api_docs/field_formats.devdocs.json +++ b/api_docs/field_formats.devdocs.json @@ -1210,7 +1210,7 @@ "label": "getParamDefaults", "description": [], "signature": [ - "() => { fieldType: null; colors: { range: string; regex: string; text: string; background: string; }[]; }" + "() => { fieldType: null; colors: { range: string; regex: string; text: string; background: string; boolean: string; }[]; }" ], "path": "src/plugins/field_formats/common/converters/color.tsx", "deprecated": false, @@ -1226,7 +1226,7 @@ "label": "findColorRuleForVal", "description": [], "signature": [ - "(val: string | number) => any" + "(val: string | number | boolean) => any" ], "path": "src/plugins/field_formats/common/converters/color.tsx", "deprecated": false, @@ -1240,7 +1240,7 @@ "label": "val", "description": [], "signature": [ - "string | number" + "string | number | boolean" ], "path": "src/plugins/field_formats/common/converters/color.tsx", "deprecated": false, @@ -6577,6 +6577,17 @@ "path": "src/plugins/field_formats/common/constants/color_default.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "fieldFormats", + "id": "def-common.DEFAULT_CONVERTER_COLOR.boolean", + "type": "string", + "tags": [], + "label": "boolean", + "description": [], + "path": "src/plugins/field_formats/common/constants/color_default.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/field_formats.mdx b/api_docs/field_formats.mdx index 768d75caea36..032fb7689f30 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldFormats'] --- import fieldFormatsObj from './field_formats.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 | |-------------------|-----------|------------------------|-----------------| -| 292 | 5 | 253 | 3 | +| 293 | 5 | 254 | 3 | ## Client diff --git a/api_docs/fields_metadata.mdx b/api_docs/fields_metadata.mdx index 55d0837d9cf5..431e999d835e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fieldsMetadata'] --- import fieldsMetadataObj from './fields_metadata.devdocs.json'; diff --git a/api_docs/file_upload.mdx b/api_docs/file_upload.mdx index 612626066ad8..04f9410414b0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fileUpload'] --- import fileUploadObj from './file_upload.devdocs.json'; diff --git a/api_docs/files.mdx b/api_docs/files.mdx index 7f4e32c22ca3..8d9e81c26ee8 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-12-10 +date: 2024-12-13 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 0018dee49f98..3000e4e16f4c 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-12-10 +date: 2024-12-13 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 fdd4aea83eeb..48fb02b44856 100644 --- a/api_docs/fleet.devdocs.json +++ b/api_docs/fleet.devdocs.json @@ -1704,10 +1704,6 @@ "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" }, - { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" @@ -1716,6 +1712,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" @@ -24592,10 +24592,6 @@ "plugin": "cloudDefend", "path": "x-pack/plugins/cloud_defend/public/test/mocks.ts" }, - { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/services/metadata/endpoint_metadata_service.test.ts" @@ -24604,6 +24600,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/support/endpoint_package_policies.test.ts" }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/management/pages/policy/store/policy_details/index.test.ts" diff --git a/api_docs/fleet.mdx b/api_docs/fleet.mdx index 1c16c88a74b2..57b2dba7773b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'fleet'] --- import fleetObj from './fleet.devdocs.json'; diff --git a/api_docs/global_search.mdx b/api_docs/global_search.mdx index 63bfa4db9f18..cd5b78e37082 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-12-10 +date: 2024-12-13 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 d0591ff26bd2..11f8e3304b0e 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-12-10 +date: 2024-12-13 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 a873a6e0b36a..db8fe987f994 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-12-10 +date: 2024-12-13 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 b013fcc8c600..d4c4b9bbd66d 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-12-10 +date: 2024-12-13 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 23b176f4d075..1b19f2fcc72a 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-12-10 +date: 2024-12-13 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 ca65364f8319..1d7969fa3393 100644 --- a/api_docs/index_management.devdocs.json +++ b/api_docs/index_management.devdocs.json @@ -3163,7 +3163,14 @@ "label": "indexMode", "description": [], "signature": [ - "\"standard\" | \"time_series\" | \"logsdb\"" + { + "pluginId": "indexManagement", + "scope": "common", + "docId": "kibIndexManagementPluginApi", + "section": "def-common.IndexMode", + "text": "IndexMode" + }, + " | undefined" ], "path": "x-pack/plugins/index_management/common/types/templates.ts", "deprecated": false, diff --git a/api_docs/index_management.mdx b/api_docs/index_management.mdx index 8b38c273afb1..a609aca7c45b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'indexManagement'] --- import indexManagementObj from './index_management.devdocs.json'; diff --git a/api_docs/inference.devdocs.json b/api_docs/inference.devdocs.json index 4cf16dcfec9b..1ece7676f968 100644 --- a/api_docs/inference.devdocs.json +++ b/api_docs/inference.devdocs.json @@ -17,7 +17,7 @@ "StreamedHttpResponse", ", T>" ], - "path": "x-pack/plugins/inference/public/util/http_response_into_observable.ts", + "path": "x-pack/platform/plugins/shared/inference/public/util/http_response_into_observable.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -36,7 +36,7 @@ "tags": [], "label": "InferencePublicSetup", "description": [], - "path": "x-pack/plugins/inference/public/types.ts", + "path": "x-pack/platform/plugins/shared/inference/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "InferencePublicStart", "description": [], - "path": "x-pack/plugins/inference/public/types.ts", + "path": "x-pack/platform/plugins/shared/inference/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -96,7 +96,7 @@ }, "" ], - "path": "x-pack/plugins/inference/public/types.ts", + "path": "x-pack/platform/plugins/shared/inference/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -127,7 +127,7 @@ }, " | undefined; } & TToolOptions" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false } @@ -163,7 +163,7 @@ }, "" ], - "path": "x-pack/plugins/inference/public/types.ts", + "path": "x-pack/platform/plugins/shared/inference/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -185,7 +185,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false } @@ -203,7 +203,7 @@ "InferenceConnector", "[]>" ], - "path": "x-pack/plugins/inference/public/types.ts", + "path": "x-pack/platform/plugins/shared/inference/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -225,7 +225,7 @@ "label": "naturalLanguageToEsql", "description": [], "signature": [ - "({\n client,\n connectorId,\n tools,\n toolChoice,\n logger,\n functionCalling,\n ...rest\n}: ", + "({\n client,\n connectorId,\n tools,\n toolChoice,\n logger,\n functionCalling,\n system,\n ...rest\n}: ", "NlToEsqlTaskParams", ") => ", "Observable", @@ -233,7 +233,7 @@ "NlToEsqlTaskEvent", ">" ], - "path": "x-pack/plugins/inference/server/tasks/nl_to_esql/task.ts", + "path": "x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -242,13 +242,13 @@ "id": "def-server.naturalLanguageToEsql.$1", "type": "CompoundType", "tags": [], - "label": "{\n client,\n connectorId,\n tools,\n toolChoice,\n logger,\n functionCalling,\n ...rest\n}", + "label": "{\n client,\n connectorId,\n tools,\n toolChoice,\n logger,\n functionCalling,\n system,\n ...rest\n}", "description": [], "signature": [ "NlToEsqlTaskParams", "" ], - "path": "x-pack/plugins/inference/server/tasks/nl_to_esql/task.ts", + "path": "x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -268,7 +268,7 @@ "description": [ "\nA version of the {@link InferenceClient} that is pre-bound to a set of parameters." ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -316,7 +316,7 @@ }, "" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -339,7 +339,7 @@ }, "[P]; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/bound_api.ts", "deprecated": false, "trackAdoption": false } @@ -377,7 +377,7 @@ }, "" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -390,7 +390,7 @@ "label": "options", "description": [], "signature": [ - "{ id: TId; input: string; schema?: TOutputSchema | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", + "{ id: TId; input: string; schema?: TOutputSchema | undefined; retry?: { onValidationError?: number | boolean | undefined; } | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", { "pluginId": "@kbn/inference-common", "scope": "common", @@ -400,7 +400,7 @@ }, "[] | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/bound_api.ts", "deprecated": false, "trackAdoption": false } @@ -420,7 +420,7 @@ "InferenceConnector", ">" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -434,7 +434,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -454,7 +454,7 @@ "description": [ "\nAn inference client, scoped to a request, that can be used to interact with LLMs." ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -502,7 +502,7 @@ }, "" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -533,7 +533,7 @@ }, " | undefined; } & TToolOptions" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false } @@ -571,7 +571,7 @@ }, "" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -593,7 +593,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false } @@ -613,7 +613,7 @@ "InferenceConnector", ">" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -627,7 +627,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/inference/server/inference_client/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/inference_client/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -651,7 +651,7 @@ "description": [ "\nSetup contract of the inference plugin." ], - "path": "x-pack/plugins/inference/server/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -667,7 +667,7 @@ "description": [ "\nStart contract of the inference plugin, exposing APIs to interact with LLMs." ], - "path": "x-pack/plugins/inference/server/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -702,7 +702,7 @@ "text": "InferenceClient" } ], - "path": "x-pack/plugins/inference/server/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -716,7 +716,7 @@ "signature": [ "T" ], - "path": "x-pack/plugins/inference/server/types.ts", + "path": "x-pack/platform/plugins/shared/inference/server/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -744,7 +744,7 @@ "signature": [ "(query: string) => { input: string; output: string; isCorrection: boolean; }" ], - "path": "x-pack/plugins/inference/common/tasks/nl_to_esql/correct_esql_query.ts", + "path": "x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/correct_esql_query.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -758,7 +758,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/inference/common/tasks/nl_to_esql/correct_esql_query.ts", + "path": "x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/correct_esql_query.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -792,7 +792,7 @@ "text": "OutputAPI" } ], - "path": "x-pack/plugins/inference/common/output/create_output_api.ts", + "path": "x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -812,7 +812,7 @@ "text": "ChatCompleteAPI" } ], - "path": "x-pack/plugins/inference/common/output/create_output_api.ts", + "path": "x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -837,45 +837,31 @@ "section": "def-common.ChatCompleteAPI", "text": "ChatCompleteAPI" }, - ") => ({ id, connectorId, input, schema, system, previousMessages, functionCalling, stream, }: ", + ") => ({ id, connectorId, input, schema, system, previousMessages, functionCalling, stream, retry, }: DefaultOutputOptions) => Promise<", { "pluginId": "@kbn/inference-common", "scope": "common", "docId": "kibKbnInferenceCommonPluginApi", - "section": "def-common.OutputOptions", - "text": "OutputOptions" + "section": "def-common.OutputResponse", + "text": "OutputResponse" }, ") => ", - "Observable", - "<{ type: ", - { - "pluginId": "@kbn/inference-common", - "scope": "common", - "docId": "kibKbnInferenceCommonPluginApi", - "section": "def-common.OutputEventType", - "text": "OutputEventType" - }, - "; id: string; content: string; output?: undefined; } | { id: string; output: ", "AugmentedRequired", "<{ [x: string]: string | number | boolean | ", "AugmentedRequired", - " | FromToolSchemaArray | undefined; }, never> | undefined; content: string; type: ", + " | FromToolSchemaArray | undefined; }, never> | undefined>> | ", { "pluginId": "@kbn/inference-common", "scope": "common", "docId": "kibKbnInferenceCommonPluginApi", - "section": "def-common.OutputEventType", - "text": "OutputEventType" + "section": "def-common.OutputStreamResponse", + "text": "OutputStreamResponse" }, - "; }> | Promise<{ id: string; content: string; output: ", - "AugmentedRequired", - "<{ [x: string]: string | number | boolean | ", - "AugmentedRequired", - " | FromToolSchemaArray | undefined; }, never> | undefined; }>" + "" ], - "path": "x-pack/plugins/inference/common/output/create_output_api.ts", + "path": "x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -895,7 +881,7 @@ "text": "ChatCompleteAPI" } ], - "path": "x-pack/plugins/inference/common/output/create_output_api.ts", + "path": "x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -914,7 +900,7 @@ "signature": [ "() => string" ], - "path": "x-pack/plugins/inference/common/utils/generate_fake_tool_call_id.ts", + "path": "x-pack/platform/plugins/shared/inference/common/utils/generate_fake_tool_call_id.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -931,7 +917,7 @@ "signature": [ "(query: string) => { name: string | undefined; command: string; }[]" ], - "path": "x-pack/plugins/inference/common/tasks/nl_to_esql/non_ast/correct_common_esql_mistakes.ts", + "path": "x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/non_ast/correct_common_esql_mistakes.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -945,7 +931,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/inference/common/tasks/nl_to_esql/non_ast/correct_common_esql_mistakes.ts", + "path": "x-pack/platform/plugins/shared/inference/common/tasks/nl_to_esql/non_ast/correct_common_esql_mistakes.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -963,7 +949,7 @@ "tags": [], "label": "GetConnectorsResponseBody", "description": [], - "path": "x-pack/plugins/inference/common/http_apis.ts", + "path": "x-pack/platform/plugins/shared/inference/common/http_apis.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -978,7 +964,7 @@ "InferenceConnector", "[]" ], - "path": "x-pack/plugins/inference/common/http_apis.ts", + "path": "x-pack/platform/plugins/shared/inference/common/http_apis.ts", "deprecated": false, "trackAdoption": false } @@ -1022,7 +1008,7 @@ }, "" ], - "path": "x-pack/plugins/inference/common/http_apis.ts", + "path": "x-pack/platform/plugins/shared/inference/common/http_apis.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/inference.mdx b/api_docs/inference.mdx index 1bdc62e7c2b5..63e7c68bd3aa 100644 --- a/api_docs/inference.mdx +++ b/api_docs/inference.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inference title: "inference" image: https://source.unsplash.com/400x175/?github description: API docs for the inference plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inference'] --- import inferenceObj from './inference.devdocs.json'; diff --git a/api_docs/infra.mdx b/api_docs/infra.mdx index 6651f313b1ad..a8dda19fe761 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'infra'] --- import infraObj from './infra.devdocs.json'; diff --git a/api_docs/ingest_pipelines.mdx b/api_docs/ingest_pipelines.mdx index fc223c19a423..7f8858bd0602 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-12-10 +date: 2024-12-13 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 a1cd3a60b30b..7d38b2a4153b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inspector'] --- import inspectorObj from './inspector.devdocs.json'; diff --git a/api_docs/integration_assistant.mdx b/api_docs/integration_assistant.mdx index 3f2edb2b3be0..93eac1f0ac2e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'integrationAssistant'] --- import integrationAssistantObj from './integration_assistant.devdocs.json'; diff --git a/api_docs/interactive_setup.mdx b/api_docs/interactive_setup.mdx index 973d5a52acac..a94002208f0e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'interactiveSetup'] --- import interactiveSetupObj from './interactive_setup.devdocs.json'; diff --git a/api_docs/inventory.mdx b/api_docs/inventory.mdx index e13143d804ba..a30d6ce84e07 100644 --- a/api_docs/inventory.mdx +++ b/api_docs/inventory.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/inventory title: "inventory" image: https://source.unsplash.com/400x175/?github description: API docs for the inventory plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'inventory'] --- import inventoryObj from './inventory.devdocs.json'; diff --git a/api_docs/investigate.devdocs.json b/api_docs/investigate.devdocs.json index 6027d5241e21..dd3feacebf9d 100644 --- a/api_docs/investigate.devdocs.json +++ b/api_docs/investigate.devdocs.json @@ -23,7 +23,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/investigate/public/util/get_es_filters_from_global_parameters.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/util/get_es_filters_from_global_parameters.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39,7 +39,7 @@ "GlobalWidgetParameters", ">" ], - "path": "x-pack/plugins/observability_solution/investigate/public/util/get_es_filters_from_global_parameters.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/util/get_es_filters_from_global_parameters.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -58,7 +58,7 @@ "signature": [ "(t1: T1) => T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -72,7 +72,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -91,7 +91,7 @@ "signature": [ "(t1: T1, t2: T2) => [T2] extends Mergable[] ? DeepOverwrite : T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -105,7 +105,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -120,7 +120,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -139,7 +139,7 @@ "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", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -153,7 +153,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -168,7 +168,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -183,7 +183,7 @@ "signature": [ "T3" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -202,7 +202,7 @@ "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", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -216,7 +216,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -231,7 +231,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -246,7 +246,7 @@ "signature": [ "T4" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -265,7 +265,7 @@ "signature": [ "(sources: Record[]) => any" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -279,7 +279,7 @@ "signature": [ "Record[]" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -297,7 +297,7 @@ "tags": [], "label": "GlobalWidgetParameters", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -311,7 +311,7 @@ "signature": [ "{ from: string; to: string; }" ], - "path": "x-pack/plugins/observability_solution/investigate/common/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -329,7 +329,7 @@ "tags": [], "label": "InvestigatePublicSetup", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -349,7 +349,7 @@ "ItemDefinition", ") => void" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -364,7 +364,7 @@ "ItemDefinition", "" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -383,7 +383,7 @@ "tags": [], "label": "InvestigatePublicStart", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -399,7 +399,7 @@ "ItemDefinition", "<{}, {}>[]" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -417,7 +417,7 @@ "ItemDefinition", "<{}, {}> | undefined" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -431,7 +431,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/investigate/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -458,7 +458,7 @@ "tags": [], "label": "InvestigateServerSetup", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -472,7 +472,7 @@ "tags": [], "label": "InvestigateServerStart", "description": [], - "path": "x-pack/plugins/observability_solution/investigate/server/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -493,7 +493,7 @@ "signature": [ "(t1: T1) => T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -507,7 +507,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -526,7 +526,7 @@ "signature": [ "(t1: T1, t2: T2) => [T2] extends Mergable[] ? DeepOverwrite : T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -540,7 +540,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -555,7 +555,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -574,7 +574,7 @@ "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", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -588,7 +588,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -603,7 +603,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -618,7 +618,7 @@ "signature": [ "T3" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -637,7 +637,7 @@ "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", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -651,7 +651,7 @@ "signature": [ "T1" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -666,7 +666,7 @@ "signature": [ "T2" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -681,7 +681,7 @@ "signature": [ "T4" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -700,7 +700,7 @@ "signature": [ "(sources: Record[]) => any" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -714,7 +714,7 @@ "signature": [ "Record[]" ], - "path": "x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts", + "path": "x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts", "deprecated": false, "trackAdoption": false, "isRequired": true diff --git a/api_docs/investigate.mdx b/api_docs/investigate.mdx index 1722696878b6..3d1356df2415 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigate'] --- import investigateObj from './investigate.devdocs.json'; diff --git a/api_docs/investigate_app.devdocs.json b/api_docs/investigate_app.devdocs.json index c33e115dd7cc..20716508f598 100644 --- a/api_docs/investigate_app.devdocs.json +++ b/api_docs/investigate_app.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "InvestigateAppPublicSetup", "description": [], - "path": "x-pack/plugins/observability_solution/investigate_app/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate_app/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "InvestigateAppPublicStart", "description": [], - "path": "x-pack/plugins/observability_solution/investigate_app/public/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate_app/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,23 @@ "label": "InvestigateAppServerRouteRepository", "description": [], "signature": [ - "{ \"GET /api/observability/investigations/_tags 2023-10-31\": ", + "{ \"POST /internal/observability/investigation/root_cause_analysis\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /internal/observability/investigation/root_cause_analysis\", Zod.ZodObject<{ body: Zod.ZodObject<{ investigationId: Zod.ZodString; rangeFrom: Zod.ZodString; rangeTo: Zod.ZodString; serviceName: Zod.ZodString; context: Zod.ZodString; connectorId: Zod.ZodString; completeInBackground: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { context: string; connectorId: string; serviceName: string; rangeFrom: string; rangeTo: string; investigationId: string; completeInBackground?: boolean | undefined; }, { context: string; connectorId: string; serviceName: string; rangeFrom: string; rangeTo: string; investigationId: string; completeInBackground?: boolean | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { body: { context: string; connectorId: string; serviceName: string; rangeFrom: string; rangeTo: string; investigationId: string; completeInBackground?: boolean | undefined; }; }, { body: { context: string; connectorId: string; serviceName: string; rangeFrom: string; rangeTo: string; investigationId: string; completeInBackground?: boolean | undefined; }; }>, ", + "InvestigateAppRouteHandlerResources", + ", ", + "Observable", + "<{ event: ", + "RootCauseAnalysisEvent", + "; } & { type: \"event\"; }>, ", + "InvestigateAppRouteCreateOptions", + ">; \"GET /api/observability/investigations/_tags 2023-10-31\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -94,9 +110,9 @@ "section": "def-common.ServerRoute", "text": "ServerRoute" }, - "<\"GET /api/observability/events 2023-10-31\", Zod.ZodObject<{ query: Zod.ZodOptional; rangeTo: Zod.ZodOptional; filter: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; }, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; } | undefined; }, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; } | undefined; }>, ", + "<\"GET /api/observability/events 2023-10-31\", Zod.ZodObject<{ query: Zod.ZodOptional; rangeTo: Zod.ZodOptional; filter: Zod.ZodOptional; eventTypes: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: (\"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\")[] | undefined; }, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: (\"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\")[] | undefined; } | undefined; }, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: string | undefined; } | undefined; }>, ", "InvestigateAppRouteHandlerResources", - ", ({ id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; } & ({ eventType: \"annotation\"; annotationType?: string | undefined; } | { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }))[], ", + ", ({ id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; } | { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; })[], ", "InvestigateAppRouteCreateOptions", ">; \"GET /api/observability/investigations/{investigationId}/items 2023-10-31\": ", { @@ -214,9 +230,9 @@ "section": "def-common.ServerRoute", "text": "ServerRoute" }, - "<\"PUT /api/observability/investigations/{investigationId} 2023-10-31\", Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodOptional; status: Zod.ZodOptional, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>>; params: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>>; tags: Zod.ZodOptional>; externalIncidentUrl: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }; }, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }; }>, ", + "<\"PUT /api/observability/investigations/{investigationId} 2023-10-31\", Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodOptional; status: Zod.ZodOptional, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>>; params: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>>; tags: Zod.ZodOptional>; externalIncidentUrl: Zod.ZodOptional>; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }; }, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }; }>, ", "InvestigateAppRouteHandlerResources", - ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, ", + ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, ", "InvestigateAppRouteCreateOptions", ">; \"GET /api/observability/investigations/{investigationId} 2023-10-31\": ", { @@ -228,7 +244,7 @@ }, "<\"GET /api/observability/investigations/{investigationId} 2023-10-31\", Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; }, { path: { investigationId: string; }; }>, ", "InvestigateAppRouteHandlerResources", - ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, ", + ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, ", "InvestigateAppRouteCreateOptions", ">; \"GET /api/observability/investigations 2023-10-31\": ", { @@ -240,7 +256,7 @@ }, "<\"GET /api/observability/investigations 2023-10-31\", Zod.ZodObject<{ query: Zod.ZodOptional; search: Zod.ZodOptional; filter: Zod.ZodOptional; page: Zod.ZodOptional; perPage: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; }, { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; } | undefined; }, { query?: { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; } | undefined; }>, ", "InvestigateAppRouteHandlerResources", - ", { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }[]; perPage: number; total: number; }, ", + ", { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }[]; perPage: number; total: number; }, ", "InvestigateAppRouteCreateOptions", ">; \"POST /api/observability/investigations 2023-10-31\": ", { @@ -252,11 +268,11 @@ }, "<\"POST /api/observability/investigations 2023-10-31\", Zod.ZodObject<{ body: Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; tags: Zod.ZodArray; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }>; }, \"strip\", Zod.ZodTypeAny, { body: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }; }, { body: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }; }>, ", "InvestigateAppRouteHandlerResources", - ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, ", + ", { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, ", "InvestigateAppRouteCreateOptions", ">; }" ], - "path": "x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts", + "path": "x-pack/solutions/observability/plugins/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -270,7 +286,7 @@ "tags": [], "label": "InvestigateAppServerSetup", "description": [], - "path": "x-pack/plugins/observability_solution/investigate_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -284,7 +300,7 @@ "tags": [], "label": "InvestigateAppServerStart", "description": [], - "path": "x-pack/plugins/observability_solution/investigate_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/investigate_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], diff --git a/api_docs/investigate_app.mdx b/api_docs/investigate_app.mdx index 1a4ba180f623..05b702b8d3cc 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'investigateApp'] --- import investigateAppObj from './investigate_app.devdocs.json'; diff --git a/api_docs/kbn_actions_types.mdx b/api_docs/kbn_actions_types.mdx index 09a37e7f227d..bb4657060907 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/actions-types'] --- import kbnActionsTypesObj from './kbn_actions_types.devdocs.json'; diff --git a/api_docs/kbn_ai_assistant.mdx b/api_docs/kbn_ai_assistant.mdx index f4e7011843e6..487af169d98f 100644 --- a/api_docs/kbn_ai_assistant.mdx +++ b/api_docs/kbn_ai_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ai-assistant title: "@kbn/ai-assistant" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ai-assistant plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ai-assistant'] --- import kbnAiAssistantObj from './kbn_ai_assistant.devdocs.json'; diff --git a/api_docs/kbn_ai_assistant_common.mdx b/api_docs/kbn_ai_assistant_common.mdx index ba42d7599a53..aab2d47fb4ce 100644 --- a/api_docs/kbn_ai_assistant_common.mdx +++ b/api_docs/kbn_ai_assistant_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ai-assistant-common title: "@kbn/ai-assistant-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ai-assistant-common plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ai-assistant-common'] --- import kbnAiAssistantCommonObj from './kbn_ai_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_aiops_components.mdx b/api_docs/kbn_aiops_components.mdx index e4559025356e..5f84496826f7 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-12-10 +date: 2024-12-13 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 f3a4465f2a03..7348066825d5 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-12-10 +date: 2024-12-13 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 7a17dac1060b..d2a8cbaf50fc 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-12-10 +date: 2024-12-13 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 0f3fbae34a79..a35b76e91994 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-12-10 +date: 2024-12-13 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 a186f4a576fa..3acc51e89151 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_alerting_state_types.mdx index cb3b8816f8a4..f115bd0274d1 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_alerting_types.mdx index 92ecf2e3507c..6e6312c00aea 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerting-types'] --- import kbnAlertingTypesObj from './kbn_alerting_types.devdocs.json'; diff --git a/api_docs/kbn_alerts_as_data_utils.mdx b/api_docs/kbn_alerts_as_data_utils.mdx index 84733e8b9c25..ad396b4c744d 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_alerts_grouping.mdx index c97880560776..997435befb23 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/alerts-grouping'] --- import kbnAlertsGroupingObj from './kbn_alerts_grouping.devdocs.json'; diff --git a/api_docs/kbn_alerts_ui_shared.devdocs.json b/api_docs/kbn_alerts_ui_shared.devdocs.json index 50b0cf5a6edd..7a503c08980f 100644 --- a/api_docs/kbn_alerts_ui_shared.devdocs.json +++ b/api_docs/kbn_alerts_ui_shared.devdocs.json @@ -5537,7 +5537,13 @@ "text": "HasSaveNotification" }, " & ", - "PublishesReload", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesReload", + "text": "PublishesReload" + }, "> & { allowExpensiveQueries$: ", { "pluginId": "@kbn/presentation-publishing", diff --git a/api_docs/kbn_alerts_ui_shared.mdx b/api_docs/kbn_alerts_ui_shared.mdx index 736438c8c985..5591f044b1e5 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-12-10 +date: 2024-12-13 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 f303e5da39e0..847444b46429 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-12-10 +date: 2024-12-13 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 c60e928a8b72..30c324bade80 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-12-10 +date: 2024-12-13 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 5263e6c4b593..70a3b94f4fe2 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-12-10 +date: 2024-12-13 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 30dcd84e6b1b..5190f9a95a45 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_apm_synthtrace.mdx index 8459cbb3a487..aafb1d6bf8f4 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace'] --- import kbnApmSynthtraceObj from './kbn_apm_synthtrace.devdocs.json'; diff --git a/api_docs/kbn_apm_synthtrace_client.devdocs.json b/api_docs/kbn_apm_synthtrace_client.devdocs.json index 0c4dcd3b9beb..9b1507d45eaf 100644 --- a/api_docs/kbn_apm_synthtrace_client.devdocs.json +++ b/api_docs/kbn_apm_synthtrace_client.devdocs.json @@ -3133,7 +3133,7 @@ "label": "LogDocument", "description": [], "signature": [ - "{ '@timestamp'?: number | undefined; } & Partial<{ _index?: string | undefined; '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; 'aws.kinesis.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; labels?: Record | undefined; test_field: string | string[]; date: Date; severity: string; msg: string; svc: string; hostname: string; 'http.status_code'?: number | undefined; 'http.request.method'?: string | undefined; 'url.path'?: string | undefined; 'process.name'?: string | undefined; 'kubernetes.namespace'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; 'kubernetes.container.name'?: string | undefined; 'orchestrator.resource.name'?: string | undefined; thisisaverylongfieldnamethatevendoesnotcontainanyspaceswhyitcouldpotentiallybreakouruiinseveralplaces: string; }>" + "{ '@timestamp'?: number | undefined; } & Partial<{ _index?: string | undefined; '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; 'aws.kinesis.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; labels?: Record | undefined; test_field: string | string[]; date: Date; severity: string; msg: string; svc: string; hostname: string; 'http.status_code'?: number | undefined; 'http.request.method'?: string | undefined; 'url.path'?: string | undefined; 'process.name'?: string | undefined; 'kubernetes.namespace'?: string | undefined; 'kubernetes.pod.name'?: string | undefined; 'kubernetes.container.name'?: string | undefined; 'orchestrator.resource.name'?: string | undefined; tags?: string | string[] | undefined; thisisaverylongfieldnamethatevendoesnotcontainanyspaceswhyitcouldpotentiallybreakouruiinseveralplaces: string; }>" ], "path": "packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts", "deprecated": false, diff --git a/api_docs/kbn_apm_synthtrace_client.mdx b/api_docs/kbn_apm_synthtrace_client.mdx index f8ea0e05eec1..0a917d61eb21 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/apm-synthtrace-client'] --- import kbnApmSynthtraceClientObj from './kbn_apm_synthtrace_client.devdocs.json'; diff --git a/api_docs/kbn_apm_types.mdx b/api_docs/kbn_apm_types.mdx index 361888d87985..a448a891a231 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-12-10 +date: 2024-12-13 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 c24f24b655be..3d49ddc8f677 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-12-10 +date: 2024-12-13 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 3a4e80771680..f56e0cf030e3 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-12-10 +date: 2024-12-13 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 de53c7e0ab5a..373e5e0ea59d 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-12-10 +date: 2024-12-13 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 bfb2cb98b977..0728ebd0397c 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-12-10 +date: 2024-12-13 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 5d60df594b8f..7116f8faf83a 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-12-10 +date: 2024-12-13 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 aaea3f4b78ac..85d0f831617d 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-12-10 +date: 2024-12-13 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 9d3b9443409d..2dd3c6a1ddac 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cases-components'] --- import kbnCasesComponentsObj from './kbn_cases_components.devdocs.json'; diff --git a/api_docs/kbn_cbor.mdx b/api_docs/kbn_cbor.mdx index 4cb2f4c23772..1271a236cadf 100644 --- a/api_docs/kbn_cbor.mdx +++ b/api_docs/kbn_cbor.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cbor'] --- import kbnCborObj from './kbn_cbor.devdocs.json'; diff --git a/api_docs/kbn_cell_actions.mdx b/api_docs/kbn_cell_actions.mdx index 7d00616784a6..e69a178ab27c 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_chart_expressions_common.mdx index d9163287fa9c..fa5f0d59bce0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/chart-expressions-common'] --- import kbnChartExpressionsCommonObj from './kbn_chart_expressions_common.devdocs.json'; diff --git a/api_docs/kbn_chart_icons.mdx b/api_docs/kbn_chart_icons.mdx index 1731b12caba4..53fb7bbb438a 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-12-10 +date: 2024-12-13 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 207061dbb6b1..5f58710b7a3a 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-12-10 +date: 2024-12-13 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 05bf5103fe6d..b3ea668e0146 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-12-10 +date: 2024-12-13 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 3cd2545713d5..074bdbd9932c 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-12-10 +date: 2024-12-13 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 ca530b7a6138..ad7e895fb8c7 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_cloud_security_posture.mdx index cf5bcab952a0..582677d0994c 100644 --- a/api_docs/kbn_cloud_security_posture.mdx +++ b/api_docs/kbn_cloud_security_posture.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture'] --- import kbnCloudSecurityPostureObj from './kbn_cloud_security_posture.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture_common.mdx b/api_docs/kbn_cloud_security_posture_common.mdx index 229bbd63114a..44bf3e0a70e7 100644 --- a/api_docs/kbn_cloud_security_posture_common.mdx +++ b/api_docs/kbn_cloud_security_posture_common.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-common'] --- import kbnCloudSecurityPostureCommonObj from './kbn_cloud_security_posture_common.devdocs.json'; diff --git a/api_docs/kbn_cloud_security_posture_graph.devdocs.json b/api_docs/kbn_cloud_security_posture_graph.devdocs.json index eb1a40b17d3c..00c821750e58 100644 --- a/api_docs/kbn_cloud_security_posture_graph.devdocs.json +++ b/api_docs/kbn_cloud_security_posture_graph.devdocs.json @@ -56,6 +56,54 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/cloud-security-posture-graph", + "id": "def-public.GraphInvestigation", + "type": "Function", + "tags": [], + "label": "GraphInvestigation", + "description": [ + "\nGraph investigation view allows the user to expand nodes and view related entities." + ], + "signature": [ + "React.FunctionComponent" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-graph", + "id": "def-public.GraphInvestigation.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/ts5.0/index.d.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/cloud-security-posture-graph", + "id": "def-public.GraphInvestigation.$2", + "type": "Any", + "tags": [], + "label": "context", + "description": [], + "signature": [ + "any" + ], + "path": "node_modules/@types/react/ts5.0/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/cloud-security-posture-graph", "id": "def-public.GraphPopover", @@ -91,6 +139,46 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/cloud-security-posture-graph", + "id": "def-public.useFetchGraphData", + "type": "Function", + "tags": [], + "label": "useFetchGraphData", + "description": [ + "\nHook to fetch event's graph visualization data.\n" + ], + "signature": [ + "({ req, options, }: ", + "UseFetchGraphDataParams", + ") => ", + "UseFetchGraphDataResult" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/cloud-security-posture-graph", + "id": "def-public.useFetchGraphData.$1", + "type": "Object", + "tags": [], + "label": "{\n req,\n options,\n}", + "description": [], + "signature": [ + "UseFetchGraphDataParams" + ], + "path": "x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [ + "The result of the hook." + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/cloud-security-posture-graph", "id": "def-public.useGraphPopover", diff --git a/api_docs/kbn_cloud_security_posture_graph.mdx b/api_docs/kbn_cloud_security_posture_graph.mdx index 84e189f3d758..22c08c449d49 100644 --- a/api_docs/kbn_cloud_security_posture_graph.mdx +++ b/api_docs/kbn_cloud_security_posture_graph.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-cloud-security-posture-graph title: "@kbn/cloud-security-posture-graph" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/cloud-security-posture-graph plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cloud-security-posture-graph'] --- import kbnCloudSecurityPostureGraphObj from './kbn_cloud_security_posture_graph.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 20 | 0 | 15 | 4 | +| 25 | 0 | 16 | 6 | ## Client diff --git a/api_docs/kbn_code_editor.mdx b/api_docs/kbn_code_editor.mdx index 468b5f6efd41..1b60d94450a3 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-12-10 +date: 2024-12-13 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 8d330b5352d7..2e3e10aaf9c3 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_code_owners.devdocs.json index 8a9168cad1d7..c01722085824 100644 --- a/api_docs/kbn_code_owners.devdocs.json +++ b/api_docs/kbn_code_owners.devdocs.json @@ -21,81 +21,93 @@ "functions": [ { "parentPluginId": "@kbn/code-owners", - "id": "def-common.getCodeOwnersForFile", + "id": "def-common.findCodeOwnersEntryForPath", "type": "Function", - "tags": [], - "label": "getCodeOwnersForFile", + "tags": [ + "throws" + ], + "label": "findCodeOwnersEntryForPath", "description": [ - "\nGet the GitHub CODEOWNERS for a file in the repository" + "\nGet a list of matching code owners for a given path\n\nTip:\n If you're making a lot of calls to this function, fetch the code owner paths once using\n `getCodeOwnersEntries` and pass it in the `getCodeOwnersEntries` parameter to speed up your queries..\n" ], "signature": [ - "(filePath: string, reversedCodeowners: ", + "(searchPath: string, codeOwnersEntries: ", { "pluginId": "@kbn/code-owners", "scope": "common", "docId": "kibKbnCodeOwnersPluginApi", - "section": "def-common.PathWithOwners", - "text": "PathWithOwners" + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" }, - "[] | undefined) => string | undefined" + "[] | undefined) => ", + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" + }, + " | undefined" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/code-owners", - "id": "def-common.getCodeOwnersForFile.$1", + "id": "def-common.findCodeOwnersEntryForPath.$1", "type": "string", "tags": [], - "label": "filePath", + "label": "searchPath", "description": [ - "the file to get code owners for" + "The path to find code owners for" ], "signature": [ "string" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "@kbn/code-owners", - "id": "def-common.getCodeOwnersForFile.$2", + "id": "def-common.findCodeOwnersEntryForPath.$2", "type": "Array", "tags": [], - "label": "reversedCodeowners", + "label": "codeOwnersEntries", "description": [ - "a cached reversed code owners list, use to speed up multiple requests" + "Pre-defined list of code owner paths to search in" ], "signature": [ { "pluginId": "@kbn/code-owners", "scope": "common", "docId": "kibKbnCodeOwnersPluginApi", - "section": "def-common.PathWithOwners", - "text": "PathWithOwners" + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" }, "[] | undefined" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, "isRequired": false } ], - "returnComment": [], + "returnComment": [ + "Code owners entry if a match is found." + ], "initialIsOpen": false }, { "parentPluginId": "@kbn/code-owners", - "id": "def-common.getPathsWithOwnersReversed", + "id": "def-common.getCodeOwnersEntries", "type": "Function", "tags": [], - "label": "getPathsWithOwnersReversed", + "label": "getCodeOwnersEntries", "description": [ - "\nGet the .github/CODEOWNERS entries, prepared for path matching.\nThe last matching CODEOWNERS entry has highest precedence:\nhttps://help.github.com/articles/about-codeowners/\nso entries are returned in reversed order to later search for the first match." + "\nGet all code owner entries from the CODEOWNERS file\n\nEntries are ordered in reverse relative to how they're defined in the CODEOWNERS file\nas patterns defined lower in the CODEOWNERS file can override earlier entries." ], "signature": [ "() => ", @@ -103,12 +115,12 @@ "pluginId": "@kbn/code-owners", "scope": "common", "docId": "kibKbnCodeOwnersPluginApi", - "section": "def-common.PathWithOwners", - "text": "PathWithOwners" + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" }, "[]" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -117,69 +129,140 @@ }, { "parentPluginId": "@kbn/code-owners", - "id": "def-common.runGetOwnersForFileCli", + "id": "def-common.getOwningTeamsForPath", "type": "Function", - "tags": [], - "label": "runGetOwnersForFileCli", + "tags": [ + "throws" + ], + "label": "getOwningTeamsForPath", "description": [ - "\nRun the getCodeOwnersForFile() method above.\nReport back to the cli with either success and the owner(s), or a failure.\n\nThis function depends on a --file param being passed on the cli, like this:\n$ node scripts/get_owners_for_file.js --file SOME-FILE" + "\nGet a list of matching code owners for a given path\n\nTip:\n If you're making a lot of calls to this function, fetch the code owner paths once using\n `getCodeOwnersEntries` and pass it in the `getCodeOwnersEntries` parameter to speed up your queries.\n" ], "signature": [ - "() => Promise" + "(searchPath: string, codeOwnersEntries: ", + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" + }, + "[] | undefined) => string[]" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, - "children": [], - "returnComment": [], + "children": [ + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getOwningTeamsForPath.$1", + "type": "string", + "tags": [], + "label": "searchPath", + "description": [ + "The path to find code owners for" + ], + "signature": [ + "string" + ], + "path": "packages/kbn-code-owners/src/code_owners.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.getOwningTeamsForPath.$2", + "type": "Array", + "tags": [], + "label": "codeOwnersEntries", + "description": [ + "Pre-defined list of code owner entries" + ], + "signature": [ + { + "pluginId": "@kbn/code-owners", + "scope": "common", + "docId": "kibKbnCodeOwnersPluginApi", + "section": "def-common.CodeOwnersEntry", + "text": "CodeOwnersEntry" + }, + "[] | undefined" + ], + "path": "packages/kbn-code-owners/src/code_owners.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [ + "List of code owners for the given path. Empty list if no matching entry is found." + ], "initialIsOpen": false } ], "interfaces": [ { "parentPluginId": "@kbn/code-owners", - "id": "def-common.PathWithOwners", + "id": "def-common.CodeOwnersEntry", "type": "Interface", "tags": [], - "label": "PathWithOwners", + "label": "CodeOwnersEntry", "description": [], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/code-owners", - "id": "def-common.PathWithOwners.path", + "id": "def-common.CodeOwnersEntry.pattern", "type": "string", "tags": [], - "label": "path", + "label": "pattern", "description": [], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/code-owners", - "id": "def-common.PathWithOwners.teams", - "type": "string", + "id": "def-common.CodeOwnersEntry.matcher", + "type": "Object", + "tags": [], + "label": "matcher", + "description": [], + "signature": [ + "Ignore" + ], + "path": "packages/kbn-code-owners/src/code_owners.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/code-owners", + "id": "def-common.CodeOwnersEntry.teams", + "type": "Array", "tags": [], "label": "teams", "description": [], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "signature": [ + "string[]" + ], + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false }, { "parentPluginId": "@kbn/code-owners", - "id": "def-common.PathWithOwners.ignorePattern", - "type": "Object", + "id": "def-common.CodeOwnersEntry.comment", + "type": "string", "tags": [], - "label": "ignorePattern", + "label": "comment", "description": [], "signature": [ - "Ignore" + "string | undefined" ], - "path": "packages/kbn-code-owners/src/file_code_owner.ts", + "path": "packages/kbn-code-owners/src/code_owners.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_code_owners.mdx b/api_docs/kbn_code_owners.mdx index 86b94b9825f5..cb2a6ea15927 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/code-owners'] --- import kbnCodeOwnersObj from './kbn_code_owners.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) for | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 9 | 0 | 4 | 0 | +| 12 | 0 | 5 | 0 | ## Common diff --git a/api_docs/kbn_coloring.devdocs.json b/api_docs/kbn_coloring.devdocs.json index c219a0dfa777..8084df1bd1b2 100644 --- a/api_docs/kbn_coloring.devdocs.json +++ b/api_docs/kbn_coloring.devdocs.json @@ -209,6 +209,97 @@ } ], "functions": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.applyPaletteParams", + "type": "Function", + "tags": [], + "label": "applyPaletteParams", + "description": [], + "signature": [ + "(palettes: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + }, + ", activePalette: T, dataBounds: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.DataBounds", + "text": "DataBounds" + }, + ") => { stop: number; color: string; }[]" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.applyPaletteParams.$1", + "type": "Object", + "tags": [], + "label": "palettes", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + } + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.applyPaletteParams.$2", + "type": "Uncategorized", + "tags": [], + "label": "activePalette", + "description": [], + "signature": [ + "T" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.applyPaletteParams.$3", + "type": "Object", + "tags": [], + "label": "dataBounds", + "description": [], + "signature": [ + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.DataBounds", + "text": "DataBounds" + } + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/coloring", "id": "def-common.checkIsMaxContinuity", @@ -486,8 +577,14 @@ "GradientColor", " | (", "LoopColor", - " & { paletteId: string; colorIndex: number; }), getPaletteFn: (paletteId: string) => ", - "CategoricalPalette", + " & { paletteId: string; colorIndex: number; }), palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, ", isDarkMode: boolean, index: number, total: number) => string" ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", @@ -536,13 +633,18 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getAssignmentColor.$3", - "type": "Function", + "type": "Object", "tags": [], - "label": "getPaletteFn", + "label": "palettes", "description": [], "signature": [ - "(paletteId: string) => ", - "CategoricalPalette" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, @@ -612,9 +714,15 @@ "ColorCode", " | (", "LoopColor", - " & { paletteId: string; colorIndex: number; }), getPaletteFn: (paletteId: string) => ", - "CategoricalPalette", - ", isDarkMode: boolean) => string" + " & { paletteId: string; colorIndex: number; }), palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, + ") => string" ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, @@ -643,28 +751,18 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getColor.$2", - "type": "Function", - "tags": [], - "label": "getPaletteFn", - "description": [], - "signature": [ - "(paletteId: string) => ", - "CategoricalPalette" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.getColor.$3", - "type": "boolean", + "type": "Object", "tags": [], - "label": "isDarkMode", + "label": "palettes", "description": [], "signature": [ - "boolean" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, @@ -718,8 +816,14 @@ "signature": [ "({ assignments, specialAssignments, colorMode, paletteId }: ", "Config", - ", getPaletteFn: (paletteId: string) => ", - "CategoricalPalette", + ", palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, ", isDarkMode: boolean, data: ", { "pluginId": "@kbn/coloring", @@ -752,13 +856,18 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getColorFactory.$2", - "type": "Function", + "type": "Object", "tags": [], - "label": "getPaletteFn", + "label": "palettes", "description": [], "signature": [ - "(paletteId: string) => ", - "CategoricalPalette" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, @@ -813,7 +922,15 @@ "label": "getColorsFromMapping", "description": [], "signature": [ - "(isDarkMode: boolean, colorMappings: ", + "(palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, + ", isDarkMode: boolean, colorMappings: ", "Config", " | undefined) => string[]" ], @@ -824,6 +941,27 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getColorsFromMapping.$1", + "type": "Object", + "tags": [], + "label": "palettes", + "description": [], + "signature": [ + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } + ], + "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/coloring", + "id": "def-common.getColorsFromMapping.$2", "type": "boolean", "tags": [], "label": "isDarkMode", @@ -838,7 +976,7 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getColorsFromMapping.$2", + "id": "def-common.getColorsFromMapping.$3", "type": "Object", "tags": [], "label": "colorMappings", @@ -968,8 +1106,14 @@ "signature": [ "(colorMode: ", "GradientColorMode", - ", getPaletteFn: (paletteId: string) => ", - "CategoricalPalette", + ", palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, ", isDarkMode: boolean) => (value: number) => string" ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", @@ -994,13 +1138,18 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getGradientColorScale.$2", - "type": "Function", + "type": "Object", "tags": [], - "label": "getPaletteFn", + "label": "palettes", "description": [], "signature": [ - "(paletteId: string) => ", - "CategoricalPalette" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.ts", "deprecated": false, @@ -1028,56 +1177,71 @@ }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPalette", + "id": "def-common.getOverridePaletteStops", "type": "Function", "tags": [], - "label": "getPalette", + "label": "getOverridePaletteStops", "description": [ - "\nThis function should be instanciated once at the root of the component with the available palettes and\na choosed default one and shared across components to keep a single point of truth of the available palettes and the default\none." + "\nReturns color stops for given palette type:\n\n- custom - User has modified the stops in some way - return stops as is\n- non-custom - Default palette stops - Return new stops based on palette\n\n> This is needed for BWC when switching between kibana themes." ], "signature": [ - "(palettes: Map, defaultPalette: ", - "CategoricalPalette", - ") => (paletteId: string) => ", - "CategoricalPalette" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "(paletteService: ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + }, + ", activePalette: T | undefined) => ", + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.ColorStop", + "text": "ColorStop" + }, + "[] | undefined" + ], + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, "children": [ { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPalette.$1", + "id": "def-common.getOverridePaletteStops.$1", "type": "Object", "tags": [], - "label": "palettes", + "label": "paletteService", "description": [], "signature": [ - "Map" + { + "pluginId": "@kbn/coloring", + "scope": "common", + "docId": "kibKbnColoringPluginApi", + "section": "def-common.PaletteRegistry", + "text": "PaletteRegistry" + } ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true }, { "parentPluginId": "@kbn/coloring", - "id": "def-common.getPalette.$2", - "type": "Object", + "id": "def-common.getOverridePaletteStops.$2", + "type": "Uncategorized", "tags": [], - "label": "defaultPalette", + "label": "activePalette", "description": [], "signature": [ - "CategoricalPalette" + "T | undefined" ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", + "path": "packages/kbn-coloring/src/palettes/utils.ts", "deprecated": false, "trackAdoption": false, - "isRequired": true + "isRequired": false } ], "returnComment": [], @@ -1091,7 +1255,15 @@ "label": "getPaletteColors", "description": [], "signature": [ - "(isDarkMode: boolean, colorMappings: ", + "(palettes: ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + }, + ", colorMappings: ", "Config", " | undefined) => string[]" ], @@ -1102,12 +1274,18 @@ { "parentPluginId": "@kbn/coloring", "id": "def-common.getPaletteColors.$1", - "type": "boolean", + "type": "Object", "tags": [], - "label": "isDarkMode", + "label": "palettes", "description": [], "signature": [ - "boolean" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts", "deprecated": false, @@ -1991,12 +2169,16 @@ "tags": [], "label": "palettes", "description": [ - "A map of paletteId and palette configuration" + "A collection of palette configurations" ], "signature": [ - "Map" + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } ], "path": "packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.tsx", "deprecated": false, @@ -2258,7 +2440,9 @@ "type": "Array", "tags": [], "label": "stops", - "description": [], + "description": [ + "lower color stops" + ], "signature": [ { "pluginId": "@kbn/coloring", @@ -2279,7 +2463,9 @@ "type": "Array", "tags": [], "label": "colorStops", - "description": [], + "description": [ + "upper color stops" + ], "signature": [ { "pluginId": "@kbn/coloring", @@ -3113,36 +3299,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ELASTIC_BRAND_PALETTE_COLORS", - "type": "Array", - "tags": [], - "label": "ELASTIC_BRAND_PALETTE_COLORS", - "description": [], - "signature": [ - "string[]" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUI_AMSTERDAM_PALETTE_COLORS", - "type": "Array", - "tags": [], - "label": "EUI_AMSTERDAM_PALETTE_COLORS", - "description": [], - "signature": [ - "string[]" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/coloring", "id": "def-common.FIXED_PROGRESSION", @@ -3158,21 +3314,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KIBANA_V7_LEGACY_PALETTE_COLORS", - "type": "Array", - "tags": [], - "label": "KIBANA_V7_LEGACY_PALETTE_COLORS", - "description": [], - "signature": [ - "string[]" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/coloring", "id": "def-common.LEGACY_COMPLIMENTARY_PALETTE", @@ -3188,36 +3329,6 @@ "trackAdoption": false, "initialIsOpen": false }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NEUTRAL_COLOR_DARK", - "type": "Array", - "tags": [], - "label": "NEUTRAL_COLOR_DARK", - "description": [], - "signature": [ - "string[]" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NEUTRAL_COLOR_LIGHT", - "type": "Array", - "tags": [], - "label": "NEUTRAL_COLOR_LIGHT", - "description": [], - "signature": [ - "string[]" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/coloring", "id": "def-common.PaletteContinuity", @@ -3241,23 +3352,23 @@ "label": "RequiredPaletteParamTypes", "description": [], "signature": [ - "{ reverse: boolean; name: string; rangeType: \"number\" | \"percent\"; continuity: ", + "{ reverse: boolean; name: string; rangeType: \"number\" | \"percent\"; stops: ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.PaletteContinuity", - "text": "PaletteContinuity" + "section": "def-common.ColorStop", + "text": "ColorStop" }, - "; progression: \"fixed\"; rangeMin: number; rangeMax: number; stops: ", + "[]; continuity: ", { "pluginId": "@kbn/coloring", "scope": "common", "docId": "kibKbnColoringPluginApi", - "section": "def-common.ColorStop", - "text": "ColorStop" + "section": "def-common.PaletteContinuity", + "text": "PaletteContinuity" }, - "[]; colorStops: ", + "; progression: \"fixed\"; rangeMin: number; rangeMax: number; colorStops: ", { "pluginId": "@kbn/coloring", "scope": "common", @@ -3274,23 +3385,6 @@ } ], "objects": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.AVAILABLE_PALETTES", - "type": "Object", - "tags": [], - "label": "AVAILABLE_PALETTES", - "description": [], - "signature": [ - "Map" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, { "parentPluginId": "@kbn/coloring", "id": "def-common.DEFAULT_COLOR_MAPPING_CONFIG", @@ -3373,483 +3467,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette", - "type": "Object", - "tags": [], - "label": "ElasticBrandPalette", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.colorCount", - "type": "number", - "tags": [], - "label": "colorCount", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"categorical\"" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.getColor", - "type": "Function", - "tags": [], - "label": "getColor", - "description": [], - "signature": [ - "(indexInRange: number, isDarkMode: boolean, loop: boolean) => string" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.getColor.$1", - "type": "number", - "tags": [], - "label": "indexInRange", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.getColor.$2", - "type": "boolean", - "tags": [], - "label": "isDarkMode", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.ElasticBrandPalette.getColor.$3", - "type": "boolean", - "tags": [], - "label": "loop", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette", - "type": "Object", - "tags": [], - "label": "EUIAmsterdamColorBlindPalette", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.colorCount", - "type": "number", - "tags": [], - "label": "colorCount", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"categorical\"" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.getColor", - "type": "Function", - "tags": [], - "label": "getColor", - "description": [], - "signature": [ - "(indexInRange: number, isDarkMode: boolean, loop: boolean) => string" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.getColor.$1", - "type": "number", - "tags": [], - "label": "indexInRange", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.getColor.$2", - "type": "boolean", - "tags": [], - "label": "isDarkMode", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.EUIAmsterdamColorBlindPalette.getColor.$3", - "type": "boolean", - "tags": [], - "label": "loop", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette", - "type": "Object", - "tags": [], - "label": "KibanaV7LegacyPalette", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.colorCount", - "type": "number", - "tags": [], - "label": "colorCount", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"categorical\"" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.getColor", - "type": "Function", - "tags": [], - "label": "getColor", - "description": [], - "signature": [ - "(indexInRange: number, isDarkMode: boolean, loop: boolean) => string" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.getColor.$1", - "type": "number", - "tags": [], - "label": "indexInRange", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.getColor.$2", - "type": "boolean", - "tags": [], - "label": "isDarkMode", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.KibanaV7LegacyPalette.getColor.$3", - "type": "boolean", - "tags": [], - "label": "loop", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette", - "type": "Object", - "tags": [], - "label": "NeutralPalette", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.id", - "type": "string", - "tags": [], - "label": "id", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.name", - "type": "string", - "tags": [], - "label": "name", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.colorCount", - "type": "number", - "tags": [], - "label": "colorCount", - "description": [], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.type", - "type": "string", - "tags": [], - "label": "type", - "description": [], - "signature": [ - "\"categorical\"" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.getColor", - "type": "Function", - "tags": [], - "label": "getColor", - "description": [], - "signature": [ - "(valueInRange: number, isDarkMode: boolean) => string" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.getColor.$1", - "type": "number", - "tags": [], - "label": "valueInRange", - "description": [], - "signature": [ - "number" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/coloring", - "id": "def-common.NeutralPalette.getColor.$2", - "type": "boolean", - "tags": [], - "label": "isDarkMode", - "description": [], - "signature": [ - "boolean" - ], - "path": "packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "@kbn/coloring", "id": "def-common.SPECIAL_TOKENS_STRING_CONVERSION", diff --git a/api_docs/kbn_coloring.mdx b/api_docs/kbn_coloring.mdx index 1495e93f5535..dfa2ee0053f8 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 227 | 0 | 188 | 9 | +| 190 | 0 | 149 | 8 | ## Common diff --git a/api_docs/kbn_config.mdx b/api_docs/kbn_config.mdx index 4495a9d666e3..840fc167e95f 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-12-10 +date: 2024-12-13 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 52dc8a530280..5c015fc3e076 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-mocks'] --- import kbnConfigMocksObj from './kbn_config_mocks.devdocs.json'; diff --git a/api_docs/kbn_config_schema.mdx b/api_docs/kbn_config_schema.mdx index 8d6f34dec6a1..8b725ba628c2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/config-schema'] --- import kbnConfigSchemaObj from './kbn_config_schema.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_editor.mdx b/api_docs/kbn_content_management_content_editor.mdx index 1e141bcb1989..8de851b171ed 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_content_management_content_insights_public.mdx index f27aed576d94..ca6e3d00769f 100644 --- a/api_docs/kbn_content_management_content_insights_public.mdx +++ b/api_docs/kbn_content_management_content_insights_public.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-public'] --- import kbnContentManagementContentInsightsPublicObj from './kbn_content_management_content_insights_public.devdocs.json'; diff --git a/api_docs/kbn_content_management_content_insights_server.mdx b/api_docs/kbn_content_management_content_insights_server.mdx index 4c87ff91d8cd..ca46e0e6b4f7 100644 --- a/api_docs/kbn_content_management_content_insights_server.mdx +++ b/api_docs/kbn_content_management_content_insights_server.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-content-insights-server'] --- import kbnContentManagementContentInsightsServerObj from './kbn_content_management_content_insights_server.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_common.mdx b/api_docs/kbn_content_management_favorites_common.mdx index b520a79a5bd4..1105e9a63d7a 100644 --- a/api_docs/kbn_content_management_favorites_common.mdx +++ b/api_docs/kbn_content_management_favorites_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-content-management-favorites-common title: "@kbn/content-management-favorites-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/content-management-favorites-common plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-favorites-common'] --- import kbnContentManagementFavoritesCommonObj from './kbn_content_management_favorites_common.devdocs.json'; diff --git a/api_docs/kbn_content_management_favorites_public.mdx b/api_docs/kbn_content_management_favorites_public.mdx index 6c4acde0a5d1..8ff2807d6956 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-12-10 +date: 2024-12-13 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 3aedb8d008ab..4e18c74e6f03 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-12-10 +date: 2024-12-13 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 8414c4c621aa..c248cd5f7428 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-12-10 +date: 2024-12-13 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 381897e6a3e5..ddf005e536e4 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-12-10 +date: 2024-12-13 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 dd1dc0326613..ddce5e5884a6 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_content_management_table_list_view_table.mdx index ed02b594ff00..94c08f27c151 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-table-list-view-table'] --- import kbnContentManagementTableListViewTableObj from './kbn_content_management_table_list_view_table.devdocs.json'; diff --git a/api_docs/kbn_content_management_user_profiles.mdx b/api_docs/kbn_content_management_user_profiles.mdx index 2b422b7c4fe1..a6e5c8b258c8 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_content_management_utils.mdx index bc0eace880ee..427b06bf0544 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/content-management-utils'] --- import kbnContentManagementUtilsObj from './kbn_content_management_utils.devdocs.json'; diff --git a/api_docs/kbn_core_analytics_browser.devdocs.json b/api_docs/kbn_core_analytics_browser.devdocs.json index d9e9918f342d..22c2c66ed6dd 100644 --- a/api_docs/kbn_core_analytics_browser.devdocs.json +++ b/api_docs/kbn_core_analytics_browser.devdocs.json @@ -478,14 +478,6 @@ "deprecated": false, "trackAdoption": true, "references": [ - { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, - { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, { "plugin": "@kbn/ebt-tools", "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" @@ -514,6 +506,14 @@ "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" }, + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, { "plugin": "@kbn/core-root-browser-internal", "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" @@ -640,15 +640,15 @@ }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts" }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/index.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/index.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx" + "path": "src/plugins/dashboard/public/dashboard_api/track_contentful_render.ts" }, { "plugin": "discover", @@ -758,70 +758,6 @@ "plugin": "globalSearchBar", "path": "x-pack/plugins/global_search_bar/public/telemetry/event_reporter.ts" }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" @@ -926,6 +862,70 @@ "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_client.ts" }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, { "plugin": "inventory", "path": "x-pack/plugins/observability_solution/inventory/public/services/telemetry/telemetry_client.ts" @@ -994,10 +994,6 @@ "plugin": "spaces", "path": "x-pack/plugins/spaces/public/management/management_service.test.ts" }, - { - "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" @@ -1054,6 +1050,10 @@ "plugin": "@kbn/langchain", "path": "x-pack/packages/kbn-langchain/server/tracers/telemetry/telemetry_tracer.test.ts" }, + { + "plugin": "observabilityAIAssistant", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" + }, { "plugin": "@kbn/shared-ux-chrome-navigation", "path": "packages/shared-ux/chrome/navigation/mocks/storybook.ts" @@ -1720,14 +1720,6 @@ "deprecated": false, "trackAdoption": true, "references": [ - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" - }, - { - "plugin": "@kbn/core-application-browser-internal", - "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" - }, { "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" @@ -1756,6 +1748,14 @@ "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" + }, { "plugin": "@kbn/core-chrome-browser-internal", "path": "packages/core/chrome/core-chrome-browser-internal/src/register_analytics_context_provider.ts" diff --git a/api_docs/kbn_core_analytics_browser.mdx b/api_docs/kbn_core_analytics_browser.mdx index 5268cf635993..8205183dc4e3 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-12-10 +date: 2024-12-13 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 a5006de5b148..fd1863900ef6 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-12-10 +date: 2024-12-13 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 6ccf946f3472..e04dd097a02c 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-12-10 +date: 2024-12-13 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 f551b259301d..4ec443605ba5 100644 --- a/api_docs/kbn_core_analytics_server.devdocs.json +++ b/api_docs/kbn_core_analytics_server.devdocs.json @@ -486,14 +486,6 @@ "deprecated": false, "trackAdoption": true, "references": [ - { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, - { - "plugin": "@kbn/core-notifications-browser-internal", - "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" - }, { "plugin": "@kbn/ebt-tools", "path": "packages/kbn-ebt-tools/src/performance_metric_events/helpers.ts" @@ -522,6 +514,14 @@ "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" }, + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, + { + "plugin": "@kbn/core-notifications-browser-internal", + "path": "packages/core/notifications/core-notifications-browser-internal/src/toasts/telemetry/event_reporter.ts" + }, { "plugin": "@kbn/core-root-browser-internal", "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" @@ -648,15 +648,15 @@ }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts" }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/index.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/index.ts" }, { "plugin": "dashboard", - "path": "src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx" + "path": "src/plugins/dashboard/public/dashboard_api/track_contentful_render.ts" }, { "plugin": "discover", @@ -766,70 +766,6 @@ "plugin": "globalSearchBar", "path": "x-pack/plugins/global_search_bar/public/telemetry/event_reporter.ts" }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/public/common/lib/telemetry/telemetry_service.ts" @@ -934,6 +870,70 @@ "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/public/services/telemetry/telemetry_client.ts" }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/public/services/telemetry/telemetry_client.ts" + }, { "plugin": "inventory", "path": "x-pack/plugins/observability_solution/inventory/public/services/telemetry/telemetry_client.ts" @@ -1002,10 +1002,6 @@ "plugin": "spaces", "path": "x-pack/plugins/spaces/public/management/management_service.test.ts" }, - { - "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.test.ts" @@ -1062,6 +1058,10 @@ "plugin": "@kbn/langchain", "path": "x-pack/packages/kbn-langchain/server/tracers/telemetry/telemetry_tracer.test.ts" }, + { + "plugin": "observabilityAIAssistant", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts" + }, { "plugin": "@kbn/shared-ux-chrome-navigation", "path": "packages/shared-ux/chrome/navigation/mocks/storybook.ts" @@ -1728,14 +1728,6 @@ "deprecated": false, "trackAdoption": true, "references": [ - { - "plugin": "@kbn/core-execution-context-browser-internal", - "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" - }, - { - "plugin": "@kbn/core-application-browser-internal", - "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" - }, { "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/track_viewport_size.ts" @@ -1764,6 +1756,14 @@ "plugin": "@kbn/core-analytics-browser-internal", "path": "packages/core/analytics/core-analytics-browser-internal/src/analytics_service.ts" }, + { + "plugin": "@kbn/core-execution-context-browser-internal", + "path": "packages/core/execution-context/core-execution-context-browser-internal/src/execution_context_service.ts" + }, + { + "plugin": "@kbn/core-application-browser-internal", + "path": "packages/core/application/core-application-browser-internal/src/register_analytics_context_provider.ts" + }, { "plugin": "@kbn/core-chrome-browser-internal", "path": "packages/core/chrome/core-chrome-browser-internal/src/register_analytics_context_provider.ts" diff --git a/api_docs/kbn_core_analytics_server.mdx b/api_docs/kbn_core_analytics_server.mdx index 8fd7a6c7db4f..8fc2db6f9bdc 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-12-10 +date: 2024-12-13 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 f32edcf1c90f..62201d3a3ebb 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-12-10 +date: 2024-12-13 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 e13bfd11f70d..ff2e2cb774b0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-analytics-server-mocks'] --- import kbnCoreAnalyticsServerMocksObj from './kbn_core_analytics_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_application_browser.devdocs.json b/api_docs/kbn_core_application_browser.devdocs.json index ebe47e742231..149c4d9451d8 100644 --- a/api_docs/kbn_core_application_browser.devdocs.json +++ b/api_docs/kbn_core_application_browser.devdocs.json @@ -1193,14 +1193,14 @@ "plugin": "@kbn/core-application-browser-internal", "path": "packages/core/application/core-application-browser-internal/src/ui/app_container.tsx" }, - { - "plugin": "management", - "path": "src/plugins/management/public/application.tsx" - }, { "plugin": "@kbn/core-application-browser-mocks", "path": "packages/core/application/core-application-browser-mocks/src/application_service.mock.ts" }, + { + "plugin": "management", + "path": "src/plugins/management/public/application.tsx" + }, { "plugin": "assetInventory", "path": "x-pack/plugins/asset_inventory/public/application.tsx" diff --git a/api_docs/kbn_core_application_browser.mdx b/api_docs/kbn_core_application_browser.mdx index 7a220a921f5c..dcc7da9c3344 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-12-10 +date: 2024-12-13 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 ef5aed04efde..a62e20b8de37 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-12-10 +date: 2024-12-13 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 5992dbbfd428..ec38b927d611 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-12-10 +date: 2024-12-13 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 0f05b5dba4f7..ec527bf2b7a4 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-12-10 +date: 2024-12-13 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 0a92b458e618..0c29477cafe2 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-12-10 +date: 2024-12-13 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 1829d5574b6f..34f5cfa29296 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-12-10 +date: 2024-12-13 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 1c52009f749f..22937d1af8bc 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-12-10 +date: 2024-12-13 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 0c94ffc31801..4edb6ed1719e 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-12-10 +date: 2024-12-13 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 1bf883e34cf3..3b507adeead4 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-12-10 +date: 2024-12-13 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 54dca2606eec..7b2835a70f7a 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-12-10 +date: 2024-12-13 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 b62bf102300c..8b1b2edbc7ab 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-12-10 +date: 2024-12-13 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 a4778701fe07..1d71fb838a16 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-12-10 +date: 2024-12-13 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 0bb412893d35..ee93fb89de39 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-12-10 +date: 2024-12-13 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 6bafdc9098db..e8ca7fcd6394 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-12-10 +date: 2024-12-13 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 f94a07a92fa0..6bd4d6cddee1 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_core_chrome_browser.mdx index 3ff5c647421b..679a90668bb8 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-12-10 +date: 2024-12-13 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 facf6c49d14a..a8efc38ca095 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-12-10 +date: 2024-12-13 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 456531968563..0670bb0ec878 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-12-10 +date: 2024-12-13 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 ca9eb8edba74..86ad6d1471bc 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-12-10 +date: 2024-12-13 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 8f9889ca56ae..46808f9021dc 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-12-10 +date: 2024-12-13 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 3e647c5acecd..3b9a5a430881 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-12-10 +date: 2024-12-13 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 425fa315c24b..d0800550174c 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-12-10 +date: 2024-12-13 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 3160fcad8999..f2556aebfccf 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-12-10 +date: 2024-12-13 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 b131ab29af77..22f313b9c6ab 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-12-10 +date: 2024-12-13 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 08d626b5426e..40d743728306 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-12-10 +date: 2024-12-13 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 38a020f2e6b3..7d843ed45d86 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-12-10 +date: 2024-12-13 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 c7e94ae340b1..ed50eb87493c 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-12-10 +date: 2024-12-13 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 6c719b4ab17d..a43054dd4e10 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-12-10 +date: 2024-12-13 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 25eb627f3a02..aa93e7f65184 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-12-10 +date: 2024-12-13 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 5fb5a51b2225..a08cf983b4d8 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-12-10 +date: 2024-12-13 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 5e5ab6f14960..b8d0fd8d8a0f 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-12-10 +date: 2024-12-13 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 88dc4dfb3126..c9cece83078d 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-12-10 +date: 2024-12-13 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 e519eaee2c94..f9b5f295f315 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-12-10 +date: 2024-12-13 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 56ed02211350..5b31fab9109a 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-12-10 +date: 2024-12-13 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 bed1728d3ef7..7f037cdc7c8d 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-12-10 +date: 2024-12-13 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 7a57afe9bb72..622c77f030bf 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-12-10 +date: 2024-12-13 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 b772e4bf03be..cb707b072be6 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-internal'] --- import kbnCoreElasticsearchClientServerInternalObj from './kbn_core_elasticsearch_client_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx b/api_docs/kbn_core_elasticsearch_client_server_mocks.mdx index 0e2889f354f7..a40e0770d058 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-client-server-mocks'] --- import kbnCoreElasticsearchClientServerMocksObj from './kbn_core_elasticsearch_client_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server.mdx b/api_docs/kbn_core_elasticsearch_server.mdx index f800236689da..7e66df339d30 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-elasticsearch-server'] --- import kbnCoreElasticsearchServerObj from './kbn_core_elasticsearch_server.devdocs.json'; diff --git a/api_docs/kbn_core_elasticsearch_server_internal.mdx b/api_docs/kbn_core_elasticsearch_server_internal.mdx index dac12bb55fb7..4a10a1bc2bf9 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-12-10 +date: 2024-12-13 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 44695a10fcaf..0791dadd980e 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-12-10 +date: 2024-12-13 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 92926382d0de..3c5d883d7f95 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-12-10 +date: 2024-12-13 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 4a9c088e1695..f1a5d99fe8f3 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-12-10 +date: 2024-12-13 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 ba036780ab01..677a5d72ad98 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-12-10 +date: 2024-12-13 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 71955a5f6319..2f1410c7f9c0 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-12-10 +date: 2024-12-13 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 819a5924cc4e..88abdc7abb9b 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-12-10 +date: 2024-12-13 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 163e3cd854d1..135d57d41e84 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-12-10 +date: 2024-12-13 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 7c02cf9672d7..b716f7949279 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-12-10 +date: 2024-12-13 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 b117a9535574..28e0bd7710e2 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-12-10 +date: 2024-12-13 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 5c3d77b99ed2..a3364ea7d666 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-12-10 +date: 2024-12-13 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 d1515de746e4..9d90ac6db686 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-12-10 +date: 2024-12-13 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 db642ff24ab8..345cda7e4a56 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-12-10 +date: 2024-12-13 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_feature_flags_browser.mdx b/api_docs/kbn_core_feature_flags_browser.mdx index ddc168e31846..cd1f78bf23f6 100644 --- a/api_docs/kbn_core_feature_flags_browser.mdx +++ b/api_docs/kbn_core_feature_flags_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser title: "@kbn/core-feature-flags-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser'] --- import kbnCoreFeatureFlagsBrowserObj from './kbn_core_feature_flags_browser.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_browser_internal.mdx b/api_docs/kbn_core_feature_flags_browser_internal.mdx index 67cd7542de7e..b406b5fa8b8a 100644 --- a/api_docs/kbn_core_feature_flags_browser_internal.mdx +++ b/api_docs/kbn_core_feature_flags_browser_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser-internal title: "@kbn/core-feature-flags-browser-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser-internal plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser-internal'] --- import kbnCoreFeatureFlagsBrowserInternalObj from './kbn_core_feature_flags_browser_internal.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_browser_mocks.mdx b/api_docs/kbn_core_feature_flags_browser_mocks.mdx index 3174685b34dc..bf64feac45f5 100644 --- a/api_docs/kbn_core_feature_flags_browser_mocks.mdx +++ b/api_docs/kbn_core_feature_flags_browser_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-browser-mocks title: "@kbn/core-feature-flags-browser-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-browser-mocks plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-browser-mocks'] --- import kbnCoreFeatureFlagsBrowserMocksObj from './kbn_core_feature_flags_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server.mdx b/api_docs/kbn_core_feature_flags_server.mdx index beda8b77721d..8182176ddcc7 100644 --- a/api_docs/kbn_core_feature_flags_server.mdx +++ b/api_docs/kbn_core_feature_flags_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server title: "@kbn/core-feature-flags-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server'] --- import kbnCoreFeatureFlagsServerObj from './kbn_core_feature_flags_server.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server_internal.mdx b/api_docs/kbn_core_feature_flags_server_internal.mdx index 2b4bfb233f54..a771f849fef7 100644 --- a/api_docs/kbn_core_feature_flags_server_internal.mdx +++ b/api_docs/kbn_core_feature_flags_server_internal.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server-internal title: "@kbn/core-feature-flags-server-internal" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server-internal plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server-internal'] --- import kbnCoreFeatureFlagsServerInternalObj from './kbn_core_feature_flags_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_feature_flags_server_mocks.mdx b/api_docs/kbn_core_feature_flags_server_mocks.mdx index d8b3e2cf5cb9..c5cd1b67689e 100644 --- a/api_docs/kbn_core_feature_flags_server_mocks.mdx +++ b/api_docs/kbn_core_feature_flags_server_mocks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-feature-flags-server-mocks title: "@kbn/core-feature-flags-server-mocks" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-feature-flags-server-mocks plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-feature-flags-server-mocks'] --- import kbnCoreFeatureFlagsServerMocksObj from './kbn_core_feature_flags_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_http_browser.mdx b/api_docs/kbn_core_http_browser.mdx index 376b09de8c7e..47feb98a1775 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-12-10 +date: 2024-12-13 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 dc43923bfe5a..79a3956a3dcc 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-12-10 +date: 2024-12-13 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 4a67f90d582e..d9f23d50185e 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-12-10 +date: 2024-12-13 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 46720ed3b6b0..e6174c259b94 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-12-10 +date: 2024-12-13 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 3c81379f64f7..0c0f76e5f859 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-12-10 +date: 2024-12-13 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 a8b1b23e8fe0..900fb29534bc 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-12-10 +date: 2024-12-13 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 d9fc15578ca9..e81c0e3bebae 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-12-10 +date: 2024-12-13 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 1f6439187e6b..11723b29b728 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-12-10 +date: 2024-12-13 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 6e6c37225673..ebfe69a7c320 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-12-10 +date: 2024-12-13 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 3d50d993f4a9..a003298c7df1 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-12-10 +date: 2024-12-13 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 e2dbfc0121b1..9d3373993b17 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-12-10 +date: 2024-12-13 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 8c6fcf6c11a1..699bacac9a38 100644 --- a/api_docs/kbn_core_http_server.devdocs.json +++ b/api_docs/kbn_core_http_server.devdocs.json @@ -4027,7 +4027,7 @@ }, { "plugin": "inference", - "path": "x-pack/plugins/inference/server/routes/connectors.ts" + "path": "x-pack/platform/plugins/shared/inference/server/routes/connectors.ts" }, { "plugin": "assetInventory", @@ -4175,15 +4175,15 @@ }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "triggersActionsUi", @@ -4195,7 +4195,7 @@ }, { "plugin": "productDocBase", - "path": "x-pack/plugins/ai_infra/product_doc_base/server/routes/installation.ts" + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" }, { "plugin": "globalSearch", @@ -4677,22 +4677,6 @@ "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipelines/list.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/routes/fields.ts" - }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/plugin.ts" @@ -4721,6 +4705,14 @@ "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts" }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/routes/metric_indices/index.ts" + }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts" @@ -4989,6 +4981,14 @@ "plugin": "grokdebugger", "path": "x-pack/plugins/grokdebugger/server/lib/kibana_framework.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/routes/fields.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "profiling", "path": "x-pack/plugins/observability_solution/profiling/server/routes/apm.ts" @@ -5025,14 +5025,6 @@ "plugin": "profiling", "path": "x-pack/plugins/observability_solution/profiling/server/routes/topn.ts" }, - { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" - }, - { - "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" - }, { "plugin": "spaces", "path": "x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts" @@ -5053,6 +5045,14 @@ "plugin": "apmDataAccess", "path": "x-pack/plugins/observability_solution/apm_data_access/server/lib/helpers/create_es_client/create_apm_event_client/index.test.ts" }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" + }, { "plugin": "console", "path": "src/plugins/console/server/routes/api/console/es_config/index.ts" @@ -6753,11 +6753,11 @@ }, { "plugin": "inference", - "path": "x-pack/plugins/inference/server/routes/chat_complete.ts" + "path": "x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts" }, { "plugin": "inference", - "path": "x-pack/plugins/inference/server/routes/chat_complete.ts" + "path": "x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts" }, { "plugin": "savedObjectsTagging", @@ -6877,7 +6877,7 @@ }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "triggersActionsUi", @@ -6893,11 +6893,11 @@ }, { "plugin": "productDocBase", - "path": "x-pack/plugins/ai_infra/product_doc_base/server/routes/installation.ts" + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" }, { "plugin": "productDocBase", - "path": "x-pack/plugins/ai_infra/product_doc_base/server/routes/installation.ts" + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/routes/installation.ts" }, { "plugin": "globalSearch", @@ -7303,18 +7303,6 @@ "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipelines/delete.ts" }, - { - "plugin": "visTypeTimeseries", - "path": "src/plugins/vis_types/timeseries/server/routes/vis.ts" - }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts" @@ -7395,6 +7383,10 @@ "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts" }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "painlessLab", "path": "x-pack/plugins/painless_lab/server/routes/api/execute.ts" @@ -7579,17 +7571,25 @@ "plugin": "grokdebugger", "path": "x-pack/plugins/grokdebugger/server/lib/kibana_framework.ts" }, + { + "plugin": "visTypeTimeseries", + "path": "src/plugins/vis_types/timeseries/server/routes/vis.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "profiling", "path": "x-pack/plugins/observability_solution/profiling/server/routes/setup/route.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, { "plugin": "console", @@ -8867,7 +8867,7 @@ }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "logsShared", @@ -9061,14 +9061,6 @@ "plugin": "logstash", "path": "x-pack/plugins/logstash/server/routes/pipeline/save.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "monitoring", "path": "x-pack/plugins/monitoring/server/plugin.ts" @@ -9077,6 +9069,10 @@ "plugin": "@kbn/test-suites-xpack", "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/routes/internal/deprecations/deprecations.ts" @@ -9133,13 +9129,17 @@ "plugin": "grokdebugger", "path": "x-pack/plugins/grokdebugger/server/lib/kibana_framework.ts" }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, { "plugin": "ftrApis", @@ -9487,6 +9487,10 @@ "plugin": "enterpriseSearch", "path": "x-pack/plugins/enterprise_search/server/routes/workplace_search/sources.ts" }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" + }, { "plugin": "metricsDataAccess", "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" @@ -9495,10 +9499,6 @@ "plugin": "infra", "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, - { - "plugin": "@kbn/test-suites-xpack", - "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" - }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/router.ts" @@ -9835,7 +9835,7 @@ }, { "plugin": "observability", - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts" + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts" }, { "plugin": "enterpriseSearch", @@ -9985,10 +9985,6 @@ "plugin": "metricsDataAccess", "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "reporting", "path": "x-pack/plugins/reporting/server/routes/internal/management/jobs.ts" @@ -10037,13 +10033,17 @@ "plugin": "grokdebugger", "path": "x-pack/plugins/grokdebugger/server/lib/kibana_framework.ts" }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" }, { "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" }, { "plugin": "ftrApis", @@ -13323,169 +13323,653 @@ "parentPluginId": "@kbn/core-http-server", "id": "def-server.RouteConfigOptions.authRequired", "type": "CompoundType", - "tags": [], + "tags": [ + "deprecated" + ], "label": "authRequired", "description": [ - "\nDefines authentication mode for a route:\n- true. A user has to have valid credentials to access a resource\n- false. A user can access a resource without any credentials.\n- 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid.\n Can be useful when we grant access to a resource but want to identify a user if possible.\n\nDefaults to `true` if an auth mechanism is registered." + "\nDefines authentication mode for a route:\n- true. A user has to have valid credentials to access a resource\n- false. A user can access a resource without any credentials.\n- 'optional'. A user can access a resource, and will be authenticated if provided credentials are valid.\n Can be useful when we grant access to a resource but want to identify a user if possible.\n\nDefaults to `true` if an auth mechanism is registered.\n" ], "signature": [ "boolean | \"optional\" | undefined" ], "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.xsrfRequired", - "type": "Uncategorized", - "tags": [], - "label": "xsrfRequired", - "description": [ - "\nDefines xsrf protection requirements for a route:\n- true. Requires an incoming POST/PUT/DELETE request to contain `kbn-xsrf` header.\n- false. Disables xsrf protection.\n\nSet to true by default" - ], - "signature": [ - "(Method extends \"get\" ? never : boolean) | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.access", - "type": "CompoundType", - "tags": [], - "label": "access", - "description": [ - "\nDefines intended request origin of the route:\n- public. The route is public, declared stable and intended for external access.\n In the future, may require an incoming request to contain a specified header.\n- internal. The route is internal and intended for internal access only.\n\nDefaults to 'internal' If not declared," - ], - "signature": [ + "deprecated": true, + "trackAdoption": false, + "references": [ { - "pluginId": "@kbn/core-http-server", - "scope": "server", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-server.RouteAccess", - "text": "RouteAccess" + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts" }, - " | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.tags", - "type": "Object", - "tags": [], - "label": "tags", - "description": [ - "\nAdditional metadata tag strings to attach to the route." - ], - "signature": [ - "readonly string[] | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.body", - "type": "Uncategorized", - "tags": [], - "label": "body", - "description": [ - "\nAdditional body options {@link RouteConfigOptionsBody}." - ], - "signature": [ - "(Method extends \"get\" | \"options\" ? undefined : ", { - "pluginId": "@kbn/core-http-server", - "scope": "server", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-server.RouteConfigOptionsBody", - "text": "RouteConfigOptionsBody" + "plugin": "@kbn/core-http-server-internal", + "path": "packages/core/http/core-http-server-internal/src/http_server.ts" }, - ") | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.timeout", - "type": "Object", - "tags": [], - "label": "timeout", - "description": [ - "\nDefines per-route timeouts." - ], - "signature": [ - "{ payload?: (Method extends \"get\" | \"options\" ? undefined : number) | undefined; idleSocket?: number | undefined; } | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.summary", - "type": "string", - "tags": [], - "label": "summary", - "description": [ - "\nShort summary of this route. Required for all routes used in OAS documentation.\n" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.description", - "type": "string", - "tags": [], - "label": "description", - "description": [ - "\nOptional API description, which supports [CommonMark](https://spec.commonmark.org) markdown formatting\n" - ], - "signature": [ - "string | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/core-http-server", - "id": "def-server.RouteConfigOptions.deprecated", - "type": "Object", - "tags": [], - "label": "deprecated", - "description": [ - "\nDescription of deprecations for this HTTP API.\n" - ], - "signature": [ { - "pluginId": "@kbn/core-http-server", - "scope": "server", - "docId": "kibKbnCoreHttpServerPluginApi", - "section": "def-server.RouteDeprecationInfo", - "text": "RouteDeprecationInfo" + "plugin": "@kbn/core-http-server-internal", + "path": "packages/core/http/core-http-server-internal/src/http_server.ts" }, - " | undefined" - ], - "path": "packages/core/http/core-http-server/src/router/route.ts", - "deprecated": false, - "trackAdoption": false - }, - { + { + "plugin": "@kbn/core-metrics-server-internal", + "path": "packages/core/metrics/core-metrics-server-internal/src/routes/elu_history.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/routes/status.ts" + }, + { + "plugin": "@kbn/core-status-server-internal", + "path": "packages/core/status/core-status-server-internal/src/routes/status_preboot.ts" + }, + { + "plugin": "@kbn/core-i18n-server-internal", + "path": "packages/core/i18n/core-i18n-server-internal/src/routes/translations.ts" + }, + { + "plugin": "@kbn/core-rendering-server-internal", + "path": "packages/core/rendering/core-rendering-server-internal/src/bootstrap/register_bootstrap_route.ts" + }, + { + "plugin": "@kbn/core-capabilities-server-internal", + "path": "packages/core/capabilities/core-capabilities-server-internal/src/routes/resolve_capabilities.ts" + }, + { + "plugin": "@kbn/core-apps-server-internal", + "path": "packages/core/apps/core-apps-server-internal/src/bundle_routes/bundles_route.ts" + }, + { + "plugin": "@kbn/core-apps-server-internal", + "path": "packages/core/apps/core-apps-server-internal/src/core_app.ts" + }, + { + "plugin": "@kbn/core-apps-server-internal", + "path": "packages/core/apps/core-apps-server-internal/src/core_app.ts" + }, + { + "plugin": "usageCollection", + "path": "src/plugins/usage_collection/server/routes/stats/stats.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/common.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/common.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authentication/saml.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/authorization/reset_session_page.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/views/capture_url.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/views/logged_out.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/views/login.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/views/login.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/views/logout.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/routes/analytics/record_violations.ts" + }, + { + "plugin": "monitoringCollection", + "path": "x-pack/plugins/monitoring_collection/server/routes/api/v1/dynamic_route/get_metrics_by_type.ts" + }, + { + "plugin": "monitoringCollection", + "path": "x-pack/plugins/monitoring_collection/server/routes/api/v1/prometheus/get_metrics.ts" + }, + { + "plugin": "files", + "path": "src/plugins/files/server/routes/public_facing/download.ts" + }, + { + "plugin": "banners", + "path": "x-pack/plugins/banners/server/routes/info.ts" + }, + { + "plugin": "telemetry", + "path": "src/plugins/telemetry/server/routes/telemetry_config.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/agent/agent_status_handler.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/resolver.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/update_insight.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/workflow_insights/get_insights.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/metadata/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/policy/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_info_handler.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/file_download_handler.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/details.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/status.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/state.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/list.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/pagerduty_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/servicenow_oauth_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/jira_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/resilient_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/ms_exchage_server_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/ms_exchage_server_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/xmatters_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/torq_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts" + }, + { + "plugin": "@kbn/test-suites-xpack", + "path": "x-pack/test/alerting_api_integration/common/plugins/actions_simulators/server/tines_simulation.ts" + }, + { + "plugin": "cloudFullStory", + "path": "x-pack/plugins/cloud_integrations/cloud_full_story/server/routes/fullstory.ts" + }, + { + "plugin": "customBranding", + "path": "x-pack/plugins/custom_branding/server/routes/info.ts" + }, + { + "plugin": "enterpriseSearch", + "path": "x-pack/plugins/enterprise_search/server/lib/route_config_helpers.test.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + }, + { + "plugin": "taskManager", + "path": "x-pack/plugins/task_manager/server/routes/background_task_utilization.test.ts" + }, + { + "plugin": "interactiveSetup", + "path": "src/plugins/interactive_setup/server/routes/configure.ts" + }, + { + "plugin": "interactiveSetup", + "path": "src/plugins/interactive_setup/server/routes/enroll.ts" + }, + { + "plugin": "interactiveSetup", + "path": "src/plugins/interactive_setup/server/routes/ping.ts" + }, + { + "plugin": "interactiveSetup", + "path": "src/plugins/interactive_setup/server/routes/status.ts" + }, + { + "plugin": "interactiveSetup", + "path": "src/plugins/interactive_setup/server/routes/verify.ts" + }, + { + "plugin": "mockIdpPlugin", + "path": "packages/kbn-mock-idp-plugin/server/plugin.ts" + }, + { + "plugin": "mockIdpPlugin", + "path": "packages/kbn-mock-idp-plugin/server/plugin.ts" + }, + { + "plugin": "mockIdpPlugin", + "path": "packages/kbn-mock-idp-plugin/server/plugin.ts" + }, + { + "plugin": "mockIdpPlugin", + "path": "packages/kbn-mock-idp-plugin/server/plugin.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_route.test.ts" + }, + { + "plugin": "@kbn/core-http-server-internal", + "path": "packages/core/http/core-http-server-internal/src/lifecycle/auth.ts" + }, + { + "plugin": "@kbn/core-http-server-internal", + "path": "packages/core/http/core-http-server-internal/src/lifecycle/auth.ts" + }, + { + "plugin": "spaces", + "path": "x-pack/plugins/spaces/server/capabilities/capabilities_switcher.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/anonymous.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/basic.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/kerberos.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/saml.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/token.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/oidc.ts" + }, + { + "plugin": "security", + "path": "x-pack/plugins/security/server/authentication/providers/pki.ts" + }, + { + "plugin": "ml", + "path": "x-pack/platform/plugins/shared/ml/server/lib/capabilities/capabilities_switcher.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + }, + { + "plugin": "@kbn/core-http-router-server-internal", + "path": "packages/core/http/core-http-router-server-internal/src/request.test.ts" + } + ] + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.xsrfRequired", + "type": "Uncategorized", + "tags": [], + "label": "xsrfRequired", + "description": [ + "\nDefines xsrf protection requirements for a route:\n- true. Requires an incoming POST/PUT/DELETE request to contain `kbn-xsrf` header.\n- false. Disables xsrf protection.\n\nSet to true by default" + ], + "signature": [ + "(Method extends \"get\" ? never : boolean) | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.access", + "type": "CompoundType", + "tags": [], + "label": "access", + "description": [ + "\nDefines intended request origin of the route:\n- public. The route is public, declared stable and intended for external access.\n In the future, may require an incoming request to contain a specified header.\n- internal. The route is internal and intended for internal access only.\n\nDefaults to 'internal' If not declared," + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteAccess", + "text": "RouteAccess" + }, + " | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.tags", + "type": "Object", + "tags": [], + "label": "tags", + "description": [ + "\nAdditional metadata tag strings to attach to the route." + ], + "signature": [ + "readonly string[] | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.body", + "type": "Uncategorized", + "tags": [], + "label": "body", + "description": [ + "\nAdditional body options {@link RouteConfigOptionsBody}." + ], + "signature": [ + "(Method extends \"get\" | \"options\" ? undefined : ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteConfigOptionsBody", + "text": "RouteConfigOptionsBody" + }, + ") | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.timeout", + "type": "Object", + "tags": [], + "label": "timeout", + "description": [ + "\nDefines per-route timeouts." + ], + "signature": [ + "{ payload?: (Method extends \"get\" | \"options\" ? undefined : number) | undefined; idleSocket?: number | undefined; } | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.summary", + "type": "string", + "tags": [], + "label": "summary", + "description": [ + "\nShort summary of this route. Required for all routes used in OAS documentation.\n" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.description", + "type": "string", + "tags": [], + "label": "description", + "description": [ + "\nOptional API description, which supports [CommonMark](https://spec.commonmark.org) markdown formatting\n" + ], + "signature": [ + "string | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-http-server", + "id": "def-server.RouteConfigOptions.deprecated", + "type": "Object", + "tags": [], + "label": "deprecated", + "description": [ + "\nDescription of deprecations for this HTTP API.\n" + ], + "signature": [ + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.RouteDeprecationInfo", + "text": "RouteDeprecationInfo" + }, + " | undefined" + ], + "path": "packages/core/http/core-http-server/src/router/route.ts", + "deprecated": false, + "trackAdoption": false + }, + { "parentPluginId": "@kbn/core-http-server", "id": "def-server.RouteConfigOptions.excludeFromOAS", "type": "CompoundType", @@ -15457,10 +15941,6 @@ "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/server/routes/benchmark_rules/get_states/get_states.ts" }, - { - "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/data_streams.ts" - }, { "plugin": "ecsDataQualityDashboard", "path": "x-pack/plugins/ecs_data_quality_dashboard/server/routes/get_index_mappings.ts" @@ -15869,14 +16349,6 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/routes.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" @@ -16137,6 +16609,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts" }, + { + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get_prebuilt_rules.ts" @@ -16185,6 +16661,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "sessionView", "path": "x-pack/plugins/session_view/server/routes/alerts_route.ts" @@ -16206,20 +16686,12 @@ "path": "x-pack/plugins/session_view/server/routes/get_total_io_bytes_route.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" - }, - { - "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" - }, - { - "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/data_streams.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/data_streams.test.ts" + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts" }, { "plugin": "dataVisualizer", @@ -16249,6 +16721,22 @@ "plugin": "transform", "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_stats_single/register_route.ts" }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" + }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts" + }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" + }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_router.ts" @@ -16616,14 +17104,6 @@ "plugin": "lists", "path": "x-pack/plugins/lists/server/routes/list/update_list_route.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/saved_query/update_saved_query_route.ts" @@ -16677,12 +17157,12 @@ "path": "x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/retry.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { "plugin": "securitySolution", @@ -16692,6 +17172,14 @@ "plugin": "transform", "path": "x-pack/platform/plugins/private/transform/server/routes/api/transforms_create/register_route.ts" }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + }, + { + "plugin": "uptime", + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts" + }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_router.ts" @@ -16959,10 +17447,6 @@ "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts" }, - { - "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/usage_metrics.ts" - }, { "plugin": "ecsDataQualityDashboard", "path": "x-pack/plugins/ecs_data_quality_dashboard/server/routes/get_unallowed_field_values.ts" @@ -17443,14 +17927,6 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_monitoring/api/detection_engine_health/get_cluster_health/get_cluster_health_route.ts" @@ -17729,23 +18205,23 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" + "path": "x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" + "path": "x-pack/plugins/security_solution/server/endpoint/routes/suggestions/index.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/endpoint/routes/protection_updates_note/index.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/usage_metrics.test.ts" + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { - "plugin": "dataUsage", - "path": "x-pack/plugins/data_usage/server/routes/internal/usage_metrics.test.ts" + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { "plugin": "securitySolution", @@ -17755,6 +18231,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts" + }, { "plugin": "dataVisualizer", "path": "x-pack/platform/plugins/private/data_visualizer/server/routes.ts" @@ -17811,6 +18291,18 @@ "plugin": "aiops", "path": "x-pack/platform/plugins/shared/aiops/server/routes/categorization_field_validation/define_route.ts" }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.test.ts" + }, + { + "plugin": "dataUsage", + "path": "x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.test.ts" + }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + }, { "plugin": "dataViewFieldEditor", "path": "src/plugins/data_view_field_editor/server/routes/field_preview.ts" @@ -18002,14 +18494,6 @@ "plugin": "lists", "path": "x-pack/plugins/lists/server/routes/list/patch_list_route.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/patch_rule/route.ts" @@ -18030,6 +18514,14 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/timeline/routes/pinned_events/persist_pinned_event.ts" }, + { + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_patch_rules/route.ts" @@ -18253,14 +18745,6 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/data_indexing/indexing_routes.ts" }, - { - "plugin": "metricsDataAccess", - "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" - }, { "plugin": "osquery", "path": "x-pack/plugins/osquery/server/routes/saved_query/delete_saved_query_route.ts" @@ -18310,13 +18794,21 @@ "path": "x-pack/plugins/security_solution/server/lib/entity_analytics/entity_store/routes/delete.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/server.ts" + "plugin": "metricsDataAccess", + "path": "x-pack/plugins/observability_solution/metrics_data_access/server/lib/adapters/framework/kibana_framework_adapter.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/adapters/framework/kibana_framework_adapter.ts" }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_management/api/rules/bulk_delete_rules/route.ts" }, + { + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/server.ts" + }, { "plugin": "@kbn/core-http-router-server-internal", "path": "packages/core/http/core-http-router-server-internal/src/versioned_router/core_versioned_router.ts" diff --git a/api_docs/kbn_core_http_server.mdx b/api_docs/kbn_core_http_server.mdx index b1acc091b418..1843e3130172 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server'] --- import kbnCoreHttpServerObj from './kbn_core_http_server.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_internal.mdx b/api_docs/kbn_core_http_server_internal.mdx index 2334b6a7f819..1334a46a3daf 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-internal'] --- import kbnCoreHttpServerInternalObj from './kbn_core_http_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_http_server_mocks.mdx b/api_docs/kbn_core_http_server_mocks.mdx index b9b3aba6760d..6a04c7de4c8b 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-12-10 +date: 2024-12-13 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_http_server_utils.mdx b/api_docs/kbn_core_http_server_utils.mdx index 351ec41bd0da..ef10453ad566 100644 --- a/api_docs/kbn_core_http_server_utils.mdx +++ b/api_docs/kbn_core_http_server_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-http-server-utils title: "@kbn/core-http-server-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-http-server-utils plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-http-server-utils'] --- import kbnCoreHttpServerUtilsObj from './kbn_core_http_server_utils.devdocs.json'; diff --git a/api_docs/kbn_core_i18n_browser.mdx b/api_docs/kbn_core_i18n_browser.mdx index 000c47c06f11..87de887dc40e 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-12-10 +date: 2024-12-13 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 f51782ce75aa..2470c0818cfb 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-12-10 +date: 2024-12-13 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 94ac5fc27c3c..fa817de447bf 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-12-10 +date: 2024-12-13 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 f479d0051409..ebf92d0daf67 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-12-10 +date: 2024-12-13 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 2f4b11a24956..9389bf1149b1 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-12-10 +date: 2024-12-13 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 8bddc5cb232c..402120d1e59a 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-12-10 +date: 2024-12-13 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 b2b12dd06049..73a5ee19925d 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-12-10 +date: 2024-12-13 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 8f05f4294eaf..6d3b849bb9dd 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-12-10 +date: 2024-12-13 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 98465eeca916..c138323207d2 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-12-10 +date: 2024-12-13 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 68530f37b079..d7c17bc43524 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-12-10 +date: 2024-12-13 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 0de819321866..7a0d8531f012 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-12-10 +date: 2024-12-13 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 766bbc64b06f..c2f89fd5a2f3 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-12-10 +date: 2024-12-13 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 7291faa25100..2b9fc54928d0 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-12-10 +date: 2024-12-13 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 81572a65f795..dd333f8513fe 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-12-10 +date: 2024-12-13 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 0f323c502f4b..b4e01854ceb8 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-12-10 +date: 2024-12-13 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 b76221057d86..202108e53b97 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-12-10 +date: 2024-12-13 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 2b08e85635d8..59bc7338d89b 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-12-10 +date: 2024-12-13 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 b96515f47e56..619f75da84e4 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-12-10 +date: 2024-12-13 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 e2eac2c41f70..f60102ae06a8 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-12-10 +date: 2024-12-13 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 1a5a185d7207..844b21308735 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-12-10 +date: 2024-12-13 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 fc8307aa4029..25043ed2b314 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-12-10 +date: 2024-12-13 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 3e4acefdb49a..d5fcab98e44b 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-12-10 +date: 2024-12-13 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 2b37f619035c..5a669b87ad3c 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-12-10 +date: 2024-12-13 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 21b1476a1cd5..325548197174 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-12-10 +date: 2024-12-13 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 16471f6082d2..254adb92bfe8 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-12-10 +date: 2024-12-13 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 b8348d5b4e0d..04ae8fec7c07 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-12-10 +date: 2024-12-13 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 99a19348d6f6..d7c23b803da2 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-12-10 +date: 2024-12-13 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 a1f82fd6f420..3d7510aefef8 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-12-10 +date: 2024-12-13 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 498781a11036..631a447f640f 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-12-10 +date: 2024-12-13 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 e61fa73f779f..82f7a798fef3 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-12-10 +date: 2024-12-13 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 fb97edb75067..a2fb654b208e 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-12-10 +date: 2024-12-13 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 998ea0193949..80337c165205 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-12-10 +date: 2024-12-13 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 9006f6158075..0a461bb82499 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-12-10 +date: 2024-12-13 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 26c6cca6859d..d0c6aff3a5d9 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-12-10 +date: 2024-12-13 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 6773f689157a..09b7f6f35334 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-12-10 +date: 2024-12-13 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 59b5cd14f66f..611d9e50072f 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-12-10 +date: 2024-12-13 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 00d2daf5e7e2..7c60eb157ef5 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-12-10 +date: 2024-12-13 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 087e03ad8fec..1364682c92f1 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-12-10 +date: 2024-12-13 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 05dc9cc0932c..405490021c1c 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-12-10 +date: 2024-12-13 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 6278e07552b7..c6be69777616 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_core_rendering_browser.mdx index 72720bbe02cf..95b5e09a0d52 100644 --- a/api_docs/kbn_core_rendering_browser.mdx +++ b/api_docs/kbn_core_rendering_browser.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-core-rendering-browser title: "@kbn/core-rendering-browser" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/core-rendering-browser plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-rendering-browser'] --- import kbnCoreRenderingBrowserObj from './kbn_core_rendering_browser.devdocs.json'; diff --git a/api_docs/kbn_core_rendering_browser_mocks.mdx b/api_docs/kbn_core_rendering_browser_mocks.mdx index 014a20a1d146..65aa6100dd3c 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-12-10 +date: 2024-12-13 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 65ad02a75a9d..53cc324b3e05 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-12-10 +date: 2024-12-13 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 bfae09edfb66..0ee6b2a3a0f6 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-12-10 +date: 2024-12-13 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 6d45673e4888..ddf64070bf4d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-root-server-internal'] --- import kbnCoreRootServerInternalObj from './kbn_core_root_server_internal.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json index 6c099d5f7842..5879bf7544b6 100644 --- a/api_docs/kbn_core_saved_objects_api_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_browser.devdocs.json @@ -886,6 +886,14 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -926,14 +934,6 @@ "plugin": "visTypeTimeseries", "path": "src/plugins/vis_types/timeseries/public/application/contexts/query_input_bar_context.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" @@ -1121,14 +1121,14 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "home", - "path": "src/plugins/home/public/application/components/home_app.js" - }, { "plugin": "@kbn/core-saved-objects-browser-mocks", "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, + { + "plugin": "home", + "path": "src/plugins/home/public/application/components/home_app.js" + }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" @@ -2767,6 +2767,18 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -2878,18 +2890,6 @@ { "plugin": "visualizations", "path": "src/plugins/visualizations/public/wizard/search_selection/show_saved_object.test.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" } ], "children": [ diff --git a/api_docs/kbn_core_saved_objects_api_browser.mdx b/api_docs/kbn_core_saved_objects_api_browser.mdx index 6c9bcdd0c2ae..1159f0133d5e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-api-browser'] --- import kbnCoreSavedObjectsApiBrowserObj from './kbn_core_saved_objects_api_browser.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_api_server.devdocs.json b/api_docs/kbn_core_saved_objects_api_server.devdocs.json index faaa62769959..b8dd073bb005 100644 --- a/api_docs/kbn_core_saved_objects_api_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_api_server.devdocs.json @@ -2330,6 +2330,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core-saved-objects-api-server-internal", "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" @@ -2342,10 +2346,6 @@ "plugin": "@kbn/core-saved-objects-server-internal", "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" diff --git a/api_docs/kbn_core_saved_objects_api_server.mdx b/api_docs/kbn_core_saved_objects_api_server.mdx index 0203fbac2f87..33ef60984afd 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-12-10 +date: 2024-12-13 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 98d41a1e3380..ad994ce18aba 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-12-10 +date: 2024-12-13 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 8557124bdcda..319689c07f5a 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-12-10 +date: 2024-12-13 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 1a71c86b7076..e9445f121ecc 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-base-server-mocks'] --- import kbnCoreSavedObjectsBaseServerMocksObj from './kbn_core_saved_objects_base_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_browser.devdocs.json b/api_docs/kbn_core_saved_objects_browser.devdocs.json index f625e1405242..d0005651d2a2 100644 --- a/api_docs/kbn_core_saved_objects_browser.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser.devdocs.json @@ -17,18 +17,6 @@ "deprecated": true, "trackAdoption": false, "references": [ - { - "plugin": "@kbn/core-lifecycle-browser", - "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" - }, - { - "plugin": "@kbn/core-lifecycle-browser", - "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" - }, - { - "plugin": "@kbn/core-lifecycle-browser", - "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_service.ts" @@ -41,6 +29,26 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_service.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + }, + { + "plugin": "@kbn/core-lifecycle-browser", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" + }, + { + "plugin": "@kbn/core-lifecycle-browser", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" + }, + { + "plugin": "@kbn/core-lifecycle-browser", + "path": "packages/core/lifecycle/core-lifecycle-browser/src/core_start.ts" + }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -55,11 +63,11 @@ }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts" }, { "plugin": "exploratoryView", - "path": "x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts" + "path": "x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts" }, { "plugin": "transform", @@ -72,14 +80,6 @@ { "plugin": "@kbn/core", "path": "src/core/server/index.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" } ], "children": [ diff --git a/api_docs/kbn_core_saved_objects_browser.mdx b/api_docs/kbn_core_saved_objects_browser.mdx index 00436cf886db..9d6eda65cd22 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_core_saved_objects_browser_internal.devdocs.json index 83b0893914e6..016c97e0e12c 100644 --- a/api_docs/kbn_core_saved_objects_browser_internal.devdocs.json +++ b/api_docs/kbn_core_saved_objects_browser_internal.devdocs.json @@ -36,24 +36,24 @@ "trackAdoption": false, "references": [ { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, { - "plugin": "@kbn/core-root-browser-internal", - "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" }, { "plugin": "@kbn/core-root-browser-internal", "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" }, { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/saved_objects_service.mock.ts" + "plugin": "@kbn/core-root-browser-internal", + "path": "packages/core/root/core-root-browser-internal/src/core_system.ts" } ], "children": [ diff --git a/api_docs/kbn_core_saved_objects_browser_internal.mdx b/api_docs/kbn_core_saved_objects_browser_internal.mdx index 67e0027d173c..8965ac9df178 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-12-10 +date: 2024-12-13 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 185c5151a73d..6e2596c79b2d 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-12-10 +date: 2024-12-13 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 27c7f50f6423..635e336f001b 100644 --- a/api_docs/kbn_core_saved_objects_common.devdocs.json +++ b/api_docs/kbn_core_saved_objects_common.devdocs.json @@ -1213,6 +1213,18 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/saved_objects_client.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core", "path": "src/core/public/index.ts" @@ -1437,18 +1449,6 @@ "plugin": "@kbn/core-saved-objects-import-export-server-internal", "path": "packages/core/saved-objects/core-saved-objects-import-export-server-internal/src/export/apply_export_transforms.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.test.ts" diff --git a/api_docs/kbn_core_saved_objects_common.mdx b/api_docs/kbn_core_saved_objects_common.mdx index 8a856f1f061b..3e5bfc473770 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-12-10 +date: 2024-12-13 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 a6e4abed4ba5..01ac48281937 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-12-10 +date: 2024-12-13 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 5e5163d7f819..e41d0e0eb9b9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-saved-objects-import-export-server-mocks'] --- import kbnCoreSavedObjectsImportExportServerMocksObj from './kbn_core_saved_objects_import_export_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_saved_objects_migration_server_internal.mdx b/api_docs/kbn_core_saved_objects_migration_server_internal.mdx index 68cd1c18dca8..1b3fdda18320 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-12-10 +date: 2024-12-13 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 4372cddba907..23608d43050c 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-12-10 +date: 2024-12-13 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 144ba6e5eaad..1f553ac884b2 100644 --- a/api_docs/kbn_core_saved_objects_server.devdocs.json +++ b/api_docs/kbn_core_saved_objects_server.devdocs.json @@ -5859,6 +5859,10 @@ "plugin": "@kbn/core-saved-objects-browser-internal", "path": "packages/core/saved-objects/core-saved-objects-browser-internal/src/simple_saved_object.ts" }, + { + "plugin": "@kbn/core-saved-objects-browser-mocks", + "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" + }, { "plugin": "@kbn/core-saved-objects-api-server-internal", "path": "packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/utils/internal_utils.ts" @@ -5871,10 +5875,6 @@ "plugin": "@kbn/core-saved-objects-server-internal", "path": "packages/core/saved-objects/core-saved-objects-server-internal/src/routes/legacy_import_export/lib/import_dashboards.ts" }, - { - "plugin": "@kbn/core-saved-objects-browser-mocks", - "path": "packages/core/saved-objects/core-saved-objects-browser-mocks/src/simple_saved_object.mock.ts" - }, { "plugin": "fleet", "path": "x-pack/plugins/fleet/server/services/epm/kibana/assets/install.ts" @@ -10763,18 +10763,6 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" - }, - { - "plugin": "apmDataAccess", - "path": "x-pack/plugins/observability_solution/apm_data_access/server/saved_objects/apm_indices.ts" - }, - { - "plugin": "infra", - "path": "x-pack/plugins/observability_solution/infra/server/lib/sources/saved_object_type.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" @@ -10795,21 +10783,33 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/endpoint/lib/artifacts/saved_object_mappings.ts" }, + { + "plugin": "apmDataAccess", + "path": "x-pack/plugins/observability_solution/apm_data_access/server/saved_objects/apm_indices.ts" + }, { "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/server/saved_objects/apm_service_groups.ts" }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" + }, + { + "plugin": "infra", + "path": "x-pack/plugins/observability_solution/infra/server/lib/sources/saved_object_type.ts" + }, { "plugin": "slo", "path": "x-pack/plugins/observability_solution/slo/server/saved_objects/slo.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor.ts" }, { "plugin": "uptime", - "path": "x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts" + "path": "x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts" }, { "plugin": "eventAnnotation", @@ -11554,10 +11554,6 @@ "plugin": "maps", "path": "x-pack/plugins/maps/server/saved_objects/setup_saved_objects.ts" }, - { - "plugin": "visualizations", - "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" - }, { "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/timeline/saved_object_mappings/timelines.ts" @@ -11574,6 +11570,10 @@ "plugin": "securitySolution", "path": "x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions_legacy/logic/rule_actions/legacy_saved_object_mappings.ts" }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/server/saved_objects/visualization.ts" + }, { "plugin": "@kbn/core-test-helpers-so-type-serializer", "path": "packages/core/test-helpers/core-test-helpers-so-type-serializer/src/extract_migration_info.ts" diff --git a/api_docs/kbn_core_saved_objects_server.mdx b/api_docs/kbn_core_saved_objects_server.mdx index 6bf2d1e33f8d..3093944e8ce8 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-12-10 +date: 2024-12-13 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 739ca5468b70..78c951e1cb06 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-12-10 +date: 2024-12-13 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 e6c9a86b3222..c93cb81fbfa0 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-12-10 +date: 2024-12-13 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 c97c2df724aa..e95c7b2674e2 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-12-10 +date: 2024-12-13 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 b682c8c3f93e..f7e5dd41d0d1 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-12-10 +date: 2024-12-13 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 5560e404afe2..f17154f6e62d 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_core_security_browser_mocks.devdocs.json index f6b6c9800876..3d76985b7d33 100644 --- a/api_docs/kbn_core_security_browser_mocks.devdocs.json +++ b/api_docs/kbn_core_security_browser_mocks.devdocs.json @@ -146,7 +146,7 @@ "section": "def-common.AuthenticatedUser", "text": "AuthenticatedUser" }, - ", \"roles\"> & { roles: string[]; }>) => { username: string; enabled: boolean; metadata: { _reserved: boolean; _deprecated?: boolean | undefined; _deprecated_reason?: string | undefined; }; email: string; full_name: string; profile_uid: string; authentication_provider: ", + ", \"roles\"> & { roles: string[]; }>) => { username: string; enabled: boolean; metadata: { _reserved: boolean; _deprecated?: boolean | undefined; _deprecated_reason?: string | undefined; }; email: string; operator?: boolean | undefined; full_name: string; profile_uid: string; authentication_provider: ", { "pluginId": "@kbn/core-security-common", "scope": "common", diff --git a/api_docs/kbn_core_security_browser_mocks.mdx b/api_docs/kbn_core_security_browser_mocks.mdx index f6e0d4d13add..b8f4e8254c45 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_core_security_common.devdocs.json index af196d5e3493..fdae7a470ddf 100644 --- a/api_docs/kbn_core_security_common.devdocs.json +++ b/api_docs/kbn_core_security_common.devdocs.json @@ -157,6 +157,22 @@ "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/core-security-common", + "id": "def-common.AuthenticatedUser.operator", + "type": "CompoundType", + "tags": [], + "label": "operator", + "description": [ + "\nIndicates whether user is an operator." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_core_security_common.mdx b/api_docs/kbn_core_security_common.mdx index 4cd19de06ef2..0662d051720d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-security-common'] --- import kbnCoreSecurityCommonObj from './kbn_core_security_common.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 | |-------------------|-----------|------------------------|-----------------| -| 20 | 0 | 6 | 0 | +| 21 | 0 | 6 | 0 | ## Common diff --git a/api_docs/kbn_core_security_server.mdx b/api_docs/kbn_core_security_server.mdx index 8483bdd8ec7c..4ff7e265f5e7 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-12-10 +date: 2024-12-13 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 ca0e0bc1dfbc..d7479bd1a032 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_core_security_server_mocks.devdocs.json index 215a6b44c44f..4708eeb9f6c1 100644 --- a/api_docs/kbn_core_security_server_mocks.devdocs.json +++ b/api_docs/kbn_core_security_server_mocks.devdocs.json @@ -312,7 +312,7 @@ "section": "def-common.AuthenticatedUser", "text": "AuthenticatedUser" }, - ", \"roles\"> & { roles: string[]; }>) => { username: string; enabled: boolean; metadata: { _reserved: boolean; _deprecated?: boolean | undefined; _deprecated_reason?: string | undefined; }; email: string; full_name: string; profile_uid: string; authentication_provider: ", + ", \"roles\"> & { roles: string[]; }>) => { username: string; enabled: boolean; metadata: { _reserved: boolean; _deprecated?: boolean | undefined; _deprecated_reason?: string | undefined; }; email: string; operator?: boolean | undefined; full_name: string; profile_uid: string; authentication_provider: ", { "pluginId": "@kbn/core-security-common", "scope": "common", diff --git a/api_docs/kbn_core_security_server_mocks.mdx b/api_docs/kbn_core_security_server_mocks.mdx index af698f43cb8c..bf552e333563 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-12-10 +date: 2024-12-13 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 968ba728ad4f..95e5491b77be 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-12-10 +date: 2024-12-13 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_server.mdx b/api_docs/kbn_core_status_server.mdx index e343f288eb9a..694dd576e012 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-12-10 +date: 2024-12-13 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 bfb89bf975f5..eaeba718669f 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-12-10 +date: 2024-12-13 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 a737b79d3f5b..e9ccfcebeb8c 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-12-10 +date: 2024-12-13 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 ae97e67fb087..1e7f40675aa1 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-12-10 +date: 2024-12-13 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 8a02a9580c5f..441d44ab805a 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-12-10 +date: 2024-12-13 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 a2b4375d91f5..91ee5fab64f0 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-12-10 +date: 2024-12-13 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 911958b64f6c..65434708f4f0 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-12-10 +date: 2024-12-13 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 9ec25179db89..05e654e77f7e 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-12-10 +date: 2024-12-13 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 cec40d2fe58a..1d99a1c96f48 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-12-10 +date: 2024-12-13 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 65fc9b6ef229..ad1f0733cb3e 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-12-10 +date: 2024-12-13 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 8015c2037ecd..70918c356c6a 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-theme-browser-mocks'] --- import kbnCoreThemeBrowserMocksObj from './kbn_core_theme_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_browser.mdx b/api_docs/kbn_core_ui_settings_browser.mdx index aac24cc2b879..642acc6374fa 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-12-10 +date: 2024-12-13 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 5a6ef4545f06..21205c924a74 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-12-10 +date: 2024-12-13 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 8af2f1ec3fce..9f45e049bcba 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-browser-mocks'] --- import kbnCoreUiSettingsBrowserMocksObj from './kbn_core_ui_settings_browser_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_ui_settings_common.mdx b/api_docs/kbn_core_ui_settings_common.mdx index 03f68c1f6791..6ea96ae8e5a7 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-12-10 +date: 2024-12-13 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 955b7c088832..c1cfef07e65a 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-12-10 +date: 2024-12-13 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 ef649a85cf81..c11fdc62c48a 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-12-10 +date: 2024-12-13 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 d30281305108..bf4ade5ca37d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/core-ui-settings-server-mocks'] --- import kbnCoreUiSettingsServerMocksObj from './kbn_core_ui_settings_server_mocks.devdocs.json'; diff --git a/api_docs/kbn_core_usage_data_server.mdx b/api_docs/kbn_core_usage_data_server.mdx index af698de3ef9b..cadf5537046b 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-12-10 +date: 2024-12-13 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 dd6adadc08ff..bb4ffc24eb99 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-12-10 +date: 2024-12-13 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 ea631910b93b..7f9a0b2cf140 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-12-10 +date: 2024-12-13 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 828142fa1f6e..5553ffb25a55 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-12-10 +date: 2024-12-13 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 83eded117948..3d29a44ab0b4 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-12-10 +date: 2024-12-13 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 3f10d256503f..0b442d54ea0e 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-12-10 +date: 2024-12-13 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 dd8af1cabec6..e373a827a214 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-12-10 +date: 2024-12-13 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 99c739e8a177..031688740877 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-12-10 +date: 2024-12-13 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 791f5e818e5d..6c68d4ac2f12 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-12-10 +date: 2024-12-13 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 da9ff6c990cb..a038c23a00ed 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-12-10 +date: 2024-12-13 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 0b86dd76cf67..ad4f52e2ae37 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-12-10 +date: 2024-12-13 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 5f612d4d5714..e6588edc04fc 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-12-10 +date: 2024-12-13 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 e23337554b69..e4a2e40785da 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-12-10 +date: 2024-12-13 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 230823f25eff..e8b99d352a2e 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-12-10 +date: 2024-12-13 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 1b1780d00529..950073c36ed2 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-12-10 +date: 2024-12-13 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 b31685f6774c..b146e2a0e54a 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-12-10 +date: 2024-12-13 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 c0be02f585d9..fa8a74ebec7f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/cypress-config'] --- import kbnCypressConfigObj from './kbn_cypress_config.devdocs.json'; diff --git a/api_docs/kbn_data_forge.devdocs.json b/api_docs/kbn_data_forge.devdocs.json index 64194f08c382..6a9ac3dd24c2 100644 --- a/api_docs/kbn_data_forge.devdocs.json +++ b/api_docs/kbn_data_forge.devdocs.json @@ -39,7 +39,7 @@ }, "; }) => Promise" ], - "path": "x-pack/packages/kbn-data-forge/src/cleanup.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -50,7 +50,7 @@ "tags": [], "label": "{\n client,\n config: partialConfig,\n logger,\n}", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/cleanup.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -64,7 +64,7 @@ "signature": [ "default" ], - "path": "x-pack/packages/kbn-data-forge/src/cleanup.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts", "deprecated": false, "trackAdoption": false }, @@ -78,7 +78,7 @@ "signature": [ "{ elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/cleanup.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts", "deprecated": false, "trackAdoption": false }, @@ -98,7 +98,7 @@ "text": "ToolingLog" } ], - "path": "x-pack/packages/kbn-data-forge/src/cleanup.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts", "deprecated": false, "trackAdoption": false } @@ -120,7 +120,7 @@ "CliOptions", " | undefined) => Promise" ], - "path": "x-pack/packages/kbn-data-forge/src/cli.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cli.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -135,7 +135,7 @@ "CliOptions", " | undefined" ], - "path": "x-pack/packages/kbn-data-forge/src/cli.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/cli.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -154,7 +154,7 @@ "signature": [ "(partialConfig: { elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }) => { elasticsearch: { host: string; username: string; password: string; apiKey: string; installKibanaUser: boolean; }; kibana: { host: string; username: string; password: string; installAssets: boolean; }; indexing: { dataset: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\"; scenario: string; interval: number; eventsPerCycle: number; payloadSize: number; concurrency: number; reduceWeekendTrafficBy: number; ephemeralProjectIds: number; alignEventsToInterval: boolean; artificialIndexDelay: number; }; schedule: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-data-forge/src/lib/create_config.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -168,7 +168,7 @@ "signature": [ "{ elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/lib/create_config.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -197,7 +197,7 @@ }, "; }) => Promise" ], - "path": "x-pack/packages/kbn-data-forge/src/generate.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -208,7 +208,7 @@ "tags": [], "label": "{\n client,\n config: partialConfig,\n logger,\n}", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/generate.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -222,7 +222,7 @@ "signature": [ "default" ], - "path": "x-pack/packages/kbn-data-forge/src/generate.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts", "deprecated": false, "trackAdoption": false }, @@ -236,7 +236,7 @@ "signature": [ "{ elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/generate.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts", "deprecated": false, "trackAdoption": false }, @@ -256,7 +256,7 @@ "text": "ToolingLog" } ], - "path": "x-pack/packages/kbn-data-forge/src/generate.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts", "deprecated": false, "trackAdoption": false } @@ -276,7 +276,7 @@ "signature": [ "(filePath: string) => Promise<{ elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }>" ], - "path": "x-pack/packages/kbn-data-forge/src/lib/create_config.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -290,7 +290,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-data-forge/src/lib/create_config.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -319,7 +319,7 @@ }, ") => Promise" ], - "path": "x-pack/packages/kbn-data-forge/src/run.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -333,7 +333,7 @@ "signature": [ "{ elasticsearch: { host: string; username: string; password: string; apiKey: string; installKibanaUser: boolean; }; kibana: { host: string; username: string; password: string; installAssets: boolean; }; indexing: { dataset: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\"; scenario: string; interval: number; eventsPerCycle: number; payloadSize: number; concurrency: number; reduceWeekendTrafficBy: number; ephemeralProjectIds: number; alignEventsToInterval: boolean; artificialIndexDelay: number; }; schedule: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-data-forge/src/run.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -348,7 +348,7 @@ "signature": [ "default" ], - "path": "x-pack/packages/kbn-data-forge/src/run.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -369,7 +369,7 @@ "text": "ToolingLog" } ], - "path": "x-pack/packages/kbn-data-forge/src/run.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -392,7 +392,7 @@ "signature": [ "{ elasticsearch: { host: string; username: string; password: string; apiKey: string; installKibanaUser: boolean; }; kibana: { host: string; username: string; password: string; installAssets: boolean; }; indexing: { dataset: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\"; scenario: string; interval: number; eventsPerCycle: number; payloadSize: number; concurrency: number; reduceWeekendTrafficBy: number; ephemeralProjectIds: number; alignEventsToInterval: boolean; artificialIndexDelay: number; }; schedule: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -407,7 +407,7 @@ "signature": [ "\"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\"" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -422,7 +422,7 @@ "signature": [ "number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; })" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -437,7 +437,7 @@ "signature": [ "{ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -452,7 +452,7 @@ "signature": [ "{ elasticsearch?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; apiKey?: string | undefined; installKibanaUser?: boolean | undefined; } | undefined; kibana?: { host?: string | undefined; username?: string | undefined; password?: string | undefined; installAssets?: boolean | undefined; } | undefined; indexing?: { dataset?: \"fake_hosts\" | \"fake_logs\" | \"fake_stack\" | \"service.logs\" | undefined; scenario?: string | undefined; interval?: number | undefined; eventsPerCycle?: number | undefined; payloadSize?: number | undefined; concurrency?: number | undefined; reduceWeekendTrafficBy?: number | undefined; ephemeralProjectIds?: number | undefined; alignEventsToInterval?: boolean | undefined; artificialIndexDelay?: number | undefined; } | undefined; schedule?: ({ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; })[] | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -467,7 +467,7 @@ "signature": [ "{ template: string; start: string; end: string | boolean; } & { eventsPerCycle?: number | ({ start: number; end: number; method: \"linear\" | \"exp\" | \"sine\"; } & { options?: { period?: number | undefined; } | undefined; }) | undefined; interval?: number | undefined; delayInMinutes?: number | undefined; delayEveryMinutes?: number | undefined; randomness?: number | undefined; metrics?: ({ name: string; method: \"linear\" | \"exp\" | \"sine\"; start: number; end: number; } & { period?: number | undefined; randomness?: number | undefined; })[] | undefined; }" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -482,7 +482,7 @@ "signature": [ "\"linear\" | \"exp\" | \"sine\"" ], - "path": "x-pack/packages/kbn-data-forge/src/types/index.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -496,7 +496,7 @@ "tags": [], "label": "DEFAULTS", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -507,7 +507,7 @@ "tags": [], "label": "EVENTS_PER_CYCLE", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -518,7 +518,7 @@ "tags": [], "label": "PAYLOAD_SIZE", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -529,7 +529,7 @@ "tags": [], "label": "CONCURRENCY", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -540,7 +540,7 @@ "tags": [], "label": "SERVERLESS", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -551,7 +551,7 @@ "tags": [], "label": "INDEX_INTERVAL", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -562,7 +562,7 @@ "tags": [], "label": "DATASET", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -573,7 +573,7 @@ "tags": [], "label": "SCENARIO", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -584,7 +584,7 @@ "tags": [], "label": "ELASTICSEARCH_HOST", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -595,7 +595,7 @@ "tags": [], "label": "ELASTICSEARCH_USERNAME", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -606,7 +606,7 @@ "tags": [], "label": "ELASTICSEARCH_PASSWORD", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -617,7 +617,7 @@ "tags": [], "label": "ELASTICSEARCH_API_KEY", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -628,7 +628,7 @@ "tags": [], "label": "SKIP_KIBANA_USER", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -639,7 +639,7 @@ "tags": [], "label": "INSTALL_KIBANA_ASSETS", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -650,7 +650,7 @@ "tags": [], "label": "DELAY_IN_MINUTES", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -661,7 +661,7 @@ "tags": [], "label": "DELAY_EVERY_MINUTES", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -672,7 +672,7 @@ "tags": [], "label": "LOOKBACK", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -683,7 +683,7 @@ "tags": [], "label": "KIBANA_URL", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -694,7 +694,7 @@ "tags": [], "label": "KIBANA_USERNAME", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -705,7 +705,7 @@ "tags": [], "label": "KIBANA_PASSWORD", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -716,7 +716,7 @@ "tags": [], "label": "EVENT_TEMPLATE", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -727,7 +727,7 @@ "tags": [], "label": "REDUCE_WEEKEND_TRAFFIC_BY", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -738,7 +738,7 @@ "tags": [], "label": "EPHEMERAL_PROJECT_IDS", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -749,7 +749,7 @@ "tags": [], "label": "ALIGN_EVENTS_TO_INTERVAL", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false }, @@ -760,7 +760,7 @@ "tags": [], "label": "CARDINALITY", "description": [], - "path": "x-pack/packages/kbn-data-forge/src/constants.ts", + "path": "x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_data_forge.mdx b/api_docs/kbn_data_forge.mdx index 2feb4a4bed69..a1dd840282bb 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-12-10 +date: 2024-12-13 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 6f21ad94849a..bf12a3d8de38 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_data_stream_adapter.devdocs.json index 66d9f0dbb0c2..4e574c32850f 100644 --- a/api_docs/kbn_data_stream_adapter.devdocs.json +++ b/api_docs/kbn_data_stream_adapter.devdocs.json @@ -34,7 +34,7 @@ "text": "IndexAdapter" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -56,7 +56,7 @@ }, ") => void" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -76,7 +76,7 @@ "text": "SetIndexTemplateParams" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -102,7 +102,7 @@ }, ") => Promise" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -122,7 +122,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -157,7 +157,7 @@ "text": "IndexPatternAdapter" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -179,7 +179,7 @@ }, ") => void" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -199,7 +199,7 @@ "text": "SetIndexTemplateParams" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -233,7 +233,7 @@ }, ">" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -253,7 +253,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -273,7 +273,7 @@ "signature": [ "(spaceId: string) => Promise" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -287,7 +287,7 @@ "signature": [ "string" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -305,7 +305,7 @@ "signature": [ "(spaceId: string) => Promise" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -319,7 +319,7 @@ "signature": [ "string" ], - "path": "packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts", + "path": "x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -350,7 +350,7 @@ }, "; attempt?: number | undefined; }) => Promise" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -364,7 +364,7 @@ "signature": [ "() => Promise" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -376,7 +376,7 @@ "tags": [], "label": "{ logger, attempt = 0 }", "description": [], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -396,7 +396,7 @@ "text": "Logger" } ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false }, @@ -410,7 +410,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false } @@ -429,7 +429,7 @@ "tags": [], "label": "AllowedValue", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -443,7 +443,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -457,7 +457,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -471,7 +471,7 @@ "tags": [], "label": "EcsMetadata", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -492,7 +492,7 @@ }, "[] | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -503,7 +503,7 @@ "tags": [], "label": "dashed_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -514,7 +514,7 @@ "tags": [], "label": "description", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -528,7 +528,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -542,7 +542,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -553,7 +553,7 @@ "tags": [], "label": "flat_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -567,7 +567,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -581,7 +581,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -592,7 +592,7 @@ "tags": [], "label": "level", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -613,7 +613,7 @@ }, "[] | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -624,7 +624,7 @@ "tags": [], "label": "name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -638,7 +638,7 @@ "signature": [ "string[]" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -652,7 +652,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -666,7 +666,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -677,7 +677,7 @@ "tags": [], "label": "short", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -688,7 +688,7 @@ "tags": [], "label": "type", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -702,7 +702,7 @@ "signature": [ "Record | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -716,7 +716,7 @@ "tags": [], "label": "InstallParams", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -736,7 +736,7 @@ "text": "Logger" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -765,7 +765,7 @@ }, ">" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -780,7 +780,7 @@ "Subject", "" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -794,7 +794,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false } @@ -808,7 +808,7 @@ "tags": [], "label": "MultiField", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -819,7 +819,7 @@ "tags": [], "label": "flat_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -830,7 +830,7 @@ "tags": [], "label": "name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -841,7 +841,7 @@ "tags": [], "label": "type", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -869,7 +869,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -892,7 +892,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -915,7 +915,7 @@ }, ", keyof NonNullable>}` : `${Key}` : never" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -930,7 +930,7 @@ "signature": [ "GetComponentTemplateOpts" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -947,7 +947,7 @@ "IndicesPutIndexTemplateIndexTemplateMapping", " | undefined; componentTemplateRefs?: string[] | undefined; isDataStream?: boolean | undefined; }" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -972,7 +972,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_data_stream_adapter.mdx b/api_docs/kbn_data_stream_adapter.mdx index 05cfd5ec3192..98eb789bf346 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-12-10 +date: 2024-12-13 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 cb9cccfb17de..15f4f5108b30 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-12-10 +date: 2024-12-13 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 35014b0edd43..89d82dc0604d 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-12-10 +date: 2024-12-13 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 2e2fce64e82f..8a2c3dba068d 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-12-10 +date: 2024-12-13 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 6218b621946d..55dd3bff9728 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-12-10 +date: 2024-12-13 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 b24ee1dfcb04..2d19345e947f 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-12-10 +date: 2024-12-13 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 5bcfb2b80290..dc1bfaac71f1 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-12-10 +date: 2024-12-13 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 af32b698c4d5..5505b8ec1f3b 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-12-10 +date: 2024-12-13 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 820e8efc49cb..0584b283602e 100644 --- a/api_docs/kbn_deeplinks_observability.devdocs.json +++ b/api_docs/kbn_deeplinks_observability.devdocs.json @@ -44,7 +44,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -55,7 +55,7 @@ "tags": [], "label": "dataStream", "description": [], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, @@ -69,7 +69,7 @@ "signature": [ "TimeRangeConfig | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, @@ -83,7 +83,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, @@ -97,7 +97,7 @@ "signature": [ "{ table?: DegradedFieldsTable | undefined; } | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, @@ -111,7 +111,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false }, @@ -125,7 +125,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false } @@ -156,7 +156,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -170,7 +170,7 @@ "signature": [ "Filters | undefined" ], - "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, "trackAdoption": false } @@ -201,7 +201,7 @@ "text": "LogsExplorerNavigationParams" } ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -217,7 +217,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false } @@ -248,7 +248,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -271,7 +271,7 @@ }, " | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -294,7 +294,7 @@ }, " | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -325,7 +325,7 @@ }, " | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -348,7 +348,7 @@ }, "[] | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -371,7 +371,7 @@ }, "[] | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -394,7 +394,7 @@ }, " | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -410,7 +410,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false } @@ -441,7 +441,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -455,7 +455,7 @@ "signature": [ "{ id: \"application-log-onboarding\"; } | undefined" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false } @@ -486,7 +486,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/observability_onboarding.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -502,7 +502,7 @@ "signature": [ "\"kubernetes\" | \"auto-detect\" | \"customLogs\" | \"otel-logs\" | \"firehose\" | undefined" ], - "path": "packages/deeplinks/observability/locators/observability_onboarding.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts", "deprecated": false, "trackAdoption": false }, @@ -516,7 +516,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/observability_onboarding.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts", "deprecated": false, "trackAdoption": false } @@ -547,7 +547,7 @@ "text": "DatasetLocatorParams" } ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -560,7 +560,7 @@ "description": [ "\nData view id to select" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false } @@ -591,7 +591,7 @@ "text": "DatasetLocatorParams" } ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -607,7 +607,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false }, @@ -620,7 +620,7 @@ "description": [ "\nDataset name to be selected.\nex: system.syslog" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false } @@ -651,7 +651,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -665,7 +665,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false }, @@ -679,7 +679,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false }, @@ -693,7 +693,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false }, @@ -707,7 +707,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false } @@ -738,7 +738,7 @@ "text": "SerializableRecord" } ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -752,7 +752,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false }, @@ -766,7 +766,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false }, @@ -780,7 +780,7 @@ "signature": [ "string | undefined" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false } @@ -800,7 +800,7 @@ "signature": [ "\"observabilityAIAssistant\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -815,7 +815,7 @@ "signature": [ "\"ALL_DATASETS_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -844,7 +844,7 @@ "text": "ObservabilityLogsExplorerLocationState" } ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -859,7 +859,7 @@ "signature": [ "\"profiling\" | \"metrics\" | \"apm\" | \"synthetics\" | \"ux\" | \"logs\" | \"slo\" | \"observabilityAIAssistant\" | \"observability-overview\" | \"streams\" | \"observability-logs-explorer\" | \"last-used-logs-viewer\" | \"observabilityOnboarding\" | \"inventory\"" ], - "path": "packages/deeplinks/observability/deep_links.ts", + "path": "src/platform/packages/shared/deeplinks/observability/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -874,7 +874,7 @@ "signature": [ "\"DATA_QUALITY_DETAILS_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/dataset_quality_details.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -889,7 +889,7 @@ "signature": [ "\"DATA_QUALITY_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/dataset_quality.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/dataset_quality.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -918,7 +918,7 @@ "text": "ObservabilityLogsExplorerLocationState" } ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -940,7 +940,7 @@ }, " | \"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:services\" | \"apm:traces\" | \"apm:dependencies\" | \"apm:service-map\" | \"apm:settings\" | \"apm:service-groups-list\" | \"apm:storage-explorer\" | \"synthetics:overview\" | \"synthetics:certificates\" | \"profiling:functions\" | \"profiling:stacktraces\" | \"profiling:flamegraphs\" | \"inventory:datastreams\" | \"streams:overview\"" ], - "path": "packages/deeplinks/observability/deep_links.ts", + "path": "src/platform/packages/shared/deeplinks/observability/deep_links.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -955,7 +955,7 @@ "signature": [ "{ type: \"document-field\"; field: string; width?: number | undefined; }" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -978,7 +978,7 @@ }, " | undefined; }" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1007,7 +1007,7 @@ "text": "SmartFieldGridColumnOptions" } ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1022,7 +1022,7 @@ "signature": [ "\"last-used-logs-viewer\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1037,7 +1037,7 @@ "signature": [ "{ mode: \"include\"; values: string[]; }" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1052,7 +1052,7 @@ "signature": [ "\"logs\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1067,7 +1067,7 @@ "signature": [ "\"LOGS_EXPLORER_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1082,7 +1082,7 @@ "signature": [ "\"profiling\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1097,7 +1097,7 @@ "signature": [ "\"ux\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1112,7 +1112,7 @@ "signature": [ "\"OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1127,7 +1127,7 @@ "signature": [ "\"obs-logs-explorer:lastUsedViewer\"" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1142,7 +1142,7 @@ "signature": [ "\"observability-logs-explorer\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1157,7 +1157,7 @@ "signature": [ "\"observabilityOnboarding\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1172,7 +1172,7 @@ "signature": [ "\"OBSERVABILITY_ONBOARDING_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/observability_onboarding.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1187,7 +1187,7 @@ "signature": [ "\"observability-overview\"" ], - "path": "packages/deeplinks/observability/constants.ts", + "path": "src/platform/packages/shared/deeplinks/observability/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1202,7 +1202,7 @@ "signature": [ "{ pause: boolean; value: number; }" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1217,7 +1217,7 @@ "signature": [ "\"SINGLE_DATASET_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/observability_logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1232,7 +1232,7 @@ "signature": [ "{ type: \"smart-field\"; smartField: \"content\" | \"resource\"; width?: number | undefined; }" ], - "path": "packages/deeplinks/observability/locators/logs_explorer.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1247,7 +1247,7 @@ "signature": [ "\"UPTIME_OVERVIEW_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_deeplinks_observability.mdx b/api_docs/kbn_deeplinks_observability.mdx index 0047fe3a09f9..2c925f1744d7 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/deeplinks-observability'] --- import kbnDeeplinksObservabilityObj from './kbn_deeplinks_observability.devdocs.json'; diff --git a/api_docs/kbn_deeplinks_search.mdx b/api_docs/kbn_deeplinks_search.mdx index b3b2a6acac31..ce60c6225312 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-12-10 +date: 2024-12-13 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 c43fa4a74365..5b807e746579 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-12-10 +date: 2024-12-13 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 83acd15dc105..815f7ec94513 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-12-10 +date: 2024-12-13 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 db7b2f78fd2f..d26ba16aca0d 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-12-10 +date: 2024-12-13 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 55d16c301798..069d0712763a 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-12-10 +date: 2024-12-13 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 6c8b9026a4f9..ec851617dee7 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-12-10 +date: 2024-12-13 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 bdcd16026554..285022a9eaec 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-12-10 +date: 2024-12-13 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 866e5088336f..65f72fe7601a 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-cli-errors'] --- import kbnDevCliErrorsObj from './kbn_dev_cli_errors.devdocs.json'; diff --git a/api_docs/kbn_dev_cli_runner.mdx b/api_docs/kbn_dev_cli_runner.mdx index 55746584265c..c81101c0bc32 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-12-10 +date: 2024-12-13 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 184adee02717..86c2ce924293 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-12-10 +date: 2024-12-13 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 3ad4e255b769..58ea3ebcb14f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dev-utils'] --- import kbnDevUtilsObj from './kbn_dev_utils.devdocs.json'; diff --git a/api_docs/kbn_discover_contextual_components.mdx b/api_docs/kbn_discover_contextual_components.mdx index 17f27301f23a..140e86b0640c 100644 --- a/api_docs/kbn_discover_contextual_components.mdx +++ b/api_docs/kbn_discover_contextual_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-discover-contextual-components title: "@kbn/discover-contextual-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/discover-contextual-components plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-contextual-components'] --- import kbnDiscoverContextualComponentsObj from './kbn_discover_contextual_components.devdocs.json'; diff --git a/api_docs/kbn_discover_utils.mdx b/api_docs/kbn_discover_utils.mdx index 127098ca2d2e..cc626c968825 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/discover-utils'] --- import kbnDiscoverUtilsObj from './kbn_discover_utils.devdocs.json'; diff --git a/api_docs/kbn_doc_links.devdocs.json b/api_docs/kbn_doc_links.devdocs.json index 9e7a1ab119ce..ab451f2b8825 100644 --- a/api_docs/kbn_doc_links.devdocs.json +++ b/api_docs/kbn_doc_links.devdocs.json @@ -543,7 +543,7 @@ "label": "securitySolution", "description": [], "signature": [ - "{ readonly aiAssistant: string; readonly artifactControl: string; readonly avcResults: string; readonly bidirectionalIntegrations: string; readonly trustedApps: string; readonly eventFilters: string; readonly eventMerging: string; readonly blocklist: string; readonly endpointArtifacts: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; linux_deadlock: string; }; readonly packageActionTroubleshooting: { es_connection: string; }; readonly threatIntelInt: string; readonly responseActions: string; readonly configureEndpointIntegrationPolicy: string; readonly exceptions: { value_lists: string; }; readonly privileges: string; readonly manageDetectionRules: string; readonly createDetectionRules: string; readonly createEsqlRuleType: string; readonly ruleUiAdvancedParams: string; readonly entityAnalytics: { readonly riskScorePrerequisites: string; readonly entityRiskScoring: string; readonly assetCriticality: string; }; readonly detectionEngineOverview: string; }" + "{ readonly aiAssistant: string; readonly artifactControl: string; readonly avcResults: string; readonly bidirectionalIntegrations: string; readonly trustedApps: string; readonly eventFilters: string; readonly eventMerging: string; readonly blocklist: string; readonly endpointArtifacts: string; readonly policyResponseTroubleshooting: { full_disk_access: string; macos_system_ext: string; linux_deadlock: string; }; readonly packageActionTroubleshooting: { es_connection: string; }; readonly threatIntelInt: string; readonly responseActions: string; readonly configureEndpointIntegrationPolicy: string; readonly exceptions: { value_lists: string; }; readonly privileges: string; readonly manageDetectionRules: string; readonly createDetectionRules: string; readonly createEsqlRuleType: string; readonly ruleUiAdvancedParams: string; readonly entityAnalytics: { readonly riskScorePrerequisites: string; readonly entityRiskScoring: string; readonly assetCriticality: string; }; readonly detectionEngineOverview: string; readonly signalsMigrationApi: string; }" ], "path": "src/platform/packages/shared/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 796964c86f5a..893d4c2172e2 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-12-10 +date: 2024-12-13 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 198f7ae9e46c..b8e2508fd67a 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/docs-utils'] --- import kbnDocsUtilsObj from './kbn_docs_utils.devdocs.json'; diff --git a/api_docs/kbn_dom_drag_drop.mdx b/api_docs/kbn_dom_drag_drop.mdx index f9b7f0f22d2c..452c5eced9be 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/dom-drag-drop'] --- import kbnDomDragDropObj from './kbn_dom_drag_drop.devdocs.json'; diff --git a/api_docs/kbn_ebt_tools.mdx b/api_docs/kbn_ebt_tools.mdx index 4cdac1f86fcb..2d673d7351dc 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-12-10 +date: 2024-12-13 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 b70583710b65..39db857f43f1 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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/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_panel/index.tsx", + "path": "x-pack/solutions/security/packages/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_panel/utils/get_ilm_phase_description.ts", + "path": "x-pack/solutions/security/packages/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_panel/utils/get_ilm_phase_description.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -116,7 +116,7 @@ "tags": [], "label": "DATA_QUALITY_DASHBOARD_CONVERSATION_ID", "description": [], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -128,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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -142,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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -154,7 +154,7 @@ "tags": [], "label": "DATA_QUALITY_SUGGESTED_USER_PROMPT", "description": [], - "path": "x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -169,7 +169,7 @@ "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", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -186,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_panel/constants.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -200,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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -214,7 +214,7 @@ "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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -229,7 +229,7 @@ "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", + "path": "x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -243,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_panel/translations.ts", + "path": "x-pack/solutions/security/packages/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 5438fc2be9b3..af4fc504ed1c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ecs-data-quality-dashboard'] --- import kbnEcsDataQualityDashboardObj from './kbn_ecs_data_quality_dashboard.devdocs.json'; diff --git a/api_docs/kbn_elastic_agent_utils.mdx b/api_docs/kbn_elastic_agent_utils.mdx index 8b2fb8cef281..b5c4c43fb7b6 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-12-10 +date: 2024-12-13 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 7df32d5195bc..9225da0d2cf4 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-12-10 +date: 2024-12-13 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 a864611adb34..fa5f7a3f2b55 100644 --- a/api_docs/kbn_elastic_assistant_common.devdocs.json +++ b/api_docs/kbn_elastic_assistant_common.devdocs.json @@ -3525,7 +3525,7 @@ "tags": [], "label": "NonEmptyString", "description": [ - "\nA string that is not empty and does not contain only whitespace" + "\nA string that does not contain only whitespace characters" ], "signature": [ "string" @@ -4292,7 +4292,7 @@ "label": "AppendConversationMessageRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ messages: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }>" + "Zod.ZodObject<{ messages: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts", "deprecated": false, @@ -4307,7 +4307,7 @@ "label": "AppendConversationMessageRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts", "deprecated": false, @@ -4322,7 +4322,7 @@ "label": "AppendConversationMessageResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/append_message.gen.ts", "deprecated": false, @@ -4337,7 +4337,7 @@ "label": "AttackDiscoveries", "description": [], "signature": [ - "Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">" + "Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts", "deprecated": false, @@ -4352,7 +4352,7 @@ "label": "AttackDiscovery", "description": [], "signature": [ - "Zod.ZodObject<{ alertIds: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>" + "Zod.ZodObject<{ alertIds: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts", "deprecated": false, @@ -4367,7 +4367,7 @@ "label": "AttackDiscoveryCancelRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ connectorId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; }, { connectorId: string; }>" + "Zod.ZodObject<{ connectorId: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; }, { connectorId: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts", "deprecated": false, @@ -4382,7 +4382,7 @@ "label": "AttackDiscoveryCancelResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/cancel_attack_discovery_route.gen.ts", "deprecated": false, @@ -4397,7 +4397,7 @@ "label": "AttackDiscoveryCreateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; alertsContextCount: Zod.ZodOptional; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodOptional; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; alertsContextCount: Zod.ZodOptional; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts", "deprecated": false, @@ -4412,7 +4412,7 @@ "label": "AttackDiscoveryGetRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ connectorId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; }, { connectorId: string; }>" + "Zod.ZodObject<{ connectorId: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; }, { connectorId: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts", "deprecated": false, @@ -4427,7 +4427,7 @@ "label": "AttackDiscoveryGetResponse", "description": [], "signature": [ - "Zod.ZodObject<{ data: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>>; stats: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }, { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { stats: { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }[]; data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; } | undefined; }, { stats: { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }[]; data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; } | undefined; }>" + "Zod.ZodObject<{ data: Zod.ZodOptional; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>>; stats: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }, { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { stats: { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }[]; data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; } | undefined; }, { stats: { connectorId: string; count: number; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; hasViewed: boolean; }[]; data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/get_attack_discovery_route.gen.ts", "deprecated": false, @@ -4442,7 +4442,7 @@ "label": "AttackDiscoveryPostRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ alertsIndexPattern: Zod.ZodString; anonymizationFields: Zod.ZodArray; field: Zod.ZodString; allowed: Zod.ZodOptional; anonymized: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; model: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; size: Zod.ZodNumber; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; }, \"strip\", Zod.ZodTypeAny, { size: number; subAction: \"invokeAI\" | \"invokeStream\"; alertsIndexPattern: string; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; model?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { size: number; subAction: \"invokeAI\" | \"invokeStream\"; alertsIndexPattern: string; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; model?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" + "Zod.ZodObject<{ alertsIndexPattern: Zod.ZodString; anonymizationFields: Zod.ZodArray; timestamp: Zod.ZodOptional>; field: Zod.ZodString; allowed: Zod.ZodOptional; anonymized: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; model: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; size: Zod.ZodNumber; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; }, \"strip\", Zod.ZodTypeAny, { size: number; subAction: \"invokeAI\" | \"invokeStream\"; alertsIndexPattern: string; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; model?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { size: number; subAction: \"invokeAI\" | \"invokeStream\"; alertsIndexPattern: string; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; model?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts", "deprecated": false, @@ -4457,7 +4457,7 @@ "label": "AttackDiscoveryPostResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/post_attack_discovery_route.gen.ts", "deprecated": false, @@ -4472,7 +4472,7 @@ "label": "AttackDiscoveryResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; alertsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; attackDiscoveries: Zod.ZodArray; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; lastViewedAt: string; attackDiscoveries: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[]; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; alertsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts", "deprecated": false, @@ -4547,7 +4547,7 @@ "label": "AttackDiscoveryUpdateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; alertsContextCount: Zod.ZodOptional; attackDiscoveries: Zod.ZodOptional; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; alertsContextCount?: number | undefined; attackDiscoveries?: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[] | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; alertsContextCount?: number | undefined; attackDiscoveries?: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[] | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; alertsContextCount: Zod.ZodOptional; attackDiscoveries: Zod.ZodOptional; id: Zod.ZodOptional; detailsMarkdown: Zod.ZodString; entitySummaryMarkdown: Zod.ZodOptional; mitreAttackTactics: Zod.ZodOptional>; summaryMarkdown: Zod.ZodString; title: Zod.ZodString; timestamp: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }, { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; alertsContextCount?: number | undefined; attackDiscoveries?: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[] | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; alertsContextCount?: number | undefined; attackDiscoveries?: { title: string; alertIds: string[]; detailsMarkdown: string; summaryMarkdown: string; id?: string | undefined; timestamp?: string | undefined; entitySummaryMarkdown?: string | undefined; mitreAttackTactics?: string[] | undefined; }[] | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/attack_discovery/common_attributes.gen.ts", "deprecated": false, @@ -4622,7 +4622,7 @@ "label": "BaseUpdateProps", "description": [], "signature": [ - "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { id: string; namespace?: string | undefined; name?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; }, { id: string; namespace?: string | undefined; name?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; }>" + "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, \"strip\", Zod.ZodTypeAny, { id: string; namespace?: string | undefined; name?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; }, { id: string; namespace?: string | undefined; name?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -4802,7 +4802,7 @@ "label": "ConversationCreateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -4832,7 +4832,7 @@ "label": "ConversationMessageCreateProps", "description": [], "signature": [ - "Zod.ZodObject<{ messages: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }>" + "Zod.ZodObject<{ messages: Zod.ZodArray, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }, { messages: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -4847,7 +4847,7 @@ "label": "ConversationResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -4892,7 +4892,7 @@ "label": "ConversationsBulkCrudActionResponse", "description": [], "signature": [ - "Zod.ZodObject<{ success: Zod.ZodOptional; status_code: Zod.ZodOptional; message: Zod.ZodOptional; conversations_count: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; conversations: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }>" + "Zod.ZodObject<{ success: Zod.ZodOptional; status_code: Zod.ZodOptional; message: Zod.ZodOptional; conversations_count: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; conversations: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts", "deprecated": false, @@ -4907,7 +4907,7 @@ "label": "ConversationsBulkCrudActionResults", "description": [], "signature": [ - "Zod.ZodObject<{ updated: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>" + "Zod.ZodObject<{ updated: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts", "deprecated": false, @@ -4922,7 +4922,7 @@ "label": "ConversationSummary", "description": [], "signature": [ - "Zod.ZodObject<{ content: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>" + "Zod.ZodObject<{ content: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -4937,7 +4937,7 @@ "label": "ConversationUpdateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -4952,7 +4952,7 @@ "label": "CreateConversationRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -4967,7 +4967,7 @@ "label": "CreateConversationResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -4997,7 +4997,7 @@ "label": "CreateKnowledgeBaseEntryResponse", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -5089,7 +5089,7 @@ "label": "DefendInsightCreateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; eventsContextCount: Zod.ZodOptional; endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodOptional; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; eventsContextCount: Zod.ZodOptional; endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; id?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts", "deprecated": false, @@ -5134,7 +5134,7 @@ "label": "DefendInsightGetRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/get_defend_insight_route.gen.ts", "deprecated": false, @@ -5149,7 +5149,7 @@ "label": "DefendInsightGetResponse", "description": [], "signature": [ - "Zod.ZodObject<{ data: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>>>; }, \"strip\", Zod.ZodTypeAny, { data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; } | null | undefined; }, { data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; } | null | undefined; }>" + "Zod.ZodObject<{ data: Zod.ZodOptional; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>>>; }, \"strip\", Zod.ZodTypeAny, { data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; } | null | undefined; }, { data?: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; } | null | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/get_defend_insight_route.gen.ts", "deprecated": false, @@ -5179,7 +5179,7 @@ "label": "DefendInsightsGetRequestQuery", "description": [], "signature": [ - "Zod.ZodObject<{ ids: Zod.ZodOptional, string[], unknown>>; connector_id: Zod.ZodOptional; type: Zod.ZodOptional>; status: Zod.ZodOptional>; endpoint_ids: Zod.ZodOptional, string[], unknown>>; size: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type?: \"incompatible_antivirus\" | \"noisy_process_tree\" | undefined; size?: number | undefined; ids?: string[] | undefined; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; connector_id?: string | undefined; endpoint_ids?: string[] | undefined; }, { type?: \"incompatible_antivirus\" | \"noisy_process_tree\" | undefined; size?: number | undefined; ids?: unknown; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; connector_id?: string | undefined; endpoint_ids?: unknown; }>" + "Zod.ZodObject<{ ids: Zod.ZodOptional, \"many\">, string[], unknown>>; connector_id: Zod.ZodOptional>; type: Zod.ZodOptional>; status: Zod.ZodOptional>; endpoint_ids: Zod.ZodOptional, \"many\">, string[], unknown>>; size: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type?: \"incompatible_antivirus\" | \"noisy_process_tree\" | undefined; size?: number | undefined; ids?: string[] | undefined; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; connector_id?: string | undefined; endpoint_ids?: string[] | undefined; }, { type?: \"incompatible_antivirus\" | \"noisy_process_tree\" | undefined; size?: number | undefined; ids?: unknown; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; connector_id?: string | undefined; endpoint_ids?: unknown; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/get_defend_insights_route.gen.ts", "deprecated": false, @@ -5194,7 +5194,7 @@ "label": "DefendInsightsGetResponse", "description": [], "signature": [ - "Zod.ZodObject<{ data: Zod.ZodArray; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { data: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }[]; }, { data: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }[]; }>" + "Zod.ZodObject<{ data: Zod.ZodArray; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { data: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }[]; }, { data: { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/get_defend_insights_route.gen.ts", "deprecated": false, @@ -5209,7 +5209,7 @@ "label": "DefendInsightsPostRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; anonymizationFields: Zod.ZodArray; field: Zod.ZodString; allowed: Zod.ZodOptional; anonymized: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; model: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; }, \"strip\", Zod.ZodTypeAny, { subAction: \"invokeAI\" | \"invokeStream\"; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; model?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { subAction: \"invokeAI\" | \"invokeStream\"; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; model?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" + "Zod.ZodObject<{ endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; anonymizationFields: Zod.ZodArray; timestamp: Zod.ZodOptional>; field: Zod.ZodString; allowed: Zod.ZodOptional; anonymized: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }, { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; model: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; }, \"strip\", Zod.ZodTypeAny, { subAction: \"invokeAI\" | \"invokeStream\"; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; model?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { subAction: \"invokeAI\" | \"invokeStream\"; anonymizationFields: { id: string; field: string; namespace?: string | undefined; timestamp?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; allowed?: boolean | undefined; anonymized?: boolean | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; model?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/post_defend_insights_route.gen.ts", "deprecated": false, @@ -5224,7 +5224,7 @@ "label": "DefendInsightsPostResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/post_defend_insights_route.gen.ts", "deprecated": false, @@ -5239,7 +5239,7 @@ "label": "DefendInsightsResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodString; lastViewedAt: Zod.ZodString; eventsContextCount: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; status: Zod.ZodEnum<[\"running\", \"succeeded\", \"failed\", \"canceled\"]>; endpointIds: Zod.ZodArray, \"many\">; insightType: Zod.ZodEnum<[\"incompatible_antivirus\", \"noisy_process_tree\"]>; insights: Zod.ZodArray, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">; apiConfig: Zod.ZodObject<{ connectorId: Zod.ZodString; actionTypeId: Zod.ZodString; defaultSystemPromptId: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>; namespace: Zod.ZodString; backingIndex: Zod.ZodString; generationIntervals: Zod.ZodArray, \"many\">; averageIntervalMs: Zod.ZodNumber; failureReason: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }, { id: string; namespace: string; createdAt: string; updatedAt: string; status: \"running\" | \"succeeded\" | \"failed\" | \"canceled\"; users: { id?: string | undefined; name?: string | undefined; }[]; apiConfig: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }; endpointIds: string[]; insightType: \"incompatible_antivirus\" | \"noisy_process_tree\"; lastViewedAt: string; backingIndex: string; generationIntervals: { date: string; durationMs: number; }[]; averageIntervalMs: number; insights: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[]; timestamp?: string | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; eventsContextCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts", "deprecated": false, @@ -5284,7 +5284,7 @@ "label": "DefendInsightsUpdateProps", "description": [], "signature": [ - "Zod.ZodArray; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; eventsContextCount: Zod.ZodOptional; insights: Zod.ZodOptional, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }>, \"many\">" + "Zod.ZodArray; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; eventsContextCount: Zod.ZodOptional; insights: Zod.ZodOptional, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }>, \"many\">" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts", "deprecated": false, @@ -5329,7 +5329,7 @@ "label": "DefendInsightUpdateProps", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; eventsContextCount: Zod.ZodOptional; insights: Zod.ZodOptional, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; eventsContextCount: Zod.ZodOptional; insights: Zod.ZodOptional, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }, { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }>, \"many\">>; status: Zod.ZodOptional>; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; generationIntervals: Zod.ZodOptional, \"many\">>; backingIndex: Zod.ZodString; failureReason: Zod.ZodOptional; lastViewedAt: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }, { id: string; backingIndex: string; status?: \"running\" | \"succeeded\" | \"failed\" | \"canceled\" | undefined; failureReason?: string | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; lastViewedAt?: string | undefined; generationIntervals?: { date: string; durationMs: number; }[] | undefined; eventsContextCount?: number | undefined; insights?: { group: string; events?: { id: string; value: string; endpointId: string; }[] | undefined; }[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/defend_insights/common_attributes.gen.ts", "deprecated": false, @@ -5344,7 +5344,7 @@ "label": "DeleteConversationRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -5359,7 +5359,7 @@ "label": "DeleteConversationResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -5374,7 +5374,7 @@ "label": "DeleteKnowledgeBaseEntryRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -5389,7 +5389,7 @@ "label": "DeleteKnowledgeBaseEntryResponse", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -5404,7 +5404,7 @@ "label": "DocumentEntry", "description": [], "signature": [ - "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>" + "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -5494,7 +5494,7 @@ "label": "DocumentEntryUpdateFields", "description": [], "signature": [ - "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>" + "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -5509,7 +5509,7 @@ "label": "ErrorSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodOptional; error: Zod.ZodObject<{ status_code: Zod.ZodNumber; message: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; }, { message: string; status_code: number; }>; }, \"strict\", Zod.ZodTypeAny, { error: { message: string; status_code: number; }; id?: string | undefined; }, { error: { message: string; status_code: number; }; id?: string | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodOptional>; error: Zod.ZodObject<{ status_code: Zod.ZodNumber; message: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; }, { message: string; status_code: number; }>; }, \"strict\", Zod.ZodTypeAny, { error: { message: string; status_code: number; }; id?: string | undefined; }, { error: { message: string; status_code: number; }; id?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -5524,7 +5524,7 @@ "label": "ExecuteConnectorRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ conversationId: Zod.ZodOptional; message: Zod.ZodOptional; model: Zod.ZodOptional; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; actionTypeId: Zod.ZodString; alertsIndexPattern: Zod.ZodOptional; allow: Zod.ZodOptional>; allowReplacement: Zod.ZodOptional>; replacements: Zod.ZodObject<{}, \"strip\", Zod.ZodString, Zod.objectOutputType<{}, Zod.ZodString, \"strip\">, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>; size: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { actionTypeId: string; subAction: \"invokeAI\" | \"invokeStream\"; replacements: {} & { [k: string]: string; }; message?: string | undefined; size?: number | undefined; allow?: string[] | undefined; conversationId?: string | undefined; model?: string | undefined; alertsIndexPattern?: string | undefined; allowReplacement?: string[] | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { actionTypeId: string; subAction: \"invokeAI\" | \"invokeStream\"; replacements: {} & { [k: string]: string; }; message?: string | undefined; size?: number | undefined; allow?: string[] | undefined; conversationId?: string | undefined; model?: string | undefined; alertsIndexPattern?: string | undefined; allowReplacement?: string[] | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" + "Zod.ZodObject<{ conversationId: Zod.ZodOptional>; message: Zod.ZodOptional; model: Zod.ZodOptional; subAction: Zod.ZodEnum<[\"invokeAI\", \"invokeStream\"]>; actionTypeId: Zod.ZodString; alertsIndexPattern: Zod.ZodOptional; allow: Zod.ZodOptional>; allowReplacement: Zod.ZodOptional>; replacements: Zod.ZodObject<{}, \"strip\", Zod.ZodString, Zod.objectOutputType<{}, Zod.ZodString, \"strip\">, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>; size: Zod.ZodOptional; langSmithProject: Zod.ZodOptional; langSmithApiKey: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { actionTypeId: string; subAction: \"invokeAI\" | \"invokeStream\"; replacements: {} & { [k: string]: string; }; message?: string | undefined; size?: number | undefined; allow?: string[] | undefined; conversationId?: string | undefined; model?: string | undefined; alertsIndexPattern?: string | undefined; allowReplacement?: string[] | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }, { actionTypeId: string; subAction: \"invokeAI\" | \"invokeStream\"; replacements: {} & { [k: string]: string; }; message?: string | undefined; size?: number | undefined; allow?: string[] | undefined; conversationId?: string | undefined; model?: string | undefined; alertsIndexPattern?: string | undefined; allowReplacement?: string[] | undefined; langSmithProject?: string | undefined; langSmithApiKey?: string | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/actions_connector/post_actions_connector_execute_route.gen.ts", "deprecated": false, @@ -5584,7 +5584,7 @@ "label": "FindConversationsResponse", "description": [], "signature": [ - "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; perPage: number; total: number; }, { page: number; data: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; perPage: number; total: number; }>" + "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; perPage: number; total: number; }, { page: number; data: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; perPage: number; total: number; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/find_conversations_route.gen.ts", "deprecated": false, @@ -5644,7 +5644,7 @@ "label": "FindKnowledgeBaseEntriesResponse", "description": [], "signature": [ - "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; perPage: number; total: number; }, { page: number; data: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; perPage: number; total: number; }>" + "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; perPage: number; total: number; }, { page: number; data: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; perPage: number; total: number; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/find_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -5704,7 +5704,7 @@ "label": "FindPromptsResponse", "description": [], "signature": [ - "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; name: Zod.ZodString; promptType: Zod.ZodEnum<[\"system\", \"quick\"]>; content: Zod.ZodString; categories: Zod.ZodOptional>; color: Zod.ZodOptional; isNewConversationDefault: Zod.ZodOptional; isDefault: Zod.ZodOptional; consumer: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }[]; perPage: number; total: number; }, { page: number; data: { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }[]; perPage: number; total: number; }>" + "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; data: Zod.ZodArray; timestamp: Zod.ZodOptional>; name: Zod.ZodString; promptType: Zod.ZodEnum<[\"system\", \"quick\"]>; content: Zod.ZodString; categories: Zod.ZodOptional>; color: Zod.ZodOptional; isNewConversationDefault: Zod.ZodOptional; isDefault: Zod.ZodOptional; consumer: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; data: { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }[]; perPage: number; total: number; }, { page: number; data: { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }[]; perPage: number; total: number; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/find_prompts_route.gen.ts", "deprecated": false, @@ -5809,7 +5809,7 @@ "label": "IndexEntry", "description": [], "signature": [ - "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>" + "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -5899,7 +5899,7 @@ "label": "IndexEntryUpdateFields", "description": [], "signature": [ - "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>" + "Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -5974,7 +5974,7 @@ "label": "KnowledgeBaseEntryBulkCrudActionResponse", "description": [], "signature": [ - "Zod.ZodObject<{ success: Zod.ZodOptional; statusCode: Zod.ZodOptional; message: Zod.ZodOptional; knowledgeBaseEntriesCount: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; knowledgeBaseEntries: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }>" + "Zod.ZodObject<{ success: Zod.ZodOptional; statusCode: Zod.ZodOptional; message: Zod.ZodOptional; knowledgeBaseEntriesCount: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; knowledgeBaseEntries: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -5989,7 +5989,7 @@ "label": "KnowledgeBaseEntryBulkCrudActionResults", "description": [], "signature": [ - "Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>" + "Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6064,7 +6064,7 @@ "label": "KnowledgeBaseEntryResponse", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -6079,7 +6079,7 @@ "label": "KnowledgeBaseEntryUpdateProps", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -6109,7 +6109,7 @@ "label": "Message", "description": [], "signature": [ - "Zod.ZodObject<{ content: Zod.ZodString; reader: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>" + "Zod.ZodObject<{ content: Zod.ZodString; reader: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/common_attributes.gen.ts", "deprecated": false, @@ -6184,7 +6184,7 @@ "label": "NonEmptyString", "description": [], "signature": [ - "Zod.ZodString" + "Zod.ZodEffects" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.gen.ts", "deprecated": false, @@ -6229,7 +6229,7 @@ "label": "PerformBulkActionRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ delete: Zod.ZodOptional; ids: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { ids?: string[] | undefined; query?: string | undefined; }, { ids?: string[] | undefined; query?: string | undefined; }>>; create: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">>; update: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { create?: { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; update?: { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }, { create?: { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; update?: { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }>" + "Zod.ZodObject<{ delete: Zod.ZodOptional; ids: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { ids?: string[] | undefined; query?: string | undefined; }, { ids?: string[] | undefined; query?: string | undefined; }>>; create: Zod.ZodOptional; title: Zod.ZodString; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">>; update: Zod.ZodOptional; title: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { create?: { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; update?: { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }, { create?: { title: string; id?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; update?: { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts", "deprecated": false, @@ -6244,7 +6244,7 @@ "label": "PerformBulkActionResponse", "description": [], "signature": [ - "Zod.ZodObject<{ success: Zod.ZodOptional; status_code: Zod.ZodOptional; message: Zod.ZodOptional; conversations_count: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; conversations: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }>" + "Zod.ZodObject<{ success: Zod.ZodOptional; status_code: Zod.ZodOptional; message: Zod.ZodOptional; conversations_count: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; created: Zod.ZodArray; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"CONVERSATION_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; conversations: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }, { attributes: { results: { created: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; updated: { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }[]; skipped: { id: string; skip_reason: \"CONVERSATION_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; status_code: number; conversations: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; status_code?: number | undefined; conversations_count?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/bulk_crud_conversations_route.gen.ts", "deprecated": false, @@ -6259,7 +6259,7 @@ "label": "PerformKnowledgeBaseEntryBulkActionRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ delete: Zod.ZodOptional; ids: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { ids?: string[] | undefined; query?: string | undefined; }, { ids?: string[] | undefined; query?: string | undefined; }>>; create: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>, \"strip\", Zod.ZodTypeAny, { source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>, \"strip\", Zod.ZodTypeAny, { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">>; update: Zod.ZodOptional; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { create?: ({ source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; update?: ({ source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }, { create?: ({ source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; update?: ({ source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }>" + "Zod.ZodObject<{ delete: Zod.ZodOptional; ids: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { ids?: string[] | undefined; query?: string | undefined; }, { ids?: string[] | undefined; query?: string | undefined; }>>; create: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>, \"strip\", Zod.ZodTypeAny, { source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>, \"strip\", Zod.ZodTypeAny, { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">>; update: Zod.ZodOptional; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { create?: ({ source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; update?: ({ source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }, { create?: ({ source: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; update?: ({ source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[] | undefined; delete?: { ids?: string[] | undefined; query?: string | undefined; } | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6274,7 +6274,7 @@ "label": "PerformKnowledgeBaseEntryBulkActionResponse", "description": [], "signature": [ - "Zod.ZodObject<{ success: Zod.ZodOptional; statusCode: Zod.ZodOptional; message: Zod.ZodOptional; knowledgeBaseEntriesCount: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; knowledgeBaseEntries: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }>" + "Zod.ZodObject<{ success: Zod.ZodOptional; statusCode: Zod.ZodOptional; message: Zod.ZodOptional; knowledgeBaseEntriesCount: Zod.ZodOptional; attributes: Zod.ZodObject<{ results: Zod.ZodObject<{ updated: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; created: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>, \"many\">; deleted: Zod.ZodArray; skipped: Zod.ZodArray; skip_reason: Zod.ZodLiteral<\"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\">; }, \"strip\", Zod.ZodTypeAny, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }, { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }, { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }>; summary: Zod.ZodObject<{ failed: Zod.ZodNumber; skipped: Zod.ZodNumber; succeeded: Zod.ZodNumber; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { total: number; succeeded: number; failed: number; skipped: number; }, { total: number; succeeded: number; failed: number; skipped: number; }>; errors: Zod.ZodOptional; knowledgeBaseEntries: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { id: string; name?: string | undefined; }, { id: string; name?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }, { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }>, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }, { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }, { attributes: { results: { created: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; updated: ({ source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; } | { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; })[]; skipped: { id: string; skip_reason: \"KNOWLEDGE_BASE_ENTRY_NOT_MODIFIED\"; name?: string | undefined; }[]; deleted: string[]; }; summary: { total: number; succeeded: number; failed: number; skipped: number; }; errors?: { message: string; statusCode: number; knowledgeBaseEntries: { id: string; name?: string | undefined; }[]; err_code?: string | undefined; }[] | undefined; }; message?: string | undefined; success?: boolean | undefined; statusCode?: number | undefined; knowledgeBaseEntriesCount?: number | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/bulk_crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6334,7 +6334,7 @@ "label": "PromptResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; timestamp: Zod.ZodOptional; name: Zod.ZodString; promptType: Zod.ZodEnum<[\"system\", \"quick\"]>; content: Zod.ZodString; categories: Zod.ZodOptional>; color: Zod.ZodOptional; isNewConversationDefault: Zod.ZodOptional; isDefault: Zod.ZodOptional; consumer: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; timestamp: Zod.ZodOptional>; name: Zod.ZodString; promptType: Zod.ZodEnum<[\"system\", \"quick\"]>; content: Zod.ZodString; categories: Zod.ZodOptional>; color: Zod.ZodOptional; isNewConversationDefault: Zod.ZodOptional; isDefault: Zod.ZodOptional; consumer: Zod.ZodOptional; updatedAt: Zod.ZodOptional; updatedBy: Zod.ZodOptional; createdAt: Zod.ZodOptional; createdBy: Zod.ZodOptional; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; namespace: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }, { id: string; name: string; content: string; promptType: \"system\" | \"quick\"; namespace?: string | undefined; consumer?: string | undefined; timestamp?: string | undefined; color?: string | undefined; createdBy?: string | undefined; updatedBy?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; categories?: string[] | undefined; isDefault?: boolean | undefined; isNewConversationDefault?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/prompts/bulk_crud_prompts_route.gen.ts", "deprecated": false, @@ -6394,7 +6394,7 @@ "label": "ReadConversationRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -6409,7 +6409,7 @@ "label": "ReadConversationResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -6439,7 +6439,7 @@ "label": "ReadKnowledgeBaseEntryRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6454,7 +6454,7 @@ "label": "ReadKnowledgeBaseEntryResponse", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6514,7 +6514,7 @@ "label": "ResponseFields", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; }, { id: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; }, { id: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -6544,7 +6544,7 @@ "label": "SharedResponseProps", "description": [], "signature": [ - "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; }, { id: string; namespace: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; }>" + "Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; }, { id: string; namespace: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/common_attributes.gen.ts", "deprecated": false, @@ -6604,7 +6604,7 @@ "label": "UpdateConversationRequestBody", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodOptional; category: Zod.ZodOptional>; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; excludeFromLastConversationStorage: Zod.ZodOptional; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; }, \"strip\", Zod.ZodTypeAny, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; title?: string | undefined; category?: \"assistant\" | \"insights\" | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -6619,7 +6619,7 @@ "label": "UpdateConversationRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -6634,7 +6634,7 @@ "label": "UpdateConversationResponse", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodString; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; title: Zod.ZodString; category: Zod.ZodEnum<[\"assistant\", \"insights\"]>; summary: Zod.ZodOptional; timestamp: Zod.ZodOptional>; public: Zod.ZodOptional; confidence: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }, { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; }>>; timestamp: Zod.ZodOptional>; updatedAt: Zod.ZodOptional; createdAt: Zod.ZodString; replacements: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodString, \"strip\">>>; users: Zod.ZodArray; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; messages: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\">>>; role: Zod.ZodEnum<[\"system\", \"user\", \"assistant\"]>; timestamp: Zod.ZodEffects; isError: Zod.ZodOptional; traceData: Zod.ZodOptional; traceId: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { transactionId?: string | undefined; traceId?: string | undefined; }, { transactionId?: string | undefined; traceId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }, { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }>, \"many\">>; apiConfig: Zod.ZodOptional; provider: Zod.ZodOptional>; model: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }, { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; }>>; isDefault: Zod.ZodOptional; excludeFromLastConversationStorage: Zod.ZodOptional; namespace: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectOutputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectOutputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }, { id: string; namespace: string; title: string; createdAt: string; category: \"assistant\" | \"insights\"; users: { id?: string | undefined; name?: string | undefined; }[]; timestamp?: string | undefined; updatedAt?: string | undefined; summary?: { timestamp?: string | undefined; content?: string | undefined; public?: boolean | undefined; confidence?: \"medium\" | \"high\" | \"low\" | undefined; } | undefined; replacements?: Zod.objectInputType<{}, Zod.ZodString, \"strip\"> | undefined; apiConfig?: { connectorId: string; actionTypeId: string; provider?: \"Other\" | \"OpenAI\" | \"Azure OpenAI\" | undefined; model?: string | undefined; defaultSystemPromptId?: string | undefined; } | undefined; messages?: { timestamp: string; role: \"user\" | \"system\" | \"assistant\"; content: string; isError?: boolean | undefined; reader?: Zod.objectInputType<{}, Zod.ZodUnknown, \"strip\"> | undefined; traceData?: { transactionId?: string | undefined; traceId?: string | undefined; } | undefined; }[] | undefined; isDefault?: boolean | undefined; excludeFromLastConversationStorage?: boolean | undefined; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/conversations/crud_conversation_route.gen.ts", "deprecated": false, @@ -6649,7 +6649,7 @@ "label": "UpdateKnowledgeBaseEntryRequestBody", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodString; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }>, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; text: string; name: string; kbResource: string; namespace?: string | undefined; required?: boolean | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; namespace: Zod.ZodOptional>; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>>; }, { id: Zod.ZodEffects; }>, Zod.objectUtil.extendShape; users: Zod.ZodOptional; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">>; }>, { type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }>, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; name: string; index: string; field: string; description: string; queryDescription: string; namespace?: string | undefined; users?: { id?: string | undefined; name?: string | undefined; }[] | undefined; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6664,7 +6664,7 @@ "label": "UpdateKnowledgeBaseEntryRequestParams", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" + "Zod.ZodObject<{ id: Zod.ZodEffects; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, @@ -6679,7 +6679,7 @@ "label": "UpdateKnowledgeBaseEntryResponse", "description": [], "signature": [ - "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodString; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" + "Zod.ZodDiscriminatedUnion<\"type\", [Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"document\">; kbResource: Zod.ZodString; source: Zod.ZodString; text: Zod.ZodString; }, { required: Zod.ZodOptional; vector: Zod.ZodOptional, Zod.objectInputType<{}, Zod.ZodNumber, \"strip\">>; }, \"strip\", Zod.ZodTypeAny, { modelId: string; tokens: {} & { [k: string]: number; }; }, { modelId: string; tokens: {} & { [k: string]: number; }; }>>; }>>, \"strip\", Zod.ZodTypeAny, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }, { source: string; id: string; type: \"document\"; namespace: string; text: string; name: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; kbResource: string; required?: boolean | undefined; vector?: { modelId: string; tokens: {} & { [k: string]: number; }; } | undefined; }>, Zod.ZodObject; name: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id?: string | undefined; name?: string | undefined; }, { id?: string | undefined; name?: string | undefined; }>, \"many\">; }>, { id: Zod.ZodEffects; createdAt: Zod.ZodString; createdBy: Zod.ZodString; updatedAt: Zod.ZodString; updatedBy: Zod.ZodString; }>, Zod.objectUtil.extendShape<{ type: Zod.ZodLiteral<\"index\">; index: Zod.ZodString; field: Zod.ZodString; description: Zod.ZodString; queryDescription: Zod.ZodString; }, { inputSchema: Zod.ZodOptional, \"many\">>; outputFields: Zod.ZodOptional>; }>>, \"strip\", Zod.ZodTypeAny, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }, { id: string; type: \"index\"; namespace: string; name: string; index: string; field: string; description: string; createdBy: string; updatedBy: string; createdAt: string; updatedAt: string; users: { id?: string | undefined; name?: string | undefined; }[]; queryDescription: string; inputSchema?: { description: string; fieldName: string; fieldType: string; }[] | undefined; outputFields?: string[] | undefined; }>]>" ], "path": "x-pack/packages/kbn-elastic-assistant-common/impl/schemas/knowledge_base/entries/crud_knowledge_base_entries_route.gen.ts", "deprecated": false, diff --git a/api_docs/kbn_elastic_assistant_common.mdx b/api_docs/kbn_elastic_assistant_common.mdx index 638efcb519e5..1376bf0ca466 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/elastic-assistant-common'] --- import kbnElasticAssistantCommonObj from './kbn_elastic_assistant_common.devdocs.json'; diff --git a/api_docs/kbn_entities_schema.mdx b/api_docs/kbn_entities_schema.mdx index 44dd0e169a22..66d1000403f6 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/entities-schema'] --- import kbnEntitiesSchemaObj from './kbn_entities_schema.devdocs.json'; diff --git a/api_docs/kbn_es.mdx b/api_docs/kbn_es.mdx index 5543f3a6b731..3b7e1d1452a7 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-12-10 +date: 2024-12-13 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 97f4a71795a7..72b416039b85 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-12-10 +date: 2024-12-13 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 9d3f70b0ee96..af71231088f4 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-errors'] --- import kbnEsErrorsObj from './kbn_es_errors.devdocs.json'; diff --git a/api_docs/kbn_es_query.mdx b/api_docs/kbn_es_query.mdx index 0262b0586b2f..691362484e32 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-query'] --- import kbnEsQueryObj from './kbn_es_query.devdocs.json'; diff --git a/api_docs/kbn_es_types.devdocs.json b/api_docs/kbn_es_types.devdocs.json index ec62dd1cd61f..31946760a86f 100644 --- a/api_docs/kbn_es_types.devdocs.json +++ b/api_docs/kbn_es_types.devdocs.json @@ -584,6 +584,21 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/es-types", + "id": "def-common.ESSearchRequestWithoutBody", + "type": "Type", + "tags": [], + "label": "ESSearchRequestWithoutBody", + "description": [], + "signature": [ + "SearchRequest" + ], + "path": "packages/kbn-es-types/src/index.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/es-types", "id": "def-common.ESSearchResponse", diff --git a/api_docs/kbn_es_types.mdx b/api_docs/kbn_es_types.mdx index d9681706b366..4762d66fb996 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/es-types'] --- import kbnEsTypesObj from './kbn_es_types.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 | |-------------------|-----------|------------------------|-----------------| -| 30 | 0 | 30 | 1 | +| 31 | 0 | 31 | 1 | ## Common diff --git a/api_docs/kbn_eslint_plugin_imports.mdx b/api_docs/kbn_eslint_plugin_imports.mdx index fd86888ec92f..b25143a68244 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_esql_ast.mdx index 8ed0263341e4..4064d8864fac 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-ast'] --- import kbnEsqlAstObj from './kbn_esql_ast.devdocs.json'; diff --git a/api_docs/kbn_esql_editor.devdocs.json b/api_docs/kbn_esql_editor.devdocs.json index ca2d78c9c89e..b464c8bd5f1e 100644 --- a/api_docs/kbn_esql_editor.devdocs.json +++ b/api_docs/kbn_esql_editor.devdocs.json @@ -83,15 +83,7 @@ "section": "def-common.TimeRange", "text": "TimeRange" }, - " | undefined, abortController: AbortController | undefined, dataView: ", - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | undefined) => Promise<", + " | undefined, abortController: AbortController | undefined, timeFieldName: string | undefined) => Promise<", { "pluginId": "expressions", "scope": "common", @@ -195,19 +187,12 @@ { "parentPluginId": "@kbn/esql-editor", "id": "def-public.fetchFieldsFromESQL.$5", - "type": "Object", + "type": "string", "tags": [], - "label": "dataView", + "label": "timeFieldName", "description": [], "signature": [ - { - "pluginId": "dataViews", - "scope": "common", - "docId": "kibDataViewsPluginApi", - "section": "def-common.DataView", - "text": "DataView" - }, - " | undefined" + "string | undefined" ], "path": "src/platform/packages/private/kbn-esql-editor/src/fetch_fields_from_esql.ts", "deprecated": false, diff --git a/api_docs/kbn_esql_editor.mdx b/api_docs/kbn_esql_editor.mdx index fe9ce1cc47c8..f4467624fdea 100644 --- a/api_docs/kbn_esql_editor.mdx +++ b/api_docs/kbn_esql_editor.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-esql-editor title: "@kbn/esql-editor" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/esql-editor plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-editor'] --- import kbnEsqlEditorObj from './kbn_esql_editor.devdocs.json'; diff --git a/api_docs/kbn_esql_utils.mdx b/api_docs/kbn_esql_utils.mdx index 147541982ac3..8e0580d5320b 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_esql_validation_autocomplete.mdx index 0a9ac9b139b2..755778445d9f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/esql-validation-autocomplete'] --- import kbnEsqlValidationAutocompleteObj from './kbn_esql_validation_autocomplete.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_common.mdx b/api_docs/kbn_event_annotation_common.mdx index 135919de21d3..50e87a14862e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/event-annotation-common'] --- import kbnEventAnnotationCommonObj from './kbn_event_annotation_common.devdocs.json'; diff --git a/api_docs/kbn_event_annotation_components.mdx b/api_docs/kbn_event_annotation_components.mdx index d16d03113ce2..40e1cab2c8cc 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-12-10 +date: 2024-12-13 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 10de89b7d365..8a6858f594bb 100644 --- a/api_docs/kbn_expandable_flyout.devdocs.json +++ b/api_docs/kbn_expandable_flyout.devdocs.json @@ -23,7 +23,7 @@ }, "): React.JSX.Element | null; displayName: string | undefined; }" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -43,7 +43,7 @@ "text": "ExpandableFlyoutProps" } ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -64,7 +64,7 @@ "signature": [ "({ children, urlKey, }: React.PropsWithChildren) => React.JSX.Element" ], - "path": "packages/kbn-expandable-flyout/src/provider.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/provider.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -78,7 +78,7 @@ "signature": [ "React.PropsWithChildren" ], - "path": "packages/kbn-expandable-flyout/src/provider.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/provider.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -106,7 +106,34 @@ "text": "ExpandableFlyoutApi" } ], - "path": "packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_api.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_api.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/expandable-flyout", + "id": "def-public.useExpandableFlyoutHistory", + "type": "Function", + "tags": [], + "label": "useExpandableFlyoutHistory", + "description": [ + "\nThis hook allows you to access the flyout state, read open right, left and preview panels." + ], + "signature": [ + "() => ", + { + "pluginId": "@kbn/expandable-flyout", + "scope": "public", + "docId": "kibKbnExpandableFlyoutPluginApi", + "section": "def-public.FlyoutPanelProps", + "text": "FlyoutPanelProps" + }, + "[]" + ], + "path": "x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_history.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -132,7 +159,7 @@ "text": "FlyoutPanels" } ], - "path": "packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_state.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_state.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -148,7 +175,7 @@ "tags": [], "label": "ExpandableFlyoutApi", "description": [], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -188,7 +215,7 @@ }, " | undefined; }) => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -199,7 +226,7 @@ "tags": [], "label": "panels", "description": [], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -220,7 +247,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -241,7 +268,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -262,7 +289,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -291,7 +318,7 @@ }, ") => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -311,7 +338,7 @@ "text": "FlyoutPanelProps" } ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -339,7 +366,7 @@ }, ") => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -359,7 +386,7 @@ "text": "FlyoutPanelProps" } ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -387,7 +414,7 @@ }, ") => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -407,7 +434,7 @@ "text": "FlyoutPanelProps" } ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -427,7 +454,7 @@ "signature": [ "() => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -445,7 +472,7 @@ "signature": [ "() => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -463,7 +490,7 @@ "signature": [ "() => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -481,7 +508,7 @@ "signature": [ "() => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -499,7 +526,7 @@ "signature": [ "() => void" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -527,7 +554,7 @@ "EuiFlyoutResizableProps", ", \"onClose\">" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -544,7 +571,7 @@ "Panel", "[]" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false }, @@ -569,7 +596,7 @@ "Theme", ">" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false }, @@ -585,7 +612,7 @@ "signature": [ "((event: KeyboardEvent | MouseEvent | TouchEvent) => void) | undefined" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false }, @@ -602,7 +629,7 @@ "FlyoutCustomProps", " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false }, @@ -618,7 +645,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-expandable-flyout/src/index.tsx", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/index.tsx", "deprecated": false, "trackAdoption": false } @@ -632,7 +659,7 @@ "tags": [], "label": "FlyoutPanelProps", "description": [], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -645,7 +672,7 @@ "description": [ "\nUnique key to identify the panel" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -661,7 +688,7 @@ "signature": [ "Record | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -684,7 +711,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -700,7 +727,7 @@ "signature": [ "Record | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -714,7 +741,7 @@ "tags": [], "label": "FlyoutPanels", "description": [], - "path": "packages/kbn-expandable-flyout/src/store/state.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -737,7 +764,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/store/state.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts", "deprecated": false, "trackAdoption": false }, @@ -760,7 +787,7 @@ }, " | undefined" ], - "path": "packages/kbn-expandable-flyout/src/store/state.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts", "deprecated": false, "trackAdoption": false }, @@ -783,7 +810,28 @@ }, "[] | undefined" ], - "path": "packages/kbn-expandable-flyout/src/store/state.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/expandable-flyout", + "id": "def-public.FlyoutPanels.history", + "type": "Array", + "tags": [], + "label": "history", + "description": [], + "signature": [ + { + "pluginId": "@kbn/expandable-flyout", + "scope": "public", + "docId": "kibKbnExpandableFlyoutPluginApi", + "section": "def-public.FlyoutPanelProps", + "text": "FlyoutPanelProps" + }, + "[]" + ], + "path": "x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts", "deprecated": false, "trackAdoption": false } @@ -797,7 +845,7 @@ "tags": [], "label": "PanelPath", "description": [], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -810,7 +858,7 @@ "description": [ "\nTop level tab that to be displayed" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -826,7 +874,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-expandable-flyout/src/types.ts", + "path": "x-pack/solutions/security/packages/expandable-flyout/src/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_expandable_flyout.mdx b/api_docs/kbn_expandable_flyout.mdx index 67c2c53ceb4d..020b6795ab13 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 41 | 0 | 14 | 2 | +| 43 | 0 | 15 | 2 | ## Client diff --git a/api_docs/kbn_field_types.mdx b/api_docs/kbn_field_types.mdx index 9796938facfb..967b09bca5fa 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-12-10 +date: 2024-12-13 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 8e5483df68d9..ddfa1e0039fe 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-12-10 +date: 2024-12-13 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 589fa07000ee..8106623c240a 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-12-10 +date: 2024-12-13 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 05ff409798ba..651ffa6556ec 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/formatters'] --- import kbnFormattersObj from './kbn_formatters.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_services.mdx b/api_docs/kbn_ftr_common_functional_services.mdx index a601c6945bef..10d0472e7d82 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-services'] --- import kbnFtrCommonFunctionalServicesObj from './kbn_ftr_common_functional_services.devdocs.json'; diff --git a/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json b/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json index 048e3d908e3f..07675d918c70 100644 --- a/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json +++ b/api_docs/kbn_ftr_common_functional_ui_services.devdocs.json @@ -11914,6 +11914,76 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.InterceptResponseFactory", + "type": "Interface", + "tags": [], + "label": "InterceptResponseFactory", + "description": [], + "path": "packages/kbn-ftr-common-functional-ui-services/services/browser.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.InterceptResponseFactory.fail", + "type": "Function", + "tags": [], + "label": "fail", + "description": [], + "signature": [ + "() => [\"Fetch.failRequest\", ", + "Protocol", + ".Fetch.FailRequestRequest]" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/browser.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.InterceptResponseFactory.fulfill", + "type": "Function", + "tags": [], + "label": "fulfill", + "description": [], + "signature": [ + "(responseOptions: Omit<", + "Protocol", + ".Fetch.FulfillRequestRequest, \"requestId\">) => [\"Fetch.fulfillRequest\", ", + "Protocol", + ".Fetch.FulfillRequestRequest]" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/browser.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/ftr-common-functional-ui-services", + "id": "def-common.InterceptResponseFactory.fulfill.$1", + "type": "Object", + "tags": [], + "label": "responseOptions", + "description": [], + "signature": [ + "Omit<", + "Protocol", + ".Fetch.FulfillRequestRequest, \"requestId\">" + ], + "path": "packages/kbn-ftr-common-functional-ui-services/services/browser.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/ftr-common-functional-ui-services", "id": "def-common.NetworkOptions", diff --git a/api_docs/kbn_ftr_common_functional_ui_services.mdx b/api_docs/kbn_ftr_common_functional_ui_services.mdx index 41a1ed2e9cf6..aed7e41c8be7 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ftr-common-functional-ui-services'] --- import kbnFtrCommonFunctionalUiServicesObj from './kbn_ftr_common_functional_ui_services.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) for | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 560 | 6 | 520 | 7 | +| 564 | 6 | 524 | 7 | ## Common diff --git a/api_docs/kbn_gen_ai_functional_testing.mdx b/api_docs/kbn_gen_ai_functional_testing.mdx index ebc94ef881e8..85e0d86fac7a 100644 --- a/api_docs/kbn_gen_ai_functional_testing.mdx +++ b/api_docs/kbn_gen_ai_functional_testing.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-gen-ai-functional-testing title: "@kbn/gen-ai-functional-testing" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/gen-ai-functional-testing plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/gen-ai-functional-testing'] --- import kbnGenAiFunctionalTestingObj from './kbn_gen_ai_functional_testing.devdocs.json'; diff --git a/api_docs/kbn_generate.mdx b/api_docs/kbn_generate.mdx index 2e84064392c7..4fa0cf9cded3 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-12-10 +date: 2024-12-13 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 7c7da8e893bb..603fb8c2d329 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-12-10 +date: 2024-12-13 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 1ba4e75358a9..b08a79a6a2af 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/generate-csv'] --- import kbnGenerateCsvObj from './kbn_generate_csv.devdocs.json'; diff --git a/api_docs/kbn_grid_layout.mdx b/api_docs/kbn_grid_layout.mdx index 3abfaaebaaa5..138217974a77 100644 --- a/api_docs/kbn_grid_layout.mdx +++ b/api_docs/kbn_grid_layout.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grid-layout'] --- import kbnGridLayoutObj from './kbn_grid_layout.devdocs.json'; diff --git a/api_docs/kbn_grouping.mdx b/api_docs/kbn_grouping.mdx index e4933bb1ff4a..39c07b685879 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/grouping'] --- import kbnGroupingObj from './kbn_grouping.devdocs.json'; diff --git a/api_docs/kbn_guided_onboarding.mdx b/api_docs/kbn_guided_onboarding.mdx index bbc027ad2c3c..1209ecf07790 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-12-10 +date: 2024-12-13 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 638ba0efb44a..40128f69c547 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-12-10 +date: 2024-12-13 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 d19a016a5d9f..df606d7c8755 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-12-10 +date: 2024-12-13 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 36325139bd05..63cdd418e46d 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-12-10 +date: 2024-12-13 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 227d38b14298..3545049754c2 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-12-10 +date: 2024-12-13 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 21cb65455ca0..fb9f981d851b 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-12-10 +date: 2024-12-13 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 b7a54c71affa..33dcc945311b 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-12-10 +date: 2024-12-13 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 de7ebf0e5ea5..658406a8680d 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-12-10 +date: 2024-12-13 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 ae94fc2a4d03..c1981233a5d2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/import-resolver'] --- import kbnImportResolverObj from './kbn_import_resolver.devdocs.json'; diff --git a/api_docs/kbn_index_adapter.devdocs.json b/api_docs/kbn_index_adapter.devdocs.json index ac852981ef20..935776730bb2 100644 --- a/api_docs/kbn_index_adapter.devdocs.json +++ b/api_docs/kbn_index_adapter.devdocs.json @@ -17,7 +17,7 @@ "tags": [], "label": "IndexAdapter", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -28,7 +28,7 @@ "tags": [], "label": "kibanaVersion", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -39,7 +39,7 @@ "tags": [], "label": "totalFieldsLimit", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -54,7 +54,7 @@ "ClusterPutComponentTemplateRequest", "[]" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -69,7 +69,7 @@ "IndicesPutIndexTemplateRequest", "[]" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -80,7 +80,7 @@ "tags": [], "label": "installed", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -94,7 +94,7 @@ "signature": [ "any" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -108,7 +108,7 @@ "signature": [ "string" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -129,7 +129,7 @@ "text": "IndexAdapterParams" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -149,7 +149,7 @@ "GetComponentTemplateOpts", ") => void" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -163,7 +163,7 @@ "signature": [ "GetComponentTemplateOpts" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -189,7 +189,7 @@ }, ") => void" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -209,7 +209,7 @@ "text": "SetIndexTemplateParams" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -229,7 +229,7 @@ "GetInstallFnParams", ") => (promise: Promise, description?: string | undefined) => Promise" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -243,7 +243,7 @@ "signature": [ "GetInstallFnParams" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -269,7 +269,7 @@ }, ") => Promise" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -289,7 +289,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -315,7 +315,7 @@ }, ") => Promise" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -335,7 +335,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -370,7 +370,7 @@ "text": "IndexAdapter" } ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -384,7 +384,7 @@ "signature": [ "Map>" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -406,7 +406,7 @@ }, "> | undefined" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -420,7 +420,7 @@ "signature": [ "any" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -434,7 +434,7 @@ "signature": [ "string" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -455,7 +455,7 @@ "text": "IndexAdapterParams" } ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -483,7 +483,7 @@ }, ") => Promise" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -503,7 +503,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -537,7 +537,7 @@ }, ">" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -557,7 +557,7 @@ "text": "InstallParams" } ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -577,7 +577,7 @@ "signature": [ "(indexSuffix: string) => Promise" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -591,7 +591,7 @@ "signature": [ "string" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -611,7 +611,7 @@ "signature": [ "(indexSuffix: string) => string" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -625,7 +625,7 @@ "signature": [ "string" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -645,7 +645,7 @@ "signature": [ "(indexSuffix: string) => Promise" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -659,7 +659,7 @@ "signature": [ "string" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -682,7 +682,7 @@ "signature": [ "({ logger, esClient, template, totalFieldsLimit, }: CreateOrUpdateComponentTemplateOpts) => Promise" ], - "path": "packages/kbn-index-adapter/src/create_or_update_component_template.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -696,7 +696,7 @@ "signature": [ "CreateOrUpdateComponentTemplateOpts" ], - "path": "packages/kbn-index-adapter/src/create_or_update_component_template.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -717,7 +717,7 @@ "signature": [ "({ logger, esClient, template, }: CreateOrUpdateIndexTemplateOpts) => Promise" ], - "path": "packages/kbn-index-adapter/src/create_or_update_index_template.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -731,7 +731,7 @@ "signature": [ "CreateOrUpdateIndexTemplateOpts" ], - "path": "packages/kbn-index-adapter/src/create_or_update_index_template.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -758,7 +758,7 @@ }, "; attempt?: number | undefined; }) => Promise" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -772,7 +772,7 @@ "signature": [ "() => Promise" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -784,7 +784,7 @@ "tags": [], "label": "{ logger, attempt = 0 }", "description": [], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -804,7 +804,7 @@ "text": "Logger" } ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false }, @@ -818,7 +818,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/retry_transient_es_errors.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts", "deprecated": false, "trackAdoption": false } @@ -837,7 +837,7 @@ "tags": [], "label": "AllowedValue", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -851,7 +851,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -865,7 +865,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -879,7 +879,7 @@ "tags": [], "label": "EcsMetadata", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -900,7 +900,7 @@ }, "[] | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -911,7 +911,7 @@ "tags": [], "label": "dashed_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -922,7 +922,7 @@ "tags": [], "label": "description", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -936,7 +936,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -950,7 +950,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -961,7 +961,7 @@ "tags": [], "label": "flat_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -975,7 +975,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -989,7 +989,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1000,7 +1000,7 @@ "tags": [], "label": "level", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1021,7 +1021,7 @@ }, "[] | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1032,7 +1032,7 @@ "tags": [], "label": "name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1046,7 +1046,7 @@ "signature": [ "string[]" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1060,7 +1060,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1074,7 +1074,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1085,7 +1085,7 @@ "tags": [], "label": "short", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1096,7 +1096,7 @@ "tags": [], "label": "type", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1110,7 +1110,7 @@ "signature": [ "Record | undefined" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -1124,7 +1124,7 @@ "tags": [], "label": "IndexAdapterParams", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1135,7 +1135,7 @@ "tags": [], "label": "kibanaVersion", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -1149,7 +1149,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false } @@ -1163,7 +1163,7 @@ "tags": [], "label": "InstallParams", "description": [], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1183,7 +1183,7 @@ "text": "Logger" } ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -1212,7 +1212,7 @@ }, ">" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -1227,7 +1227,7 @@ "Subject", "" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false }, @@ -1241,7 +1241,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false } @@ -1255,7 +1255,7 @@ "tags": [], "label": "MultiField", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1266,7 +1266,7 @@ "tags": [], "label": "flat_name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1277,7 +1277,7 @@ "tags": [], "label": "name", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1288,7 +1288,7 @@ "tags": [], "label": "type", "description": [], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false } @@ -1316,7 +1316,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1339,7 +1339,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1354,7 +1354,7 @@ "signature": [ "(indexSuffix: string) => Promise" ], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1366,7 +1366,7 @@ "tags": [], "label": "indexSuffix", "description": [], - "path": "packages/kbn-index-adapter/src/index_pattern_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts", "deprecated": false, "trackAdoption": false } @@ -1391,7 +1391,7 @@ }, ", keyof NonNullable>}` : `${Key}` : never" ], - "path": "packages/kbn-index-adapter/src/field_maps/types.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1406,7 +1406,7 @@ "signature": [ "GetComponentTemplateOpts" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1423,7 +1423,7 @@ "IndicesPutIndexTemplateIndexTemplateMapping", " | undefined; componentTemplateRefs?: string[] | undefined; isDataStream?: boolean | undefined; }" ], - "path": "packages/kbn-index-adapter/src/index_adapter.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1448,7 +1448,7 @@ }, "[] | undefined; index?: boolean | undefined; path?: string | undefined; scaling_factor?: number | undefined; dynamic?: boolean | \"strict\" | undefined; properties?: Record | undefined; inference_id?: string | undefined; copy_to?: string | undefined; }; }" ], - "path": "packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts", + "path": "x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_index_adapter.mdx b/api_docs/kbn_index_adapter.mdx index 18930da423ca..cdb3f9c0294b 100644 --- a/api_docs/kbn_index_adapter.mdx +++ b/api_docs/kbn_index_adapter.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-adapter title: "@kbn/index-adapter" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-adapter plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-adapter'] --- import kbnIndexAdapterObj from './kbn_index_adapter.devdocs.json'; diff --git a/api_docs/kbn_index_lifecycle_management_common_shared.mdx b/api_docs/kbn_index_lifecycle_management_common_shared.mdx index 261488413d7a..cb7b6041eebf 100644 --- a/api_docs/kbn_index_lifecycle_management_common_shared.mdx +++ b/api_docs/kbn_index_lifecycle_management_common_shared.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-lifecycle-management-common-shared title: "@kbn/index-lifecycle-management-common-shared" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-lifecycle-management-common-shared plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-lifecycle-management-common-shared'] --- import kbnIndexLifecycleManagementCommonSharedObj from './kbn_index_lifecycle_management_common_shared.devdocs.json'; diff --git a/api_docs/kbn_index_management_shared_types.mdx b/api_docs/kbn_index_management_shared_types.mdx index 8bb71f78d7ec..488629c12008 100644 --- a/api_docs/kbn_index_management_shared_types.mdx +++ b/api_docs/kbn_index_management_shared_types.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-index-management-shared-types title: "@kbn/index-management-shared-types" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/index-management-shared-types plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/index-management-shared-types'] --- import kbnIndexManagementSharedTypesObj from './kbn_index_management_shared_types.devdocs.json'; diff --git a/api_docs/kbn_inference_common.devdocs.json b/api_docs/kbn_inference_common.devdocs.json index 9cb8c900b21d..6811cb39c58d 100644 --- a/api_docs/kbn_inference_common.devdocs.json +++ b/api_docs/kbn_inference_common.devdocs.json @@ -37,7 +37,7 @@ }, " extends Error" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -51,7 +51,7 @@ "signature": [ "any" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -65,7 +65,7 @@ "signature": [ "TCode" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -80,7 +80,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -95,7 +95,7 @@ "signature": [ "TMeta" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -120,7 +120,7 @@ "text": "InferenceTaskErrorEvent" } ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -148,7 +148,7 @@ "text": "InferenceTaskInternalError" } ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -162,7 +162,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -177,7 +177,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -203,7 +203,7 @@ "text": "InferenceTaskRequestError" } ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -217,7 +217,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -232,7 +232,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -269,7 +269,7 @@ }, ">) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -298,7 +298,7 @@ }, ">" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -327,7 +327,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -347,7 +347,7 @@ "text": "InferenceTaskEvent" } ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -376,7 +376,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -397,7 +397,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -434,7 +434,7 @@ }, ">) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -463,7 +463,7 @@ }, ">" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -482,7 +482,7 @@ "signature": [ "(error: unknown) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -496,7 +496,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -515,7 +515,7 @@ "signature": [ "(error: unknown) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -529,7 +529,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -548,7 +548,7 @@ "signature": [ "(error: unknown) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -562,7 +562,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -583,7 +583,7 @@ "signature": [ "(event: TOutputEvent) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -597,7 +597,7 @@ "signature": [ "TOutputEvent" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -626,7 +626,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -646,7 +646,7 @@ "text": "InferenceTaskEvent" } ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -675,7 +675,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -696,7 +696,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -717,7 +717,7 @@ "signature": [ "(error: Error) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -731,7 +731,7 @@ "signature": [ "Error" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -752,7 +752,7 @@ "signature": [ "(error: Error) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -766,7 +766,7 @@ "signature": [ "Error" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -787,7 +787,7 @@ "signature": [ "(error: Error | undefined) => boolean" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -801,7 +801,7 @@ "signature": [ "Error | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -820,7 +820,7 @@ "signature": [ "(values: T[], limit: number) => (string | T)[]" ], - "path": "x-pack/packages/ai-infra/inference-common/src/truncate_list.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/truncate_list.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -834,7 +834,7 @@ "signature": [ "T[]" ], - "path": "x-pack/packages/ai-infra/inference-common/src/truncate_list.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/truncate_list.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -849,7 +849,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/ai-infra/inference-common/src/truncate_list.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/truncate_list.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -880,7 +880,7 @@ }, ">>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -909,7 +909,7 @@ }, ">>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -938,7 +938,7 @@ }, ">>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/event_utils.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/event_utils.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -966,7 +966,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -979,7 +979,7 @@ "description": [ "\nThe text content of the LLM response." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1002,7 +1002,7 @@ }, "[\"toolCalls\"]" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1025,7 +1025,7 @@ }, " | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false } @@ -1041,7 +1041,7 @@ "description": [ "\nRepresent a partial tool call present in a chunk event.\n\nNote that all properties of the structure, except from the index,\nare partial and must be aggregated." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1054,7 +1054,7 @@ "description": [ "\nThe tool call index (position in the tool call array)." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false }, @@ -1067,7 +1067,7 @@ "description": [ "\nchunk of tool call id." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false }, @@ -1081,7 +1081,7 @@ "signature": [ "{ name: string; arguments: string; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false } @@ -1097,7 +1097,7 @@ "description": [ "\nToken count structure for the chatComplete API." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1110,7 +1110,7 @@ "description": [ "\nInput token count" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false }, @@ -1123,7 +1123,7 @@ "description": [ "\nOutput token count" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false }, @@ -1136,7 +1136,7 @@ "description": [ "\nTotal token count" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false } @@ -1162,7 +1162,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/inference_task.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/inference_task.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1178,7 +1178,7 @@ "signature": [ "TEventType" ], - "path": "x-pack/packages/ai-infra/inference-common/src/inference_task.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/inference_task.ts", "deprecated": false, "trackAdoption": false } @@ -1204,7 +1204,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1220,7 +1220,7 @@ "signature": [ "TId" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1233,7 +1233,7 @@ "description": [ "\nThe ID of the connector to use.\nMust be an inference connector, or an error will be thrown." ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1249,7 +1249,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1262,7 +1262,7 @@ "description": [ "\nThe prompt for the LLM." ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1278,7 +1278,7 @@ "signature": [ "TOutputSchema | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1301,7 +1301,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1324,7 +1324,7 @@ }, " | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1340,7 +1340,23 @@ "signature": [ "TStream | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/inference-common", + "id": "def-common.OutputOptions.retry", + "type": "Object", + "tags": [], + "label": "retry", + "description": [ + "\nOptional configuration for retrying the call if an error occurs." + ], + "signature": [ + "{ onValidationError?: number | boolean | undefined; } | undefined" + ], + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false } @@ -1366,7 +1382,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1382,7 +1398,7 @@ "signature": [ "TId" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1398,7 +1414,7 @@ "signature": [ "TOutput" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false }, @@ -1411,7 +1427,7 @@ "description": [ "\nPotential text content provided by the LLM, if it was provided in addition to the tool call." ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false } @@ -1437,7 +1453,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1450,7 +1466,7 @@ "description": [ "\nThe id of the tool call, that must be re-used when providing the tool call response" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false }, @@ -1464,7 +1480,7 @@ "signature": [ "{ name: TName; } & (TArguments extends Record ? { arguments: TArguments; } : {})" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false } @@ -1480,7 +1496,7 @@ "description": [ "\nThe definition of a tool that will be provided to the LLM for it to eventually call." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1493,7 +1509,7 @@ "description": [ "\nA description of what the tool does. Note that this will be exposed to the LLM,\nso the description should be explicit about what the tool does and when to call it." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false }, @@ -1510,7 +1526,7 @@ "ToolSchemaTypeObject", " | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false } @@ -1536,7 +1552,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1559,7 +1575,7 @@ }, " | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false }, @@ -1583,7 +1599,7 @@ }, "> | undefined" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false } @@ -1599,7 +1615,7 @@ "description": [ "\nRepresents a tool call from the LLM before correctly converted to the schema type.\n\nOnly publicly exposed because referenced by {@link ChatCompletionToolValidationError}" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1610,7 +1626,7 @@ "tags": [], "label": "toolCallId", "description": [], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false }, @@ -1624,7 +1640,7 @@ "signature": [ "{ name: string; arguments: string; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false } @@ -1642,7 +1658,7 @@ "description": [ "\nList of code of error that are specific to the {@link ChatCompleteAPI}" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1656,7 +1672,7 @@ "description": [ "\nList possible values of {@link ChatCompletionEvent} types." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1670,7 +1686,7 @@ "description": [ "\nEnum for generic inference error codes." ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1684,7 +1700,7 @@ "description": [ "\nEnum for all possible {@link Message} roles." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/messages.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1698,7 +1714,7 @@ "description": [ "\nList possible values of {@link OutputEvent} types." ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1712,7 +1728,7 @@ "description": [ "\nTool invocation choice type.\n\nRefer to {@link ToolChoice} for more details." ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1747,7 +1763,40 @@ }, " | undefined>[] | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/messages.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/inference-common", + "id": "def-common.AssistantMessageOf", + "type": "Type", + "tags": [], + "label": "AssistantMessageOf", + "description": [ + "\nUtility type to get the Assistant message type of a {@link ToolOptions} type." + ], + "signature": [ + "Omit<", + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.AssistantMessage", + "text": "AssistantMessage" + }, + ", \"toolCalls\"> & ", + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.ToolCallsOf", + "text": "ToolCallsOf" + }, + "" + ], + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1796,7 +1845,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/bound_api.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1819,7 +1868,7 @@ }, "[P]; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/bound_api.ts", "deprecated": false, "trackAdoption": false } @@ -1854,7 +1903,7 @@ }, "[\"functionCalling\"] | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/bound_api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1891,7 +1940,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/bound_api.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1904,7 +1953,7 @@ "label": "options", "description": [], "signature": [ - "{ id: TId; input: string; schema?: TOutputSchema | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", + "{ id: TId; input: string; schema?: TOutputSchema | undefined; retry?: { onValidationError?: number | boolean | undefined; } | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", { "pluginId": "@kbn/inference-common", "scope": "common", @@ -1914,7 +1963,7 @@ }, "[] | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/bound_api.ts", "deprecated": false, "trackAdoption": false } @@ -1941,7 +1990,7 @@ }, " | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/bound_api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1990,7 +2039,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -2021,7 +2070,7 @@ }, " | undefined; } & TToolOptions" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false } @@ -2056,7 +2105,7 @@ }, ">" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2089,7 +2138,7 @@ }, " | undefined; } & TToolOptions" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2115,7 +2164,7 @@ }, ">" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2155,7 +2204,7 @@ }, "[]; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2195,7 +2244,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2235,7 +2284,7 @@ }, "[\"toolCalls\"]; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2275,7 +2324,7 @@ }, "; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2307,7 +2356,7 @@ }, ".TokenLimitReachedError, { tokenLimit?: number | undefined; tokenCount?: number | undefined; }>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2339,7 +2388,7 @@ }, ".ToolNotFoundError, { name: string; }>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2379,7 +2428,7 @@ }, "[] | undefined; }>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2398,7 +2447,7 @@ "ToolSchemaTypeObject", " ? FromToolSchemaObject : TToolSchema extends ToolSchemaTypeArray ? FromToolSchemaArray : TToolSchema extends ToolSchemaTypeBoolean ? boolean : TToolSchema extends ToolSchemaTypeNumber ? number : TToolSchema extends ToolSchemaTypeString ? FromToolSchemaString : never" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tool_schema.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tool_schema.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2415,7 +2464,7 @@ "signature": [ "\"native\" | \"simulated\"" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2445,7 +2494,7 @@ }, "> & { error: { code: string; message: string; meta?: Record | undefined; }; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2467,7 +2516,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/inference_task.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/inference_task.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2479,7 +2528,7 @@ "tags": [], "label": "InferenceTaskEventType", "description": [], - "path": "x-pack/packages/ai-infra/inference-common/src/inference_task.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/inference_task.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2509,7 +2558,7 @@ }, ".internalError, Record>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2539,7 +2588,7 @@ }, ".requestError, { status: number; }>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/errors.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/errors.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2577,9 +2626,49 @@ "section": "def-common.ToolMessage", "text": "ToolMessage" }, - "" + " | undefined>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/messages.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/inference-common", + "id": "def-common.MessageOf", + "type": "Type", + "tags": [], + "label": "MessageOf", + "description": [ + "\nUtility type to get the mixin Message type of a {@link ToolOptions} type." + ], + "signature": [ + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.UserMessage", + "text": "UserMessage" + }, + " | ", + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.AssistantMessageOf", + "text": "AssistantMessageOf" + }, + " | ", + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.ToolMessageOf", + "text": "ToolMessageOf" + }, + "" + ], + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2596,7 +2685,7 @@ "signature": [ "unknown" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2633,7 +2722,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -2655,7 +2744,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false } @@ -2689,7 +2778,7 @@ }, ".OutputComplete> & { id: TId; output: TOutput; content: string; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2732,7 +2821,7 @@ }, " : undefined>>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2764,7 +2853,7 @@ }, "" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2800,7 +2889,7 @@ }, " : undefined>>" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2832,7 +2921,7 @@ }, ".OutputUpdate> & { id: TId; content: string; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/events.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2863,9 +2952,11 @@ "section": "def-common.ToolChoiceType", "text": "ToolChoiceType" }, - ".none; } ? { toolCalls: []; } : { toolCalls: ToolResponsesOf>; } : { toolCalls: never; }" + ".none; } ? { toolCalls: []; } : { toolCalls: ", + "ToolResponsesOf", + ">; } : { toolCalls: never; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2889,7 +2980,7 @@ }, " | CustomToolChoice" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tools.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2912,9 +3003,38 @@ "section": "def-common.MessageRole", "text": "MessageRole" }, - ".Tool> & { toolCallId: string; response: TToolResponse; }" + ".Tool> & { name: TName; toolCallId: string; response: TToolResponse; } & (TToolData extends undefined ? {} : { data: TToolData; })" + ], + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/inference-common", + "id": "def-common.ToolMessageOf", + "type": "Type", + "tags": [], + "label": "ToolMessageOf", + "description": [ + "\nUtility type to get the Tool message type of a {@link ToolOptions} type." + ], + "signature": [ + "MessageBase<", + { + "pluginId": "@kbn/inference-common", + "scope": "common", + "docId": "kibKbnInferenceCommonPluginApi", + "section": "def-common.MessageRole", + "text": "MessageRole" + }, + ".Tool> & { name: ", + "ToolNamesOf", + "; toolCallId: string; response: ", + "ToolResponsesOf", + "; } & ({} | { data: Record; })" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/messages.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2931,7 +3051,7 @@ "signature": [ "ToolSchemaTypeObject" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tool_schema.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tool_schema.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2949,7 +3069,7 @@ "ToolSchemaTypeObject", " | ToolSchemaTypeString | ToolSchemaTypeBoolean | ToolSchemaTypeNumber | ToolSchemaTypeArray" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/tool_schema.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tool_schema.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2974,7 +3094,7 @@ }, "[P]; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/bound_api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -2989,7 +3109,7 @@ "\nOptions used to call the {@link BoundOutputAPI}" ], "signature": [ - "{ id: TId; input: string; schema?: TOutputSchema | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", + "{ id: TId; input: string; schema?: TOutputSchema | undefined; retry?: { onValidationError?: number | boolean | undefined; } | undefined; system?: string | undefined; stream?: TStream | undefined; previousMessages?: ", { "pluginId": "@kbn/inference-common", "scope": "common", @@ -2999,7 +3119,7 @@ }, "[] | undefined; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/output/bound_api.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/output/bound_api.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3024,7 +3144,7 @@ }, ".User> & { content: string; }" ], - "path": "x-pack/packages/ai-infra/inference-common/src/chat_complete/messages.ts", + "path": "x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_inference_common.mdx b/api_docs/kbn_inference_common.mdx index ae7b81e2ecca..fc4528740913 100644 --- a/api_docs/kbn_inference_common.mdx +++ b/api_docs/kbn_inference_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-inference-common title: "@kbn/inference-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/inference-common plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/inference-common'] --- import kbnInferenceCommonObj from './kbn_inference_common.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 132 | 0 | 43 | 1 | +| 136 | 0 | 43 | 3 | ## Common diff --git a/api_docs/kbn_inference_integration_flyout.mdx b/api_docs/kbn_inference_integration_flyout.mdx index 835d28fa31cb..5f99d9066b9e 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_infra_forge.devdocs.json index 51660ce739fb..0db9d8bc7d5a 100644 --- a/api_docs/kbn_infra_forge.devdocs.json +++ b/api_docs/kbn_infra_forge.devdocs.json @@ -39,7 +39,7 @@ }, "; }) => Promise" ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -50,7 +50,7 @@ "tags": [], "label": "{ esClient, logger }", "description": [], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -64,7 +64,7 @@ "signature": [ "default" ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false }, @@ -84,7 +84,7 @@ "text": "ToolingLog" } ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false } @@ -114,7 +114,7 @@ }, "; }) => Promise" ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -125,7 +125,7 @@ "tags": [], "label": "{\n esClient,\n lookback,\n logger,\n}", "description": [], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -139,7 +139,7 @@ "signature": [ "default" ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false }, @@ -150,7 +150,7 @@ "tags": [], "label": "lookback", "description": [], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false }, @@ -170,7 +170,7 @@ "text": "ToolingLog" } ], - "path": "x-pack/packages/kbn-infra-forge/src/run.ts", + "path": "x-pack/platform/packages/private/kbn-infra-forge/src/run.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_infra_forge.mdx b/api_docs/kbn_infra_forge.mdx index 1da04c3ca95d..e812cedeeb0c 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-12-10 +date: 2024-12-13 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 6f7eb31206d9..97988814b6a3 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-12-10 +date: 2024-12-13 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 index 9d9586f583ec..e0190597796f 100644 --- a/api_docs/kbn_investigation_shared.devdocs.json +++ b/api_docs/kbn_investigation_shared.devdocs.json @@ -22,6 +22,36 @@ "interfaces": [], "enums": [], "misc": [ + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.AlertEventResponse", + "type": "Type", + "tags": [], + "label": "AlertEventResponse", + "description": [], + "signature": [ + "{ id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }" + ], + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.AnnotationEventResponse", + "type": "Type", + "tags": [], + "label": "AnnotationEventResponse", + "description": [], + "signature": [ + "{ id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }" + ], + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/investigation-shared", "id": "def-common.CreateInvestigationItemParams", @@ -32,7 +62,7 @@ "signature": [ "{ params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -47,7 +77,7 @@ "signature": [ "{ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -62,7 +92,7 @@ "signature": [ "{ content: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -77,7 +107,7 @@ "signature": [ "{ id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -92,7 +122,7 @@ "signature": [ "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -105,9 +135,9 @@ "label": "CreateInvestigationResponse", "description": [], "signature": [ - "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }" + "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -122,7 +152,7 @@ "signature": [ "{ itemId: string; investigationId: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -137,7 +167,7 @@ "signature": [ "{ investigationId: string; noteId: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -152,7 +182,7 @@ "signature": [ "{ investigationId: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -167,7 +197,7 @@ "signature": [ "{ dataStream?: string | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/entity.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -182,7 +212,7 @@ "signature": [ "{ id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; } & { sources: { dataStream?: string | undefined; }[]; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/entity.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -195,24 +225,9 @@ "label": "EventResponse", "description": [], "signature": [ - "{ id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; } & ({ eventType: \"annotation\"; annotationType?: string | undefined; } | { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; })" + "{ id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; } | { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/event.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.EventSchema", - "type": "Type", - "tags": [], - "label": "EventSchema", - "description": [], - "signature": [ - "{ id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; } & ({ eventType: \"annotation\"; annotationType?: string | undefined; } | { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; })" - ], - "path": "packages/kbn-investigation-shared/src/rest_specs/event.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -227,7 +242,7 @@ "signature": [ "{ page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; } | undefined" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -240,9 +255,9 @@ "label": "FindInvestigationsResponse", "description": [], "signature": [ - "{ page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }[]; perPage: number; total: number; }" + "{ page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }[]; perPage: number; total: number; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -257,7 +272,7 @@ "signature": [ "{ count: Partial>; total: number; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -272,7 +287,7 @@ "signature": [ "string[]" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -287,7 +302,7 @@ "signature": [ "{ 'container.id'?: string | undefined; 'host.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.name'?: string | undefined; } | undefined" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -302,7 +317,7 @@ "signature": [ "{ entities: ({ id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; } & { sources: { dataStream?: string | undefined; }[]; })[]; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -315,9 +330,9 @@ "label": "GetEventsParams", "description": [], "signature": [ - "{ filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; } | undefined" + "{ filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: (\"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\")[] | undefined; } | undefined" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_events.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -330,9 +345,9 @@ "label": "GetEventsResponse", "description": [], "signature": [ - "({ id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; } & ({ eventType: \"annotation\"; annotationType?: string | undefined; } | { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }))[]" + "({ id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; } | { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; })[]" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_events.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -347,7 +362,7 @@ "signature": [ "({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -362,7 +377,7 @@ "signature": [ "{ id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -377,7 +392,7 @@ "signature": [ "{ investigationId: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -390,9 +405,9 @@ "label": "GetInvestigationResponse", "description": [], "signature": [ - "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }" + "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -407,7 +422,7 @@ "signature": [ "{ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -422,7 +437,7 @@ "signature": [ "{ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -437,7 +452,7 @@ "signature": [ "{ id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -450,9 +465,9 @@ "label": "InvestigationResponse", "description": [], "signature": [ - "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }" + "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -467,7 +482,7 @@ "signature": [ "{ params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -482,7 +497,7 @@ "signature": [ "\"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -497,7 +512,7 @@ "signature": [ "{ params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -512,7 +527,7 @@ "signature": [ "{ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -527,7 +542,7 @@ "signature": [ "{ content: string; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -542,7 +557,7 @@ "signature": [ "{ id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -555,9 +570,9 @@ "label": "UpdateInvestigationParams", "description": [], "signature": [ - "{ params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }" + "{ params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -570,15 +585,30 @@ "label": "UpdateInvestigationResponse", "description": [], "signature": [ - "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }" + "{ params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false } ], "objects": [ + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.alertEventSchema", + "type": "Object", + "tags": [], + "label": "alertEventSchema", + "description": [], + "signature": [ + "Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }>" + ], + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/investigation-shared", "id": "def-common.alertOriginSchema", @@ -589,7 +619,22 @@ "signature": [ "Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>" ], - "path": "packages/kbn-investigation-shared/src/schema/origin.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/origin.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/investigation-shared", + "id": "def-common.annotationEventSchema", + "type": "Object", + "tags": [], + "label": "annotationEventSchema", + "description": [], + "signature": [ + "Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"annotation\">; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }>" + ], + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -604,7 +649,7 @@ "signature": [ "Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>" ], - "path": "packages/kbn-investigation-shared/src/schema/origin.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/origin.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -619,7 +664,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { params: Record; type: string; title: string; }; }, { path: { investigationId: string; }; body: { params: Record; type: string; title: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -634,7 +679,7 @@ "signature": [ "Zod.ZodIntersection, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -649,7 +694,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ content: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { content: string; }, { content: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { content: string; }; }, { path: { investigationId: string; }; body: { content: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -664,7 +709,7 @@ "signature": [ "Zod.ZodObject<{ id: Zod.ZodString; content: Zod.ZodString; createdAt: Zod.ZodNumber; updatedAt: Zod.ZodNumber; createdBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -679,7 +724,7 @@ "signature": [ "Zod.ZodObject<{ body: Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; tags: Zod.ZodArray; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }>; }, \"strip\", Zod.ZodTypeAny, { body: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }; }, { body: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -692,9 +737,9 @@ "label": "createInvestigationResponseSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>" + "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/create.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -709,7 +754,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; itemId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { itemId: string; investigationId: string; }, { itemId: string; investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { itemId: string; investigationId: string; }; }, { path: { itemId: string; investigationId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -724,7 +769,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; noteId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; noteId: string; }, { investigationId: string; noteId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; noteId: string; }; }, { path: { investigationId: string; noteId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -739,7 +784,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; }, { path: { investigationId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/delete.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -754,7 +799,7 @@ "signature": [ "Zod.ZodObject<{ id: Zod.ZodString; definition_id: Zod.ZodString; definition_version: Zod.ZodString; display_name: Zod.ZodString; last_seen_timestamp: Zod.ZodString; identity_fields: Zod.ZodArray; schema_version: Zod.ZodString; type: Zod.ZodString; metrics: Zod.ZodObject<{ failedTransactionRate: Zod.ZodOptional; latency: Zod.ZodOptional; throughput: Zod.ZodOptional; logErrorRate: Zod.ZodOptional; logRate: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/entity.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -769,37 +814,37 @@ "signature": [ "Zod.ZodIntersection; schema_version: Zod.ZodString; type: Zod.ZodString; metrics: Zod.ZodObject<{ failedTransactionRate: Zod.ZodOptional; latency: Zod.ZodOptional; throughput: Zod.ZodOptional; logErrorRate: Zod.ZodOptional; logRate: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }>, Zod.ZodObject<{ sources: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { dataStream?: string | undefined; }, { dataStream?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { sources: { dataStream?: string | undefined; }[]; }, { sources: { dataStream?: string | undefined; }[]; }>>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/entity.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.eventResponseSchema", + "id": "def-common.eventSchema", "type": "Object", "tags": [], - "label": "eventResponseSchema", + "label": "eventSchema", "description": [], "signature": [ - "Zod.ZodIntersection, Zod.ZodLiteral<\"alert\">, Zod.ZodLiteral<\"error_rate\">, Zod.ZodLiteral<\"latency\">, Zod.ZodLiteral<\"anomaly\">]>; source: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }>, Zod.ZodDiscriminatedUnion<\"eventType\", [Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"annotation\">; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { eventType: \"annotation\"; annotationType?: string | undefined; }, { eventType: \"annotation\"; annotationType?: string | undefined; }>, Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }>]>>" + "Zod.ZodDiscriminatedUnion<\"eventType\", [Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"annotation\">; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }>, Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }>]>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/event.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false }, { "parentPluginId": "@kbn/investigation-shared", - "id": "def-common.eventSchema", + "id": "def-common.eventTypeSchema", "type": "Object", "tags": [], - "label": "eventSchema", + "label": "eventTypeSchema", "description": [], "signature": [ - "Zod.ZodIntersection, Zod.ZodLiteral<\"alert\">, Zod.ZodLiteral<\"error_rate\">, Zod.ZodLiteral<\"latency\">, Zod.ZodLiteral<\"anomaly\">]>; source: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }>, Zod.ZodDiscriminatedUnion<\"eventType\", [Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"annotation\">; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { eventType: \"annotation\"; annotationType?: string | undefined; }, { eventType: \"annotation\"; annotationType?: string | undefined; }>, Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }>]>>" + "Zod.ZodUnion<[Zod.ZodLiteral<\"annotation\">, Zod.ZodLiteral<\"alert\">, Zod.ZodLiteral<\"error_rate\">, Zod.ZodLiteral<\"latency\">, Zod.ZodLiteral<\"anomaly\">]>" ], - "path": "packages/kbn-investigation-shared/src/schema/event.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -814,7 +859,7 @@ "signature": [ "Zod.ZodObject<{ query: Zod.ZodOptional; search: Zod.ZodOptional; filter: Zod.ZodOptional; page: Zod.ZodOptional; perPage: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; }, { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; } | undefined; }, { query?: { page?: number | undefined; filter?: string | undefined; search?: string | undefined; perPage?: number | undefined; alertId?: string | undefined; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -827,9 +872,9 @@ "label": "findInvestigationsResponseSchema", "description": [], "signature": [ - "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; results: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }[]; perPage: number; total: number; }, { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }[]; perPage: number; total: number; }>" + "Zod.ZodObject<{ page: Zod.ZodNumber; perPage: Zod.ZodNumber; total: Zod.ZodNumber; results: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }[]; perPage: number; total: number; }, { page: number; results: { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }[]; perPage: number; total: number; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/find.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -844,7 +889,7 @@ "signature": [ "Zod.ZodObject<{ query: Zod.ZodObject<{}, \"strip\", Zod.ZodTypeAny, {}, {}>; }, \"strip\", Zod.ZodTypeAny, { query: {}; }, { query: {}; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -859,7 +904,7 @@ "signature": [ "Zod.ZodObject<{ count: Zod.ZodRecord, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>, Zod.ZodNumber>; total: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { count: Partial>; total: number; }, { count: Partial>; total: number; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -874,7 +919,7 @@ "signature": [ "Zod.ZodObject<{ query: Zod.ZodObject<{}, \"strip\", Zod.ZodTypeAny, {}, {}>; }, \"strip\", Zod.ZodTypeAny, { query: {}; }, { query: {}; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -889,7 +934,7 @@ "signature": [ "Zod.ZodArray" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -904,7 +949,7 @@ "signature": [ "Zod.ZodObject<{ query: Zod.ZodOptional; 'service.environment': Zod.ZodOptional; 'host.name': Zod.ZodOptional; 'container.id': Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { 'container.id'?: string | undefined; 'host.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.name'?: string | undefined; }, { 'container.id'?: string | undefined; 'host.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.name'?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { 'container.id'?: string | undefined; 'host.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.name'?: string | undefined; } | undefined; }, { query?: { 'container.id'?: string | undefined; 'host.name'?: string | undefined; 'service.environment'?: string | undefined; 'service.name'?: string | undefined; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -919,7 +964,7 @@ "signature": [ "Zod.ZodObject<{ entities: Zod.ZodArray; schema_version: Zod.ZodString; type: Zod.ZodString; metrics: Zod.ZodObject<{ failedTransactionRate: Zod.ZodOptional; latency: Zod.ZodOptional; throughput: Zod.ZodOptional; logErrorRate: Zod.ZodOptional; logRate: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }, { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }, { id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; }>, Zod.ZodObject<{ sources: Zod.ZodArray; }, \"strip\", Zod.ZodTypeAny, { dataStream?: string | undefined; }, { dataStream?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { sources: { dataStream?: string | undefined; }[]; }, { sources: { dataStream?: string | undefined; }[]; }>>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { entities: ({ id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; } & { sources: { dataStream?: string | undefined; }[]; })[]; }, { entities: ({ id: string; type: string; metrics: { latency?: number | undefined; throughput?: number | undefined; failedTransactionRate?: number | undefined; logErrorRate?: number | undefined; logRate?: number | undefined; }; schema_version: string; identity_fields: string[]; display_name: string; definition_version: string; definition_id: string; last_seen_timestamp: string; } & { sources: { dataStream?: string | undefined; }[]; })[]; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -932,9 +977,9 @@ "label": "getEventsParamsSchema", "description": [], "signature": [ - "Zod.ZodObject<{ query: Zod.ZodOptional; rangeTo: Zod.ZodOptional; filter: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; }, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; } | undefined; }, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; } | undefined; }>" + "Zod.ZodObject<{ query: Zod.ZodOptional; rangeTo: Zod.ZodOptional; filter: Zod.ZodOptional; eventTypes: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: (\"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\")[] | undefined; }, { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: string | undefined; }>>; }, \"strip\", Zod.ZodTypeAny, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: (\"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\")[] | undefined; } | undefined; }, { query?: { filter?: string | undefined; rangeFrom?: string | undefined; rangeTo?: string | undefined; eventTypes?: string | undefined; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_events.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -947,9 +992,9 @@ "label": "getEventsResponseSchema", "description": [], "signature": [ - "Zod.ZodArray, Zod.ZodLiteral<\"alert\">, Zod.ZodLiteral<\"error_rate\">, Zod.ZodLiteral<\"latency\">, Zod.ZodLiteral<\"anomaly\">]>; source: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"alert\" | \"annotation\" | \"latency\" | \"error_rate\" | \"anomaly\"; source?: Record | undefined; }>, Zod.ZodDiscriminatedUnion<\"eventType\", [Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"annotation\">; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { eventType: \"annotation\"; annotationType?: string | undefined; }, { eventType: \"annotation\"; annotationType?: string | undefined; }>, Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }, { alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; }>]>>, \"many\">" + "Zod.ZodArray; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; annotationType: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }, { id: string; timestamp: number; title: string; description: string; eventType: \"annotation\"; source?: Record | undefined; annotationType?: string | undefined; }>, Zod.ZodObject<{ eventType: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; title: Zod.ZodString; description: Zod.ZodString; timestamp: Zod.ZodNumber; source: Zod.ZodOptional>; alertStatus: Zod.ZodUnion<[Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"flapping\">, Zod.ZodLiteral<\"recovered\">, Zod.ZodLiteral<\"untracked\">]>; }, \"strip\", Zod.ZodTypeAny, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }, { id: string; timestamp: number; title: string; description: string; alertStatus: \"flapping\" | \"recovered\" | \"active\" | \"untracked\"; eventType: \"alert\"; source?: Record | undefined; }>]>, \"many\">" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_events.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -964,7 +1009,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; }, { path: { investigationId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -979,7 +1024,7 @@ "signature": [ "Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_items.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -994,7 +1039,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; }, { path: { investigationId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1009,7 +1054,7 @@ "signature": [ "Zod.ZodArray, \"many\">" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1024,7 +1069,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; }, { path: { investigationId: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1037,9 +1082,9 @@ "label": "getInvestigationResponseSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>" + "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/get.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1054,7 +1099,7 @@ "signature": [ "Zod.ZodIntersection, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1069,7 +1114,7 @@ "signature": [ "Zod.ZodIntersection, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1084,7 +1129,7 @@ "signature": [ "Zod.ZodObject<{ id: Zod.ZodString; content: Zod.ZodString; createdAt: Zod.ZodNumber; updatedAt: Zod.ZodNumber; createdBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1099,7 +1144,7 @@ "signature": [ "Zod.ZodObject<{ id: Zod.ZodString; content: Zod.ZodString; createdAt: Zod.ZodNumber; updatedAt: Zod.ZodNumber; createdBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1112,9 +1157,9 @@ "label": "investigationResponseSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>" + "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/investigation.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1127,9 +1172,9 @@ "label": "investigationSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>" + "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1144,7 +1189,7 @@ "signature": [ "Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1159,7 +1204,7 @@ "signature": [ "Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>" ], - "path": "packages/kbn-investigation-shared/src/schema/investigation.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1174,7 +1219,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; itemId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { itemId: string; investigationId: string; }, { itemId: string; investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { itemId: string; investigationId: string; }; body: { params: Record; type: string; title: string; }; }, { path: { itemId: string; investigationId: string; }; body: { params: Record; type: string; title: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1189,7 +1234,7 @@ "signature": [ "Zod.ZodIntersection, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_item.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1204,7 +1249,7 @@ "signature": [ "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; noteId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; noteId: string; }, { investigationId: string; noteId: string; }>; body: Zod.ZodObject<{ content: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { content: string; }, { content: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; noteId: string; }; body: { content: string; }; }, { path: { investigationId: string; noteId: string; }; body: { content: string; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1219,7 +1264,7 @@ "signature": [ "Zod.ZodObject<{ id: Zod.ZodString; content: Zod.ZodString; createdAt: Zod.ZodNumber; updatedAt: Zod.ZodNumber; createdBy: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }, { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update_note.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1232,9 +1277,9 @@ "label": "updateInvestigationParamsSchema", "description": [], "signature": [ - "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodOptional; status: Zod.ZodOptional, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>>; params: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>>; tags: Zod.ZodOptional>; externalIncidentUrl: Zod.ZodOptional>; }, \"strip\", Zod.ZodTypeAny, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }; }, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; }; }>" + "Zod.ZodObject<{ path: Zod.ZodObject<{ investigationId: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { investigationId: string; }, { investigationId: string; }>; body: Zod.ZodObject<{ title: Zod.ZodOptional; status: Zod.ZodOptional, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>>; params: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>>; tags: Zod.ZodOptional>; externalIncidentUrl: Zod.ZodOptional>; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }; }, { path: { investigationId: string; }; body: { params?: { timeRange: { from: number; to: number; }; } | undefined; tags?: string[] | undefined; title?: string | undefined; status?: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\" | undefined; externalIncidentUrl?: string | null | undefined; rootCauseAnalysis?: { events: any[]; } | undefined; }; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1247,9 +1292,9 @@ "label": "updateInvestigationResponseSchema", "description": [], "signature": [ - "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; }>" + "Zod.ZodObject<{ id: Zod.ZodString; title: Zod.ZodString; createdAt: Zod.ZodNumber; createdBy: Zod.ZodString; updatedAt: Zod.ZodNumber; params: Zod.ZodObject<{ timeRange: Zod.ZodObject<{ from: Zod.ZodNumber; to: Zod.ZodNumber; }, \"strip\", Zod.ZodTypeAny, { from: number; to: number; }, { from: number; to: number; }>; }, \"strip\", Zod.ZodTypeAny, { timeRange: { from: number; to: number; }; }, { timeRange: { from: number; to: number; }; }>; origin: Zod.ZodUnion<[Zod.ZodObject<{ type: Zod.ZodLiteral<\"alert\">; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"alert\"; }, { id: string; type: \"alert\"; }>, Zod.ZodObject<{ type: Zod.ZodLiteral<\"blank\">; }, \"strip\", Zod.ZodTypeAny, { type: \"blank\"; }, { type: \"blank\"; }>]>; status: Zod.ZodUnion<[Zod.ZodLiteral<\"triage\">, Zod.ZodLiteral<\"active\">, Zod.ZodLiteral<\"mitigated\">, Zod.ZodLiteral<\"resolved\">, Zod.ZodLiteral<\"cancelled\">]>; tags: Zod.ZodArray; notes: Zod.ZodArray, \"many\">; items: Zod.ZodArray, Zod.ZodObject<{ title: Zod.ZodString; type: Zod.ZodString; params: Zod.ZodRecord; }, \"strip\", Zod.ZodTypeAny, { params: Record; type: string; title: string; }, { params: Record; type: string; title: string; }>>, \"many\">; externalIncidentUrl: Zod.ZodNullable; rootCauseAnalysis: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { events: any[]; }, { events: any[]; }>>; }, \"strip\", Zod.ZodTypeAny, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }, { params: { timeRange: { from: number; to: number; }; }; id: string; tags: string[]; title: string; createdBy: string; createdAt: number; updatedAt: number; status: \"active\" | \"triage\" | \"mitigated\" | \"resolved\" | \"cancelled\"; items: ({ id: string; createdBy: string; createdAt: number; updatedAt: number; } & { params: Record; type: string; title: string; })[]; origin: { id: string; type: \"alert\"; } | { type: \"blank\"; }; externalIncidentUrl: string | null; notes: { id: string; content: string; createdBy: string; createdAt: number; updatedAt: number; }[]; rootCauseAnalysis?: { events: any[]; } | undefined; }>" ], - "path": "packages/kbn-investigation-shared/src/rest_specs/update.ts", + "path": "x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_investigation_shared.mdx b/api_docs/kbn_investigation_shared.mdx index a3d2e84dae6e..cc9ef71e0320 100644 --- a/api_docs/kbn_investigation_shared.mdx +++ b/api_docs/kbn_investigation_shared.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/investigation-shared'] --- import kbnInvestigationSharedObj from './kbn_investigation_shared.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 | |-------------------|-----------|------------------------|-----------------| -| 82 | 0 | 82 | 0 | +| 85 | 0 | 85 | 0 | ## Common diff --git a/api_docs/kbn_io_ts_utils.mdx b/api_docs/kbn_io_ts_utils.mdx index db2a188e33c6..5f7f835c4400 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-12-10 +date: 2024-12-13 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 901e82a92998..7452e707cf2c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ipynb'] --- import kbnIpynbObj from './kbn_ipynb.devdocs.json'; diff --git a/api_docs/kbn_item_buffer.mdx b/api_docs/kbn_item_buffer.mdx index 6a6ffb8478cb..cf858538ce3b 100644 --- a/api_docs/kbn_item_buffer.mdx +++ b/api_docs/kbn_item_buffer.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-item-buffer title: "@kbn/item-buffer" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/item-buffer plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/item-buffer'] --- import kbnItemBufferObj from './kbn_item_buffer.devdocs.json'; diff --git a/api_docs/kbn_jest_serializers.mdx b/api_docs/kbn_jest_serializers.mdx index 7c0a7ae507c3..410db992388f 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-12-10 +date: 2024-12-13 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 8a0a6c7fddd1..b4ff813ee6b5 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-12-10 +date: 2024-12-13 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 7ed7865c98c8..78d2283acace 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-12-10 +date: 2024-12-13 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 4435f176abf7..a4b6a557af51 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-12-10 +date: 2024-12-13 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 8f7927fb7441..fd80f946c572 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_language_documentation.mdx index b5ee3a53170b..38d6e2c88b3f 100644 --- a/api_docs/kbn_language_documentation.mdx +++ b/api_docs/kbn_language_documentation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-language-documentation title: "@kbn/language-documentation" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/language-documentation plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/language-documentation'] --- import kbnLanguageDocumentationObj from './kbn_language_documentation.devdocs.json'; diff --git a/api_docs/kbn_lens_embeddable_utils.mdx b/api_docs/kbn_lens_embeddable_utils.mdx index 3de194aa8dd6..44d2b6ea68ea 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-12-10 +date: 2024-12-13 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 2e10d60a2392..6990e26db69b 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-12-10 +date: 2024-12-13 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 b12d106b4540..e26063c7a4a7 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-12-10 +date: 2024-12-13 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 fabf0158d77f..1a35a2a75d98 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_managed_content_badge.mdx index 975c1366844a..55da99db3985 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/managed-content-badge'] --- import kbnManagedContentBadgeObj from './kbn_managed_content_badge.devdocs.json'; diff --git a/api_docs/kbn_managed_vscode_config.mdx b/api_docs/kbn_managed_vscode_config.mdx index 20f5993d3784..5c880581d94f 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-12-10 +date: 2024-12-13 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 0fef8c4259ef..a9e65acb0836 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-12-10 +date: 2024-12-13 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 4c180b669e6e..1a302f0b5c62 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-12-10 +date: 2024-12-13 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 cb28f1307bdc..657137766b83 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-12-10 +date: 2024-12-13 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 74afbf935717..2992f73ad36f 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-12-10 +date: 2024-12-13 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 4986de7fed64..b04900d41d97 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-12-10 +date: 2024-12-13 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 d67e63f9fd57..bbaf23141e15 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-12-10 +date: 2024-12-13 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 af5f139fae40..59f4a3f81cee 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-field-definition'] --- import kbnManagementSettingsFieldDefinitionObj from './kbn_management_settings_field_definition.devdocs.json'; diff --git a/api_docs/kbn_management_settings_ids.mdx b/api_docs/kbn_management_settings_ids.mdx index d3881d109ada..d7a7b612258c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-settings-ids'] --- import kbnManagementSettingsIdsObj from './kbn_management_settings_ids.devdocs.json'; diff --git a/api_docs/kbn_management_settings_section_registry.mdx b/api_docs/kbn_management_settings_section_registry.mdx index a1d50b9c8198..e3ff82f96ceb 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_management_settings_types.mdx index 9adad01d8feb..341adcbfa9bf 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-12-10 +date: 2024-12-13 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 331cb1ceddea..eefb10e8c891 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-12-10 +date: 2024-12-13 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 ce8a3fd26d1b..8695da589489 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/management-storybook-config'] --- import kbnManagementStorybookConfigObj from './kbn_management_storybook_config.devdocs.json'; diff --git a/api_docs/kbn_manifest.mdx b/api_docs/kbn_manifest.mdx index 64218575a83a..98b29e1c2d1a 100644 --- a/api_docs/kbn_manifest.mdx +++ b/api_docs/kbn_manifest.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-manifest title: "@kbn/manifest" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/manifest plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/manifest'] --- import kbnManifestObj from './kbn_manifest.devdocs.json'; diff --git a/api_docs/kbn_mapbox_gl.mdx b/api_docs/kbn_mapbox_gl.mdx index 0e365ab6aebd..5343532ca170 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-12-10 +date: 2024-12-13 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 e0b147e3efe0..7767553f07c9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/maps-vector-tile-utils'] --- import kbnMapsVectorTileUtilsObj from './kbn_maps_vector_tile_utils.devdocs.json'; diff --git a/api_docs/kbn_ml_agg_utils.mdx b/api_docs/kbn_ml_agg_utils.mdx index ff0fc16114bb..8c93f8bb3d2c 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-12-10 +date: 2024-12-13 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 4db52f230beb..70b2727cc712 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-12-10 +date: 2024-12-13 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 8f2d2ccdf254..14f13c2fc09d 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-12-10 +date: 2024-12-13 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 57f44e3457aa..40035edf33af 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-12-10 +date: 2024-12-13 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 f5ccbecdde61..0fb36b2b39ed 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-12-10 +date: 2024-12-13 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 b0c26c2b6291..fda95de5f8d4 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-12-10 +date: 2024-12-13 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 dcd567834c17..bc4ac3b31b58 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-data-grid'] --- import kbnMlDataGridObj from './kbn_ml_data_grid.devdocs.json'; diff --git a/api_docs/kbn_ml_date_picker.mdx b/api_docs/kbn_ml_date_picker.mdx index aa266265b7c5..f2446df55a83 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-12-10 +date: 2024-12-13 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 060ab1293635..5db0b21d34cc 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-12-10 +date: 2024-12-13 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 f88871437f8b..67aa0b676ded 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-12-10 +date: 2024-12-13 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_field_stats_flyout.mdx b/api_docs/kbn_ml_field_stats_flyout.mdx index fb9d0ca71361..8ec0703426e3 100644 --- a/api_docs/kbn_ml_field_stats_flyout.mdx +++ b/api_docs/kbn_ml_field_stats_flyout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-field-stats-flyout title: "@kbn/ml-field-stats-flyout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-field-stats-flyout plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-field-stats-flyout'] --- import kbnMlFieldStatsFlyoutObj from './kbn_ml_field_stats_flyout.devdocs.json'; diff --git a/api_docs/kbn_ml_in_memory_table.mdx b/api_docs/kbn_ml_in_memory_table.mdx index 86aa8bae3a8e..d68047d44438 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-12-10 +date: 2024-12-13 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 69647a59e5d5..f36d5e2aaed9 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-12-10 +date: 2024-12-13 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 2ea520000e77..68698f2f8ff1 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-12-10 +date: 2024-12-13 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 ec8c6abba4bc..099ede984291 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-12-10 +date: 2024-12-13 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 eeac5337d376..42ffd5f98426 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-12-10 +date: 2024-12-13 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 72b0bd264a59..160cb655b840 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-12-10 +date: 2024-12-13 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 b213f2abdbca..af9c402b501a 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-12-10 +date: 2024-12-13 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_parse_interval.mdx b/api_docs/kbn_ml_parse_interval.mdx index 3bf9b5d5c961..8d419e085ace 100644 --- a/api_docs/kbn_ml_parse_interval.mdx +++ b/api_docs/kbn_ml_parse_interval.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-parse-interval title: "@kbn/ml-parse-interval" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-parse-interval plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-parse-interval'] --- import kbnMlParseIntervalObj from './kbn_ml_parse_interval.devdocs.json'; diff --git a/api_docs/kbn_ml_query_utils.mdx b/api_docs/kbn_ml_query_utils.mdx index 1a6066479371..6c8d077f573a 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-12-10 +date: 2024-12-13 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 f69df764055b..1923d257cb04 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-12-10 +date: 2024-12-13 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 7e6193f7913d..a26a49010cfd 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-12-10 +date: 2024-12-13 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 9cb3071903db..0accf17f6bb7 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-12-10 +date: 2024-12-13 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 75f14776987d..2b7d0467d7c4 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-12-10 +date: 2024-12-13 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 88bd28976b29..2ec4eda6ba7b 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-12-10 +date: 2024-12-13 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 601f27d5df2d..acceffa09d97 100644 --- a/api_docs/kbn_ml_trained_models_utils.devdocs.json +++ b/api_docs/kbn_ml_trained_models_utils.devdocs.json @@ -112,7 +112,7 @@ "\nModel name, e.g. elser" ], "signature": [ - "\"elser\" | \"e5\"" + "\"rerank\" | \"elser\" | \"e5\"" ], "path": "x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts", "deprecated": false, @@ -300,6 +300,22 @@ "path": "x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/ml-trained-models-utils", + "id": "def-common.ModelDefinition.techPreview", + "type": "CompoundType", + "tags": [], + "label": "techPreview", + "description": [ + "Indicates if model is in tech preview" + ], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -417,7 +433,7 @@ "label": "ElasticCuratedModelName", "description": [], "signature": [ - "\"elser\" | \"e5\"" + "\"rerank\" | \"elser\" | \"e5\"" ], "path": "x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts", "deprecated": false, diff --git a/api_docs/kbn_ml_trained_models_utils.mdx b/api_docs/kbn_ml_trained_models_utils.mdx index 5b424e788fa4..402e861c1cd0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-trained-models-utils'] --- import kbnMlTrainedModelsUtilsObj from './kbn_ml_trained_models_utils.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 | |-------------------|-----------|------------------------|-----------------| -| 47 | 0 | 41 | 1 | +| 48 | 0 | 41 | 1 | ## Common diff --git a/api_docs/kbn_ml_ui_actions.mdx b/api_docs/kbn_ml_ui_actions.mdx index 77a49b4237d1..c67411d228d6 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-12-10 +date: 2024-12-13 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 ee7e90997496..1f2d4f706a38 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-url-state'] --- import kbnMlUrlStateObj from './kbn_ml_url_state.devdocs.json'; diff --git a/api_docs/kbn_ml_validators.mdx b/api_docs/kbn_ml_validators.mdx index b6ae503df089..9acc4d95827b 100644 --- a/api_docs/kbn_ml_validators.mdx +++ b/api_docs/kbn_ml_validators.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-ml-validators title: "@kbn/ml-validators" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/ml-validators plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ml-validators'] --- import kbnMlValidatorsObj from './kbn_ml_validators.devdocs.json'; diff --git a/api_docs/kbn_mock_idp_utils.mdx b/api_docs/kbn_mock_idp_utils.mdx index aa1e3a3a44da..3818cd7d84c1 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_monaco.mdx index 89a2aa83a701..431f0c8528d8 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/monaco'] --- import kbnMonacoObj from './kbn_monaco.devdocs.json'; diff --git a/api_docs/kbn_object_versioning.mdx b/api_docs/kbn_object_versioning.mdx index 62193d39e1e3..c4b7984276d8 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning'] --- import kbnObjectVersioningObj from './kbn_object_versioning.devdocs.json'; diff --git a/api_docs/kbn_object_versioning_utils.mdx b/api_docs/kbn_object_versioning_utils.mdx index 5f48f93631b5..859bac5a4743 100644 --- a/api_docs/kbn_object_versioning_utils.mdx +++ b/api_docs/kbn_object_versioning_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-object-versioning-utils title: "@kbn/object-versioning-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/object-versioning-utils plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/object-versioning-utils'] --- import kbnObjectVersioningUtilsObj from './kbn_object_versioning_utils.devdocs.json'; diff --git a/api_docs/kbn_observability_alert_details.devdocs.json b/api_docs/kbn_observability_alert_details.devdocs.json index b1c6297dead2..7cdb8e6842f9 100644 --- a/api_docs/kbn_observability_alert_details.devdocs.json +++ b/api_docs/kbn_observability_alert_details.devdocs.json @@ -29,7 +29,7 @@ "signature": [ "({ alertStart, alertEnd, color, id }: Props) => React.JSX.Element" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_active_time_range_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -43,7 +43,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_active_time_range_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -62,7 +62,7 @@ "signature": [ "({ alertStart, color, dateFormat, id }: Props) => React.JSX.Element" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -76,7 +76,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -95,7 +95,7 @@ "signature": [ "({ threshold, color, id }: Props) => React.JSX.Element" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_threshold_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -109,7 +109,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_threshold_annotation.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -128,7 +128,7 @@ "signature": [ "({ color, id, threshold }: Props) => React.JSX.Element" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_threshold_time_range_rect.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -142,7 +142,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/observability/alert_details/src/components/alert_threshold_time_range_rect.tsx", + "path": "x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -164,7 +164,7 @@ ") => ", "UseAlertsHistory" ], - "path": "x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.ts", + "path": "x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -178,7 +178,7 @@ "signature": [ "Props" ], - "path": "x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.ts", + "path": "x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts", "deprecated": false, "trackAdoption": false, "isRequired": true diff --git a/api_docs/kbn_observability_alert_details.mdx b/api_docs/kbn_observability_alert_details.mdx index fc1c9ad0e372..079bb675ceba 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_observability_alerting_rule_utils.devdocs.json index ba4a7cbf8553..71001a122302 100644 --- a/api_docs/kbn_observability_alerting_rule_utils.devdocs.json +++ b/api_docs/kbn_observability_alerting_rule_utils.devdocs.json @@ -37,7 +37,7 @@ }, "[]) => Record" ], - "path": "x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts", + "path": "x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -58,7 +58,7 @@ }, "[]" ], - "path": "x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts", + "path": "x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -76,7 +76,7 @@ "tags": [], "label": "Group", "description": [], - "path": "x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts", + "path": "x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -87,7 +87,7 @@ "tags": [], "label": "field", "description": [], - "path": "x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts", + "path": "x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts", "deprecated": false, "trackAdoption": false }, @@ -98,7 +98,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts", + "path": "x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_observability_alerting_rule_utils.mdx b/api_docs/kbn_observability_alerting_rule_utils.mdx index 92530c3edb17..27158325579e 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_observability_alerting_test_data.devdocs.json index f2836f5247cc..94fab28a7f00 100644 --- a/api_docs/kbn_observability_alerting_test_data.devdocs.json +++ b/api_docs/kbn_observability_alerting_test_data.devdocs.json @@ -31,7 +31,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_apm_error_count_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45,7 +45,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_apm_error_count_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -66,7 +66,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -80,7 +80,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -101,7 +101,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -115,7 +115,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -130,7 +130,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -142,7 +142,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -156,7 +156,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false }, @@ -170,7 +170,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false }, @@ -184,7 +184,7 @@ "signature": [ "{ criteria: any[]; groupBy?: string[] | undefined; searchConfiguration: { query: { query?: string | undefined; }; }; } | undefined" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts", "deprecated": false, "trackAdoption": false } @@ -206,7 +206,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_data_view.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -217,7 +217,7 @@ "tags": [], "label": "{\n indexPattern,\n id,\n}", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/create_data_view.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -228,7 +228,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/create_data_view.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts", "deprecated": false, "trackAdoption": false }, @@ -239,7 +239,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/create_data_view.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts", "deprecated": false, "trackAdoption": false } @@ -261,7 +261,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_index_connector.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_index_connector.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -280,7 +280,7 @@ "AxiosResponse", ">" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -294,7 +294,7 @@ "signature": [ "any" ], - "path": "x-pack/packages/observability/alerting_test_data/src/create_rule.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -313,7 +313,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/packages/observability/alerting_test_data/src/run.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/run.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -332,7 +332,7 @@ "tags": [], "label": "scenario1", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -343,7 +343,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -354,7 +354,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false }, @@ -365,7 +365,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false }, @@ -376,7 +376,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false } @@ -389,7 +389,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -400,7 +400,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false }, @@ -411,7 +411,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false }, @@ -422,7 +422,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -446,7 +446,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false }, @@ -457,7 +457,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -468,7 +468,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -479,7 +479,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts", "deprecated": false, "trackAdoption": false } @@ -501,7 +501,7 @@ "tags": [], "label": "scenario2", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -512,7 +512,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -523,7 +523,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -534,7 +534,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -545,7 +545,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false } @@ -558,7 +558,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -569,7 +569,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -580,7 +580,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -591,7 +591,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -615,7 +615,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -629,7 +629,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -640,7 +640,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -651,7 +651,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -662,7 +662,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts", "deprecated": false, "trackAdoption": false } @@ -684,7 +684,7 @@ "tags": [], "label": "scenario3", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -695,7 +695,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -706,7 +706,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -717,7 +717,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -728,7 +728,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false } @@ -741,7 +741,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -752,7 +752,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -763,7 +763,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -774,7 +774,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -798,7 +798,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -809,7 +809,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -820,7 +820,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -831,7 +831,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts", "deprecated": false, "trackAdoption": false } @@ -853,7 +853,7 @@ "tags": [], "label": "scenario4", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -864,7 +864,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -875,7 +875,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false }, @@ -886,7 +886,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false }, @@ -897,7 +897,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false } @@ -910,7 +910,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -921,7 +921,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false }, @@ -932,7 +932,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false }, @@ -943,7 +943,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -967,7 +967,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false }, @@ -978,7 +978,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -989,7 +989,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1000,7 +1000,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts", "deprecated": false, "trackAdoption": false } @@ -1022,7 +1022,7 @@ "tags": [], "label": "scenario5", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1033,7 +1033,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1044,7 +1044,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1055,7 +1055,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1066,7 +1066,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false } @@ -1079,7 +1079,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1090,7 +1090,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1101,7 +1101,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1112,7 +1112,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1136,7 +1136,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1150,7 +1150,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false }, @@ -1161,7 +1161,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1172,7 +1172,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1183,7 +1183,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts", "deprecated": false, "trackAdoption": false } @@ -1205,7 +1205,7 @@ "tags": [], "label": "scenario6", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1216,7 +1216,7 @@ "tags": [], "label": "dataView", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1227,7 +1227,7 @@ "tags": [], "label": "indexPattern", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -1238,7 +1238,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -1249,7 +1249,7 @@ "tags": [], "label": "shouldCreate", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false } @@ -1262,7 +1262,7 @@ "tags": [], "label": "ruleParams", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1273,7 +1273,7 @@ "tags": [], "label": "consumer", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -1284,7 +1284,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -1295,7 +1295,7 @@ "tags": [], "label": "params", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1319,7 +1319,7 @@ "Aggregators", "; }[]; }[]" ], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false }, @@ -1330,7 +1330,7 @@ "tags": [], "label": "searchConfiguration", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1341,7 +1341,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1352,7 +1352,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", + "path": "x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_observability_alerting_test_data.mdx b/api_docs/kbn_observability_alerting_test_data.mdx index f8f849871e1c..a163d01f3139 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_observability_get_padded_alert_time_range_util.devdocs.json index ae2d7079bfc7..84d4a7404387 100644 --- a/api_docs/kbn_observability_get_padded_alert_time_range_util.devdocs.json +++ b/api_docs/kbn_observability_get_padded_alert_time_range_util.devdocs.json @@ -30,7 +30,7 @@ "(alertStart: string, alertEnd?: string | undefined, lookBackWindow?: { size: number; unit: \"m\" | \"s\" | \"d\" | \"h\"; } | undefined) => ", "TimeRange" ], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -44,7 +44,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -59,7 +59,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -71,7 +71,7 @@ "tags": [], "label": "lookBackWindow", "description": [], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -82,7 +82,7 @@ "tags": [], "label": "size", "description": [], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false }, @@ -96,7 +96,7 @@ "signature": [ "\"m\" | \"s\" | \"d\" | \"h\"" ], - "path": "x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", + "path": "x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts", "deprecated": false, "trackAdoption": false } 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 5c5c59993a44..932aa7383869 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-12-10 +date: 2024-12-13 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_observability_logs_overview.mdx b/api_docs/kbn_observability_logs_overview.mdx index 276476ac7430..04c1ff7a330d 100644 --- a/api_docs/kbn_observability_logs_overview.mdx +++ b/api_docs/kbn_observability_logs_overview.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-logs-overview title: "@kbn/observability-logs-overview" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-logs-overview plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-logs-overview'] --- import kbnObservabilityLogsOverviewObj from './kbn_observability_logs_overview.devdocs.json'; diff --git a/api_docs/kbn_observability_synthetics_test_data.devdocs.json b/api_docs/kbn_observability_synthetics_test_data.devdocs.json index 21c91a98e054..bd016da5427c 100644 --- a/api_docs/kbn_observability_synthetics_test_data.devdocs.json +++ b/api_docs/kbn_observability_synthetics_test_data.devdocs.json @@ -17,7 +17,345 @@ "objects": [] }, "common": { - "classes": [], + "classes": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner", + "type": "Class", + "tags": [], + "label": "SyntheticsRunner", + "description": [], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.getService", + "type": "Any", + "tags": [], + "label": "getService", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.kibanaUrl", + "type": "string", + "tags": [], + "label": "kibanaUrl", + "description": [], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.testFilesLoaded", + "type": "boolean", + "tags": [], + "label": "testFilesLoaded", + "description": [], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.params", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "ArgParams" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.Unnamed.$1", + "type": "Any", + "tags": [], + "label": "getService", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "params", + "description": [], + "signature": [ + "ArgParams" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.setup", + "type": "Function", + "tags": [], + "label": "setup", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.createTestUsers", + "type": "Function", + "tags": [], + "label": "createTestUsers", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestFiles", + "type": "Function", + "tags": [], + "label": "loadTestFiles", + "description": [], + "signature": [ + "(callback: (reload?: boolean | undefined) => Promise, reload?: boolean) => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestFiles.$1", + "type": "Function", + "tags": [], + "label": "callback", + "description": [], + "signature": [ + "(reload?: boolean | undefined) => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestFiles.$2", + "type": "boolean", + "tags": [], + "label": "reload", + "description": [], + "signature": [ + "boolean" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestData", + "type": "Function", + "tags": [], + "label": "loadTestData", + "description": [], + "signature": [ + "(e2eDir: string, dataArchives: string[]) => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestData.$1", + "type": "string", + "tags": [], + "label": "e2eDir", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.loadTestData.$2", + "type": "Array", + "tags": [], + "label": "dataArchives", + "description": [], + "signature": [ + "string[]" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.getKibanaUrl", + "type": "Function", + "tags": [], + "label": "getKibanaUrl", + "description": [], + "signature": [ + "() => string" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.getElasticsearchUrl", + "type": "Function", + "tags": [], + "label": "getElasticsearchUrl", + "description": [], + "signature": [ + "() => string" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.run", + "type": "Function", + "tags": [], + "label": "run", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.assertResults", + "type": "Function", + "tags": [], + "label": "assertResults", + "description": [], + "signature": [ + "(results: { [x: string]: ", + "JourneyResult", + "; }) => void" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.assertResults.$1", + "type": "Object", + "tags": [], + "label": "results", + "description": [], + "signature": [ + "{ [x: string]: ", + "JourneyResult", + "; }" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.SyntheticsRunner.cleanUp", + "type": "Function", + "tags": [], + "label": "cleanUp", + "description": [], + "signature": [ + "() => void" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], "functions": [ { "parentPluginId": "@kbn/observability-synthetics-test-data", @@ -29,9 +367,9 @@ "signature": [ "({ name, timestamp, monitorId, location, configId, }?: ", "DocOverrides", - ") => { summary: { up: number; down: number; final_attempt: boolean; }; monitor: { duration: { us: number; }; origin: string; ip: string; name: string; fleet_managed: boolean; check_group: string; timespan: { lt: string; gte: string | moment.Moment; }; id: string; type: string; status: \"up\" | \"down\"; }; error: { message: string; type: string; }; '@timestamp': string; config_id: string; state: { duration_ms: number; checks: number; ends: null; started_at: string; id: string; up: number; down: number; flap_history: never[]; status: string; }; url: { scheme: string; port: number; domain: string; full: string; }; ecs: { version: string; }; tcp: { rtt: { connect: { us: number; }; }; }; event: { agent_id_status: string; ingested: string; dataset: string; }; agent: { name: string; id: string; type: string; ephemeral_id: string; version: string; }; elastic_agent: { id: string; version: string; snapshot: boolean; }; data_stream: { namespace: string; type: string; dataset: string; }; resolve: { rtt: { us: number; }; ip: string; }; tls: { established: boolean; cipher: string; certificate_not_valid_before: string; server: { x509: { not_after: string; subject: { distinguished_name: string; common_name: string; }; not_before: string; public_key_algorithm: string; public_key_curve: string; signature_algorithm: string; serial_number: string; issuer: { distinguished_name: string; common_name: string; }; }; hash: { sha1: string; sha256: string; }; }; rtt: { handshake: { us: number; }; }; version: string; certificate_not_valid_after: string; version_protocol: string; }; http: { rtt: { response_header: { us: number; }; total: { us: number; }; write_request: { us: number; }; content: { us: number; }; validate: { us: number; }; }; response: { headers: { Server: string; P3p: string; Date: string; 'X-Frame-Options': string; 'Accept-Ranges': string; 'Cache-Control': string; 'X-Xss-Protection': string; 'Cross-Origin-Opener-Policy-Report-Only': string; Vary: string; Expires: string; 'Content-Type': string; }; status_code: number; mime_type: string; body: { bytes: number; hash: string; }; }; }; observer: { geo: { name: string; location: string; }; name: string; }; }" + ") => { summary: { up: number; down: number; final_attempt: boolean; }; monitor: { duration: { us: number; }; origin: string; ip: string; name: string; fleet_managed: boolean; check_group: string; timespan: { lt: string; gte: string | moment.Moment; }; id: string; type: string; status: \"up\" | \"down\"; }; error: { message: string; type: string; }; '@timestamp': string; config_id: string; state: { duration_ms: number; checks: number; ends: null; started_at: string; id: string; up: number; down: number; flap_history: never[]; status: string; }; url: { scheme: string; port: number; domain: string; full: string; }; ecs: { version: string; }; tcp: { rtt: { connect: { us: number; }; }; }; event: { agent_id_status: string; ingested: string; dataset: string; }; agent: { name: string; id: string; type: string; ephemeral_id: string; version: string; }; elastic_agent: { id: string; version: string; snapshot: boolean; }; data_stream: { namespace: string; type: string; dataset: string; }; resolve: { rtt: { us: number; }; ip: string; }; tls: { established: boolean; cipher: string; certificate_not_valid_before: string; server: { x509: { not_after: string; subject: { distinguished_name: string; common_name: string; }; not_before: string; public_key_algorithm: string; public_key_curve: string; signature_algorithm: string; serial_number: string; issuer: { distinguished_name: string; common_name: string; }; }; hash: { sha1: string; sha256: string; }; }; rtt: { handshake: { us: number; }; }; version: string; certificate_not_valid_after: string; version_protocol: string; }; http: { rtt: { response_header: { us: number; }; total: { us: number; }; write_request: { us: number; }; content: { us: number; }; validate: { us: number; }; }; response: { headers: { Server: string; P3p: string; Date: string; 'X-Frame-Options': string; 'Accept-Ranges': string; 'Cache-Control': string; 'X-Xss-Protection': string; 'Cross-Origin-Opener-Policy-Report-Only': string; Vary: string; Expires: string; 'Content-Type': string; }; status_code: number; mime_type: string; body: { bytes: number; hash: string; }; }; }; meta: { space_id: string; }; observer: { geo: { name: string; location: string; }; name: string; }; }" ], - "path": "x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts", + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45,7 +383,7 @@ "signature": [ "DocOverrides" ], - "path": "x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts", + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -64,9 +402,9 @@ "signature": [ "({ name, timestamp, monitorId, configId, testRunId, location, }?: ", "DocOverrides", - ") => { test_run_id?: string | undefined; summary: { up: number; down: number; final_attempt: boolean; }; monitor: { duration: { us: number; }; origin: string; ip: string; name: string; fleet_managed: boolean; check_group: string; timespan: { lt: string; gte: string | moment.Moment; }; id: string; type: string; status: \"up\" | \"down\"; }; '@timestamp': string; config_id: string; state: { duration_ms: number; checks: number; ends: null; started_at: string; up: number; id: string; down: number; flap_history: never[]; status: string; }; url: { scheme: string; port: number; domain: string; full: string; }; ecs: { version: string; }; tcp: { rtt: { connect: { us: number; }; }; }; event: { agent_id_status: string; ingested: string; dataset: string; }; agent: { name: string; id: string; type: string; ephemeral_id: string; version: string; }; elastic_agent: { id: string; version: string; snapshot: boolean; }; data_stream: { namespace: string; type: string; dataset: string; }; resolve: { rtt: { us: number; }; ip: string; }; tls: { established: boolean; cipher: string; certificate_not_valid_before: string; server: { x509: { not_after: string; subject: { distinguished_name: string; common_name: string; }; not_before: string; public_key_algorithm: string; public_key_curve: string; signature_algorithm: string; serial_number: string; issuer: { distinguished_name: string; common_name: string; }; }; hash: { sha1: string; sha256: string; }; }; rtt: { handshake: { us: number; }; }; version: string; certificate_not_valid_after: string; version_protocol: string; }; http: { rtt: { response_header: { us: number; }; total: { us: number; }; write_request: { us: number; }; content: { us: number; }; validate: { us: number; }; }; response: { headers: { Server: string; P3p: string; Date: string; 'X-Frame-Options': string; 'Accept-Ranges': string; 'Cache-Control': string; 'X-Xss-Protection': string; 'Cross-Origin-Opener-Policy-Report-Only': string; Vary: string; Expires: string; 'Content-Type': string; }; status_code: number; mime_type: string; body: { bytes: number; hash: string; }; }; }; observer: { geo: { name: string; location: string; }; name: string; }; }" + ") => { test_run_id?: string | undefined; summary: { up: number; down: number; final_attempt: boolean; }; monitor: { duration: { us: number; }; origin: string; ip: string; name: string; fleet_managed: boolean; check_group: string; timespan: { lt: string; gte: string | moment.Moment; }; id: string; type: string; status: \"up\" | \"down\"; }; '@timestamp': string; config_id: string; state: { duration_ms: number; checks: number; ends: null; started_at: string; up: number; id: string; down: number; flap_history: never[]; status: string; }; url: { scheme: string; port: number; domain: string; full: string; }; ecs: { version: string; }; tcp: { rtt: { connect: { us: number; }; }; }; event: { agent_id_status: string; ingested: string; dataset: string; }; agent: { name: string; id: string; type: string; ephemeral_id: string; version: string; }; elastic_agent: { id: string; version: string; snapshot: boolean; }; data_stream: { namespace: string; type: string; dataset: string; }; resolve: { rtt: { us: number; }; ip: string; }; tls: { established: boolean; cipher: string; certificate_not_valid_before: string; server: { x509: { not_after: string; subject: { distinguished_name: string; common_name: string; }; not_before: string; public_key_algorithm: string; public_key_curve: string; signature_algorithm: string; serial_number: string; issuer: { distinguished_name: string; common_name: string; }; }; hash: { sha1: string; sha256: string; }; }; rtt: { handshake: { us: number; }; }; version: string; certificate_not_valid_after: string; version_protocol: string; }; http: { rtt: { response_header: { us: number; }; total: { us: number; }; write_request: { us: number; }; content: { us: number; }; validate: { us: number; }; }; response: { headers: { Server: string; P3p: string; Date: string; 'X-Frame-Options': string; 'Accept-Ranges': string; 'Cache-Control': string; 'X-Xss-Protection': string; 'Cross-Origin-Opener-Policy-Report-Only': string; Vary: string; Expires: string; 'Content-Type': string; }; status_code: number; mime_type: string; body: { bytes: number; hash: string; }; }; }; meta: { space_id: string; }; observer: { geo: { name: string; location: string; }; name: string; }; }" ], - "path": "x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts", + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -80,7 +418,74 @@ "signature": [ "DocOverrides" ], - "path": "x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts", + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.readKibanaConfig", + "type": "Function", + "tags": [], + "label": "readKibanaConfig", + "description": [], + "signature": [ + "() => Record" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/read_kibana_config.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.recordVideo", + "type": "Function", + "tags": [], + "label": "recordVideo", + "description": [], + "signature": [ + "(page: ", + "Page", + ", postfix?: string) => void" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/record_video.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.recordVideo.$1", + "type": "Object", + "tags": [], + "label": "page", + "description": [], + "signature": [ + "Page" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/record_video.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.recordVideo.$2", + "type": "string", + "tags": [], + "label": "postfix", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/record_video.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -93,6 +498,22 @@ "interfaces": [], "enums": [], "misc": [], - "objects": [] + "objects": [ + { + "parentPluginId": "@kbn/observability-synthetics-test-data", + "id": "def-common.argv", + "type": "Object", + "tags": [], + "label": "argv", + "description": [], + "signature": [ + "{ [x: string]: unknown; headless: boolean; bail: boolean; grep: undefined; _: string[]; $0: string; }" + ], + "path": "x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/parse_args_params.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ] } } \ No newline at end of file diff --git a/api_docs/kbn_observability_synthetics_test_data.mdx b/api_docs/kbn_observability_synthetics_test_data.mdx index fe1ff61f417f..ff4817a0838f 100644 --- a/api_docs/kbn_observability_synthetics_test_data.mdx +++ b/api_docs/kbn_observability_synthetics_test_data.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-observability-synthetics-test-data title: "@kbn/observability-synthetics-test-data" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/observability-synthetics-test-data plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/observability-synthetics-test-data'] --- import kbnObservabilitySyntheticsTestDataObj from './kbn_observability_synthetics_test_data.devdocs.json'; @@ -21,10 +21,16 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 4 | 1 | +| 31 | 2 | 31 | 2 | ## Common +### Objects + + ### Functions +### Classes + + diff --git a/api_docs/kbn_openapi_bundler.mdx b/api_docs/kbn_openapi_bundler.mdx index 03890b35301f..ecf7890f636b 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-12-10 +date: 2024-12-13 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 8a7c6d88ea4d..9ae2d2ebe876 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-12-10 +date: 2024-12-13 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 175d8c0e1b5f..2f54382e7225 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-12-10 +date: 2024-12-13 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 9807ae3e162c..d3647cbe8679 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_osquery_io_ts_types.devdocs.json index 4fd8870da6ea..c63d3feefe73 100644 --- a/api_docs/kbn_osquery_io_ts_types.devdocs.json +++ b/api_docs/kbn_osquery_io_ts_types.devdocs.json @@ -32,7 +32,7 @@ "signature": [ "{ agents: string[]; allAgentsSelected: boolean; platformsSelected: string[]; policiesSelected: string[]; }" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -47,7 +47,7 @@ "signature": [ "{ agents: string[]; allAgentsSelected: boolean; platformsSelected: string[]; policiesSelected: string[]; } | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -62,7 +62,7 @@ "signature": [ "{ id: string; query: string; ecs_mapping: { [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined; version: string | undefined; platform: string | undefined; removed: boolean | undefined; snapshot: boolean | undefined; }[]" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -77,7 +77,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -92,7 +92,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -107,7 +107,7 @@ "signature": [ "{ [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; }" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -122,7 +122,7 @@ "signature": [ "{ [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -137,7 +137,7 @@ "signature": [ "{ name: string | undefined; url: string | undefined; }" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -152,7 +152,7 @@ "signature": [ "{ name: string | undefined; url: string | undefined; } | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -167,7 +167,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -182,7 +182,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -197,7 +197,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -212,7 +212,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -227,7 +227,7 @@ "signature": [ "{ [x: string]: { query: string; id: string; ecs_mapping: { [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined; version: string | undefined; platform: string | undefined; saved_query_id: string | undefined; removed: boolean | undefined; snapshot: boolean | undefined; }; }" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -242,7 +242,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -257,7 +257,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -272,7 +272,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -287,7 +287,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -302,7 +302,7 @@ "signature": [ "{ id: string; query: string; ecs_mapping: { [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined; version: string | undefined; platform: string | undefined; removed: boolean | undefined; snapshot: boolean | undefined; }[] | { [x: string]: { query: string; id: string; ecs_mapping: { [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined; version: string | undefined; platform: string | undefined; saved_query_id: string | undefined; removed: boolean | undefined; snapshot: boolean | undefined; }; }" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -317,7 +317,7 @@ "signature": [ "{ id: string; query: string; ecs_mapping: { [x: string]: { field?: string | undefined; value?: string | string[] | undefined; }; } | undefined; version: string | undefined; platform: string | undefined; removed: boolean | undefined; snapshot: boolean | undefined; }[] | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -332,7 +332,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -347,7 +347,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -362,7 +362,7 @@ "signature": [ "boolean" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -377,7 +377,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -392,7 +392,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -407,7 +407,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -422,7 +422,7 @@ "signature": [ "boolean" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -437,7 +437,7 @@ "signature": [ "boolean | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -452,7 +452,7 @@ "signature": [ "string[] | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -467,7 +467,7 @@ "signature": [ "number" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -482,7 +482,7 @@ "signature": [ "number | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -497,7 +497,7 @@ "signature": [ "string" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -512,7 +512,7 @@ "signature": [ "string | undefined" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -544,7 +544,7 @@ "StringC", ">; }>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -578,7 +578,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -644,7 +644,7 @@ "UndefinedC", "]>; }>>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -659,7 +659,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -679,7 +679,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -709,7 +709,7 @@ "StringC", ">]>; }>>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -743,7 +743,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -771,7 +771,7 @@ "UndefinedC", "]>; }>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -803,7 +803,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -818,7 +818,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -838,7 +838,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -853,7 +853,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -873,7 +873,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -947,7 +947,7 @@ "UndefinedC", "]>; }>>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -962,7 +962,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -982,7 +982,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -997,7 +997,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1017,7 +1017,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1145,7 +1145,7 @@ "UndefinedC", "]>; }>>]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1215,7 +1215,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1230,7 +1230,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1250,7 +1250,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1265,7 +1265,7 @@ "signature": [ "BooleanC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1285,7 +1285,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1300,7 +1300,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1320,7 +1320,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1335,7 +1335,7 @@ "signature": [ "BooleanC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1355,7 +1355,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1377,7 +1377,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1393,7 +1393,7 @@ "Type", "" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1413,7 +1413,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1428,7 +1428,7 @@ "signature": [ "StringC" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1448,7 +1448,7 @@ "UndefinedC", "]>" ], - "path": "packages/kbn-osquery-io-ts-types/src/live_query/index.ts", + "path": "src/platform/packages/shared/kbn-osquery-io-ts-types/src/live_query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_osquery_io_ts_types.mdx b/api_docs/kbn_osquery_io_ts_types.mdx index 736ca4874ace..7439c2234fc3 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-12-10 +date: 2024-12-13 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_palettes.devdocs.json b/api_docs/kbn_palettes.devdocs.json new file mode 100644 index 000000000000..0f5ba9d2d0b2 --- /dev/null +++ b/api_docs/kbn_palettes.devdocs.json @@ -0,0 +1,796 @@ +{ + "id": "@kbn/palettes", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes", + "type": "Class", + "tags": [], + "label": "KbnPalettes", + "description": [], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.palettes", + "type": "Object", + "tags": [], + "label": "#palettes", + "description": [], + "signature": [ + "Map" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.aliasMappings", + "type": "Object", + "tags": [], + "label": "#aliasMappings", + "description": [], + "signature": [ + "Map" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.defaultPalette", + "type": "Object", + "tags": [], + "label": "#defaultPalette", + "description": [], + "signature": [ + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + } + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.Unnamed.$1", + "type": "Array", + "tags": [], + "label": "palettes", + "description": [], + "signature": [ + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + }, + "[]" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.Unnamed.$2", + "type": "Object", + "tags": [], + "label": "defaultPalette", + "description": [], + "signature": [ + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + } + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.query", + "type": "Function", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "(id: string) => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + }, + " | undefined" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.query.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(id: string) => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + } + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.get.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalettes.getAll", + "type": "Function", + "tags": [], + "label": "getAll", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.IKbnPalette", + "text": "IKbnPalette" + }, + "[]" + ], + "path": "packages/kbn-palettes/classes/palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "functions": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.getKbnPalettes", + "type": "Function", + "tags": [], + "label": "getKbnPalettes", + "description": [], + "signature": [ + "({ name, darkMode }: ", + { + "pluginId": "@kbn/core-theme-browser", + "scope": "public", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-public.CoreTheme", + "text": "CoreTheme" + }, + ") => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } + ], + "path": "packages/kbn-palettes/palettes/get_kbn_palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.getKbnPalettes.$1", + "type": "Object", + "tags": [], + "label": "{ name, darkMode }", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-theme-browser", + "scope": "public", + "docId": "kibKbnCoreThemeBrowserPluginApi", + "section": "def-public.CoreTheme", + "text": "CoreTheme" + } + ], + "path": "packages/kbn-palettes/palettes/get_kbn_palettes.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.getPalettes", + "type": "Function", + "tags": [], + "label": "getPalettes", + "description": [], + "signature": [ + "(darkMode: boolean) => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } + ], + "path": "packages/kbn-palettes/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.getPalettes.$1", + "type": "boolean", + "tags": [], + "label": "darkMode", + "description": [], + "signature": [ + "boolean" + ], + "path": "packages/kbn-palettes/palettes/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.useKbnPalettes", + "type": "Function", + "tags": [], + "label": "useKbnPalettes", + "description": [], + "signature": [ + "() => ", + { + "pluginId": "@kbn/palettes", + "scope": "common", + "docId": "kibKbnPalettesPluginApi", + "section": "def-common.KbnPalettes", + "text": "KbnPalettes" + } + ], + "path": "packages/kbn-palettes/hooks/use_kbn_palettes.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette", + "type": "Interface", + "tags": [], + "label": "IKbnPalette", + "description": [ + "\nCommon palette definition used throughout kibana" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [ + "\nUnique identifier for the palette" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [ + "\nDisplay name of this palette." + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.type", + "type": "CompoundType", + "tags": [], + "label": "type", + "description": [ + "\nType of pallette" + ], + "signature": [ + "\"gradient\" | \"categorical\"" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.colorCount", + "type": "number", + "tags": [], + "label": "colorCount", + "description": [ + "\nNumber of colors to display" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.legacy", + "type": "boolean", + "tags": [], + "label": "legacy", + "description": [ + "\nPalette belongs to an outdated theme set" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.aliases", + "type": "Array", + "tags": [], + "label": "aliases", + "description": [ + "\nAlternate aliases/ids this palette matches" + ], + "signature": [ + "string[]" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.standalone", + "type": "CompoundType", + "tags": [], + "label": "standalone", + "description": [ + "\nExcluded from `getAll` but can still query for palette with `get`/`query`\n\nAn example would be `KbnPalette.Neutral` palette. I want to exclude it from the list of all available palettes, but I still want to `get`/`query` the palette." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.colors", + "type": "Function", + "tags": [], + "label": "colors", + "description": [ + "\nReturns array of colors, optionally provide desired number of colors (`n`)" + ], + "signature": [ + "(n?: number | undefined) => string[]" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.colors.$1", + "type": "number", + "tags": [], + "label": "n", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [ + "\nReturns color provided index and optional total number of colors" + ], + "signature": [ + "(colorIndex: number, numberOfColors?: number | undefined) => string" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.getColor.$1", + "type": "number", + "tags": [], + "label": "colorIndex", + "description": [], + "signature": [ + "number" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.IKbnPalette.getColor.$2", + "type": "number", + "tags": [], + "label": "numberOfColors", + "description": [], + "signature": [ + "number | undefined" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], + "enums": [], + "misc": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.DEFAULT_FALLBACK_PALETTE", + "type": "string", + "tags": [], + "label": "DEFAULT_FALLBACK_PALETTE", + "description": [], + "signature": [ + "\"default\"" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPaletteType", + "type": "Type", + "tags": [], + "label": "KbnPaletteType", + "description": [], + "signature": [ + "\"gradient\" | \"categorical\"" + ], + "path": "packages/kbn-palettes/classes/types.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + } + ], + "objects": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.elasticPalette", + "type": "Object", + "tags": [], + "label": "elasticPalette", + "description": [ + "\nThis is not correctly returning the updated vis colors from eui.\nAll gradient function work correctly." + ], + "signature": [ + "KbnColorFnPalette" + ], + "path": "packages/kbn-palettes/palettes/categorical/elastic.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalette", + "type": "Object", + "tags": [], + "label": "KbnPalette", + "description": [ + "\nEnum of all kbn palette ids, including by type" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalette.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [ + "// Categorical palettes" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalette.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [ + "// Gradient palettes" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalette.Unnamed", + "type": "Any", + "tags": [], + "label": "Unnamed", + "description": [ + "// Semantic palettes" + ], + "signature": [ + "any" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.KbnPalette.Amsterdam", + "type": "string", + "tags": [], + "label": "Amsterdam", + "description": [ + "// ---- Deprecated palettes ----\n/**\n * Amsterdam theme\n * @deprecated use `KbnPalette.kibana7`\n */" + ], + "signature": [ + "\"eui_amsterdam_color_blind\"" + ], + "path": "packages/kbn-palettes/constants.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette", + "type": "Object", + "tags": [], + "label": "logLevelPalette", + "description": [ + "\nDefines a palette to be used directly and does not fully implement IKbnPalette" + ], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette.id", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "\"log_level\"" + ], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette.getColor", + "type": "Function", + "tags": [], + "label": "getColor", + "description": [], + "signature": [ + "(key: \"Error\" | \"Other\" | \"Debug\" | \"Info\" | \"Notice\" | \"Alert\" | \"Emerg\" | \"Crit\" | \"Warn\") => string" + ], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette.getColor.$1", + "type": "CompoundType", + "tags": [], + "label": "key", + "description": [], + "signature": [ + "\"Error\" | \"Other\" | \"Debug\" | \"Info\" | \"Notice\" | \"Alert\" | \"Emerg\" | \"Crit\" | \"Warn\"" + ], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "@kbn/palettes", + "id": "def-common.logLevelPalette.colors", + "type": "Object", + "tags": [], + "label": "colors", + "description": [], + "signature": [ + "{ Emerg: string; Alert: string; Crit: string; Error: string; Warn: string; Notice: string; Info: string; Debug: string; Other: string; }" + ], + "path": "packages/kbn-palettes/palettes/semantic/log_level.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ] + } +} \ No newline at end of file diff --git a/api_docs/kbn_palettes.mdx b/api_docs/kbn_palettes.mdx new file mode 100644 index 000000000000..eb083b164c32 --- /dev/null +++ b/api_docs/kbn_palettes.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: kibKbnPalettesPluginApi +slug: /kibana-dev-docs/api/kbn-palettes +title: "@kbn/palettes" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/palettes plugin +date: 2024-12-13 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/palettes'] +--- +import kbnPalettesObj from './kbn_palettes.devdocs.json'; + + + +Contact [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 44 | 3 | 27 | 1 | + +## Common + +### Objects + + +### Functions + + +### Classes + + +### Interfaces + + +### Consts, variables and types + + diff --git a/api_docs/kbn_panel_loader.mdx b/api_docs/kbn_panel_loader.mdx index 6cbe5e72b18c..059ea10772e3 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-12-10 +date: 2024-12-13 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 5d30afaad94f..37be5f188909 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-12-10 +date: 2024-12-13 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 61775fada02f..6f7a87d18c97 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-12-10 +date: 2024-12-13 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 8b9db012aca7..34037cd1fc45 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-12-10 +date: 2024-12-13 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 ae741374afa7..fa17c3a52bea 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-12-10 +date: 2024-12-13 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 3fa2ed6691aa..305426d8d15c 100644 --- a/api_docs/kbn_presentation_containers.devdocs.json +++ b/api_docs/kbn_presentation_containers.devdocs.json @@ -1246,14 +1246,6 @@ ], "signature": [ "() => ", - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.MaybePromise", - "text": "MaybePromise" - }, - "<", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -1261,7 +1253,7 @@ "section": "def-public.SerializedPanelState", "text": "SerializedPanelState" }, - ">" + "" ], "path": "packages/presentation/presentation_containers/interfaces/serialized_state.ts", "deprecated": false, @@ -1914,7 +1906,9 @@ "section": "def-public.OverlayRef", "text": "OverlayRef" }, - ", options?: TracksOverlaysOptions | undefined) => void" + ", options?: ", + "TracksOverlaysOptions", + " | undefined) => void" ], "path": "packages/presentation/presentation_containers/interfaces/tracks_overlays.ts", "deprecated": false, @@ -1949,7 +1943,8 @@ "label": "options", "description": [], "signature": [ - "TracksOverlaysOptions | undefined" + "TracksOverlaysOptions", + " | undefined" ], "path": "packages/presentation/presentation_containers/interfaces/tracks_overlays.ts", "deprecated": false, @@ -1977,73 +1972,6 @@ } ], "initialIsOpen": false - }, - { - "parentPluginId": "@kbn/presentation-containers", - "id": "def-public.TracksQueryPerformance", - "type": "Interface", - "tags": [], - "label": "TracksQueryPerformance", - "description": [], - "path": "packages/presentation/presentation_containers/interfaces/performance_trackers.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/presentation-containers", - "id": "def-public.TracksQueryPerformance.firstLoad", - "type": "boolean", - "tags": [], - "label": "firstLoad", - "description": [], - "path": "packages/presentation/presentation_containers/interfaces/performance_trackers.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/presentation-containers", - "id": "def-public.TracksQueryPerformance.creationStartTime", - "type": "number", - "tags": [], - "label": "creationStartTime", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "packages/presentation/presentation_containers/interfaces/performance_trackers.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/presentation-containers", - "id": "def-public.TracksQueryPerformance.creationEndTime", - "type": "number", - "tags": [], - "label": "creationEndTime", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "packages/presentation/presentation_containers/interfaces/performance_trackers.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/presentation-containers", - "id": "def-public.TracksQueryPerformance.lastLoadStartTime", - "type": "number", - "tags": [], - "label": "lastLoadStartTime", - "description": [], - "signature": [ - "number | undefined" - ], - "path": "packages/presentation/presentation_containers/interfaces/performance_trackers.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false } ], "enums": [], diff --git a/api_docs/kbn_presentation_containers.mdx b/api_docs/kbn_presentation_containers.mdx index 2219051de19e..2f6111733b7e 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-containers'] --- import kbnPresentationContainersObj from './kbn_presentation_containers.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 | |-------------------|-----------|------------------------|-----------------| -| 92 | 0 | 80 | 0 | +| 87 | 0 | 75 | 1 | ## Client diff --git a/api_docs/kbn_presentation_publishing.devdocs.json b/api_docs/kbn_presentation_publishing.devdocs.json index ab054f8e4ee1..c706f1179f60 100644 --- a/api_docs/kbn_presentation_publishing.devdocs.json +++ b/api_docs/kbn_presentation_publishing.devdocs.json @@ -930,6 +930,46 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-public.apiPublishesReload", + "type": "Function", + "tags": [], + "label": "apiPublishesReload", + "description": [], + "signature": [ + "(unknownApi: unknown) => unknownApi is ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishesReload", + "text": "PublishesReload" + } + ], + "path": "packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-public.apiPublishesReload.$1", + "type": "Unknown", + "tags": [], + "label": "unknownApi", + "description": [], + "signature": [ + "unknown" + ], + "path": "packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/presentation-publishing", "id": "def-public.apiPublishesRendered", @@ -6124,6 +6164,180 @@ ], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-public.PublishesReload", + "type": "Interface", + "tags": [], + "label": "PublishesReload", + "description": [], + "path": "packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/presentation-publishing", + "id": "def-public.PublishesReload.reload$", + "type": "Object", + "tags": [], + "label": "reload$", + "description": [], + "signature": [ + "{ source: ", + "Observable", + " | undefined; forEach: { (next: (value: void) => void): Promise; (next: (value: void) => void, promiseCtor: PromiseConstructorLike): Promise; }; pipe: { (): ", + "Observable", + "; (op1: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + ", op6: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + ", op6: ", + "OperatorFunction", + ", op7: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + ", op6: ", + "OperatorFunction", + ", op7: ", + "OperatorFunction", + ", op8: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + ", op6: ", + "OperatorFunction", + ", op7: ", + "OperatorFunction", + ", op8: ", + "OperatorFunction", + ", op9: ", + "OperatorFunction", + "): ", + "Observable", + "; (op1: ", + "OperatorFunction", + ", op2: ", + "OperatorFunction", + ", op3: ", + "OperatorFunction", + ", op4: ", + "OperatorFunction", + ", op5: ", + "OperatorFunction", + ", op6: ", + "OperatorFunction", + ", op7: ", + "OperatorFunction", + ", op8: ", + "OperatorFunction", + ", op9: ", + "OperatorFunction", + ", ...operations: ", + "OperatorFunction", + "[]): ", + "Observable", + "; }; operator: ", + "Operator", + " | undefined; lift: (operator?: ", + "Operator", + " | undefined) => ", + "Observable", + "; subscribe: { (observerOrNext?: Partial<", + "Observer", + "> | ((value: void) => void) | undefined): ", + "Subscription", + "; (next?: ((value: void) => void) | null | undefined, error?: ((error: any) => void) | null | undefined, complete?: (() => void) | null | undefined): ", + "Subscription", + "; }; toPromise: { (): Promise; (PromiseCtor: PromiseConstructor): Promise; (PromiseCtor: PromiseConstructorLike): Promise; }; }" + ], + "path": "packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/presentation-publishing", "id": "def-public.PublishesRendered", diff --git a/api_docs/kbn_presentation_publishing.mdx b/api_docs/kbn_presentation_publishing.mdx index 57156f455fc4..879faab15329 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/presentation-publishing'] --- import kbnPresentationPublishingObj from './kbn_presentation_publishing.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 | |-------------------|-----------|------------------------|-----------------| -| 229 | 0 | 193 | 6 | +| 233 | 0 | 197 | 6 | ## Client diff --git a/api_docs/kbn_product_doc_artifact_builder.mdx b/api_docs/kbn_product_doc_artifact_builder.mdx index 2a27a3eb5c83..f92c1ab17402 100644 --- a/api_docs/kbn_product_doc_artifact_builder.mdx +++ b/api_docs/kbn_product_doc_artifact_builder.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-product-doc-artifact-builder title: "@kbn/product-doc-artifact-builder" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/product-doc-artifact-builder plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/product-doc-artifact-builder'] --- import kbnProductDocArtifactBuilderObj from './kbn_product_doc_artifact_builder.devdocs.json'; diff --git a/api_docs/kbn_product_doc_common.devdocs.json b/api_docs/kbn_product_doc_common.devdocs.json index f5c8ea4e0e65..33547649b923 100644 --- a/api_docs/kbn_product_doc_common.devdocs.json +++ b/api_docs/kbn_product_doc_common.devdocs.json @@ -29,7 +29,7 @@ "signature": [ "({ productName, productVersion, excludeExtension, }: { productName: \"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"; productVersion: string; excludeExtension?: boolean | undefined; }) => string" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -40,7 +40,7 @@ "tags": [], "label": "{\n productName,\n productVersion,\n excludeExtension = false,\n}", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -54,7 +54,7 @@ "signature": [ "\"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false }, @@ -65,7 +65,7 @@ "tags": [], "label": "productVersion", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false }, @@ -79,7 +79,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false } @@ -99,7 +99,7 @@ "signature": [ "(productName: \"security\" | \"kibana\" | \"observability\" | \"elasticsearch\") => string" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/indices.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/indices.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -113,7 +113,7 @@ "signature": [ "\"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/indices.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/indices.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -132,7 +132,7 @@ "signature": [ "(path: string) => boolean" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact_content.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact_content.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -146,7 +146,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact_content.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact_content.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -165,7 +165,7 @@ "signature": [ "(artifactName: string) => { productName: \"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"; productVersion: string; } | undefined" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -179,7 +179,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/artifact.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/artifact.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -197,7 +197,7 @@ "tags": [], "label": "ArtifactManifest", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/manifest.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/manifest.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -208,7 +208,7 @@ "tags": [], "label": "formatVersion", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/manifest.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/manifest.ts", "deprecated": false, "trackAdoption": false }, @@ -222,7 +222,7 @@ "signature": [ "\"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/manifest.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/manifest.ts", "deprecated": false, "trackAdoption": false }, @@ -233,7 +233,7 @@ "tags": [], "label": "productVersion", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/manifest.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/manifest.ts", "deprecated": false, "trackAdoption": false } @@ -247,7 +247,7 @@ "tags": [], "label": "ProductDocumentationAttributes", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -258,7 +258,7 @@ "tags": [], "label": "content_title", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -272,7 +272,7 @@ "signature": [ "SemanticTextField" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -286,7 +286,7 @@ "signature": [ "\"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -297,7 +297,7 @@ "tags": [], "label": "root_type", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -308,7 +308,7 @@ "tags": [], "label": "slug", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -319,7 +319,7 @@ "tags": [], "label": "url", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -330,7 +330,7 @@ "tags": [], "label": "version", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -341,7 +341,7 @@ "tags": [], "label": "ai_subtitle", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -355,7 +355,7 @@ "signature": [ "SemanticTextField" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -369,7 +369,7 @@ "signature": [ "SemanticTextArrayField" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false }, @@ -383,7 +383,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/documents.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/documents.ts", "deprecated": false, "trackAdoption": false } @@ -399,7 +399,7 @@ "tags": [], "label": "DocumentationProduct", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/product.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/product.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -413,7 +413,7 @@ "tags": [], "label": "productDocIndexPattern", "description": [], - "path": "x-pack/packages/ai-infra/product-doc-common/src/indices.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/indices.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -428,7 +428,7 @@ "signature": [ "\".kibana_ai_product_doc\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/indices.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/indices.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -443,7 +443,7 @@ "signature": [ "\"security\" | \"kibana\" | \"observability\" | \"elasticsearch\"" ], - "path": "x-pack/packages/ai-infra/product-doc-common/src/product.ts", + "path": "x-pack/platform/packages/shared/ai-infra/product-doc-common/src/product.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_product_doc_common.mdx b/api_docs/kbn_product_doc_common.mdx index fa1ddf25aeb2..71043ed59269 100644 --- a/api_docs/kbn_product_doc_common.mdx +++ b/api_docs/kbn_product_doc_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-product-doc-common title: "@kbn/product-doc-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/product-doc-common plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/product-doc-common'] --- import kbnProductDocCommonObj from './kbn_product_doc_common.devdocs.json'; diff --git a/api_docs/kbn_profiling_utils.mdx b/api_docs/kbn_profiling_utils.mdx index 16f9e36a856f..b92959f8321b 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-12-10 +date: 2024-12-13 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 6fd0b3d1727b..f17775e52bc2 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-12-10 +date: 2024-12-13 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 acde3d9b4c4d..6e1bac7a5b47 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-12-10 +date: 2024-12-13 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 7a13604cc9a0..a0322a8cfd81 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_react_kibana_context_common.devdocs.json index 0f29deb8b761..379585633026 100644 --- a/api_docs/kbn_react_kibana_context_common.devdocs.json +++ b/api_docs/kbn_react_kibana_context_common.devdocs.json @@ -225,6 +225,30 @@ "path": "packages/react/kibana_context/common/types.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/react-kibana-context-common", + "id": "def-common.ThemeServiceStart.getTheme", + "type": "Function", + "tags": [], + "label": "getTheme", + "description": [], + "signature": [ + "(() => ", + { + "pluginId": "@kbn/react-kibana-context-common", + "scope": "common", + "docId": "kibKbnReactKibanaContextCommonPluginApi", + "section": "def-common.KibanaTheme", + "text": "KibanaTheme" + }, + ") | undefined" + ], + "path": "packages/react/kibana_context/common/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] } ], "initialIsOpen": false diff --git a/api_docs/kbn_react_kibana_context_common.mdx b/api_docs/kbn_react_kibana_context_common.mdx index e4478b802c0c..84f135b608be 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-common'] --- import kbnReactKibanaContextCommonObj from './kbn_react_kibana_context_common.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 | |-------------------|-----------|------------------------|-----------------| -| 15 | 0 | 8 | 0 | +| 16 | 0 | 9 | 0 | ## Common diff --git a/api_docs/kbn_react_kibana_context_render.mdx b/api_docs/kbn_react_kibana_context_render.mdx index de6526007e27..edec5c3e804c 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_react_kibana_context_root.devdocs.json index 074a223560fa..3aef4a4374ca 100644 --- a/api_docs/kbn_react_kibana_context_root.devdocs.json +++ b/api_docs/kbn_react_kibana_context_root.devdocs.json @@ -29,7 +29,7 @@ "\nPrepares and returns a configured `EuiProvider` for use in Kibana roots. In most cases, this utility context\nshould not be used. Instead, refer to `KibanaRootContextProvider` to set up the root of Kibana." ], "signature": [ - "({ theme: { theme$ }, globalStyles: globalStylesProp, colorMode: colorModeProp, modify, children, }: React.PropsWithChildren<", + "({ theme, globalStyles: globalStylesProp, colorMode: colorModeProp, modify, children, }: React.PropsWithChildren<", { "pluginId": "@kbn/react-kibana-context-root", "scope": "common", @@ -48,7 +48,7 @@ "id": "def-common.KibanaEuiProvider.$1", "type": "CompoundType", "tags": [], - "label": "{\n theme: { theme$ },\n globalStyles: globalStylesProp,\n colorMode: colorModeProp,\n modify,\n children,\n}", + "label": "{\n theme,\n globalStyles: globalStylesProp,\n colorMode: colorModeProp,\n modify,\n children,\n}", "description": [], "signature": [ "React.PropsWithChildren<", diff --git a/api_docs/kbn_react_kibana_context_root.mdx b/api_docs/kbn_react_kibana_context_root.mdx index 5ae581983f57..bcd7262a3245 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-12-10 +date: 2024-12-13 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 040b05718f8c..dc7780368e2b 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-12-10 +date: 2024-12-13 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 a10eb5ae7ca0..7059a9109bf2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-context-theme'] --- import kbnReactKibanaContextThemeObj from './kbn_react_kibana_context_theme.devdocs.json'; diff --git a/api_docs/kbn_react_kibana_mount.mdx b/api_docs/kbn_react_kibana_mount.mdx index 1b2af6522c1c..8aac86e18bc3 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-kibana-mount'] --- import kbnReactKibanaMountObj from './kbn_react_kibana_mount.devdocs.json'; diff --git a/api_docs/kbn_react_mute_legacy_root_warning.mdx b/api_docs/kbn_react_mute_legacy_root_warning.mdx index a0b6111a5b56..3d8c74455153 100644 --- a/api_docs/kbn_react_mute_legacy_root_warning.mdx +++ b/api_docs/kbn_react_mute_legacy_root_warning.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-react-mute-legacy-root-warning title: "@kbn/react-mute-legacy-root-warning" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/react-mute-legacy-root-warning plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/react-mute-legacy-root-warning'] --- import kbnReactMuteLegacyRootWarningObj from './kbn_react_mute_legacy_root_warning.devdocs.json'; diff --git a/api_docs/kbn_recently_accessed.mdx b/api_docs/kbn_recently_accessed.mdx index 1c7322e52464..0df977475bf7 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/recently-accessed'] --- import kbnRecentlyAccessedObj from './kbn_recently_accessed.devdocs.json'; diff --git a/api_docs/kbn_relocate.devdocs.json b/api_docs/kbn_relocate.devdocs.json new file mode 100644 index 000000000000..ba9cd4ccc1f1 --- /dev/null +++ b/api_docs/kbn_relocate.devdocs.json @@ -0,0 +1,47 @@ +{ + "id": "@kbn/relocate", + "client": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "server": { + "classes": [], + "functions": [ + { + "parentPluginId": "@kbn/relocate", + "id": "def-server.runKbnRelocateCli", + "type": "Function", + "tags": [], + "label": "runKbnRelocateCli", + "description": [ + "\nA CLI to move Kibana modules into the right folder structure,\naccording to the Sustainable Kibana Architecture" + ], + "signature": [ + "() => void" + ], + "path": "packages/kbn-relocate/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [], + "initialIsOpen": false + } + ], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + }, + "common": { + "classes": [], + "functions": [], + "interfaces": [], + "enums": [], + "misc": [], + "objects": [] + } +} \ No newline at end of file diff --git a/api_docs/kbn_relocate.mdx b/api_docs/kbn_relocate.mdx new file mode 100644 index 000000000000..4b4bcb8075ff --- /dev/null +++ b/api_docs/kbn_relocate.mdx @@ -0,0 +1,30 @@ +--- +#### +#### This 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: kibKbnRelocatePluginApi +slug: /kibana-dev-docs/api/kbn-relocate +title: "@kbn/relocate" +image: https://source.unsplash.com/400x175/?github +description: API docs for the @kbn/relocate plugin +date: 2024-12-13 +tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/relocate'] +--- +import kbnRelocateObj from './kbn_relocate.devdocs.json'; + + + +Contact [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) for questions regarding this plugin. + +**Code health stats** + +| Public API count | Any count | Items lacking comments | Missing exports | +|-------------------|-----------|------------------------|-----------------| +| 1 | 0 | 0 | 0 | + +## Server + +### Functions + + diff --git a/api_docs/kbn_repo_file_maps.mdx b/api_docs/kbn_repo_file_maps.mdx index cf7709abb7f3..5b02da11dd5c 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-12-10 +date: 2024-12-13 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 354c33d80654..f14efa0bca52 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-12-10 +date: 2024-12-13 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 54526e531799..2f4d5c83d81f 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-12-10 +date: 2024-12-13 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 77193b39aaf8..6eefdaf0d839 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-12-10 +date: 2024-12-13 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 fc271f63ea3d..8345bcbdba6f 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-12-10 +date: 2024-12-13 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 ef317de7ff4b..189c57fcf118 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_reporting_export_types_csv.mdx index b1f0cba5d230..0cb2dea451ec 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-12-10 +date: 2024-12-13 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 6797e44a1769..f7e4d5a2c1f9 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_reporting_export_types_pdf.mdx index ba65a70ac6bb..661ad2db902f 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-12-10 +date: 2024-12-13 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 a73dd9fedb5e..f0b336e09cf7 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_reporting_export_types_png.mdx index e575f36bcf82..2631050f6d01 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-12-10 +date: 2024-12-13 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 2387ddfb2b75..1217806f52a0 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_reporting_mocks_server.mdx index 6ad57318e6a0..4215fda84394 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-12-10 +date: 2024-12-13 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 f2d6aca30457..386d099ba7c0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/reporting-public'] --- import kbnReportingPublicObj from './kbn_reporting_public.devdocs.json'; diff --git a/api_docs/kbn_reporting_server.mdx b/api_docs/kbn_reporting_server.mdx index 54280e3d1019..ea8d13fa371c 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-12-10 +date: 2024-12-13 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 697be56d70d0..c028ff8ccb85 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-12-10 +date: 2024-12-13 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 57f0048adcf1..7783f0c0e00b 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-12-10 +date: 2024-12-13 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_response_ops_rule_form.devdocs.json b/api_docs/kbn_response_ops_rule_form.devdocs.json index b163e043f795..1df902627c59 100644 --- a/api_docs/kbn_response_ops_rule_form.devdocs.json +++ b/api_docs/kbn_response_ops_rule_form.devdocs.json @@ -1348,6 +1348,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "@kbn/response-ops-rule-form", + "id": "def-public.RuleFormPlugins.userProfile", + "type": "Object", + "tags": [], + "label": "userProfile", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-user-profile-browser", + "scope": "public", + "docId": "kibKbnCoreUserProfileBrowserPluginApi", + "section": "def-public.UserProfileService", + "text": "UserProfileService" + } + ], + "path": "packages/response-ops/rule_form/src/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "@kbn/response-ops-rule-form", "id": "def-public.RuleFormPlugins.application", diff --git a/api_docs/kbn_response_ops_rule_form.mdx b/api_docs/kbn_response_ops_rule_form.mdx index d11ded24d77d..96e45b765703 100644 --- a/api_docs/kbn_response_ops_rule_form.mdx +++ b/api_docs/kbn_response_ops_rule_form.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-rule-form title: "@kbn/response-ops-rule-form" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-rule-form plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-rule-form'] --- import kbnResponseOpsRuleFormObj from './kbn_response_ops_rule_form.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 | |-------------------|-----------|------------------------|-----------------| -| 157 | 0 | 156 | 7 | +| 158 | 0 | 157 | 7 | ## Client diff --git a/api_docs/kbn_response_ops_rule_params.mdx b/api_docs/kbn_response_ops_rule_params.mdx index d7cddafb1e60..1c3d274fd173 100644 --- a/api_docs/kbn_response_ops_rule_params.mdx +++ b/api_docs/kbn_response_ops_rule_params.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-response-ops-rule-params title: "@kbn/response-ops-rule-params" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/response-ops-rule-params plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/response-ops-rule-params'] --- import kbnResponseOpsRuleParamsObj from './kbn_response_ops_rule_params.devdocs.json'; diff --git a/api_docs/kbn_rison.mdx b/api_docs/kbn_rison.mdx index f2f4a8baf58b..b499dc65ad42 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-12-10 +date: 2024-12-13 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 db40f919b9dc..03ba3d581af9 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-12-10 +date: 2024-12-13 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 354dedf7e662..f9e57f28fa3b 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-12-10 +date: 2024-12-13 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 499bad3166c4..2b47d5250579 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-12-10 +date: 2024-12-13 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 ef55ace7e422..ac55e95f6b4a 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-12-10 +date: 2024-12-13 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 30bd03d23c3c..0415d5d5ab11 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-12-10 +date: 2024-12-13 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 dc4cfeb2093f..47304336a34b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-objects-settings'] --- import kbnSavedObjectsSettingsObj from './kbn_saved_objects_settings.devdocs.json'; diff --git a/api_docs/kbn_saved_search_component.mdx b/api_docs/kbn_saved_search_component.mdx index 83958a1b8f7a..793692eec2c7 100644 --- a/api_docs/kbn_saved_search_component.mdx +++ b/api_docs/kbn_saved_search_component.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-saved-search-component title: "@kbn/saved-search-component" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/saved-search-component plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/saved-search-component'] --- import kbnSavedSearchComponentObj from './kbn_saved_search_component.devdocs.json'; diff --git a/api_docs/kbn_scout.devdocs.json b/api_docs/kbn_scout.devdocs.json index 3eaffaf3d88c..7c66238149dc 100644 --- a/api_docs/kbn_scout.devdocs.json +++ b/api_docs/kbn_scout.devdocs.json @@ -1612,7 +1612,7 @@ "section": "def-common.ScoutTestFixtures", "text": "ScoutTestFixtures" }, - ", ", + " & { validateTags: void; }, ", "PlaywrightWorkerArgs", " & ", "PlaywrightWorkerOptions", @@ -1798,7 +1798,7 @@ }, " extends Pick<", "PlaywrightTestConfig", - "<{}, {}>, \"testDir\" | \"workers\">" + "<{}, {}>, \"workers\" | \"testDir\">" ], "path": "packages/kbn-scout/src/playwright/types/index.ts", "deprecated": false, @@ -2144,6 +2144,63 @@ "initialIsOpen": false } ], - "objects": [] + "objects": [ + { + "parentPluginId": "@kbn/scout", + "id": "def-common.tags", + "type": "Object", + "tags": [], + "label": "tags", + "description": [], + "path": "packages/kbn-scout/src/playwright/tags.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/scout", + "id": "def-common.tags.ESS_ONLY", + "type": "Array", + "tags": [], + "label": "ESS_ONLY", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-scout/src/playwright/tags.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/scout", + "id": "def-common.tags.SERVERLESS_ONLY", + "type": "Array", + "tags": [], + "label": "SERVERLESS_ONLY", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-scout/src/playwright/tags.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/scout", + "id": "def-common.tags.DEPLOYMENT_AGNOSTIC", + "type": "Array", + "tags": [], + "label": "DEPLOYMENT_AGNOSTIC", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-scout/src/playwright/tags.ts", + "deprecated": false, + "trackAdoption": false + } + ], + "initialIsOpen": false + } + ] } } \ No newline at end of file diff --git a/api_docs/kbn_scout.mdx b/api_docs/kbn_scout.mdx index e5b3bff9f472..14fa772ba8fc 100644 --- a/api_docs/kbn_scout.mdx +++ b/api_docs/kbn_scout.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout title: "@kbn/scout" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout'] --- import kbnScoutObj from './kbn_scout.devdocs.json'; @@ -21,10 +21,13 @@ Contact [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) for | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 117 | 0 | 86 | 8 | +| 121 | 0 | 90 | 8 | ## Common +### Objects + + ### Functions diff --git a/api_docs/kbn_scout_info.mdx b/api_docs/kbn_scout_info.mdx index e06c3d3af817..4c8f48ccee25 100644 --- a/api_docs/kbn_scout_info.mdx +++ b/api_docs/kbn_scout_info.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout-info title: "@kbn/scout-info" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout-info plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout-info'] --- import kbnScoutInfoObj from './kbn_scout_info.devdocs.json'; diff --git a/api_docs/kbn_scout_reporting.mdx b/api_docs/kbn_scout_reporting.mdx index 83f93554a4c5..8dff6bed528e 100644 --- a/api_docs/kbn_scout_reporting.mdx +++ b/api_docs/kbn_scout_reporting.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-scout-reporting title: "@kbn/scout-reporting" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/scout-reporting plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/scout-reporting'] --- import kbnScoutReportingObj from './kbn_scout_reporting.devdocs.json'; diff --git a/api_docs/kbn_screenshotting_server.mdx b/api_docs/kbn_screenshotting_server.mdx index 7ada739fa09a..c91e96c511a5 100644 --- a/api_docs/kbn_screenshotting_server.mdx +++ b/api_docs/kbn_screenshotting_server.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/screenshotting-server'] --- import kbnScreenshottingServerObj from './kbn_screenshotting_server.devdocs.json'; diff --git a/api_docs/kbn_search_api_keys_components.mdx b/api_docs/kbn_search_api_keys_components.mdx index ce83b7341015..ebac609d6aa0 100644 --- a/api_docs/kbn_search_api_keys_components.mdx +++ b/api_docs/kbn_search_api_keys_components.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-keys-components title: "@kbn/search-api-keys-components" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-keys-components plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-keys-components'] --- import kbnSearchApiKeysComponentsObj from './kbn_search_api_keys_components.devdocs.json'; diff --git a/api_docs/kbn_search_api_keys_server.mdx b/api_docs/kbn_search_api_keys_server.mdx index 6af6e2a75499..b64cd22a56a4 100644 --- a/api_docs/kbn_search_api_keys_server.mdx +++ b/api_docs/kbn_search_api_keys_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-api-keys-server title: "@kbn/search-api-keys-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-api-keys-server plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-api-keys-server'] --- import kbnSearchApiKeysServerObj from './kbn_search_api_keys_server.devdocs.json'; diff --git a/api_docs/kbn_search_api_panels.mdx b/api_docs/kbn_search_api_panels.mdx index 0eaeae8c49c0..3ff5e5e457de 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-12-10 +date: 2024-12-13 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 31c2ae5d16f1..7e391086a36b 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-12-10 +date: 2024-12-13 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 d807d557e640..f43d4ebcff3e 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-12-10 +date: 2024-12-13 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 c87dba5e4faa..e9c62abdb118 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-12-10 +date: 2024-12-13 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 0b28331cd33a..4ba4cb80c793 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-12-10 +date: 2024-12-13 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_shared_ui.mdx b/api_docs/kbn_search_shared_ui.mdx index 9012e3a9da18..46f253f7ee92 100644 --- a/api_docs/kbn_search_shared_ui.mdx +++ b/api_docs/kbn_search_shared_ui.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-search-shared-ui title: "@kbn/search-shared-ui" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/search-shared-ui plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/search-shared-ui'] --- import kbnSearchSharedUiObj from './kbn_search_shared_ui.devdocs.json'; diff --git a/api_docs/kbn_search_types.mdx b/api_docs/kbn_search_types.mdx index 4c448ff83484..d7f73cc3890a 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-12-10 +date: 2024-12-13 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 dd6c4e355b53..acaf8d6006bb 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_security_authorization_core.mdx index 08692cd14f62..24f503dd35ec 100644 --- a/api_docs/kbn_security_authorization_core.mdx +++ b/api_docs/kbn_security_authorization_core.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core'] --- import kbnSecurityAuthorizationCoreObj from './kbn_security_authorization_core.devdocs.json'; diff --git a/api_docs/kbn_security_authorization_core_common.mdx b/api_docs/kbn_security_authorization_core_common.mdx index 8fd2cf460021..605f3ab5a101 100644 --- a/api_docs/kbn_security_authorization_core_common.mdx +++ b/api_docs/kbn_security_authorization_core_common.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-security-authorization-core-common title: "@kbn/security-authorization-core-common" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/security-authorization-core-common plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-authorization-core-common'] --- import kbnSecurityAuthorizationCoreCommonObj from './kbn_security_authorization_core_common.devdocs.json'; diff --git a/api_docs/kbn_security_form_components.mdx b/api_docs/kbn_security_form_components.mdx index 4defccc0e674..2e9caa1af6cb 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-12-10 +date: 2024-12-13 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 0c4468431ffe..343a89752edf 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_security_plugin_types_common.devdocs.json index 66423093f7f1..886b1bffd0d9 100644 --- a/api_docs/kbn_security_plugin_types_common.devdocs.json +++ b/api_docs/kbn_security_plugin_types_common.devdocs.json @@ -270,6 +270,22 @@ "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/security-plugin-types-common", + "id": "def-common.AuthenticatedUser.operator", + "type": "CompoundType", + "tags": [], + "label": "operator", + "description": [ + "\nIndicates whether user is an operator." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_security_plugin_types_common.mdx b/api_docs/kbn_security_plugin_types_common.mdx index df118cc8509c..feaf51825fa3 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-common'] --- import kbnSecurityPluginTypesCommonObj from './kbn_security_plugin_types_common.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 | |-------------------|-----------|------------------------|-----------------| -| 125 | 0 | 66 | 0 | +| 126 | 0 | 66 | 0 | ## Common diff --git a/api_docs/kbn_security_plugin_types_public.mdx b/api_docs/kbn_security_plugin_types_public.mdx index f476cf48ccdd..d60b503f3aa2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-public'] --- import kbnSecurityPluginTypesPublicObj from './kbn_security_plugin_types_public.devdocs.json'; diff --git a/api_docs/kbn_security_plugin_types_server.devdocs.json b/api_docs/kbn_security_plugin_types_server.devdocs.json index b8a5df3a3b0c..8571e8869ec2 100644 --- a/api_docs/kbn_security_plugin_types_server.devdocs.json +++ b/api_docs/kbn_security_plugin_types_server.devdocs.json @@ -4851,7 +4851,7 @@ }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts" }, { "plugin": "fleet", @@ -4873,26 +4873,6 @@ "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts" }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/enable.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/disable.ts" - }, { "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/server/lib/helpers/get_random_sampler/index.ts" @@ -4922,52 +4902,72 @@ "path": "x-pack/plugins/upgrade_assistant/server/lib/reindexing/credential_store.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/enable.ts" + }, + { + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/disable.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" } ] }, @@ -4981,13 +4981,47 @@ "\nAuthorization services to manage and access the permissions a particular user has." ], "signature": [ + "{ mode: ", { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.AuthorizationServiceSetup", - "text": "AuthorizationServiceSetup" - } + "section": "def-server.AuthorizationMode", + "text": "AuthorizationMode" + }, + "; actions: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.Actions", + "text": "Actions" + }, + "; checkPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesWithRequest", + "text": "CheckPrivilegesWithRequest" + }, + "; checkPrivilegesDynamicallyWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesDynamicallyWithRequest", + "text": "CheckPrivilegesDynamicallyWithRequest" + }, + "; checkSavedObjectsPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckSavedObjectsPrivilegesWithRequest", + "text": "CheckSavedObjectsPrivilegesWithRequest" + }, + "; }" ], "path": "x-pack/packages/security/plugin_types_server/src/plugin.ts", "deprecated": false, @@ -6072,6 +6106,23 @@ "trackAdoption": false, "initialIsOpen": false }, + { + "parentPluginId": "@kbn/security-plugin-types-server", + "id": "def-server.EsSecurityConfig", + "type": "Type", + "tags": [], + "label": "EsSecurityConfig", + "description": [], + "signature": [ + "{ operator_privileges: ", + "XpackUsageBase", + "; }" + ], + "path": "x-pack/packages/security/plugin_types_server/src/authorization/es_security_config.ts", + "deprecated": false, + "trackAdoption": false, + "initialIsOpen": false + }, { "parentPluginId": "@kbn/security-plugin-types-server", "id": "def-server.GLOBAL_RESOURCE", diff --git a/api_docs/kbn_security_plugin_types_server.mdx b/api_docs/kbn_security_plugin_types_server.mdx index 7976f4a945fb..b1c6a024957d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-plugin-types-server'] --- import kbnSecurityPluginTypesServerObj from './kbn_security_plugin_types_server.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 | |-------------------|-----------|------------------------|-----------------| -| 281 | 1 | 160 | 0 | +| 282 | 1 | 161 | 0 | ## Server diff --git a/api_docs/kbn_security_role_management_model.mdx b/api_docs/kbn_security_role_management_model.mdx index 9a4ab0b9242e..f6ca23b12f88 100644 --- a/api_docs/kbn_security_role_management_model.mdx +++ b/api_docs/kbn_security_role_management_model.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-role-management-model'] --- import kbnSecurityRoleManagementModelObj from './kbn_security_role_management_model.devdocs.json'; diff --git a/api_docs/kbn_security_solution_distribution_bar.devdocs.json b/api_docs/kbn_security_solution_distribution_bar.devdocs.json index 51fdf64ef88c..ac66b60a1f71 100644 --- a/api_docs/kbn_security_solution_distribution_bar.devdocs.json +++ b/api_docs/kbn_security_solution_distribution_bar.devdocs.json @@ -23,7 +23,7 @@ }, ">" ], - "path": "x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx", + "path": "x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -70,7 +70,7 @@ "description": [ "DistributionBar component props" ], - "path": "x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx", + "path": "x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -86,7 +86,7 @@ "signature": [ "{ key: string; count: number; color: string; label?: React.ReactNode; isCurrentFilter?: boolean | undefined; filter?: (() => void) | undefined; reset?: ((event: React.MouseEvent) => void) | undefined; }[]" ], - "path": "x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx", + "path": "x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx", "deprecated": false, "trackAdoption": false }, @@ -102,7 +102,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx", + "path": "x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx", "deprecated": false, "trackAdoption": false }, @@ -118,7 +118,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx", + "path": "x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_security_solution_distribution_bar.mdx b/api_docs/kbn_security_solution_distribution_bar.mdx index 697f727b79d6..8bdcc469842f 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_security_solution_features.devdocs.json index f77d52c6d9ff..4e2fd77a59f2 100644 --- a/api_docs/kbn_security_solution_features.devdocs.json +++ b/api_docs/kbn_security_solution_features.devdocs.json @@ -37,7 +37,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -87,7 +87,7 @@ "ReservedKibanaPrivilege", "[]; } | undefined; }" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -101,7 +101,7 @@ "signature": [ "T[]" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -123,7 +123,7 @@ }, ">" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -151,7 +151,7 @@ }, ">" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -202,7 +202,7 @@ "ReservedKibanaPrivilege", "[]; } | undefined; }" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -224,7 +224,7 @@ }, "[]" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -245,7 +245,7 @@ " | ", "ProductFeatureAttackDiscoveryKey" ], - "path": "x-pack/packages/security-solution/features/src/product_features_keys.ts", + "path": "x-pack/solutions/security/packages/features/src/product_features_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -291,7 +291,7 @@ }, ">[] | undefined; }" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -318,7 +318,7 @@ "AssistantSubFeatureId", ">>" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -343,7 +343,7 @@ }, ">" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -370,7 +370,7 @@ "CasesSubFeatureId", ">>" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -401,7 +401,7 @@ }, ">" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -428,7 +428,7 @@ "SecuritySubFeatureId", ">>" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -547,7 +547,7 @@ }, "<{ all: readonly string[]; read: readonly string[]; }> | undefined; }" ], - "path": "x-pack/packages/security-solution/features/src/types.ts", + "path": "x-pack/solutions/security/packages/features/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_security_solution_features.mdx b/api_docs/kbn_security_solution_features.mdx index ba2edfd501e5..050a9c9f584e 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_security_solution_navigation.devdocs.json index cfb6285eaefe..4e22926d5b05 100644 --- a/api_docs/kbn_security_solution_navigation.devdocs.json +++ b/api_docs/kbn_security_solution_navigation.devdocs.json @@ -31,7 +31,7 @@ "signature": [ "(id: string) => { appId: string; deepLinkId?: string | undefined; path?: string | undefined; }" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -45,7 +45,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -80,7 +80,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -101,7 +101,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -136,7 +136,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -157,7 +157,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -192,7 +192,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -213,7 +213,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -240,7 +240,7 @@ }, "; }>) => React.JSX.Element" ], - "path": "x-pack/packages/security-solution/navigation/src/context.tsx", + "path": "x-pack/solutions/security/packages/navigation/src/context.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -262,7 +262,7 @@ }, "; }>" ], - "path": "x-pack/packages/security-solution/navigation/src/context.tsx", + "path": "x-pack/solutions/security/packages/navigation/src/context.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -291,7 +291,7 @@ }, "; }" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -318,7 +318,7 @@ }, "; }" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -353,7 +353,7 @@ }, "; }" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -387,7 +387,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -408,7 +408,7 @@ }, ".accordion" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -419,7 +419,7 @@ "tags": [], "label": "label", "description": [], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -440,7 +440,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -464,7 +464,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -478,7 +478,7 @@ "signature": [ "readonly T[] | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -492,7 +492,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -513,7 +513,7 @@ }, " | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -528,7 +528,7 @@ "IconType", " | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -549,7 +549,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -573,7 +573,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -595,7 +595,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -609,7 +609,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -623,7 +623,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -637,7 +637,7 @@ "signature": [ "T" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -652,7 +652,7 @@ "IconType", " | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -666,7 +666,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -687,7 +687,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -698,7 +698,7 @@ "tags": [], "label": "title", "description": [], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -713,7 +713,7 @@ "IconType", " | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -727,7 +727,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -741,7 +741,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -755,7 +755,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -769,7 +769,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -783,7 +783,7 @@ "signature": [ "{ text: string; } | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -815,7 +815,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -836,7 +836,7 @@ }, ".separator" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -850,7 +850,7 @@ "signature": [ "readonly T[]" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -882,7 +882,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -903,7 +903,7 @@ }, ".title | undefined" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -917,7 +917,7 @@ "signature": [ "readonly T[]" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -928,7 +928,7 @@ "tags": [], "label": "label", "description": [], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -946,7 +946,7 @@ "description": [ "\nExternal (non-Security) page names that need to be linked in the Security navigation.\nFormat: `:/`.\n\n`pluginId`: is the id of the plugin that owns the deep link\n\n`deepLinkId`: is the id of the deep link inside the plugin.\nKeep empty for the root page of the plugin, e.g. `osquery:`\n\n`path`: is the path to append to the plugin and deep link.\nThis is optional and only needed if the path is not registered in the plugin's `deepLinks`. e.g. `integrations:/browse/security`\nThe path should not be used for links displayed in the main left navigation, since highlighting won't work." ], - "path": "x-pack/packages/security-solution/navigation/src/constants.ts", + "path": "x-pack/solutions/security/packages/navigation/src/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -958,7 +958,7 @@ "tags": [], "label": "LinkCategoryType", "description": [], - "path": "x-pack/packages/security-solution/navigation/src/constants.ts", + "path": "x-pack/solutions/security/packages/navigation/src/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -987,7 +987,7 @@ "signature": [ "(param: { appId?: string | undefined; deepLinkId?: string | undefined; path?: string | undefined; absolute?: boolean | undefined; }) => string" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1002,7 +1002,7 @@ "signature": [ "{ appId?: string | undefined; deepLinkId?: string | undefined; path?: string | undefined; absolute?: boolean | undefined; }" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1027,7 +1027,7 @@ }, "[]" ], - "path": "x-pack/packages/security-solution/navigation/src/types.ts", + "path": "x-pack/solutions/security/packages/navigation/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1050,7 +1050,7 @@ }, ") => void" ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1072,7 +1072,7 @@ "text": "NavigateToAppOptions" } ], - "path": "x-pack/packages/security-solution/navigation/src/navigation.ts", + "path": "x-pack/solutions/security/packages/navigation/src/navigation.ts", "deprecated": false, "trackAdoption": false } @@ -1089,7 +1089,7 @@ "signature": [ "\"securitySolutionUI\"" ], - "path": "x-pack/packages/security-solution/navigation/src/constants.ts", + "path": "x-pack/solutions/security/packages/navigation/src/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_security_solution_navigation.mdx b/api_docs/kbn_security_solution_navigation.mdx index 09fe67fe7946..04dcf8208863 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_security_solution_side_nav.devdocs.json index f50c9850b3ac..a82741016145 100644 --- a/api_docs/kbn_security_solution_side_nav.devdocs.json +++ b/api_docs/kbn_security_solution_side_nav.devdocs.json @@ -37,7 +37,7 @@ }, ") => React.JSX.Element" ], - "path": "x-pack/packages/security-solution/side_nav/src/index.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -57,7 +57,7 @@ "text": "SolutionSideNavProps" } ], - "path": "x-pack/packages/security-solution/side_nav/src/index.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -85,7 +85,7 @@ }, "" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -99,7 +99,7 @@ "signature": [ "T" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -110,7 +110,7 @@ "tags": [], "label": "label", "description": [], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -121,7 +121,7 @@ "tags": [], "label": "href", "description": [], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -135,7 +135,7 @@ "signature": [ "React.MouseEventHandler | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -149,7 +149,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -163,7 +163,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -184,7 +184,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -206,7 +206,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -221,7 +221,7 @@ "IconType", " | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -235,7 +235,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -256,7 +256,7 @@ }, " | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -270,7 +270,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -284,7 +284,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -298,7 +298,7 @@ "signature": [ "{ text: string; } | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false } @@ -312,7 +312,7 @@ "tags": [], "label": "SolutionSideNavProps", "description": [], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -335,7 +335,7 @@ }, "[]" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false }, @@ -348,7 +348,7 @@ "description": [ "The id of the selected item to highlight. It only affects the top level items rendered in the main panel" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false }, @@ -371,7 +371,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false }, @@ -387,7 +387,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false }, @@ -403,7 +403,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false }, @@ -426,7 +426,7 @@ }, " | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx", + "path": "x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx", "deprecated": false, "trackAdoption": false } @@ -442,7 +442,7 @@ "tags": [], "label": "SolutionSideNavItemPosition", "description": [], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -459,7 +459,7 @@ "signature": [ "(type: string, event: string | string[], count?: number | undefined) => void" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -471,7 +471,7 @@ "tags": [], "label": "type", "description": [], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -485,7 +485,7 @@ "signature": [ "string | string[]" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false }, @@ -499,7 +499,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/packages/security-solution/side_nav/src/types.ts", + "path": "x-pack/solutions/security/packages/side_nav/src/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/kbn_security_solution_side_nav.mdx b/api_docs/kbn_security_solution_side_nav.mdx index e06a281b52d6..80710b04c3cc 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_security_solution_storybook_config.devdocs.json index 8d585c20a8a0..ac9afa570520 100644 --- a/api_docs/kbn_security_solution_storybook_config.devdocs.json +++ b/api_docs/kbn_security_solution_storybook_config.devdocs.json @@ -34,7 +34,7 @@ "signature": [ "\"Security Solution Storybook\"" ], - "path": "x-pack/packages/security-solution/storybook/config/constants.ts", + "path": "x-pack/solutions/security/packages/storybook/config/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -51,7 +51,7 @@ "signature": [ "\"https://github.com/elastic/kibana/tree/main/packages/security_solution\"" ], - "path": "x-pack/packages/security-solution/storybook/config/constants.ts", + "path": "x-pack/solutions/security/packages/storybook/config/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_security_solution_storybook_config.mdx b/api_docs/kbn_security_solution_storybook_config.mdx index 440095f2cc18..12829ac59c9c 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_security_ui_components.mdx index 369deb84d5fd..5b688d8767ab 100644 --- a/api_docs/kbn_security_ui_components.mdx +++ b/api_docs/kbn_security_ui_components.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/security-ui-components'] --- import kbnSecurityUiComponentsObj from './kbn_security_ui_components.devdocs.json'; diff --git a/api_docs/kbn_securitysolution_autocomplete.mdx b/api_docs/kbn_securitysolution_autocomplete.mdx index e06d9857ba31..6358526fdba7 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_securitysolution_data_table.devdocs.json index 094b367093aa..2116e15e76b4 100644 --- a/api_docs/kbn_securitysolution_data_table.devdocs.json +++ b/api_docs/kbn_securitysolution_data_table.devdocs.json @@ -47,7 +47,7 @@ "EuiDataGridSetCellProps", ") => void) => void" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -67,7 +67,7 @@ "text": "EcsSecurityExtension" } ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -88,7 +88,7 @@ "text": "EuiTheme" } ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -105,7 +105,7 @@ "EuiDataGridSetCellProps", ") => void" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -126,7 +126,7 @@ "DataTableProps", ">" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -175,7 +175,7 @@ "text": "TableState" } ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/reducer.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/reducer.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -235,7 +235,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -250,7 +250,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -271,7 +271,7 @@ "text": "BrowserFields" } ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -286,7 +286,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -323,7 +323,7 @@ }, "[]>" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -344,7 +344,7 @@ }, "[]" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -359,7 +359,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -374,7 +374,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -389,7 +389,7 @@ "signature": [ "boolean" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -410,7 +410,7 @@ "signature": [ "(rowIndex: number, itemsPerPage: number) => number" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/pagination.ts", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/pagination.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -424,7 +424,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/pagination.ts", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/pagination.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -439,7 +439,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/pagination.ts", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/pagination.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -492,7 +492,7 @@ }, ", { clearCache: () => void; }> & { clearCache: () => void; }" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/selectors.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/selectors.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -517,7 +517,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -537,7 +537,7 @@ "text": "EcsSecurityExtension" } ], - "path": "x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx", + "path": "x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -566,7 +566,7 @@ " extends ", "DataTableModelSettings" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -612,7 +612,7 @@ }, " | undefined; type?: string | undefined; })[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -628,7 +628,7 @@ "signature": [ "string | null" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -644,7 +644,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -665,7 +665,7 @@ }, "[] | undefined" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -681,7 +681,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -694,7 +694,7 @@ "description": [ "Uniquely identifies the data table" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -708,7 +708,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -719,7 +719,7 @@ "tags": [], "label": "isLoading", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -732,7 +732,7 @@ "description": [ "If selectAll checkbox in header is checked" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -745,7 +745,7 @@ "description": [ "The number of items to show in a single page of results" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -761,7 +761,7 @@ "signature": [ "number[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -777,7 +777,7 @@ "signature": [ "string[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -801,7 +801,7 @@ }, "[]; }" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -815,7 +815,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -830,7 +830,7 @@ "SessionViewConfig", " | null" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -846,7 +846,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -859,7 +859,7 @@ "description": [ "Total number of fetched events/alerts" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -873,7 +873,7 @@ "signature": [ "\"gridView\" | \"eventRenderedView\"" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false }, @@ -887,7 +887,7 @@ "signature": [ "{ showOnlyThreatIndicatorAlerts: boolean; showBuildingBlockAlerts: boolean; }" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false } @@ -903,7 +903,7 @@ "description": [ "The state of all timelines is stored here" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -923,7 +923,7 @@ "text": "TableState" } ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false } @@ -937,7 +937,7 @@ "tags": [], "label": "SortColumnTable", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -948,7 +948,7 @@ "tags": [], "label": "columnId", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false }, @@ -959,7 +959,7 @@ "tags": [], "label": "columnType", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false }, @@ -973,7 +973,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false }, @@ -994,7 +994,7 @@ "text": "Direction" } ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false } @@ -1010,7 +1010,7 @@ "description": [ "A map of id to data table" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1031,7 +1031,7 @@ "text": "DataTableModel" } ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false } @@ -1047,7 +1047,7 @@ "description": [ "The state of all data tables is stored here" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1067,7 +1067,7 @@ "text": "TableById" } ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/types.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/types.ts", "deprecated": false, "trackAdoption": false } @@ -1083,7 +1083,7 @@ "tags": [], "label": "Direction", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1095,7 +1095,7 @@ "tags": [], "label": "TableEntityType", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1107,7 +1107,7 @@ "tags": [], "label": "TableId", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1119,7 +1119,7 @@ "tags": [], "label": "TimelineTabs", "description": [], - "path": "x-pack/packages/security-solution/data_table/common/types/detail_panel.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/detail_panel.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1136,7 +1136,7 @@ "signature": [ "\"not-filtered\" | \"text-filter\"" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1152,7 +1152,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1167,7 +1167,7 @@ "signature": [ "\"open\"" ], - "path": "x-pack/packages/security-solution/data_table/common/types/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1189,7 +1189,7 @@ "text": "Direction" } ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1300,7 +1300,7 @@ "SessionViewConfig", " | null; readonly totalCount: number; }" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/model.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/model.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1402,7 +1402,7 @@ }, ".alertsRiskInputs" ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1417,7 +1417,7 @@ "signature": [ "\"gridView\" | \"eventRenderedView\"" ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1431,7 +1431,7 @@ "tags": [], "label": "tableDefaults", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1446,7 +1446,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1460,7 +1460,7 @@ "signature": [ "null" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1474,7 +1474,7 @@ "signature": [ "never[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1488,7 +1488,7 @@ "signature": [ "never[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1502,7 +1502,7 @@ "signature": [ "never[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1516,7 +1516,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1530,7 +1530,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1541,7 +1541,7 @@ "tags": [], "label": "itemsPerPage", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1555,7 +1555,7 @@ "signature": [ "number[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1569,7 +1569,7 @@ "signature": [ "never[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1580,7 +1580,7 @@ "tags": [], "label": "selectedEventIds", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false, "children": [] @@ -1595,7 +1595,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1609,7 +1609,7 @@ "signature": [ "{ columnId: string; columnType: string; esTypes: string[]; sortDirection: \"desc\"; }[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1623,7 +1623,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1634,7 +1634,7 @@ "tags": [], "label": "graphEventId", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1648,7 +1648,7 @@ "signature": [ "null" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1663,7 +1663,7 @@ "ColumnHeaderOptions", "[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1677,7 +1677,7 @@ "signature": [ "never[]" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1688,7 +1688,7 @@ "tags": [], "label": "title", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1699,7 +1699,7 @@ "tags": [], "label": "totalCount", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1713,7 +1713,7 @@ "signature": [ "\"gridView\"" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1724,7 +1724,7 @@ "tags": [], "label": "additionalFilters", "description": [], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1738,7 +1738,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false }, @@ -1752,7 +1752,7 @@ "signature": [ "false" ], - "path": "x-pack/packages/security-solution/data_table/store/data_table/defaults.ts", + "path": "x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts", "deprecated": false, "trackAdoption": false } @@ -1875,7 +1875,7 @@ }, "; }" ], - "path": "x-pack/packages/security-solution/data_table/common/types/data_table/index.ts", + "path": "x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_securitysolution_data_table.mdx b/api_docs/kbn_securitysolution_data_table.mdx index bd1680ab7c16..dd8b8aad9c15 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-12-10 +date: 2024-12-13 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 3088d2051340..dfb1942bf34b 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-12-10 +date: 2024-12-13 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 e7dcb1d4de62..670876700710 100644 --- a/api_docs/kbn_securitysolution_es_utils.devdocs.json +++ b/api_docs/kbn_securitysolution_es_utils.devdocs.json @@ -613,9 +613,9 @@ "\nRetrieves all index aliases for a given alias name\n" ], "signature": [ - "({ esClient, alias, }: { esClient: ", + "({ esClient, alias, index, }: { esClient: ", "ElasticsearchClient", - "; alias: string; }) => Promise" + "; alias: string; index?: string | undefined; }) => Promise" ], "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", "deprecated": false, @@ -626,7 +626,7 @@ "id": "def-common.getIndexAliases.$1", "type": "Object", "tags": [], - "label": "{\n esClient,\n alias,\n}", + "label": "{\n esClient,\n alias,\n index,\n}", "description": [], "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", "deprecated": false, @@ -1906,6 +1906,20 @@ "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/securitysolution-es-utils", + "id": "def-common.getIndexAliases.$1.index", + "type": "string", + "tags": [], + "label": "index", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts", + "deprecated": false, + "trackAdoption": false } ] } diff --git a/api_docs/kbn_securitysolution_es_utils.mdx b/api_docs/kbn_securitysolution_es_utils.mdx index 6d98ee04fb15..dce5645374de 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-es-utils'] --- import kbnSecuritysolutionEsUtilsObj from './kbn_securitysolution_es_utils.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-detection-engine](https://github.com/orgs/elastic/tea | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 87 | 0 | 76 | 1 | +| 88 | 0 | 77 | 1 | ## Common diff --git a/api_docs/kbn_securitysolution_exception_list_components.mdx b/api_docs/kbn_securitysolution_exception_list_components.mdx index b267a800bb66..6639ac33fb31 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-12-10 +date: 2024-12-13 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 f26d3d93dfc4..9bc11829a1c1 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-12-10 +date: 2024-12-13 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 2c8bcf291398..8d2ff02dd4bb 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-12-10 +date: 2024-12-13 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 1cfd4acdd73e..cc4005e893e7 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-12-10 +date: 2024-12-13 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 63131851f322..46b032fe6996 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-12-10 +date: 2024-12-13 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 aadaa9bb5e05..2d57b7c1314a 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-12-10 +date: 2024-12-13 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 acda4d82918e..ede87b9c4b17 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-12-10 +date: 2024-12-13 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 6cc5f6231ab4..ac3a70cc5470 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-12-10 +date: 2024-12-13 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 4b4ae0c9f0a3..72f5c90577e0 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-12-10 +date: 2024-12-13 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 0bb78551477d..85d1b2a4aeff 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-12-10 +date: 2024-12-13 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 0a9a4ac9323e..2788561c74f9 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-12-10 +date: 2024-12-13 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 62a0d9909e40..1a59a025406b 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-12-10 +date: 2024-12-13 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 0673ea18beff..216a59d43f26 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/securitysolution-utils'] --- import kbnSecuritysolutionUtilsObj from './kbn_securitysolution_utils.devdocs.json'; diff --git a/api_docs/kbn_server_http_tools.mdx b/api_docs/kbn_server_http_tools.mdx index c467d3e2445a..3ae8d6c9b623 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-http-tools'] --- import kbnServerHttpToolsObj from './kbn_server_http_tools.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository.mdx b/api_docs/kbn_server_route_repository.mdx index c569f7af69c1..fa6b915f8e29 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository'] --- import kbnServerRouteRepositoryObj from './kbn_server_route_repository.devdocs.json'; diff --git a/api_docs/kbn_server_route_repository_client.mdx b/api_docs/kbn_server_route_repository_client.mdx index bf4bea214db2..eca34c8978b6 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_server_route_repository_utils.mdx index 1cc5a5d72b0d..84b84e718814 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/server-route-repository-utils'] --- import kbnServerRouteRepositoryUtilsObj from './kbn_server_route_repository_utils.devdocs.json'; diff --git a/api_docs/kbn_serverless_common_settings.mdx b/api_docs/kbn_serverless_common_settings.mdx index cd0c189f2a91..5af06a48ed87 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-12-10 +date: 2024-12-13 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 756a31d3679c..0be2b9a56acb 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-12-10 +date: 2024-12-13 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 7444f55f614d..b399753b468c 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-12-10 +date: 2024-12-13 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 09f93f60ffc6..3dbf5891d9dc 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-12-10 +date: 2024-12-13 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 a8758f5ecad7..389cc4f5d778 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-12-10 +date: 2024-12-13 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 c5a5f69686df..878b26a99d9e 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-12-10 +date: 2024-12-13 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 e2e57260035d..1617fa4a0797 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-12-10 +date: 2024-12-13 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 5cc189ae9489..e1a83cb4e3e1 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-12-10 +date: 2024-12-13 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 6eb5a4029897..d960ec849fe5 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_shared_ux_button_toolbar.devdocs.json index ea07e99c1ce7..249f1003dbbf 100644 --- a/api_docs/kbn_shared_ux_button_toolbar.devdocs.json +++ b/api_docs/kbn_shared_ux_button_toolbar.devdocs.json @@ -1,27 +1,11 @@ { "id": "@kbn/shared-ux-button-toolbar", "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.AddFromLibraryButton", + "id": "def-public.AddFromLibraryButton", "type": "Function", "tags": [], "label": "AddFromLibraryButton", @@ -32,9 +16,9 @@ "({ onClick, size, ...rest }: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -45,7 +29,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.AddFromLibraryButton.$1", + "id": "def-public.AddFromLibraryButton.$1", "type": "Object", "tags": [], "label": "{ onClick, size = 'm', ...rest }", @@ -53,9 +37,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" } ], @@ -70,7 +54,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButtonGroup", + "id": "def-public.IconButtonGroup", "type": "Function", "tags": [], "label": "IconButtonGroup", @@ -81,9 +65,9 @@ "({ buttons, legend, buttonSize, \"data-test-subj\": dataTestSubj, }: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -94,7 +78,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButtonGroup.$1", + "id": "def-public.IconButtonGroup.$1", "type": "Object", "tags": [], "label": "{\n buttons,\n legend,\n buttonSize = 'm',\n 'data-test-subj': dataTestSubj,\n}", @@ -102,9 +86,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" } ], @@ -119,7 +103,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Toolbar", + "id": "def-public.Toolbar", "type": "Function", "tags": [], "label": "Toolbar", @@ -130,9 +114,9 @@ "({ children }: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -143,7 +127,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Toolbar.$1", + "id": "def-public.Toolbar.$1", "type": "Object", "tags": [], "label": "{ children }", @@ -151,9 +135,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" } ], @@ -170,7 +154,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.ToolbarButton", + "id": "def-public.ToolbarButton", "type": "Function", "tags": [], "label": "ToolbarButton", @@ -179,9 +163,9 @@ "(props: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -192,7 +176,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.ToolbarButton.$1", + "id": "def-public.ToolbarButton.$1", "type": "Uncategorized", "tags": [], "label": "props", @@ -200,9 +184,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, "" @@ -218,7 +202,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.ToolbarPopover", + "id": "def-public.ToolbarPopover", "type": "Function", "tags": [], "label": "ToolbarPopover", @@ -229,9 +213,9 @@ "({ type, label, iconType, size, children, isDisabled, ...popover }: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -242,7 +226,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.ToolbarPopover.$1", + "id": "def-public.ToolbarPopover.$1", "type": "CompoundType", "tags": [], "label": "{\n type,\n label,\n iconType,\n size = 'm',\n children,\n isDisabled,\n ...popover\n}", @@ -250,9 +234,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" } ], @@ -269,7 +253,7 @@ "interfaces": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton", + "id": "def-public.IconButton", "type": "Interface", "tags": [], "label": "IconButton", @@ -282,7 +266,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.label", + "id": "def-public.IconButton.label", "type": "string", "tags": [], "label": "label", @@ -295,7 +279,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.iconType", + "id": "def-public.IconButton.iconType", "type": "CompoundType", "tags": [], "label": "iconType", @@ -311,7 +295,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.onClick", + "id": "def-public.IconButton.onClick", "type": "Function", "tags": [], "label": "onClick", @@ -329,7 +313,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.title", + "id": "def-public.IconButton.title", "type": "string", "tags": [], "label": "title", @@ -345,7 +329,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.datatestsubj", + "id": "def-public.IconButton.datatestsubj", "type": "string", "tags": [], "label": "'data-test-subj'", @@ -361,7 +345,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.isDisabled", + "id": "def-public.IconButton.isDisabled", "type": "CompoundType", "tags": [], "label": "isDisabled", @@ -377,7 +361,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.ariaexpanded", + "id": "def-public.IconButton.ariaexpanded", "type": "CompoundType", "tags": [], "label": "'aria-expanded'", @@ -393,7 +377,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.IconButton.ariacontrols", + "id": "def-public.IconButton.ariacontrols", "type": "string", "tags": [], "label": "'aria-controls'", @@ -412,7 +396,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Interface", "tags": [], "label": "Props", @@ -425,7 +409,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props.legend", + "id": "def-public.Props.legend", "type": "string", "tags": [], "label": "legend", @@ -438,7 +422,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props.buttons", + "id": "def-public.Props.buttons", "type": "Array", "tags": [], "label": "buttons", @@ -448,9 +432,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.IconButton", + "section": "def-public.IconButton", "text": "IconButton" }, "[]" @@ -461,7 +445,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props.buttonSize", + "id": "def-public.Props.buttonSize", "type": "CompoundType", "tags": [], "label": "buttonSize", @@ -477,7 +461,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props.datatestsubj", + "id": "def-public.Props.datatestsubj", "type": "string", "tags": [], "label": "'data-test-subj'", @@ -496,7 +480,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Interface", "tags": [], "label": "Props", @@ -509,7 +493,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props.children", + "id": "def-public.Props.children", "type": "Object", "tags": [], "label": "children", @@ -529,7 +513,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Type", "tags": [], "label": "Props", @@ -546,7 +530,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Type", "tags": [], "label": "Props", @@ -563,7 +547,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Type", "tags": [], "label": "Props", @@ -580,7 +564,7 @@ }, { "parentPluginId": "@kbn/shared-ux-button-toolbar", - "id": "def-common.ToolbarButtonType", + "id": "def-public.ToolbarButtonType", "type": "Type", "tags": [], "label": "ToolbarButtonType", @@ -591,17 +575,17 @@ "((props: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element) | (({ type, label, iconType, size, children, isDisabled, ...popover }: ", { "pluginId": "@kbn/shared-ux-button-toolbar", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxButtonToolbarPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element)" @@ -615,5 +599,21 @@ } ], "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_shared_ux_button_toolbar.mdx b/api_docs/kbn_shared_ux_button_toolbar.mdx index 3757ca9c569e..40f1b728cf1b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-button-toolbar'] --- import kbnSharedUxButtonToolbarObj from './kbn_shared_ux_button_toolbar.devdocs.json'; @@ -23,14 +23,14 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh |-------------------|-----------|------------------------|-----------------| | 30 | 0 | 8 | 0 | -## Common +## Client ### Functions - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_card_no_data.mdx b/api_docs/kbn_shared_ux_card_no_data.mdx index f0252f01c744..53954304f53d 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-12-10 +date: 2024-12-13 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 fb0e3a99631d..532f53a8c458 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-card-no-data-mocks'] --- import kbnSharedUxCardNoDataMocksObj from './kbn_shared_ux_card_no_data_mocks.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_chrome_navigation.mdx b/api_docs/kbn_shared_ux_chrome_navigation.mdx index 5e3fe38d9728..579f8eb54fdd 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-12-10 +date: 2024-12-13 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 ae38a19b7f62..07566da92f5d 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-12-10 +date: 2024-12-13 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 6beb3f26d848..7c8084fedb6b 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-12-10 +date: 2024-12-13 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 706879497645..7e2d02efd22b 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-12-10 +date: 2024-12-13 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 9dad1bda446b..4cc201130bd3 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-12-10 +date: 2024-12-13 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 cf98a1960749..bb4ccda3f22c 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_shared_ux_file_picker.devdocs.json index 8afebe976c72..f60003a33ad0 100644 --- a/api_docs/kbn_shared_ux_file_picker.devdocs.json +++ b/api_docs/kbn_shared_ux_file_picker.devdocs.json @@ -1,27 +1,11 @@ { "id": "@kbn/shared-ux-file-picker", "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.FilePicker", + "id": "def-public.FilePicker", "type": "Function", "tags": [], "label": "FilePicker", @@ -30,9 +14,9 @@ "(props: ", { "pluginId": "@kbn/shared-ux-file-picker", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFilePickerPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, ") => React.JSX.Element" @@ -43,7 +27,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.FilePicker.$1", + "id": "def-public.FilePicker.$1", "type": "Object", "tags": [], "label": "props", @@ -51,9 +35,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-file-picker", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFilePickerPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, "" @@ -71,7 +55,7 @@ "interfaces": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props", + "id": "def-public.Props", "type": "Interface", "tags": [], "label": "Props", @@ -79,9 +63,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-file-picker", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFilePickerPluginApi", - "section": "def-common.Props", + "section": "def-public.Props", "text": "Props" }, "" @@ -92,7 +76,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.kind", + "id": "def-public.Props.kind", "type": "Uncategorized", "tags": [], "label": "kind", @@ -108,7 +92,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.shouldAllowDelete", + "id": "def-public.Props.shouldAllowDelete", "type": "Function", "tags": [], "label": "shouldAllowDelete", @@ -132,7 +116,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.shouldAllowDelete.$1", + "id": "def-public.Props.shouldAllowDelete.$1", "type": "Object", "tags": [], "label": "file", @@ -157,7 +141,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.onClose", + "id": "def-public.Props.onClose", "type": "Function", "tags": [], "label": "onClose", @@ -175,7 +159,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.onDone", + "id": "def-public.Props.onDone", "type": "Function", "tags": [], "label": "onDone", @@ -199,7 +183,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.onDone.$1", + "id": "def-public.Props.onDone.$1", "type": "Array", "tags": [], "label": "files", @@ -224,7 +208,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.onUpload", + "id": "def-public.Props.onUpload", "type": "Function", "tags": [], "label": "onUpload", @@ -235,9 +219,9 @@ "((done: ", { "pluginId": "@kbn/shared-ux-file-upload", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFileUploadPluginApi", - "section": "def-common.DoneNotification", + "section": "def-public.DoneNotification", "text": "DoneNotification" }, "[]) => void) | undefined" @@ -248,7 +232,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.onUpload.$1", + "id": "def-public.Props.onUpload.$1", "type": "Array", "tags": [], "label": "done", @@ -256,9 +240,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-file-upload", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFileUploadPluginApi", - "section": "def-common.DoneNotification", + "section": "def-public.DoneNotification", "text": "DoneNotification" }, "[]" @@ -273,7 +257,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.uploadMeta", + "id": "def-public.Props.uploadMeta", "type": "Unknown", "tags": [], "label": "uploadMeta", @@ -289,7 +273,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.pageSize", + "id": "def-public.Props.pageSize", "type": "number", "tags": [], "label": "pageSize", @@ -305,7 +289,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-picker", - "id": "def-common.Props.multiple", + "id": "def-public.Props.multiple", "type": "CompoundType", "tags": [ "default" @@ -328,5 +312,21 @@ "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_shared_ux_file_picker.mdx b/api_docs/kbn_shared_ux_file_picker.mdx index 1b3576896484..8804cd12b719 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-picker'] --- import kbnSharedUxFilePickerObj from './kbn_shared_ux_file_picker.devdocs.json'; @@ -23,11 +23,11 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh |-------------------|-----------|------------------------|-----------------| | 14 | 0 | 6 | 0 | -## Common +## Client ### Functions - + ### Interfaces - + diff --git a/api_docs/kbn_shared_ux_file_types.mdx b/api_docs/kbn_shared_ux_file_types.mdx index 60b250e385b9..c6301fdbb31b 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_shared_ux_file_upload.devdocs.json index a3ad0f3d4189..131c7f36c33a 100644 --- a/api_docs/kbn_shared_ux_file_upload.devdocs.json +++ b/api_docs/kbn_shared_ux_file_upload.devdocs.json @@ -1,27 +1,11 @@ { "id": "@kbn/shared-ux-file-upload", "client": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "server": { - "classes": [], - "functions": [], - "interfaces": [], - "enums": [], - "misc": [], - "objects": [] - }, - "common": { "classes": [], "functions": [ { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.FileUpload", + "id": "def-public.FileUpload", "type": "Function", "tags": [], "label": "FileUpload", @@ -30,9 +14,9 @@ "(props: ", { "pluginId": "@kbn/shared-ux-file-upload", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFileUploadPluginApi", - "section": "def-common.FileUploadProps", + "section": "def-public.FileUploadProps", "text": "FileUploadProps" }, ") => React.JSX.Element" @@ -43,7 +27,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.FileUpload.$1", + "id": "def-public.FileUpload.$1", "type": "CompoundType", "tags": [], "label": "props", @@ -51,9 +35,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-file-upload", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFileUploadPluginApi", - "section": "def-common.FileUploadProps", + "section": "def-public.FileUploadProps", "text": "FileUploadProps" } ], @@ -70,7 +54,7 @@ "interfaces": [ { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.DoneNotification", + "id": "def-public.DoneNotification", "type": "Interface", "tags": [], "label": "DoneNotification", @@ -78,9 +62,9 @@ "signature": [ { "pluginId": "@kbn/shared-ux-file-upload", - "scope": "common", + "scope": "public", "docId": "kibKbnSharedUxFileUploadPluginApi", - "section": "def-common.DoneNotification", + "section": "def-public.DoneNotification", "text": "DoneNotification" }, "" @@ -91,7 +75,7 @@ "children": [ { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.DoneNotification.id", + "id": "def-public.DoneNotification.id", "type": "string", "tags": [], "label": "id", @@ -102,7 +86,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.DoneNotification.kind", + "id": "def-public.DoneNotification.kind", "type": "string", "tags": [], "label": "kind", @@ -113,7 +97,7 @@ }, { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.DoneNotification.fileJSON", + "id": "def-public.DoneNotification.fileJSON", "type": "Object", "tags": [], "label": "fileJSON", @@ -140,7 +124,7 @@ "misc": [ { "parentPluginId": "@kbn/shared-ux-file-upload", - "id": "def-common.FileUploadProps", + "id": "def-public.FileUploadProps", "type": "Type", "tags": [], "label": "FileUploadProps", @@ -156,5 +140,21 @@ } ], "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_shared_ux_file_upload.mdx b/api_docs/kbn_shared_ux_file_upload.mdx index cc92bd7686b6..a81cf9d65d3c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-file-upload'] --- import kbnSharedUxFileUploadObj from './kbn_shared_ux_file_upload.devdocs.json'; @@ -23,14 +23,14 @@ Contact [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sh |-------------------|-----------|------------------------|-----------------| | 7 | 0 | 7 | 1 | -## Common +## Client ### Functions - + ### Interfaces - + ### Consts, variables and types - + diff --git a/api_docs/kbn_shared_ux_file_util.mdx b/api_docs/kbn_shared_ux_file_util.mdx index ba6df33a865c..fc4c52b21007 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-12-10 +date: 2024-12-13 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 d1908e5a2043..f6e30a8fa8a8 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-12-10 +date: 2024-12-13 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 68514ec9753e..9a184c8ce3fc 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-12-10 +date: 2024-12-13 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 2604477f27e1..a7b984b75a49 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-12-10 +date: 2024-12-13 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 26126b89dc85..53379915a007 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-12-10 +date: 2024-12-13 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 471a0023258b..5fb7b20f070e 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-12-10 +date: 2024-12-13 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 265d15cbaf4d..a64e1bcd5aaf 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-12-10 +date: 2024-12-13 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 83e3c89c5514..cd34e4a1a39b 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-12-10 +date: 2024-12-13 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 9913f12207e2..ced126480f09 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-12-10 +date: 2024-12-13 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 067d0719f9b2..6da8cafe5fa3 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-12-10 +date: 2024-12-13 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 28f6bbf10e0c..df6f6ad8bce9 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-12-10 +date: 2024-12-13 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 f3f85740ba4d..b1fc1a29c9e0 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-12-10 +date: 2024-12-13 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 9d2b9dff40a0..5cfeb72b8ab8 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-12-10 +date: 2024-12-13 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 19760b957cb9..3e4201e77716 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-12-10 +date: 2024-12-13 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 e970f0fc22c6..dbfd7267b0ad 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-12-10 +date: 2024-12-13 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 5aa822627f55..be610f057337 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-12-10 +date: 2024-12-13 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 240e58147a12..33adf13defa3 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-12-10 +date: 2024-12-13 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 8642aa9ac4f8..30e642c8a57a 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-12-10 +date: 2024-12-13 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 1a02155b99cb..f4eb8647530a 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-12-10 +date: 2024-12-13 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 95ebb75b17f2..a8bb458ef84c 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-12-10 +date: 2024-12-13 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 18ffcec0fd79..a0ae9e3e9aca 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-12-10 +date: 2024-12-13 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 32cbf9523ead..23af34282365 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-12-10 +date: 2024-12-13 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 55867fa84a97..091fec6aa533 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-12-10 +date: 2024-12-13 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 a69c91c82d52..350b3a610ac0 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-12-10 +date: 2024-12-13 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.mdx b/api_docs/kbn_shared_ux_table_persist.mdx index 23c94ff6dd4f..a36dd231c137 100644 --- a/api_docs/kbn_shared_ux_table_persist.mdx +++ b/api_docs/kbn_shared_ux_table_persist.mdx @@ -8,7 +8,7 @@ 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/shared-ux-table-persist'] --- import kbnSharedUxTablePersistObj from './kbn_shared_ux_table_persist.devdocs.json'; diff --git a/api_docs/kbn_shared_ux_utility.mdx b/api_docs/kbn_shared_ux_utility.mdx index 2cc2dc17261d..07413eee1968 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-12-10 +date: 2024-12-13 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.devdocs.json b/api_docs/kbn_slo_schema.devdocs.json index 434db5f52535..2e67a7d3d310 100644 --- a/api_docs/kbn_slo_schema.devdocs.json +++ b/api_docs/kbn_slo_schema.devdocs.json @@ -25,7 +25,7 @@ "tags": [], "label": "Duration", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -39,7 +39,7 @@ "signature": [ "any" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -53,7 +53,7 @@ "signature": [ "number" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -74,7 +74,7 @@ "text": "DurationUnit" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -107,7 +107,7 @@ "text": "Duration" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -127,7 +127,7 @@ "text": "Duration" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -153,7 +153,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -173,7 +173,7 @@ "text": "Duration" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -199,7 +199,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -219,7 +219,7 @@ "text": "Duration" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -245,7 +245,7 @@ }, ") => boolean" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -265,7 +265,7 @@ "text": "Duration" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -283,7 +283,7 @@ "signature": [ "() => string" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -299,7 +299,7 @@ "signature": [ "() => number" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -315,7 +315,7 @@ "signature": [ "() => number" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -343,7 +343,7 @@ "text": "DurationUnit" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -357,7 +357,7 @@ "signature": [ "string" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -384,7 +384,7 @@ }, ") => moment.unitOfTime.Diff" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -404,7 +404,7 @@ "text": "DurationUnit" } ], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -432,7 +432,7 @@ }, "" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -443,7 +443,7 @@ "tags": [], "label": "total", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false }, @@ -454,7 +454,7 @@ "tags": [], "label": "page", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false }, @@ -465,7 +465,7 @@ "tags": [], "label": "perPage", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false }, @@ -479,7 +479,7 @@ "signature": [ "T[]" ], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false } @@ -493,7 +493,7 @@ "tags": [], "label": "Pagination", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -504,7 +504,7 @@ "tags": [], "label": "page", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false }, @@ -515,7 +515,7 @@ "tags": [], "label": "perPage", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/pagination.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts", "deprecated": false, "trackAdoption": false } @@ -531,7 +531,7 @@ "tags": [], "label": "DurationUnit", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/models/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -548,7 +548,7 @@ "signature": [ "\"*\"" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -563,7 +563,7 @@ "signature": [ "{ type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -578,7 +578,7 @@ "signature": [ "{ type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -593,7 +593,7 @@ "signature": [ "\"occurrences\" | \"timeslices\"" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -608,7 +608,7 @@ "signature": [ "{ name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; } & { id?: string | undefined; settings?: { syncDelay?: string | undefined; frequency?: string | undefined; preventInitialBackfill?: boolean | undefined; syncField?: string | null | undefined; } | undefined; tags?: string[] | undefined; groupBy?: string | string[] | undefined; revision?: number | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -663,7 +663,7 @@ }, " | undefined; preventInitialBackfill?: boolean | undefined; syncField?: string | null | undefined; } | undefined; tags?: string[] | undefined; groupBy?: string | string[] | undefined; revision?: number | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -678,7 +678,7 @@ "signature": [ "{ id: string; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -693,7 +693,7 @@ "signature": [ "{ list: ({ sloId: string; instanceId: string; } & { excludeRollup?: boolean | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -708,7 +708,7 @@ "signature": [ "{ list: ({ sloId: string; instanceId: string; } & { excludeRollup?: boolean | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -747,7 +747,7 @@ }, " | undefined; }; groupBy: string | string[]; revision: number; } & { remoteName?: string | undefined; range?: { from: Date; to: Date; } | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -762,7 +762,7 @@ "signature": [ "{ sloId: string; instanceId: string; data: { date: string; status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; }[]; }[]" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -777,7 +777,7 @@ "signature": [ "{ list: { sloId: string; sloInstanceId: string; }[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -792,7 +792,7 @@ "signature": [ "{ sloId: string; sloInstanceId: string; sloRevision: number; state: \"running\" | \"indexing\" | \"no_data\" | \"stale\"; health: { overall: \"healthy\" | \"unhealthy\"; rollup: \"healthy\" | \"unhealthy\"; summary: \"healthy\" | \"unhealthy\"; }; }[]" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -807,7 +807,7 @@ "signature": [ "({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -822,7 +822,7 @@ "signature": [ "{ search?: string | undefined; includeOutdatedOnly?: boolean | undefined; page?: string | undefined; perPage?: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -837,7 +837,7 @@ "signature": [ "{ page: number; perPage: number; total: number; results: { id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; }[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -852,7 +852,7 @@ "signature": [ "{ page?: string | undefined; perPage?: string | undefined; groupBy?: \"status\" | \"slo.instanceId\" | \"_index\" | \"ungrouped\" | \"slo.tags\" | \"slo.indicator.type\" | undefined; groupsFilter?: string | string[] | undefined; kqlQuery?: string | undefined; filters?: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -867,7 +867,7 @@ "signature": [ "{ page: number; perPage: number; total: number; results: { group: string; groupBy: \"status\" | \"slo.instanceId\" | \"_index\" | \"ungrouped\" | \"slo.tags\" | \"slo.indicator.type\"; summary: { total: number; worst: { sliValue: number; status: string; slo: { id: string; instanceId: string; name: string; groupings: { [x: string]: unknown; }; }; }; violated: number; healthy: number; degrading: number; noData: number; }; }[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -882,7 +882,7 @@ "signature": [ "{ filters?: string | undefined; kqlQuery?: string | undefined; page?: string | undefined; perPage?: string | undefined; sortBy?: \"status\" | \"error_budget_consumed\" | \"error_budget_remaining\" | \"sli_value\" | \"burn_rate_5m\" | \"burn_rate_1h\" | \"burn_rate_1d\" | undefined; sortDirection?: \"asc\" | \"desc\" | undefined; hideStale?: boolean | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -897,7 +897,7 @@ "signature": [ "{ page: number; perPage: number; total: number; results: ({ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; } & { summary: { status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; fiveMinuteBurnRate: number; oneHourBurnRate: number; oneDayBurnRate: number; } & { summaryUpdatedAt?: string | null | undefined; }; groupings: { [x: string]: string | number; }; } & { instanceId?: string | undefined; meta?: { synthetics?: { monitorId: string; locationId: string; configId: string; } | undefined; } | undefined; remote?: { remoteName: string; kibanaUrl: string; } | undefined; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -920,7 +920,7 @@ }, " | undefined; }) | undefined; instanceId?: string | undefined; groupBy?: string | string[] | undefined; remoteName?: string | undefined; groupings?: { [x: string]: unknown; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -935,7 +935,7 @@ "signature": [ "({ date: string; sliValue: number | null; } & { events?: { good: number; bad: number; total: number; } | undefined; })[]" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -950,7 +950,7 @@ "signature": [ "{ burnRates: { name: string; burnRate: number; sli: number; }[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -965,7 +965,7 @@ "signature": [ "{ instanceId: string; groupingKey: string; } & { search?: string | undefined; afterKey?: string | undefined; size?: string | undefined; excludeStale?: boolean | undefined; remoteName?: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -980,7 +980,7 @@ "signature": [ "{ groupingKey: string; values: string[]; afterKey: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -995,7 +995,7 @@ "signature": [ "{ instanceId?: string | undefined; remoteName?: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1010,7 +1010,7 @@ "signature": [ "{ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; } & { summary: { status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; fiveMinuteBurnRate: number; oneHourBurnRate: number; oneDayBurnRate: number; } & { summaryUpdatedAt?: string | null | undefined; }; groupings: { [x: string]: string | number; }; } & { instanceId?: string | undefined; meta?: { synthetics?: { monitorId: string; locationId: string; configId: string; } | undefined; } | undefined; remote?: { remoteName: string; kibanaUrl: string; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1025,7 +1025,7 @@ "signature": [ "{ useAllRemoteClusters: boolean; selectedRemoteClusters: string[]; staleThresholdInHours: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1040,7 +1040,7 @@ "signature": [ "{ tags: { label: string; value: string; count: number; }[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1055,7 +1055,7 @@ "signature": [ "{ [x: string]: string | number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1070,7 +1070,7 @@ "signature": [ "{ total: number; worst: { sliValue: number; status: string; slo: { id: string; instanceId: string; name: string; groupings: { [x: string]: unknown; }; }; }; violated: number; healthy: number; degrading: number; noData: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1085,7 +1085,7 @@ "signature": [ "{ type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1100,7 +1100,7 @@ "signature": [ "{ date: string; status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1115,7 +1115,7 @@ "signature": [ "{ type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1130,7 +1130,7 @@ "signature": [ "\"sli.apm.transactionDuration\" | \"sli.apm.transactionErrorRate\" | \"sli.synthetics.availability\" | \"sli.kql.custom\" | \"sli.metric.custom\" | \"sli.metric.timeslice\" | \"sli.histogram.custom\"" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1145,7 +1145,7 @@ "signature": [ "{ type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1160,7 +1160,7 @@ "signature": [ "{ kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1175,7 +1175,7 @@ "signature": [ "{ id: string; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/manage.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1190,7 +1190,7 @@ "signature": [ "{ type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1205,7 +1205,7 @@ "signature": [ "{ target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1220,7 +1220,7 @@ "signature": [ "{ useAllRemoteClusters: boolean; selectedRemoteClusters: string[]; staleThresholdInHours: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1235,7 +1235,7 @@ "signature": [ "{ useAllRemoteClusters: boolean; selectedRemoteClusters: string[]; staleThresholdInHours: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1250,7 +1250,7 @@ "signature": [ "string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1265,7 +1265,7 @@ "signature": [ "{ id: string; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1280,7 +1280,7 @@ "signature": [ "{ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1295,7 +1295,7 @@ "signature": [ "{ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1310,7 +1310,7 @@ "signature": [ "{ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; } & { summary: { status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; fiveMinuteBurnRate: number; oneHourBurnRate: number; oneDayBurnRate: number; } & { summaryUpdatedAt?: string | null | undefined; }; groupings: { [x: string]: string | number; }; } & { instanceId?: string | undefined; meta?: { synthetics?: { monitorId: string; locationId: string; configId: string; } | undefined; } | undefined; remote?: { remoteName: string; kibanaUrl: string; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1325,7 +1325,7 @@ "signature": [ "{ type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1340,7 +1340,7 @@ "signature": [ "{ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1355,7 +1355,7 @@ "signature": [ "{ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1370,7 +1370,7 @@ "signature": [ "{ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1385,7 +1385,7 @@ "signature": [ "{ type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1400,7 +1400,7 @@ "signature": [ "\"rolling\" | \"calendarAligned\"" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1415,7 +1415,7 @@ "signature": [ "{ name?: string | undefined; description?: string | undefined; indicator?: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | undefined; timeWindow?: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; } | undefined; budgetingMethod?: \"occurrences\" | \"timeslices\" | undefined; objective?: ({ target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }) | undefined; settings?: { syncDelay?: string | undefined; frequency?: string | undefined; preventInitialBackfill?: boolean | undefined; syncField?: string | null | undefined; } | undefined; tags?: string[] | undefined; groupBy?: string | string[] | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1470,7 +1470,7 @@ }, " | undefined; preventInitialBackfill?: boolean | undefined; syncField?: string | null | undefined; } | undefined; tags?: string[] | undefined; groupBy?: string | string[] | undefined; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1485,7 +1485,7 @@ "signature": [ "{ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; }" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1507,7 +1507,7 @@ "StringC", "]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1535,7 +1535,7 @@ "StringC", "]>>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1643,7 +1643,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1659,7 +1659,7 @@ "LiteralC", "<\"sli.apm.transactionDuration\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1765,7 +1765,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1781,7 +1781,7 @@ "LiteralC", "<\"sli.apm.transactionErrorRate\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1801,7 +1801,7 @@ "LiteralC", "<\"timeslices\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1829,7 +1829,7 @@ "LiteralC", "<\"calendarAligned\">; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1845,7 +1845,7 @@ "LiteralC", "<\"calendarAligned\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3425,7 +3425,7 @@ "NumberC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3443,7 +3443,7 @@ "Type", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3463,7 +3463,7 @@ "Type", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3479,7 +3479,7 @@ "Type", "" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3511,7 +3511,7 @@ "BooleanC", "; }>]>>; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3531,7 +3531,7 @@ "Type", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3555,7 +3555,7 @@ }, ", string, unknown>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/duration.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3579,7 +3579,7 @@ "BooleanC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3689,7 +3689,7 @@ "Type", "; }>; }>]>>; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3743,7 +3743,7 @@ "BooleanC", "; }>; }>>; }>>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3773,7 +3773,7 @@ "StringC", "]>; }>>; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3831,7 +3831,7 @@ "LiteralC", "<\"unhealthy\">]>; }>; }>>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3891,7 +3891,7 @@ "AnyC", "; }>]>>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3917,7 +3917,7 @@ "StringC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5513,7 +5513,7 @@ "NumberC", "; }>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5561,7 +5561,7 @@ "StringC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5635,7 +5635,7 @@ "NumberC", "; }>; }>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5685,7 +5685,7 @@ "Type", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7359,7 +7359,7 @@ "StringC", "; }>; }>]>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8877,7 +8877,7 @@ "UnknownC", ">; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8915,7 +8915,7 @@ "NumberC", "; }>; }>]>>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8965,7 +8965,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8991,7 +8991,7 @@ "NumberC", "; }>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9031,7 +9031,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9059,7 +9059,7 @@ "UndefinedC", "]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9093,7 +9093,7 @@ "StringC", "; }>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10757,7 +10757,7 @@ "StringC", "; }>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10783,7 +10783,7 @@ "NumberC", "; }>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10811,7 +10811,7 @@ "StringC", "]>>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10835,7 +10835,7 @@ "NumberC", "]>>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10881,7 +10881,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10901,7 +10901,7 @@ "LiteralC", "<\"unhealthy\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11253,7 +11253,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11269,7 +11269,7 @@ "LiteralC", "<\"sli.histogram.custom\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -11309,7 +11309,7 @@ "BooleanC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -12769,7 +12769,7 @@ "StringC", "; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -12785,7 +12785,7 @@ "Type", "" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -12815,7 +12815,7 @@ "LiteralC", "<\"sli.histogram.custom\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13007,7 +13007,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13023,7 +13023,7 @@ "LiteralC", "<\"sli.kql.custom\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13038,7 +13038,7 @@ "signature": [ "StringC" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13102,7 +13102,7 @@ "AnyC", "; }>]>>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13122,7 +13122,7 @@ "Type", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/manage.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13146,7 +13146,7 @@ "StringC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13226,7 +13226,7 @@ "AnyC", "; }>]>>; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13304,7 +13304,7 @@ "AnyC", "; }>]>>; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13664,7 +13664,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13680,7 +13680,7 @@ "LiteralC", "<\"sli.metric.custom\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13714,7 +13714,7 @@ }, ", string, unknown>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13730,7 +13730,7 @@ "LiteralC", "<\"occurrences\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13774,7 +13774,7 @@ "NullC", "]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13794,7 +13794,7 @@ "NumberC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13820,7 +13820,7 @@ "NumberC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13844,7 +13844,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13912,7 +13912,7 @@ "AnyC", "; }>]>>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13932,7 +13932,7 @@ "StringC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13952,7 +13952,7 @@ "Type", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15538,7 +15538,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15566,7 +15566,7 @@ "LiteralC", "<\"rolling\">; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15582,7 +15582,7 @@ "LiteralC", "<\"rolling\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -15630,7 +15630,7 @@ "NullC", "]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -17216,7 +17216,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -17280,7 +17280,7 @@ "NumberC", "; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -17296,7 +17296,7 @@ "Type", "" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -17314,7 +17314,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -17338,7 +17338,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/settings.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19002,7 +19002,7 @@ "StringC", "; }>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19026,7 +19026,7 @@ "LiteralC", "<\"stale\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/health.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19050,7 +19050,7 @@ "LiteralC", "<\"VIOLATED\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19104,7 +19104,7 @@ "NullC", "]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/common.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19234,7 +19234,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19250,7 +19250,7 @@ "LiteralC", "<\"sli.synthetics.availability\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19268,7 +19268,7 @@ "StringC", ">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19286,7 +19286,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19366,7 +19366,7 @@ "AnyC", "; }>]>>; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19378,7 +19378,7 @@ "tags": [], "label": "timesliceMetricComparatorMapping", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -19389,7 +19389,7 @@ "tags": [], "label": "GT", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false }, @@ -19400,7 +19400,7 @@ "tags": [], "label": "GTE", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false }, @@ -19411,7 +19411,7 @@ "tags": [], "label": "LT", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false }, @@ -19422,7 +19422,7 @@ "tags": [], "label": "LTE", "description": [], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false } @@ -19502,7 +19502,7 @@ "AnyC", "; }>]>>; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19796,7 +19796,7 @@ "StringC", "; }>]>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -19812,7 +19812,7 @@ "LiteralC", "<\"sli.metric.timeslice\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -20026,7 +20026,7 @@ "AnyC", "; }>]>>; }>]>; }>]>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -20108,7 +20108,7 @@ "AnyC", "; }>]>>; }>]>; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/indicators.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -20124,7 +20124,7 @@ "LiteralC", "<\"timeslices\">" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/slo.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -20168,7 +20168,7 @@ "LiteralC", "<\"calendarAligned\">; }>]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -20188,7 +20188,7 @@ "LiteralC", "<\"calendarAligned\">]>" ], - "path": "x-pack/packages/kbn-slo-schema/src/schema/time_window.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -21764,7 +21764,7 @@ "StringC", "]>>]>; }>; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -23350,7 +23350,7 @@ "NumberC", "; }>" ], - "path": "x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts", + "path": "x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/kbn_slo_schema.mdx b/api_docs/kbn_slo_schema.mdx index 0e07f12737d3..6c4eae4aca40 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-12-10 +date: 2024-12-13 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 266e25316751..d70da50c5952 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-12-10 +date: 2024-12-13 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 6df76da5ee1c..a4140cf44b27 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sort-predicates'] --- import kbnSortPredicatesObj from './kbn_sort_predicates.devdocs.json'; diff --git a/api_docs/kbn_sse_utils.mdx b/api_docs/kbn_sse_utils.mdx index c7e2ed7c6e7f..32dba41d30cd 100644 --- a/api_docs/kbn_sse_utils.mdx +++ b/api_docs/kbn_sse_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils title: "@kbn/sse-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils'] --- import kbnSseUtilsObj from './kbn_sse_utils.devdocs.json'; diff --git a/api_docs/kbn_sse_utils_client.mdx b/api_docs/kbn_sse_utils_client.mdx index 71c40e3e32ec..40a74dffc943 100644 --- a/api_docs/kbn_sse_utils_client.mdx +++ b/api_docs/kbn_sse_utils_client.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils-client title: "@kbn/sse-utils-client" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils-client plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils-client'] --- import kbnSseUtilsClientObj from './kbn_sse_utils_client.devdocs.json'; diff --git a/api_docs/kbn_sse_utils_server.devdocs.json b/api_docs/kbn_sse_utils_server.devdocs.json index dbf75dfc2083..3039d2e3389a 100644 --- a/api_docs/kbn_sse_utils_server.devdocs.json +++ b/api_docs/kbn_sse_utils_server.devdocs.json @@ -29,7 +29,15 @@ "signature": [ "(source$: ", "Observable", - " & { type: string; }>) => ", + " & { type: string; }>, {\n logger,\n signal,\n }: { logger: Pick<", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.Logger", + "text": "Logger" + }, + ", \"error\" | \"debug\">; signal: AbortSignal; }) => ", "PassThrough" ], "path": "packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts", @@ -51,6 +59,95 @@ "deprecated": false, "trackAdoption": false, "isRequired": true + }, + { + "parentPluginId": "@kbn/sse-utils-server", + "id": "def-common.observableIntoEventSourceStream.$2", + "type": "Object", + "tags": [], + "label": "{\n logger,\n signal,\n }", + "description": [], + "path": "packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/sse-utils-server", + "id": "def-common.observableIntoEventSourceStream.$2.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + "{ error: (errorOrMessage: Error | ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void; debug: (message: ", + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.LogMessageSource", + "text": "LogMessageSource" + }, + ", meta?: Meta | undefined) => void; }" + ], + "path": "packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "@kbn/sse-utils-server", + "id": "def-common.observableIntoEventSourceStream.$2.signal", + "type": "Object", + "tags": [], + "label": "signal", + "description": [], + "signature": [ + "AbortSignal" + ], + "path": "packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts", + "deprecated": false, + "trackAdoption": false + } + ] } ], "returnComment": [], diff --git a/api_docs/kbn_sse_utils_server.mdx b/api_docs/kbn_sse_utils_server.mdx index ba641ade176f..76f4d80ac641 100644 --- a/api_docs/kbn_sse_utils_server.mdx +++ b/api_docs/kbn_sse_utils_server.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-sse-utils-server title: "@kbn/sse-utils-server" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/sse-utils-server plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/sse-utils-server'] --- import kbnSseUtilsServerObj from './kbn_sse_utils_server.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 | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 3 | 0 | +| 7 | 0 | 6 | 0 | ## Common diff --git a/api_docs/kbn_std.mdx b/api_docs/kbn_std.mdx index 713b5a6e8264..c1b07209d24b 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-12-10 +date: 2024-12-13 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 434de060b7cb..b3bbbce946c9 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-12-10 +date: 2024-12-13 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 5e4273929e99..d1b0bab74291 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/storybook'] --- import kbnStorybookObj from './kbn_storybook.devdocs.json'; diff --git a/api_docs/kbn_synthetics_e2e.devdocs.json b/api_docs/kbn_synthetics_e2e.devdocs.json index 279942a1d8bc..c1cf32a65f2e 100644 --- a/api_docs/kbn_synthetics_e2e.devdocs.json +++ b/api_docs/kbn_synthetics_e2e.devdocs.json @@ -17,345 +17,7 @@ "objects": [] }, "common": { - "classes": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner", - "type": "Class", - "tags": [], - "label": "SyntheticsRunner", - "description": [], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.getService", - "type": "Any", - "tags": [], - "label": "getService", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.kibanaUrl", - "type": "string", - "tags": [], - "label": "kibanaUrl", - "description": [], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.testFilesLoaded", - "type": "boolean", - "tags": [], - "label": "testFilesLoaded", - "description": [], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.params", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "ArgParams" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.Unnamed", - "type": "Function", - "tags": [], - "label": "Constructor", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.Unnamed.$1", - "type": "Any", - "tags": [], - "label": "getService", - "description": [], - "signature": [ - "any" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.Unnamed.$2", - "type": "Object", - "tags": [], - "label": "params", - "description": [], - "signature": [ - "ArgParams" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.setup", - "type": "Function", - "tags": [], - "label": "setup", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.createTestUsers", - "type": "Function", - "tags": [], - "label": "createTestUsers", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestFiles", - "type": "Function", - "tags": [], - "label": "loadTestFiles", - "description": [], - "signature": [ - "(callback: (reload?: boolean | undefined) => Promise, reload?: boolean) => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestFiles.$1", - "type": "Function", - "tags": [], - "label": "callback", - "description": [], - "signature": [ - "(reload?: boolean | undefined) => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestFiles.$2", - "type": "boolean", - "tags": [], - "label": "reload", - "description": [], - "signature": [ - "boolean" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestData", - "type": "Function", - "tags": [], - "label": "loadTestData", - "description": [], - "signature": [ - "(e2eDir: string, dataArchives: string[]) => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestData.$1", - "type": "string", - "tags": [], - "label": "e2eDir", - "description": [], - "signature": [ - "string" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.loadTestData.$2", - "type": "Array", - "tags": [], - "label": "dataArchives", - "description": [], - "signature": [ - "string[]" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.getKibanaUrl", - "type": "Function", - "tags": [], - "label": "getKibanaUrl", - "description": [], - "signature": [ - "() => string" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.getElasticsearchUrl", - "type": "Function", - "tags": [], - "label": "getElasticsearchUrl", - "description": [], - "signature": [ - "() => string" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.run", - "type": "Function", - "tags": [], - "label": "run", - "description": [], - "signature": [ - "() => Promise" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.assertResults", - "type": "Function", - "tags": [], - "label": "assertResults", - "description": [], - "signature": [ - "(results: { [x: string]: ", - "JourneyResult", - "; }) => void" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.assertResults.$1", - "type": "Object", - "tags": [], - "label": "results", - "description": [], - "signature": [ - "{ [x: string]: ", - "JourneyResult", - "; }" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": true - } - ], - "returnComment": [] - }, - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.SyntheticsRunner.cleanUp", - "type": "Function", - "tags": [], - "label": "cleanUp", - "description": [], - "signature": [ - "() => void" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - } - ], - "initialIsOpen": false - } - ], + "classes": [], "functions": [ { "parentPluginId": "@kbn/synthetics-e2e", @@ -369,7 +31,7 @@ "Page", "; isRemote?: boolean | undefined; username?: string | undefined; password?: string | undefined; }) => { waitForLoadingToFinish(): Promise; loginToKibana(usernameT?: \"editor\" | \"viewer\" | undefined, passwordT?: string | undefined): Promise; }" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -380,7 +42,7 @@ "tags": [], "label": "{\n page,\n isRemote = false,\n username = 'elastic',\n password = 'changeme',\n}", "description": [], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -394,7 +56,7 @@ "signature": [ "Page" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false }, @@ -408,7 +70,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false }, @@ -422,7 +84,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false }, @@ -436,7 +98,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx", "deprecated": false, "trackAdoption": false } @@ -462,7 +124,7 @@ "ElementHandle", ">; }" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/utils.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -473,7 +135,7 @@ "tags": [], "label": "{ page }", "description": [], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/utils.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -487,7 +149,7 @@ "signature": [ "Page" ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/page_objects/utils.tsx", + "path": "x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx", "deprecated": false, "trackAdoption": false } @@ -501,22 +163,6 @@ "interfaces": [], "enums": [], "misc": [], - "objects": [ - { - "parentPluginId": "@kbn/synthetics-e2e", - "id": "def-common.argv", - "type": "Object", - "tags": [], - "label": "argv", - "description": [], - "signature": [ - "{ [x: string]: unknown; headless: boolean; bail: boolean; grep: undefined; _: string[]; $0: string; }" - ], - "path": "x-pack/plugins/observability_solution/synthetics/e2e/helpers/parse_args_params.ts", - "deprecated": false, - "trackAdoption": false, - "initialIsOpen": false - } - ] + "objects": [] } } \ No newline at end of file diff --git a/api_docs/kbn_synthetics_e2e.mdx b/api_docs/kbn_synthetics_e2e.mdx index 21c5a7dfe881..41fd6b07dbc9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/synthetics-e2e'] --- import kbnSyntheticsE2eObj from './kbn_synthetics_e2e.devdocs.json'; @@ -21,16 +21,10 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 32 | 2 | 32 | 0 | +| 9 | 0 | 9 | 0 | ## Common -### Objects - - ### Functions -### Classes - - diff --git a/api_docs/kbn_synthetics_private_location.mdx b/api_docs/kbn_synthetics_private_location.mdx index fcc0b28808d3..450844e04ccd 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-12-10 +date: 2024-12-13 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 bf80b02cdbb5..da0e0520b535 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-12-10 +date: 2024-12-13 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 90b99d676f20..a96697838614 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-12-10 +date: 2024-12-13 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 c2087a4d8dcc..7189a568facf 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-12-10 +date: 2024-12-13 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 a4c009f13823..cba4df7c4758 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-12-10 +date: 2024-12-13 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 3eee4b5fcf63..60e370706081 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/test-subj-selector'] --- import kbnTestSubjSelectorObj from './kbn_test_subj_selector.devdocs.json'; diff --git a/api_docs/kbn_timerange.mdx b/api_docs/kbn_timerange.mdx index c623e767d023..592f530c5501 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/timerange'] --- import kbnTimerangeObj from './kbn_timerange.devdocs.json'; diff --git a/api_docs/kbn_tooling_log.mdx b/api_docs/kbn_tooling_log.mdx index 7e39333f85de..815387d551eb 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/tooling-log'] --- import kbnToolingLogObj from './kbn_tooling_log.devdocs.json'; diff --git a/api_docs/kbn_transpose_utils.mdx b/api_docs/kbn_transpose_utils.mdx index ee25d7b22877..d10725966cdc 100644 --- a/api_docs/kbn_transpose_utils.mdx +++ b/api_docs/kbn_transpose_utils.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/kbn-transpose-utils title: "@kbn/transpose-utils" image: https://source.unsplash.com/400x175/?github description: API docs for the @kbn/transpose-utils plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/transpose-utils'] --- import kbnTransposeUtilsObj from './kbn_transpose_utils.devdocs.json'; diff --git a/api_docs/kbn_triggers_actions_ui_types.mdx b/api_docs/kbn_triggers_actions_ui_types.mdx index 1ed43aacfbeb..6d20084ba61f 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-12-10 +date: 2024-12-13 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 ab433f5c8f1c..0165ea9f1866 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-12-10 +date: 2024-12-13 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 089172c24b07..ebf06a4f81b3 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-12-10 +date: 2024-12-13 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 e71c62047b2e..d200d76f5a9b 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-12-10 +date: 2024-12-13 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 91519393d174..4589e9ca47bd 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-12-10 +date: 2024-12-13 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 8ef4bbb1b2dd..5eb2e9f0728b 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-12-10 +date: 2024-12-13 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 50f9bb53556b..b4c752a1b405 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/ui-theme'] --- import kbnUiThemeObj from './kbn_ui_theme.devdocs.json'; diff --git a/api_docs/kbn_unified_data_table.mdx b/api_docs/kbn_unified_data_table.mdx index ecf1da9eed3f..90495c845689 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/unified-data-table'] --- import kbnUnifiedDataTableObj from './kbn_unified_data_table.devdocs.json'; diff --git a/api_docs/kbn_unified_doc_viewer.mdx b/api_docs/kbn_unified_doc_viewer.mdx index 9adf0481ac2c..5dd244d3b503 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-12-10 +date: 2024-12-13 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 a25c3dc4592e..63c7d18d0e13 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-12-10 +date: 2024-12-13 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 a39c3736b906..c80136585e40 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-12-10 +date: 2024-12-13 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 58ddf3fd5c7a..a86a8fb7fdd9 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-12-10 +date: 2024-12-13 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 a00d54551c2d..3559a9bf5fea 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-12-10 +date: 2024-12-13 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 1eaf4a327fa2..2ab18dae8d06 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-12-10 +date: 2024-12-13 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 a70e0d6405eb..6552ed1209de 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-12-10 +date: 2024-12-13 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 f6f8885e181e..7560dc515c1d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utility-types-jest'] --- import kbnUtilityTypesJestObj from './kbn_utility_types_jest.devdocs.json'; diff --git a/api_docs/kbn_utils.mdx b/api_docs/kbn_utils.mdx index f5093649e563..63a2681908c0 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/utils'] --- import kbnUtilsObj from './kbn_utils.devdocs.json'; diff --git a/api_docs/kbn_visualization_ui_components.devdocs.json b/api_docs/kbn_visualization_ui_components.devdocs.json index c89a8276981b..f6e3a7ee20b2 100644 --- a/api_docs/kbn_visualization_ui_components.devdocs.json +++ b/api_docs/kbn_visualization_ui_components.devdocs.json @@ -47,7 +47,7 @@ "label": "ColorPicker", "description": [], "signature": [ - "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, }: ", + "({ overwriteColor, defaultColor, isClearable, setConfig, label, disableHelpTooltip, disabledMessage, showAlpha, swatches, }: ", { "pluginId": "@kbn/visualization-ui-components", "scope": "public", @@ -66,7 +66,7 @@ "id": "def-public.ColorPicker.$1", "type": "Object", "tags": [], - "label": "{\n overwriteColor,\n defaultColor,\n isClearable,\n setConfig,\n label,\n disableHelpTooltip,\n disabledMessage,\n showAlpha,\n}", + "label": "{\n overwriteColor,\n defaultColor,\n isClearable,\n setConfig,\n label,\n disableHelpTooltip,\n disabledMessage,\n showAlpha,\n swatches,\n}", "description": [], "signature": [ { @@ -2058,6 +2058,20 @@ "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "@kbn/visualization-ui-components", + "id": "def-public.ColorPickerProps.swatches", + "type": "Array", + "tags": [], + "label": "swatches", + "description": [], + "signature": [ + "string[]" + ], + "path": "packages/kbn-visualization-ui-components/components/color_picker.tsx", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/kbn_visualization_ui_components.mdx b/api_docs/kbn_visualization_ui_components.mdx index a375d6d38afb..5028cd5f4fb3 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 144 | 0 | 138 | 4 | +| 145 | 0 | 139 | 4 | ## Client diff --git a/api_docs/kbn_visualization_utils.mdx b/api_docs/kbn_visualization_utils.mdx index ed9aad8b4139..36d6438b12a2 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-12-10 +date: 2024-12-13 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 9004a0f42745..0f40e22f289f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/xstate-utils'] --- import kbnXstateUtilsObj from './kbn_xstate_utils.devdocs.json'; diff --git a/api_docs/kbn_yarn_lock_validator.mdx b/api_docs/kbn_yarn_lock_validator.mdx index 653fcb4d79bf..03702c40133a 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/yarn-lock-validator'] --- import kbnYarnLockValidatorObj from './kbn_yarn_lock_validator.devdocs.json'; diff --git a/api_docs/kbn_zod.mdx b/api_docs/kbn_zod.mdx index 40a181dc684d..47fa3ea46509 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod'] --- import kbnZodObj from './kbn_zod.devdocs.json'; diff --git a/api_docs/kbn_zod_helpers.devdocs.json b/api_docs/kbn_zod_helpers.devdocs.json index ea7b86d74c0c..885029ffc043 100644 --- a/api_docs/kbn_zod_helpers.devdocs.json +++ b/api_docs/kbn_zod_helpers.devdocs.json @@ -167,6 +167,54 @@ "returnComment": [], "initialIsOpen": false }, + { + "parentPluginId": "@kbn/zod-helpers", + "id": "def-common.isNonEmptyString", + "type": "Function", + "tags": [], + "label": "isNonEmptyString", + "description": [], + "signature": [ + "(input: string, ctx: Zod.RefinementCtx) => void" + ], + "path": "packages/kbn-zod-helpers/src/non_empty_string.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "@kbn/zod-helpers", + "id": "def-common.isNonEmptyString.$1", + "type": "string", + "tags": [], + "label": "input", + "description": [], + "signature": [ + "string" + ], + "path": "packages/kbn-zod-helpers/src/non_empty_string.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "@kbn/zod-helpers", + "id": "def-common.isNonEmptyString.$2", + "type": "Object", + "tags": [], + "label": "ctx", + "description": [], + "signature": [ + "Zod.RefinementCtx" + ], + "path": "packages/kbn-zod-helpers/src/non_empty_string.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "@kbn/zod-helpers", "id": "def-common.isValidDateMath", diff --git a/api_docs/kbn_zod_helpers.mdx b/api_docs/kbn_zod_helpers.mdx index 0885ecaca722..8879ebae2d12 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', '@kbn/zod-helpers'] --- import kbnZodHelpersObj from './kbn_zod_helpers.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/security-detection-rule-management](https://github.com/orgs/el | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 20 | 0 | 10 | 0 | +| 23 | 0 | 13 | 0 | ## Common diff --git a/api_docs/kibana_overview.mdx b/api_docs/kibana_overview.mdx index 6aff7fa949e0..cefde0612664 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'kibanaOverview'] --- import kibanaOverviewObj from './kibana_overview.devdocs.json'; diff --git a/api_docs/kibana_react.devdocs.json b/api_docs/kibana_react.devdocs.json index c893f9283518..f9f20e71faba 100644 --- a/api_docs/kibana_react.devdocs.json +++ b/api_docs/kibana_react.devdocs.json @@ -966,6 +966,14 @@ { "plugin": "observabilityShared", "path": "x-pack/plugins/observability_solution/observability_shared/public/components/header_menu/header_menu_portal.tsx" + }, + { + "plugin": "monitoring", + "path": "x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx" + }, + { + "plugin": "monitoring", + "path": "x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx" } ], "children": [ @@ -1478,19 +1486,19 @@ "references": [ { "plugin": "aiAssistantManagementSelection", - "path": "src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx" + "path": "src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx" }, { "plugin": "aiAssistantManagementSelection", - "path": "src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx" + "path": "src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx" }, { "plugin": "observabilityAiAssistantManagement", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx" + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx" }, { "plugin": "observabilityAiAssistantManagement", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx" + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx" } ], "children": [ diff --git a/api_docs/kibana_react.mdx b/api_docs/kibana_react.mdx index be05b56eda8b..4dbb9173f575 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-12-10 +date: 2024-12-13 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 5396d6f8ed22..7094ff336fc3 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-12-10 +date: 2024-12-13 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 2e7cf52c6ee9..ab61a6790d3f 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-12-10 +date: 2024-12-13 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 17f5de4a4d6e..edfe90bca0c7 100644 --- a/api_docs/lens.devdocs.json +++ b/api_docs/lens.devdocs.json @@ -132,14 +132,6 @@ "text": "PublishingSubject" }, " | undefined; resetUnsavedChanges?: (() => boolean) | undefined; serializeState: () => ", - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.MaybePromise", - "text": "MaybePromise" - }, - "<", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -385,7 +377,7 @@ "section": "def-common.DynamicActionsState", "text": "DynamicActionsState" }, - "; } | undefined; isNewPanel?: boolean | undefined; }>>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", + "; } | undefined; isNewPanel?: boolean | undefined; }>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -689,7 +681,15 @@ "section": "def-common.AggregateQuery", "text": "AggregateQuery" }, - " | undefined>; rendered$: ", + " | undefined>; searchSessionId$: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "; rendered$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6678,7 +6678,7 @@ "\nReact component which can be used to embed a Lens visualization into another application.\nSee `x-pack/examples/embedded_lens_example` for exemplary usage.\n\nThis API might undergo breaking changes even in minor versions.\n" ], "signature": [ - "({ title, withDefaultActions, extraActions, showInspector, syncColors, syncCursor, syncTooltips, viewMode, id, query, filters, timeRange, disabledActions, ...props }: { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", + "({ title, withDefaultActions, extraActions, showInspector, syncColors, syncCursor, syncTooltips, viewMode, id, query, filters, timeRange, disabledActions, searchSessionId, hidePanelTitles, ...props }: { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -17756,14 +17756,6 @@ "text": "PublishingSubject" }, " | undefined; resetUnsavedChanges?: (() => boolean) | undefined; serializeState: () => ", - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.MaybePromise", - "text": "MaybePromise" - }, - "<", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -18009,7 +18001,7 @@ "section": "def-common.DynamicActionsState", "text": "DynamicActionsState" }, - "; } | undefined; isNewPanel?: boolean | undefined; }>>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", + "; } | undefined; isNewPanel?: boolean | undefined; }>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -18313,7 +18305,15 @@ "section": "def-common.AggregateQuery", "text": "AggregateQuery" }, - " | undefined>; rendered$: ", + " | undefined>; searchSessionId$: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "; rendered$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -20310,14 +20310,6 @@ "text": "PublishingSubject" }, " | undefined; resetUnsavedChanges?: (() => boolean) | undefined; serializeState: () => ", - { - "pluginId": "@kbn/utility-types", - "scope": "common", - "docId": "kibKbnUtilityTypesPluginApi", - "section": "def-common.MaybePromise", - "text": "MaybePromise" - }, - "<", { "pluginId": "@kbn/presentation-containers", "scope": "public", @@ -20563,7 +20555,7 @@ "section": "def-common.DynamicActionsState", "text": "DynamicActionsState" }, - "; } | undefined; isNewPanel?: boolean | undefined; }>>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", + "; } | undefined; isNewPanel?: boolean | undefined; }>; snapshotRuntimeState: () => { id?: string | undefined; className?: string | undefined; style?: React.CSSProperties | undefined; title?: string | undefined; description?: string | undefined; viewMode?: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -20867,7 +20859,15 @@ "section": "def-common.AggregateQuery", "text": "AggregateQuery" }, - " | undefined>; rendered$: ", + " | undefined>; searchSessionId$: ", + { + "pluginId": "@kbn/presentation-publishing", + "scope": "public", + "docId": "kibKbnPresentationPublishingPluginApi", + "section": "def-public.PublishingSubject", + "text": "PublishingSubject" + }, + "; rendered$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", diff --git a/api_docs/lens.mdx b/api_docs/lens.mdx index e90abb70f654..ed1bb096c52c 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lens'] --- import lensObj from './lens.devdocs.json'; diff --git a/api_docs/license_api_guard.mdx b/api_docs/license_api_guard.mdx index 7229770a2ce2..ecffb153ae49 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-12-10 +date: 2024-12-13 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 704efebb74b7..07797af1af5c 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-12-10 +date: 2024-12-13 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 cb2fa10f2037..497daa113b00 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-12-10 +date: 2024-12-13 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 3624254804ce..dd6963a9f9d1 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'links'] --- import linksObj from './links.devdocs.json'; diff --git a/api_docs/lists.mdx b/api_docs/lists.mdx index c01f7076c28f..de1f6a43e7f3 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'lists'] --- import listsObj from './lists.devdocs.json'; diff --git a/api_docs/llm_tasks.devdocs.json b/api_docs/llm_tasks.devdocs.json index be33e1e8cbf5..39638b49a1e8 100644 --- a/api_docs/llm_tasks.devdocs.json +++ b/api_docs/llm_tasks.devdocs.json @@ -24,7 +24,7 @@ "description": [ "\nDescribes public llmTasks plugin contract returned at the `setup` stage." ], - "path": "x-pack/plugins/ai_infra/llm_tasks/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/llm_tasks/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -40,7 +40,7 @@ "description": [ "\nDescribes public llmTasks plugin contract returned at the `start` stage." ], - "path": "x-pack/plugins/ai_infra/llm_tasks/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/llm_tasks/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -56,7 +56,7 @@ "signature": [ "() => Promise" ], - "path": "x-pack/plugins/ai_infra/llm_tasks/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/llm_tasks/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -80,7 +80,7 @@ "RetrieveDocumentationResult", ">" ], - "path": "x-pack/plugins/ai_infra/llm_tasks/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/llm_tasks/server/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -95,7 +95,7 @@ "signature": [ "RetrieveDocumentationParams" ], - "path": "x-pack/plugins/ai_infra/llm_tasks/server/tasks/retrieve_documentation/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/llm_tasks/server/tasks/retrieve_documentation/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/llm_tasks.mdx b/api_docs/llm_tasks.mdx index 2adb45f4aaf4..f4866d6464e5 100644 --- a/api_docs/llm_tasks.mdx +++ b/api_docs/llm_tasks.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/llmTasks title: "llmTasks" image: https://source.unsplash.com/400x175/?github description: API docs for the llmTasks plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'llmTasks'] --- import llmTasksObj from './llm_tasks.devdocs.json'; diff --git a/api_docs/logs_data_access.mdx b/api_docs/logs_data_access.mdx index c1e10f806bb0..1a1c0ba95b31 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsDataAccess'] --- import logsDataAccessObj from './logs_data_access.devdocs.json'; diff --git a/api_docs/logs_explorer.mdx b/api_docs/logs_explorer.mdx index 6149d530e093..dba92c07e4ae 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsExplorer'] --- import logsExplorerObj from './logs_explorer.devdocs.json'; diff --git a/api_docs/logs_shared.mdx b/api_docs/logs_shared.mdx index aadc044bb6f7..1fa82ad459dc 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'logsShared'] --- import logsSharedObj from './logs_shared.devdocs.json'; diff --git a/api_docs/management.mdx b/api_docs/management.mdx index 02f48da67288..7e77c9cdca62 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-12-10 +date: 2024-12-13 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 13be2f625771..5187704c3cc3 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-12-10 +date: 2024-12-13 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 acb7b46255e2..a89f6e6c6e81 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'mapsEms'] --- import mapsEmsObj from './maps_ems.devdocs.json'; diff --git a/api_docs/metrics_data_access.mdx b/api_docs/metrics_data_access.mdx index 59a57b0fade8..89aaaaccadd8 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'metricsDataAccess'] --- import metricsDataAccessObj from './metrics_data_access.devdocs.json'; diff --git a/api_docs/ml.mdx b/api_docs/ml.mdx index 792589e932c7..696468130943 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ml'] --- import mlObj from './ml.devdocs.json'; diff --git a/api_docs/mock_idp_plugin.mdx b/api_docs/mock_idp_plugin.mdx index 17d3e33d2eba..260c908966d7 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-12-10 +date: 2024-12-13 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 5b7f69096f7c..800e848fd30e 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-12-10 +date: 2024-12-13 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 782c0b380c1f..263899d209e3 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-12-10 +date: 2024-12-13 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 cfa72847f267..e3342dbcbd6f 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-12-10 +date: 2024-12-13 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 5cae7cf8fb46..99d51f93ea13 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-12-10 +date: 2024-12-13 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 186c617fbef8..5ed30d54bbd0 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-12-10 +date: 2024-12-13 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 3e281d9a87f8..49828d9c7202 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-12-10 +date: 2024-12-13 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 3dc14fc3d10b..51eb9e06f65e 100644 --- a/api_docs/observability.devdocs.json +++ b/api_docs/observability.devdocs.json @@ -15,7 +15,7 @@ "AutocompleteFieldProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -29,7 +29,7 @@ "signature": [ "AutocompleteFieldProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -56,7 +56,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -70,7 +70,7 @@ "signature": [ "BuildEsQueryArgs" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -106,7 +106,7 @@ ") => ", "BucketSize" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -126,7 +126,7 @@ "text": "TimeRange" } ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -147,7 +147,7 @@ "text": "TimeBuckets" } ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -170,7 +170,7 @@ "Maybe", "; defaultValue?: string | undefined; extended?: boolean | undefined; }) => ConvertedDuration" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -181,7 +181,7 @@ "tags": [], "label": "{\n unit,\n microseconds,\n defaultValue = NOT_AVAILABLE_LABEL,\n extended,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -196,7 +196,7 @@ "\"microseconds\" | ", "TimeUnit" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false }, @@ -210,7 +210,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false }, @@ -224,7 +224,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false }, @@ -238,7 +238,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false } @@ -274,7 +274,7 @@ }, " | undefined; list: () => string[]; } & { getFormatter: () => () => string; registerFormatter: () => void; list: () => string[]; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/observability_rule_type_registry_mock.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/observability_rule_type_registry_mock.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -300,7 +300,7 @@ ") => ", "LinkProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/hooks/create_use_rules_link.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/hooks/create_use_rules_link.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -319,7 +319,7 @@ "DatePickerProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -333,7 +333,7 @@ "signature": [ "DatePickerProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -352,7 +352,7 @@ "signature": [ "({ children }: { children: React.ReactElement>; }) => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/context/date_picker_context/date_picker_context.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/context/date_picker_context/date_picker_context.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -363,7 +363,7 @@ "tags": [], "label": "{ children }", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/context/date_picker_context/date_picker_context.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/context/date_picker_context/date_picker_context.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -377,7 +377,7 @@ "signature": [ "React.ReactElement>" ], - "path": "x-pack/plugins/observability_solution/observability/public/context/date_picker_context/date_picker_context.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/context/date_picker_context/date_picker_context.tsx", "deprecated": false, "trackAdoption": false } @@ -397,7 +397,7 @@ "signature": [ "(ruleTypeId?: string | undefined, evaluationValue?: number | undefined) => string | number" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -411,7 +411,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -426,7 +426,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -445,7 +445,7 @@ "signature": [ "(query: Record) => string" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -459,7 +459,7 @@ "signature": [ "Record" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -493,7 +493,7 @@ "text": "AlertSummaryTimeRange" } ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -513,7 +513,7 @@ "text": "TimeRange" } ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -528,7 +528,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -543,7 +543,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -562,7 +562,7 @@ "signature": [ "({\n traceId,\n rangeFrom,\n rangeTo,\n}: { traceId: string; rangeFrom: string; rangeTo: string; }) => string" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -573,7 +573,7 @@ "tags": [], "label": "{\n traceId,\n rangeFrom,\n rangeTo,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -584,7 +584,7 @@ "tags": [], "label": "traceId", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts", "deprecated": false, "trackAdoption": false }, @@ -595,7 +595,7 @@ "tags": [], "label": "rangeFrom", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts", "deprecated": false, "trackAdoption": false }, @@ -606,7 +606,7 @@ "tags": [], "label": "rangeTo", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts", "deprecated": false, "trackAdoption": false } @@ -628,7 +628,7 @@ "CoreVitalProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -642,7 +642,7 @@ "signature": [ "CoreVitalProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -671,7 +671,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -686,7 +686,7 @@ "Group", "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -701,7 +701,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -720,7 +720,7 @@ "signature": [ "React.LazyExoticComponent<({ alert, rawAlert, alerts, isInApp, observabilityRuleTypeRegistry, onClose, selectedAlertId, }: AlertsFlyoutProps) => React.JSX.Element | null>" ], - "path": "x-pack/plugins/observability_solution/observability/public/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/index.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -754,7 +754,7 @@ "ObservabilityAlertSearchBarProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -768,7 +768,7 @@ "signature": [ "ObservabilityAlertSearchBarProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -807,7 +807,7 @@ "node_modules/@testing-library/dom/types/queries", ", HTMLElement, HTMLElement>" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -821,7 +821,7 @@ "signature": [ "React.ReactNode" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -851,7 +851,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -872,7 +872,7 @@ "RuleConditionChartProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -886,7 +886,7 @@ "signature": [ "RuleConditionChartProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -907,7 +907,7 @@ "RuleFlyoutKueryBarProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -921,7 +921,7 @@ "signature": [ "RuleFlyoutKueryBarProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -942,7 +942,7 @@ "Props", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -956,7 +956,7 @@ "signature": [ "Props" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -977,7 +977,7 @@ "ParsedQuery", "" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -991,7 +991,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/utils/url.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/utils/url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1022,7 +1022,7 @@ "SeriesIdentifier", ">> | undefined; annotations?: ({ id: string; } & { annotation: { title?: string | undefined; 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; })[] | undefined; }) => React.JSX.Element; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1033,7 +1033,7 @@ "tags": [], "label": "{\n domain,\n editAnnotation,\n slo,\n setEditAnnotation,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1047,7 +1047,7 @@ "signature": [ "({ id: string; name: string; description: string; indicator: { type: \"sli.apm.transactionDuration\"; params: { environment: string; service: string; transactionType: string; transactionName: string; threshold: number; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.apm.transactionErrorRate\"; params: { environment: string; service: string; transactionType: string; transactionName: string; index: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.synthetics.availability\"; params: { monitorIds: { value: string; label: string; }[]; index: string; } & { tags?: { value: string; label: string; }[] | undefined; projects?: { value: string; label: string; }[] | undefined; filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.kql.custom\"; params: { index: string; good: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; total: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.custom\"; params: { index: string; good: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; total: { metrics: (({ name: string; aggregation: \"sum\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.metric.timeslice\"; params: { index: string; metric: { metrics: (({ name: string; aggregation: \"min\" | \"max\" | \"sum\" | \"avg\" | \"cardinality\" | \"last_value\" | \"std_deviation\"; field: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"doc_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ name: string; aggregation: \"percentile\"; field: string; percentile: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }))[]; equation: string; threshold: number; comparator: \"GT\" | \"GTE\" | \"LT\" | \"LTE\"; }; timestampField: string; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; } | { type: \"sli.histogram.custom\"; params: { index: string; timestampField: string; good: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); total: ({ field: string; aggregation: \"value_count\"; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }) | ({ field: string; aggregation: \"range\"; from: number; to: number; } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; }); } & { filter?: string | { kqlQuery: string; filters: ({ meta: { alias?: string | null | undefined; disabled?: boolean | undefined; negate?: boolean | undefined; controlledBy?: string | undefined; group?: string | undefined; index?: string | undefined; isMultiIndex?: boolean | undefined; type?: string | undefined; key?: string | undefined; field?: string | undefined; params?: any; value?: string | undefined; }; query: { [x: string]: any; }; } & { $state?: any; })[]; } | undefined; dataViewId?: string | undefined; }; }; timeWindow: { duration: string; type: \"rolling\"; } | { duration: string; type: \"calendarAligned\"; }; budgetingMethod: \"occurrences\" | \"timeslices\"; objective: { target: number; } & { timesliceTarget?: number | undefined; timesliceWindow?: string | undefined; }; settings: { syncDelay: string; frequency: string; preventInitialBackfill: boolean; } & { syncField?: string | null | undefined; }; revision: number; enabled: boolean; tags: string[]; createdAt: string; updatedAt: string; groupBy: string | string[]; version: number; } & { summary: { status: \"HEALTHY\" | \"NO_DATA\" | \"DEGRADING\" | \"VIOLATED\"; sliValue: number; errorBudget: { initial: number; consumed: number; remaining: number; isEstimated: boolean; }; fiveMinuteBurnRate: number; oneHourBurnRate: number; oneDayBurnRate: number; } & { summaryUpdatedAt?: string | null | undefined; }; groupings: { [x: string]: string | number; }; } & { instanceId?: string | undefined; meta?: { synthetics?: { monitorId: string; locationId: string; configId: string; } | undefined; } | undefined; remote?: { remoteName: string; kibanaUrl: string; } | undefined; }) | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false }, @@ -1061,7 +1061,7 @@ "signature": [ "({ id: string; } & { annotation: { title?: string | undefined; 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; }) | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false }, @@ -1075,7 +1075,7 @@ "signature": [ "((annotation: ({ id: string; } & { annotation: { title?: string | undefined; 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; }) | null) => void) | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1089,7 +1089,7 @@ "signature": [ "({ id: string; } & { annotation: { title?: string | undefined; 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; }) | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1107,7 +1107,7 @@ "signature": [ "{ min: string | number; max: string | number; } | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx", "deprecated": false, "trackAdoption": false } @@ -1149,7 +1149,7 @@ }, "[], unknown>>; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_data_views.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_data_views.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1181,7 +1181,7 @@ "text": "AlertSummaryTimeRange" } ], - "path": "x-pack/plugins/observability_solution/observability/public/hooks/use_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/hooks/use_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1201,7 +1201,7 @@ "text": "TimeRange" } ], - "path": "x-pack/plugins/observability_solution/observability/public/hooks/use_summary_time_range.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/hooks/use_summary_time_range.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1227,7 +1227,7 @@ "text": "TimeBuckets" } ], - "path": "x-pack/plugins/observability_solution/observability/public/hooks/use_time_buckets.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/hooks/use_time_buckets.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1246,7 +1246,7 @@ "WithKueryAutocompletionLifecycleProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -1260,7 +1260,7 @@ "signature": [ "WithKueryAutocompletionLifecycleProps" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1278,7 +1278,7 @@ "tags": [], "label": "AlertDetailsAppSectionProps", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/pages/alert_details/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/alert_details/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1294,7 +1294,7 @@ "AlertDetailsSource", "[] | undefined>) => void" ], - "path": "x-pack/plugins/observability_solution/observability/public/pages/alert_details/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/pages/alert_details/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1342,7 +1342,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1372,7 +1372,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1394,7 +1394,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1408,7 +1408,7 @@ "tags": [], "label": "APMHasDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1419,7 +1419,7 @@ "tags": [], "label": "hasData", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1433,7 +1433,7 @@ "signature": [ "ApmIndicesConfig" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1447,7 +1447,7 @@ "tags": [], "label": "ConfigSchema", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1461,7 +1461,7 @@ "signature": [ "{ alertDetails: { logs?: { enabled: boolean; } | undefined; uptime: { enabled: boolean; }; observability?: { enabled: boolean; } | undefined; }; thresholdRule?: { enabled: boolean; } | undefined; ruleFormV2?: { enabled: boolean; } | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false } @@ -1475,7 +1475,7 @@ "tags": [], "label": "Coordinates", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1486,7 +1486,7 @@ "tags": [], "label": "x", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1500,7 +1500,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1524,7 +1524,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1554,7 +1554,7 @@ }, "[T]>" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1575,7 +1575,7 @@ "text": "FetchDataParams" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1607,7 +1607,7 @@ }, "[T]>" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1629,7 +1629,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1645,7 +1645,7 @@ "tags": [], "label": "FetchDataParams", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1659,7 +1659,7 @@ "signature": [ "{ start: number; end: number; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1673,7 +1673,7 @@ "signature": [ "{ start: string; end: string; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1687,7 +1687,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1698,7 +1698,7 @@ "tags": [], "label": "bucketSize", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1709,7 +1709,7 @@ "tags": [], "label": "intervalString", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1723,7 +1723,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1737,7 +1737,7 @@ "tags": [], "label": "FetchDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1748,7 +1748,7 @@ "tags": [], "label": "appLink", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1762,7 +1762,7 @@ "tags": [], "label": "HasDataParams", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1776,7 +1776,7 @@ "signature": [ "{ start: number; end: number; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1790,7 +1790,7 @@ "tags": [], "label": "HasDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1801,7 +1801,7 @@ "tags": [], "label": "hasData", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1815,7 +1815,7 @@ "tags": [], "label": "InfraLogsHasDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1826,7 +1826,7 @@ "tags": [], "label": "hasData", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1837,7 +1837,7 @@ "tags": [], "label": "indices", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1851,7 +1851,7 @@ "tags": [], "label": "InfraMetricsHasDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1862,7 +1862,7 @@ "tags": [], "label": "hasData", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1873,7 +1873,7 @@ "tags": [], "label": "indices", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1904,7 +1904,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1926,7 +1926,7 @@ }, " & { label: string; }; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1948,7 +1948,7 @@ }, " & { label: string; }; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -1979,7 +1979,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2001,7 +2001,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2015,7 +2015,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2030,7 +2030,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2055,7 +2055,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -2069,7 +2069,7 @@ "tags": [], "label": "MetricsFetchDataSeries", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2080,7 +2080,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2094,7 +2094,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2108,7 +2108,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2122,7 +2122,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2136,7 +2136,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2150,7 +2150,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2164,7 +2164,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2178,7 +2178,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2192,7 +2192,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2206,7 +2206,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2260,7 +2260,7 @@ }, "; }[]" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -2274,7 +2274,7 @@ "tags": [], "label": "ObservabilityFetchDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2294,7 +2294,7 @@ "text": "ApmFetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2314,7 +2314,7 @@ "text": "MetricsFetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2334,7 +2334,7 @@ "text": "LogsFetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2354,7 +2354,7 @@ "text": "UptimeFetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2374,7 +2374,7 @@ "text": "UxFetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2394,7 +2394,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -2408,7 +2408,7 @@ "tags": [], "label": "ObservabilityHasDataResponse", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2428,7 +2428,7 @@ "text": "APMHasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2448,7 +2448,7 @@ "text": "InfraMetricsHasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2468,7 +2468,7 @@ "text": "InfraLogsHasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2488,7 +2488,7 @@ "text": "SyntheticsHasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2508,7 +2508,7 @@ "text": "UXHasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2522,7 +2522,7 @@ "signature": [ "UniversalProfilingHasDataResponse" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -2536,7 +2536,7 @@ "tags": [], "label": "ObservabilityPublicPluginsSetup", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2556,7 +2556,7 @@ "text": "DataPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2578,7 +2578,7 @@ }, "[]) => void; has: (id: string) => boolean; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2602,7 +2602,7 @@ }, "[]>) => void; }; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2623,7 +2623,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2671,7 +2671,7 @@ }, ") => void; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2691,7 +2691,7 @@ "text": "TriggersAndActionsUIPublicPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2712,7 +2712,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2732,7 +2732,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2752,7 +2752,7 @@ "text": "EmbeddableSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2798,7 +2798,7 @@ }, ") => void; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2818,7 +2818,7 @@ "text": "LicensingPluginSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2839,7 +2839,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2860,7 +2860,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2881,7 +2881,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false } @@ -2895,7 +2895,7 @@ "tags": [], "label": "ObservabilityPublicPluginsStart", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2933,7 +2933,7 @@ }, ") => void; has: (id: string) => boolean; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2953,7 +2953,7 @@ "text": "CasesPublicStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2976,7 +2976,7 @@ "ActiveCursor", "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -2996,7 +2996,7 @@ "text": "ContentManagementPublicStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3016,7 +3016,7 @@ "text": "DataPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3036,7 +3036,7 @@ "text": "DataViewsServicePublic" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3056,7 +3056,7 @@ "text": "PluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3076,7 +3076,7 @@ "text": "DiscoverStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3096,7 +3096,7 @@ "text": "EmbeddableStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3138,7 +3138,7 @@ }, ") => React.JSX.Element | null; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3168,7 +3168,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3189,7 +3189,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3209,7 +3209,7 @@ "text": "LensPublicStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3229,7 +3229,7 @@ "text": "LicensingPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3250,7 +3250,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3270,7 +3270,7 @@ "text": "NavigationPublicStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3314,7 +3314,7 @@ }, ">; }) => void; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3335,7 +3335,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3397,7 +3397,7 @@ }, ">) => void; has: (id: string) => boolean; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3417,7 +3417,7 @@ "text": "SecurityPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3457,7 +3457,7 @@ }, ">): void; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3478,7 +3478,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3498,7 +3498,7 @@ "text": "TriggersAndActionsUIPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3518,7 +3518,7 @@ "text": "UsageCollectionSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3538,7 +3538,7 @@ "text": "UnifiedSearchPublicPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3559,7 +3559,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3580,7 +3580,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3600,7 +3600,7 @@ "text": "AiopsPluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3621,7 +3621,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3641,7 +3641,7 @@ "text": "IUiSettingsClient" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3729,7 +3729,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3750,7 +3750,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3770,7 +3770,7 @@ "text": "ThemeServiceSetup" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3790,7 +3790,7 @@ "text": "PluginStart" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3810,7 +3810,7 @@ "text": "IToasts" } ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3831,7 +3831,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false }, @@ -3852,7 +3852,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false } @@ -3884,7 +3884,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3910,7 +3910,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link?: string | undefined; hasBasePath?: boolean | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -3937,7 +3937,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult?: string) => string; }; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false } @@ -3953,7 +3953,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false } @@ -3984,7 +3984,7 @@ "text": "SerializableRecord" } ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3998,7 +3998,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false }, @@ -4012,7 +4012,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false }, @@ -4026,7 +4026,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false }, @@ -4047,7 +4047,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false }, @@ -4061,7 +4061,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/locators/rules.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/locators/rules.ts", "deprecated": false, "trackAdoption": false } @@ -4075,7 +4075,7 @@ "tags": [], "label": "Series", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4096,7 +4096,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4110,7 +4110,7 @@ "tags": [], "label": "Stat", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4124,7 +4124,7 @@ "signature": [ "\"number\" | \"percent\" | \"bytesPerSecond\"" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -4135,7 +4135,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4166,7 +4166,7 @@ "text": "HasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4177,7 +4177,7 @@ "tags": [], "label": "indices", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4201,7 +4201,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4223,7 +4223,7 @@ }, "[]; }; readonly \"kibana.alert.rule.execution.timestamp\": { readonly type: \"date\"; readonly array: false; readonly required: false; }; readonly \"kibana.alert.rule.execution.type\": { readonly type: \"keyword\"; 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; }; }>> & OutputOf> & TAdditionalMetaFields" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4234,7 +4234,7 @@ "tags": [], "label": "start", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4245,7 +4245,7 @@ "tags": [], "label": "lastUpdated", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4256,7 +4256,7 @@ "tags": [], "label": "reason", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4270,7 +4270,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4281,7 +4281,7 @@ "tags": [], "label": "active", "description": [], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -4295,7 +4295,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts", "deprecated": false, "trackAdoption": false } @@ -4326,7 +4326,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4364,7 +4364,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -4394,7 +4394,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4425,7 +4425,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4445,7 +4445,7 @@ "text": "UXMetrics" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4476,7 +4476,7 @@ "text": "HasDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4490,7 +4490,7 @@ "signature": [ "string | number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false }, @@ -4504,7 +4504,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4524,7 +4524,7 @@ "signature": [ "\"ALERTS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4539,7 +4539,7 @@ "signature": [ "\"observability:apmEnableTableSearchBar\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4554,7 +4554,7 @@ "signature": [ "\"observability:apmServiceGroupMaxNumberOfServices\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4569,7 +4569,7 @@ "signature": [ "\"observability:apmAgentExplorerView\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4584,7 +4584,7 @@ "signature": [ "\"observability:enableComparisonByDefault\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4599,7 +4599,7 @@ "signature": [ "\"observability:enableInspectEsQueries\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4614,7 +4614,7 @@ "signature": [ "\"observability:enableLegacyUptimeApp\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4637,7 +4637,7 @@ }, ") => Promise" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4658,7 +4658,7 @@ "text": "FetchDataParams" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4676,7 +4676,7 @@ "\"custom\" | ", "Aggregators" ], - "path": "x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.tsx", + "path": "x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.tsx", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4707,7 +4707,7 @@ }, "[T]>" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4729,7 +4729,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false } @@ -4746,7 +4746,7 @@ "signature": [ "number | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4761,7 +4761,7 @@ "signature": [ "\"observability-overview\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4776,7 +4776,7 @@ "signature": [ "\"observability\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4791,7 +4791,7 @@ "signature": [ "\"uptime\" | \"apm\" | \"ux\" | \"infra_logs\" | \"infra_metrics\" | \"universal_profiling\"" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4818,7 +4818,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult?: string) => string; }; }) => { reason: string; link?: string | undefined; hasBasePath?: boolean | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4845,7 +4845,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult?: string) => string; }; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false } @@ -4878,7 +4878,7 @@ }, " | undefined; list: () => string[]; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4893,7 +4893,7 @@ "signature": [ "\"RULE_DETAILS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4908,7 +4908,7 @@ "signature": [ "\"RULES_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4923,7 +4923,7 @@ "signature": [ "\"SLO_DETAILS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4938,7 +4938,7 @@ "signature": [ "\"SLO_EDIT_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4953,7 +4953,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4978,7 +4978,7 @@ }, " : K[attr]) | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/utils.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/utils.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4993,7 +4993,7 @@ "signature": [ "\"observability:syntheticsThrottlingEnabled\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5014,7 +5014,7 @@ "text": "FetchDataResponse" } ], - "path": "x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5029,7 +5029,7 @@ "signature": [ "\"UPTIME_OVERVIEW_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5122,7 +5122,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "setup", @@ -5172,7 +5172,7 @@ "LinkProps", "; }" ], - "path": "x-pack/plugins/observability_solution/observability/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", @@ -5192,7 +5192,7 @@ "WrappedElasticsearchClientError", " extends Error" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5206,7 +5206,7 @@ "signature": [ "ElasticsearchClientError" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false }, @@ -5220,7 +5220,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5234,7 +5234,7 @@ "signature": [ "ElasticsearchClientError" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -5293,7 +5293,7 @@ }, "; }) => Promise" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5304,7 +5304,7 @@ "tags": [], "label": "{\n index,\n mappings,\n client,\n logger,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -5315,7 +5315,7 @@ "tags": [], "label": "index", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false }, @@ -5349,7 +5349,7 @@ "MappingRuntimeFields", " | undefined; }) | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false }, @@ -6617,7 +6617,7 @@ "default", "; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false }, @@ -6637,7 +6637,7 @@ "text": "Logger" } ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false } @@ -6677,7 +6677,7 @@ "AcknowledgedResponseBase", " | undefined>" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6688,7 +6688,7 @@ "tags": [], "label": "{\n indexTemplate,\n client,\n logger,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -6702,7 +6702,7 @@ "signature": [ "IndicesPutIndexTemplateRequest" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false }, @@ -7970,7 +7970,7 @@ "default", "; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false }, @@ -7990,7 +7990,7 @@ "text": "Logger" } ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts", "deprecated": false, "trackAdoption": false } @@ -8012,7 +8012,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8026,7 +8026,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8072,7 +8072,7 @@ "text": "Request" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8083,7 +8083,7 @@ "tags": [], "label": "{\n esError,\n esRequestParams,\n esRequestStatus,\n esResponse,\n kibanaRequest,\n operationName,\n startTime,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8098,7 +8098,7 @@ "WrappedElasticsearchClientError", " | null" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8112,7 +8112,7 @@ "signature": [ "{ [x: string]: any; }" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8132,7 +8132,7 @@ "text": "RequestStatus" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8146,7 +8146,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8167,7 +8167,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8178,7 +8178,7 @@ "tags": [], "label": "operationName", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -8189,7 +8189,7 @@ "tags": [], "label": "startTime", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false } @@ -8211,7 +8211,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/get_parsed_filtered_query.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/get_parsed_filtered_query.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8225,7 +8225,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/get_parsed_filtered_query.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/get_parsed_filtered_query.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8246,7 +8246,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8260,7 +8260,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8281,7 +8281,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8295,7 +8295,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8310,7 +8310,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8325,7 +8325,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8346,7 +8346,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8360,7 +8360,7 @@ "signature": [ "T" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8375,7 +8375,7 @@ "signature": [ "string | number | boolean | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8390,7 +8390,7 @@ "signature": [ "TermQueryOpts" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8411,7 +8411,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8425,7 +8425,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8440,7 +8440,7 @@ "signature": [ "(string | number | boolean | null | undefined)[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8459,7 +8459,7 @@ "signature": [ "(responsePromise: T) => Promise[\"body\"]>" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8473,7 +8473,7 @@ "signature": [ "T" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8494,7 +8494,7 @@ "QueryDslQueryContainer", "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8508,7 +8508,7 @@ "signature": [ "T" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8523,7 +8523,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -8538,7 +8538,7 @@ "signature": [ "{ leadingWildcard: boolean; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/queries.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/queries.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -8556,7 +8556,7 @@ "tags": [], "label": "CustomThresholdLocators", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8585,7 +8585,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", "deprecated": false, "trackAdoption": false }, @@ -8614,7 +8614,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts", "deprecated": false, "trackAdoption": false } @@ -8628,7 +8628,7 @@ "tags": [], "label": "ObservabilityRouteCreateOptions", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8642,7 +8642,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false }, @@ -8656,7 +8656,7 @@ "signature": [ "\"internal\" | \"public\" | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false } @@ -8670,7 +8670,7 @@ "tags": [], "label": "ObservabilityRouteHandlerResources", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8715,7 +8715,7 @@ }, ">; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false }, @@ -8729,7 +8729,7 @@ "signature": [ "RegisterRoutesDependencies" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false }, @@ -8749,7 +8749,7 @@ "text": "Logger" } ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false }, @@ -8770,7 +8770,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false } @@ -8814,7 +8814,7 @@ }, " | undefined>; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8829,7 +8829,7 @@ "signature": [ "\"GET /internal/observability/assistant/alert_details_contextual_insights\" | \"GET /api/observability/rules/alerts/dynamic_index_pattern 2023-10-31\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/get_global_observability_server_route_repository.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/get_global_observability_server_route_repository.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8863,7 +8863,7 @@ "MappingRuntimeFields", " | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8992,7 +8992,7 @@ }, " | undefined; } | undefined> ? TWrappedResponseType : TReturnType : never" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9007,7 +9007,7 @@ "signature": [ "{ readonly enabled: boolean; readonly annotations: Readonly<{} & { index: string; enabled: boolean; }>; readonly unsafe: Readonly<{} & { alertDetails: Readonly<{} & { uptime: Readonly<{} & { enabled: boolean; }>; observability: Readonly<{} & { enabled: boolean; }>; metrics: Readonly<{} & { enabled: boolean; }>; logs: Readonly<{} & { enabled: boolean; }>; }>; thresholdRule: Readonly<{} & { enabled: boolean; }>; ruleFormV2: Readonly<{} & { enabled: boolean; }>; }>; readonly customThresholdRule: Readonly<{} & { groupByPageSize: number; }>; readonly createO11yGenericFeatureId: boolean; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9110,7 +9110,7 @@ }, ">; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/routes/get_global_observability_server_route_repository.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/routes/get_global_observability_server_route_repository.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9135,7 +9135,7 @@ "DeleteByQueryResponse", ">; permissions: () => Promise<{ index: string; hasGoldLicense: boolean; }>; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/lib/annotations/bootstrap_annotations.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/lib/annotations/bootstrap_annotations.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9171,7 +9171,7 @@ "UnknownRecordC", "]>" ], - "path": "x-pack/plugins/observability_solution/observability/server/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9217,7 +9217,7 @@ "Type", "; }>]>" ], - "path": "x-pack/plugins/observability_solution/observability/server/types.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9231,7 +9231,7 @@ "description": [ "\nuiSettings definitions for Observability." ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9242,7 +9242,7 @@ "tags": [], "label": "[enableInspectEsQueries]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9256,7 +9256,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9267,7 +9267,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9281,7 +9281,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9292,7 +9292,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9313,7 +9313,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9327,7 +9327,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9340,7 +9340,7 @@ "tags": [], "label": "[maxSuggestions]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9354,7 +9354,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9365,7 +9365,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9376,7 +9376,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9387,7 +9387,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9408,7 +9408,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9421,7 +9421,7 @@ "tags": [], "label": "[enableComparisonByDefault]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9435,7 +9435,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9446,7 +9446,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9460,7 +9460,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9471,7 +9471,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9492,7 +9492,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9505,7 +9505,7 @@ "tags": [], "label": "[defaultApmServiceEnvironment]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9519,7 +9519,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9533,7 +9533,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9544,7 +9544,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9555,7 +9555,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9566,7 +9566,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9587,7 +9587,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9600,7 +9600,7 @@ "tags": [], "label": "[apmProgressiveLoading]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9614,7 +9614,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9625,7 +9625,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9636,7 +9636,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9656,7 +9656,7 @@ "text": "ProgressiveLoadingQuality" } ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9685,7 +9685,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9699,7 +9699,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9713,7 +9713,7 @@ "signature": [ "\"select\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9734,7 +9734,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9745,7 +9745,7 @@ "tags": [], "label": "optionLabels", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9756,7 +9756,7 @@ "tags": [], "label": "[ProgressiveLoadingQuality.off]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9767,7 +9767,7 @@ "tags": [], "label": "[ProgressiveLoadingQuality.low]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9778,7 +9778,7 @@ "tags": [], "label": "[ProgressiveLoadingQuality.medium]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9789,7 +9789,7 @@ "tags": [], "label": "[ProgressiveLoadingQuality.high]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9805,7 +9805,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9818,7 +9818,7 @@ "tags": [], "label": "[apmServiceInventoryOptimizedSorting]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9832,7 +9832,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9843,7 +9843,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9854,7 +9854,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9875,7 +9875,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9889,7 +9889,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9903,7 +9903,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9917,7 +9917,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9931,7 +9931,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -9944,7 +9944,7 @@ "tags": [], "label": "[apmServiceGroupMaxNumberOfServices]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9958,7 +9958,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9969,7 +9969,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9980,7 +9980,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -9991,7 +9991,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10012,7 +10012,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10025,7 +10025,7 @@ "tags": [], "label": "[apmTraceExplorerTab]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10039,7 +10039,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10050,7 +10050,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10061,7 +10061,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10082,7 +10082,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10096,7 +10096,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10110,7 +10110,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10124,7 +10124,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10138,7 +10138,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10151,7 +10151,7 @@ "tags": [], "label": "[apmLabsButton]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10165,7 +10165,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10176,7 +10176,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10187,7 +10187,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10208,7 +10208,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10222,7 +10222,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10236,7 +10236,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10250,7 +10250,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10263,7 +10263,7 @@ "tags": [], "label": "[enableInfrastructureProfilingIntegration]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10277,7 +10277,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10288,7 +10288,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10302,7 +10302,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10313,7 +10313,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10334,7 +10334,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10347,7 +10347,7 @@ "tags": [], "label": "[enableInfrastructureAssetCustomDashboards]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10361,7 +10361,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10372,7 +10372,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10386,7 +10386,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10397,7 +10397,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10418,7 +10418,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10431,7 +10431,7 @@ "tags": [], "label": "[enableAwsLambdaMetrics]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10445,7 +10445,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10456,7 +10456,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10467,7 +10467,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10488,7 +10488,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10502,7 +10502,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10516,7 +10516,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10530,7 +10530,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10544,7 +10544,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10557,7 +10557,7 @@ "tags": [], "label": "[enableAgentExplorerView]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10571,7 +10571,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10582,7 +10582,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10593,7 +10593,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10614,7 +10614,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10628,7 +10628,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10642,7 +10642,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10656,7 +10656,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10669,7 +10669,7 @@ "tags": [], "label": "[apmEnableTableSearchBar]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10683,7 +10683,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10694,7 +10694,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10705,7 +10705,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10726,7 +10726,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10740,7 +10740,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10754,7 +10754,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10768,7 +10768,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10781,7 +10781,7 @@ "tags": [], "label": "[entityCentricExperience]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10795,7 +10795,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10806,7 +10806,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10817,7 +10817,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10838,7 +10838,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10852,7 +10852,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10866,7 +10866,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10880,7 +10880,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -10893,7 +10893,7 @@ "tags": [], "label": "[apmEnableServiceInventoryTableSearchBar]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -10907,7 +10907,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10918,7 +10918,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10929,7 +10929,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10950,7 +10950,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10964,7 +10964,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10978,7 +10978,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -10992,7 +10992,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11005,7 +11005,7 @@ "tags": [], "label": "[apmAWSLambdaPriceFactor]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11019,7 +11019,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11030,7 +11030,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11044,7 +11044,7 @@ "signature": [ "\"json\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11055,7 +11055,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11066,7 +11066,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11103,7 +11103,7 @@ }, "; }>" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11116,7 +11116,7 @@ "tags": [], "label": "[apmAWSLambdaRequestCostPerMillion]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11130,7 +11130,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11141,7 +11141,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11152,7 +11152,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11173,7 +11173,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11186,7 +11186,7 @@ "tags": [], "label": "[apmEnableServiceMetrics]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11200,7 +11200,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11211,7 +11211,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11225,7 +11225,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11236,7 +11236,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11257,7 +11257,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11271,7 +11271,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11284,7 +11284,7 @@ "tags": [], "label": "[apmEnableContinuousRollups]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11298,7 +11298,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11309,7 +11309,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11323,7 +11323,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11334,7 +11334,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11355,7 +11355,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11369,7 +11369,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11382,7 +11382,7 @@ "tags": [], "label": "[enableCriticalPath]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11396,7 +11396,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11407,7 +11407,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11418,7 +11418,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11439,7 +11439,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11453,7 +11453,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11467,7 +11467,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11481,7 +11481,7 @@ "signature": [ "\"boolean\"" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11495,7 +11495,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11508,7 +11508,7 @@ "tags": [], "label": "[syntheticsThrottlingEnabled]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11522,7 +11522,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11533,7 +11533,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11547,7 +11547,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11558,7 +11558,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11579,7 +11579,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11593,7 +11593,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11606,7 +11606,7 @@ "tags": [], "label": "[enableLegacyUptimeApp]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11620,7 +11620,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11631,7 +11631,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11645,7 +11645,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11656,7 +11656,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11677,7 +11677,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11691,7 +11691,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11704,7 +11704,7 @@ "tags": [], "label": "[apmEnableProfilingIntegration]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11718,7 +11718,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11729,7 +11729,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11743,7 +11743,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11764,7 +11764,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11778,7 +11778,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11791,7 +11791,7 @@ "tags": [], "label": "[profilingShowErrorFrames]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11805,7 +11805,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11816,7 +11816,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11830,7 +11830,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11851,7 +11851,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11865,7 +11865,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11878,7 +11878,7 @@ "tags": [], "label": "[profilingPervCPUWattX86]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11892,7 +11892,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11903,7 +11903,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11914,7 +11914,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11925,7 +11925,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11946,7 +11946,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11960,7 +11960,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -11973,7 +11973,7 @@ "tags": [], "label": "[profilingPervCPUWattArm64]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -11987,7 +11987,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -11998,7 +11998,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12009,7 +12009,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12020,7 +12020,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12041,7 +12041,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12055,7 +12055,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12068,7 +12068,7 @@ "tags": [], "label": "[profilingDatacenterPUE]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12082,7 +12082,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12093,7 +12093,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12104,7 +12104,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12115,7 +12115,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12136,7 +12136,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12150,7 +12150,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12163,7 +12163,7 @@ "tags": [], "label": "[profilingCo2PerKWH]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12177,7 +12177,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12188,7 +12188,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12199,7 +12199,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12210,7 +12210,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12231,7 +12231,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12245,7 +12245,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12258,7 +12258,7 @@ "tags": [], "label": "[profilingAWSCostDiscountRate]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12272,7 +12272,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12283,7 +12283,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12294,7 +12294,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12315,7 +12315,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12329,7 +12329,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12340,7 +12340,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12353,7 +12353,7 @@ "tags": [], "label": "[profilingAzureCostDiscountRate]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12367,7 +12367,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12378,7 +12378,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12389,7 +12389,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12410,7 +12410,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12424,7 +12424,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12435,7 +12435,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12448,7 +12448,7 @@ "tags": [], "label": "[profilingCostPervCPUPerHour]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12462,7 +12462,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12473,7 +12473,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12484,7 +12484,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12495,7 +12495,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12516,7 +12516,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12530,7 +12530,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12543,7 +12543,7 @@ "tags": [], "label": "[apmEnableTransactionProfiling]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12557,7 +12557,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12568,7 +12568,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12582,7 +12582,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12603,7 +12603,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12617,7 +12617,7 @@ "signature": [ "true" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12630,7 +12630,7 @@ "tags": [], "label": "[profilingFetchTopNFunctionsFromStacktraces]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12644,7 +12644,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12655,7 +12655,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12666,7 +12666,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12680,7 +12680,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12701,7 +12701,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12715,7 +12715,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12728,7 +12728,7 @@ "tags": [], "label": "[searchExcludedDataTiers]", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12742,7 +12742,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12753,7 +12753,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12764,7 +12764,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12778,7 +12778,7 @@ "signature": [ "never[]" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12799,7 +12799,7 @@ }, "<(\"data_cold\" | \"data_frozen\")[]>" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false }, @@ -12813,7 +12813,7 @@ "signature": [ "false" ], - "path": "x-pack/plugins/observability_solution/observability/server/ui_settings.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/ui_settings.ts", "deprecated": false, "trackAdoption": false } @@ -12885,7 +12885,7 @@ }, ">; }" ], - "path": "x-pack/plugins/observability_solution/observability/server/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability/server/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "setup", @@ -12927,7 +12927,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12941,7 +12941,7 @@ "signature": [ "\"ALERTS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -12963,7 +12963,7 @@ }, ") => Promise<{ app: string; path: string; state: {}; }>" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -12983,7 +12983,7 @@ "text": "AlertsLocatorParams" } ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13008,7 +13008,7 @@ "TimeUnit", ") => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13022,7 +13022,7 @@ "signature": [ "number" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13037,7 +13037,7 @@ "signature": [ "TimeUnit" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13060,7 +13060,7 @@ "Maybe", ", { defaultValue = NOT_AVAILABLE_LABEL, extended }: FormatterOptions) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13075,7 +13075,7 @@ "Maybe", "" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13090,7 +13090,7 @@ "signature": [ "FormatterOptions" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13111,7 +13111,7 @@ "Maybe", ") => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/size.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -13126,7 +13126,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/size.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.ts", "deprecated": false, "trackAdoption": false } @@ -13143,7 +13143,7 @@ "signature": [ "(value: number | null | undefined) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13157,7 +13157,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13178,7 +13178,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult: string) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13193,7 +13193,7 @@ "Maybe", "" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13208,7 +13208,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13223,7 +13223,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13251,7 +13251,7 @@ "text": "COMPARATORS" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13265,7 +13265,7 @@ "signature": [ "LegacyComparator" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13292,7 +13292,7 @@ }, ") => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13306,7 +13306,7 @@ "signature": [ "number" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13327,7 +13327,7 @@ "text": "TimeUnitChar" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13354,7 +13354,7 @@ }, ", spaceId: string, alertUuid: string | null) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13374,7 +13374,7 @@ "text": "IBasePath" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13389,7 +13389,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13404,7 +13404,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13439,7 +13439,7 @@ }, "> | undefined, publicBaseUrl?: string | undefined) => Promise" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13453,7 +13453,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13468,7 +13468,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13483,7 +13483,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13513,7 +13513,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13528,7 +13528,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -13554,7 +13554,7 @@ "text": "TimeFormatter" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -13566,7 +13566,7 @@ "tags": [], "label": "max", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false } @@ -13610,7 +13610,7 @@ "text": "Request" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13621,7 +13621,7 @@ "tags": [], "label": "{\n esError,\n esRequestParams,\n esRequestStatus,\n esResponse,\n kibanaRequest,\n operationName,\n startTime,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13636,7 +13636,7 @@ "WrappedElasticsearchClientError", " | null" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13650,7 +13650,7 @@ "signature": [ "{ [x: string]: any; }" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13670,7 +13670,7 @@ "text": "RequestStatus" } ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13684,7 +13684,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13705,7 +13705,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13716,7 +13716,7 @@ "tags": [], "label": "operationName", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false }, @@ -13727,7 +13727,7 @@ "tags": [], "label": "startTime", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts", "deprecated": false, "trackAdoption": false } @@ -13755,7 +13755,7 @@ }, ") => number" ], - "path": "x-pack/plugins/observability_solution/observability/common/progressive_loading.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/progressive_loading.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13775,7 +13775,7 @@ "text": "ProgressiveLoadingQuality" } ], - "path": "x-pack/plugins/observability_solution/observability/common/progressive_loading.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/progressive_loading.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -13810,7 +13810,7 @@ "text": "SerializableRecord" } ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -13821,7 +13821,7 @@ "tags": [], "label": "baseUrl", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -13832,7 +13832,7 @@ "tags": [], "label": "spaceId", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -13846,7 +13846,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -13860,7 +13860,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -13874,7 +13874,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false }, @@ -13889,7 +13889,7 @@ "AlertStatus", " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false } @@ -13905,7 +13905,7 @@ "tags": [], "label": "ProcessorEvent", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/processor_event.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/processor_event.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13917,7 +13917,7 @@ "tags": [], "label": "ProgressiveLoadingQuality", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/progressive_loading.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/progressive_loading.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13949,7 +13949,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability/common/locators/alerts.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13964,7 +13964,7 @@ "signature": [ "\"ALERTS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13979,7 +13979,7 @@ "signature": [ "\"observability:apmAWSLambdaPriceFactor\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -13994,7 +13994,7 @@ "signature": [ "\"observability:apmAWSLambdaRequestCostPerMillion\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14009,7 +14009,7 @@ "signature": [ "\"observability:apmEnableContinuousRollups\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14024,7 +14024,7 @@ "signature": [ "\"observability:apmEnableProfilingIntegration\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14039,7 +14039,7 @@ "signature": [ "\"observability:apmEnableServiceInventoryTableSearchBar\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14054,7 +14054,7 @@ "signature": [ "\"observability:apmEnableServiceMetrics\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14069,7 +14069,7 @@ "signature": [ "\"observability:apmEnableTableSearchBar\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14084,7 +14084,7 @@ "signature": [ "\"observability:apmEnableTransactionProfiling\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14099,7 +14099,7 @@ "signature": [ "\"observability:apmLabsButton\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14114,7 +14114,7 @@ "signature": [ "\"observability:apmProgressiveLoading\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14129,7 +14129,7 @@ "signature": [ "\"observability:apmServiceGroupMaxNumberOfServices\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14144,7 +14144,7 @@ "signature": [ "\"observability:apmServiceInventoryOptimizedSorting\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14159,7 +14159,7 @@ "signature": [ "\"observability:apmTraceExplorerTab\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14176,7 +14176,7 @@ "Maybe", ", { defaultValue, extended }?: FormatterOptions) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -14191,7 +14191,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false }, @@ -14205,7 +14205,7 @@ "signature": [ "FormatterOptions" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false } @@ -14224,7 +14224,7 @@ "Maybe", ", denominator: number | undefined, fallbackResult?: string) => string" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -14239,7 +14239,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false }, @@ -14253,7 +14253,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false }, @@ -14264,7 +14264,7 @@ "tags": [], "label": "fallbackResult", "description": [], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts", "deprecated": false, "trackAdoption": false } @@ -14283,7 +14283,7 @@ "signature": [ "\"observabilityCases\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": true, "trackAdoption": false, "references": [], @@ -14299,7 +14299,7 @@ "signature": [ "\"observabilityCasesV2\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14314,7 +14314,7 @@ "signature": [ "\"observability:apmDefaultServiceEnvironment\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14329,7 +14329,7 @@ "signature": [ "\"observability:apmAgentExplorerView\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14344,7 +14344,7 @@ "signature": [ "\"observability:enableAwsLambdaMetrics\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14359,7 +14359,7 @@ "signature": [ "\"observability:enableComparisonByDefault\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14374,7 +14374,7 @@ "signature": [ "\"observability:apmEnableCriticalPath\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14389,7 +14389,7 @@ "signature": [ "\"observability:enableInfrastructureAssetCustomDashboards\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14404,7 +14404,7 @@ "signature": [ "\"observability:enableInfrastructureProfilingIntegration\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14419,7 +14419,7 @@ "signature": [ "\"observability:enableInspectEsQueries\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14434,7 +14434,7 @@ "signature": [ "\"observability:entityCentricExperience\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14449,7 +14449,7 @@ "signature": [ "\"observability:maxSuggestions\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14471,7 +14471,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability/common/constants.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14486,7 +14486,7 @@ "signature": [ "\"observability-overview\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14501,7 +14501,7 @@ "signature": [ "\"observability\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14516,7 +14516,7 @@ "signature": [ "\"observability:profilingAWSCostDiscountRate\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14531,7 +14531,7 @@ "signature": [ "\"observability:profilingAzureCostDiscountRate\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14546,7 +14546,7 @@ "signature": [ "\"observability:profilingCo2PerKWH\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14561,7 +14561,7 @@ "signature": [ "\"observability:profilingCostPervCPUPerHour\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14576,7 +14576,7 @@ "signature": [ "\"observability:profilingDatacenterPUE\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14591,7 +14591,7 @@ "signature": [ "\"observability:profilingFetchTopNFunctionsFromStacktraces\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14606,7 +14606,7 @@ "signature": [ "\"observability:profilingPervCPUWattArm64\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14621,7 +14621,7 @@ "signature": [ "\"observability:profilingPerVCPUWattX86\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14636,7 +14636,7 @@ "signature": [ "\"observability:profilingShowErrorFrames\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14651,7 +14651,7 @@ "signature": [ "\"RULE_DETAILS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14666,7 +14666,7 @@ "signature": [ "\"RULES_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14681,7 +14681,7 @@ "signature": [ "\"SLO_DETAILS_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14696,7 +14696,7 @@ "signature": [ "\"SLO_EDIT_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14711,7 +14711,7 @@ "signature": [ "\"slo\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14726,7 +14726,7 @@ "signature": [ "\"SLO_LIST_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14741,7 +14741,7 @@ "signature": [ "\"SYNTHETICS_EDIT_MONITOR_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14756,7 +14756,7 @@ "signature": [ "\"SYNTHETICS_MONITOR_DETAIL_LOCATOR\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14771,7 +14771,7 @@ "signature": [ "\"SYNTHETICS_SETTINGS\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14786,7 +14786,7 @@ "signature": [ "\"observability:syntheticsThrottlingEnabled\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14803,7 +14803,7 @@ "Maybe", ", options?: FormatterOptions | undefined) => ConvertedDuration" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -14818,7 +14818,7 @@ "signature": [ "number | null | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false }, @@ -14832,7 +14832,7 @@ "signature": [ "FormatterOptions | undefined" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false } @@ -14849,7 +14849,7 @@ "signature": [ "\"m\" | \"s\" | \"d\" | \"h\"" ], - "path": "x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14864,7 +14864,7 @@ "signature": [ "\"UPTIME_OVERVIEW_LOCATOR\"" ], - "path": "packages/deeplinks/observability/locators/uptime.ts", + "path": "src/platform/packages/shared/deeplinks/observability/locators/uptime.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -14881,7 +14881,7 @@ "signature": [ "{ alerts: string; annotations: string; alertDetails: (alertId: string) => string; rules: string; ruleDetails: (ruleId: string) => string; }" ], - "path": "x-pack/plugins/observability_solution/observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/observability.mdx b/api_docs/observability.mdx index 397f23be7613..e41f77ff13f7 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observability'] --- import observabilityObj from './observability.devdocs.json'; diff --git a/api_docs/observability_a_i_assistant.devdocs.json b/api_docs/observability_a_i_assistant.devdocs.json index 548b3f1e3fd6..71fa67fbe605 100644 --- a/api_docs/observability_a_i_assistant.devdocs.json +++ b/api_docs/observability_a_i_assistant.devdocs.json @@ -9,7 +9,7 @@ "tags": [], "label": "ShortIdTable", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -23,7 +23,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -39,7 +39,7 @@ "signature": [ "(originalId: string) => string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -53,7 +53,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -71,7 +71,7 @@ "signature": [ "(shortId: string) => string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -85,7 +85,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -110,7 +110,7 @@ "AssistantAvatarProps", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -124,7 +124,7 @@ "signature": [ "AssistantAvatarProps" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -151,7 +151,7 @@ }, ") => void; onRegenerateClick: () => void; onStopGeneratingClick: () => void; }) => React.JSX.Element | null" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -162,7 +162,7 @@ "tags": [], "label": "{\n error,\n loading,\n canRegenerate,\n canGiveFeedback,\n onFeedbackClick,\n onRegenerateClick,\n onStopGeneratingClick,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -176,7 +176,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false }, @@ -187,7 +187,7 @@ "tags": [], "label": "loading", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false }, @@ -198,7 +198,7 @@ "tags": [], "label": "canRegenerate", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false }, @@ -209,7 +209,7 @@ "tags": [], "label": "canGiveFeedback", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false }, @@ -231,7 +231,7 @@ }, ") => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -251,7 +251,7 @@ "text": "Feedback" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -269,7 +269,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -285,7 +285,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -315,7 +315,7 @@ "ConcatenatedMessage", ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -334,7 +334,7 @@ "UseGenAIConnectorsResult", ") => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -348,7 +348,7 @@ "signature": [ "UseGenAIConnectorsResult" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -374,7 +374,7 @@ "text": "MessageAddEvent" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -385,7 +385,7 @@ "tags": [], "label": "{\n name,\n args,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -396,7 +396,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", "deprecated": false, "trackAdoption": false }, @@ -410,7 +410,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", "deprecated": false, "trackAdoption": false } @@ -437,7 +437,7 @@ "text": "MessageAddEvent" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -448,7 +448,7 @@ "tags": [], "label": "{\n name,\n content,\n data,\n}", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -459,7 +459,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", "deprecated": false, "trackAdoption": false }, @@ -473,7 +473,7 @@ "signature": [ "unknown" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", "deprecated": false, "trackAdoption": false }, @@ -487,7 +487,7 @@ "signature": [ "unknown" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", "deprecated": false, "trackAdoption": false } @@ -509,7 +509,7 @@ "ScreenContextActionDefinition", ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -523,7 +523,7 @@ "signature": [ "TActionDefinition" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -538,7 +538,7 @@ "signature": [ "TRespondFunction" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -564,7 +564,7 @@ "text": "ObservabilityAIAssistantChatService" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/storybook_mock.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/storybook_mock.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -588,7 +588,7 @@ "text": "ObservabilityAIAssistantService" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/storybook_mock.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/storybook_mock.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -605,7 +605,7 @@ "signature": [ "() => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx", "deprecated": false, "trackAdoption": false, "children": [], @@ -622,7 +622,7 @@ "signature": [ "({ onClickFeedback }: FeedbackButtonsProps) => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -636,7 +636,7 @@ "signature": [ "FeedbackButtonsProps" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -655,7 +655,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -669,7 +669,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -688,7 +688,7 @@ "signature": [ "({ loading, content, onActionClick }: Props) => React.JSX.Element" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -702,7 +702,7 @@ "signature": [ "Props" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -729,7 +729,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -743,7 +743,7 @@ "signature": [ "({}: { signal: AbortSignal; }) => T | Promise" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -758,7 +758,7 @@ "signature": [ "any[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -770,7 +770,7 @@ "tags": [], "label": "options", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -784,7 +784,7 @@ "signature": [ "boolean | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false }, @@ -798,7 +798,7 @@ "signature": [ "(() => T) | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -829,7 +829,7 @@ ") => ", "UseGenAIConnectorsResult" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -849,7 +849,7 @@ "text": "ObservabilityAIAssistantService" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -867,7 +867,7 @@ "tags": [], "label": "Conversation", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -878,7 +878,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -892,7 +892,7 @@ "signature": [ "{ id?: string | undefined; name: string; } | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -908,7 +908,7 @@ "TokenCount", " | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -929,7 +929,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -943,7 +943,7 @@ "signature": [ "{ [x: string]: string; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -957,7 +957,7 @@ "signature": [ "{ [x: string]: number; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -968,7 +968,7 @@ "tags": [], "label": "namespace", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -979,7 +979,7 @@ "tags": [], "label": "public", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -993,7 +993,7 @@ "tags": [], "label": "DiscoveredDataset", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1004,7 +1004,7 @@ "tags": [], "label": "title", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1015,7 +1015,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1029,7 +1029,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1043,7 +1043,7 @@ "signature": [ "unknown[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1067,7 +1067,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1078,7 +1078,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1089,7 +1089,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1110,7 +1110,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1124,7 +1124,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1138,7 +1138,7 @@ "signature": [ "TParameters | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false } @@ -1152,7 +1152,7 @@ "tags": [], "label": "KnowledgeBaseEntry", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1163,7 +1163,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1174,7 +1174,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1188,7 +1188,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1199,7 +1199,7 @@ "tags": [], "label": "text", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1213,7 +1213,7 @@ "signature": [ "\"medium\" | \"high\" | \"low\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1224,7 +1224,7 @@ "tags": [], "label": "is_correction", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1238,7 +1238,7 @@ "signature": [ "\"user_instruction\" | \"contextual\" | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1249,7 +1249,7 @@ "tags": [], "label": "public", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1263,7 +1263,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1283,7 +1283,7 @@ "text": "KnowledgeBaseEntryRole" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1297,7 +1297,7 @@ "signature": [ "{ name: string; } | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -1311,7 +1311,7 @@ "tags": [], "label": "Message", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1322,7 +1322,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1368,7 +1368,7 @@ }, ".Elastic; } | undefined; data?: string | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -1382,7 +1382,7 @@ "tags": [], "label": "ObservabilityAIAssistantChatService", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1404,7 +1404,7 @@ }, ") => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1424,7 +1424,7 @@ "text": "TelemetryEventTypeWithPayload" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1484,7 +1484,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1498,7 +1498,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1510,7 +1510,7 @@ "tags": [], "label": "options", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1531,7 +1531,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1542,7 +1542,7 @@ "tags": [], "label": "connectorId", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1572,7 +1572,7 @@ }, ">, \"name\" | \"description\" | \"parameters\">[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1586,7 +1586,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1600,7 +1600,7 @@ "signature": [ "AbortSignal" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1621,7 +1621,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1670,7 +1670,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1681,7 +1681,7 @@ "tags": [], "label": "options", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1697,7 +1697,7 @@ "ObservabilityAIAssistantScreenContext", "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1713,7 +1713,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1724,7 +1724,7 @@ "tags": [], "label": "connectorId", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1745,7 +1745,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1756,7 +1756,7 @@ "tags": [], "label": "persist", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1770,7 +1770,7 @@ "signature": [ "boolean | { except: string[]; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1784,7 +1784,7 @@ "signature": [ "AbortSignal" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1799,7 +1799,7 @@ "AdHocInstruction", "[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1820,7 +1820,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1863,7 +1863,7 @@ }, ">[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1874,7 +1874,7 @@ "tags": [], "label": "options", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1888,7 +1888,7 @@ "signature": [ "string[] | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1902,7 +1902,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1923,7 +1923,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -1959,7 +1959,7 @@ }, ">[]>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -1973,7 +1973,7 @@ "signature": [ "(name: string) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1987,7 +1987,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2012,7 +2012,7 @@ "text": "Message" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2028,7 +2028,7 @@ "signature": [ "(name: string) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2042,7 +2042,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2068,7 +2068,7 @@ }, ") => React.ReactNode" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2082,7 +2082,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2097,7 +2097,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -2109,7 +2109,7 @@ "tags": [], "label": "response", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2123,7 +2123,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -2137,7 +2137,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -2159,7 +2159,7 @@ "text": "ChatActionClickHandler" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -2185,7 +2185,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -2201,7 +2201,7 @@ "tags": [], "label": "ObservabilityAIAssistantService", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4163,7 +4163,7 @@ "ObservabilityAIAssistantRouteCreateOptions", ">; }, TEndpoint>>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -4257,7 +4257,7 @@ "signature": [ "() => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4281,7 +4281,7 @@ }, ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4292,7 +4292,7 @@ "tags": [], "label": "{}", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4306,7 +4306,7 @@ "signature": [ "AbortSignal" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -4327,7 +4327,7 @@ "ChatRegistrationRenderFunction", ") => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4341,7 +4341,7 @@ "signature": [ "ChatRegistrationRenderFunction" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4361,7 +4361,7 @@ "ObservabilityAIAssistantScreenContext", ") => () => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4375,7 +4375,7 @@ "signature": [ "ObservabilityAIAssistantScreenContext" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4395,7 +4395,7 @@ "ObservabilityAIAssistantScreenContext", "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4411,7 +4411,7 @@ "signature": [ "ObservabilityAIAssistantConversationService" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -4435,7 +4435,7 @@ }, ">>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4449,7 +4449,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4476,7 +4476,7 @@ }, "[]>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -4498,7 +4498,7 @@ }, "[]) => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4519,7 +4519,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4545,7 +4545,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4561,7 +4561,7 @@ "tags": [], "label": "UseChatResult", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4582,7 +4582,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false }, @@ -4604,7 +4604,7 @@ }, "[]) => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4625,7 +4625,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4649,7 +4649,7 @@ "text": "ChatState" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false }, @@ -4671,7 +4671,7 @@ }, "[]) => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -4692,7 +4692,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -4710,7 +4710,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4728,7 +4728,7 @@ "tags": [], "label": "ChatActionClickType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4740,7 +4740,7 @@ "tags": [], "label": "ChatState", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4752,7 +4752,7 @@ "tags": [], "label": "FunctionVisibility", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4764,7 +4764,7 @@ "tags": [], "label": "KnowledgeBaseEntryRole", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4776,7 +4776,7 @@ "tags": [], "label": "KnowledgeBaseType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4788,7 +4788,7 @@ "tags": [], "label": "MessageRole", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4800,7 +4800,7 @@ "tags": [], "label": "ObservabilityAIAssistantTelemetryEventType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4812,7 +4812,7 @@ "tags": [], "label": "StreamingChatResponseEventType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4824,7 +4824,7 @@ "tags": [], "label": "VisualizeESQLUserIntention", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4841,7 +4841,7 @@ "signature": [ "(T extends Promise ? State : State) & { refresh: () => void; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4856,7 +4856,7 @@ "signature": [ "\"observability:logSources\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4871,7 +4871,7 @@ "signature": [ "\"aiAssistant:preferredAIAssistantType\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4886,7 +4886,7 @@ "signature": [ "\"observability:aiAssistantSearchConnectorIndexPattern\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4901,7 +4901,7 @@ "signature": [ "\"observability:aiAssistantSimulatedFunctionCalling\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5904,7 +5904,7 @@ }, " | undefined; } | undefined> ? TWrappedResponseType : TReturnType : never" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/api/index.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/api/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5919,7 +5919,7 @@ "signature": [ "(payload: ChatActionClickPayloadExecuteEsql) => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -5942,7 +5942,7 @@ }, "; } & { query: string; userOverrides?: unknown; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts", "deprecated": false, "trackAdoption": false } @@ -5967,7 +5967,7 @@ }, "; } & { query: string; userOverrides?: unknown; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -5990,7 +5990,7 @@ }, ".ChatCompletionChunk; } & { id: string; message: { content?: string | undefined; function_call?: { name?: string | undefined; arguments?: string | undefined; } | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6079,7 +6079,7 @@ }, "[] | undefined; description?: string | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6091,7 +6091,7 @@ "tags": [], "label": "elasticAiAssistantImage", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -6106,7 +6106,7 @@ "signature": [ "\"negative\" | \"positive\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7115,7 +7115,7 @@ }, " ? ClientRequestParamsOfType : TRouteParamsRT extends undefined ? {} : never : never" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/api/index.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/api/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7130,7 +7130,7 @@ "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/semantic_text_migration\" | \"POST /internal/observability_ai_assistant/kb/setup\" | \"POST /internal/observability_ai_assistant/kb/reset\" | \"GET /internal/observability_ai_assistant/kb/status\" | \"GET /internal/observability_ai_assistant/kb/entries\" | \"PUT /internal/observability_ai_assistant/kb/user_instructions\" | \"POST /internal/observability_ai_assistant/kb/entries/import\" | \"GET /internal/observability_ai_assistant/kb/user_instructions\" | \"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", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/api/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7153,7 +7153,7 @@ }, ") => void" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7165,7 +7165,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7187,7 +7187,7 @@ }, "; }) => React.ReactNode" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7210,7 +7210,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -7237,7 +7237,7 @@ }, "; }) => React.ReactNode" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7260,7 +7260,7 @@ }, "; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -7331,7 +7331,7 @@ "InsightResponse", "; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/index.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7353,7 +7353,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7367,7 +7367,7 @@ "tags": [], "label": "aiAssistantCapabilities", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/capabilities.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/capabilities.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7378,7 +7378,7 @@ "tags": [], "label": "show", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/capabilities.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/capabilities.ts", "deprecated": false, "trackAdoption": false } @@ -7393,7 +7393,7 @@ "tags": [], "label": "ObservabilityAIAssistantPublicSetup", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7407,7 +7407,7 @@ "tags": [], "label": "ObservabilityAIAssistantPublicStart", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7427,7 +7427,7 @@ "text": "ObservabilityAIAssistantService" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7443,7 +7443,7 @@ "InsightProps", "> | null" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7459,7 +7459,7 @@ "ChatFlyoutSecondSlotHandler", " | undefined>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7481,7 +7481,7 @@ }, " | undefined>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7502,7 +7502,7 @@ "text": "ObservabilityAIAssistantChatService" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7519,7 +7519,7 @@ "() => ", "UseGenAIConnectorsResult" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -7544,7 +7544,7 @@ "text": "UseChatResult" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7615,7 +7615,7 @@ }, "[]; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts", "deprecated": false, "trackAdoption": false } @@ -7639,7 +7639,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7650,7 +7650,7 @@ "tags": [], "label": "{}", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7661,7 +7661,7 @@ "tags": [], "label": "message", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -7672,7 +7672,7 @@ "tags": [], "label": "instructions", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -7697,7 +7697,7 @@ "ScreenContextActionDefinition", ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7712,7 +7712,7 @@ "signature": [ "TActionDefinition" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", "deprecated": false, "trackAdoption": false }, @@ -7726,7 +7726,7 @@ "signature": [ "TRespondFunction" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -7757,7 +7757,7 @@ }, "[]; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -7771,8 +7771,1616 @@ } }, "server": { - "classes": [], + "classes": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient", + "type": "Class", + "tags": [], + "label": "ObservabilityAIAssistantClient", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed", + "type": "Function", + "tags": [], + "label": "Constructor", + "description": [], + "signature": [ + "any" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1", + "type": "Object", + "tags": [], + "label": "dependencies", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.config", + "type": "Object", + "tags": [], + "label": "config", + "description": [], + "signature": [ + "{ readonly scope?: \"search\" | \"observability\" | undefined; readonly enabled: boolean; readonly enableKnowledgeBase: boolean; }" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.core", + "type": "Object", + "tags": [], + "label": "core", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-lifecycle-server", + "scope": "server", + "docId": "kibKbnCoreLifecycleServerPluginApi", + "section": "def-server.CoreSetup", + "text": "CoreSetup" + }, + "<", + "ObservabilityAIAssistantPluginStartDependencies", + ", unknown>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.actionsClient", + "type": "Object", + "tags": [], + "label": "actionsClient", + "description": [], + "signature": [ + "{ execute: (connectorExecuteParams: ", + "ConnectorExecuteParams", + ") => Promise<", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.ActionTypeExecutorResult", + "text": "ActionTypeExecutorResult" + }, + ">; create: ({ action, options, }: Omit<", + "ConnectorCreateParams", + ", \"context\">) => Promise<", + "Connector", + ">; update: ({ id, action, }: Pick<", + "ConnectorUpdateParams", + ", \"id\" | \"action\">) => Promise<", + "Connector", + ">; get: ({ id, throwIfSystemAction, }: { id: string; throwIfSystemAction?: boolean | undefined; }) => Promise<", + "Connector", + ">; getAll: ({ includeSystemActions }?: { includeSystemActions?: boolean | undefined; }) => Promise<", + { + "pluginId": "actions", + "scope": "server", + "docId": "kibActionsPluginApi", + "section": "def-server.ConnectorWithExtraFindData", + "text": "ConnectorWithExtraFindData" + }, + "[]>; getAllSystemConnectors: () => Promise<", + { + "pluginId": "actions", + "scope": "server", + "docId": "kibActionsPluginApi", + "section": "def-server.ConnectorWithExtraFindData", + "text": "ConnectorWithExtraFindData" + }, + "[]>; getBulk: ({ ids, throwIfSystemAction, }: { ids: string[]; throwIfSystemAction?: boolean | undefined; }) => Promise<", + "Connector", + "[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { type: \"jwt\" | \"client\"; options: Readonly<{} & { tokenUrl: string; config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { tokenUrl: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; secrets: Readonly<{} & { clientSecret: string; }>; scope: string; }>; }>, configurationUtilities: ", + "ActionsConfigurationUtilities", + ") => Promise<{ accessToken: string | null; }>; delete: ({ id }: { id: string; }) => Promise<{}>; bulkEnqueueExecution: (options: ", + "ExecuteOptions", + "[]) => Promise<", + "ExecutionResponse", + ">; listTypes: ({ featureId, includeSystemActionTypes, }?: ", + "ListTypesParams", + ") => Promise<", + "ConnectorType", + "[]>; isActionTypeEnabled: (actionTypeId: string, options?: { notifyUsage: boolean; }) => boolean; isPreconfigured: (connectorId: string) => boolean; isSystemAction: (connectorId: string) => boolean; getGlobalExecutionLogWithAuth: ({ dateStart, dateEnd, filter, page, perPage, sort, namespaces, }: ", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.GetGlobalExecutionLogParams", + "text": "GetGlobalExecutionLogParams" + }, + ") => Promise<", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.IExecutionLogResult", + "text": "IExecutionLogResult" + }, + ">; getGlobalExecutionKpiWithAuth: ({ dateStart, dateEnd, filter, namespaces, }: ", + { + "pluginId": "actions", + "scope": "common", + "docId": "kibActionsPluginApi", + "section": "def-common.GetGlobalExecutionKPIParams", + "text": "GetGlobalExecutionKPIParams" + }, + ") => Promise<{ success: number; unknown: number; failure: number; warning: number; }>; }" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.uiSettingsClient", + "type": "Object", + "tags": [], + "label": "uiSettingsClient", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-ui-settings-server", + "scope": "server", + "docId": "kibKbnCoreUiSettingsServerPluginApi", + "section": "def-server.IUiSettingsClient", + "text": "IUiSettingsClient" + } + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.namespace", + "type": "string", + "tags": [], + "label": "namespace", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.esClient", + "type": "Object", + "tags": [], + "label": "esClient", + "description": [], + "signature": [ + "{ asInternalUser: ", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + "; asCurrentUser: ", + { + "pluginId": "@kbn/core-elasticsearch-server", + "scope": "server", + "docId": "kibKbnCoreElasticsearchServerPluginApi", + "section": "def-server.ElasticsearchClient", + "text": "ElasticsearchClient" + }, + "; }" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.inferenceClient", + "type": "Object", + "tags": [], + "label": "inferenceClient", + "description": [], + "signature": [ + { + "pluginId": "inference", + "scope": "server", + "docId": "kibInferencePluginApi", + "section": "def-server.InferenceClient", + "text": "InferenceClient" + } + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.logger", + "type": "Object", + "tags": [], + "label": "logger", + "description": [], + "signature": [ + { + "pluginId": "@kbn/logging", + "scope": "common", + "docId": "kibKbnLoggingPluginApi", + "section": "def-common.Logger", + "text": "Logger" + } + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.user", + "type": "Object", + "tags": [], + "label": "user", + "description": [], + "signature": [ + "{ id?: string | undefined; name: string; } | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.knowledgeBaseService", + "type": "Object", + "tags": [], + "label": "knowledgeBaseService", + "description": [], + "signature": [ + "KnowledgeBaseService" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.Unnamed.$1.scopes", + "type": "Array", + "tags": [], + "label": "scopes", + "description": [], + "signature": [ + { + "pluginId": "@kbn/ai-assistant-common", + "scope": "common", + "docId": "kibKbnAiAssistantCommonPluginApi", + "section": "def-common.AssistantScope", + "text": "AssistantScope" + }, + "[]" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.get", + "type": "Function", + "tags": [], + "label": "get", + "description": [], + "signature": [ + "(conversationId: string) => Promise<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Conversation", + "text": "Conversation" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.get.$1", + "type": "string", + "tags": [], + "label": "conversationId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.delete", + "type": "Function", + "tags": [], + "label": "delete", + "description": [], + "signature": [ + "(conversationId: string) => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.delete.$1", + "type": "string", + "tags": [], + "label": "conversationId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete", + "type": "Function", + "tags": [], + "label": "complete", + "description": [], + "signature": [ + "({ functionClient, connectorId, simulateFunctionCalling, instructions: adHocInstructions, messages: initialMessages, signal, persist, kibanaPublicUrl, isPublic, title: predefinedTitle, conversationId: predefinedConversationId, disableFunctions, }: { messages: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Message", + "text": "Message" + }, + "[]; connectorId: string; signal: AbortSignal; functionClient: ", + "ChatFunctionClient", + "; persist: boolean; conversationId?: string | undefined; title?: string | undefined; isPublic?: boolean | undefined; kibanaPublicUrl?: string | undefined; instructions?: ", + "AdHocInstruction", + "[] | undefined; simulateFunctionCalling?: boolean | undefined; disableFunctions?: boolean | { except: string[]; } | undefined; }) => ", + "Observable", + "<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ConversationCreateEvent", + "text": "ConversationCreateEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ConversationUpdateEvent", + "text": "ConversationUpdateEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.MessageAddEvent", + "text": "MessageAddEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ChatCompletionChunkEvent", + "text": "ChatCompletionChunkEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ChatCompletionMessageEvent", + "text": "ChatCompletionMessageEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.TokenCountEvent", + "text": "TokenCountEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.BufferFlushEvent", + "text": "BufferFlushEvent" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1", + "type": "Object", + "tags": [], + "label": "{\n functionClient,\n connectorId,\n simulateFunctionCalling = false,\n instructions: adHocInstructions = [],\n messages: initialMessages,\n signal,\n persist,\n kibanaPublicUrl,\n isPublic,\n title: predefinedTitle,\n conversationId: predefinedConversationId,\n disableFunctions = false,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.messages", + "type": "Array", + "tags": [], + "label": "messages", + "description": [], + "signature": [ + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Message", + "text": "Message" + }, + "[]" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.connectorId", + "type": "string", + "tags": [], + "label": "connectorId", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.signal", + "type": "Object", + "tags": [], + "label": "signal", + "description": [], + "signature": [ + "AbortSignal" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.functionClient", + "type": "Object", + "tags": [], + "label": "functionClient", + "description": [], + "signature": [ + "ChatFunctionClient" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.persist", + "type": "boolean", + "tags": [], + "label": "persist", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.conversationId", + "type": "string", + "tags": [], + "label": "conversationId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.isPublic", + "type": "CompoundType", + "tags": [], + "label": "isPublic", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.kibanaPublicUrl", + "type": "string", + "tags": [], + "label": "kibanaPublicUrl", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.instructions", + "type": "Array", + "tags": [], + "label": "instructions", + "description": [], + "signature": [ + "AdHocInstruction", + "[] | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.simulateFunctionCalling", + "type": "CompoundType", + "tags": [], + "label": "simulateFunctionCalling", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.complete.$1.disableFunctions", + "type": "CompoundType", + "tags": [], + "label": "disableFunctions", + "description": [], + "signature": [ + "boolean | { except: string[]; } | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat", + "type": "Function", + "tags": [], + "label": "chat", + "description": [], + "signature": [ + "(name: string, { messages, connectorId, functions, functionCall, signal, simulateFunctionCalling, tracer, }: { messages: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Message", + "text": "Message" + }, + "[]; connectorId: string; functions?: { name: string; description: string; parameters?: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.CompatibleJSONSchema", + "text": "CompatibleJSONSchema" + }, + " | undefined; }[] | undefined; functionCall?: string | undefined; signal: AbortSignal; simulateFunctionCalling?: boolean | undefined; tracer: ", + "LangTracer", + "; }) => ", + "Observable", + "<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ChatCompletionChunkEvent", + "text": "ChatCompletionChunkEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.ChatCompletionMessageEvent", + "text": "ChatCompletionMessageEvent" + }, + " | ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.TokenCountEvent", + "text": "TokenCountEvent" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$1", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2", + "type": "Object", + "tags": [], + "label": "{\n messages,\n connectorId,\n functions,\n functionCall,\n signal,\n simulateFunctionCalling,\n tracer,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.messages", + "type": "Array", + "tags": [], + "label": "messages", + "description": [], + "signature": [ + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Message", + "text": "Message" + }, + "[]" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.connectorId", + "type": "string", + "tags": [], + "label": "connectorId", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.functions", + "type": "Array", + "tags": [], + "label": "functions", + "description": [], + "signature": [ + "{ name: string; description: string; parameters?: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.CompatibleJSONSchema", + "text": "CompatibleJSONSchema" + }, + " | undefined; }[] | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.functionCall", + "type": "string", + "tags": [], + "label": "functionCall", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.signal", + "type": "Object", + "tags": [], + "label": "signal", + "description": [], + "signature": [ + "AbortSignal" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.simulateFunctionCalling", + "type": "CompoundType", + "tags": [], + "label": "simulateFunctionCalling", + "description": [], + "signature": [ + "boolean | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.chat.$2.tracer", + "type": "Object", + "tags": [], + "label": "tracer", + "description": [], + "signature": [ + "LangTracer" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.find", + "type": "Function", + "tags": [], + "label": "find", + "description": [], + "signature": [ + "(options?: { query?: string | undefined; } | undefined) => Promise<{ conversations: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Conversation", + "text": "Conversation" + }, + "[]; }>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.find.$1", + "type": "Object", + "tags": [], + "label": "options", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.find.$1.query", + "type": "string", + "tags": [], + "label": "query", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.update", + "type": "Function", + "tags": [], + "label": "update", + "description": [], + "signature": [ + "(conversationId: string, conversation: ", + "ConversationUpdateRequest", + ") => Promise<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Conversation", + "text": "Conversation" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.update.$1", + "type": "string", + "tags": [], + "label": "conversationId", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.update.$2", + "type": "CompoundType", + "tags": [], + "label": "conversation", + "description": [], + "signature": [ + "ConversationUpdateRequest" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setTitle", + "type": "Function", + "tags": [], + "label": "setTitle", + "description": [], + "signature": [ + "({ conversationId, title }: { conversationId: string; title: string; }) => Promise<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Conversation", + "text": "Conversation" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setTitle.$1", + "type": "Object", + "tags": [], + "label": "{ conversationId, title }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setTitle.$1.conversationId", + "type": "string", + "tags": [], + "label": "conversationId", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setTitle.$1.title", + "type": "string", + "tags": [], + "label": "title", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.create", + "type": "Function", + "tags": [], + "label": "create", + "description": [], + "signature": [ + "(conversation: ", + "ConversationRequestBase", + ") => Promise<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.Conversation", + "text": "Conversation" + }, + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.create.$1", + "type": "CompoundType", + "tags": [], + "label": "conversation", + "description": [], + "signature": [ + "ConversationRequestBase" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.recall", + "type": "Function", + "tags": [], + "label": "recall", + "description": [], + "signature": [ + "({ queries, categories, limit, }: { queries: { text: string; boost?: number | undefined; }[]; categories?: string[] | undefined; limit?: { size?: number | undefined; tokenCount?: number | undefined; } | undefined; }) => Promise<", + "RecalledEntry", + "[]>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.recall.$1", + "type": "Object", + "tags": [], + "label": "{\n queries,\n categories,\n limit,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.recall.$1.queries", + "type": "Array", + "tags": [], + "label": "queries", + "description": [], + "signature": [ + "{ text: string; boost?: number | undefined; }[]" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.recall.$1.categories", + "type": "Array", + "tags": [], + "label": "categories", + "description": [], + "signature": [ + "string[] | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.recall.$1.limit", + "type": "Object", + "tags": [], + "label": "limit", + "description": [], + "signature": [ + "{ size?: number | undefined; tokenCount?: number | undefined; } | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseStatus", + "type": "Function", + "tags": [], + "label": "getKnowledgeBaseStatus", + "description": [], + "signature": [ + "() => Promise<{ ready: boolean; enabled: boolean; errorMessage: string; endpoint?: undefined; model_stats?: undefined; } | { endpoint: ", + "InferenceInferenceEndpointInfo", + "; ready: boolean; enabled: boolean; model_stats: { allocation_count: number; deployment_state: ", + "MlDeploymentState", + " | undefined; allocation_state: ", + "MlDeploymentAllocationState", + " | undefined; }; errorMessage?: undefined; }>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setupKnowledgeBase", + "type": "Function", + "tags": [], + "label": "setupKnowledgeBase", + "description": [], + "signature": [ + "(modelId: string | undefined) => Promise<", + "InferenceInferenceEndpointInfo", + ">" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.setupKnowledgeBase.$1", + "type": "string", + "tags": [], + "label": "modelId", + "description": [], + "signature": [ + "string | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": false + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.resetKnowledgeBase", + "type": "Function", + "tags": [], + "label": "resetKnowledgeBase", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.migrateKnowledgeBaseToSemanticText", + "type": "Function", + "tags": [], + "label": "migrateKnowledgeBaseToSemanticText", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addUserInstruction", + "type": "Function", + "tags": [], + "label": "addUserInstruction", + "description": [], + "signature": [ + "({ entry, }: { entry: Omit<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.KnowledgeBaseEntry", + "text": "KnowledgeBaseEntry" + }, + ", \"type\" | \"@timestamp\" | \"role\" | \"confidence\" | \"is_correction\">; }) => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addUserInstruction.$1", + "type": "Object", + "tags": [], + "label": "{\n entry,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addUserInstruction.$1.entry", + "type": "Object", + "tags": [], + "label": "entry", + "description": [], + "signature": [ + "{ id: string; text: string; title?: string | undefined; labels?: Record | undefined; public: boolean; user?: { name: string; } | undefined; }" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addKnowledgeBaseEntry", + "type": "Function", + "tags": [], + "label": "addKnowledgeBaseEntry", + "description": [], + "signature": [ + "({ entry, }: { entry: Omit<", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.KnowledgeBaseEntry", + "text": "KnowledgeBaseEntry" + }, + ", \"type\" | \"@timestamp\">; }) => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addKnowledgeBaseEntry.$1", + "type": "Object", + "tags": [], + "label": "{\n entry,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.addKnowledgeBaseEntry.$1.entry", + "type": "Object", + "tags": [], + "label": "entry", + "description": [], + "signature": [ + "{ id: string; text: string; title?: string | undefined; role: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.KnowledgeBaseEntryRole", + "text": "KnowledgeBaseEntryRole" + }, + "; labels?: Record | undefined; public: boolean; user?: { name: string; } | undefined; confidence: \"medium\" | \"high\" | \"low\"; is_correction: boolean; }" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseEntries", + "type": "Function", + "tags": [], + "label": "getKnowledgeBaseEntries", + "description": [], + "signature": [ + "({ query, sortBy, sortDirection, }: { query: string; sortBy: string; sortDirection: \"asc\" | \"desc\"; }) => Promise<{ entries: ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.KnowledgeBaseEntry", + "text": "KnowledgeBaseEntry" + }, + "[]; }>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseEntries.$1", + "type": "Object", + "tags": [], + "label": "{\n query,\n sortBy,\n sortDirection,\n }", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseEntries.$1.query", + "type": "string", + "tags": [], + "label": "query", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseEntries.$1.sortBy", + "type": "string", + "tags": [], + "label": "sortBy", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseEntries.$1.sortDirection", + "type": "CompoundType", + "tags": [], + "label": "sortDirection", + "description": [], + "signature": [ + "\"asc\" | \"desc\"" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.deleteKnowledgeBaseEntry", + "type": "Function", + "tags": [], + "label": "deleteKnowledgeBaseEntry", + "description": [], + "signature": [ + "(id: string) => Promise" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.deleteKnowledgeBaseEntry.$1", + "type": "string", + "tags": [], + "label": "id", + "description": [], + "signature": [ + "string" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.ObservabilityAIAssistantClient.getKnowledgeBaseUserInstructions", + "type": "Function", + "tags": [], + "label": "getKnowledgeBaseUserInstructions", + "description": [], + "signature": [ + "() => Promise<(", + "Instruction", + " & { public?: boolean | undefined; })[]>" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], "functions": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionRequestMessage", + "type": "Function", + "tags": [], + "label": "createFunctionRequestMessage", + "description": [], + "signature": [ + "({\n name,\n args,\n}: { name: string; args?: Record | undefined; }) => ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.MessageAddEvent", + "text": "MessageAddEvent" + } + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionRequestMessage.$1", + "type": "Object", + "tags": [], + "label": "{\n name,\n args,\n}", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionRequestMessage.$1.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionRequestMessage.$1.args", + "type": "Object", + "tags": [], + "label": "args", + "description": [], + "signature": [ + "Record | undefined" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionResponseMessage", + "type": "Function", + "tags": [], + "label": "createFunctionResponseMessage", + "description": [], + "signature": [ + "({\n name,\n content,\n data,\n}: { name: string; content: unknown; data?: unknown; }) => ", + { + "pluginId": "observabilityAIAssistant", + "scope": "common", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-common.MessageAddEvent", + "text": "MessageAddEvent" + } + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionResponseMessage.$1", + "type": "Object", + "tags": [], + "label": "{\n name,\n content,\n data,\n}", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionResponseMessage.$1.name", + "type": "string", + "tags": [], + "label": "name", + "description": [], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionResponseMessage.$1.content", + "type": "Unknown", + "tags": [], + "label": "content", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "deprecated": false, + "trackAdoption": false + }, + { + "parentPluginId": "observabilityAIAssistant", + "id": "def-server.createFunctionResponseMessage.$1.data", + "type": "Unknown", + "tags": [], + "label": "data", + "description": [], + "signature": [ + "unknown" + ], + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "returnComment": [], + "initialIsOpen": false + }, { "parentPluginId": "observabilityAIAssistant", "id": "def-server.streamIntoObservable", @@ -7787,7 +9395,7 @@ "Observable", "" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -7801,7 +9409,7 @@ "signature": [ "Readable" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -7824,7 +9432,7 @@ "signature": [ "\"observability:logSources\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7839,7 +9447,7 @@ "signature": [ "\"observability:aiAssistantSearchConnectorIndexPattern\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -7854,7 +9462,7 @@ "signature": [ "\"observability:aiAssistantSimulatedFunctionCalling\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8831,7 +10439,7 @@ "ObservabilityAIAssistantRouteCreateOptions", ">; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -8847,7 +10455,13 @@ "({}: { signal: AbortSignal; resources: ", "RespondFunctionResources", "; client: ", - "ObservabilityAIAssistantClient", + { + "pluginId": "observabilityAIAssistant", + "scope": "server", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-server.ObservabilityAIAssistantClient", + "text": "ObservabilityAIAssistantClient" + }, "; functions: ", "ChatFunctionClient", "; scopes: ", @@ -8860,7 +10474,7 @@ }, "[]; }) => Promise" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -8876,7 +10490,13 @@ "{ signal: AbortSignal; resources: ", "RespondFunctionResources", "; client: ", - "ObservabilityAIAssistantClient", + { + "pluginId": "observabilityAIAssistant", + "scope": "server", + "docId": "kibObservabilityAIAssistantPluginApi", + "section": "def-server.ObservabilityAIAssistantClient", + "text": "ObservabilityAIAssistantClient" + }, "; functions: ", "ChatFunctionClient", "; scopes: ", @@ -8889,7 +10509,7 @@ }, "[]; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/types.ts", "deprecated": false, "trackAdoption": false } @@ -8905,7 +10525,7 @@ "tags": [], "label": "ObservabilityAIAssistantServerStart", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8921,7 +10541,7 @@ "signature": [ "ObservabilityAIAssistantService" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts", "deprecated": false, "trackAdoption": false } @@ -8936,7 +10556,7 @@ "tags": [], "label": "ObservabilityAIAssistantServerSetup", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8952,7 +10572,7 @@ "signature": [ "ObservabilityAIAssistantService" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts", "deprecated": false, "trackAdoption": false } @@ -8980,7 +10600,7 @@ }, " extends Error" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -8994,7 +10614,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9008,7 +10628,7 @@ "signature": [ "T" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9023,7 +10643,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9038,7 +10658,7 @@ "signature": [ "ErrorMetaAttributes[T]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9056,7 +10676,7 @@ "tags": [], "label": "ShortIdTable", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9070,7 +10690,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -9086,7 +10706,7 @@ "signature": [ "(originalId: string) => string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9100,7 +10720,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9118,7 +10738,7 @@ "signature": [ "(shortId: string) => string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9132,7 +10752,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9163,7 +10783,7 @@ "ConcatenatedMessage", ">" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -9196,7 +10816,7 @@ }, ".NotFoundError>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -9229,7 +10849,7 @@ }, ".FunctionNotFoundError>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9243,7 +10863,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9278,7 +10898,7 @@ }, ".InternalError>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9292,7 +10912,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9327,7 +10947,7 @@ }, ".TokenLimitReachedError>" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9341,7 +10961,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9356,7 +10976,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -9375,7 +10995,7 @@ "signature": [ "(error: Error) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9389,7 +11009,7 @@ "signature": [ "Error" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9408,7 +11028,7 @@ "signature": [ "(type: string) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9422,7 +11042,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9441,7 +11061,7 @@ "signature": [ "(error: Error) => boolean" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9455,7 +11075,7 @@ "signature": [ "Error" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -9473,7 +11093,7 @@ "tags": [], "label": "Conversation", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9484,7 +11104,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9498,7 +11118,7 @@ "signature": [ "{ id?: string | undefined; name: string; } | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9514,7 +11134,7 @@ "TokenCount", " | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9535,7 +11155,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9549,7 +11169,7 @@ "signature": [ "{ [x: string]: string; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9563,7 +11183,7 @@ "signature": [ "{ [x: string]: number; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9574,7 +11194,7 @@ "tags": [], "label": "namespace", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9585,7 +11205,7 @@ "tags": [], "label": "public", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -9609,7 +11229,7 @@ }, "" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9620,7 +11240,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9631,7 +11251,7 @@ "tags": [], "label": "description", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9652,7 +11272,7 @@ }, " | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9666,7 +11286,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9680,7 +11300,7 @@ "signature": [ "TParameters | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false } @@ -9694,7 +11314,7 @@ "tags": [], "label": "KnowledgeBaseEntry", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9705,7 +11325,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9716,7 +11336,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9730,7 +11350,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9741,7 +11361,7 @@ "tags": [], "label": "text", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9755,7 +11375,7 @@ "signature": [ "\"medium\" | \"high\" | \"low\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9766,7 +11386,7 @@ "tags": [], "label": "is_correction", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9780,7 +11400,7 @@ "signature": [ "\"user_instruction\" | \"contextual\" | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9791,7 +11411,7 @@ "tags": [], "label": "public", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9805,7 +11425,7 @@ "signature": [ "Record | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9825,7 +11445,7 @@ "text": "KnowledgeBaseEntryRole" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9839,7 +11459,7 @@ "signature": [ "{ name: string; } | undefined" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -9853,7 +11473,7 @@ "tags": [], "label": "Message", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -9864,7 +11484,7 @@ "tags": [], "label": "'@timestamp'", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false }, @@ -9910,7 +11530,7 @@ }, ".Elastic; } | undefined; data?: string | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false } @@ -9926,7 +11546,7 @@ "tags": [], "label": "ChatCompletionErrorCode", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9938,7 +11558,7 @@ "tags": [], "label": "FunctionVisibility", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9950,7 +11570,7 @@ "tags": [], "label": "KnowledgeBaseEntryRole", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9962,7 +11582,7 @@ "tags": [], "label": "KnowledgeBaseType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9974,7 +11594,7 @@ "tags": [], "label": "MessageRole", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9986,7 +11606,7 @@ "tags": [], "label": "StreamingChatResponseEventType", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -9998,7 +11618,7 @@ "tags": [], "label": "VisualizeESQLUserIntention", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10015,7 +11635,7 @@ "signature": [ "\"observability:logSources\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10030,7 +11650,7 @@ "signature": [ "\"observability:aiAssistantSearchConnectorIndexPattern\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10045,7 +11665,7 @@ "signature": [ "\"observability:aiAssistantSimulatedFunctionCalling\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10068,7 +11688,7 @@ }, ".BufferFlush; } & { data?: string | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10091,7 +11711,7 @@ }, ".ChatCompletionChunk; } & { id: string; message: { content?: string | undefined; function_call?: { name?: string | undefined; arguments?: string | undefined; } | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10122,7 +11742,7 @@ }, " | undefined; meta?: Record | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10145,7 +11765,7 @@ }, ".ChatCompletionMessage; } & { id: string; message: { content?: string | undefined; function_call?: { name?: string | undefined; arguments?: string | undefined; } | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10234,7 +11854,7 @@ }, "[] | undefined; description?: string | undefined; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10259,7 +11879,7 @@ "TokenCount", " | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10284,7 +11904,7 @@ "TokenCount", " | undefined; id?: string | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10309,7 +11929,7 @@ "TokenCount", " | undefined; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10340,7 +11960,7 @@ }, "; id: string; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10417,7 +12037,7 @@ "text": "BufferFlushEvent" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10486,7 +12106,7 @@ "text": "BufferFlushEvent" } ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10509,7 +12129,7 @@ }, ".TokenCount; } & { tokens: { completion: number; prompt: number; total: number; }; }" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -10531,7 +12151,7 @@ }, "[]" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/observability_a_i_assistant.mdx b/api_docs/observability_a_i_assistant.mdx index a238101a6e23..fbac729372c2 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 298 | 1 | 296 | 28 | +| 385 | 1 | 383 | 30 | ## Client @@ -60,6 +60,9 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai ### Functions +### Classes + + ### Consts, variables and types diff --git a/api_docs/observability_a_i_assistant_app.devdocs.json b/api_docs/observability_a_i_assistant_app.devdocs.json index b20b594df398..d583c2ff125c 100644 --- a/api_docs/observability_a_i_assistant_app.devdocs.json +++ b/api_docs/observability_a_i_assistant_app.devdocs.json @@ -6,7 +6,69 @@ "interfaces": [], "enums": [], "misc": [], - "objects": [] + "objects": [], + "setup": { + "parentPluginId": "observabilityAIAssistantApp", + "id": "def-public.ObservabilityAIAssistantAppPublicSetup", + "type": "Interface", + "tags": [], + "label": "ObservabilityAIAssistantAppPublicSetup", + "description": [], + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "observabilityAIAssistantApp", + "id": "def-public.ObservabilityAIAssistantAppPublicStart", + "type": "Interface", + "tags": [], + "label": "ObservabilityAIAssistantAppPublicStart", + "description": [], + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "observabilityAIAssistantApp", + "id": "def-public.ObservabilityAIAssistantAppPublicStart.RootCauseAnalysisContainer", + "type": "Function", + "tags": [], + "label": "RootCauseAnalysisContainer", + "description": [], + "signature": [ + "React.ExoticComponent<{ events?: ", + "RootCauseAnalysisEvent", + "[] | undefined; completeInBackground: boolean; onStartAnalysisClick: () => void; onStopAnalysisClick: () => void; onResetAnalysisClick: () => void; onClearAnalysisClick: () => void; onCompleteInBackgroundClick: () => void; loading: boolean; error?: Error | undefined; }>" + ], + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.ts", + "deprecated": false, + "trackAdoption": false, + "returnComment": [], + "children": [ + { + "parentPluginId": "observabilityAIAssistantApp", + "id": "def-public.ObservabilityAIAssistantAppPublicStart.RootCauseAnalysisContainer.$1", + "type": "Uncategorized", + "tags": [], + "label": "props", + "description": [], + "signature": [ + "P" + ], + "path": "node_modules/@types/react/ts5.0/index.d.ts", + "deprecated": false, + "trackAdoption": false + } + ] + } + ], + "lifecycle": "start", + "initialIsOpen": true + } }, "server": { "classes": [], @@ -24,7 +86,7 @@ "signature": [ "\"changes\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/index.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -39,7 +101,7 @@ "signature": [ "\"query\"" ], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/index.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -53,7 +115,7 @@ "tags": [], "label": "ObservabilityAIAssistantAppServerStart", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -67,7 +129,7 @@ "tags": [], "label": "ObservabilityAIAssistantAppServerSetup", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], diff --git a/api_docs/observability_a_i_assistant_app.mdx b/api_docs/observability_a_i_assistant_app.mdx index d17a9e0e27f0..b1bb740cbcf9 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityAIAssistantApp'] --- import observabilityAIAssistantAppObj from './observability_a_i_assistant_app.devdocs.json'; @@ -21,7 +21,15 @@ Contact [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 4 | 0 | 4 | 0 | +| 8 | 0 | 7 | 0 | + +## Client + +### Setup + + +### Start + ## Server diff --git a/api_docs/observability_ai_assistant_management.devdocs.json b/api_docs/observability_ai_assistant_management.devdocs.json index 8cc7e70b1990..b7ca87c81262 100644 --- a/api_docs/observability_ai_assistant_management.devdocs.json +++ b/api_docs/observability_ai_assistant_management.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "AiAssistantManagementObservabilityPluginSetup", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_management/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "AiAssistantManagementObservabilityPluginStart", "description": [], - "path": "x-pack/plugins/observability_solution/observability_ai_assistant_management/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], diff --git a/api_docs/observability_ai_assistant_management.mdx b/api_docs/observability_ai_assistant_management.mdx index ee6994ae7dc2..dc4da5f99bd8 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-12-10 +date: 2024-12-13 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 eefd6bbbc17b..0a76be85f806 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-12-10 +date: 2024-12-13 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 46b8953d5f67..a4aca0ca176d 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityOnboarding'] --- import observabilityOnboardingObj from './observability_onboarding.devdocs.json'; diff --git a/api_docs/observability_shared.mdx b/api_docs/observability_shared.mdx index d8f637861d6e..0563e434c56b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'observabilityShared'] --- import observabilitySharedObj from './observability_shared.devdocs.json'; diff --git a/api_docs/osquery.mdx b/api_docs/osquery.mdx index deaeb4de2d92..9b37570e6625 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-12-10 +date: 2024-12-13 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 c701e7935d09..12701483a14b 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-12-10 +date: 2024-12-13 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 a010cb19a416..4ff242488181 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana'] --- @@ -15,13 +15,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | Count | Plugins or Packages with a
public API | Number of teams | |--------------|----------|------------------------| -| 901 | 768 | 43 | +| 905 | 770 | 43 | ### Public API health stats | API Count | Any Count | Missing comments | Missing exports | |--------------|----------|-----------------|--------| -| 55052 | 240 | 41416 | 2030 | +| 55138 | 243 | 41474 | 2033 | ## Plugin Directory @@ -39,7 +39,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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. | 60 | 1 | 59 | 2 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 125 | 0 | 105 | 28 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 267 | 2 | 252 | 9 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 271 | 2 | 255 | 9 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 83 | 0 | 20 | 1 | | cloudChat | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | Chat available on Elastic Cloud deployments for quicker assistance. | 0 | 0 | 0 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | Static migration page where self-managed users can see text/copy about migrating to Elastic Cloud | 8 | 0 | 8 | 1 | @@ -54,7 +54,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | 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 | 268 | 0 | 249 | 1 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 114 | 0 | 111 | 14 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds the Dashboard app to Kibana | 114 | 0 | 111 | 13 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 54 | 0 | 51 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Data services are useful for searching and querying data from Elasticsearch. Helpful utilities include: a re-usable react query bar, KQL autocomplete, async search, Data Views (Index Patterns) and field formatters. | 3209 | 31 | 2594 | 24 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 6 | 0 | 6 | 0 | @@ -66,13 +66,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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. | 14 | 0 | 14 | 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. | 214 | 0 | 166 | 30 | +| | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | This plugin contains the Discover application and the saved search embeddable. | 215 | 0 | 167 | 30 | | | [@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 | 26 | 0 | 23 | 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 | -| | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | Server APIs for the Elastic AI Assistant | 56 | 0 | 41 | 2 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds embeddables service to Kibana | 571 | 1 | 462 | 9 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Extends embeddable plugin with more functionality | 19 | 0 | 19 | 2 | +| | [@elastic/security-generative-ai](https://github.com/orgs/elastic/teams/security-generative-ai) | Server APIs for the Elastic AI Assistant | 55 | 0 | 40 | 2 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds embeddables service to Kibana | 537 | 1 | 433 | 6 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Extends embeddable plugin with more functionality | 15 | 0 | 15 | 2 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides encryption and decryption utilities for saved objects containing sensitive information. | 54 | 0 | 47 | 1 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Adds dashboards for discovering and managing Enterprise Search products. | 5 | 0 | 5 | 0 | | | [@elastic/obs-entities](https://github.com/orgs/elastic/teams/obs-entities) | - | 2 | 0 | 2 | 0 | @@ -100,7 +100,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Expression XY plugin adds a `xy` renderer and function to the expression plugin. The renderer will display the `xy` chart. | 182 | 0 | 171 | 13 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Adds expression runtime to Kibana | 2241 | 17 | 1769 | 6 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 270 | 0 | 110 | 3 | -| | [@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/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | Index pattern fields and ambiguous values formatters | 293 | 5 | 254 | 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. | 45 | 0 | 45 | 9 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | 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. | 89 | 0 | 89 | 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 | @@ -156,8 +156,8 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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) | - | 697 | 2 | 689 | 23 | -| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 298 | 1 | 296 | 28 | -| | [@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) | - | 385 | 1 | 383 | 30 | +| | [@elastic/obs-ai-assistant](https://github.com/orgs/elastic/teams/obs-ai-assistant) | - | 8 | 0 | 7 | 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) | - | 24 | 0 | 24 | 0 | @@ -165,7 +165,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 159 | 2 | 129 | 10 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). | 126 | 2 | 102 | 8 | | | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 10 | 0 | 10 | 4 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 16 | 1 | 16 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 22 | 0 | 22 | 7 | @@ -191,7 +191,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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) | - | 13 | 0 | 13 | 0 | | 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. | 455 | 0 | 238 | 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. | 458 | 0 | 238 | 0 | | | [@elastic/security-solution](https://github.com/orgs/elastic/teams/security-solution) | - | 191 | 0 | 123 | 34 | | | [@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 | @@ -199,15 +199,15 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | Serverless customizations for observability. | 6 | 0 | 6 | 0 | | | [@elastic/search-kibana](https://github.com/orgs/elastic/teams/search-kibana) | Serverless customizations for search. | 7 | 0 | 7 | 0 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 134 | 0 | 134 | 8 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds URL Service and sharing capabilities to Kibana | 136 | 0 | 73 | 15 | -| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 48 | 0 | 48 | 2 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | Adds URL Service and sharing capabilities to Kibana | 136 | 0 | 73 | 16 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 54 | 0 | 54 | 2 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 22 | 1 | 22 | 1 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | This plugin provides the Spaces feature, which allows saved objects to be organized into meaningful categories. | 269 | 0 | 73 | 1 | | | [@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 | -| | [@elastic/streams-program-team](https://github.com/orgs/elastic/teams/streams-program-team) | A manager for Streams | 13 | 0 | 13 | 4 | +| | [@elastic/streams-program-team](https://github.com/orgs/elastic/teams/streams-program-team) | A manager for Streams | 13 | 0 | 13 | 3 | | | [@elastic/streams-program-team](https://github.com/orgs/elastic/teams/streams-program-team) | - | 8 | 0 | 8 | 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 | +| 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 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 108 | 0 | 64 | 7 | | | [@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 | @@ -222,13 +222,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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. | 69 | 0 | 35 | 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 | 21 | +| | [@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. | 150 | 2 | 113 | 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 | 0 | 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) | - | 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/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-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. | 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 | @@ -242,7 +242,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Registers the vega visualization. Is the elastic version of vega and vega-lite libraries. | 2 | 0 | 2 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the vislib visualizations. These are the classical area/line/bar, gauge/goal and heatmap charts. We want to replace them with elastic-charts. | 1 | 0 | 1 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the new xy-axis chart using the elastic-charts library, which will eventually replace the vislib xy-axis charts including bar, area, and line. | 52 | 0 | 50 | 5 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 871 | 12 | 840 | 20 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | Contains the shared architecture among all the legacy visualizations, e.g. the visualization type registry or the visualization embeddable. | 871 | 12 | 840 | 21 | | watcher | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 0 | 0 | 0 | 0 | ## Package Directory @@ -286,11 +286,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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) | - | 93 | 1 | 93 | 0 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 122 | 0 | 120 | 1 | -| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 20 | 0 | 15 | 4 | +| | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 25 | 0 | 16 | 6 | | | [@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) | - | 9 | 0 | 4 | 0 | -| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 227 | 0 | 188 | 9 | +| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 12 | 0 | 5 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 190 | 0 | 149 | 8 | | | [@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 | @@ -450,7 +450,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 10 | 0 | 3 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 8 | 0 | 8 | 0 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 20 | 0 | 6 | 0 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 21 | 0 | 6 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 146 | 1 | 63 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 16 | 0 | 16 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 15 | 0 | 15 | 2 | @@ -527,7 +527,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@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) | - | 271 | 1 | 210 | 14 | -| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 30 | 0 | 30 | 1 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 31 | 0 | 31 | 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) | - | 285 | 1 | 223 | 25 | | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 29 | 0 | 12 | 0 | @@ -535,13 +535,13 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-esql](https://github.com/orgs/elastic/teams/kibana-esql) | - | 205 | 0 | 193 | 12 | | | [@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) | - | 41 | 0 | 14 | 2 | +| | [@elastic/security-threat-hunting-investigations](https://github.com/orgs/elastic/teams/security-threat-hunting-investigations) | - | 43 | 0 | 15 | 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) | - | 51 | 0 | 42 | 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) | - | 111 | 2 | 86 | 1 | -| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 560 | 6 | 520 | 7 | +| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 564 | 6 | 524 | 7 | | | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 10 | 0 | 8 | 0 | | | [@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 | @@ -560,11 +560,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-threat-hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) | - | 85 | 0 | 80 | 2 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 75 | 0 | 73 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 126 | 3 | 126 | 0 | -| | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 132 | 0 | 43 | 1 | +| | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 136 | 0 | 43 | 3 | | | [@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) | - | 82 | 0 | 82 | 0 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 85 | 0 | 85 | 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/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 23 | 0 | 14 | 0 | @@ -620,7 +620,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 8 | 0 | 0 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 2 | 0 | 1 | 0 | | | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 34 | 0 | 0 | 0 | -| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 47 | 0 | 41 | 1 | +| | [@elastic/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 48 | 0 | 41 | 1 | | | [@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/ml-ui](https://github.com/orgs/elastic/teams/ml-ui) | - | 32 | 0 | 0 | 0 | @@ -633,26 +633,27 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 99 | 1 | 99 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 6 | 0 | 6 | 1 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 29 | 0 | 27 | 5 | -| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 4 | 0 | 4 | 1 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 31 | 2 | 31 | 2 | | | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 12 | 0 | 12 | 0 | | | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 15 | 0 | 15 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 46 | 0 | 46 | 9 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 51 | 5 | 34 | 0 | | | [@elastic/security-asset-management](https://github.com/orgs/elastic/teams/security-asset-management) | - | 66 | 0 | 66 | 0 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 44 | 3 | 27 | 1 | | | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 5 | 0 | 5 | 0 | | | [@elastic/kibana-performance-testing](https://github.com/orgs/elastic/teams/kibana-performance-testing) | - | 3 | 0 | 3 | 1 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 1 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 1 | 0 | 1 | 0 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 92 | 0 | 80 | 0 | -| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 229 | 0 | 193 | 6 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 87 | 0 | 75 | 1 | +| | [@elastic/kibana-presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | - | 233 | 0 | 197 | 6 | | | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 1 | 0 | 1 | 0 | | | [@elastic/appex-ai-infra](https://github.com/orgs/elastic/teams/appex-ai-infra) | - | 31 | 0 | 31 | 0 | | | [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) | - | 168 | 0 | 55 | 0 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 13 | 0 | 7 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | - | 22 | 0 | 9 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 9 | 0 | 8 | 0 | -| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 15 | 0 | 8 | 0 | +| | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 16 | 0 | 9 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 3 | 0 | 1 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 11 | 0 | 5 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 18 | 0 | 3 | 0 | @@ -660,6 +661,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 11 | 0 | 8 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 1 | 0 | 0 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 14 | 0 | 7 | 0 | +| | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 1 | 0 | 0 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 18 | 0 | 18 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 40 | 0 | 38 | 5 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 0 | 9 | 0 | @@ -677,7 +679,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 91 | 0 | 91 | 0 | | | [@elastic/kibana-data-discovery](https://github.com/orgs/elastic/teams/kibana-data-discovery) | A component for creating resizable layouts containing a fixed width panel and a flexible panel, with support for horizontal and vertical layouts. | 18 | 0 | 5 | 0 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 3 | 0 | 3 | 0 | -| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 157 | 0 | 156 | 7 | +| | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 158 | 0 | 157 | 7 | | | [@elastic/response-ops](https://github.com/orgs/elastic/teams/response-ops) | - | 8 | 0 | 8 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 13 | 2 | 8 | 0 | | | [@elastic/kibana-management](https://github.com/orgs/elastic/teams/kibana-management) | - | 3 | 0 | 3 | 0 | @@ -687,7 +689,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-detections-response](https://github.com/orgs/elastic/teams/security-detections-response) | - | 152 | 0 | 140 | 0 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 2 | 0 | 2 | 0 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 15 | 0 | 14 | 0 | -| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 117 | 0 | 86 | 8 | +| | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 121 | 0 | 90 | 8 | | | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 6 | 0 | 6 | 0 | | | [@elastic/appex-qa](https://github.com/orgs/elastic/teams/appex-qa) | - | 68 | 0 | 53 | 3 | | | [@elastic/appex-sharedux](https://github.com/orgs/elastic/teams/appex-sharedux) | - | 35 | 0 | 34 | 0 | @@ -705,9 +707,9 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 4 | 0 | 0 | 0 | | | [@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) | - | 125 | 0 | 66 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 126 | 0 | 66 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 67 | 0 | 40 | 0 | -| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 281 | 1 | 160 | 0 | +| | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 282 | 1 | 161 | 0 | | | [@elastic/kibana-security](https://github.com/orgs/elastic/teams/kibana-security) | - | 74 | 0 | 73 | 0 | | | [@elastic/kibana-cloud-security-posture](https://github.com/orgs/elastic/teams/kibana-cloud-security-posture) | - | 7 | 0 | 0 | 0 | | | [@elastic/security-threat-hunting-explore](https://github.com/orgs/elastic/teams/security-threat-hunting-explore) | - | 15 | 0 | 15 | 7 | @@ -718,7 +720,7 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 56 | 1 | 41 | 0 | | | [@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 | -| | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 87 | 0 | 76 | 1 | +| | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 88 | 0 | 77 | 1 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 107 | 0 | 96 | 1 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 15 | 0 | 7 | 0 | | | [@elastic/security-detection-engine](https://github.com/orgs/elastic/teams/security-detection-engine) | - | 147 | 0 | 125 | 0 | @@ -788,11 +790,11 @@ tags: ['contributor', 'dev', 'apidocs', 'kibana'] | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 4 | 0 | 4 | 0 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 19 | 0 | 19 | 3 | | | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 1 | 0 | 1 | 1 | -| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 4 | 0 | 3 | 0 | +| | [@elastic/obs-knowledge-team](https://github.com/orgs/elastic/teams/obs-knowledge-team) | - | 7 | 0 | 6 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 108 | 2 | 70 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 4 | 0 | 2 | 0 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 41 | 2 | 21 | 0 | -| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 32 | 2 | 32 | 0 | +| | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 9 | 0 | 9 | 0 | | | [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) | - | 19 | 0 | 19 | 0 | | | [@elastic/kibana-core](https://github.com/orgs/elastic/teams/kibana-core) | - | 7 | 0 | 5 | 1 | | | [@elastic/kibana-operations](https://github.com/orgs/elastic/teams/kibana-operations) | - | 360 | 4 | 305 | 14 | @@ -819,10 +821,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) | - | 144 | 0 | 138 | 4 | +| | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 145 | 0 | 139 | 4 | | | [@elastic/kibana-visualizations](https://github.com/orgs/elastic/teams/kibana-visualizations) | - | 24 | 0 | 22 | 1 | | | [@elastic/obs-ux-logs-team](https://github.com/orgs/elastic/teams/obs-ux-logs-team) | - | 14 | 0 | 14 | 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 | +| | [@elastic/security-detection-rule-management](https://github.com/orgs/elastic/teams/security-detection-rule-management) | - | 23 | 0 | 13 | 0 | diff --git a/api_docs/presentation_panel.mdx b/api_docs/presentation_panel.mdx index 405058c4edb2..efe507e5cd54 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationPanel'] --- import presentationPanelObj from './presentation_panel.devdocs.json'; diff --git a/api_docs/presentation_util.devdocs.json b/api_docs/presentation_util.devdocs.json index 3ceb843da051..ea50ab8480f1 100644 --- a/api_docs/presentation_util.devdocs.json +++ b/api_docs/presentation_util.devdocs.json @@ -3,62 +3,6 @@ "client": { "classes": [], "functions": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.cleanFiltersForSerialize", - "type": "Function", - "tags": [], - "label": "cleanFiltersForSerialize", - "description": [], - "signature": [ - "(filters?: ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[] | undefined) => ", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[]" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.cleanFiltersForSerialize.$1", - "type": "Array", - "tags": [], - "label": "filters", - "description": [], - "signature": [ - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" - }, - "[] | undefined" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.ts", - "deprecated": false, - "trackAdoption": false, - "isRequired": false - } - ], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "presentationUtil", "id": "def-public.DashboardDrilldownOptionsComponent", @@ -350,31 +294,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.lazyLoadReduxToolsPackage", - "type": "Function", - "tags": [], - "label": "lazyLoadReduxToolsPackage", - "description": [], - "signature": [ - "() => Promise<", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxToolsPackage", - "text": "ReduxToolsPackage" - }, - ">" - ], - "path": "src/plugins/presentation_util/public/redux_tools/index.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [], - "initialIsOpen": false - }, { "parentPluginId": "presentationUtil", "id": "def-public.LazySavedObjectSaveModalDashboard", @@ -899,678 +818,6 @@ ], "initialIsOpen": false }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableState", - "type": "Interface", - "tags": [], - "label": "ReduxEmbeddableState", - "description": [ - "\nThe Embeddable Redux store should contain Input, Output and State. Input is serialized and used to create the embeddable,\nOutput is used as a communication layer for state that the Embeddable creates, and State is used to store ephemeral state which needs\nto be communicated between an embeddable and its inner React components." - ], - "signature": [ - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableState", - "text": "ReduxEmbeddableState" - }, - "" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableState.explicitInput", - "type": "Uncategorized", - "tags": [], - "label": "explicitInput", - "description": [], - "signature": [ - "InputType" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableState.output", - "type": "Uncategorized", - "tags": [], - "label": "output", - "description": [], - "signature": [ - "OutputType" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableState.componentState", - "type": "Uncategorized", - "tags": [], - "label": "componentState", - "description": [], - "signature": [ - "StateType" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools", - "type": "Interface", - "tags": [], - "label": "ReduxEmbeddableTools", - "description": [ - "\nThe return type from createReduxEmbeddableTools. Contains tools to get state, select state for react components,\nset state, and react to state changes." - ], - "signature": [ - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableTools", - "text": "ReduxEmbeddableTools" - }, - "" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.cleanup", - "type": "Function", - "tags": [], - "label": "cleanup", - "description": [], - "signature": [ - "() => void" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [], - "returnComment": [] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.store", - "type": "Object", - "tags": [], - "label": "store", - "description": [], - "signature": [ - "ToolkitStore", - ">" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.select", - "type": "Function", - "tags": [], - "label": "select", - "description": [], - "signature": [ - "(selector: (state: ReduxEmbeddableStateType) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.select.$1", - "type": "Function", - "tags": [], - "label": "selector", - "description": [], - "signature": [ - "(state: ReduxStateType) => Selected" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.select.$1.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "ReduxStateType" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.select.$2", - "type": "Function", - "tags": [], - "label": "equalityFn", - "description": [], - "signature": [ - "((previous: Selected, next: Selected) => boolean) | undefined" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.getState", - "type": "Function", - "tags": [], - "label": "getState", - "description": [], - "signature": [ - "() => ReduxEmbeddableStateType & {}" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.dispatch", - "type": "Object", - "tags": [], - "label": "dispatch", - "description": [], - "signature": [ - "{ [ReducerKey in keyof ReducerType]: (payload: Parameters[1][\"payload\"]) => void; }" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.onStateChange", - "type": "Function", - "tags": [], - "label": "onStateChange", - "description": [], - "signature": [ - "(listener: () => void) => ", - "Unsubscribe" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxEmbeddableTools.onStateChange.$1", - "type": "Function", - "tags": [], - "label": "listener", - "description": [], - "signature": [ - "() => void" - ], - "path": "node_modules/redux/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - } - ] - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools", - "type": "Interface", - "tags": [], - "label": "ReduxTools", - "description": [ - "\nThe return type from createReduxTools. Contains tools to get state, select state for react components,\nset state, and react to state changes." - ], - "signature": [ - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxTools", - "text": "ReduxTools" - }, - "" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.store", - "type": "Object", - "tags": [], - "label": "store", - "description": [], - "signature": [ - "ToolkitStore", - ">" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.select", - "type": "Function", - "tags": [], - "label": "select", - "description": [], - "signature": [ - "(selector: (state: ReduxStateType) => Selected, equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined) => Selected" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.select.$1", - "type": "Function", - "tags": [], - "label": "selector", - "description": [], - "signature": [ - "(state: ReduxStateType) => Selected" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.select.$1.$1", - "type": "Uncategorized", - "tags": [], - "label": "state", - "description": [], - "signature": [ - "ReduxStateType" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.select.$2", - "type": "Function", - "tags": [], - "label": "equalityFn", - "description": [], - "signature": [ - "((previous: Selected, next: Selected) => boolean) | undefined" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.getState", - "type": "Function", - "tags": [], - "label": "getState", - "description": [], - "signature": [ - "() => ReduxStateType & {}" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.onStateChange", - "type": "Function", - "tags": [], - "label": "onStateChange", - "description": [], - "signature": [ - "(listener: () => void) => ", - "Unsubscribe" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.onStateChange.$1", - "type": "Function", - "tags": [], - "label": "listener", - "description": [], - "signature": [ - "() => void" - ], - "path": "node_modules/redux/index.d.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [] - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxTools.dispatch", - "type": "Object", - "tags": [], - "label": "dispatch", - "description": [], - "signature": [ - "{ [ReducerKey in keyof ReducerType]: (payload: Parameters[1][\"payload\"]) => void; }" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false - } - ], - "initialIsOpen": false - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxToolsPackage", - "type": "Interface", - "tags": [], - "label": "ReduxToolsPackage", - "description": [ - "\nThe package type is lazily exported from presentation_util and should contain all methods needed to use the redux embeddable tools." - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxToolsPackage.createReduxTools", - "type": "Function", - "tags": [], - "label": "createReduxTools", - "description": [], - "signature": [ - " = ", - "ReduxToolsReducers", - ">({ reducers, additionalMiddleware, initialState, }: { additionalMiddleware?: ", - "Middleware", - "<", - "AnyAction", - ", any, ", - "Dispatch", - "<", - "AnyAction", - ">>[] | undefined; initialState: ReduxStateType; reducers: ReducerType; }) => ", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxTools", - "text": "ReduxTools" - }, - "" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxToolsPackage.createReduxTools.$1", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "{ additionalMiddleware?: ", - "Middleware", - "<", - "AnyAction", - ", any, ", - "Dispatch", - "<", - "AnyAction", - ">>[] | undefined; initialState: ReduxStateType; reducers: ReducerType; }" - ], - "path": "src/plugins/presentation_util/public/redux_tools/create_redux_tools.ts", - "deprecated": false, - "trackAdoption": false - } - ] - }, - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxToolsPackage.createReduxEmbeddableTools", - "type": "Function", - "tags": [], - "label": "createReduxEmbeddableTools", - "description": [], - "signature": [ - " = ", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableState", - "text": "ReduxEmbeddableState" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", unknown>, ReducerType extends ", - "ReduxToolsReducers", - " = ", - "ReduxToolsReducers", - ">({ reducers, embeddable, syncSettings, additionalMiddleware, initialComponentState, }: { embeddable: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - "; additionalMiddleware?: ", - "Middleware", - "<", - "AnyAction", - ", any, ", - "Dispatch", - "<", - "AnyAction", - ">>[] | undefined; initialComponentState?: ReduxEmbeddableStateType[\"componentState\"] | undefined; syncSettings?: ", - "ReduxEmbeddableSyncSettings", - "<", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableState", - "text": "ReduxEmbeddableState" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", unknown>> | undefined; reducers: ReducerType; }) => ", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableTools", - "text": "ReduxEmbeddableTools" - }, - "" - ], - "path": "src/plugins/presentation_util/public/redux_tools/types.ts", - "deprecated": false, - "trackAdoption": false, - "returnComment": [], - "children": [ - { - "parentPluginId": "presentationUtil", - "id": "def-public.ReduxToolsPackage.createReduxEmbeddableTools.$1", - "type": "Object", - "tags": [], - "label": "__0", - "description": [], - "signature": [ - "{ embeddable: ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.Embeddable", - "text": "Embeddable" - }, - "; additionalMiddleware?: ", - "Middleware", - "<", - "AnyAction", - ", any, ", - "Dispatch", - "<", - "AnyAction", - ">>[] | undefined; initialComponentState?: ReduxEmbeddableStateType[\"componentState\"] | undefined; syncSettings?: ", - "ReduxEmbeddableSyncSettings", - "<", - { - "pluginId": "presentationUtil", - "scope": "public", - "docId": "kibPresentationUtilPluginApi", - "section": "def-public.ReduxEmbeddableState", - "text": "ReduxEmbeddableState" - }, - "<", - { - "pluginId": "embeddable", - "scope": "common", - "docId": "kibEmbeddablePluginApi", - "section": "def-common.EmbeddableInput", - "text": "EmbeddableInput" - }, - ", ", - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.EmbeddableOutput", - "text": "EmbeddableOutput" - }, - ", unknown>> | undefined; reducers: ReducerType; }" - ], - "path": "src/plugins/presentation_util/public/redux_tools/redux_embeddables/create_redux_embeddable_tools.ts", - "deprecated": false, - "trackAdoption": false - } - ] - } - ], - "initialIsOpen": false - }, { "parentPluginId": "presentationUtil", "id": "def-public.SaveModalDashboardProps", diff --git a/api_docs/presentation_util.mdx b/api_docs/presentation_util.mdx index f76c594cfb61..c2ce74ce6541 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'presentationUtil'] --- import presentationUtilObj from './presentation_util.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 | |-------------------|-----------|------------------------|-----------------| -| 159 | 2 | 129 | 10 | +| 126 | 2 | 102 | 8 | ## Client diff --git a/api_docs/product_doc_base.devdocs.json b/api_docs/product_doc_base.devdocs.json index c6d82bc6f79e..71ded441b875 100644 --- a/api_docs/product_doc_base.devdocs.json +++ b/api_docs/product_doc_base.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "ProductDocBasePluginSetup", "description": [], - "path": "x-pack/plugins/ai_infra/product_doc_base/public/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "ProductDocBasePluginStart", "description": [], - "path": "x-pack/plugins/ai_infra/product_doc_base/public/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -42,7 +42,7 @@ "signature": [ "InstallationAPI" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/public/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -71,7 +71,7 @@ "DocSearchResponse", ">" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/services/search/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/services/search/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -86,7 +86,7 @@ "signature": [ "DocSearchOptions" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/services/search/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/services/search/types.ts", "deprecated": false, "trackAdoption": false } @@ -102,7 +102,7 @@ "tags": [], "label": "ProductDocBaseSetupContract", "description": [], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -116,7 +116,7 @@ "tags": [], "label": "ProductDocBaseStartContract", "description": [], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -134,7 +134,7 @@ "DocSearchResponse", ">" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -149,7 +149,7 @@ "signature": [ "DocSearchOptions" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/services/search/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/services/search/types.ts", "deprecated": false, "trackAdoption": false } @@ -165,7 +165,7 @@ "signature": [ "DocumentationManagerAPI" ], - "path": "x-pack/plugins/ai_infra/product_doc_base/server/types.ts", + "path": "x-pack/platform/plugins/shared/ai_infra/product_doc_base/server/types.ts", "deprecated": false, "trackAdoption": false } diff --git a/api_docs/product_doc_base.mdx b/api_docs/product_doc_base.mdx index 8697949c31bc..4ea9f4b34c43 100644 --- a/api_docs/product_doc_base.mdx +++ b/api_docs/product_doc_base.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/productDocBase title: "productDocBase" image: https://source.unsplash.com/400x175/?github description: API docs for the productDocBase plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'productDocBase'] --- import productDocBaseObj from './product_doc_base.devdocs.json'; diff --git a/api_docs/profiling.devdocs.json b/api_docs/profiling.devdocs.json index 01192dc0b13f..1946c2afe9ec 100644 --- a/api_docs/profiling.devdocs.json +++ b/api_docs/profiling.devdocs.json @@ -17,7 +17,7 @@ "signature": [ "void" ], - "path": "x-pack/plugins/observability_solution/profiling/public/plugin.tsx", + "path": "x-pack/plugins/observability_solution/profiling/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", diff --git a/api_docs/profiling.mdx b/api_docs/profiling.mdx index 2f2edbd73b90..f7e53520a67e 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-12-10 +date: 2024-12-13 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 522147b1c44c..fd433a544aa7 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-12-10 +date: 2024-12-13 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 fa12a3aa38bd..bf1aadf8d95b 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-12-10 +date: 2024-12-13 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 517733987a9a..6845f2303028 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-12-10 +date: 2024-12-13 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 ddc9a17fdda4..1c42db4975c6 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'rollup'] --- import rollupObj from './rollup.devdocs.json'; diff --git a/api_docs/rule_registry.mdx b/api_docs/rule_registry.mdx index 2dfad9af095a..dae2fb0e4802 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-12-10 +date: 2024-12-13 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 6ec93b8215ca..2a1d4ad4060f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'runtimeFields'] --- import runtimeFieldsObj from './runtime_fields.devdocs.json'; diff --git a/api_docs/saved_objects.devdocs.json b/api_docs/saved_objects.devdocs.json index 79f331186c69..56c2bcd5d8cd 100644 --- a/api_docs/saved_objects.devdocs.json +++ b/api_docs/saved_objects.devdocs.json @@ -34,14 +34,6 @@ "removeBy": "8.8.0", "trackAdoption": false, "references": [ - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx" - }, { "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx" @@ -50,6 +42,14 @@ "plugin": "presentationUtil", "path": "src/plugins/presentation_util/public/components/saved_object_save_modal_dashboard.tsx" }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx" + }, + { + "plugin": "visualizations", + "path": "src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx" + }, { "plugin": "lens", "path": "x-pack/plugins/lens/public/visualizations/xy/annotations/actions/save_action.tsx" diff --git a/api_docs/saved_objects.mdx b/api_docs/saved_objects.mdx index 7a4f8e71721f..e0b937b9d62f 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjects'] --- import savedObjectsObj from './saved_objects.devdocs.json'; diff --git a/api_docs/saved_objects_finder.mdx b/api_docs/saved_objects_finder.mdx index f84b1de547b6..160b5b03d636 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-12-10 +date: 2024-12-13 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 5af681ef0808..cd3285f96a58 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-12-10 +date: 2024-12-13 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 b32e5a9d99d3..cedf4acb7f1a 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-12-10 +date: 2024-12-13 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 dd7b41d92559..a2cf5bd75d3b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'savedObjectsTaggingOss'] --- import savedObjectsTaggingOssObj from './saved_objects_tagging_oss.devdocs.json'; diff --git a/api_docs/saved_search.mdx b/api_docs/saved_search.mdx index 5a2fae0d7abd..505ea6f9595d 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-12-10 +date: 2024-12-13 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 eb3e94d6aeab..979b95c85c47 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-12-10 +date: 2024-12-13 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 7519647f5d44..254d2438c192 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'screenshotting'] --- import screenshottingObj from './screenshotting.devdocs.json'; diff --git a/api_docs/search_assistant.mdx b/api_docs/search_assistant.mdx index 10999a62b75f..0f31a8bc7b97 100644 --- a/api_docs/search_assistant.mdx +++ b/api_docs/search_assistant.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchAssistant title: "searchAssistant" image: https://source.unsplash.com/400x175/?github description: API docs for the searchAssistant plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchAssistant'] --- import searchAssistantObj from './search_assistant.devdocs.json'; diff --git a/api_docs/search_connectors.mdx b/api_docs/search_connectors.mdx index 4c51a6bfb01e..4981102baf11 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-12-10 +date: 2024-12-13 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 26fd2f09cf18..012896d94610 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchHomepage'] --- import searchHomepageObj from './search_homepage.devdocs.json'; diff --git a/api_docs/search_indices.mdx b/api_docs/search_indices.mdx index d3e710662efa..5d67f3d0bfb1 100644 --- a/api_docs/search_indices.mdx +++ b/api_docs/search_indices.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchIndices title: "searchIndices" image: https://source.unsplash.com/400x175/?github description: API docs for the searchIndices plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchIndices'] --- import searchIndicesObj from './search_indices.devdocs.json'; diff --git a/api_docs/search_inference_endpoints.mdx b/api_docs/search_inference_endpoints.mdx index 586130aa4c7f..76a331163695 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchInferenceEndpoints'] --- import searchInferenceEndpointsObj from './search_inference_endpoints.devdocs.json'; diff --git a/api_docs/search_navigation.mdx b/api_docs/search_navigation.mdx index 68c346df437e..cdcd5f1b2ff4 100644 --- a/api_docs/search_navigation.mdx +++ b/api_docs/search_navigation.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/searchNavigation title: "searchNavigation" image: https://source.unsplash.com/400x175/?github description: API docs for the searchNavigation plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNavigation'] --- import searchNavigationObj from './search_navigation.devdocs.json'; diff --git a/api_docs/search_notebooks.mdx b/api_docs/search_notebooks.mdx index 60127da7c23a..873fbbca39fa 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchNotebooks'] --- import searchNotebooksObj from './search_notebooks.devdocs.json'; diff --git a/api_docs/search_playground.mdx b/api_docs/search_playground.mdx index f21a543026a9..f402bebe9781 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'searchPlayground'] --- import searchPlaygroundObj from './search_playground.devdocs.json'; diff --git a/api_docs/security.devdocs.json b/api_docs/security.devdocs.json index c1f411fb8b76..c2c17b9fbb0a 100644 --- a/api_docs/security.devdocs.json +++ b/api_docs/security.devdocs.json @@ -141,6 +141,22 @@ "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-public.AuthenticatedUser.operator", + "type": "CompoundType", + "tags": [], + "label": "operator", + "description": [ + "\nIndicates whether user is an operator." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -3673,6 +3689,22 @@ "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-server.AuthenticatedUser.operator", + "type": "CompoundType", + "tags": [], + "label": "operator", + "description": [ + "\nIndicates whether user is an operator." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false @@ -6358,13 +6390,47 @@ "label": "authz", "description": [], "signature": [ + "{ mode: ", { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.AuthorizationServiceSetup", - "text": "AuthorizationServiceSetup" - } + "section": "def-server.AuthorizationMode", + "text": "AuthorizationMode" + }, + "; actions: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.Actions", + "text": "Actions" + }, + "; checkPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesWithRequest", + "text": "CheckPrivilegesWithRequest" + }, + "; checkPrivilegesDynamicallyWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesDynamicallyWithRequest", + "text": "CheckPrivilegesDynamicallyWithRequest" + }, + "; checkSavedObjectsPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckSavedObjectsPrivilegesWithRequest", + "text": "CheckSavedObjectsPrivilegesWithRequest" + }, + "; }" ], "path": "x-pack/plugins/security/server/plugin.ts", "deprecated": true, @@ -6467,7 +6533,7 @@ }, { "plugin": "observabilityAIAssistant", - "path": "x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts" + "path": "x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts" }, { "plugin": "fleet", @@ -6489,26 +6555,6 @@ "plugin": "cloudSecurityPosture", "path": "x-pack/plugins/cloud_security_posture/server/routes/setup_routes.ts" }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/enable.ts" - }, - { - "plugin": "entityManager", - "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/disable.ts" - }, { "plugin": "apm", "path": "x-pack/plugins/observability_solution/apm/server/lib/helpers/get_random_sampler/index.ts" @@ -6538,52 +6584,72 @@ "path": "x-pack/plugins/upgrade_assistant/server/lib/reindexing/credential_store.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/lib/auth/api_key/api_key.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/enable.ts" + }, + { + "plugin": "entityManager", + "path": "x-pack/platform/plugins/shared/entity_manager/server/routes/enablement/disable.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "fleet", + "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + }, + { + "plugin": "transform", + "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts" }, { - "plugin": "fleet", - "path": "x-pack/plugins/fleet/server/routes/setup/handlers.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" }, { - "plugin": "transform", - "path": "x-pack/platform/plugins/private/transform/server/routes/api/reauthorize_transforms/route_handler_factory.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts" } ] }, @@ -6597,13 +6663,47 @@ "\nAuthorization services to manage and access the permissions a particular user has." ], "signature": [ + "{ mode: ", { "pluginId": "@kbn/security-plugin-types-server", "scope": "server", "docId": "kibKbnSecurityPluginTypesServerPluginApi", - "section": "def-server.AuthorizationServiceSetup", - "text": "AuthorizationServiceSetup" - } + "section": "def-server.AuthorizationMode", + "text": "AuthorizationMode" + }, + "; actions: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.Actions", + "text": "Actions" + }, + "; checkPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesWithRequest", + "text": "CheckPrivilegesWithRequest" + }, + "; checkPrivilegesDynamicallyWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckPrivilegesDynamicallyWithRequest", + "text": "CheckPrivilegesDynamicallyWithRequest" + }, + "; checkSavedObjectsPrivilegesWithRequest: ", + { + "pluginId": "@kbn/security-plugin-types-server", + "scope": "server", + "docId": "kibKbnSecurityPluginTypesServerPluginApi", + "section": "def-server.CheckSavedObjectsPrivilegesWithRequest", + "text": "CheckSavedObjectsPrivilegesWithRequest" + }, + "; }" ], "path": "x-pack/packages/security/plugin_types_server/src/plugin.ts", "deprecated": false, @@ -6963,6 +7063,22 @@ "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", "deprecated": false, "trackAdoption": false + }, + { + "parentPluginId": "security", + "id": "def-common.AuthenticatedUser.operator", + "type": "CompoundType", + "tags": [], + "label": "operator", + "description": [ + "\nIndicates whether user is an operator." + ], + "signature": [ + "boolean | undefined" + ], + "path": "packages/core/security/core-security-common/src/authentication/authenticated_user.ts", + "deprecated": false, + "trackAdoption": false } ], "initialIsOpen": false diff --git a/api_docs/security.mdx b/api_docs/security.mdx index ee526e2bdc14..8299a1b4fc49 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-12-10 +date: 2024-12-13 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 | |-------------------|-----------|------------------------|-----------------| -| 455 | 0 | 238 | 0 | +| 458 | 0 | 238 | 0 | ## Client diff --git a/api_docs/security_solution.devdocs.json b/api_docs/security_solution.devdocs.json index 83890026a0c9..35eea88c3daa 100644 --- a/api_docs/security_solution.devdocs.json +++ b/api_docs/security_solution.devdocs.json @@ -522,7 +522,7 @@ "\nExperimental flag needed to enable the link" ], "signature": [ - "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | undefined" + "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | \"newExpandableFlyoutNavigationEnabled\" | \"crowdstrikeRunScriptEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -602,7 +602,7 @@ "\nExperimental flag needed to disable the link. Opposite of experimentalKey" ], "signature": [ - "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | undefined" + "\"assistantModelEvaluation\" | \"defendInsights\" | \"alertSuppressionForSequenceEqlRuleEnabled\" | \"excludePoliciesInFilterEnabled\" | \"kubernetesEnabled\" | \"donutChartEmbeddablesEnabled\" | \"previewTelemetryUrlEnabled\" | \"extendedRuleExecutionLoggingEnabled\" | \"socTrendsEnabled\" | \"responseActionUploadEnabled\" | \"automatedProcessActionsEnabled\" | \"responseActionsSentinelOneV1Enabled\" | \"responseActionsSentinelOneV2Enabled\" | \"responseActionsSentinelOneGetFileEnabled\" | \"responseActionsSentinelOneKillProcessEnabled\" | \"responseActionsSentinelOneProcessesEnabled\" | \"responseActionsCrowdstrikeManualHostIsolationEnabled\" | \"endpointManagementSpaceAwarenessEnabled\" | \"securitySolutionNotesDisabled\" | \"entityAlertPreviewDisabled\" | \"newUserDetailsFlyoutManagedUser\" | \"riskScoringPersistence\" | \"riskScoringRoutesEnabled\" | \"esqlRulesDisabled\" | \"protectionUpdatesEnabled\" | \"disableTimelineSaveTour\" | \"riskEnginePrivilegesRouteEnabled\" | \"sentinelOneDataInAnalyzerEnabled\" | \"sentinelOneManualHostActionsEnabled\" | \"crowdstrikeDataInAnalyzerEnabled\" | \"responseActionsTelemetryEnabled\" | \"jamfDataInAnalyzerEnabled\" | \"timelineEsqlTabDisabled\" | \"analyzerDatePickersAndSourcererDisabled\" | \"graphVisualizationInFlyoutEnabled\" | \"prebuiltRulesCustomizationEnabled\" | \"malwareOnWriteScanOptionAvailable\" | \"unifiedManifestEnabled\" | \"valueListItemsModalEnabled\" | \"filterProcessDescendantsForEventFiltersEnabled\" | \"dataIngestionHubEnabled\" | \"entityStoreDisabled\" | \"serviceEntityStoreEnabled\" | \"siemMigrationsEnabled\" | \"newExpandableFlyoutNavigationEnabled\" | \"crowdstrikeRunScriptEnabled\" | undefined" ], "path": "x-pack/plugins/security_solution/public/common/links/types.ts", "deprecated": false, @@ -1882,7 +1882,7 @@ "label": "experimentalFeatures", "description": [], "signature": [ - "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; }" + "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/public/types.ts", "deprecated": false, @@ -3130,7 +3130,7 @@ "\nThe security solution generic experimental features" ], "signature": [ - "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; }" + "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/server/plugin_contract.ts", "deprecated": false, @@ -3303,7 +3303,7 @@ "label": "ExperimentalFeatures", "description": [], "signature": [ - "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; }" + "{ readonly alertSuppressionForSequenceEqlRuleEnabled: 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 endpointManagementSpaceAwarenessEnabled: boolean; readonly securitySolutionNotesDisabled: boolean; readonly entityAlertPreviewDisabled: boolean; readonly assistantModelEvaluation: 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 responseActionsTelemetryEnabled: boolean; readonly jamfDataInAnalyzerEnabled: boolean; readonly timelineEsqlTabDisabled: boolean; readonly analyzerDatePickersAndSourcererDisabled: boolean; readonly graphVisualizationInFlyoutEnabled: boolean; readonly prebuiltRulesCustomizationEnabled: boolean; readonly malwareOnWriteScanOptionAvailable: boolean; readonly unifiedManifestEnabled: boolean; readonly valueListItemsModalEnabled: boolean; readonly filterProcessDescendantsForEventFiltersEnabled: boolean; readonly dataIngestionHubEnabled: boolean; readonly entityStoreDisabled: boolean; readonly serviceEntityStoreEnabled: boolean; readonly siemMigrationsEnabled: boolean; readonly defendInsights: boolean; readonly newExpandableFlyoutNavigationEnabled: boolean; readonly crowdstrikeRunScriptEnabled: boolean; }" ], "path": "x-pack/plugins/security_solution/common/experimental_features.ts", "deprecated": false, @@ -3369,7 +3369,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 alertSuppressionForSequenceEqlRuleEnabled: true; readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: false; 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 endpointManagementSpaceAwarenessEnabled: false; readonly securitySolutionNotesDisabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; 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 responseActionsTelemetryEnabled: false; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly graphVisualizationInFlyoutEnabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; readonly entityStoreDisabled: false; readonly serviceEntityStoreEnabled: true; readonly siemMigrationsEnabled: false; readonly defendInsights: false; }" + "{ readonly alertSuppressionForSequenceEqlRuleEnabled: true; readonly excludePoliciesInFilterEnabled: false; readonly kubernetesEnabled: false; 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 endpointManagementSpaceAwarenessEnabled: false; readonly securitySolutionNotesDisabled: false; readonly entityAlertPreviewDisabled: false; readonly assistantModelEvaluation: false; 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 responseActionsTelemetryEnabled: false; readonly jamfDataInAnalyzerEnabled: true; readonly timelineEsqlTabDisabled: false; readonly analyzerDatePickersAndSourcererDisabled: false; readonly graphVisualizationInFlyoutEnabled: false; readonly prebuiltRulesCustomizationEnabled: false; readonly malwareOnWriteScanOptionAvailable: true; readonly unifiedManifestEnabled: true; readonly valueListItemsModalEnabled: true; readonly filterProcessDescendantsForEventFiltersEnabled: true; readonly dataIngestionHubEnabled: false; readonly entityStoreDisabled: false; readonly serviceEntityStoreEnabled: false; readonly siemMigrationsEnabled: false; readonly defendInsights: false; readonly newExpandableFlyoutNavigationEnabled: false; readonly crowdstrikeRunScriptEnabled: 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 3187c6ebb132..e757a1b8af55 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-12-10 +date: 2024-12-13 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 ac5003768491..ea9bf734dbe1 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-12-10 +date: 2024-12-13 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 c564182e3e4a..74b8db070925 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-12-10 +date: 2024-12-13 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 b8f60227062d..6e65a4d2cd12 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'serverless'] --- import serverlessObj from './serverless.devdocs.json'; diff --git a/api_docs/serverless_observability.devdocs.json b/api_docs/serverless_observability.devdocs.json index 27cfb7e4ed1a..4b2486bb9136 100644 --- a/api_docs/serverless_observability.devdocs.json +++ b/api_docs/serverless_observability.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "ServerlessObservabilityPublicSetup", "description": [], - "path": "x-pack/plugins/serverless_observability/public/types.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "ServerlessObservabilityPublicStart", "description": [], - "path": "x-pack/plugins/serverless_observability/public/types.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "ServerlessObservabilityPluginSetup", "description": [], - "path": "x-pack/plugins/serverless_observability/server/types.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "ServerlessObservabilityPluginStart", "description": [], - "path": "x-pack/plugins/serverless_observability/server/types.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -88,7 +88,7 @@ "signature": [ "\"serverlessObservability\"" ], - "path": "x-pack/plugins/serverless_observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -103,7 +103,7 @@ "signature": [ "\"serverlessObservability\"" ], - "path": "x-pack/plugins/serverless_observability/common/index.ts", + "path": "x-pack/solutions/observability/plugins/serverless_observability/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/serverless_observability.mdx b/api_docs/serverless_observability.mdx index 2b29dcbc9703..fdc547e18044 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-12-10 +date: 2024-12-13 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 4c4ffb23c5ac..eda7330cd3b7 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-12-10 +date: 2024-12-13 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 b085908391dc..15b71bcc7da5 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'sessionView'] --- import sessionViewObj from './session_view.devdocs.json'; diff --git a/api_docs/share.devdocs.json b/api_docs/share.devdocs.json index f059f4827715..36ca1c42b9b0 100644 --- a/api_docs/share.devdocs.json +++ b/api_docs/share.devdocs.json @@ -528,7 +528,7 @@ ], "signature": [ "(params: P, options?: ", - "FormatSearchParamsOptions", + "GetRedirectUrlOptions", " | undefined) => string" ], "path": "src/plugins/share/common/url_service/locators/types.ts", @@ -562,7 +562,7 @@ "URL serialization options." ], "signature": [ - "FormatSearchParamsOptions", + "GetRedirectUrlOptions", " | undefined" ], "path": "src/plugins/share/common/url_service/locators/types.ts", @@ -847,7 +847,9 @@ "\nAllows for passing contextual information that each consumer can provide to customize the share menu" ], "signature": [ - "{ title: string; }" + "{ title: string; config?: Partial> | undefined; }" ], "path": "src/plugins/share/public/types.ts", "deprecated": false, @@ -2318,7 +2320,7 @@ ], "signature": [ "(params: P, options?: ", - "FormatSearchParamsOptions", + "GetRedirectUrlOptions", " | undefined) => string" ], "path": "src/plugins/share/common/url_service/locators/types.ts", @@ -2352,7 +2354,7 @@ "URL serialization options." ], "signature": [ - "FormatSearchParamsOptions", + "GetRedirectUrlOptions", " | undefined" ], "path": "src/plugins/share/common/url_service/locators/types.ts", diff --git a/api_docs/share.mdx b/api_docs/share.mdx index b533d5e9cdaf..483daf6384c2 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'share'] --- import shareObj from './share.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 | |-------------------|-----------|------------------------|-----------------| -| 136 | 0 | 73 | 15 | +| 136 | 0 | 73 | 16 | ## Client diff --git a/api_docs/slo.devdocs.json b/api_docs/slo.devdocs.json index 6103989a90a7..410a5f83698d 100644 --- a/api_docs/slo.devdocs.json +++ b/api_docs/slo.devdocs.json @@ -1221,10 +1221,124 @@ "server": { "classes": [], "functions": [], - "interfaces": [], + "interfaces": [ + { + "parentPluginId": "slo", + "id": "def-server.SloClient", + "type": "Interface", + "tags": [], + "label": "SloClient", + "description": [], + "path": "x-pack/plugins/observability_solution/slo/server/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "slo", + "id": "def-server.SloClient.getSummaryIndices", + "type": "Function", + "tags": [], + "label": "getSummaryIndices", + "description": [], + "signature": [ + "() => Promise" + ], + "path": "x-pack/plugins/observability_solution/slo/server/client/index.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "returnComment": [] + } + ], + "initialIsOpen": false + } + ], "enums": [], "misc": [], - "objects": [] + "objects": [], + "setup": { + "parentPluginId": "slo", + "id": "def-server.SLOServerSetup", + "type": "Interface", + "tags": [], + "label": "SLOServerSetup", + "description": [], + "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [], + "lifecycle": "setup", + "initialIsOpen": true + }, + "start": { + "parentPluginId": "slo", + "id": "def-server.SLOServerStart", + "type": "Interface", + "tags": [], + "label": "SLOServerStart", + "description": [], + "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "slo", + "id": "def-server.SLOServerStart.getSloClientWithRequest", + "type": "Function", + "tags": [], + "label": "getSloClientWithRequest", + "description": [], + "signature": [ + "(request: ", + { + "pluginId": "@kbn/core-http-server", + "scope": "server", + "docId": "kibKbnCoreHttpServerPluginApi", + "section": "def-server.KibanaRequest", + "text": "KibanaRequest" + }, + ") => ", + { + "pluginId": "slo", + "scope": "server", + "docId": "kibSloPluginApi", + "section": "def-server.SloClient", + "text": "SloClient" + } + ], + "path": "x-pack/plugins/observability_solution/slo/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "children": [ + { + "parentPluginId": "slo", + "id": "def-server.SLOServerStart.getSloClientWithRequest.$1", + "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/slo/server/types.ts", + "deprecated": false, + "trackAdoption": false, + "isRequired": true + } + ], + "returnComment": [] + } + ], + "lifecycle": "start", + "initialIsOpen": true + } }, "common": { "classes": [], diff --git a/api_docs/slo.mdx b/api_docs/slo.mdx index 34be1f29719b..02d8a354eec5 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'slo'] --- import sloObj from './slo.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 | |-------------------|-----------|------------------------|-----------------| -| 48 | 0 | 48 | 2 | +| 54 | 0 | 54 | 2 | ## Client @@ -34,6 +34,17 @@ Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/ ### Interfaces +## Server + +### Setup + + +### Start + + +### Interfaces + + ## Common ### Objects diff --git a/api_docs/snapshot_restore.mdx b/api_docs/snapshot_restore.mdx index fe3e8f32c653..352efa40c91c 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-12-10 +date: 2024-12-13 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 27ce322add6a..6fe1270c9917 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-12-10 +date: 2024-12-13 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 5303fd771eb8..5aa62da077ed 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-12-10 +date: 2024-12-13 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 8e9ed5dc2932..a46903d547a1 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'stackConnectors'] --- import stackConnectorsObj from './stack_connectors.devdocs.json'; diff --git a/api_docs/streams.devdocs.json b/api_docs/streams.devdocs.json index 095b9b87cb11..4e6151b341ba 100644 --- a/api_docs/streams.devdocs.json +++ b/api_docs/streams.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "StreamsPluginSetup", "description": [], - "path": "x-pack/plugins/streams/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29,7 +29,7 @@ "Observable", "<{ status: \"unknown\" | \"disabled\" | \"enabled\"; }>" ], - "path": "x-pack/plugins/streams/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -44,7 +44,7 @@ "tags": [], "label": "StreamsPluginStart", "description": [], - "path": "x-pack/plugins/streams/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -63,7 +63,27 @@ "section": "def-common.RouteRepositoryClient", "text": "RouteRepositoryClient" }, - "<{ \"POST /api/streams/{id}/_sample\": ", + "<{ \"POST /api/streams/{id}/schema/fields_simulation\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /api/streams/{id}/schema/fields_simulation\", Zod.ZodObject<{ path: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; body: Zod.ZodObject<{ field_definitions: Zod.ZodArray; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }, { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }; }, { path: { id: string; }; body: { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }; }>, ", + "StreamsRouteHandlerResources", + ", { status: \"unknown\" | \"success\" | \"failure\"; simulationError: string | null; documentsWithRuntimeFieldsApplied: unknown[] | null; }, undefined>; \"GET /api/streams/{id}/schema/unmapped_fields\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /api/streams/{id}/schema/unmapped_fields\", Zod.ZodObject<{ path: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; }, { path: { id: string; }; }>, ", + "StreamsRouteHandlerResources", + ", { unmappedFields: string[]; }, undefined>; \"POST /api/streams/{id}/_sample\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -129,11 +149,9 @@ "StreamsRouteHandlerResources", ", { definitions: { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }[]; trees: ", - "StreamTree", - "[]; }, undefined>; \"DELETE /api/streams/{id}\": ", + "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }[]; }, undefined>; \"DELETE /api/streams/{id}\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -159,7 +177,7 @@ "Condition", "; }, { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }>, \"many\">>; fields: Zod.ZodDefault; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }>, \"many\">>; children: Zod.ZodDefault, \"many\">>; fields: Zod.ZodDefault; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">>; managed: Zod.ZodDefault; children: Zod.ZodDefault, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; }, { children?: { id: string; condition?: ", "Condition", - "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; }; }, { path: { id: string; }; body: { children?: { id: string; condition?: ", "Condition", - "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; }; }>, ", "StreamsRouteHandlerResources", @@ -197,9 +215,9 @@ "StreamsRouteHandlerResources", ", { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, undefined>; \"POST /api/streams/{id}/_fork\": ", + "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; format?: string | undefined; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, undefined>; \"POST /api/streams/{id}/_fork\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -215,7 +233,7 @@ "Condition", "; }, { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }>, \"many\">>; fields: Zod.ZodDefault; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }>, \"many\">>; children: Zod.ZodDefault, \"many\">>; fields: Zod.ZodDefault; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">>; managed: Zod.ZodDefault; children: Zod.ZodDefault, \"many\">>; }, { id: Zod.ZodString; managed: Zod.ZodDefault; unmanaged_elasticsearch_assets: Zod.ZodOptional; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }>, \"many\">>; }>, \"children\">, \"strip\", Zod.ZodTypeAny, { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }>, \"many\">>; }, { id: Zod.ZodString; unmanaged_elasticsearch_assets: Zod.ZodOptional; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }>, \"many\">>; }>, \"children\">, \"strip\", Zod.ZodTypeAny, { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }>; condition: Zod.ZodType<", "Condition", ", Zod.ZodTypeDef, ", "Condition", - ">; }, \"strip\", Zod.ZodTypeAny, { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + ">; }, \"strip\", Zod.ZodTypeAny, { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }, { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }, { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }; }, { path: { id: string; }; body: { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }; }, { path: { id: string; }; body: { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", @@ -269,11 +287,11 @@ }, "<\"POST /api/streams/_enable\", Zod.ZodObject<{}, \"strip\", Zod.ZodTypeAny, {}, {}>, ", "StreamsRouteHandlerResources", - ", { acknowledged: true; }, undefined>; }, ", + ", { acknowledged: true; message: string; }, undefined>; }, ", "StreamsRepositoryClientOptions", ">" ], - "path": "x-pack/plugins/streams/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -288,7 +306,7 @@ "Observable", "<{ status: \"unknown\" | \"disabled\" | \"enabled\"; }>" ], - "path": "x-pack/plugins/streams/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -308,7 +326,7 @@ "tags": [], "label": "ListStreamResponse", "description": [], - "path": "x-pack/plugins/streams/server/lib/streams/stream_crud.ts", + "path": "x-pack/solutions/observability/plugins/streams/server/lib/streams/stream_crud.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -322,11 +340,11 @@ "signature": [ "{ id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }[]" ], - "path": "x-pack/plugins/streams/server/lib/streams/stream_crud.ts", + "path": "x-pack/solutions/observability/plugins/streams/server/lib/streams/stream_crud.ts", "deprecated": false, "trackAdoption": false } @@ -346,7 +364,7 @@ "signature": [ "{}" ], - "path": "x-pack/plugins/streams/common/config.ts", + "path": "x-pack/solutions/observability/plugins/streams/common/config.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -359,7 +377,27 @@ "label": "StreamsRouteRepository", "description": [], "signature": [ - "{ \"POST /api/streams/{id}/_sample\": ", + "{ \"POST /api/streams/{id}/schema/fields_simulation\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"POST /api/streams/{id}/schema/fields_simulation\", Zod.ZodObject<{ path: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; body: Zod.ZodObject<{ field_definitions: Zod.ZodArray; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">; }, \"strip\", Zod.ZodTypeAny, { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }, { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }; }, { path: { id: string; }; body: { field_definitions: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; }; }>, ", + "StreamsRouteHandlerResources", + ", { status: \"unknown\" | \"success\" | \"failure\"; simulationError: string | null; documentsWithRuntimeFieldsApplied: unknown[] | null; }, undefined>; \"GET /api/streams/{id}/schema/unmapped_fields\": ", + { + "pluginId": "@kbn/server-route-repository-utils", + "scope": "common", + "docId": "kibKbnServerRouteRepositoryUtilsPluginApi", + "section": "def-common.ServerRoute", + "text": "ServerRoute" + }, + "<\"GET /api/streams/{id}/schema/unmapped_fields\", Zod.ZodObject<{ path: Zod.ZodObject<{ id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; }, { id: string; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; }, { path: { id: string; }; }>, ", + "StreamsRouteHandlerResources", + ", { unmappedFields: string[]; }, undefined>; \"POST /api/streams/{id}/_sample\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -425,11 +463,9 @@ "StreamsRouteHandlerResources", ", { definitions: { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }[]; trees: ", - "StreamTree", - "[]; }, undefined>; \"DELETE /api/streams/{id}\": ", + "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }[]; }, undefined>; \"DELETE /api/streams/{id}\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -455,7 +491,7 @@ "Condition", "; }, { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }>, \"many\">>; fields: Zod.ZodDefault; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }>, \"many\">>; children: Zod.ZodDefault, \"many\">>; fields: Zod.ZodDefault; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">>; managed: Zod.ZodDefault; children: Zod.ZodDefault, \"many\">>; }, \"strip\", Zod.ZodTypeAny, { children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; }, { children?: { id: string; condition?: ", "Condition", - "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; }; }, { path: { id: string; }; body: { children?: { id: string; condition?: ", "Condition", - "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[] | undefined; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; }; }>, ", "StreamsRouteHandlerResources", @@ -493,9 +529,9 @@ "StreamsRouteHandlerResources", ", { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, undefined>; \"POST /api/streams/{id}/_fork\": ", + "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; format?: string | undefined; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, undefined>; \"POST /api/streams/{id}/_fork\": ", { "pluginId": "@kbn/server-route-repository-utils", "scope": "common", @@ -511,7 +547,7 @@ "Condition", "; }, { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }>, \"many\">>; fields: Zod.ZodDefault; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }>, \"many\">>; children: Zod.ZodDefault, \"many\">>; fields: Zod.ZodDefault; format: Zod.ZodOptional; }, \"strip\", Zod.ZodTypeAny, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }, { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }>, \"many\">>; managed: Zod.ZodDefault; children: Zod.ZodDefault, \"many\">>; }, { id: Zod.ZodString; managed: Zod.ZodDefault; unmanaged_elasticsearch_assets: Zod.ZodOptional; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }>, \"many\">>; }>, \"children\">, \"strip\", Zod.ZodTypeAny, { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }>, \"many\">>; }, { id: Zod.ZodString; unmanaged_elasticsearch_assets: Zod.ZodOptional; id: Zod.ZodString; }, \"strip\", Zod.ZodTypeAny, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }, { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }>, \"many\">>; }>, \"children\">, \"strip\", Zod.ZodTypeAny, { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }, { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }>; condition: Zod.ZodType<", "Condition", ", Zod.ZodTypeDef, ", "Condition", - ">; }, \"strip\", Zod.ZodTypeAny, { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + ">; }, \"strip\", Zod.ZodTypeAny, { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }, { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }, { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }>; }, \"strip\", Zod.ZodTypeAny, { path: { id: string; }; body: { stream: { id: string; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", - "; }; }, { path: { id: string; }; body: { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }; }, { path: { id: string; }; body: { stream: { id: string; fields?: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[] | undefined; managed?: boolean | undefined; processing?: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[] | undefined; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; condition?: ", "Condition", @@ -565,9 +601,9 @@ }, "<\"POST /api/streams/_enable\", Zod.ZodObject<{}, \"strip\", Zod.ZodTypeAny, {}, {}>, ", "StreamsRouteHandlerResources", - ", { acknowledged: true; }, undefined>; }" + ", { acknowledged: true; message: string; }, undefined>; }" ], - "path": "x-pack/plugins/streams/server/routes/index.ts", + "path": "x-pack/solutions/observability/plugins/streams/server/routes/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -581,7 +617,7 @@ "tags": [], "label": "StreamsPluginSetup", "description": [], - "path": "x-pack/plugins/streams/server/plugin.ts", + "path": "x-pack/solutions/observability/plugins/streams/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -595,7 +631,7 @@ "tags": [], "label": "StreamsPluginStart", "description": [], - "path": "x-pack/plugins/streams/server/plugin.ts", + "path": "x-pack/solutions/observability/plugins/streams/server/plugin.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -619,11 +655,11 @@ "signature": [ "{ id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", - "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }" + "; }[]; inheritedFields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; from: string; format?: string | undefined; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }" ], - "path": "x-pack/plugins/streams/common/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -638,11 +674,11 @@ "signature": [ "{ id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }" ], - "path": "x-pack/plugins/streams/common/types.ts", + "path": "x-pack/solutions/observability/plugins/streams/common/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/streams.mdx b/api_docs/streams.mdx index c998504b68e1..fa0acfeb0096 100644 --- a/api_docs/streams.mdx +++ b/api_docs/streams.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/streams title: "streams" image: https://source.unsplash.com/400x175/?github description: API docs for the streams plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'streams'] --- import streamsObj from './streams.devdocs.json'; @@ -21,7 +21,7 @@ Contact [@elastic/streams-program-team](https://github.com/orgs/elastic/teams/st | Public API count | Any count | Items lacking comments | Missing exports | |-------------------|-----------|------------------------|-----------------| -| 13 | 0 | 13 | 4 | +| 13 | 0 | 13 | 3 | ## Client diff --git a/api_docs/streams_app.devdocs.json b/api_docs/streams_app.devdocs.json index 12a4d9b1b7d5..0c7fcf59a750 100644 --- a/api_docs/streams_app.devdocs.json +++ b/api_docs/streams_app.devdocs.json @@ -14,7 +14,7 @@ "tags": [], "label": "StreamsAppPublicSetup", "description": [], - "path": "x-pack/plugins/streams_app/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -28,7 +28,7 @@ "tags": [], "label": "StreamsAppPublicStart", "description": [], - "path": "x-pack/plugins/streams_app/public/types.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -50,7 +50,7 @@ "tags": [], "label": "StreamsAppServerSetup", "description": [], - "path": "x-pack/plugins/streams_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -64,7 +64,7 @@ "tags": [], "label": "StreamsAppServerStart", "description": [], - "path": "x-pack/plugins/streams_app/server/types.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -83,7 +83,7 @@ "tags": [], "label": "EntityTypeDefinition", "description": [], - "path": "x-pack/plugins/streams_app/common/index.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -94,7 +94,7 @@ "tags": [], "label": "displayName", "description": [], - "path": "x-pack/plugins/streams_app/common/index.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -114,11 +114,11 @@ "signature": [ "EntityBase & { type: \"stream\"; properties: { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; }" ], - "path": "x-pack/plugins/streams_app/common/index.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -133,11 +133,11 @@ "signature": [ "EntityBase & { type: \"stream\"; properties: { id: string; children: { id: string; condition?: ", "Condition", - "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", + "; }[]; fields: { type: \"boolean\" | \"ip\" | \"keyword\" | \"date\" | \"long\" | \"double\" | \"match_only_text\"; name: string; format?: string | undefined; }[]; managed: boolean; processing: { config: { type: \"grok\"; field: string; patterns: string[]; pattern_definitions?: Record | undefined; } | { type: \"dissect\"; field: string; pattern: string; }; condition?: ", "Condition", "; }[]; unmanaged_elasticsearch_assets?: { id: string; type: \"ingest_pipeline\" | \"data_stream\" | \"index_template\" | \"component_template\"; }[] | undefined; }; }" ], - "path": "x-pack/plugins/streams_app/common/index.ts", + "path": "x-pack/solutions/observability/plugins/streams_app/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/streams_app.mdx b/api_docs/streams_app.mdx index c33f416e0da4..e484e5b1d896 100644 --- a/api_docs/streams_app.mdx +++ b/api_docs/streams_app.mdx @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/streamsApp title: "streamsApp" image: https://source.unsplash.com/400x175/?github description: API docs for the streamsApp plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'streamsApp'] --- import streamsAppObj from './streams_app.devdocs.json'; diff --git a/api_docs/task_manager.mdx b/api_docs/task_manager.mdx index 34fb36b7d6fd..a5fc04fd2e30 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'taskManager'] --- import taskManagerObj from './task_manager.devdocs.json'; diff --git a/api_docs/telemetry.devdocs.json b/api_docs/telemetry.devdocs.json index 4ea397d13220..72092679afa2 100644 --- a/api_docs/telemetry.devdocs.json +++ b/api_docs/telemetry.devdocs.json @@ -828,20 +828,20 @@ "path": "x-pack/plugins/fleet/server/telemetry/sender.test.ts" }, { - "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.ts" + "plugin": "securitySolution", + "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.test.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts" }, { "plugin": "synthetics", - "path": "x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.test.ts" + "path": "x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.test.ts" }, { - "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/server/lib/telemetry/sender.test.ts" + "plugin": "synthetics", + "path": "x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.test.ts" } ], "children": [], diff --git a/api_docs/telemetry.mdx b/api_docs/telemetry.mdx index 207ac7953383..3fb8ea04ed41 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetry'] --- import telemetryObj from './telemetry.devdocs.json'; diff --git a/api_docs/telemetry_collection_manager.mdx b/api_docs/telemetry_collection_manager.mdx index 627e061f3308..c47484a8be87 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryCollectionManager'] --- import telemetryCollectionManagerObj from './telemetry_collection_manager.devdocs.json'; diff --git a/api_docs/telemetry_management_section.mdx b/api_docs/telemetry_management_section.mdx index 32336fbcf4fd..a67c6f61217b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'telemetryManagementSection'] --- import telemetryManagementSectionObj from './telemetry_management_section.devdocs.json'; diff --git a/api_docs/threat_intelligence.devdocs.json b/api_docs/threat_intelligence.devdocs.json index 2257a85ac3bc..57443fe73fb6 100644 --- a/api_docs/threat_intelligence.devdocs.json +++ b/api_docs/threat_intelligence.devdocs.json @@ -15,7 +15,7 @@ "signature": [ "(threatIntelligencePage: \"indicators\") => TILinkItem" ], - "path": "x-pack/plugins/threat_intelligence/public/utils/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -31,7 +31,7 @@ "signature": [ "\"indicators\"" ], - "path": "x-pack/plugins/threat_intelligence/public/utils/security_solution_links.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -53,7 +53,7 @@ "description": [ "\nMethods exposed from the security solution to the threat intelligence application." ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -69,7 +69,7 @@ "signature": [ "() => React.ComponentType<{ children: React.ReactNode; }>" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -87,7 +87,7 @@ "signature": [ "() => React.ComponentType<{ children: React.ReactNode; }>" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -105,7 +105,7 @@ "signature": [ "LicenseAware" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -121,7 +121,7 @@ "signature": [ "SelectedDataView" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -140,7 +140,7 @@ "AnyAction", ">" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -158,7 +158,7 @@ "UseInvestigateInTimelineProps", ") => () => Promise" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -172,7 +172,7 @@ "signature": [ "UseInvestigateInTimelineProps" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -197,7 +197,7 @@ "text": "Query" } ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -221,7 +221,7 @@ }, "[]" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -244,7 +244,7 @@ "text": "TimeRange" } ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -260,7 +260,7 @@ "signature": [ "React.VoidFunctionComponent" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -307,7 +307,7 @@ "signature": [ "(query: { id: string; loading: boolean; refetch: VoidFunction; }) => void" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -318,7 +318,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -329,7 +329,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -340,7 +340,7 @@ "tags": [], "label": "loading", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false }, @@ -354,7 +354,7 @@ "signature": [ "VoidFunction" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -377,7 +377,7 @@ "signature": [ "(query: { id: string; }) => void" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -388,7 +388,7 @@ "tags": [], "label": "query", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -399,7 +399,7 @@ "tags": [], "label": "id", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -420,7 +420,7 @@ "signature": [ "Blocking" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false } @@ -434,7 +434,7 @@ "tags": [], "label": "ThreatIntelligencePluginSetup", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -447,7 +447,7 @@ "tags": [], "label": "ThreatIntelligencePluginStart", "description": [], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -469,7 +469,7 @@ }, "; }) => React.ReactElement>" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -493,7 +493,7 @@ "signature": [ "\"/threat_intelligence\"" ], - "path": "x-pack/plugins/threat_intelligence/public/constants/navigation.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/constants/navigation.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -510,7 +510,7 @@ "signature": [ "\"threat_intelligence\"" ], - "path": "x-pack/plugins/threat_intelligence/public/types.ts", + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/types.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/threat_intelligence.mdx b/api_docs/threat_intelligence.mdx index 058f18551826..b2635d91d8e0 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-12-10 +date: 2024-12-13 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 c404e4317d82..2ab9325ca9c5 100644 --- a/api_docs/timelines.devdocs.json +++ b/api_docs/timelines.devdocs.json @@ -15,7 +15,7 @@ "signature": [ "(arrayIndex: number) => number" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -29,7 +29,7 @@ "signature": [ "number" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -50,7 +50,7 @@ "signature": [ "(element: HTMLElement | null | undefined) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -64,7 +64,7 @@ "signature": [ "HTMLElement | null | undefined" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -85,7 +85,7 @@ "signature": [ "({ colindexAttribute, containerElement, ariaColindex, ariaRowindex, rowindexAttribute, }: { colindexAttribute: string; containerElement: Element | null; ariaColindex: number; ariaRowindex: number; rowindexAttribute: string; }) => FocusColumnResult" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -96,7 +96,7 @@ "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n ariaColindex,\n ariaRowindex,\n rowindexAttribute,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -107,7 +107,7 @@ "tags": [], "label": "colindexAttribute", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -121,7 +121,7 @@ "signature": [ "Element | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -132,7 +132,7 @@ "tags": [], "label": "ariaColindex", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -143,7 +143,7 @@ "tags": [], "label": "ariaRowindex", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -154,7 +154,7 @@ "tags": [], "label": "rowindexAttribute", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -176,7 +176,7 @@ "signature": [ "({ containerElement, tableClassName, }: { containerElement: HTMLElement | null; tableClassName: string; }) => HTMLDivElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -187,7 +187,7 @@ "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -201,7 +201,7 @@ "signature": [ "HTMLElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -212,7 +212,7 @@ "tags": [], "label": "tableClassName", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -234,7 +234,7 @@ "signature": [ "({ containerElement, tableClassName, }: { containerElement: HTMLElement | null; tableClassName: string; }) => HTMLDivElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -245,7 +245,7 @@ "tags": [], "label": "{\n containerElement,\n tableClassName,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -259,7 +259,7 @@ "signature": [ "HTMLElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -270,7 +270,7 @@ "tags": [], "label": "tableClassName", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -290,7 +290,7 @@ "signature": [ "(ariaRowindex: number) => string" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -304,7 +304,7 @@ "signature": [ "number" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -323,7 +323,7 @@ "signature": [ "(ariaRowindex: number) => string" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -337,7 +337,7 @@ "signature": [ "number" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -361,7 +361,7 @@ "; shiftKey: boolean; tableHasFocus: (containerElement: HTMLElement | null) => boolean; tableClassName: string; }) => ", "SkipFocus" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -372,7 +372,7 @@ "tags": [], "label": "{\n containerElement,\n getFocusedCell,\n shiftKey,\n tableHasFocus,\n tableClassName,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -386,7 +386,7 @@ "signature": [ "HTMLElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -400,7 +400,7 @@ "signature": [ "({ containerElement, tableClassName, }: { containerElement: HTMLElement | null; tableClassName: string; }) => HTMLDivElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -415,7 +415,7 @@ "signature": [ "{ containerElement: HTMLElement | null; tableClassName: string; }" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -428,7 +428,7 @@ "tags": [], "label": "shiftKey", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -442,7 +442,7 @@ "signature": [ "(containerElement: HTMLElement | null) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -456,7 +456,7 @@ "signature": [ "HTMLElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -471,7 +471,7 @@ "tags": [], "label": "tableClassName", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -495,7 +495,7 @@ "SkipFocus", "; }) => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -506,7 +506,7 @@ "tags": [], "label": "{\n onSkipFocusBackwards,\n onSkipFocusForward,\n skipFocus,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -520,7 +520,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -536,7 +536,7 @@ "signature": [ "() => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -552,7 +552,7 @@ "signature": [ "\"SKIP_FOCUS_BACKWARDS\" | \"SKIP_FOCUS_FORWARD\" | \"SKIP_FOCUS_NOOP\"" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -574,7 +574,7 @@ "signature": [ "(event: React.KeyboardEvent) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -588,7 +588,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -609,7 +609,7 @@ "signature": [ "(event: React.KeyboardEvent) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -623,7 +623,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -644,7 +644,7 @@ "signature": [ "(event: React.KeyboardEvent) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -658,7 +658,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -679,7 +679,7 @@ "signature": [ "(event: React.KeyboardEvent) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -693,7 +693,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -716,7 +716,7 @@ "OnColumnFocused", "; rowindexAttribute: string; }) => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -727,7 +727,7 @@ "tags": [], "label": "{\n colindexAttribute,\n containerElement,\n event,\n maxAriaColindex,\n maxAriaRowindex,\n onColumnFocused,\n rowindexAttribute,\n}", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -738,7 +738,7 @@ "tags": [], "label": "colindexAttribute", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -752,7 +752,7 @@ "signature": [ "HTMLDivElement | null" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -766,7 +766,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -777,7 +777,7 @@ "tags": [], "label": "maxAriaColindex", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -788,7 +788,7 @@ "tags": [], "label": "maxAriaRowindex", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false }, @@ -802,7 +802,7 @@ "signature": [ "({ newFocusedColumn, newFocusedColumnAriaColindex, }: { newFocusedColumn: HTMLDivElement | null; newFocusedColumnAriaColindex: number | null; }) => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -817,7 +817,7 @@ "signature": [ "{ newFocusedColumn: HTMLDivElement | null; newFocusedColumnAriaColindex: number | null; }" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -830,7 +830,7 @@ "tags": [], "label": "rowindexAttribute", "description": [], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -852,7 +852,7 @@ "signature": [ "(event: React.KeyboardEvent) => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -866,7 +866,7 @@ "signature": [ "React.KeyboardEvent" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -895,7 +895,7 @@ " extends ", "HoverActionComponentProps" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false, "children": [ @@ -939,7 +939,7 @@ "EuiButtonIconProps", " & { href?: string | undefined; onClick?: React.MouseEventHandler | undefined; } & React.AnchorHTMLAttributes & { buttonRef?: React.Ref | undefined; })> | React.FunctionComponent | undefined" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false }, @@ -953,7 +953,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false }, @@ -982,7 +982,7 @@ }, "[] | undefined" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false }, @@ -996,7 +996,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false }, @@ -1034,7 +1034,7 @@ }, "; }" ], - "path": "x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", + "path": "x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx", "deprecated": false, "trackAdoption": false } @@ -1056,7 +1056,7 @@ "signature": [ "\"aria-colindex\"" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1073,7 +1073,7 @@ "signature": [ "\"aria-rowindex\"" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1090,7 +1090,7 @@ "signature": [ "\"data-colindex\"" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1107,7 +1107,7 @@ "signature": [ "\"data-rowindex\"" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1124,7 +1124,7 @@ "signature": [ "1" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1139,7 +1139,7 @@ "signature": [ "({ newFocusedColumn, newFocusedColumnAriaColindex, }: { newFocusedColumn: HTMLDivElement | null; newFocusedColumnAriaColindex: number | null; }) => void" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false, "returnComment": [], @@ -1154,7 +1154,7 @@ "signature": [ "{ newFocusedColumn: HTMLDivElement | null; newFocusedColumnAriaColindex: number | null; }" ], - "path": "x-pack/plugins/timelines/common/utils/accessibility/helpers.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts", "deprecated": false, "trackAdoption": false } @@ -1195,7 +1195,7 @@ }, "; }" ], - "path": "x-pack/plugins/timelines/public/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -1209,7 +1209,7 @@ "tags": [], "label": "TimelinesUIStart", "description": [], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1226,7 +1226,7 @@ "() => ", "HoverActionsConfig" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -1240,19 +1240,19 @@ }, { "plugin": "threatIntelligence", - "path": "x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" }, { "plugin": "threatIntelligence", - "path": "x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" }, { "plugin": "threatIntelligence", - "path": "x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" }, { "plugin": "threatIntelligence", - "path": "x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" + "path": "x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx" } ], "children": [], @@ -1268,7 +1268,7 @@ "signature": [ "() => any" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1288,7 +1288,7 @@ "LoadingPanelProps", ", string | React.JSXElementConstructor>" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1302,7 +1302,7 @@ "signature": [ "LoadingPanelProps" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1324,7 +1324,7 @@ "LastUpdatedAtProps", ", string | React.JSXElementConstructor>" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1338,7 +1338,7 @@ "signature": [ "LastUpdatedAtProps" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1359,7 +1359,7 @@ ") => ", "UseAddToTimeline" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1377,7 +1377,7 @@ "SensorAPI", ") => void" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1397,7 +1397,7 @@ "AnyAction", ">) => void" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1414,7 +1414,7 @@ "AnyAction", ">" ], - "path": "x-pack/plugins/timelines/public/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/public/types.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1441,7 +1441,7 @@ "tags": [], "label": "TimelinesPluginUI", "description": [], - "path": "x-pack/plugins/timelines/server/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1455,7 +1455,7 @@ "tags": [], "label": "TimelinesPluginStart", "description": [], - "path": "x-pack/plugins/timelines/server/types.ts", + "path": "x-pack/solutions/security/plugins/timelines/server/types.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -1486,7 +1486,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1501,7 +1501,7 @@ "Fields", "" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1516,7 +1516,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1531,7 +1531,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1550,7 +1550,7 @@ "signature": [ "(field: string) => boolean" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1564,7 +1564,7 @@ "signature": [ "string" ], - "path": "x-pack/plugins/timelines/common/utils/field_formatters.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1583,7 +1583,7 @@ "signature": [ "(value: T | T[] | null | undefined) => T[]" ], - "path": "x-pack/plugins/timelines/common/utils/to_array.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1597,7 +1597,7 @@ "signature": [ "T | T[] | null | undefined" ], - "path": "x-pack/plugins/timelines/common/utils/to_array.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1616,7 +1616,7 @@ "signature": [ "(value: T | T[] | null) => { str: string; isObjectArray?: boolean | undefined; }[]" ], - "path": "x-pack/plugins/timelines/common/utils/to_array.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1630,7 +1630,7 @@ "signature": [ "T | T[] | null" ], - "path": "x-pack/plugins/timelines/common/utils/to_array.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts", "deprecated": false, "trackAdoption": false, "isRequired": false @@ -1648,7 +1648,7 @@ "tags": [], "label": "CursorType", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1663,7 +1663,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1678,7 +1678,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -1692,7 +1692,7 @@ "tags": [], "label": "DataProvider", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1705,7 +1705,7 @@ "description": [ "Uniquely identifies a data provider" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1718,7 +1718,7 @@ "description": [ "Human readable" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1731,7 +1731,7 @@ "description": [ "\nWhen `false`, a data provider is temporarily disabled, but not removed from\nthe timeline. default: `true`" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1744,7 +1744,7 @@ "description": [ "\nWhen `true`, a data provider is excluding the match, but not removed from\nthe timeline. default: `false`" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1757,7 +1757,7 @@ "description": [ "\nReturns the KQL query who have been added by user" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1779,7 +1779,7 @@ "text": "QueryMatch" } ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1802,7 +1802,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1818,7 +1818,7 @@ "signature": [ "\"default\" | \"template\" | undefined" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false } @@ -1836,17 +1836,17 @@ "description": [ "\nThis interface should not be used anymore.\nUse the one from `plugins/security_solution/common/types/timeline`." ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": true, "trackAdoption": false, "references": [ { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "securitySolution", @@ -1868,7 +1868,7 @@ "signature": [ "DeprecatedRowRendererId" ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1890,7 +1890,7 @@ }, ") => boolean" ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1910,7 +1910,7 @@ "text": "EcsSecurityExtension" } ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false, "isRequired": true @@ -1936,7 +1936,7 @@ }, "; isDraggable: boolean; scopeId: string; }) => React.ReactNode" ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1947,7 +1947,7 @@ "tags": [], "label": "{\n contextId,\n data,\n isDraggable,\n scopeId,\n }", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -1961,7 +1961,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1981,7 +1981,7 @@ "text": "EcsSecurityExtension" } ], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false }, @@ -1992,7 +1992,7 @@ "tags": [], "label": "isDraggable", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2003,7 +2003,7 @@ "tags": [], "label": "scopeId", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/rows/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts", "deprecated": false, "trackAdoption": false } @@ -2022,7 +2022,7 @@ "tags": [], "label": "EqlFieldsComboBoxOptions", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2037,7 +2037,7 @@ "EuiComboBoxOptionOption", "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2052,7 +2052,7 @@ "EuiComboBoxOptionOption", "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2067,7 +2067,7 @@ "EuiComboBoxOptionOption", "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false } @@ -2081,7 +2081,7 @@ "tags": [], "label": "EqlOptions", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2095,7 +2095,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2109,7 +2109,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2123,7 +2123,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2137,7 +2137,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2151,7 +2151,7 @@ "signature": [ "number | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false } @@ -2165,7 +2165,7 @@ "tags": [], "label": "FieldInfo", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2176,7 +2176,7 @@ "tags": [], "label": "category", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2190,7 +2190,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2204,7 +2204,7 @@ "signature": [ "string | number | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2218,7 +2218,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2229,7 +2229,7 @@ "tags": [], "label": "name", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2243,7 +2243,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false } @@ -2275,7 +2275,7 @@ }, ", \"format\">" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2288,7 +2288,7 @@ "description": [ "Where the field belong" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2305,7 +2305,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2322,7 +2322,7 @@ "Maybe", "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2339,7 +2339,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2354,7 +2354,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false } @@ -2388,7 +2388,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -2435,7 +2435,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2449,7 +2449,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2465,7 +2465,7 @@ "MappingRuntimeField", "; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false } @@ -2479,7 +2479,7 @@ "tags": [], "label": "Inspect", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2493,7 +2493,7 @@ "signature": [ "string[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -2507,7 +2507,7 @@ "tags": [], "label": "LastTimeDetails", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2522,7 +2522,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2537,7 +2537,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2552,7 +2552,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false } @@ -2566,7 +2566,7 @@ "tags": [], "label": "PaginationInputPaginated", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2579,7 +2579,7 @@ "description": [ "The activePage parameter defines the page of results you want to fetch" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2592,7 +2592,7 @@ "description": [ "The cursorStart parameter defines the start of the results to be displayed" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2605,7 +2605,7 @@ "description": [ "The fakePossibleCount parameter determines the total count in order to show 5 additional pages" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2618,7 +2618,7 @@ "description": [ "The querySize parameter is the number of items to be returned" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -2632,7 +2632,7 @@ "tags": [], "label": "QueryMatch", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2643,7 +2643,7 @@ "tags": [], "label": "field", "description": [], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2657,7 +2657,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2671,7 +2671,7 @@ "signature": [ "string | number | boolean | (string | number | boolean)[]" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2685,7 +2685,7 @@ "signature": [ "string | number | boolean | undefined" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2699,7 +2699,7 @@ "signature": [ "\"includes\" | \":\" | \":*\"" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false } @@ -2723,7 +2723,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2737,7 +2737,7 @@ "signature": [ "Field" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2757,7 +2757,7 @@ "text": "Direction" } ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -2771,7 +2771,7 @@ "tags": [], "label": "TimelineEdges", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2791,7 +2791,7 @@ "text": "TimelineItem" } ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2811,7 +2811,7 @@ "text": "CursorType" } ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false } @@ -2845,7 +2845,7 @@ "EqlSearchResponse", ">" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2866,7 +2866,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2877,7 +2877,7 @@ "tags": [], "label": "totalCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2891,7 +2891,7 @@ "signature": [ "{ activePage: number; querySize: number; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2912,7 +2912,7 @@ }, " | null" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false } @@ -2944,7 +2944,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -2958,7 +2958,7 @@ "signature": [ "{ [x: string]: number; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2979,7 +2979,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -2990,7 +2990,7 @@ "tags": [], "label": "totalCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3004,7 +3004,7 @@ "signature": [ "{ activePage: number; querySize: number; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3027,7 +3027,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false } @@ -3041,7 +3041,7 @@ "tags": [], "label": "TimelineEventsDetailsItem", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3056,7 +3056,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3070,7 +3070,7 @@ "signature": [ "string | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3081,7 +3081,7 @@ "tags": [], "label": "field", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3096,7 +3096,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3110,7 +3110,7 @@ "signature": [ "any" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3121,7 +3121,7 @@ "tags": [], "label": "isObjectArray", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false } @@ -3153,7 +3153,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3176,7 +3176,7 @@ }, "[]> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3199,7 +3199,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3222,7 +3222,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3237,7 +3237,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts", "deprecated": false, "trackAdoption": false } @@ -3269,7 +3269,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3283,7 +3283,7 @@ "signature": [ "string | null" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3306,7 +3306,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false } @@ -3320,7 +3320,7 @@ "tags": [], "label": "TimelineItem", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3331,7 +3331,7 @@ "tags": [], "label": "_id", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3346,7 +3346,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3367,7 +3367,7 @@ }, "[]" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3387,7 +3387,7 @@ "text": "EcsSecurityExtension" } ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false } @@ -3419,7 +3419,7 @@ }, "" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3430,7 +3430,7 @@ "tags": [], "label": "destinationIpCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3453,7 +3453,7 @@ }, "> | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3464,7 +3464,7 @@ "tags": [], "label": "hostCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3475,7 +3475,7 @@ "tags": [], "label": "processCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3486,7 +3486,7 @@ "tags": [], "label": "sourceIpCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3497,7 +3497,7 @@ "tags": [], "label": "userCount", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts", "deprecated": false, "trackAdoption": false } @@ -3511,7 +3511,7 @@ "tags": [], "label": "TimelineNonEcsData", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3522,7 +3522,7 @@ "tags": [], "label": "field", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3537,7 +3537,7 @@ "Maybe", " | undefined" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts", "deprecated": false, "trackAdoption": false } @@ -3551,7 +3551,7 @@ "tags": [], "label": "TimerangeInput", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3564,7 +3564,7 @@ "description": [ "The interval string to use for last bucket. The format is '{value}{unit}'. For example '5m' would return the metrics for the last 5 minutes of the timespan." ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3577,7 +3577,7 @@ "description": [ "The end of the timerange" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3590,7 +3590,7 @@ "description": [ "The beginning of the timerange" ], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -3604,7 +3604,7 @@ "tags": [], "label": "TotalValue", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "children": [ @@ -3615,7 +3615,7 @@ "tags": [], "label": "value", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false }, @@ -3626,7 +3626,7 @@ "tags": [], "label": "relation", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false } @@ -3642,7 +3642,7 @@ "tags": [], "label": "Direction", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/common/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3654,7 +3654,7 @@ "tags": [], "label": "LastEventIndexKey", "description": [], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3666,7 +3666,7 @@ "tags": [], "label": "TimelineEventsQueries", "description": [], - "path": "x-pack/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -3693,7 +3693,7 @@ }, "; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -3730,45 +3730,45 @@ "FieldCategory", "; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": true, "trackAdoption": false, "references": [ { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts" + "path": "x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts" + "path": "x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "securitySolution", @@ -3996,47 +3996,47 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/add_data_provider_popover.tsx" + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/empty.tsx" + "path": "x-pack/plugins/security_solution/public/common/components/drag_and_drop/drag_drop_context_wrapper.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/data_providers/providers.tsx" + "path": "x-pack/plugins/security_solution/public/common/components/top_n/index.tsx" }, { "plugin": "securitySolution", @@ -4068,19 +4068,19 @@ }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" + "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" }, { "plugin": "securitySolution", - "path": "x-pack/plugins/security_solution/public/timelines/components/timeline/tabs/shared/utils.ts" + "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" + "path": "x-pack/plugins/security_solution/public/flyout/document_details/right/utils/enriched_field_info.ts" }, { "plugin": "securitySolution", @@ -4092,11 +4092,11 @@ }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/mock/mock_source.ts" + "path": "x-pack/solutions/security/packages/data_table/mock/mock_source.ts" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/mock/mock_source.ts" + "path": "x-pack/solutions/security/packages/data_table/mock/mock_source.ts" } ], "initialIsOpen": false @@ -4143,7 +4143,7 @@ }, " | undefined; type?: string | undefined; }" ], - "path": "x-pack/plugins/timelines/common/types/timeline/actions/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/actions/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4166,7 +4166,7 @@ }, "; }" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4181,7 +4181,7 @@ "signature": [ "\"DELETED_SECURITY_SOLUTION_DATA_VIEW\"" ], - "path": "x-pack/plugins/timelines/common/constants.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/constants.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4249,17 +4249,17 @@ }, "[] | undefined; setFlyoutAlert?: ((alertId: string) => void) | undefined; scopeId: string; truncate?: boolean | undefined; key?: string | undefined; closeCellPopover?: (() => void) | undefined; enableActions?: boolean | undefined; }" ], - "path": "x-pack/plugins/timelines/common/types/timeline/cells/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts", "deprecated": true, "trackAdoption": false, "references": [ { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "@kbn/securitysolution-data-table", - "path": "x-pack/packages/security-solution/data_table/components/data_table/index.tsx" + "path": "x-pack/solutions/security/packages/data_table/components/data_table/index.tsx" }, { "plugin": "securitySolution", @@ -4282,7 +4282,7 @@ "signature": [ "\"events\" | \"sessions\"" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4299,7 +4299,7 @@ "signature": [ "\":*\"" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4321,7 +4321,7 @@ "text": "EqlOptions" } ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4341,7 +4341,7 @@ " : ", "IndexFieldsStrategyRequestByIndices" ], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": true, "trackAdoption": false, "references": [ @@ -4384,7 +4384,7 @@ "signature": [ "\":\"" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4401,7 +4401,7 @@ "signature": [ "\"includes\" | \":\" | \":*\"" ], - "path": "x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4424,7 +4424,7 @@ }, "; type?: string | undefined; esTypes?: string[] | undefined; }[]; language: \"eql\"; fieldRequested: string[]; params?: any; id?: string | undefined; size?: number | undefined; indexType?: string | undefined; timerange?: { interval: string; from: string; to: string; } | undefined; timestampField?: string | undefined; defaultIndex?: string[] | undefined; entityType?: \"events\" | \"sessions\" | undefined; runtimeMappings?: Record; id: string; } | undefined; fetch_fields?: string[] | undefined; input_field?: string | undefined; target_field?: string | undefined; target_index?: string | undefined; }> | undefined; filterQuery?: string | Record | { range: Record; } | { query_string: { query: string; analyze_wildcard: boolean; }; } | { match: Record; } | { term: Record; } | { bool: { filter: {}[]; should: {}[]; must: {}[]; must_not: {}[]; }; } | undefined; filterStatus?: \"open\" | \"closed\" | \"acknowledged\" | undefined; pagination?: Zod.objectInputType<{ activePage: Zod.ZodNumber; cursorStart: Zod.ZodOptional; querySize: Zod.ZodNumber; }, Zod.ZodTypeAny, \"passthrough\"> | undefined; eventCategoryField?: string | undefined; tiebreakerField?: string | undefined; runTimeMappings?: Record; id: string; } | undefined; fetch_fields?: string[] | undefined; input_field?: string | undefined; target_field?: string | undefined; target_index?: string | undefined; }> | undefined; }" ], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/eql.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/eql.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4455,7 +4455,7 @@ }, ".all; params?: any; id?: string | undefined; indexType?: string | undefined; timerange?: { interval: string; from: string; to: string; } | undefined; defaultIndex?: string[] | undefined; entityType?: \"events\" | \"sessions\" | undefined; runtimeMappings?: Record; id: string; } | undefined; fetch_fields?: string[] | undefined; input_field?: string | undefined; target_field?: string | undefined; target_index?: string | undefined; }> | undefined; filterQuery?: any; filterStatus?: \"open\" | \"closed\" | \"acknowledged\" | undefined; pagination?: Zod.objectInputType<{ activePage: Zod.ZodNumber; cursorStart: Zod.ZodOptional; querySize: Zod.ZodNumber; }, Zod.ZodTypeAny, \"passthrough\"> | undefined; authFilter?: {} | undefined; excludeEcsData?: boolean | undefined; }" ], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/events_all.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_all.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4478,7 +4478,7 @@ }, ".details; params?: any; id?: string | undefined; indexType?: string | undefined; timerange?: { interval: string; from: string; to: string; } | undefined; defaultIndex?: string[] | undefined; entityType?: \"events\" | \"sessions\" | undefined; runtimeMappings?: Record; id: string; } | undefined; fetch_fields?: string[] | undefined; input_field?: string | undefined; target_field?: string | undefined; target_index?: string | undefined; }> | undefined; filterQuery?: string | Record | { range: Record; } | { query_string: { query: string; analyze_wildcard: boolean; }; } | { match: Record; } | { term: Record; } | { bool: { filter: {}[]; should: {}[]; must: {}[]; must_not: {}[]; }; } | undefined; filterStatus?: \"open\" | \"closed\" | \"acknowledged\" | undefined; pagination?: Zod.objectInputType<{ activePage: Zod.ZodNumber; cursorStart: Zod.ZodOptional; querySize: Zod.ZodNumber; }, Zod.ZodTypeAny, \"passthrough\"> | undefined; authFilter?: {} | undefined; }" ], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/events_details.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_details.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4509,7 +4509,7 @@ }, "; params?: any; id?: string | undefined; indexType?: string | undefined; defaultIndex?: string[] | undefined; entityType?: \"events\" | \"sessions\" | undefined; filterStatus?: \"open\" | \"closed\" | \"acknowledged\" | undefined; }" ], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4532,7 +4532,7 @@ }, ".kpi; params?: any; id?: string | undefined; indexType?: string | undefined; timerange?: { interval: string; from: string; to: string; } | undefined; defaultIndex?: string[] | undefined; entityType?: \"events\" | \"sessions\" | undefined; runtimeMappings?: Record; id: string; } | undefined; fetch_fields?: string[] | undefined; input_field?: string | undefined; target_field?: string | undefined; target_index?: string | undefined; }> | undefined; filterQuery?: string | Record | { range: Record; } | { query_string: { query: string; analyze_wildcard: boolean; }; } | { match: Record; } | { term: Record; } | { bool: { filter: {}[]; should: {}[]; must: {}[]; must_not: {}[]; }; } | undefined; filterStatus?: \"open\" | \"closed\" | \"acknowledged\" | undefined; }" ], - "path": "x-pack/plugins/timelines/common/api/search_strategy/timeline/kpi.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/kpi.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false @@ -4546,7 +4546,7 @@ "tags": [], "label": "EMPTY_BROWSER_FIELDS", "description": [], - "path": "x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts", "deprecated": false, "trackAdoption": false, "children": [], @@ -4562,7 +4562,7 @@ "signature": [ "{ readonly EVENTS: \"events\"; readonly SESSIONS: \"sessions\"; }" ], - "path": "x-pack/plugins/timelines/common/search_strategy/timeline/events/index.ts", + "path": "x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/index.ts", "deprecated": false, "trackAdoption": false, "initialIsOpen": false diff --git a/api_docs/timelines.mdx b/api_docs/timelines.mdx index d3c4eb10322d..3808911ee03e 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-12-10 +date: 2024-12-13 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 47e11b4c27bf..481bfd5a8b53 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'transform'] --- import transformObj from './transform.devdocs.json'; diff --git a/api_docs/triggers_actions_ui.mdx b/api_docs/triggers_actions_ui.mdx index f6897f079dd4..c75411995b5b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'triggersActionsUi'] --- import triggersActionsUiObj from './triggers_actions_ui.devdocs.json'; diff --git a/api_docs/ui_actions.devdocs.json b/api_docs/ui_actions.devdocs.json index 902cbd0c015d..ec4ba804fb8e 100644 --- a/api_docs/ui_actions.devdocs.json +++ b/api_docs/ui_actions.devdocs.json @@ -772,26 +772,6 @@ { "plugin": "imageEmbeddable", "path": "src/plugins/image_embeddable/public/components/image_embeddable.tsx" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/tests/helpers.ts" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/tests/container.test.ts" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/tests/container.test.ts" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/tests/container.test.ts" - }, - { - "plugin": "embeddable", - "path": "src/plugins/embeddable/public/tests/explicit_input.test.ts" } ], "children": [ diff --git a/api_docs/ui_actions.mdx b/api_docs/ui_actions.mdx index b259a3b7ab81..ba6116ebcf5c 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-12-10 +date: 2024-12-13 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 3cadaea195dc..957321160fc9 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-12-10 +date: 2024-12-13 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 795a362575f0..93986008eafc 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-12-10 +date: 2024-12-13 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 8c934b6a5263..404fd87cb7b6 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-12-10 +date: 2024-12-13 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 8cd7f76bb914..7cf8791b9a01 100644 --- a/api_docs/unified_search.devdocs.json +++ b/api_docs/unified_search.devdocs.json @@ -1595,6 +1595,26 @@ "deprecated": false, "trackAdoption": false }, + { + "parentPluginId": "unifiedSearch", + "id": "def-public.IUnifiedSearchPluginServices.userProfile", + "type": "Object", + "tags": [], + "label": "userProfile", + "description": [], + "signature": [ + { + "pluginId": "@kbn/core-user-profile-browser", + "scope": "public", + "docId": "kibKbnCoreUserProfileBrowserPluginApi", + "section": "def-public.UserProfileService", + "text": "UserProfileService" + } + ], + "path": "src/plugins/unified_search/public/types.ts", + "deprecated": false, + "trackAdoption": false + }, { "parentPluginId": "unifiedSearch", "id": "def-public.IUnifiedSearchPluginServices.storage", diff --git a/api_docs/unified_search.mdx b/api_docs/unified_search.mdx index 10bbb6d686cf..791ba873169b 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-12-10 +date: 2024-12-13 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 | 21 | +| 150 | 2 | 113 | 21 | ## Client diff --git a/api_docs/unified_search_autocomplete.mdx b/api_docs/unified_search_autocomplete.mdx index f6d9d17e126d..fb2e3f03e445 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-12-10 +date: 2024-12-13 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 | 21 | +| 150 | 2 | 113 | 21 | ## Client diff --git a/api_docs/uptime.mdx b/api_docs/uptime.mdx index dc8ab141643a..2c0793f43a2d 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-12-10 +date: 2024-12-13 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 e8a3ff383b53..c9656276a722 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'urlForwarding'] --- import urlForwardingObj from './url_forwarding.devdocs.json'; diff --git a/api_docs/usage_collection.mdx b/api_docs/usage_collection.mdx index 0dae6d29e8b4..bf80ad94f67b 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'usageCollection'] --- import usageCollectionObj from './usage_collection.devdocs.json'; diff --git a/api_docs/ux.devdocs.json b/api_docs/ux.devdocs.json index 0198d4e41388..f4b0f58de4ad 100644 --- a/api_docs/ux.devdocs.json +++ b/api_docs/ux.devdocs.json @@ -17,7 +17,7 @@ "signature": [ "void" ], - "path": "x-pack/plugins/observability_solution/ux/public/plugin.ts", + "path": "x-pack/solutions/observability/plugins/ux/public/plugin.ts", "deprecated": false, "trackAdoption": false, "lifecycle": "start", diff --git a/api_docs/ux.mdx b/api_docs/ux.mdx index 606ada6a8816..5bf90886fb05 100644 --- a/api_docs/ux.mdx +++ b/api_docs/ux.mdx @@ -8,14 +8,14 @@ slug: /kibana-dev-docs/api/ux title: "ux" image: https://source.unsplash.com/400x175/?github description: API docs for the ux plugin -date: 2024-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'ux'] --- import uxObj from './ux.devdocs.json'; -Contact [@elastic/obs-ux-infra_services-team](https://github.com/orgs/elastic/teams/obs-ux-infra_services-team) for questions regarding this plugin. +Contact [@elastic/obs-ux-management-team](https://github.com/orgs/elastic/teams/obs-ux-management-team) for questions regarding this plugin. **Code health stats** diff --git a/api_docs/vis_default_editor.mdx b/api_docs/vis_default_editor.mdx index fbaea5e2d110..32a71cdf4359 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visDefaultEditor'] --- import visDefaultEditorObj from './vis_default_editor.devdocs.json'; diff --git a/api_docs/vis_type_gauge.mdx b/api_docs/vis_type_gauge.mdx index 05e17b746a62..882295728722 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-12-10 +date: 2024-12-13 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 91d0b3ba9e2c..d970f60bbdaa 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-12-10 +date: 2024-12-13 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 51ad1945ad75..c90b24e88c2a 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-12-10 +date: 2024-12-13 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 0adee8b9b558..6139b1e81117 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-12-10 +date: 2024-12-13 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 37fe584a900b..7888275cc390 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-12-10 +date: 2024-12-13 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 f59f7e828cdd..4826373d2bc2 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-12-10 +date: 2024-12-13 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 af2b3adaa3d4..4dd6be6c848b 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-12-10 +date: 2024-12-13 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 a48db75fbdd6..24c618ea56d7 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-12-10 +date: 2024-12-13 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 ec33e813e88b..5016ba10c189 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-12-10 +date: 2024-12-13 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 234558c6457a..edb109107c6d 100644 --- a/api_docs/visualizations.devdocs.json +++ b/api_docs/visualizations.devdocs.json @@ -1463,13 +1463,7 @@ "label": "attributeService", "description": [], "signature": [ - { - "pluginId": "embeddable", - "scope": "public", - "docId": "kibEmbeddablePluginApi", - "section": "def-public.AttributeService", - "text": "AttributeService" - }, + "AttributeService", "<", "VisualizeSavedObjectAttributes", ", ", @@ -6970,7 +6964,7 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; lockHoverActions: (lock: boolean) => void; disableTriggers: boolean; savedObjectId: ", + "; lockHoverActions: (lock: boolean) => void; disableTriggers: boolean; filters$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6978,7 +6972,15 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "; timeRange$: ", + "<", + { + "pluginId": "@kbn/es-query", + "scope": "common", + "docId": "kibKbnEsQueryPluginApi", + "section": "def-common.Filter", + "text": "Filter" + }, + "[] | undefined>; savedObjectId: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -6986,15 +6988,7 @@ "section": "def-public.PublishingSubject", "text": "PublishingSubject" }, - "<", - { - "pluginId": "@kbn/es-query", - "scope": "common", - "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.TimeRange", - "text": "TimeRange" - }, - " | undefined>; filters$: ", + "; timeRange$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", @@ -7007,10 +7001,10 @@ "pluginId": "@kbn/es-query", "scope": "common", "docId": "kibKbnEsQueryPluginApi", - "section": "def-common.Filter", - "text": "Filter" + "section": "def-common.TimeRange", + "text": "TimeRange" }, - "[] | undefined>; isCompatibleWithUnifiedSearch: (() => boolean) | undefined; query$: ", + " | undefined>; isCompatibleWithUnifiedSearch: (() => boolean) | undefined; query$: ", { "pluginId": "@kbn/presentation-publishing", "scope": "public", diff --git a/api_docs/visualizations.mdx b/api_docs/visualizations.mdx index a8031263a8f9..eae374a41d38 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-12-10 +date: 2024-12-13 tags: ['contributor', 'dev', 'apidocs', 'kibana', 'visualizations'] --- import visualizationsObj from './visualizations.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 | |-------------------|-----------|------------------------|-----------------| -| 871 | 12 | 840 | 20 | +| 871 | 12 | 840 | 21 | ## Client diff --git a/config/serverless.security.yml b/config/serverless.security.yml index b9190df60854..47a67c293565 100644 --- a/config/serverless.security.yml +++ b/config/serverless.security.yml @@ -10,6 +10,7 @@ xpack.observabilityAIAssistant.enabled: false xpack.search.notebooks.enabled: false xpack.searchPlayground.enabled: false xpack.searchInferenceEndpoints.enabled: false +xpack.inventory.enabled: false ## Fine-tune the security solution feature privileges. Also, refer to `serverless.yml` for the project-agnostic overrides. xpack.features.overrides: diff --git a/dev_docs/key_concepts/api_authorization.mdx b/dev_docs/key_concepts/api_authorization.mdx index cda6ad5de21c..5615a20d0f4b 100644 --- a/dev_docs/key_concepts/api_authorization.mdx +++ b/dev_docs/key_concepts/api_authorization.mdx @@ -102,6 +102,38 @@ router.get({ }, handler); ``` +### Configuring operator and superuser privileges +We have two special predefined privilege sets that can be used in security configuration: +1. Operator +```ts +router.get({ + path: '/api/path', + security: { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator, ''], + }, + }, + ... +}, handler); +``` +Operator privileges check is enforced only if operator privileges are enabled in the Elasticsearch configuration. +For more information on operator privileges, refer to the [Operator privileges documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/operator-privileges.html). +If operator privileges are disabled, we skip the check for it, so the only privilege checked from the example above is ``. +Operator privileges cannot be used as standalone, it is required to explicitly specify additional privileges in the configuration to ensure that the route is protected even when operator privileges are disabled. + +2. Superuser +```ts +router.get({ + path: '/api/path', + security: { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.superuser], + }, + }, + ... +}, handler); +``` + ### Opting out of authorization for specific routes **Before migration:** ```ts @@ -291,7 +323,7 @@ GET /api/oas?pathStartsWith=/your/api/path ## Migrating from `access` tags to `security` configuration We aim to use the same privileges that are currently defined with tags `access:`. To assist with this migration, we have created eslint rule `no_deprecated_authz_config`, that will automatically convert your `access` tags to the new `security` configuration. -It scans route definitions and converts `access` tags to the new `requiredPriviliges` configuration. +It scans route definitions and converts `access` tags to the new `requiredPrivileges` configuration. Note: The rule is disabled by default to avoid automatic migrations without an oversight. You can perform migrations by running: diff --git a/docs/concepts/data-views.asciidoc b/docs/concepts/data-views.asciidoc index 2a260e611a06..02922b298976 100644 --- a/docs/concepts/data-views.asciidoc +++ b/docs/concepts/data-views.asciidoc @@ -142,14 +142,14 @@ To match indices starting with `logstash-`, but exclude those starting with `log all clusters having a name starting with `cluster_`: ```ts -`cluster_*:logstash-*,cluster_*:-logstash-old*` +cluster_*:logstash-*,cluster_*:-logstash-old* ``` Excluding a cluster avoids sending any network calls to that cluster. To exclude a cluster with the name `cluster_one`: ```ts -`cluster_*:logstash-*,-cluster_one:*` +cluster_*:logstash-*,-cluster_one:* ``` Once you configure a {data-source} to use the {ccs} syntax, all searches and @@ -182,4 +182,4 @@ for {data-sources} with a high field count that span a large number of indices a list is updated every couple of minutes in typical {kib} usage. Alternatively, use the refresh button on the {data-source} management detail page to get an updated field list. A force reload of {kib} has the same effect. -The field list may be impacted by changes in indices and user permissions. \ No newline at end of file +The field list may be impacted by changes in indices and user permissions. diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index 7de266985c6d..0a67bfb2b036 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -28,7 +28,7 @@ allowing users to configure their advanced settings, also known as uiSettings within the code. -|{kib-repo}blob/{branch}/src/plugins/ai_assistant_management/selection/README.md[aiAssistantManagementSelection] +|{kib-repo}blob/{branch}/src/platform/plugins/shared/ai_assistant_management/selection/README.md[aiAssistantManagementSelection] |The aiAssistantManagementSelection plugin manages the Ai Assistant management section. @@ -541,7 +541,7 @@ Plugin server-side only. Plugin has three main functions: |In order to make ongoing maintenance of log collection easy we want to introduce the concept of data set quality, where users can easily get an overview on the data sets they have with information such as integration, size, last activity, among others. -|{kib-repo}blob/{branch}/x-pack/plugins/data_usage/README.md[dataUsage] +|{kib-repo}blob/{branch}/x-pack/platform/plugins/private/data_usage/README.md[dataUsage] |Serverless only plugin for users to view data usage @@ -592,7 +592,7 @@ security and spaces filtering. activities. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/exploratory_view/README.md[exploratoryView] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/exploratory_view/README.md[exploratoryView] |A shared component for visualizing observability data types via lens embeddable. For further details. @@ -665,11 +665,11 @@ the infrastructure monitoring use-case within Kibana. |Home of the Inventory plugin, which renders the... inventory. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/investigate/README.md[investigate] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/investigate/README.md[investigate] |undefined -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/investigate_app/README.md[investigateApp] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/investigate_app/README.md[investigateApp] |undefined @@ -743,19 +743,19 @@ Elastic. |The Notifications plugin provides a set of services to help Solutions and plugins send notifications to users. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability/README.md[observability] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/observability/README.md[observability] |This plugin provides shared components and services for use across observability solutions, as well as the observability landing page UI. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_ai_assistant/README.md[observabilityAIAssistant] +|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/README.md[observabilityAIAssistant] |This document gives an overview of the features of the Observability AI Assistant at the time of writing, and how to use them. At a high level, the Observability AI Assistant offers contextual insights, and a chat functionality that we enrich with function calling, allowing the LLM to hook into the user's data. We also allow the LLM to store things it considers new information as embeddings into Elasticsearch, and query this knowledge base when it decides it needs more information, using ELSER. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_ai_assistant_app/README.md[observabilityAIAssistantApp] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/observability_ai_assistant_app/README.md[observabilityAIAssistantApp] |This app registers defaults functions. It exists as a separate plugin to avoid cyclical dependencies. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/observability_ai_assistant_management/README.md[observabilityAiAssistantManagement] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/observability_ai_assistant_management/README.md[observabilityAiAssistantManagement] |The observabilityAiAssistantManagement plugin manages the Ai Assistant for Observability and Search management section. @@ -882,7 +882,7 @@ This plugin is only enabled when the application is built for serverless project | -|{kib-repo}blob/{branch}/x-pack/plugins/serverless_observability/README.mdx[serverlessObservability] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/serverless_observability/README.mdx[serverlessObservability] |This plugin contains configuration and code used to create a Serverless Observability project. It leverages universal configuration and other APIs in the serverless plugin to configure Kibana. @@ -917,15 +917,15 @@ routes, etc. |The stack_connectors plugin provides connector types shipped with Kibana, built on top of the framework provided in the actions plugin. -|{kib-repo}blob/{branch}/x-pack/plugins/streams/README.md[streams] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/streams/README.md[streams] |This plugin provides an interface to manage streams -|{kib-repo}blob/{branch}/x-pack/plugins/streams_app/README.md[streamsApp] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/streams_app/README.md[streamsApp] |Home of the Streams app plugin, which allows users to manage Streams via the UI. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/synthetics/README.md[synthetics] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/synthetics/README.md[synthetics] |The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening in their infrastructure. @@ -938,11 +938,11 @@ in their infrastructure. |Gathers all usage collection, retrieving them from both: OSS and X-Pack plugins. -|{kib-repo}blob/{branch}/x-pack/plugins/threat_intelligence/README.md[threatIntelligence] +|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/threat_intelligence/README.md[threatIntelligence] |Elastic Threat Intelligence makes it easy to analyze and investigate potential security threats by aggregating data from multiple sources in one place. You’ll be able to view data from all activated threat intelligence feeds and take action. -|{kib-repo}blob/{branch}/x-pack/plugins/timelines/README.md[timelines] +|{kib-repo}blob/{branch}/x-pack/solutions/security/plugins/timelines/README.md[timelines] |Timelines is a plugin that provides a grid component with accompanying server side apis to help users identify events of interest and perform root cause analysis within Kibana. @@ -964,7 +964,7 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona |Upgrade Assistant helps users prepare their Stack for being upgraded to the next version of the Elastic stack. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/uptime/README.md[uptime] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/uptime/README.md[uptime] |The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening in their infrastructure. @@ -973,7 +973,7 @@ in their infrastructure. |NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin. -|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/ux/readme.md[ux] +|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/ux/readme.md[ux] |https://docs.elastic.dev/kibana-dev-docs/welcome diff --git a/docs/user/security/audit-logging.asciidoc b/docs/user/security/audit-logging.asciidoc index ef12f4303c1b..0c5bee6106f0 100644 --- a/docs/user/security/audit-logging.asciidoc +++ b/docs/user/security/audit-logging.asciidoc @@ -151,6 +151,18 @@ Refer to the corresponding {es} logs for potential write errors. .1+| `product_documentation_create` | `unknown` | User requested to install the product documentation for use in AI Assistants. +.2+| `knowledge_base_entry_create` +| `success` | User has created knowledge base entry [id=x] +| `failure` | Failed attempt to create a knowledge base entry + +.2+| `knowledge_base_entry_update` +| `success` | User has updated knowledge base entry [id=x] +| `failure` | Failed attempt to update a knowledge base entry + +.2+| `knowledge_base_entry_delete` +| `success` | User has deleted knowledge base entry [id=x] +| `failure` | Failed attempt to delete a knowledge base entry + 3+a| ====== Type: change diff --git a/examples/controls_example/public/app/app.tsx b/examples/controls_example/public/app/app.tsx index 9c6df503700b..9659b0fa4774 100644 --- a/examples/controls_example/public/app/app.tsx +++ b/examples/controls_example/public/app/app.tsx @@ -48,7 +48,7 @@ const App = ({ } return ( - + 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 7ba409e83c0e..b6cb97720d79 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 @@ -315,10 +315,7 @@ export const ReactControlExample = ({ {JSON.stringify(controlGroupApi?.serializeState(), null, 2)} , - { - theme: core.theme, - i18n: core.i18n, - } + core ) ); }} @@ -374,10 +371,10 @@ export const ReactControlExample = ({ { + onClick={() => { if (controlGroupApi) { saveNotification$.next(); - setControlGroupSerializedState(await controlGroupApi.serializeState()); + setControlGroupSerializedState(controlGroupApi.serializeState()); } }} > diff --git a/examples/discover_customization_examples/public/plugin.tsx b/examples/discover_customization_examples/public/plugin.tsx index 6dc6e8f48da5..2ac642b4f752 100644 --- a/examples/discover_customization_examples/public/plugin.tsx +++ b/examples/discover_customization_examples/public/plugin.tsx @@ -52,11 +52,11 @@ export class DiscoverCustomizationExamplesPlugin implements Plugin { title: PLUGIN_NAME, visibleIn: [], mount: async (appMountParams) => { - const [_, { discover, data }] = await core.getStartServices(); + const [coreStart, { discover, data }] = await core.getStartServices(); ReactDOM.render( - + diff --git a/examples/embeddable_examples/public/app/app.tsx b/examples/embeddable_examples/public/app/app.tsx index f59169849e9f..97389830552a 100644 --- a/examples/embeddable_examples/public/app/app.tsx +++ b/examples/embeddable_examples/public/app/app.tsx @@ -81,7 +81,7 @@ const App = ({ }, [pages]); return ( - + diff --git a/examples/embeddable_examples/public/app/presentation_container_example/components/add_button.tsx b/examples/embeddable_examples/public/app/presentation_container_example/components/add_button.tsx index 3bef0d4e1192..570cd50f44ea 100644 --- a/examples/embeddable_examples/public/app/presentation_container_example/components/add_button.tsx +++ b/examples/embeddable_examples/public/app/presentation_container_example/components/add_button.tsx @@ -10,9 +10,8 @@ import React, { ReactElement, useEffect, useState } from 'react'; import { EuiButton, EuiContextMenuItem, EuiContextMenuPanel, EuiPopover } from '@elastic/eui'; import { ADD_PANEL_TRIGGER, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { PageApi } from '../types'; -export function AddButton({ pageApi, uiActions }: { pageApi: PageApi; uiActions: UiActionsStart }) { +export function AddButton({ pageApi, uiActions }: { pageApi: unknown; uiActions: UiActionsStart }) { const [isPopoverOpen, setIsPopoverOpen] = useState(false); const [items, setItems] = useState([]); @@ -73,7 +72,7 @@ export function AddButton({ pageApi, uiActions }: { pageApi: PageApi; uiActions: setIsPopoverOpen(!isPopoverOpen); }} > - Add + Add panel } isOpen={isPopoverOpen} diff --git a/examples/embeddable_examples/public/app/presentation_container_example/page_api.ts b/examples/embeddable_examples/public/app/presentation_container_example/page_api.ts index 59f06847a153..c08ba7a499b9 100644 --- a/examples/embeddable_examples/public/app/presentation_container_example/page_api.ts +++ b/examples/embeddable_examples/public/app/presentation_container_example/page_api.ts @@ -9,7 +9,6 @@ import { BehaviorSubject, Subject, combineLatest, map, merge } from 'rxjs'; import { v4 as generateId } from 'uuid'; -import { asyncForEach } from '@kbn/std'; import { TimeRange } from '@kbn/es-query'; import { PanelPackage, @@ -146,14 +145,14 @@ export function getPageApi() { }, onSave: async () => { const panelsState: LastSavedState['panelsState'] = []; - await asyncForEach(panels$.value, async ({ id, type }) => { + panels$.value.forEach(({ id, type }) => { try { const childApi = children$.value[id]; if (apiHasSerializableState(childApi)) { panelsState.push({ id, type, - panelState: await childApi.serializeState(), + panelState: childApi.serializeState(), }); } } catch (error) { diff --git a/examples/embeddable_examples/public/app/state_management_example/state_management_example.tsx b/examples/embeddable_examples/public/app/state_management_example/state_management_example.tsx index a3dcd0661815..18ff194769b3 100644 --- a/examples/embeddable_examples/public/app/state_management_example/state_management_example.tsx +++ b/examples/embeddable_examples/public/app/state_management_example/state_management_example.tsx @@ -21,7 +21,6 @@ import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { ViewMode } from '@kbn/presentation-publishing'; import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import { BehaviorSubject, Subject } from 'rxjs'; -import useMountedState from 'react-use/lib/useMountedState'; import { SAVED_BOOK_ID } from '../../react_embeddables/saved_book/constants'; import { BookApi, @@ -32,7 +31,6 @@ import { lastSavedStateSessionStorage } from './last_saved_state'; import { unsavedChangesSessionStorage } from './unsaved_changes'; export const StateManagementExample = ({ uiActions }: { uiActions: UiActionsStart }) => { - const isMounted = useMountedState(); const saveNotification$ = useMemo(() => { return new Subject(); }, []); @@ -123,16 +121,13 @@ export const StateManagementExample = ({ uiActions }: { uiActions: UiActionsStar { + onClick={() => { if (!bookApi) { return; } setIsSaving(true); - const bookSerializedState = await bookApi.serializeState(); - if (!isMounted()) { - return; - } + const bookSerializedState = bookApi.serializeState(); lastSavedStateSessionStorage.save(bookSerializedState); saveNotification$.next(); // signals embeddable unsaved change tracking to update last saved state setHasUnsavedChanges(false); diff --git a/examples/embeddable_examples/public/index.ts b/examples/embeddable_examples/public/index.ts index 1705ec84680f..3e0db5b6ab24 100644 --- a/examples/embeddable_examples/public/index.ts +++ b/examples/embeddable_examples/public/index.ts @@ -9,4 +9,6 @@ import { EmbeddableExamplesPlugin } from './plugin'; +export { AddButton as AddEmbeddableButton } from './app/presentation_container_example/components/add_button'; + export const plugin = () => new EmbeddableExamplesPlugin(); diff --git a/examples/embeddable_examples/public/react_embeddables/data_table/data_table_react_embeddable.tsx b/examples/embeddable_examples/public/react_embeddables/data_table/data_table_react_embeddable.tsx index 54046eb5afa0..0311decf5c3c 100644 --- a/examples/embeddable_examples/public/react_embeddables/data_table/data_table_react_embeddable.tsx +++ b/examples/embeddable_examples/public/react_embeddables/data_table/data_table_react_embeddable.tsx @@ -99,7 +99,7 @@ export const getDataTableFactory = ( width: 100%; `} > - + { @@ -36,19 +35,17 @@ export const registerCreateSavedBookAction = (uiActions: UiActionsPublicStart, c if (!apiCanAddNewPanel(embeddable)) throw new IncompatibleActionError(); const newPanelStateManager = stateManagerFromAttributes(defaultBookAttributes); - const { addToLibrary } = await openSavedBookEditor(newPanelStateManager, true, core, { - parentApi: embeddable, + const { savedBookId } = await openSavedBookEditor({ + attributesManager: newPanelStateManager, + parent: embeddable, + isCreate: true, + core, }); - const initialState: BookRuntimeState = await (async () => { - const bookAttributes = serializeBookAttributes(newPanelStateManager); - // if we're adding this to the library, we only need to return the by reference state. - if (addToLibrary) { - const savedBookId = await saveBookAttributes(undefined, bookAttributes); - return { savedBookId, ...bookAttributes }; - } - return bookAttributes; - })(); + const bookAttributes = serializeBookAttributes(newPanelStateManager); + const initialState: BookRuntimeState = savedBookId + ? { savedBookId, ...bookAttributes } + : { ...bookAttributes }; embeddable.addNewPanel({ panelType: SAVED_BOOK_ID, diff --git a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_editor.tsx b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_editor.tsx index 8a028eeadd49..0222e682b7b0 100644 --- a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_editor.tsx +++ b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_editor.tsx @@ -27,26 +27,32 @@ import { OverlayRef } from '@kbn/core-mount-utils-browser'; import { i18n } from '@kbn/i18n'; import { tracksOverlays } from '@kbn/presentation-containers'; import { - apiHasParentApi, + apiHasInPlaceLibraryTransforms, apiHasUniqueId, useBatchedOptionalPublishingSubjects, } from '@kbn/presentation-publishing'; import { toMountPoint } from '@kbn/react-kibana-mount'; -import React from 'react'; +import React, { useState } from 'react'; import { serializeBookAttributes } from './book_state'; -import { BookAttributesManager } from './types'; +import { BookApi, BookAttributesManager } from './types'; +import { saveBookAttributes } from './saved_book_library'; -export const openSavedBookEditor = ( - attributesManager: BookAttributesManager, - isCreate: boolean, - core: CoreStart, - api: unknown -): Promise<{ addToLibrary: boolean }> => { +export const openSavedBookEditor = ({ + attributesManager, + isCreate, + core, + parent, + api, +}: { + attributesManager: BookAttributesManager; + isCreate: boolean; + core: CoreStart; + parent?: unknown; + api?: BookApi; +}): Promise<{ savedBookId?: string }> => { return new Promise((resolve) => { const closeOverlay = (overlayRef: OverlayRef) => { - if (apiHasParentApi(api) && tracksOverlays(api.parentApi)) { - api.parentApi.clearOverlays(); - } + if (tracksOverlays(parent)) parent.clearOverlays(); overlayRef.close(); }; @@ -54,8 +60,9 @@ export const openSavedBookEditor = ( const overlay = core.overlays.openFlyout( toMountPoint( { // set the state back to the initial state and reject attributesManager.authorName.next(initialState.authorName); @@ -64,19 +71,23 @@ export const openSavedBookEditor = ( attributesManager.numberOfPages.next(initialState.numberOfPages); closeOverlay(overlay); }} - onSubmit={(addToLibrary: boolean) => { + onSubmit={async (addToLibrary: boolean) => { + const savedBookId = addToLibrary + ? await saveBookAttributes( + apiHasInPlaceLibraryTransforms(api) ? api.libraryId$.value : undefined, + serializeBookAttributes(attributesManager) + ) + : undefined; + closeOverlay(overlay); - resolve({ addToLibrary }); + resolve({ savedBookId }); }} />, - { - theme: core.theme, - i18n: core.i18n, - } + core ), { type: isCreate ? 'overlay' : 'push', - size: isCreate ? 'm' : 's', + size: 'm', onClose: () => closeOverlay(overlay), } ); @@ -86,9 +97,7 @@ export const openSavedBookEditor = ( * if our parent needs to know about the overlay, notify it. This allows the parent to close the overlay * when navigating away, or change certain behaviors based on the overlay being open. */ - if (apiHasParentApi(api) && tracksOverlays(api.parentApi)) { - api.parentApi.openOverlay(overlay, overlayOptions); - } + if (tracksOverlays(parent)) parent.openOverlay(overlay, overlayOptions); }); }; @@ -97,19 +106,24 @@ export const SavedBookEditor = ({ isCreate, onSubmit, onCancel, + api, }: { attributesManager: BookAttributesManager; isCreate: boolean; - onSubmit: (addToLibrary: boolean) => void; + onSubmit: (addToLibrary: boolean) => Promise; onCancel: () => void; + api?: BookApi; }) => { - const [addToLibrary, setAddToLibrary] = React.useState(false); - const [authorName, synopsis, bookTitle, numberOfPages] = useBatchedOptionalPublishingSubjects( - attributesManager.authorName, - attributesManager.bookSynopsis, - attributesManager.bookTitle, - attributesManager.numberOfPages - ); + const [libraryId, authorName, synopsis, bookTitle, numberOfPages] = + useBatchedOptionalPublishingSubjects( + api?.libraryId$, + attributesManager.authorName, + attributesManager.bookSynopsis, + attributesManager.bookTitle, + attributesManager.numberOfPages + ); + const [addToLibrary, setAddToLibrary] = useState(Boolean(libraryId)); + const [saving, setSaving] = useState(false); return ( <> @@ -133,6 +147,7 @@ export const SavedBookEditor = ({ })} > attributesManager.authorName.next(e.target.value)} /> @@ -143,6 +158,7 @@ export const SavedBookEditor = ({ })} > attributesManager.bookTitle.next(e.target.value)} /> @@ -153,6 +169,7 @@ export const SavedBookEditor = ({ })} > attributesManager.numberOfPages.next(+e.target.value)} /> @@ -163,6 +180,7 @@ export const SavedBookEditor = ({ })} > attributesManager.bookSynopsis.next(e.target.value)} /> @@ -171,7 +189,7 @@ export const SavedBookEditor = ({ - + {i18n.translate('embeddableExamples.savedBook.editor.cancel', { defaultMessage: 'Discard changes', })} @@ -179,19 +197,25 @@ export const SavedBookEditor = ({ - {isCreate && ( - - setAddToLibrary(!addToLibrary)} - /> - - )} - onSubmit(addToLibrary)} fill> + setAddToLibrary(!addToLibrary)} + /> + + + { + setSaving(true); + onSubmit(addToLibrary); + }} + fill + > {isCreate ? i18n.translate('embeddableExamples.savedBook.editor.create', { defaultMessage: 'Create book', diff --git a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_library.ts b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_library.ts index 3d989debf709..ef22750d9457 100644 --- a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_library.ts +++ b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_library.ts @@ -23,7 +23,7 @@ export const saveBookAttributes = async ( maybeId?: string, attributes?: BookAttributes ): Promise => { - await new Promise((r) => setTimeout(r, 100)); // simulate save to network. + await new Promise((r) => setTimeout(r, 500)); // simulate save to network. const id = maybeId ?? v4(); storage.set(id, attributes); return id; diff --git a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_react_embeddable.tsx b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_react_embeddable.tsx index 58f0f4de8555..74cd81cf51bd 100644 --- a/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_react_embeddable.tsx +++ b/examples/embeddable_examples/public/react_embeddables/saved_book/saved_book_react_embeddable.tsx @@ -81,14 +81,22 @@ export const getSavedBookEmbeddableFactory = (core: CoreStart) => { { ...titlesApi, onEdit: async () => { - openSavedBookEditor(bookAttributesManager, false, core, api); + openSavedBookEditor({ + attributesManager: bookAttributesManager, + parent: api.parentApi, + isCreate: false, + core, + api, + }).then((result) => { + savedBookId$.next(result.savedBookId); + }); }, isEditingEnabled: () => true, getTypeDisplayName: () => i18n.translate('embeddableExamples.savedbook.editBook.displayName', { defaultMessage: 'book', }), - serializeState: async () => { + serializeState: () => { if (!Boolean(savedBookId$.value)) { // if this book is currently by value, we serialize the entire state. const bookByValueState: BookByValueSerializedState = { @@ -98,16 +106,11 @@ export const getSavedBookEmbeddableFactory = (core: CoreStart) => { return { rawState: bookByValueState }; } - // if this book is currently by reference, we serialize the reference and write to the external store. + // if this book is currently by reference, we serialize the reference only. const bookByReferenceState: BookByReferenceSerializedState = { savedBookId: savedBookId$.value!, ...serializeTitles(), }; - - await saveBookAttributes( - savedBookId$.value, - serializeBookAttributes(bookAttributesManager) - ); return { rawState: bookByReferenceState }; }, diff --git a/examples/embeddable_examples/tsconfig.json b/examples/embeddable_examples/tsconfig.json index 8f59132f05fb..d7aa8342de0c 100644 --- a/examples/embeddable_examples/tsconfig.json +++ b/examples/embeddable_examples/tsconfig.json @@ -40,7 +40,6 @@ "@kbn/kibana-utils-plugin", "@kbn/core-mount-utils-browser", "@kbn/react-kibana-mount", - "@kbn/std", "@kbn/shared-ux-router" ] } diff --git a/examples/expressions_explorer/public/app.tsx b/examples/expressions_explorer/public/app.tsx index 638767ed72a3..ca7db99f81e9 100644 --- a/examples/expressions_explorer/public/app.tsx +++ b/examples/expressions_explorer/public/app.tsx @@ -24,6 +24,7 @@ import { I18nStart, IUiSettingsClient, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import { ExpressionsStart } from '@kbn/expressions-plugin/public'; import { Start as InspectorStart } from '@kbn/inspector-plugin/public'; @@ -41,6 +42,7 @@ interface Props { inspector: InspectorStart; actions: UiActionsStart; uiSettings: IUiSettingsClient; + userProfile: UserProfileService; settings: SettingsStart; theme: ThemeServiceStart; i18n: I18nStart; @@ -52,15 +54,13 @@ const ExpressionsExplorer = ({ actions, uiSettings, settings, - i18n, - theme, + ...startServices }: Props) => { const { Provider: KibanaReactContextProvider } = createKibanaReactContext({ uiSettings, settings, - theme, + theme: startServices.theme, }); - const startServices = { i18n, theme }; return ( diff --git a/examples/expressions_explorer/public/plugin.tsx b/examples/expressions_explorer/public/plugin.tsx index b0030d1c00aa..d03008bb1653 100644 --- a/examples/expressions_explorer/public/plugin.tsx +++ b/examples/expressions_explorer/public/plugin.tsx @@ -58,6 +58,7 @@ export class ExpressionsExplorerPlugin implements Plugin { +export const GridExample = ({ + coreStart, + uiActions, +}: { + coreStart: CoreStart; + uiActions: UiActionsStart; +}) => { const savedState = useRef(getSerializedDashboardState()); const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false); - const [expandedPanelId, setExpandedPanelId] = useState(); - const [accessMode, setAccessMode] = useState('EDIT'); const [currentLayout, setCurrentLayout] = useState( dashboardInputToGridLayout(savedState.current) ); const mockDashboardApi = useMockDashboardApi({ savedState: savedState.current }); + const [viewMode, expandedPanelId] = useBatchedPublishingSubjects( + mockDashboardApi.viewMode, + mockDashboardApi.expandedPanelId + ); useEffect(() => { combineLatest([mockDashboardApi.panels$, mockDashboardApi.rows$]) .pipe(debounceTime(0)) // debounce to avoid subscribe being called twice when both panels$ and rows$ publish .subscribe(([panels, rows]) => { const hasChanges = !( - deepEqual(panels, savedState.current.panels) && deepEqual(rows, savedState.current.rows) + deepEqual( + Object.values(panels).map(({ gridData }) => ({ row: 0, ...gridData })), + Object.values(savedState.current.panels).map(({ gridData }) => ({ + row: 0, // if row is undefined, then default to 0 + ...gridData, + })) + ) && deepEqual(rows, savedState.current.rows) ); setHasUnsavedChanges(hasChanges); setCurrentLayout(dashboardInputToGridLayout({ panels, rows })); @@ -69,58 +84,31 @@ export const GridExample = ({ coreStart }: { coreStart: CoreStart }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, []); - const renderBasicPanel = useCallback( - (id: string) => { + const renderPanelContents = useCallback( + (id: string, setDragHandles?: (refs: Array) => void) => { + const currentPanels = mockDashboardApi.panels$.getValue(); + return ( - <> -
{id}
- { - setExpandedPanelId(undefined); - mockDashboardApi.removePanel(id); - }} - > - {i18n.translate('examples.gridExample.deletePanelButton', { - defaultMessage: 'Delete panel', - })} - - { - setExpandedPanelId(undefined); - const newPanelId = await getPanelId({ - coreStart, - suggestion: id, - }); - if (newPanelId) mockDashboardApi.replacePanel(id, newPanelId); - }} - > - {i18n.translate('examples.gridExample.replacePanelButton', { - defaultMessage: 'Replace panel', - })} - - setExpandedPanelId((expandedId) => (expandedId ? undefined : id))} - aria-label={ - expandedPanelId - ? i18n.translate('examples.gridExample.minimizePanel', { - defaultMessage: 'Minimize panel {id}', - values: { id }, - }) - : i18n.translate('examples.gridExample.maximizePanel', { - defaultMessage: 'Maximize panel {id}', - values: { id }, - }) - } - /> - + mockDashboardApi} + panelProps={{ + showBadges: true, + showBorder: true, + showNotifications: true, + showShadow: false, + setDragHandles, + }} + /> ); }, - [coreStart, mockDashboardApi, setExpandedPanelId, expandedPanelId] + [mockDashboardApi] ); return ( - + { { - { - setExpandedPanelId(undefined); - const panelId = await getPanelId({ - coreStart, - suggestion: uuidv4(), - }); - if (panelId) mockDashboardApi.addNewPanel({ id: panelId }); - }} - > - {i18n.translate('examples.gridExample.addPanelButton', { - defaultMessage: 'Add a panel', - })} - + @@ -180,7 +155,7 @@ export const GridExample = ({ coreStart }: { coreStart: CoreStart }) => { })} options={[ { - id: 'VIEW', + id: 'view', label: i18n.translate('examples.gridExample.viewOption', { defaultMessage: 'View', }), @@ -188,16 +163,16 @@ export const GridExample = ({ coreStart }: { coreStart: CoreStart }) => { 'The layout adjusts when the window is resized. Panel interactivity, such as moving and resizing within the grid, is disabled.', }, { - id: 'EDIT', + id: 'edit', label: i18n.translate('examples.gridExample.editOption', { defaultMessage: 'Edit', }), toolTipContent: 'The layout does not adjust when the window is resized.', }, ]} - idSelected={accessMode} + idSelected={viewMode} onChange={(id) => { - setAccessMode(id as GridAccessMode); + mockDashboardApi.viewMode.next(id); }} /> @@ -245,7 +220,7 @@ export const GridExample = ({ coreStart }: { coreStart: CoreStart }) => { { rowHeight: DASHBOARD_GRID_HEIGHT, columnCount: DASHBOARD_GRID_COLUMN_COUNT, }} - renderPanelContents={renderBasicPanel} + renderPanelContents={renderPanelContents} onLayoutChange={(newLayout) => { - const { panels, rows } = gridLayoutToDashboardPanelMap(newLayout); + const { panels, rows } = gridLayoutToDashboardPanelMap( + mockDashboardApi.panels$.getValue(), + newLayout + ); mockDashboardApi.panels$.next(panels); mockDashboardApi.rows$.next(rows); }} /> - +
); }; export const renderGridExampleApp = ( element: AppMountParameters['element'], - coreStart: CoreStart + deps: { uiActions: UiActionsStart; coreStart: CoreStart } ) => { - ReactDOM.render(, element); + ReactDOM.render(, element); return () => ReactDOM.unmountComponentAtNode(element); }; diff --git a/examples/grid_example/public/get_panel_id.tsx b/examples/grid_example/public/get_panel_id.tsx index d83d0b232b53..b94b1ac0de2b 100644 --- a/examples/grid_example/public/get_panel_id.tsx +++ b/examples/grid_example/public/get_panel_id.tsx @@ -98,10 +98,7 @@ export const getPanelId = async ({ session.close(); }} />, - { - theme: coreStart.theme, - i18n: coreStart.i18n, - } + coreStart ) ); }); diff --git a/examples/grid_example/public/logs_dashboard_panels.json b/examples/grid_example/public/logs_dashboard_panels.json new file mode 100644 index 000000000000..29d63baa2d33 --- /dev/null +++ b/examples/grid_example/public/logs_dashboard_panels.json @@ -0,0 +1,4884 @@ +{ + "343f0bef-0b19-452e-b1c8-59beb18b6f0c": { + "type": "visualization", + "gridData": { + "x": 0, + "y": 0, + "w": 18, + "h": 8, + "i": "343f0bef-0b19-452e-b1c8-59beb18b6f0c" + }, + "explicitInput": { + "id": "343f0bef-0b19-452e-b1c8-59beb18b6f0c", + "hidePanelTitles": true, + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "savedVis": { + "title": "[Logs] Markdown Instructions", + "description": "", + "type": "markdown", + "params": { + "fontSize": 12, + "openLinksInNewTab": true, + "markdown": "#### Sample Logs Data\n### Request Sizes\nThis dashboard uses the `[Logs]` sample data for you to play with and includes visualizations related to the sizes (in bytes) of the sample requests. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)." + }, + "uiState": {}, + "data": { + "aggs": [], + "searchSource": { + "query": { + "query": "", + "language": "kuery" + }, + "filter": [] + } + } + } + } + }, + "2874670c-61d5-4dca-b842-fdf76977cc02": { + "type": "lens", + "gridData": { + "x": 18, + "y": 0, + "w": 30, + "h": 13, + "i": "2874670c-61d5-4dca-b842-fdf76977cc02" + }, + "explicitInput": { + "id": "2874670c-61d5-4dca-b842-fdf76977cc02", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "52b991d3-bfec-474c-a9ee-860b58baffd2", + "filters": [], + "query": { + "query": "", + "language": "kuery" + }, + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-9159b5ef-429c-4c92-b587-7247fbdadd4d", + "type": "index-pattern" + } + ], + "state": { + "visualization": { + "legend": { + "isVisible": true, + "position": "right" + }, + "valueLabels": "hide", + "fittingFunction": "None", + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "area", + "layers": [ + { + "layerId": "9159b5ef-429c-4c92-b587-7247fbdadd4d", + "accessors": ["e950618a-874e-435d-85da-30dd52504120"], + "position": "top", + "seriesType": "area", + "showGridlines": false, + "layerType": "data", + "xAccessor": "f136fcf3-2bda-42a0-8bae-231543b236ab" + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "9159b5ef-429c-4c92-b587-7247fbdadd4d": { + "columns": { + "f136fcf3-2bda-42a0-8bae-231543b236ab": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true, + "dropPartials": false + } + }, + "e950618a-874e-435d-85da-30dd52504120": { + "label": "Median of bytes", + "dataType": "number", + "operationType": "median", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "emptyAsNull": true + } + } + }, + "columnOrder": [ + "f136fcf3-2bda-42a0-8bae-231543b236ab", + "e950618a-874e-435d-85da-30dd52504120" + ], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + "a88dd08e-9b07-45b0-bc0a-822450d2bfcb": { + "type": "lens", + "gridData": { + "x": 0, + "y": 8, + "w": 9, + "h": 5, + "i": "a88dd08e-9b07-45b0-bc0a-822450d2bfcb" + }, + "explicitInput": { + "id": "a88dd08e-9b07-45b0-bc0a-822450d2bfcb", + "title": "", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "52b991d3-bfec-474c-a9ee-860b58baffd2", + "filters": [], + "query": { + "query": "", + "language": "kuery" + }, + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-04d32faf-7772-4820-bc25-dc510a13b0bc", + "type": "index-pattern" + } + ], + "state": { + "visualization": { + "layerId": "04d32faf-7772-4820-bc25-dc510a13b0bc", + "layerType": "data", + "metricAccessor": "3016ca70-b4ae-408d-859d-3de50b22b528", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#bbdad3", + "stop": 13154.66 + }, + { + "color": "#77b6a8", + "stop": 26309.32 + }, + { + "color": "#209280", + "stop": 39464 + } + ], + "continuity": "above", + "maxSteps": 5, + "colorStops": [ + { + "color": "#bbdad3", + "stop": 0 + }, + { + "color": "#77b6a8", + "stop": 13154.66 + }, + { + "color": "#209280", + "stop": 26309.32 + } + ] + } + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "04d32faf-7772-4820-bc25-dc510a13b0bc": { + "columns": { + "3016ca70-b4ae-408d-859d-3de50b22b528": { + "label": "Median Request Size", + "dataType": "number", + "operationType": "median", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + }, + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": ["3016ca70-b4ae-408d-859d-3de50b22b528"], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + "2daa9fd6-1406-4f3d-8230-3172760c5eb0": { + "type": "lens", + "gridData": { + "x": 9, + "y": 8, + "w": 9, + "h": 5, + "i": "2daa9fd6-1406-4f3d-8230-3172760c5eb0" + }, + "explicitInput": { + "id": "2daa9fd6-1406-4f3d-8230-3172760c5eb0", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "52b991d3-bfec-474c-a9ee-860b58baffd2", + "filters": [], + "query": { + "query": "", + "language": "kuery" + }, + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-04d32faf-7772-4820-bc25-dc510a13b0bc", + "type": "index-pattern" + } + ], + "state": { + "visualization": { + "layerId": "04d32faf-7772-4820-bc25-dc510a13b0bc", + "layerType": "data", + "metricAccessor": "3016ca70-b4ae-408d-859d-3de50b22b528", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#bbdad3", + "stop": 13154.66 + }, + { + "color": "#77b6a8", + "stop": 26309.32 + }, + { + "color": "#209280", + "stop": 39464 + } + ], + "continuity": "above", + "maxSteps": 5, + "colorStops": [ + { + "color": "#bbdad3", + "stop": 0 + }, + { + "color": "#77b6a8", + "stop": 13154.66 + }, + { + "color": "#209280", + "stop": 26309.32 + } + ] + } + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "04d32faf-7772-4820-bc25-dc510a13b0bc": { + "columns": { + "3016ca70-b4ae-408d-859d-3de50b22b528": { + "label": "Maximum Request Size", + "dataType": "number", + "operationType": "max", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + }, + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": ["3016ca70-b4ae-408d-859d-3de50b22b528"], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + "b6a55c16-2cce-40a7-9d15-988bc060af16": { + "type": "lens", + "gridData": { + "x": 0, + "y": 13, + "w": 18, + "h": 11, + "i": "b6a55c16-2cce-40a7-9d15-988bc060af16" + }, + "explicitInput": { + "id": "b6a55c16-2cce-40a7-9d15-988bc060af16", + "title": "Bytes distribution", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "hidePanelTitles": false, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "51b1c696-a450-48c2-8223-5753e57957c1", + "filters": [], + "query": { + "language": "kuery", + "query": "" + }, + "attributes": { + "title": "[Logs] Bytes distribution - Bucketed", + "description": "", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-40355730-da62-4d81-8b3b-18ff824f7dd2" + } + ], + "state": { + "visualization": { + "legend": { + "isVisible": true, + "legendSize": "auto", + "position": "right" + }, + "valueLabels": "hide", + "fittingFunction": "None", + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "full" + }, + "axisTitlesVisibilitySettings": { + "x": false, + "yLeft": false, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "bar", + "layers": [ + { + "layerId": "40355730-da62-4d81-8b3b-18ff824f7dd2", + "seriesType": "bar", + "xAccessor": "cfeb3d08-02c2-48d5-92f8-d2fc831f6953", + "accessors": ["569e4272-0188-4023-9b8c-e8611d2c7e0e"], + "layerType": "data", + "colorMapping": { + "assignments": [], + "specialAssignments": [ + { + "rule": { + "type": "other" + }, + "color": { + "type": "loop" + }, + "touched": false + } + ], + "paletteId": "eui_amsterdam_color_blind", + "colorMode": { + "type": "categorical" + } + }, + "yConfig": [ + { + "forAccessor": "569e4272-0188-4023-9b8c-e8611d2c7e0e", + "color": "#54B399" + } + ] + } + ] + }, + "query": { + "language": "kuery", + "query": "" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "40355730-da62-4d81-8b3b-18ff824f7dd2": { + "columns": { + "cfeb3d08-02c2-48d5-92f8-d2fc831f6953": { + "label": "bytes", + "dataType": "string", + "operationType": "range", + "sourceField": "bytes", + "isBucketed": true, + "scale": "ordinal", + "params": { + "type": "range", + "ranges": [ + { + "from": 0, + "to": 1, + "label": "Empty requests" + }, + { + "from": 1, + "to": 2000, + "label": "" + }, + { + "from": 2000, + "to": 4000, + "label": "" + }, + { + "from": 4000, + "to": 6000, + "label": "" + }, + { + "from": 6000, + "to": 8000, + "label": "" + }, + { + "from": 8000, + "to": 10000, + "label": "" + }, + { + "from": 10000, + "to": 12000, + "label": "" + }, + { + "from": 12000, + "to": 14000, + "label": "" + }, + { + "from": 14000, + "to": null, + "label": "" + } + ], + "maxBars": 499.5, + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + }, + "parentFormat": { + "id": "range", + "params": { + "template": "arrow_right", + "replaceInfinity": true + } + } + } + }, + "569e4272-0188-4023-9b8c-e8611d2c7e0eX0": { + "label": "Part of % of visits", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "569e4272-0188-4023-9b8c-e8611d2c7e0eX1": { + "label": "Part of % of visits", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "569e4272-0188-4023-9b8c-e8611d2c7e0eX2": { + "label": "Part of % of visits", + "dataType": "number", + "operationType": "overall_sum", + "isBucketed": false, + "scale": "ratio", + "references": ["569e4272-0188-4023-9b8c-e8611d2c7e0eX1"], + "customLabel": true + }, + "569e4272-0188-4023-9b8c-e8611d2c7e0eX3": { + "label": "Part of % of visits", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "569e4272-0188-4023-9b8c-e8611d2c7e0eX0", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX2" + ], + "location": { + "min": 0, + "max": 30 + }, + "text": "count() / overall_sum(count())" + } + }, + "references": [ + "569e4272-0188-4023-9b8c-e8611d2c7e0eX0", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX2" + ], + "customLabel": true + }, + "569e4272-0188-4023-9b8c-e8611d2c7e0e": { + "label": "% of visits", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count() / overall_sum(count())", + "isFormulaBroken": false + }, + "references": ["569e4272-0188-4023-9b8c-e8611d2c7e0eX3"], + "customLabel": true + } + }, + "columnOrder": [ + "cfeb3d08-02c2-48d5-92f8-d2fc831f6953", + "569e4272-0188-4023-9b8c-e8611d2c7e0e", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX0", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX1", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX2", + "569e4272-0188-4023-9b8c-e8611d2c7e0eX3" + ], + "incompleteColumns": {}, + "sampling": 1, + "indexPatternId": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + }, + "currentIndexPatternId": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + "7c02d081-73a7-48c7-8ca7-fff6a9bb3ac3": { + "type": "lens", + "gridData": { + "x": 18, + "y": 13, + "w": 30, + "h": 11, + "i": "7c02d081-73a7-48c7-8ca7-fff6a9bb3ac3" + }, + "explicitInput": { + "id": "7c02d081-73a7-48c7-8ca7-fff6a9bb3ac3", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "52b991d3-bfec-474c-a9ee-860b58baffd2", + "filters": [], + "query": { + "query": "", + "language": "kuery" + }, + "attributes": { + "title": "", + "visualizationType": "lnsDatatable", + "type": "lens", + "references": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-c840e93e-2949-4723-ad35-6bdb2d724404", + "type": "index-pattern" + } + ], + "state": { + "visualization": { + "columns": [ + { + "columnId": "4e64d6d7-4f92-4d5e-abbb-13796604db30", + "isTransposed": false + }, + { + "columnId": "fb9a848d-76f3-4005-a067-4259a50b5621", + "isTransposed": false + }, + { + "columnId": "a2760bc2-9a6e-46a1-8595-86f61573c7cf", + "isTransposed": false + }, + { + "columnId": "2c8bd8d5-35ff-4386-8d27-3ba882b13e43", + "isTransposed": false, + "colorMode": "text", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#d23115", + "stop": 1000 + }, + { + "color": "#fcc400", + "stop": 1500 + }, + { + "color": "#68bc00", + "stop": 1501 + } + ], + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "continuity": "above", + "colorStops": [ + { + "color": "#d23115", + "stop": 0 + }, + { + "color": "#fcc400", + "stop": 1000 + }, + { + "color": "#68bc00", + "stop": 1500 + } + ], + "name": "custom" + } + } + }, + { + "columnId": "defa6f97-b874-4556-8438-056fb437787b", + "isTransposed": false, + "colorMode": "text", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#D23115", + "stop": 10 + }, + { + "color": "#FCC400", + "stop": 25 + }, + { + "color": "#68bc00", + "stop": 26 + } + ], + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "continuity": "above", + "colorStops": [ + { + "color": "#D23115", + "stop": 0 + }, + { + "color": "#FCC400", + "stop": 10 + }, + { + "color": "#68bc00", + "stop": 25 + } + ], + "name": "custom" + } + } + } + ], + "layerId": "c840e93e-2949-4723-ad35-6bdb2d724404", + "layerType": "data" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "c840e93e-2949-4723-ad35-6bdb2d724404": { + "columns": { + "4e64d6d7-4f92-4d5e-abbb-13796604db30": { + "label": "Type", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "extension.keyword", + "isBucketed": true, + "params": { + "size": 10, + "orderBy": { + "type": "column", + "columnId": "fb9a848d-76f3-4005-a067-4259a50b5621" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false, + "parentFormat": { + "id": "terms" + }, + "include": [], + "exclude": [], + "includeIsRegex": false, + "excludeIsRegex": false + }, + "customLabel": true + }, + "fb9a848d-76f3-4005-a067-4259a50b5621": { + "label": "Bytes (Total)", + "dataType": "number", + "operationType": "sum", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "emptyAsNull": true, + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + } + }, + "customLabel": true + }, + "a2760bc2-9a6e-46a1-8595-86f61573c7cf": { + "label": "Bytes (Last Hour)", + "dataType": "number", + "operationType": "sum", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "reducedTimeRange": "1h", + "params": { + "emptyAsNull": true, + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + } + }, + "customLabel": true + }, + "2c8bd8d5-35ff-4386-8d27-3ba882b13e43": { + "label": "Unique Visits (Total)", + "dataType": "number", + "operationType": "unique_count", + "scale": "ratio", + "sourceField": "clientip", + "isBucketed": false, + "params": { + "emptyAsNull": true + }, + "customLabel": true + }, + "defa6f97-b874-4556-8438-056fb437787b": { + "label": "Unique count of clientip", + "dataType": "number", + "operationType": "unique_count", + "scale": "ratio", + "sourceField": "clientip", + "isBucketed": false, + "reducedTimeRange": "1h", + "params": { + "emptyAsNull": true + } + } + }, + "columnOrder": [ + "4e64d6d7-4f92-4d5e-abbb-13796604db30", + "fb9a848d-76f3-4005-a067-4259a50b5621", + "a2760bc2-9a6e-46a1-8595-86f61573c7cf", + "2c8bd8d5-35ff-4386-8d27-3ba882b13e43", + "defa6f97-b874-4556-8438-056fb437787b" + ], + "sampling": 1, + "incompleteColumns": {} + } + } + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + + "4": { + "type": "map", + "gridData": { + "x": 0, + "y": 16, + "w": 48, + "h": 17, + "i": "4", + "row": 1 + }, + "explicitInput": { + "id": "4", + "savedObjectId": "de71f4f0-1902-11e9-919b-ffe5949a18d2", + "isLayerTOCOpen": false, + "hiddenLayers": [], + "mapCenter": { + "lat": 39.6308, + "lon": -100.62555, + "zoom": 3.31 + }, + "openTOCDetails": [], + "enhancements": {}, + "mapBuffer": { + "minLon": -180, + "minLat": 21.94305, + "maxLon": -22.5, + "maxLat": 55.77657 + } + }, + "version": "8.10.0-SNAPSHOT" + }, + "05da0d2b-0145-4068-b21c-00be3184d465": { + "type": "visualization", + "gridData": { + "x": 0, + "y": 0, + "w": 18, + "h": 8, + "i": "05da0d2b-0145-4068-b21c-00be3184d465", + "row": 1 + }, + "explicitInput": { + "id": "05da0d2b-0145-4068-b21c-00be3184d465", + "savedVis": { + "title": "[Logs] Markdown Instructions", + "description": "", + "type": "markdown", + "params": { + "fontSize": 12, + "openLinksInNewTab": true, + "markdown": "#### Sample Logs Data\n### Visitors\nThis dashboard uses the `[Logs]` sample data for you to play with and includes visualizations related to the visitors. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)." + }, + "uiState": {}, + "data": { + "aggs": [], + "searchSource": { + "query": { + "query": "", + "language": "kuery" + }, + "filter": [] + } + } + }, + "enhancements": {}, + "hidePanelTitles": true + }, + "version": "8.10.0-SNAPSHOT" + }, + "b7da9075-4742-47e3-b4f8-fc9ba82de74c": { + "type": "visualization", + "gridData": { + "x": 18, + "y": 0, + "w": 18, + "h": 16, + "i": "b7da9075-4742-47e3-b4f8-fc9ba82de74c", + "row": 1 + }, + "explicitInput": { + "id": "b7da9075-4742-47e3-b4f8-fc9ba82de74c", + "savedObjectId": "cb099a20-ea66-11eb-9425-113343a037e3", + "title": "Unique Destination Heatmap", + "savedVis": { + "title": "", + "description": "", + "type": "vega", + "params": { + "spec": "{\n $schema: https://vega.github.io/schema/vega-lite/v5.json\n data: {\n url: {\n %context%: true\n %timefield%: @timestamp\n index: kibana_sample_data_logs\n body: {\n aggs: {\n countries: {\n terms: {\n field: geo.src\n size: 25\n }\n aggs: {\n hours: {\n histogram: {\n field: hour_of_day\n interval: 1\n }\n aggs: {\n unique: {\n cardinality: {\n field: clientip\n }\n }\n }\n }\n }\n }\n }\n size: 0\n }\n }\n format: {property: \"aggregations.countries.buckets\"}\n }\n \n transform: [\n {\n flatten: [\"hours.buckets\"],\n as: [\"buckets\"]\n }\n ]\n\n mark: {\n type: rect\n tooltip: true\n }\n\n encoding: {\n x: {\n field: buckets.key\n type: ordinal\n axis: {\n title: false\n labelAngle: 0\n }\n }\n y: {\n field: key\n type: nominal\n sort: {\n field: -buckets.unique.value\n }\n axis: {title: false}\n }\n color: {\n field: buckets.unique.value\n type: quantitative\n axis: {title: false}\n scale: {\n scheme: reds\n }\n }\n }\n}\n" + }, + "uiState": {}, + "data": { + "aggs": [], + "searchSource": { + "query": { + "query": "", + "language": "kuery" + }, + "filter": [] + } + } + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.10.0-SNAPSHOT" + }, + "5c409557-644d-4c05-a284-ffe54bb28db0": { + "type": "lens", + "gridData": { + "x": 36, + "y": 0, + "w": 12, + "h": 16, + "i": "5c409557-644d-4c05-a284-ffe54bb28db0", + "row": 1 + }, + "explicitInput": { + "id": "5c409557-644d-4c05-a284-ffe54bb28db0", + "title": "Sum of Request Bytes by Visitor Location", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsPie", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-edb3a980-148e-4d41-ae90-a77f679a988b" + } + ], + "state": { + "visualization": { + "shape": "treemap", + "layers": [ + { + "layerId": "edb3a980-148e-4d41-ae90-a77f679a988b", + "primaryGroups": ["e5fed3a7-a050-401f-84cc-98f32d97c350"], + "metrics": ["90c36c1d-5653-4d12-b7ab-a8fb82a354fc"], + "numberDisplay": "percent", + "categoryDisplay": "default", + "legendDisplay": "default", + "nestedLegend": false, + "layerType": "data" + } + ], + "palette": { + "type": "palette", + "name": "cool" + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "edb3a980-148e-4d41-ae90-a77f679a988b": { + "columns": { + "e5fed3a7-a050-401f-84cc-98f32d97c350": { + "label": "Top 5 values of geo.dest", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "geo.dest", + "isBucketed": true, + "params": { + "size": 5, + "orderBy": { + "type": "column", + "columnId": "90c36c1d-5653-4d12-b7ab-a8fb82a354fc" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false, + "parentFormat": { + "id": "terms" + }, + "include": [], + "exclude": [], + "includeIsRegex": false, + "excludeIsRegex": false + } + }, + "90c36c1d-5653-4d12-b7ab-a8fb82a354fc": { + "label": "Sum of bytes", + "dataType": "number", + "operationType": "sum", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "emptyAsNull": true, + "format": { + "id": "bytes", + "params": { + "decimals": 2 + } + } + } + } + }, + "columnOrder": [ + "e5fed3a7-a050-401f-84cc-98f32d97c350", + "90c36c1d-5653-4d12-b7ab-a8fb82a354fc" + ], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.10.0-SNAPSHOT" + }, + "af4b5c07-506e-44c2-b2bb-2113d0c5b274": { + "type": "lens", + "gridData": { + "x": 0, + "y": 8, + "w": 6, + "h": 8, + "i": "af4b5c07-506e-44c2-b2bb-2113d0c5b274", + "row": 1 + }, + "explicitInput": { + "id": "af4b5c07-506e-44c2-b2bb-2113d0c5b274", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-ebfc4825-b7b6-4113-bd22-f1f07a4113e9" + }, + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-717129e0-2d11-4f22-abbb-a2c8a0f7ae0d" + } + ], + "state": { + "visualization": { + "layerId": "ebfc4825-b7b6-4113-bd22-f1f07a4113e9", + "layerType": "data", + "metricAccessor": "0e1418b8-3896-416c-8f78-9e832e5c42c8", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#ccd9ea", + "stop": 500 + }, + { + "color": "#98b5d5", + "stop": 1000 + }, + { + "color": "#6092c0", + "stop": 3662 + } + ], + "continuity": "above", + "maxSteps": 5, + "colorStops": [ + { + "color": "#ccd9ea", + "stop": 0 + }, + { + "color": "#98b5d5", + "stop": 500 + }, + { + "color": "#6092c0", + "stop": 1000 + } + ] + } + }, + "showBar": false, + "icon": "empty", + "trendlineLayerId": "717129e0-2d11-4f22-abbb-a2c8a0f7ae0d", + "trendlineLayerType": "metricTrendline", + "trendlineTimeAccessor": "6c3a5c8c-2e1f-4a51-9b15-39d2fac35c58", + "trendlineMetricAccessor": "cf34fce7-0017-472e-91c2-56f30a86d32b" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "ebfc4825-b7b6-4113-bd22-f1f07a4113e9": { + "columns": { + "0e1418b8-3896-416c-8f78-9e832e5c42c8": { + "label": "Total Visits", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "clientip", + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": ["0e1418b8-3896-416c-8f78-9e832e5c42c8"], + "incompleteColumns": {}, + "sampling": 1 + }, + "717129e0-2d11-4f22-abbb-a2c8a0f7ae0d": { + "linkToLayers": ["ebfc4825-b7b6-4113-bd22-f1f07a4113e9"], + "columns": { + "6c3a5c8c-2e1f-4a51-9b15-39d2fac35c58": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true, + "dropPartials": false + } + }, + "cf34fce7-0017-472e-91c2-56f30a86d32b": { + "label": "Total Visits", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "clientip", + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": [ + "6c3a5c8c-2e1f-4a51-9b15-39d2fac35c58", + "cf34fce7-0017-472e-91c2-56f30a86d32b" + ], + "sampling": 1, + "ignoreGlobalFilters": false, + "incompleteColumns": {} + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + "d42c4870-c028-4d8a-abd0-0effbc190ce3": { + "type": "lens", + "gridData": { + "x": 6, + "y": 8, + "w": 6, + "h": 8, + "i": "d42c4870-c028-4d8a-abd0-0effbc190ce3", + "row": 1 + }, + "explicitInput": { + "id": "d42c4870-c028-4d8a-abd0-0effbc190ce3", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-ebfc4825-b7b6-4113-bd22-f1f07a4113e9" + } + ], + "state": { + "visualization": { + "layerId": "ebfc4825-b7b6-4113-bd22-f1f07a4113e9", + "layerType": "data", + "metricAccessor": "0e1418b8-3896-416c-8f78-9e832e5c42c8", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#dee1e6", + "stop": 577.33 + }, + { + "color": "#b3b8c1", + "stop": 1154.66 + }, + { + "color": "#8c909d", + "stop": 1732 + } + ], + "continuity": "above", + "maxSteps": 5, + "colorStops": [ + { + "color": "#dee1e6", + "stop": 0 + }, + { + "color": "#b3b8c1", + "stop": 577.33 + }, + { + "color": "#8c909d", + "stop": 1154.66 + } + ] + } + }, + "showBar": false, + "icon": "empty" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "ebfc4825-b7b6-4113-bd22-f1f07a4113e9": { + "columns": { + "0e1418b8-3896-416c-8f78-9e832e5c42c8": { + "label": "Unique Visitors", + "dataType": "number", + "operationType": "unique_count", + "scale": "ratio", + "sourceField": "clientip", + "isBucketed": false, + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": ["0e1418b8-3896-416c-8f78-9e832e5c42c8"], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + "4092d42c-f93b-4c71-a6db-8f12abf12791": { + "type": "lens", + "gridData": { + "x": 12, + "y": 8, + "w": 6, + "h": 8, + "i": "4092d42c-f93b-4c71-a6db-8f12abf12791", + "row": 1 + }, + "explicitInput": { + "id": "4092d42c-f93b-4c71-a6db-8f12abf12791", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-ebfc4825-b7b6-4113-bd22-f1f07a4113e9" + } + ], + "state": { + "visualization": { + "layerId": "ebfc4825-b7b6-4113-bd22-f1f07a4113e9", + "layerType": "data", + "metricAccessor": "0e1418b8-3896-416c-8f78-9e832e5c42c8", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#dee1e6", + "stop": 88 + }, + { + "color": "#b3b8c1", + "stop": 176 + }, + { + "color": "#8c909d", + "stop": 264 + } + ], + "continuity": "above", + "maxSteps": 5, + "colorStops": [ + { + "color": "#dee1e6", + "stop": 0 + }, + { + "color": "#b3b8c1", + "stop": 88 + }, + { + "color": "#8c909d", + "stop": 176 + } + ] + } + }, + "showBar": false, + "icon": "mapMarker" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "ebfc4825-b7b6-4113-bd22-f1f07a4113e9": { + "columns": { + "0e1418b8-3896-416c-8f78-9e832e5c42c8": { + "label": "Unique Visitor Locations", + "dataType": "number", + "operationType": "unique_count", + "scale": "ratio", + "sourceField": "geo.dest", + "isBucketed": false, + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": ["0e1418b8-3896-416c-8f78-9e832e5c42c8"], + "incompleteColumns": {}, + "sampling": 1 + } + } + }, + "indexpattern": { + "layers": {} + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + + "15": { + "type": "lens", + "gridData": { + "x": 18, + "y": 0, + "w": 30, + "h": 15, + "i": "15", + "row": 2 + }, + "explicitInput": { + "id": "15", + "title": "[Logs] Response Codes Over Time + Annotations", + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "hidePanelTitles": false, + "syncColors": false, + "syncCursor": true, + "syncTooltips": false, + "searchSessionId": "c35ac8a2-8ced-403c-8d3d-81e07e633c44", + "filters": [], + "query": { + "query": "", + "language": "kuery" + }, + "attributes": { + "title": "[Logs] Response Codes Over Time + Annotations (converted)", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-b38fe501-4b47-4de8-a423-6656d1162174" + }, + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "xy-visualization-layer-f265e722-ae38-495c-903c-48aa7931fa82" + } + ], + "state": { + "visualization": { + "legend": { + "isVisible": true, + "showSingleSeries": true, + "position": "bottom", + "shouldTruncate": true, + "maxLines": 1 + }, + "valueLabels": "hide", + "fittingFunction": "None", + "fillOpacity": 0.5, + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "full" + }, + "yLeftScale": "linear", + "yRightScale": "linear", + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "bar_stacked", + "layers": [ + { + "seriesType": "area_percentage_stacked", + "layerType": "data", + "layerId": "b38fe501-4b47-4de8-a423-6656d1162174", + "accessors": ["896c5eb2-81c5-44f1-a4a1-57344161ea62"], + "yConfig": [ + { + "forAccessor": "896c5eb2-81c5-44f1-a4a1-57344161ea62", + "color": "rgba(115,216,255,1)", + "axisMode": "left" + } + ], + "xAccessor": "8986e393-d24f-49b0-96ca-118fd66d75e5", + "splitAccessor": "43f5bb0f-c6da-43a0-8a0a-50e9838ed34b", + "palette": { + "name": "default", + "type": "palette" + }, + "colorMapping": { + "assignments": [], + "specialAssignments": [ + { + "rule": { + "type": "other" + }, + "color": { + "type": "loop" + }, + "touched": false + } + ], + "paletteId": "eui_amsterdam_color_blind", + "colorMode": { + "type": "categorical" + } + } + }, + { + "layerId": "f265e722-ae38-495c-903c-48aa7931fa82", + "layerType": "annotations", + "ignoreGlobalFilters": true, + "annotations": [ + { + "type": "query", + "id": "bd7548a0-2223-11e8-832f-d5027f3c8a47", + "label": "Event", + "key": { + "type": "point_in_time" + }, + "color": "#D33115", + "timeField": "timestamp", + "icon": "asterisk", + "filter": { + "type": "kibana_query", + "query": "tags:error AND tags:security", + "language": "lucene" + }, + "extraFields": ["geo.src"] + } + ], + "indexPatternId": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "b38fe501-4b47-4de8-a423-6656d1162174": { + "columns": { + "8986e393-d24f-49b0-96ca-118fd66d75e5": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true, + "dropPartials": false + } + }, + "43f5bb0f-c6da-43a0-8a0a-50e9838ed34b": { + "label": "Filters", + "dataType": "string", + "operationType": "filters", + "scale": "ordinal", + "isBucketed": true, + "params": { + "filters": [ + { + "input": { + "query": "response.keyword >= 200 and response.keyword < 400", + "language": "kuery" + }, + "label": "HTTP 2xx and 3xx" + }, + { + "input": { + "query": "response.keyword >= 400 and response.keyword < 500", + "language": "kuery" + }, + "label": "HTTP 4xx" + }, + { + "input": { + "query": "response.keyword >= 500", + "language": "kuery" + }, + "label": "HTTP 5xx" + } + ] + } + }, + "896c5eb2-81c5-44f1-a4a1-57344161ea62": { + "label": "Response Code Count", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": [ + "8986e393-d24f-49b0-96ca-118fd66d75e5", + "43f5bb0f-c6da-43a0-8a0a-50e9838ed34b", + "896c5eb2-81c5-44f1-a4a1-57344161ea62" + ], + "incompleteColumns": {}, + "indexPatternId": "90943e30-9a47-11e8-b64d-95841ca0b247" + } + }, + "currentIndexPatternId": "90943e30-9a47-11e8-b64d-95841ca0b247" + }, + "textBased": { + "layers": {}, + "indexPatternRefs": [ + { + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "title": "kibana_sample_data_logs", + "timeField": "timestamp" + } + ] + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + } + } + }, + "4e64d6d7-4f92-4d5e-abbb-13796604db30": { + "type": "visualization", + "gridData": { + "x": 0, + "y": 0, + "w": 18, + "h": 8, + "i": "4e64d6d7-4f92-4d5e-abbb-13796604db30", + "row": 2 + }, + "explicitInput": { + "id": "4e64d6d7-4f92-4d5e-abbb-13796604db30v", + "savedVis": { + "title": "[Logs] Markdown Instructions", + "description": "", + "type": "markdown", + "params": { + "fontSize": 12, + "openLinksInNewTab": true, + "markdown": "#### Sample Logs Data\n### Response Codes\nThis dashboard uses the `[Logs]` sample data for you to play with and includes visualizations related to the response codes of the sample requests. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)." + }, + "uiState": {}, + "data": { + "aggs": [], + "searchSource": { + "query": { + "query": "", + "language": "kuery" + }, + "filter": [] + } + } + }, + "enhancements": {}, + "hidePanelTitles": true + }, + "version": "8.10.0-SNAPSHOT" + }, + "ddce4ad8-6a82-44f0-9995-57f46f153f50": { + "type": "lens", + "gridData": { + "x": 0, + "y": 8, + "w": 6, + "h": 7, + "i": "ddce4ad8-6a82-44f0-9995-57f46f153f50", + "row": 2 + }, + "explicitInput": { + "id": "ddce4ad8-6a82-44f0-9995-57f46f153f50", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a" + } + ], + "state": { + "visualization": { + "layerId": "f3793bb7-3971-4753-866d-4008e77a9f9a", + "layerType": "data", + "metricAccessor": "71c076a6-e782-4866-b8df-5fd85a41f08b", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#dfdfdf", + "stop": 0.25 + }, + { + "color": "#c9f0e5", + "stop": 0.5 + }, + { + "color": "#99dcca", + "stop": 0.75 + }, + { + "color": "#54B399", + "stop": 1 + }, + { + "color": "#36967c", + "stop": 1.8423645320197044 + } + ], + "colorStops": [ + { + "color": "#dfdfdf", + "stop": 0 + }, + { + "color": "#c9f0e5", + "stop": 0.25 + }, + { + "color": "#99dcca", + "stop": 0.5 + }, + { + "color": "#54B399", + "stop": 0.75 + }, + { + "color": "#36967c", + "stop": 1 + } + ], + "continuity": "above", + "maxSteps": 5 + } + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "f3793bb7-3971-4753-866d-4008e77a9f9a": { + "columns": { + "71c076a6-e782-4866-b8df-5fd85a41f08bX0": { + "label": "Part of HTTP 2xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "response.keyword >= 200 and response.keyword < 300", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX1": { + "label": "Part of HTTP 2xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX2": { + "label": "Part of HTTP 2xx", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "location": { + "min": 0, + "max": 73 + }, + "text": "count(kql='response.keyword >= 200 and response.keyword < 300') / count()" + } + }, + "references": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08b": { + "label": "HTTP 2xx", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='response.keyword >= 200 and response.keyword < 300') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 2, + "compact": true + } + } + }, + "references": ["71c076a6-e782-4866-b8df-5fd85a41f08bX2"], + "customLabel": true + } + }, + "columnOrder": [ + "71c076a6-e782-4866-b8df-5fd85a41f08b", + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1", + "71c076a6-e782-4866-b8df-5fd85a41f08bX2" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + "a2884704-db3b-4b92-a19a-cdfe668dec39": { + "type": "lens", + "gridData": { + "x": 6, + "y": 8, + "w": 6, + "h": 7, + "i": "a2884704-db3b-4b92-a19a-cdfe668dec39", + "row": 2 + }, + "explicitInput": { + "id": "a2884704-db3b-4b92-a19a-cdfe668dec39", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a" + } + ], + "state": { + "visualization": { + "layerId": "f3793bb7-3971-4753-866d-4008e77a9f9a", + "layerType": "data", + "metricAccessor": "71c076a6-e782-4866-b8df-5fd85a41f08b", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#ffe4ed", + "stop": 0.05 + }, + { + "color": "#f0b1c6", + "stop": 0.1 + }, + { + "color": "#e187a5", + "stop": 0.5 + }, + { + "color": "#D36086", + "stop": 0.9 + }, + { + "color": "#b1315b", + "stop": 1.9 + } + ], + "colorStops": [ + { + "color": "#ffe4ed", + "stop": 0 + }, + { + "color": "#f0b1c6", + "stop": 0.05 + }, + { + "color": "#e187a5", + "stop": 0.1 + }, + { + "color": "#D36086", + "stop": 0.5 + }, + { + "color": "#b1315b", + "stop": 0.9 + } + ], + "continuity": "above", + "maxSteps": 5 + } + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "f3793bb7-3971-4753-866d-4008e77a9f9a": { + "columns": { + "71c076a6-e782-4866-b8df-5fd85a41f08bX0": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "response.keyword >= 400 and response.keyword < 500", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX1": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX2": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "location": { + "min": 0, + "max": 73 + }, + "text": "count(kql='response.keyword >= 400 and response.keyword < 500') / count()" + } + }, + "references": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08b": { + "label": "HTTP 4xx", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='response.keyword >= 400 and response.keyword < 500') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 2, + "compact": true + } + } + }, + "references": ["71c076a6-e782-4866-b8df-5fd85a41f08bX2"], + "customLabel": true + } + }, + "columnOrder": [ + "71c076a6-e782-4866-b8df-5fd85a41f08b", + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1", + "71c076a6-e782-4866-b8df-5fd85a41f08bX2" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + "529eec49-10e2-4a40-9c77-5c81f4eb3943": { + "type": "lens", + "gridData": { + "x": 12, + "y": 8, + "w": 6, + "h": 7, + "i": "529eec49-10e2-4a40-9c77-5c81f4eb3943", + "row": 2 + }, + "explicitInput": { + "id": "529eec49-10e2-4a40-9c77-5c81f4eb3943", + "title": "", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a" + } + ], + "state": { + "visualization": { + "layerId": "f3793bb7-3971-4753-866d-4008e77a9f9a", + "layerType": "data", + "metricAccessor": "71c076a6-e782-4866-b8df-5fd85a41f08b", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 3, + "name": "custom", + "reverse": false, + "rangeType": "number", + "rangeMin": 0, + "rangeMax": null, + "progression": "fixed", + "stops": [ + { + "color": "#ffe4ed", + "stop": 0.05 + }, + { + "color": "#f0b1c6", + "stop": 0.1 + }, + { + "color": "#e187a5", + "stop": 0.5 + }, + { + "color": "#D36086", + "stop": 0.9 + }, + { + "color": "#b1315b", + "stop": 1.9 + } + ], + "colorStops": [ + { + "color": "#ffe4ed", + "stop": 0 + }, + { + "color": "#f0b1c6", + "stop": 0.05 + }, + { + "color": "#e187a5", + "stop": 0.1 + }, + { + "color": "#D36086", + "stop": 0.5 + }, + { + "color": "#b1315b", + "stop": 0.9 + } + ], + "continuity": "above", + "maxSteps": 5 + } + } + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "f3793bb7-3971-4753-866d-4008e77a9f9a": { + "columns": { + "71c076a6-e782-4866-b8df-5fd85a41f08bX0": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "response.keyword >= 500 and response.keyword < 600", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX1": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08bX2": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "location": { + "min": 0, + "max": 73 + }, + "text": "count(kql='response.keyword >= 500 and response.keyword < 600') / count()" + } + }, + "references": [ + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1" + ], + "customLabel": true + }, + "71c076a6-e782-4866-b8df-5fd85a41f08b": { + "label": "HTTP 5xx", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='response.keyword >= 500 and response.keyword < 600') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 2, + "compact": true + } + } + }, + "references": ["71c076a6-e782-4866-b8df-5fd85a41f08bX2"], + "customLabel": true + } + }, + "columnOrder": [ + "71c076a6-e782-4866-b8df-5fd85a41f08b", + "71c076a6-e782-4866-b8df-5fd85a41f08bX0", + "71c076a6-e782-4866-b8df-5fd85a41f08bX1", + "71c076a6-e782-4866-b8df-5fd85a41f08bX2" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.10.0-SNAPSHOT" + }, + "1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b": { + "type": "lens", + "gridData": { + "x": 0, + "y": 15, + "w": 48, + "h": 12, + "i": "1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b", + "row": 2 + }, + "explicitInput": { + "id": "1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b", + "title": "[Logs] Errors by host", + "attributes": { + "title": "", + "description": "", + "visualizationType": "lnsDatatable", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "90943e30-9a47-11e8-b64d-95841ca0b247", + "name": "indexpattern-datasource-layer-c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0" + } + ], + "state": { + "visualization": { + "layerId": "c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0", + "columns": [ + { + "columnId": "42783ad7-dbcf-4310-bc06-f21f4eaaac96", + "width": 650.6666666666666 + }, + { + "columnId": "f7835375-4d5b-4839-95ea-41928192a319" + }, + { + "columnId": "491285fd-0196-402c-9b7f-4660fdc1c22a", + "isTransposed": false, + "width": 81.66666666666669, + "colorMode": "cell", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#FFDAE6", + "stop": 0.1 + }, + { + "color": "#D36086", + "stop": 1 + } + ], + "rangeType": "number", + "name": "custom", + "colorStops": [ + { + "color": "#FFDAE6", + "stop": 0.05 + }, + { + "color": "#D36086", + "stop": 0.1 + } + ], + "rangeMin": 0.05, + "rangeMax": null, + "continuity": "above" + } + } + }, + { + "columnId": "07fc84ca-4147-4ba9-879e-d1b4e086e1da", + "isTransposed": false, + "colorMode": "cell", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#ffdae6", + "stop": 0.1 + }, + { + "color": "#D36086", + "stop": 1 + } + ], + "name": "custom", + "colorStops": [ + { + "color": "#ffdae6", + "stop": 0.05 + }, + { + "color": "#D36086", + "stop": 0.1 + } + ], + "rangeType": "number", + "rangeMin": 0.05, + "rangeMax": null, + "continuity": "above" + } + } + }, + { + "columnId": "791d5a5b-a7ba-4e9e-b533-51b33c7d7747", + "isTransposed": false + }, + { + "columnId": "611e3509-e834-4fdd-b573-44e959e95d27", + "isTransposed": false + }, + { + "columnId": "9f79ecca-123f-4098-a658-6b0e998da003", + "isTransposed": false + } + ], + "sorting": { + "columnId": "491285fd-0196-402c-9b7f-4660fdc1c22a", + "direction": "desc" + }, + "layerType": "data", + "rowHeight": "single", + "rowHeightLines": 1 + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0": { + "columns": { + "42783ad7-dbcf-4310-bc06-f21f4eaaac96": { + "label": "URL", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "url.keyword", + "isBucketed": true, + "params": { + "size": 1000, + "orderBy": { + "type": "column", + "columnId": "f7835375-4d5b-4839-95ea-41928192a319" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false + }, + "customLabel": true + }, + "f7835375-4d5b-4839-95ea-41928192a319": { + "label": "Visits", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX0": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "response.keyword >= 400 and response.keyword < 500", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX1": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX2": { + "label": "Part of HTTP 4xx", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX0", + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX1" + ], + "location": { + "min": 0, + "max": 73 + }, + "text": "count(kql='response.keyword >= 400 and response.keyword < 500') / count()" + } + }, + "references": [ + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX0", + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX1" + ], + "customLabel": true + }, + "07fc84ca-4147-4ba9-879e-d1b4e086e1da": { + "label": "HTTP 4xx", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='response.keyword >= 400 and response.keyword < 500') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1 + } + } + }, + "references": ["07fc84ca-4147-4ba9-879e-d1b4e086e1daX2"], + "customLabel": true + }, + "791d5a5b-a7ba-4e9e-b533-51b33c7d7747": { + "label": "Unique", + "dataType": "number", + "operationType": "unique_count", + "scale": "ratio", + "sourceField": "clientip", + "isBucketed": false, + "customLabel": true + }, + "611e3509-e834-4fdd-b573-44e959e95d27": { + "label": "95th percentile of bytes", + "dataType": "number", + "operationType": "percentile", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "percentile": 95, + "format": { + "id": "bytes", + "params": { + "decimals": 0 + } + } + } + }, + "9f79ecca-123f-4098-a658-6b0e998da003": { + "label": "Median of bytes", + "dataType": "number", + "operationType": "median", + "sourceField": "bytes", + "isBucketed": false, + "scale": "ratio", + "params": { + "format": { + "id": "bytes", + "params": { + "decimals": 0 + } + } + } + }, + "491285fd-0196-402c-9b7f-4660fdc1c22aX0": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "response.keyword >= 500", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "491285fd-0196-402c-9b7f-4660fdc1c22aX1": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "491285fd-0196-402c-9b7f-4660fdc1c22aX2": { + "label": "Part of HTTP 5xx", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "491285fd-0196-402c-9b7f-4660fdc1c22aX0", + "491285fd-0196-402c-9b7f-4660fdc1c22aX1" + ], + "location": { + "min": 0, + "max": 46 + }, + "text": "count(kql='response.keyword >= 500') / count()" + } + }, + "references": [ + "491285fd-0196-402c-9b7f-4660fdc1c22aX0", + "491285fd-0196-402c-9b7f-4660fdc1c22aX1" + ], + "customLabel": true + }, + "491285fd-0196-402c-9b7f-4660fdc1c22a": { + "label": "HTTP 5xx", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='response.keyword >= 500') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1 + } + } + }, + "references": ["491285fd-0196-402c-9b7f-4660fdc1c22aX2"], + "customLabel": true + } + }, + "columnOrder": [ + "42783ad7-dbcf-4310-bc06-f21f4eaaac96", + "f7835375-4d5b-4839-95ea-41928192a319", + "791d5a5b-a7ba-4e9e-b533-51b33c7d7747", + "07fc84ca-4147-4ba9-879e-d1b4e086e1da", + "491285fd-0196-402c-9b7f-4660fdc1c22a", + "491285fd-0196-402c-9b7f-4660fdc1c22aX0", + "491285fd-0196-402c-9b7f-4660fdc1c22aX1", + "491285fd-0196-402c-9b7f-4660fdc1c22aX2", + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX0", + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX1", + "07fc84ca-4147-4ba9-879e-d1b4e086e1daX2", + "611e3509-e834-4fdd-b573-44e959e95d27", + "9f79ecca-123f-4098-a658-6b0e998da003" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": { + "dynamicActions": { + "events": [] + } + }, + "hidePanelTitles": false + }, + "version": "8.10.0-SNAPSHOT" + }, + + "9f79ecca-123f-4098-a658-6b0e998da003": { + "type": "search", + "gridData": { + "x": 0, + "y": 69, + "w": 48, + "h": 15, + "i": "9f79ecca-123f-4098-a658-6b0e998da003", + "row": 3 + }, + "explicitInput": { + "id": "9f79ecca-123f-4098-a658-6b0e998da003", + "savedObjectId": "571aaf70-4c88-11e8-b3d7-01146121b73d", + "enhancements": {} + }, + "version": "8.8.0" + }, + "7": { + "type": "lens", + "gridData": { + "x": 0, + "y": 16, + "w": 24, + "h": 9, + "i": "7", + "row": 3 + }, + "explicitInput": { + "id": "7", + "title": "[Flights] Delays & Cancellations", + "attributes": { + "title": "[Flights] Delays & Cancellations (converted)", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce" + }, + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "xy-visualization-layer-10fed425-accd-411b-a773-ee825bc3945b" + } + ], + "state": { + "visualization": { + "legend": { + "isVisible": false, + "showSingleSeries": false, + "position": "bottom", + "shouldTruncate": true, + "maxLines": 1 + }, + "valueLabels": "hide", + "fittingFunction": "None", + "fillOpacity": 0.5, + "yLeftExtent": { + "upperBound": 1, + "mode": "custom" + }, + "yRightExtent": { + "mode": "full" + }, + "yLeftScale": "linear", + "yRightScale": "linear", + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": 0 + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "bar_stacked", + "layers": [ + { + "seriesType": "area", + "layerType": "data", + "layerId": "dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce", + "accessors": ["b9d6187b-8a7e-4c49-bffd-7a60cc075a4a"], + "yConfig": [ + { + "forAccessor": "b9d6187b-8a7e-4c49-bffd-7a60cc075a4a", + "color": "rgba(0,156,224,1)", + "axisMode": "left" + } + ], + "xAccessor": "6944431b-f90a-4dab-a282-0961cb97edd1", + "palette": { + "name": "default", + "type": "palette" + } + }, + { + "layerId": "10fed425-accd-411b-a773-ee825bc3945b", + "layerType": "annotations", + "ignoreGlobalFilters": true, + "annotations": [ + { + "type": "query", + "id": "53b7dff0-4c89-11e8-a66a-6989ad5a0a39", + "label": "Event", + "key": { + "type": "point_in_time" + }, + "timeField": "timestamp", + "color": "#0062B1", + "icon": "alert", + "filter": { + "type": "kibana_query", + "query": "FlightDelay:true AND Cancelled:true", + "language": "lucene" + }, + "extraFields": ["FlightDelay", "Cancelled", "Carrier"] + } + ] + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce": { + "columns": { + "6944431b-f90a-4dab-a282-0961cb97edd1": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true, + "dropPartials": false + } + }, + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0": { + "label": "Part of count(lucene='FlightDelay:true') / count(kql='*')", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "FlightDelay:true", + "language": "lucene" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1": { + "label": "Part of count(lucene='FlightDelay:true') / count(kql='*')", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "*", + "language": "kuery" + }, + "params": { + "emptyAsNull": false + }, + "customLabel": true + }, + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2": { + "label": "Part of count(lucene='FlightDelay:true') / count(kql='*')", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1" + ], + "location": { + "min": 0, + "max": 49 + }, + "text": "count(lucene='FlightDelay:true') / count(kql='*')" + } + }, + "references": [ + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1" + ], + "customLabel": true + }, + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4a": { + "label": "Percent Delays", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "format": { + "id": "percent" + }, + "formula": "count(lucene='FlightDelay:true') / count(kql='*')", + "isFormulaBroken": false + }, + "references": ["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2"], + "customLabel": true + } + }, + "columnOrder": [ + "6944431b-f90a-4dab-a282-0961cb97edd1", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2", + "b9d6187b-8a7e-4c49-bffd-7a60cc075a4a" + ], + "incompleteColumns": {} + } + } + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.9.0" + }, + "10": { + "type": "lens", + "gridData": { + "x": 0, + "y": 58, + "w": 24, + "h": 11, + "i": "10", + "row": 3 + }, + "explicitInput": { + "id": "10", + "title": "[Flights] Delay Buckets", + "attributes": { + "title": "[Flights] Delay Buckets (converted)", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-247b176d-e81d-47dc-bbd1-4de85d098961" + }, + { + "type": "index-pattern", + "name": "c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d" + } + ], + "state": { + "visualization": { + "legend": { + "isVisible": false, + "position": "right", + "legendSize": "auto", + "shouldTruncate": true, + "maxLines": 1, + "showSingleSeries": true + }, + "valueLabels": "hide", + "curveType": "LINEAR", + "yTitle": "Count", + "yLeftExtent": { + "mode": "full", + "enforce": true + }, + "yLeftScale": "linear", + "yRightScale": "linear", + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "labelsOrientation": { + "x": 0, + "yLeft": 0, + "yRight": -90 + }, + "gridlinesVisibilitySettings": { + "x": false, + "yLeft": false, + "yRight": true + }, + "preferredSeriesType": "bar_stacked", + "layers": [ + { + "layerId": "247b176d-e81d-47dc-bbd1-4de85d098961", + "accessors": ["c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da"], + "layerType": "data", + "seriesType": "bar_stacked", + "xAccessor": "c7936be7-e59b-424e-a912-69ba820d8e24", + "simpleView": false, + "palette": { + "type": "palette", + "name": "default" + }, + "yConfig": [ + { + "forAccessor": "c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da", + "axisMode": "left", + "color": "#1F78C1" + } + ], + "xScaleType": "linear", + "isHistogram": true + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [ + { + "meta": { + "negate": true, + "disabled": false, + "alias": null, + "type": "phrase", + "key": "FlightDelayMin", + "value": "0", + "params": { + "query": 0, + "type": "phrase" + }, + "index": "c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a" + }, + "query": { + "match": { + "FlightDelayMin": { + "query": 0, + "type": "phrase" + } + } + }, + "$state": { + "store": "appState" + } + } + ], + "datasourceStates": { + "formBased": { + "layers": { + "247b176d-e81d-47dc-bbd1-4de85d098961": { + "columns": { + "c7936be7-e59b-424e-a912-69ba820d8e24": { + "label": "Flight Delay Minutes", + "dataType": "number", + "operationType": "range", + "sourceField": "FlightDelayMin", + "isBucketed": true, + "scale": "interval", + "params": { + "includeEmptyRows": false, + "type": "histogram", + "ranges": [ + { + "from": 0, + "to": 1000, + "label": "" + } + ], + "maxBars": "auto" + }, + "customLabel": true + }, + "c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da": { + "label": "Count", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": true + }, + "customLabel": true + } + }, + "columnOrder": [ + "c7936be7-e59b-424e-a912-69ba820d8e24", + "c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da" + ], + "incompleteColumns": {} + } + } + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.9.0" + }, + "23": { + "type": "map", + "gridData": { + "x": 0, + "y": 36, + "w": 24, + "h": 22, + "i": "23", + "row": 3 + }, + "explicitInput": { + "id": "23", + "savedObjectId": "5dd88580-1906-11e9-919b-ffe5949a18d2", + "isLayerTOCOpen": true, + "hiddenLayers": [], + "mapCenter": { + "lat": 48.72307, + "lon": -115.18171, + "zoom": 4.28 + }, + "openTOCDetails": [], + "enhancements": {} + }, + "version": "8.8.0" + }, + "31": { + "type": "visualization", + "gridData": { + "x": 24, + "y": 36, + "w": 24, + "h": 22, + "i": "31", + "row": 3 + }, + "explicitInput": { + "id": "31", + "savedObjectId": "ed78a660-53a0-11e8-acbd-0be0ad9d822b", + "enhancements": {} + }, + "version": "8.8.0" + }, + "6afc61f7-e2d5-45a3-9e7a-281160ad3eb9": { + "type": "visualization", + "gridData": { + "x": 0, + "y": 0, + "w": 24, + "h": 8, + "i": "6afc61f7-e2d5-45a3-9e7a-281160ad3eb9", + "row": 3 + }, + "explicitInput": { + "id": "6afc61f7-e2d5-45a3-9e7a-281160ad3eb9", + "savedVis": { + "title": "[Flights] Markdown Instructions", + "description": "", + "type": "markdown", + "params": { + "fontSize": 10, + "openLinksInNewTab": true, + "markdown": "## Sample Flight data\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)." + }, + "uiState": {}, + "data": { + "aggs": [], + "searchSource": {} + } + }, + "hidePanelTitles": true, + "enhancements": {} + }, + "version": "8.9.0" + }, + "392b4936-f753-47bc-a98d-a4e41a0a4cd4": { + "type": "lens", + "gridData": { + "x": 24, + "y": 0, + "w": 8, + "h": 8, + "i": "392b4936-f753-47bc-a98d-a4e41a0a4cd4", + "row": 3 + }, + "explicitInput": { + "id": "392b4936-f753-47bc-a98d-a4e41a0a4cd4", + "enhancements": {}, + "attributes": { + "title": "[Flights] Total Flights", + "description": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-8fa993db-c147-4954-adf7-4ff264d42576" + } + ], + "state": { + "visualization": { + "layerId": "8fa993db-c147-4954-adf7-4ff264d42576", + "layerType": "data", + "metricAccessor": "81124c45-6ab6-42f4-8859-495d55eb8065" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "8fa993db-c147-4954-adf7-4ff264d42576": { + "columns": { + "81124c45-6ab6-42f4-8859-495d55eb8065": { + "label": "Total flights", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + } + }, + "columnOrder": ["81124c45-6ab6-42f4-8859-495d55eb8065"], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "hidePanelTitles": true + }, + "version": "8.9.0" + }, + "9271deff-5a61-4665-83fc-f9fdc6bf0c0b": { + "type": "lens", + "gridData": { + "x": 32, + "y": 0, + "w": 8, + "h": 4, + "i": "9271deff-5a61-4665-83fc-f9fdc6bf0c0b", + "row": 3 + }, + "explicitInput": { + "id": "9271deff-5a61-4665-83fc-f9fdc6bf0c0b", + "attributes": { + "title": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317" + } + ], + "state": { + "visualization": { + "layerId": "b4712d43-1e84-4f5b-878d-8e38ba748317", + "layerType": "data", + "metricAccessor": "7e8fe9b1-f45c-4f3d-9561-30febcd357ec" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "b4712d43-1e84-4f5b-878d-8e38ba748317": { + "columns": { + "7e8fe9b1-f45c-4f3d-9561-30febcd357ec": { + "label": "Delayed", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='FlightDelay : true') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1, + "compact": true + } + } + }, + "references": ["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"], + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0": { + "label": "Part of count(kql='FlightDelay : true') / count()", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "FlightDelay : true", + "language": "kuery" + }, + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1": { + "label": "Part of count(kql='FlightDelay : true') / count()", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2": { + "label": "Part of count(kql='FlightDelay : true') / count()", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1" + ], + "location": { + "min": 0, + "max": 41 + }, + "text": "count(kql='FlightDelay : true') / count()" + } + }, + "references": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1" + ], + "customLabel": true + } + }, + "columnOrder": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ec", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.9.0" + }, + "aa591c29-1a31-4ee1-a71d-b829c06fd162": { + "type": "lens", + "gridData": { + "x": 40, + "y": 0, + "w": 8, + "h": 4, + "i": "aa591c29-1a31-4ee1-a71d-b829c06fd162", + "row": 3 + }, + "explicitInput": { + "id": "aa591c29-1a31-4ee1-a71d-b829c06fd162", + "attributes": { + "title": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317" + }, + { + "type": "index-pattern", + "name": "c804c161-375f-4d52-a1cc-2e98b966957d", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d" + } + ], + "state": { + "visualization": { + "layerId": "b4712d43-1e84-4f5b-878d-8e38ba748317", + "layerType": "data", + "metricAccessor": "c7851241-5526-499a-960b-357af8c2ce5b" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [ + { + "meta": { + "alias": null, + "negate": false, + "disabled": false, + "type": "phrase", + "key": "FlightDelay", + "params": { + "query": true + }, + "index": "c804c161-375f-4d52-a1cc-2e98b966957d" + }, + "query": { + "match_phrase": { + "FlightDelay": true + } + }, + "$state": { + "store": "appState" + } + } + ], + "datasourceStates": { + "formBased": { + "layers": { + "b4712d43-1e84-4f5b-878d-8e38ba748317": { + "columns": { + "c7851241-5526-499a-960b-357af8c2ce5b": { + "label": "Delayed vs 1 week earlier", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count() / count(shift='1w') - 1", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1, + "compact": true + } + } + }, + "references": ["c7851241-5526-499a-960b-357af8c2ce5bX2"], + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX2": { + "label": "Part of Delayed", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "subtract", + "args": [ + { + "type": "function", + "name": "divide", + "args": [ + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "location": { + "min": 0, + "max": 28 + }, + "text": "count() / count(shift='1w') " + }, + 1 + ], + "location": { + "min": 0, + "max": 31 + }, + "text": "count() / count(shift='1w') - 1" + } + }, + "references": [ + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX0": { + "label": "Part of Delayed", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX1": { + "label": "Part of Delayed", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "timeShift": "1w", + "customLabel": true + } + }, + "columnOrder": [ + "c7851241-5526-499a-960b-357af8c2ce5b", + "c7851241-5526-499a-960b-357af8c2ce5bX2", + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.9.0" + }, + "b766e3b8-4544-46ed-99e6-9ecc4847e2a2": { + "type": "lens", + "gridData": { + "x": 32, + "y": 4, + "w": 8, + "h": 4, + "i": "b766e3b8-4544-46ed-99e6-9ecc4847e2a2", + "row": 3 + }, + "explicitInput": { + "id": "b766e3b8-4544-46ed-99e6-9ecc4847e2a2", + "attributes": { + "title": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317" + } + ], + "state": { + "visualization": { + "layerId": "b4712d43-1e84-4f5b-878d-8e38ba748317", + "layerType": "data", + "metricAccessor": "7e8fe9b1-f45c-4f3d-9561-30febcd357ec" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "b4712d43-1e84-4f5b-878d-8e38ba748317": { + "columns": { + "7e8fe9b1-f45c-4f3d-9561-30febcd357ec": { + "label": "Cancelled", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='Cancelled : true') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1, + "compact": true + } + } + }, + "references": ["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"], + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0": { + "label": "Part of Cancelled", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "Cancelled : true", + "language": "kuery" + }, + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1": { + "label": "Part of Cancelled", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2": { + "label": "Part of Cancelled", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1" + ], + "location": { + "min": 0, + "max": 39 + }, + "text": "count(kql='Cancelled : true') / count()" + } + }, + "references": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1" + ], + "customLabel": true + } + }, + "columnOrder": [ + "7e8fe9b1-f45c-4f3d-9561-30febcd357ec", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1", + "7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.9.0" + }, + "2e33ade5-96e5-40b4-b460-493e5d4fa834": { + "type": "lens", + "gridData": { + "x": 40, + "y": 4, + "w": 8, + "h": 4, + "i": "2e33ade5-96e5-40b4-b460-493e5d4fa834", + "row": 3 + }, + "explicitInput": { + "id": "2e33ade5-96e5-40b4-b460-493e5d4fa834", + "attributes": { + "title": "", + "visualizationType": "lnsMetric", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317" + }, + { + "type": "index-pattern", + "name": "14cea722-a629-4c69-a06d-94a4a4c9a718", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d" + } + ], + "state": { + "visualization": { + "layerId": "b4712d43-1e84-4f5b-878d-8e38ba748317", + "layerType": "data", + "metricAccessor": "c7851241-5526-499a-960b-357af8c2ce5b" + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [ + { + "meta": { + "alias": null, + "negate": false, + "disabled": false, + "type": "phrase", + "key": "Cancelled", + "params": { + "query": true + }, + "index": "14cea722-a629-4c69-a06d-94a4a4c9a718" + }, + "query": { + "match_phrase": { + "Cancelled": true + } + }, + "$state": { + "store": "appState" + } + } + ], + "datasourceStates": { + "formBased": { + "layers": { + "b4712d43-1e84-4f5b-878d-8e38ba748317": { + "columns": { + "c7851241-5526-499a-960b-357af8c2ce5b": { + "label": "Cancelled vs 1 week earlier", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count() / count(shift='1w') - 1", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 1, + "compact": true + } + } + }, + "references": ["c7851241-5526-499a-960b-357af8c2ce5bX2"], + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX2": { + "label": "Part of Delayed vs 1 week earlier", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "subtract", + "args": [ + { + "type": "function", + "name": "divide", + "args": [ + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "location": { + "min": 0, + "max": 28 + }, + "text": "count() / count(shift='1w') " + }, + 1 + ], + "location": { + "min": 0, + "max": 31 + }, + "text": "count() / count(shift='1w') - 1" + } + }, + "references": [ + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX0": { + "label": "Part of Delayed vs 1 week earlier", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "c7851241-5526-499a-960b-357af8c2ce5bX1": { + "label": "Part of Delayed vs 1 week earlier", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "timeShift": "1w", + "customLabel": true + } + }, + "columnOrder": [ + "c7851241-5526-499a-960b-357af8c2ce5b", + "c7851241-5526-499a-960b-357af8c2ce5bX2", + "c7851241-5526-499a-960b-357af8c2ce5bX0", + "c7851241-5526-499a-960b-357af8c2ce5bX1" + ], + "incompleteColumns": {} + } + } + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.9.0" + }, + "086ac2e9-dd16-4b45-92b8-1e43ff7e3f65": { + "type": "lens", + "gridData": { + "x": 0, + "y": 8, + "w": 24, + "h": 8, + "i": "086ac2e9-dd16-4b45-92b8-1e43ff7e3f65", + "row": 3 + }, + "explicitInput": { + "id": "086ac2e9-dd16-4b45-92b8-1e43ff7e3f65", + "title": "[Flights] Flight count", + "attributes": { + "title": "", + "type": "lens", + "visualizationType": "lnsXY", + "state": { + "datasourceStates": { + "formBased": { + "layers": { + "03c34665-471c-49c7-acf1-5a11f517421c": { + "columns": { + "a5b94e30-4e77-4b0a-9187-1d8b13de1456": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true + } + }, + "3e267327-7317-4310-aee3-320e0f7c1e70": { + "label": "Count of records", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "columnOrder": [ + "a5b94e30-4e77-4b0a-9187-1d8b13de1456", + "3e267327-7317-4310-aee3-320e0f7c1e70" + ], + "incompleteColumns": {} + } + } + } + }, + "visualization": { + "legend": { + "isVisible": true, + "position": "right", + "legendSize": "auto" + }, + "valueLabels": "hide", + "fittingFunction": "None", + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "custom", + "lowerBound": 0, + "upperBound": 1 + }, + "axisTitlesVisibilitySettings": { + "x": false, + "yLeft": false, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "bar_stacked", + "layers": [ + { + "layerId": "03c34665-471c-49c7-acf1-5a11f517421c", + "accessors": ["3e267327-7317-4310-aee3-320e0f7c1e70"], + "position": "top", + "seriesType": "bar_stacked", + "showGridlines": false, + "xAccessor": "a5b94e30-4e77-4b0a-9187-1d8b13de1456", + "layerType": "data" + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [] + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-03c34665-471c-49c7-acf1-5a11f517421c", + "type": "index-pattern" + } + ] + }, + "hidePanelTitles": false, + "enhancements": {} + }, + "version": "8.9.0" + }, + "fb86b32f-fb7a-45cf-9511-f366fef51bbd": { + "type": "lens", + "gridData": { + "x": 24, + "y": 8, + "w": 24, + "h": 28, + "i": "fb86b32f-fb7a-45cf-9511-f366fef51bbd", + "row": 3 + }, + "explicitInput": { + "id": "fb86b32f-fb7a-45cf-9511-f366fef51bbd", + "title": "[Flights] Most delayed cities", + "attributes": { + "title": "Cities by delay, cancellation", + "type": "lens", + "visualizationType": "lnsDatatable", + "state": { + "datasourceStates": { + "formBased": { + "layers": { + "f26e8f7a-4118-4227-bea0-5c02d8b270f7": { + "columns": { + "3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0": { + "label": "Top values of OriginCityName", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "OriginCityName", + "isBucketed": true, + "params": { + "size": 1000, + "orderBy": { + "type": "alphabetical", + "fallback": true + }, + "orderDirection": "asc", + "otherBucket": true, + "missingBucket": false + } + }, + "52f6f2e9-6242-4c44-be63-b799150e7e60X0": { + "label": "Part of Delay %", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "FlightDelay : true ", + "language": "kuery" + }, + "customLabel": true + }, + "52f6f2e9-6242-4c44-be63-b799150e7e60X1": { + "label": "Part of Delay %", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "52f6f2e9-6242-4c44-be63-b799150e7e60X2": { + "label": "Part of Delay %", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "52f6f2e9-6242-4c44-be63-b799150e7e60X0", + "52f6f2e9-6242-4c44-be63-b799150e7e60X1" + ], + "location": { + "min": 0, + "max": 42 + }, + "text": "count(kql='FlightDelay : true ') / count()" + } + }, + "references": [ + "52f6f2e9-6242-4c44-be63-b799150e7e60X0", + "52f6f2e9-6242-4c44-be63-b799150e7e60X1" + ], + "customLabel": true + }, + "52f6f2e9-6242-4c44-be63-b799150e7e60": { + "label": "Delay %", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='FlightDelay : true ') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 0 + } + } + }, + "references": ["52f6f2e9-6242-4c44-be63-b799150e7e60X2"], + "customLabel": true + }, + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0": { + "label": "Part of Cancel %", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "filter": { + "query": "Cancelled: true", + "language": "kuery" + }, + "customLabel": true + }, + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1": { + "label": "Part of Cancel %", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "customLabel": true + }, + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2": { + "label": "Part of Cancel %", + "dataType": "number", + "operationType": "math", + "isBucketed": false, + "scale": "ratio", + "params": { + "tinymathAst": { + "type": "function", + "name": "divide", + "args": [ + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1" + ], + "location": { + "min": 0, + "max": 38 + }, + "text": "count(kql='Cancelled: true') / count()" + } + }, + "references": [ + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1" + ], + "customLabel": true + }, + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6": { + "label": "Cancel %", + "dataType": "number", + "operationType": "formula", + "isBucketed": false, + "scale": "ratio", + "params": { + "formula": "count(kql='Cancelled: true') / count()", + "isFormulaBroken": false, + "format": { + "id": "percent", + "params": { + "decimals": 0 + } + } + }, + "references": ["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2"], + "customLabel": true + } + }, + "columnOrder": [ + "3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0", + "52f6f2e9-6242-4c44-be63-b799150e7e60", + "52f6f2e9-6242-4c44-be63-b799150e7e60X0", + "52f6f2e9-6242-4c44-be63-b799150e7e60X1", + "52f6f2e9-6242-4c44-be63-b799150e7e60X2", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2", + "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6" + ], + "incompleteColumns": {} + } + } + } + }, + "visualization": { + "columns": [ + { + "isTransposed": false, + "columnId": "3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0", + "width": 262.75 + }, + { + "columnId": "52f6f2e9-6242-4c44-be63-b799150e7e60", + "isTransposed": false, + "width": 302.5, + "colorMode": "cell", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#f7e0b8", + "stop": 0.6 + }, + { + "color": "#e7664c", + "stop": 1 + } + ], + "name": "custom", + "colorStops": [ + { + "color": "#f7e0b8", + "stop": 0.2 + }, + { + "color": "#e7664c", + "stop": 0.6 + } + ], + "rangeType": "number", + "rangeMin": 0.2, + "rangeMax": 0.6 + } + }, + "alignment": "center" + }, + { + "columnId": "7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6", + "isTransposed": false, + "alignment": "center", + "colorMode": "cell", + "palette": { + "name": "custom", + "type": "palette", + "params": { + "steps": 5, + "stops": [ + { + "color": "#f7e0b8", + "stop": 0.6 + }, + { + "color": "#e7664c", + "stop": 0.6666666666666666 + } + ], + "rangeType": "number", + "name": "custom", + "colorStops": [ + { + "color": "#f7e0b8", + "stop": 0.2 + }, + { + "color": "#e7664c", + "stop": 0.6 + } + ], + "rangeMin": 0.2, + "rangeMax": 0.6 + } + } + } + ], + "layerId": "f26e8f7a-4118-4227-bea0-5c02d8b270f7", + "sorting": { + "columnId": "52f6f2e9-6242-4c44-be63-b799150e7e60", + "direction": "desc" + }, + "layerType": "data", + "rowHeight": "single", + "rowHeightLines": 1 + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [] + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-f26e8f7a-4118-4227-bea0-5c02d8b270f7", + "type": "index-pattern" + } + ] + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.9.0" + }, + "0cc42484-16f7-42ec-b38c-9bf8be69cde7": { + "type": "lens", + "gridData": { + "x": 0, + "y": 25, + "w": 24, + "h": 11, + "i": "0cc42484-16f7-42ec-b38c-9bf8be69cde7", + "row": 3 + }, + "explicitInput": { + "id": "0cc42484-16f7-42ec-b38c-9bf8be69cde7", + "title": "[Flights] Delay Type", + "attributes": { + "title": "", + "type": "lens", + "visualizationType": "lnsXY", + "state": { + "datasourceStates": { + "formBased": { + "layers": { + "e80cc05e-c52a-4e5f-ac71-4b37274867f5": { + "columns": { + "caf7421e-93a3-439e-ab0a-fbdead93c21c": { + "label": "Top values of FlightDelayType", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "FlightDelayType", + "isBucketed": true, + "params": { + "size": 10, + "orderBy": { + "type": "column", + "columnId": "0233d302-ec81-4fbe-96cb-7fac84cf035c" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false + } + }, + "13ec79e3-9d73-4536-9056-3d92802bb30a": { + "label": "timestamp", + "dataType": "date", + "operationType": "date_histogram", + "sourceField": "timestamp", + "isBucketed": true, + "scale": "interval", + "params": { + "interval": "auto", + "includeEmptyRows": true + } + }, + "0233d302-ec81-4fbe-96cb-7fac84cf035c": { + "label": "Count of records", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "columnOrder": [ + "caf7421e-93a3-439e-ab0a-fbdead93c21c", + "13ec79e3-9d73-4536-9056-3d92802bb30a", + "0233d302-ec81-4fbe-96cb-7fac84cf035c" + ], + "incompleteColumns": {} + } + } + } + }, + "visualization": { + "legend": { + "isVisible": true, + "position": "bottom", + "legendSize": "auto" + }, + "valueLabels": "hide", + "fittingFunction": "None", + "yLeftExtent": { + "mode": "full" + }, + "yRightExtent": { + "mode": "full" + }, + "axisTitlesVisibilitySettings": { + "x": true, + "yLeft": false, + "yRight": true + }, + "tickLabelsVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "gridlinesVisibilitySettings": { + "x": true, + "yLeft": true, + "yRight": true + }, + "preferredSeriesType": "bar_percentage_stacked", + "layers": [ + { + "layerId": "e80cc05e-c52a-4e5f-ac71-4b37274867f5", + "accessors": ["0233d302-ec81-4fbe-96cb-7fac84cf035c"], + "position": "top", + "seriesType": "bar_percentage_stacked", + "showGridlines": false, + "palette": { + "type": "palette", + "name": "cool" + }, + "xAccessor": "13ec79e3-9d73-4536-9056-3d92802bb30a", + "splitAccessor": "caf7421e-93a3-439e-ab0a-fbdead93c21c", + "layerType": "data" + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [] + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-e80cc05e-c52a-4e5f-ac71-4b37274867f5", + "type": "index-pattern" + } + ] + }, + "hidePanelTitles": false, + "enhancements": {} + }, + "version": "8.9.0" + }, + "5d53db36-2d5a-4adc-af7b-cec4c1a294e0": { + "type": "lens", + "gridData": { + "x": 24, + "y": 58, + "w": 12, + "h": 11, + "i": "5d53db36-2d5a-4adc-af7b-cec4c1a294e0", + "row": 3 + }, + "explicitInput": { + "id": "5d53db36-2d5a-4adc-af7b-cec4c1a294e0", + "title": "[Flights] Delay Type", + "attributes": { + "title": "", + "type": "lens", + "visualizationType": "lnsPie", + "state": { + "datasourceStates": { + "formBased": { + "layers": { + "0c8e136b-a822-4fb3-836d-e06cbea4eea4": { + "columns": { + "d1cee8bf-34cf-4141-99d7-ff043ee77b56": { + "label": "Top values of FlightDelayType", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "FlightDelayType", + "isBucketed": true, + "params": { + "size": 10, + "orderBy": { + "type": "column", + "columnId": "aa152ace-ee2d-447b-b86d-459bef4d7880" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false + } + }, + "aa152ace-ee2d-447b-b86d-459bef4d7880": { + "label": "Count of records", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___" + } + }, + "columnOrder": [ + "d1cee8bf-34cf-4141-99d7-ff043ee77b56", + "aa152ace-ee2d-447b-b86d-459bef4d7880" + ], + "incompleteColumns": {} + } + } + } + }, + "visualization": { + "shape": "pie", + "palette": { + "type": "palette", + "name": "cool" + }, + "layers": [ + { + "layerId": "0c8e136b-a822-4fb3-836d-e06cbea4eea4", + "numberDisplay": "percent", + "categoryDisplay": "default", + "legendDisplay": "default", + "nestedLegend": false, + "layerType": "data", + "legendSize": "auto", + "primaryGroups": ["d1cee8bf-34cf-4141-99d7-ff043ee77b56"], + "metrics": ["aa152ace-ee2d-447b-b86d-459bef4d7880"] + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [ + { + "meta": { + "type": "phrase", + "key": "FlightDelayType", + "params": { + "query": "No Delay" + }, + "disabled": false, + "negate": true, + "alias": null, + "index": "filter-index-pattern-0" + }, + "query": { + "match_phrase": { + "FlightDelayType": "No Delay" + } + }, + "$state": { + "store": "appState" + } + } + ] + }, + "references": [ + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-current-indexpattern", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-0c8e136b-a822-4fb3-836d-e06cbea4eea4", + "type": "index-pattern" + }, + { + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "filter-index-pattern-0", + "type": "index-pattern" + } + ] + }, + "enhancements": {}, + "hidePanelTitles": false + }, + "version": "8.9.0" + }, + "ecd89a7c-9124-4472-bdc6-9bdbd70d45d5": { + "type": "lens", + "gridData": { + "x": 36, + "y": 58, + "w": 12, + "h": 11, + "i": "ecd89a7c-9124-4472-bdc6-9bdbd70d45d5", + "row": 3 + }, + "explicitInput": { + "id": "ecd89a7c-9124-4472-bdc6-9bdbd70d45d5", + "attributes": { + "title": "", + "visualizationType": "lnsXY", + "type": "lens", + "references": [ + { + "type": "index-pattern", + "id": "d3d7af60-4c81-11e8-b3d7-01146121b73d", + "name": "indexpattern-datasource-layer-dffd86e7-01a9-4990-b974-3706608b5532" + } + ], + "state": { + "visualization": { + "title": "Empty XY chart", + "legend": { + "isVisible": true, + "position": "right" + }, + "valueLabels": "hide", + "preferredSeriesType": "bar_horizontal", + "layers": [ + { + "layerId": "dffd86e7-01a9-4990-b974-3706608b5532", + "accessors": ["9d212159-afac-41f5-9303-5fb62ff04ba3"], + "position": "top", + "seriesType": "bar_horizontal", + "showGridlines": false, + "layerType": "data", + "splitAccessor": "d99ad4d7-26ff-4d65-a8ce-34656fdafa0a", + "palette": { + "type": "palette", + "name": "temperature" + } + } + ] + }, + "query": { + "query": "", + "language": "kuery" + }, + "filters": [], + "datasourceStates": { + "formBased": { + "layers": { + "dffd86e7-01a9-4990-b974-3706608b5532": { + "columns": { + "9d212159-afac-41f5-9303-5fb62ff04ba3": { + "label": "Count of records", + "dataType": "number", + "operationType": "count", + "isBucketed": false, + "scale": "ratio", + "sourceField": "___records___", + "params": { + "emptyAsNull": true + } + }, + "d99ad4d7-26ff-4d65-a8ce-34656fdafa0a": { + "label": "Top 10 values of DestWeather", + "dataType": "string", + "operationType": "terms", + "scale": "ordinal", + "sourceField": "DestWeather", + "isBucketed": true, + "params": { + "size": 10, + "orderBy": { + "type": "column", + "columnId": "9d212159-afac-41f5-9303-5fb62ff04ba3" + }, + "orderDirection": "desc", + "otherBucket": true, + "missingBucket": false, + "parentFormat": { + "id": "terms" + }, + "include": [], + "exclude": [], + "includeIsRegex": false, + "excludeIsRegex": false + } + } + }, + "columnOrder": [ + "d99ad4d7-26ff-4d65-a8ce-34656fdafa0a", + "9d212159-afac-41f5-9303-5fb62ff04ba3" + ], + "sampling": 1, + "incompleteColumns": {} + } + } + }, + "textBased": { + "layers": {} + } + }, + "internalReferences": [], + "adHocDataViews": {} + } + }, + "enhancements": {} + }, + "version": "8.9.0" + } +} diff --git a/examples/grid_example/public/plugin.ts b/examples/grid_example/public/plugin.ts index d57b06ac9601..b56b339273dd 100644 --- a/examples/grid_example/public/plugin.ts +++ b/examples/grid_example/public/plugin.ts @@ -9,6 +9,7 @@ import { AppMountParameters, CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import { DeveloperExamplesSetup } from '@kbn/developer-examples-plugin/public'; +import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; export const GRID_EXAMPLE_APP_ID = 'gridExample'; const gridExampleTitle = 'Grid Example'; @@ -17,20 +18,28 @@ interface GridExamplePluginSetupDependencies { developerExamples: DeveloperExamplesSetup; } +export interface GridExamplePluginStartDependencies { + uiActions: UiActionsStart; +} + export class GridExamplePlugin - implements Plugin + implements + Plugin { - public setup(core: CoreSetup<{}>, { developerExamples }: GridExamplePluginSetupDependencies) { + public setup( + core: CoreSetup, + { developerExamples }: GridExamplePluginSetupDependencies + ) { core.application.register({ id: GRID_EXAMPLE_APP_ID, title: gridExampleTitle, visibleIn: [], async mount(params: AppMountParameters) { - const [{ renderGridExampleApp }, [coreStart]] = await Promise.all([ + const [{ renderGridExampleApp }, [coreStart, deps]] = await Promise.all([ import('./app'), core.getStartServices(), ]); - return renderGridExampleApp(params.element, coreStart); + return renderGridExampleApp(params.element, { coreStart, uiActions: deps.uiActions }); }, }); developerExamples.register({ diff --git a/examples/grid_example/public/serialized_grid_layout.ts b/examples/grid_example/public/serialized_grid_layout.ts index 3e40380d91ac..e5664bd1f22e 100644 --- a/examples/grid_example/public/serialized_grid_layout.ts +++ b/examples/grid_example/public/serialized_grid_layout.ts @@ -9,6 +9,8 @@ import { MockSerializedDashboardState } from './types'; +import logsPanels from './logs_dashboard_panels.json'; + const STATE_SESSION_STORAGE_KEY = 'kibana.examples.gridExample.state'; export function clearSerializedDashboardState() { @@ -25,21 +27,11 @@ export function setSerializedGridLayout(state: MockSerializedDashboardState) { } const initialState: MockSerializedDashboardState = { - panels: { - panel1: { id: 'panel1', gridData: { i: 'panel1', x: 0, y: 0, w: 12, h: 6, row: 0 } }, - panel2: { id: 'panel2', gridData: { i: 'panel2', x: 0, y: 6, w: 8, h: 4, row: 0 } }, - panel3: { id: 'panel3', gridData: { i: 'panel3', x: 8, y: 6, w: 12, h: 4, row: 0 } }, - panel4: { id: 'panel4', gridData: { i: 'panel4', x: 0, y: 10, w: 48, h: 4, row: 0 } }, - panel5: { id: 'panel5', gridData: { i: 'panel5', x: 12, y: 0, w: 36, h: 6, row: 0 } }, - panel6: { id: 'panel6', gridData: { i: 'panel6', x: 24, y: 6, w: 24, h: 4, row: 0 } }, - panel7: { id: 'panel7', gridData: { i: 'panel7', x: 20, y: 6, w: 4, h: 2, row: 0 } }, - panel8: { id: 'panel8', gridData: { i: 'panel8', x: 20, y: 8, w: 4, h: 2, row: 0 } }, - panel9: { id: 'panel9', gridData: { i: 'panel9', x: 0, y: 0, w: 12, h: 16, row: 1 } }, - panel10: { id: 'panel10', gridData: { i: 'panel10', x: 24, y: 0, w: 12, h: 6, row: 2 } }, - }, + panels: logsPanels, rows: [ - { title: 'Large section', collapsed: false }, - { title: 'Small section', collapsed: false }, - { title: 'Another small section', collapsed: false }, + { title: 'Request Sizes', collapsed: false }, + { title: 'Visitors', collapsed: false }, + { title: 'Response Codes', collapsed: false }, + { title: 'Entire Flights Dashboard', collapsed: true }, ], }; diff --git a/examples/grid_example/public/types.ts b/examples/grid_example/public/types.ts index 39885e25e715..141ba96ed2a7 100644 --- a/examples/grid_example/public/types.ts +++ b/examples/grid_example/public/types.ts @@ -15,8 +15,15 @@ export interface DashboardGridData { i: string; } +interface DashboardPanelState { + type: string; + gridData: DashboardGridData & { row?: number }; + explicitInput: Partial & { id: string }; + version?: string; +} + export interface MockedDashboardPanelMap { - [key: string]: { id: string; gridData: DashboardGridData & { row: number } }; + [key: string]: DashboardPanelState; } export type MockedDashboardRowMap = Array<{ title: string; collapsed: boolean }>; diff --git a/examples/grid_example/public/use_mock_dashboard_api.tsx b/examples/grid_example/public/use_mock_dashboard_api.tsx index 8388bd83f264..51933f3a038e 100644 --- a/examples/grid_example/public/use_mock_dashboard_api.tsx +++ b/examples/grid_example/public/use_mock_dashboard_api.tsx @@ -10,6 +10,10 @@ import { cloneDeep } from 'lodash'; import { useMemo } from 'react'; import { BehaviorSubject } from 'rxjs'; +import { v4 } from 'uuid'; + +import { TimeRange } from '@kbn/es-query'; +import { PanelPackage } from '@kbn/presentation-containers'; import { MockSerializedDashboardState, @@ -27,24 +31,50 @@ export const useMockDashboardApi = ({ savedState: MockSerializedDashboardState; }) => { const mockDashboardApi = useMemo(() => { + const panels$ = new BehaviorSubject(savedState.panels); + const expandedPanelId$ = new BehaviorSubject(undefined); + return { + getSerializedStateForChild: (id: string) => { + return { + rawState: panels$.getValue()[id].explicitInput, + references: [], + }; + }, + children$: new BehaviorSubject({}), + timeRange$: new BehaviorSubject({ + from: 'now-24h', + to: 'now', + }), viewMode: new BehaviorSubject('edit'), - panels$: new BehaviorSubject(savedState.panels), + panels$, rows$: new BehaviorSubject(savedState.rows), + expandedPanelId: expandedPanelId$, + expandPanel: (id: string) => { + if (expandedPanelId$.getValue()) { + expandedPanelId$.next(undefined); + } else { + expandedPanelId$.next(id); + } + }, removePanel: (id: string) => { const panels = { ...mockDashboardApi.panels$.getValue() }; delete panels[id]; // the grid layout component will handle compacting, if necessary mockDashboardApi.panels$.next(panels); }, - replacePanel: (oldId: string, newId: string) => { + replacePanel: (id: string, newPanel: PanelPackage) => { const currentPanels = mockDashboardApi.panels$.getValue(); const otherPanels = { ...currentPanels }; - const oldPanel = currentPanels[oldId]; - delete otherPanels[oldId]; - otherPanels[newId] = { id: newId, gridData: { ...oldPanel.gridData, i: newId } }; + const oldPanel = currentPanels[id]; + delete otherPanels[id]; + const newId = v4(); + otherPanels[newId] = { + ...oldPanel, + explicitInput: { ...newPanel.initialState, id: newId }, + }; mockDashboardApi.panels$.next(otherPanels); }, - addNewPanel: ({ id: newId }: { id: string }) => { + addNewPanel: async (panelPackage: PanelPackage) => { // we are only implementing "place at top" here, for demo purposes const currentPanels = mockDashboardApi.panels$.getValue(); const otherPanels = { ...currentPanels }; @@ -53,17 +83,22 @@ export const useMockDashboardApi = ({ currentPanel.gridData.y = currentPanel.gridData.y + DEFAULT_PANEL_HEIGHT; otherPanels[id] = currentPanel; } + const newId = v4(); mockDashboardApi.panels$.next({ ...otherPanels, [newId]: { - id: newId, + type: panelPackage.panelType, gridData: { - i: newId, row: 0, x: 0, y: 0, w: DEFAULT_PANEL_WIDTH, h: DEFAULT_PANEL_HEIGHT, + i: newId, + }, + explicitInput: { + ...panelPackage.initialState, + id: newId, }, }, }); diff --git a/examples/grid_example/public/utils.ts b/examples/grid_example/public/utils.ts index 5d2dfd0fa300..8c9db472cffa 100644 --- a/examples/grid_example/public/utils.ts +++ b/examples/grid_example/public/utils.ts @@ -11,6 +11,7 @@ import { GridLayoutData } from '@kbn/grid-layout'; import { MockedDashboardPanelMap, MockedDashboardRowMap } from './types'; export const gridLayoutToDashboardPanelMap = ( + panelState: MockedDashboardPanelMap, layout: GridLayoutData ): { panels: MockedDashboardPanelMap; rows: MockedDashboardRowMap } => { const panels: MockedDashboardPanelMap = {}; @@ -19,7 +20,7 @@ export const gridLayoutToDashboardPanelMap = ( rows.push({ title: row.title, collapsed: row.isCollapsed }); Object.values(row.panels).forEach((panelGridData) => { panels[panelGridData.id] = { - id: panelGridData.id, + ...panelState[panelGridData.id], gridData: { i: panelGridData.id, y: panelGridData.row, @@ -49,7 +50,7 @@ export const dashboardInputToGridLayout = ({ Object.keys(panels).forEach((panelId) => { const gridData = panels[panelId].gridData; - layout[gridData.row].panels[panelId] = { + layout[gridData.row ?? 0].panels[panelId] = { id: panelId, row: gridData.y, column: gridData.x, diff --git a/examples/grid_example/tsconfig.json b/examples/grid_example/tsconfig.json index ad692e9697b2..334bc8c809a2 100644 --- a/examples/grid_example/tsconfig.json +++ b/examples/grid_example/tsconfig.json @@ -3,7 +3,13 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["index.ts", "public/**/*.ts", "public/**/*.tsx", "../../typings/**/*"], + "include": [ + "index.ts", + "public/**/*.ts", + "public/**/*.tsx", + "../../typings/**/*", + "public/**/*.json" + ], "exclude": ["target/**/*"], "kbn_references": [ "@kbn/grid-layout", @@ -11,7 +17,15 @@ "@kbn/core", "@kbn/developer-examples-plugin", "@kbn/core-lifecycle-browser", + "@kbn/embeddable-plugin", "@kbn/react-kibana-mount", "@kbn/i18n", + "@kbn/embeddable-examples-plugin", + "@kbn/react-kibana-context-render", + "@kbn/presentation-publishing", + "@kbn/es-query", + "@kbn/ui-actions-plugin", + "@kbn/embeddable-examples-plugin", + "@kbn/presentation-containers" ] } diff --git a/examples/portable_dashboards_example/public/app.tsx b/examples/portable_dashboards_example/public/app.tsx index c68b612c3119..04a42de83690 100644 --- a/examples/portable_dashboards_example/public/app.tsx +++ b/examples/portable_dashboards_example/public/app.tsx @@ -56,7 +56,7 @@ const PortableDashboardsDemos = ({ history: AppMountParameters['history']; }) => { return ( - + diff --git a/examples/resizable_layout_examples/public/application.tsx b/examples/resizable_layout_examples/public/application.tsx index 7637cf2a79c6..90065dc3f704 100644 --- a/examples/resizable_layout_examples/public/application.tsx +++ b/examples/resizable_layout_examples/public/application.tsx @@ -8,7 +8,7 @@ */ import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; -import type { AppMountParameters } from '@kbn/core/public'; +import type { AppMountParameters, CoreStart } from '@kbn/core/public'; import { I18nProvider } from '@kbn/i18n-react'; import React, { ReactNode, useState } from 'react'; import ReactDOM from 'react-dom'; @@ -98,10 +98,10 @@ const ResizableSection = ({ ); }; -export const renderApp = ({ element, theme$ }: AppMountParameters) => { +export const renderApp = (coreStart: CoreStart, { element }: AppMountParameters) => { ReactDOM.render( - +
{ + const [coreStart] = await core.getStartServices(); // Load application bundle const { renderApp } = await import('./application'); // Render the application - return renderApp(params); + return renderApp(coreStart, params); }, }); diff --git a/examples/search_examples/public/search/app.tsx b/examples/search_examples/public/search/app.tsx index 6639d446e80e..c1ffceb561fe 100644 --- a/examples/search_examples/public/search/app.tsx +++ b/examples/search_examples/public/search/app.tsx @@ -43,7 +43,10 @@ import { PLUGIN_ID, PLUGIN_NAME, SERVER_SEARCH_ROUTE_PATH } from '../../common'; import { IMyStrategyResponse } from '../../common/types'; interface SearchExamplesAppDeps - extends Pick { + extends Pick< + CoreStart, + 'notifications' | 'http' | 'analytics' | 'i18n' | 'theme' | 'userProfile' + > { navigation: NavigationPublicPluginStart; data: DataPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; @@ -230,13 +233,8 @@ export const SearchExamplesApp = ({ ); notifications.toasts.addSuccess( - { - title: 'Query result', - text: toMountPoint(message, startServices), - }, - { - toastLifeTimeMs: 300000, - } + { title: 'Query result', text: toMountPoint(message, startServices) }, + { toastLifeTimeMs: 300000 } ); if (res.warning) { notifications.toasts.addWarning({ diff --git a/examples/search_examples/public/search_sessions/app.tsx b/examples/search_examples/public/search_sessions/app.tsx index 5fcb0e326c8b..aca66a395352 100644 --- a/examples/search_examples/public/search_sessions/app.tsx +++ b/examples/search_examples/public/search_sessions/app.tsx @@ -56,6 +56,7 @@ interface SearchSessionsExampleAppDeps { analytics: CoreStart['analytics']; i18n: CoreStart['i18n']; theme: CoreStart['theme']; + userProfile: CoreStart['userProfile']; navigation: NavigationPublicPluginStart; data: DataPublicPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; @@ -674,6 +675,7 @@ function doSearch( analytics: CoreStart['analytics']; i18n: CoreStart['i18n']; theme: CoreStart['theme']; + userProfile: CoreStart['userProfile']; } ): Promise<{ request: IEsSearchRequest; response: IEsSearchResponse; tookMs?: number }> { if (!dataView) return Promise.reject('Select a data view'); diff --git a/examples/unified_field_list_examples/public/application.tsx b/examples/unified_field_list_examples/public/application.tsx index 6cbdc8242b6b..fa1a936d6689 100644 --- a/examples/unified_field_list_examples/public/application.tsx +++ b/examples/unified_field_list_examples/public/application.tsx @@ -18,11 +18,11 @@ import { UnifiedFieldListExampleApp } from './example_app'; export const renderApp = ( core: CoreStart, deps: AppPluginStartDependencies, - { element, theme$ }: AppMountParameters + { element }: AppMountParameters ) => { ReactDOM.render( - + { + const { euiTheme } = useEuiTheme(); const userProfile: UserProfile<{ avatar: UserProfileAvatarData }> = { uid: 'u_J41Oh6L9ki-Vo2tOogS8WRTENzhHurGtRc87NgEAlkc_0', enabled: true, @@ -24,7 +25,7 @@ export const AvatarDemo: FunctionComponent = () => { }, data: { avatar: { - color: '#09e8ca', + color: euiTheme.colors.vis.euiColorVis1, initials: 'DN', imageUrl: 'https://source.unsplash.com/64x64/?cat', }, diff --git a/examples/user_profile_examples/public/tooltip_demo.tsx b/examples/user_profile_examples/public/tooltip_demo.tsx index 1c356be4df20..bb99bfa5bb52 100644 --- a/examples/user_profile_examples/public/tooltip_demo.tsx +++ b/examples/user_profile_examples/public/tooltip_demo.tsx @@ -10,10 +10,11 @@ import React, { FunctionComponent } from 'react'; import { UserAvatarTip, UserToolTip } from '@kbn/user-profile-components'; import type { UserProfile, UserProfileAvatarData } from '@kbn/user-profile-components'; -import { EuiCommentList, EuiComment } from '@elastic/eui'; +import { EuiCommentList, EuiComment, useEuiTheme } from '@elastic/eui'; import { PanelWithCodeBlock } from './panel_with_code_block'; export const ToolTipDemo: FunctionComponent = () => { + const { euiTheme } = useEuiTheme(); const userProfile: UserProfile<{ avatar: UserProfileAvatarData }> = { uid: 'u_9xDEQqUqoYCnFnPPLq5mIRHKL8gBTo_NiKgOnd5gGk0_0', enabled: true, @@ -24,7 +25,7 @@ export const ToolTipDemo: FunctionComponent = () => { }, data: { avatar: { - color: '#09e8ca', + color: euiTheme.colors.vis.euiColorVis1, initials: 'WD', imageUrl: 'https://source.unsplash.com/64x64/?dingo', }, diff --git a/kbn_pm/src/commands/watch_command.mjs b/kbn_pm/src/commands/watch_command.mjs index c9e12620d910..9a98b5c12810 100644 --- a/kbn_pm/src/commands/watch_command.mjs +++ b/kbn_pm/src/commands/watch_command.mjs @@ -27,6 +27,7 @@ export const command = { async run({ args, log }) { await Bazel.watch(log, { offline: args.getBooleanValue('offline') ?? true, + reactVersion: process.env.REACT_18 ? '18' : '17', }); }, }; diff --git a/kbn_pm/src/lib/bazel.mjs b/kbn_pm/src/lib/bazel.mjs index 53a1c87f164c..f3a0e287cf3f 100644 --- a/kbn_pm/src/lib/bazel.mjs +++ b/kbn_pm/src/lib/bazel.mjs @@ -83,7 +83,7 @@ async function runBazel(log, inputArgs, opts = undefined) { /** * * @param {import('./log.mjs').Log} log - * @param {{ offline: boolean } | undefined} opts + * @param {{ offline: boolean, reactVersion?: string } | undefined} opts */ export async function watch(log, opts = undefined) { const ibazel = (await getBazelRunner()).runIBazel; @@ -97,10 +97,12 @@ export async function watch(log, opts = undefined) { ...BAZEL_TARGETS, '--show_result=1', ...(opts?.offline ? ['--config=offline'] : []), + `--define=REACT_18=${opts?.reactVersion === '18' ? 'true' : 'false'}`, ]; log.debug(`> ibazel ${args.join(' ')}`); await ibazel(args, { cwd: REPO_ROOT, + env: { ...process.env, REACT_18: opts?.reactVersion === '18' ? 'true' : 'false' }, logPrefix: Color.info('[ibazel]'), onErrorExit(code, output) { throwBazelError(log, 'ibazel', code, output); diff --git a/oas_docs/output/kibana.serverless.yaml b/oas_docs/output/kibana.serverless.yaml index 0c89dc73bcd3..2a942bc85c3b 100644 --- a/oas_docs/output/kibana.serverless.yaml +++ b/oas_docs/output/kibana.serverless.yaml @@ -114,7 +114,12 @@ tags: - description: Manage and interact with Security Assistant resources. name: Security AI Assistant API x-displayName: Security AI assistant - - 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. + - description: | + Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged. + > warn + > If the API key used for authorization has different privileges than the key that created or most recently updated a rule, the rule behavior might change. + + > If the API key that created a rule is deleted, or the user that created the rule becomes inactive, the rule will stop running. name: Security Detections API x-displayName: Security detections - description: Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met. @@ -126,10 +131,67 @@ tags: - description: '' name: Security Entity Analytics API x-displayName: Security entity analytics - - 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. + - description: | + Exceptions are associated with detection and endpoint rules, and are used to prevent a rule from generating an alert from incoming events, even when the rule's other criteria are met. They can help reduce the number of false positives and prevent trusted processes and network activity from generating unnecessary alerts. + + Exceptions are made up of: + + * **Exception containers**: A container for related exceptions. Generally, a single exception container contains all the exception items relevant for a subset of rules. For example, a container can be used to group together network-related exceptions that are relevant for a large number of network rules. The container can then be associated with all the relevant rules. + * **Exception items**: The query (fields, values, and logic) used to prevent rules from generating alerts. When an exception item's query evaluates to `true`, the rule does not generate an alert. + + For detection rules, you can also use lists to define rule exceptions. A list holds multiple values of the same Elasticsearch data type, such as IP addresses. These values are used to determine when an exception prevents an alert from being generated. + > info + > You cannot use lists with endpoint rule exceptions. + + > info + > Only exception containers can be associated with rules. You cannot directly associate an exception item or a list container with a rule. To use list exceptions, create an exception item that references the relevant list container. + + ## Exceptions requirements + + Before you can start working with exceptions that use value lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. For a complete list of requirements, refer to [Enable and access detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui). name: Security Exceptions API x-displayName: Security exceptions - - description: Lists API allows you to manage lists of keywords, IPs or IP ranges items. + - description: | + Lists can be used with detection rule exceptions to define values that prevent a rule from generating alerts. + + Lists are made up of: + + * **List containers**: A container for values of the same Elasticsearch data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception prevents an alert from being generated. + + All list items in the same list container must be of the same data type, and each item defines a single value. For example, an IP list container named `internal-ip-addresses-southport` contains five items, where each item defines one internal IP address: + 1. `192.168.1.1` + 2. `192.168.1.3` + 3. `192.168.1.18` + 4. `192.168.1.12` + 5. `192.168.1.7` + + To use these IP addresses as values for defining rule exceptions, use the Security exceptions API to [create an exception list item](../operation/operation-createexceptionlistitem) that references the `internal-ip-addresses-southport` list. + > info + > Lists cannot be added directly to rules, nor do they define the operators used to determine when exceptions are applied (`is in list`, `is not in list`). Use an exception item to define the operator and associate it with an [exception container](../operation/operation-createexceptionlist). You can then add the exception container to a rule's `exceptions_list` object. + + ## Lists requirements + + Before you can start using lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. Refer to [Enable and access detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui) for a complete list of requirements. name: Security Lists API x-displayName: Security lists - description: Run live queries, manage packs and saved queries. @@ -33483,6 +33545,58 @@ paths: tags: - Security Entity Analytics API x-beta: true + /api/risk_score/engine/saved_object/configure: + patch: + description: Configuring the Risk Engine Saved Object + operationId: ConfigureRiskEngineSavedObject + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + exclude_alert_statuses: + items: + type: string + type: array + exclude_alert_tags: + items: + type: string + type: array + range: + type: object + properties: + end: + type: string + start: + type: string + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + risk_engine_saved_object_configured: + type: boolean + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_Entity_Analytics_API_TaskManagerUnavailableResponse' + description: Task manager is unavailable + default: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_Entity_Analytics_API_ConfigureRiskEngineSavedObjectErrorResponse' + description: Unexpected error + summary: Configure the Risk Engine Saved Object + tags: + - Security Entity Analytics API + x-beta: true /api/risk_score/engine/schedule_now: post: description: Schedule the risk scoring engine to run as soon as possible. You can use this to recalculate entity risk scores after updating their asset criticality. @@ -40331,9 +40445,9 @@ components: - assistant type: string Security_AI_Assistant_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_AI_Assistant_API_NormalizedAnonymizationFieldError: type: object @@ -43097,9 +43211,9 @@ components: - severity - $ref: '#/components/schemas/Security_Detections_API_NewTermsRuleCreateFields' Security_Detections_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Detections_API_NormalizedRuleAction: additionalProperties: false @@ -46301,9 +46415,9 @@ components: - text type: string Security_Endpoint_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Endpoint_Exceptions_API_PlatformErrorResponse: type: object @@ -46604,9 +46718,9 @@ components: required: - hostStatuses Security_Endpoint_Management_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Endpoint_Management_API_NoParametersRequestSchema: type: object @@ -46925,6 +47039,27 @@ components: required: - cleanup_successful - errors + Security_Entity_Analytics_API_ConfigureRiskEngineSavedObjectErrorResponse: + type: object + properties: + errors: + items: + type: object + properties: + error: + type: string + seq: + type: integer + required: + - seq + - error + type: array + risk_engine_saved_object_configured: + example: false + type: boolean + required: + - risk_engine_saved_object_configured + - errors Security_Entity_Analytics_API_CreateAssetCriticalityRecord: allOf: - $ref: '#/components/schemas/Security_Entity_Analytics_API_AssetCriticalityRecordIdParts' @@ -47788,9 +47923,9 @@ components: - text type: string Security_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Exceptions_API_PlatformErrorResponse: type: object @@ -48034,9 +48169,9 @@ components: - text type: string Security_Lists_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Lists_API_PlatformErrorResponse: type: object diff --git a/oas_docs/output/kibana.yaml b/oas_docs/output/kibana.yaml index d9dbce0c460e..9945bce1322a 100644 --- a/oas_docs/output/kibana.yaml +++ b/oas_docs/output/kibana.yaml @@ -130,7 +130,12 @@ tags: - description: Manage and interact with Security Assistant resources. name: Security AI Assistant API x-displayName: Security AI assistant - - 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. + - description: | + Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged. + > warn + > If the API key used for authorization has different privileges than the key that created or most recently updated a rule, the rule behavior might change. + + > If the API key that created a rule is deleted, or the user that created the rule becomes inactive, the rule will stop running. name: Security Detections API x-displayName: Security detections - description: Endpoint Exceptions API allows you to manage detection rule endpoint exceptions to prevent a rule from generating an alert from incoming events even when the rule's other criteria are met. @@ -142,10 +147,67 @@ tags: - description: '' name: Security Entity Analytics API x-displayName: Security entity analytics - - 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. + - description: | + Exceptions are associated with detection and endpoint rules, and are used to prevent a rule from generating an alert from incoming events, even when the rule's other criteria are met. They can help reduce the number of false positives and prevent trusted processes and network activity from generating unnecessary alerts. + + Exceptions are made up of: + + * **Exception containers**: A container for related exceptions. Generally, a single exception container contains all the exception items relevant for a subset of rules. For example, a container can be used to group together network-related exceptions that are relevant for a large number of network rules. The container can then be associated with all the relevant rules. + * **Exception items**: The query (fields, values, and logic) used to prevent rules from generating alerts. When an exception item's query evaluates to `true`, the rule does not generate an alert. + + For detection rules, you can also use lists to define rule exceptions. A list holds multiple values of the same Elasticsearch data type, such as IP addresses. These values are used to determine when an exception prevents an alert from being generated. + > info + > You cannot use lists with endpoint rule exceptions. + + > info + > Only exception containers can be associated with rules. You cannot directly associate an exception item or a list container with a rule. To use list exceptions, create an exception item that references the relevant list container. + + ## Exceptions requirements + + Before you can start working with exceptions that use value lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. For a complete list of requirements, refer to [Enable and access detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui). name: Security Exceptions API x-displayName: Security exceptions - - description: Lists API allows you to manage lists of keywords, IPs or IP ranges items. + - description: | + Lists can be used with detection rule exceptions to define values that prevent a rule from generating alerts. + + Lists are made up of: + + * **List containers**: A container for values of the same Elasticsearch data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception prevents an alert from being generated. + + All list items in the same list container must be of the same data type, and each item defines a single value. For example, an IP list container named `internal-ip-addresses-southport` contains five items, where each item defines one internal IP address: + 1. `192.168.1.1` + 2. `192.168.1.3` + 3. `192.168.1.18` + 4. `192.168.1.12` + 5. `192.168.1.7` + + To use these IP addresses as values for defining rule exceptions, use the Security exceptions API to [create an exception list item](../operation/operation-createexceptionlistitem) that references the `internal-ip-addresses-southport` list. + > info + > Lists cannot be added directly to rules, nor do they define the operators used to determine when exceptions are applied (`is in list`, `is not in list`). Use an exception item to define the operator and associate it with an [exception container](../operation/operation-createexceptionlist). You can then add the exception container to a rule's `exceptions_list` object. + + ## Lists requirements + + Before you can start using lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. Refer to [Enable and access detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui) for a complete list of requirements. name: Security Lists API x-displayName: Security lists - description: Run live queries, manage packs and saved queries. @@ -36208,6 +36270,57 @@ paths: summary: Cleanup the Risk Engine tags: - Security Entity Analytics API + /api/risk_score/engine/saved_object/configure: + patch: + description: Configuring the Risk Engine Saved Object + operationId: ConfigureRiskEngineSavedObject + requestBody: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + exclude_alert_statuses: + items: + type: string + type: array + exclude_alert_tags: + items: + type: string + type: array + range: + type: object + properties: + end: + type: string + start: + type: string + required: true + responses: + '200': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + type: object + properties: + risk_engine_saved_object_configured: + type: boolean + description: Successful response + '400': + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_Entity_Analytics_API_TaskManagerUnavailableResponse' + description: Task manager is unavailable + default: + content: + application/json; Elastic-Api-Version=2023-10-31: + schema: + $ref: '#/components/schemas/Security_Entity_Analytics_API_ConfigureRiskEngineSavedObjectErrorResponse' + description: Unexpected error + summary: Configure the Risk Engine Saved Object + tags: + - Security Entity Analytics API /api/risk_score/engine/schedule_now: post: description: Schedule the risk scoring engine to run as soon as possible. You can use this to recalculate entity risk scores after updating their asset criticality. @@ -47829,9 +47942,9 @@ components: - assistant type: string Security_AI_Assistant_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_AI_Assistant_API_NormalizedAnonymizationFieldError: type: object @@ -50775,9 +50888,9 @@ components: - severity - $ref: '#/components/schemas/Security_Detections_API_NewTermsRuleCreateFields' Security_Detections_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Detections_API_NormalizedRuleAction: additionalProperties: false @@ -53986,9 +54099,9 @@ components: - text type: string Security_Endpoint_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Endpoint_Exceptions_API_PlatformErrorResponse: type: object @@ -54289,9 +54402,9 @@ components: required: - hostStatuses Security_Endpoint_Management_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Endpoint_Management_API_NoParametersRequestSchema: type: object @@ -54610,6 +54723,27 @@ components: required: - cleanup_successful - errors + Security_Entity_Analytics_API_ConfigureRiskEngineSavedObjectErrorResponse: + type: object + properties: + errors: + items: + type: object + properties: + error: + type: string + seq: + type: integer + required: + - seq + - error + type: array + risk_engine_saved_object_configured: + example: false + type: boolean + required: + - risk_engine_saved_object_configured + - errors Security_Entity_Analytics_API_CreateAssetCriticalityRecord: allOf: - $ref: '#/components/schemas/Security_Entity_Analytics_API_AssetCriticalityRecordIdParts' @@ -55473,9 +55607,9 @@ components: - text type: string Security_Exceptions_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Exceptions_API_PlatformErrorResponse: type: object @@ -55719,9 +55853,9 @@ components: - text type: string Security_Lists_API_NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string Security_Lists_API_PlatformErrorResponse: type: object diff --git a/oas_docs/overlays/alerting.overlays.yaml b/oas_docs/overlays/alerting.overlays.yaml index c4cc25b68578..f6920e662e9e 100644 --- a/oas_docs/overlays/alerting.overlays.yaml +++ b/oas_docs/overlays/alerting.overlays.yaml @@ -113,9 +113,9 @@ actions: # 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' + - $ref: '../../x-pack/solutions/observability/plugins/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' + - $ref: '../../x-pack/solutions/observability/plugins/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) diff --git a/package.json b/package.json index 47f098d33f40..d1be5da4b63a 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,7 @@ "@elastic/datemath": "5.0.3", "@elastic/ebt": "^1.1.1", "@elastic/ecs": "^8.11.1", - "@elastic/elasticsearch": "^8.15.2", + "@elastic/elasticsearch": "^8.16.0", "@elastic/ems-client": "8.5.3", "@elastic/eui": "98.1.0-borealis.0", "@elastic/eui-theme-borealis": "0.0.4", @@ -160,7 +160,7 @@ "@kbn/advanced-settings-plugin": "link:src/plugins/advanced_settings", "@kbn/ai-assistant": "link:x-pack/packages/kbn-ai-assistant", "@kbn/ai-assistant-common": "link:x-pack/packages/kbn-ai-assistant-common", - "@kbn/ai-assistant-management-plugin": "link:src/plugins/ai_assistant_management/selection", + "@kbn/ai-assistant-management-plugin": "link:src/platform/plugins/shared/ai_assistant_management/selection", "@kbn/aiops-change-point-detection": "link:x-pack/platform/packages/private/ml/aiops_change_point_detection", "@kbn/aiops-common": "link:x-pack/platform/packages/shared/ml/aiops_common", "@kbn/aiops-components": "link:x-pack/platform/packages/private/ml/aiops_components", @@ -423,13 +423,13 @@ "@kbn/custom-integrations-plugin": "link:src/plugins/custom_integrations", "@kbn/dashboard-enhanced-plugin": "link:x-pack/plugins/dashboard_enhanced", "@kbn/dashboard-plugin": "link:src/plugins/dashboard", - "@kbn/data-forge": "link:x-pack/packages/kbn-data-forge", + "@kbn/data-forge": "link:x-pack/platform/packages/shared/kbn-data-forge", "@kbn/data-plugin": "link:src/plugins/data", "@kbn/data-quality-plugin": "link:x-pack/plugins/data_quality", "@kbn/data-search-plugin": "link:test/plugin_functional/plugins/data_search", "@kbn/data-service": "link:packages/kbn-data-service", - "@kbn/data-stream-adapter": "link:packages/kbn-data-stream-adapter", - "@kbn/data-usage-plugin": "link:x-pack/plugins/data_usage", + "@kbn/data-stream-adapter": "link:x-pack/solutions/security/packages/data-stream-adapter", + "@kbn/data-usage-plugin": "link:x-pack/platform/plugins/private/data_usage", "@kbn/data-view-editor-plugin": "link:src/plugins/data_view_editor", "@kbn/data-view-field-editor-example-plugin": "link:examples/data_view_field_editor_example", "@kbn/data-view-field-editor-plugin": "link:src/plugins/data_view_field_editor", @@ -444,7 +444,7 @@ "@kbn/deeplinks-fleet": "link:packages/deeplinks/fleet", "@kbn/deeplinks-management": "link:packages/deeplinks/management", "@kbn/deeplinks-ml": "link:src/platform/packages/shared/deeplinks/ml", - "@kbn/deeplinks-observability": "link:packages/deeplinks/observability", + "@kbn/deeplinks-observability": "link:src/platform/packages/shared/deeplinks/observability", "@kbn/deeplinks-search": "link:packages/deeplinks/search", "@kbn/deeplinks-security": "link:packages/deeplinks/security", "@kbn/deeplinks-shared": "link:packages/deeplinks/shared", @@ -463,7 +463,7 @@ "@kbn/doc-links": "link:src/platform/packages/shared/kbn-doc-links", "@kbn/dom-drag-drop": "link:packages/kbn-dom-drag-drop", "@kbn/ebt-tools": "link:packages/kbn-ebt-tools", - "@kbn/ecs-data-quality-dashboard": "link:x-pack/packages/security-solution/ecs_data_quality_dashboard", + "@kbn/ecs-data-quality-dashboard": "link:x-pack/solutions/security/packages/ecs_data_quality_dashboard", "@kbn/ecs-data-quality-dashboard-plugin": "link:x-pack/plugins/ecs_data_quality_dashboard", "@kbn/elastic-agent-utils": "link:packages/kbn-elastic-agent-utils", "@kbn/elastic-assistant": "link:x-pack/packages/kbn-elastic-assistant", @@ -504,9 +504,9 @@ "@kbn/event-annotation-plugin": "link:src/plugins/event_annotation", "@kbn/event-log-fixture-plugin": "link:x-pack/test/plugin_api_integration/plugins/event_log", "@kbn/event-log-plugin": "link:x-pack/plugins/event_log", - "@kbn/expandable-flyout": "link:packages/kbn-expandable-flyout", + "@kbn/expandable-flyout": "link:x-pack/solutions/security/packages/expandable-flyout", "@kbn/exploratory-view-example-plugin": "link:x-pack/examples/exploratory_view_example", - "@kbn/exploratory-view-plugin": "link:x-pack/plugins/observability_solution/exploratory_view", + "@kbn/exploratory-view-plugin": "link:x-pack/solutions/observability/plugins/exploratory_view", "@kbn/expression-error-plugin": "link:src/plugins/expression_error", "@kbn/expression-gauge-plugin": "link:src/plugins/chart_expressions/expression_gauge", "@kbn/expression-heatmap-plugin": "link:src/plugins/chart_expressions/expression_heatmap", @@ -571,7 +571,7 @@ "@kbn/i18n-react": "link:packages/kbn-i18n-react", "@kbn/iframe-embedded-plugin": "link:x-pack/test/functional_embedded/plugins/iframe_embedded", "@kbn/image-embeddable-plugin": "link:src/plugins/image_embeddable", - "@kbn/index-adapter": "link:packages/kbn-index-adapter", + "@kbn/index-adapter": "link:x-pack/solutions/security/packages/index-adapter", "@kbn/index-lifecycle-management-common-shared": "link:x-pack/packages/index-lifecycle-management/index_lifecycle_management_common_shared", "@kbn/index-lifecycle-management-plugin": "link:x-pack/plugins/index_lifecycle_management", "@kbn/index-management-plugin": "link:x-pack/plugins/index_management", @@ -580,7 +580,7 @@ "@kbn/inference-common": "link:x-pack/platform/packages/shared/ai-infra/inference-common", "@kbn/inference-plugin": "link:x-pack/platform/plugins/shared/inference", "@kbn/inference_integration_flyout": "link:x-pack/platform/packages/private/ml/inference_integration_flyout", - "@kbn/infra-forge": "link:x-pack/packages/kbn-infra-forge", + "@kbn/infra-forge": "link:x-pack/platform/packages/private/kbn-infra-forge", "@kbn/infra-plugin": "link:x-pack/plugins/observability_solution/infra", "@kbn/ingest-pipelines-plugin": "link:x-pack/plugins/ingest_pipelines", "@kbn/input-control-vis-plugin": "link:src/plugins/input_control_vis", @@ -590,9 +590,9 @@ "@kbn/interactive-setup-test-endpoints-plugin": "link:test/interactive_setup_api_integration/plugins/test_endpoints", "@kbn/interpreter": "link:packages/kbn-interpreter", "@kbn/inventory-plugin": "link:x-pack/plugins/observability_solution/inventory", - "@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/investigate-app-plugin": "link:x-pack/solutions/observability/plugins/investigate_app", + "@kbn/investigate-plugin": "link:x-pack/solutions/observability/plugins/investigate", + "@kbn/investigation-shared": "link:x-pack/solutions/observability/packages/kbn-investigation-shared", "@kbn/io-ts-utils": "link:packages/kbn-io-ts-utils", "@kbn/ipynb": "link:packages/kbn-ipynb", "@kbn/item-buffer": "link:packages/kbn-item-buffer", @@ -692,20 +692,22 @@ "@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", - "@kbn/observability-alert-details": "link:x-pack/packages/observability/alert_details", - "@kbn/observability-alerting-rule-utils": "link:x-pack/packages/observability/alerting_rule_utils", - "@kbn/observability-alerting-test-data": "link:x-pack/packages/observability/alerting_test_data", + "@kbn/observability-ai-assistant-app-plugin": "link:x-pack/solutions/observability/plugins/observability_ai_assistant_app", + "@kbn/observability-ai-assistant-management-plugin": "link:x-pack/solutions/observability/plugins/observability_ai_assistant_management", + "@kbn/observability-ai-assistant-plugin": "link:x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant", + "@kbn/observability-ai-common": "link:x-pack/solutions/observability/packages/observability_ai/observability_ai_common", + "@kbn/observability-ai-server": "link:x-pack/solutions/observability/packages/observability_ai/observability_ai_server", + "@kbn/observability-alert-details": "link:x-pack/solutions/observability/packages/alert_details", + "@kbn/observability-alerting-rule-utils": "link:x-pack/platform/packages/shared/observability/alerting_rule_utils", + "@kbn/observability-alerting-test-data": "link:x-pack/solutions/observability/packages/alerting_test_data", "@kbn/observability-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/observability", - "@kbn/observability-get-padded-alert-time-range-util": "link:x-pack/packages/observability/get_padded_alert_time_range_util", + "@kbn/observability-get-padded-alert-time-range-util": "link:x-pack/solutions/observability/packages/get_padded_alert_time_range_util", "@kbn/observability-logs-explorer-plugin": "link:x-pack/plugins/observability_solution/observability_logs_explorer", "@kbn/observability-logs-overview": "link:x-pack/packages/observability/logs_overview", "@kbn/observability-onboarding-plugin": "link:x-pack/plugins/observability_solution/observability_onboarding", - "@kbn/observability-plugin": "link:x-pack/plugins/observability_solution/observability", + "@kbn/observability-plugin": "link:x-pack/solutions/observability/plugins/observability", "@kbn/observability-shared-plugin": "link:x-pack/plugins/observability_solution/observability_shared", - "@kbn/observability-synthetics-test-data": "link:x-pack/packages/observability/synthetics_test_data", + "@kbn/observability-synthetics-test-data": "link:x-pack/solutions/observability/packages/synthetics_test_data", "@kbn/observability-utils-browser": "link:x-pack/packages/observability/observability_utils/observability_utils_browser", "@kbn/observability-utils-common": "link:x-pack/packages/observability/observability_utils/observability_utils_common", "@kbn/observability-utils-server": "link:x-pack/packages/observability/observability_utils/observability_utils_server", @@ -716,6 +718,7 @@ "@kbn/osquery-plugin": "link:x-pack/plugins/osquery", "@kbn/paertial-results-example-plugin": "link:examples/partial_results_example", "@kbn/painless-lab-plugin": "link:x-pack/plugins/painless_lab", + "@kbn/palettes": "link:packages/kbn-palettes", "@kbn/panel-loader": "link:packages/kbn-panel-loader", "@kbn/plugin-check": "link:packages/kbn-plugin-check", "@kbn/portable-dashboards-example": "link:examples/portable_dashboards_example", @@ -824,20 +827,20 @@ "@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-distribution-bar": "link:x-pack/packages/security-solution/distribution_bar", + "@kbn/security-solution-distribution-bar": "link:x-pack/solutions/security/packages/distribution_bar", "@kbn/security-solution-ess": "link:x-pack/plugins/security_solution_ess", - "@kbn/security-solution-features": "link:x-pack/packages/security-solution/features", + "@kbn/security-solution-features": "link:x-pack/solutions/security/packages/features", "@kbn/security-solution-fixtures-plugin": "link:x-pack/test/cases_api_integration/common/plugins/security_solution", - "@kbn/security-solution-navigation": "link:x-pack/packages/security-solution/navigation", + "@kbn/security-solution-navigation": "link:x-pack/solutions/security/packages/navigation", "@kbn/security-solution-plugin": "link:x-pack/plugins/security_solution", "@kbn/security-solution-serverless": "link:x-pack/plugins/security_solution_serverless", - "@kbn/security-solution-side-nav": "link:x-pack/packages/security-solution/side_nav", - "@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-solution-side-nav": "link:x-pack/solutions/security/packages/side_nav", + "@kbn/security-solution-storybook-config": "link:x-pack/solutions/security/packages/storybook/config", + "@kbn/security-solution-upselling": "link:x-pack/solutions/security/packages/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-data-table": "link:x-pack/solutions/security/packages/data_table", "@kbn/securitysolution-ecs": "link:packages/kbn-securitysolution-ecs", "@kbn/securitysolution-endpoint-exceptions-common": "link:packages/kbn-securitysolution-endpoint-exceptions-common", "@kbn/securitysolution-es-utils": "link:packages/kbn-securitysolution-es-utils", @@ -862,7 +865,7 @@ "@kbn/server-route-repository-utils": "link:packages/kbn-server-route-repository-utils", "@kbn/serverless": "link:x-pack/plugins/serverless", "@kbn/serverless-common-settings": "link:packages/serverless/settings/common", - "@kbn/serverless-observability": "link:x-pack/plugins/serverless_observability", + "@kbn/serverless-observability": "link:x-pack/solutions/observability/plugins/serverless_observability", "@kbn/serverless-observability-settings": "link:packages/serverless/settings/observability_project", "@kbn/serverless-project-switcher": "link:packages/serverless/project_switcher", "@kbn/serverless-search": "link:x-pack/plugins/serverless_search", @@ -926,7 +929,7 @@ "@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", + "@kbn/slo-schema": "link:x-pack/platform/packages/shared/kbn-slo-schema", "@kbn/snapshot-restore-plugin": "link:x-pack/plugins/snapshot_restore", "@kbn/sort-predicates": "link:packages/kbn-sort-predicates", "@kbn/spaces-plugin": "link:x-pack/plugins/spaces", @@ -941,9 +944,9 @@ "@kbn/status-plugin-a-plugin": "link:test/server_integration/plugins/status_plugin_a", "@kbn/status-plugin-b-plugin": "link:test/server_integration/plugins/status_plugin_b", "@kbn/std": "link:packages/kbn-std", - "@kbn/streams-app-plugin": "link:x-pack/plugins/streams_app", - "@kbn/streams-plugin": "link:x-pack/plugins/streams", - "@kbn/synthetics-plugin": "link:x-pack/plugins/observability_solution/synthetics", + "@kbn/streams-app-plugin": "link:x-pack/solutions/observability/plugins/streams_app", + "@kbn/streams-plugin": "link:x-pack/solutions/observability/plugins/streams", + "@kbn/synthetics-plugin": "link:x-pack/solutions/observability/plugins/synthetics", "@kbn/synthetics-private-location": "link:x-pack/packages/kbn-synthetics-private-location", "@kbn/task-manager-fixture-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture", "@kbn/task-manager-performance-plugin": "link:x-pack/test/plugin_api_perf/plugins/task_manager_performance", @@ -957,8 +960,8 @@ "@kbn/testing-embedded-lens-plugin": "link:x-pack/examples/testing_embedded_lens", "@kbn/third-party-lens-navigation-prompt-plugin": "link:x-pack/examples/third_party_lens_navigation_prompt", "@kbn/third-party-vis-lens-example-plugin": "link:x-pack/examples/third_party_vis_lens_example", - "@kbn/threat-intelligence-plugin": "link:x-pack/plugins/threat_intelligence", - "@kbn/timelines-plugin": "link:x-pack/plugins/timelines", + "@kbn/threat-intelligence-plugin": "link:x-pack/solutions/security/plugins/threat_intelligence", + "@kbn/timelines-plugin": "link:x-pack/solutions/security/plugins/timelines", "@kbn/timelion-grammar": "link:packages/kbn-timelion-grammar", "@kbn/timerange": "link:packages/kbn-timerange", "@kbn/tinymath": "link:packages/kbn-tinymath", @@ -991,7 +994,7 @@ "@kbn/unsaved-changes-badge": "link:packages/kbn-unsaved-changes-badge", "@kbn/unsaved-changes-prompt": "link:packages/kbn-unsaved-changes-prompt", "@kbn/upgrade-assistant-plugin": "link:x-pack/plugins/upgrade_assistant", - "@kbn/uptime-plugin": "link:x-pack/plugins/observability_solution/uptime", + "@kbn/uptime-plugin": "link:x-pack/solutions/observability/plugins/uptime", "@kbn/url-drilldown-plugin": "link:x-pack/plugins/drilldowns/url_drilldown", "@kbn/url-forwarding-plugin": "link:src/plugins/url_forwarding", "@kbn/usage-collection-plugin": "link:src/plugins/usage_collection", @@ -1003,7 +1006,7 @@ "@kbn/utility-types": "link:packages/kbn-utility-types", "@kbn/utility-types-jest": "link:packages/kbn-utility-types-jest", "@kbn/utils": "link:packages/kbn-utils", - "@kbn/ux-plugin": "link:x-pack/plugins/observability_solution/ux", + "@kbn/ux-plugin": "link:x-pack/solutions/observability/plugins/ux", "@kbn/v8-profiler-examples-plugin": "link:examples/v8_profiler_examples", "@kbn/vis-default-editor-plugin": "link:src/plugins/vis_default_editor", "@kbn/vis-type-gauge-plugin": "link:src/plugins/vis_types/gauge", @@ -1130,7 +1133,7 @@ "del": "^6.1.0", "diff": "^5.1.0", "dotenv": "^16.4.5", - "elastic-apm-node": "^4.8.1", + "elastic-apm-node": "^4.9.0", "email-addresses": "^5.0.0", "eventsource-parser": "^3.0.0", "execa": "^5.1.1", @@ -1145,6 +1148,7 @@ "fnv-plus": "^1.3.1", "formik": "^2.4.6", "fp-ts": "^2.3.1", + "fuse.js": "^7.0.0", "get-port": "^5.0.0", "getopts": "^2.2.5", "getos": "^3.1.0", @@ -1168,7 +1172,7 @@ "joi-to-json": "^4.3.0", "jquery": "^3.5.0", "js-search": "^1.4.3", - "js-sha256": "^0.9.0", + "js-sha256": "^0.11.0", "js-yaml": "^4.1.0", "json-schema-to-ts": "^2.9.1", "json-stable-stringify": "^1.0.1", @@ -1487,6 +1491,7 @@ "@kbn/plugin-generator": "link:packages/kbn-plugin-generator", "@kbn/plugin-helpers": "link:packages/kbn-plugin-helpers", "@kbn/product-doc-artifact-builder": "link:x-pack/packages/ai-infra/product-doc-artifact-builder", + "@kbn/relocate": "link:packages/kbn-relocate", "@kbn/repo-file-maps": "link:packages/kbn-repo-file-maps", "@kbn/repo-linter": "link:packages/kbn-repo-linter", "@kbn/repo-path": "link:packages/kbn-repo-path", @@ -1501,7 +1506,7 @@ "@kbn/sort-package-json": "link:packages/kbn-sort-package-json", "@kbn/stdio-dev-helpers": "link:packages/kbn-stdio-dev-helpers", "@kbn/storybook": "link:packages/kbn-storybook", - "@kbn/synthetics-e2e": "link:x-pack/plugins/observability_solution/synthetics/e2e", + "@kbn/synthetics-e2e": "link:x-pack/solutions/observability/plugins/synthetics/e2e", "@kbn/telemetry-tools": "link:packages/kbn-telemetry-tools", "@kbn/test": "link:packages/kbn-test", "@kbn/test-eui-helpers": "link:packages/kbn-test-eui-helpers", @@ -1613,10 +1618,9 @@ "@types/mime": "^2.0.1", "@types/mime-types": "^2.1.0", "@types/minimatch": "^2.0.29", - "@types/minimist": "^1.2.2", + "@types/minimist": "^1.2.5", "@types/mock-fs": "^4.13.1", "@types/moment-duration-format": "^2.2.3", - "@types/multistream": "^4.1.0", "@types/mustache": "^0.8.31", "@types/nock": "^10.0.3", "@types/node": "20.10.5", @@ -1746,7 +1750,7 @@ "exit-hook": "^2.2.0", "expect": "^29.7.0", "expose-loader": "^0.7.5", - "express": "^4.21.1", + "express": "^4.21.2", "fetch-mock": "^7.3.9", "file-loader": "^4.2.0", "find-cypress-specs": "^1.41.4", @@ -1785,7 +1789,7 @@ "micromatch": "^4.0.8", "mini-css-extract-plugin": "1.1.0", "minimist": "^1.2.6", - "mocha": "^10.1.0", + "mocha": "^10.3.0", "mocha-junit-reporter": "^2.0.2", "mocha-multi-reporters": "^1.5.1", "mochawesome": "^7.1.3", @@ -1793,7 +1797,6 @@ "mock-fs": "^5.1.2", "ms-chromium-edge-driver": "^0.5.1", "msw": "^2.4.12", - "multistream": "^4.1.0", "mutation-observer": "^1.0.3", "native-hdr-histogram": "^1.0.0", "nock": "12.0.3", @@ -1842,7 +1845,7 @@ "swagger-jsdoc": "^6.2.8", "swagger-ui-express": "^5.0.1", "table": "^6.8.2", - "tape": "^5.0.1", + "tape": "^5.9.0", "terser": "^5.36.0", "terser-webpack-plugin": "^4.2.3", "tough-cookie": "^5.0.0", diff --git a/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts b/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts index f10d2cb3b3ac..a0cadaacfbf7 100644 --- a/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts +++ b/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.test.ts @@ -220,6 +220,16 @@ describe('RouteSecurity validation', () => { expect(() => validRouteSecurity(routeSecurity)).not.toThrow(); }); + it('should pass validation when operator privileges are combined with superuser', () => { + const routeSecurity = { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator, ReservedPrivilegesSet.superuser], + }, + }; + + expect(() => validRouteSecurity(routeSecurity)).not.toThrow(); + }); + it('should fail validation when anyRequired and allRequired have the same values', () => { const invalidRouteSecurity = { authz: { @@ -263,6 +273,20 @@ describe('RouteSecurity validation', () => { ); }); + it('should fail validation when allRequired has duplicate entries', () => { + const invalidRouteSecurity = { + authz: { + requiredPrivileges: [ + { anyRequired: ['privilege4', 'privilege5'], allRequired: ['privilege1', 'privilege1'] }, + ], + }, + }; + + expect(() => validRouteSecurity(invalidRouteSecurity)).toThrowErrorMatchingInlineSnapshot( + `"[authz.requiredPrivileges]: allRequired privileges must contain unique values"` + ); + }); + it('should fail validation when anyRequired has duplicates in multiple privilege entries', () => { const invalidRouteSecurity = { authz: { @@ -289,7 +313,7 @@ describe('RouteSecurity validation', () => { }; expect(() => validRouteSecurity(invalidRouteSecurity)).toThrowErrorMatchingInlineSnapshot( - `"[authz.requiredPrivileges]: Combining superuser with other privileges is redundant, superuser privileges set can be only used as a standalone privilege."` + `"[authz.requiredPrivileges]: Using superuser privileges in anyRequired is not allowed"` ); }); @@ -304,4 +328,41 @@ describe('RouteSecurity validation', () => { `"[authz.requiredPrivileges]: Combining superuser with other privileges is redundant, superuser privileges set can be only used as a standalone privilege."` ); }); + + it('should fail validation when anyRequired has operator privileges set', () => { + const invalidRouteSecurity = { + authz: { + requiredPrivileges: [ + { anyRequired: ['privilege1', 'privilege2'], allRequired: ['privilege4'] }, + { anyRequired: ['privilege5', ReservedPrivilegesSet.operator] }, + ], + }, + }; + + expect(() => validRouteSecurity(invalidRouteSecurity)).toThrowErrorMatchingInlineSnapshot( + `"[authz.requiredPrivileges]: Using operator privileges in anyRequired is not allowed"` + ); + }); + + it('should fail validation when operator privileges set is used as standalone', () => { + expect(() => + validRouteSecurity({ + authz: { + requiredPrivileges: [{ allRequired: [ReservedPrivilegesSet.operator] }], + }, + }) + ).toThrowErrorMatchingInlineSnapshot( + `"[authz.requiredPrivileges]: Operator privilege requires at least one additional non-operator privilege to be defined"` + ); + + expect(() => + validRouteSecurity({ + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator], + }, + }) + ).toThrowErrorMatchingInlineSnapshot( + `"[authz.requiredPrivileges]: Operator privilege requires at least one additional non-operator privilege to be defined"` + ); + }); }); diff --git a/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts b/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts index 65073f9a66ec..ec54c5e61ce0 100644 --- a/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts +++ b/packages/core/http/core-http-router-server-internal/src/security_route_config_validator.ts @@ -50,15 +50,33 @@ const requiredPrivilegesSchema = schema.arrayOf( } }); + if (anyRequired.includes(ReservedPrivilegesSet.superuser)) { + return 'Using superuser privileges in anyRequired is not allowed'; + } + + const hasSuperuserInAllRequired = allRequired.includes(ReservedPrivilegesSet.superuser); + const hasOperatorInAllRequired = allRequired.includes(ReservedPrivilegesSet.operator); + // Combining superuser with other privileges is redundant. // If user is a superuser, they inherently have access to all the privileges that may come with other roles. + // The exception is when superuser and operator are the only required privileges. if ( - anyRequired.includes(ReservedPrivilegesSet.superuser) || - (allRequired.includes(ReservedPrivilegesSet.superuser) && allRequired.length > 1) + hasSuperuserInAllRequired && + allRequired.length > 1 && + !(hasOperatorInAllRequired && allRequired.length === 2) ) { return 'Combining superuser with other privileges is redundant, superuser privileges set can be only used as a standalone privilege.'; } + // Operator privilege requires at least one additional non-operator privilege to be defined, that's why it's not allowed in anyRequired. + if (anyRequired.includes(ReservedPrivilegesSet.operator)) { + return 'Using operator privileges in anyRequired is not allowed'; + } + + if (hasOperatorInAllRequired && allRequired.length === 1) { + return 'Operator privilege requires at least one additional non-operator privilege to be defined'; + } + if (anyRequired.length && allRequired.length) { for (const privilege of anyRequired) { if (allRequired.includes(privilege)) { @@ -68,12 +86,20 @@ const requiredPrivilegesSchema = schema.arrayOf( } if (anyRequired.length) { - const uniquePrivileges = new Set([...anyRequired]); + const uniqueAnyPrivileges = new Set([...anyRequired]); - if (anyRequired.length !== uniquePrivileges.size) { + if (anyRequired.length !== uniqueAnyPrivileges.size) { return 'anyRequired privileges must contain unique values'; } } + + if (allRequired.length) { + const uniqueAllPrivileges = new Set([...allRequired]); + + if (allRequired.length !== uniqueAllPrivileges.size) { + return 'allRequired privileges must contain unique values'; + } + } }, minSize: 1, } diff --git a/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap b/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap index 9df54435ba9a..192c892b0128 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap +++ b/packages/core/overlays/core-overlays-browser-internal/src/flyout/__snapshots__/flyout_service.test.tsx.snap @@ -160,7 +160,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -280,7 +293,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, diff --git a/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap b/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap index cc2dc671f921..c0e94fc9fb2d 100644 --- a/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap +++ b/packages/core/overlays/core-overlays-browser-internal/src/modal/__snapshots__/modal_service.test.tsx.snap @@ -102,7 +102,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -380,7 +393,28 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -715,7 +749,36 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -969,7 +1032,36 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -1228,7 +1320,36 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -1482,7 +1603,36 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + Array [], + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -1696,7 +1846,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -1816,7 +1979,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -1941,7 +2117,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, @@ -2061,7 +2250,20 @@ Array [ } theme={ Object { - "getTheme": [MockFunction], + "getTheme": [MockFunction] { + "calls": Array [ + Array [], + ], + "results": Array [ + Object { + "type": "return", + "value": Object { + "darkMode": false, + "name": "amsterdam", + }, + }, + ], + }, "theme$": Observable { "_subscribe": [Function], }, diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/open_point_in_time.test.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/open_point_in_time.test.ts index ca07f39d6620..2efc33eddddf 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/open_point_in_time.test.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/apis/open_point_in_time.test.ts @@ -36,6 +36,7 @@ import { createGenericNotFoundErrorPayload, } from '../../test_helpers/repository.test.common'; import { PointInTimeFinder } from '../point_in_time_finder'; +import { OpenPointInTimeResponse } from '@elastic/elasticsearch/lib/api/types'; describe('SavedObjectsRepository', () => { let client: ReturnType; @@ -81,7 +82,7 @@ describe('SavedObjectsRepository', () => { describe('#openPointInTimeForType', () => { const type = 'index-pattern'; - const generateResults = (id?: string) => ({ id: id || 'id' }); + const generateResults = (id?: string) => ({ id: id || 'id' } as OpenPointInTimeResponse); const successResponse = async (type: string, options?: SavedObjectsOpenPointInTimeOptions) => { client.openPointInTime.mockResponseOnce(generateResults()); const result = await repository.openPointInTimeForType(type, options); @@ -136,7 +137,7 @@ describe('SavedObjectsRepository', () => { it(`throws when ES is unable to find the index`, async () => { client.openPointInTime.mockResolvedValueOnce( elasticsearchClientMock.createSuccessTransportRequestPromise( - { id: 'error' }, + { id: 'error' } as OpenPointInTimeResponse, { statusCode: 404 } ) ); diff --git a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.security_extension.test.ts b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.security_extension.test.ts index 984a60814d59..171b37c3a6b3 100644 --- a/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.security_extension.test.ts +++ b/packages/core/saved-objects/core-saved-objects-api-server-internal/src/lib/repository.security_extension.test.ts @@ -66,6 +66,7 @@ import { import { savedObjectsExtensionsMock } from '../mocks/saved_objects_extensions.mock'; import { arrayMapsAreEqual } from '@kbn/core-saved-objects-utils-server'; import { mockAuthenticatedUser } from '@kbn/core-security-common/mocks'; +import { OpenPointInTimeResponse } from '@elastic/elasticsearch/lib/api/types'; describe('SavedObjectsRepository Security Extension', () => { let client: ReturnType; @@ -676,7 +677,7 @@ describe('SavedObjectsRepository Security Extension', () => { test(`returns result when partially authorized`, async () => { setupAuthorizeFunc(mockSecurityExt.authorizeOpenPointInTime, 'partially_authorized'); - client.openPointInTime.mockResponseOnce({ id }); + client.openPointInTime.mockResponseOnce({ id } as OpenPointInTimeResponse); const result = await repository.openPointInTimeForType(type); expect(mockSecurityExt.authorizeOpenPointInTime).toHaveBeenCalledTimes(1); @@ -687,7 +688,7 @@ describe('SavedObjectsRepository Security Extension', () => { test(`returns result when fully authorized`, async () => { setupAuthorizeFunc(mockSecurityExt.authorizeOpenPointInTime, 'fully_authorized'); - client.openPointInTime.mockResponseOnce({ id }); + client.openPointInTime.mockResponseOnce({ id } as OpenPointInTimeResponse); const result = await repository.openPointInTimeForType(type); expect(mockSecurityExt.authorizeOpenPointInTime).toHaveBeenCalledTimes(1); @@ -702,7 +703,7 @@ describe('SavedObjectsRepository Security Extension', () => { test(`calls authorizeOpenPointInTime with correct parameters`, async () => { setupAuthorizeFunc(mockSecurityExt.authorizeOpenPointInTime, 'fully_authorized'); - client.openPointInTime.mockResponseOnce({ id }); + client.openPointInTime.mockResponseOnce({ id } as OpenPointInTimeResponse); const namespaces = [namespace, 'x', 'y', 'z']; await repository.openPointInTimeForType(type, { namespaces }); expect(mockSecurityExt.authorizeOpenPointInTime).toHaveBeenCalledTimes(1); diff --git a/packages/core/security/core-security-common/src/authentication/authenticated_user.ts b/packages/core/security/core-security-common/src/authentication/authenticated_user.ts index 4aa871125052..d80ff8f434a4 100644 --- a/packages/core/security/core-security-common/src/authentication/authenticated_user.ts +++ b/packages/core/security/core-security-common/src/authentication/authenticated_user.ts @@ -60,4 +60,9 @@ export interface AuthenticatedUser extends User { * User profile ID of this user. */ profile_uid?: string; + + /** + * Indicates whether user is an operator. + */ + operator?: boolean; } diff --git a/packages/deeplinks/observability/jest.config.js b/packages/deeplinks/observability/jest.config.js deleted file mode 100644 index 76553cb46847..000000000000 --- a/packages/deeplinks/observability/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/packages/deeplinks/observability'], -}; diff --git a/packages/deeplinks/observability/tsconfig.json b/packages/deeplinks/observability/tsconfig.json deleted file mode 100644 index 425a5a861285..000000000000 --- a/packages/deeplinks/observability/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/utility-types", - "@kbn/es-query", - ] -} diff --git a/packages/deeplinks/security/deep_links.ts b/packages/deeplinks/security/deep_links.ts index c1d9b3b3cb6a..2f8229def91d 100644 --- a/packages/deeplinks/security/deep_links.ts +++ b/packages/deeplinks/security/deep_links.ts @@ -72,7 +72,7 @@ export enum SecurityPageName { siemMigrationsRules = 'siem_migrations-rules', /* * Warning: Computed values are not permitted in an enum with string valued members - * All threat intelligence page names must match `TIPageId` in x-pack/plugins/threat_intelligence/public/common/navigation/types.ts + * All threat intelligence page names must match `TIPageId` in x-pack/solutions/security/plugins/threat_intelligence/public/common/navigation/types.ts */ threatIntelligence = 'threat_intelligence', timelines = 'timelines', diff --git a/packages/kbn-alerts-ui-shared/tsconfig.json b/packages/kbn-alerts-ui-shared/tsconfig.json index 07a52c9d9c1b..30be2e17af3e 100644 --- a/packages/kbn-alerts-ui-shared/tsconfig.json +++ b/packages/kbn-alerts-ui-shared/tsconfig.json @@ -34,6 +34,6 @@ "@kbn/alerts-as-data-utils", "@kbn/core-http-browser-mocks", "@kbn/core-notifications-browser-mocks", - "@kbn/shared-ux-table-persist" + "@kbn/shared-ux-table-persist", ] } 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 8fa7a5997f4f..e4e382860767 100644 --- a/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts +++ b/packages/kbn-apm-synthtrace-client/src/lib/logs/index.ts @@ -83,6 +83,7 @@ export type LogDocument = Fields & 'kubernetes.pod.name'?: string; 'kubernetes.container.name'?: string; 'orchestrator.resource.name'?: string; + tags?: string | string[]; }>; class Log extends Serializable { diff --git a/packages/kbn-apm-synthtrace/src/lib/utils/stream_utils.ts b/packages/kbn-apm-synthtrace/src/lib/utils/stream_utils.ts index 9e52e9fc2b0a..77aba18974b3 100644 --- a/packages/kbn-apm-synthtrace/src/lib/utils/stream_utils.ts +++ b/packages/kbn-apm-synthtrace/src/lib/utils/stream_utils.ts @@ -8,11 +8,29 @@ */ import { eachSeries } from 'async'; -import MultiStream from 'multistream'; -import { Duplex, Readable, Transform } from 'stream'; +import { Duplex, Readable, Transform, PassThrough } from 'stream'; + +/** + * Pipe one or many streams sequentially into the destination stream. Once all + * source streams have been exhausted, the destination stream is ended. + * @param sources A collection of streams to read from + * @param destination The stream to pipe data to + */ +async function combineStreams(sources: Readable[], destination: PassThrough) { + for (const stream of sources) { + await new Promise((resolve, reject) => { + stream.on('end', resolve); + stream.on('error', reject); + stream.pipe(destination, { end: false }); + }); + } + destination.emit('end'); +} export function sequential(...streams: Readable[]) { - return new MultiStream(streams, { objectMode: true }); + const output = new PassThrough({ objectMode: true }); + combineStreams(streams, output).catch((err) => output.destroy(err)); + return output; } export function fork(...streams: Transform[]): Duplex { diff --git a/packages/kbn-babel-preset/styled_components_files.js b/packages/kbn-babel-preset/styled_components_files.js index 89b71c06d9e8..89bb20750266 100644 --- a/packages/kbn-babel-preset/styled_components_files.js +++ b/packages/kbn-babel-preset/styled_components_files.js @@ -15,9 +15,11 @@ module.exports = { USES_STYLED_COMPONENTS: [ /packages[\/\\]kbn-ui-shared-deps-(npm|src)[\/\\]/, /src[\/\\]plugins[\/\\](kibana_react)[\/\\]/, + /x-pack[\/\\]solutions[\/\\]observability[\/\\]plugins[\/\\]/, /x-pack[\/\\]plugins[\/\\](observability_solution\/apm|beats_management|fleet|observability_solution\/infra|lists|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, + /x-pack[\/\\]solutions[\/\\]security[\/\\]plugins[\/\\](observability_solution\/apm|beats_management|fleet|observability_solution\/infra|lists|observability_solution\/observability|observability_solution\/observability_shared|observability_solution\/exploratory_view|security_solution|timelines|observability_solution\/synthetics|observability_solution\/ux|observability_solution\/uptime)[\/\\]/, /x-pack[\/\\]test[\/\\]plugin_functional[\/\\]plugins[\/\\]resolver_test[\/\\]/, /x-pack[\/\\]packages[\/\\]elastic_assistant[\/\\]/, - /x-pack[\/\\]packages[\/\\]security-solution[\/\\]ecs_data_quality_dashboard[\/\\]/, + /x-pack[\/\\]solutions[\/\\]security[\/\\]packages[\/\\]ecs_data_quality_dashboard[\/\\]/, ], }; diff --git a/packages/kbn-check-mappings-update-cli/current_fields.json b/packages/kbn-check-mappings-update-cli/current_fields.json index 45313933ab1b..75601611ad3d 100644 --- a/packages/kbn-check-mappings-update-cli/current_fields.json +++ b/packages/kbn-check-mappings-update-cli/current_fields.json @@ -3,7 +3,9 @@ "actionTypeId", "name" ], - "action_task_params": [], + "action_task_params": [ + "apiKeyId" + ], "ad_hoc_run_params": [ "apiKeyId", "createdAt", @@ -1098,6 +1100,7 @@ "enabled", "ownerId", "partition", + "priority", "retryAt", "runAt", "schedule", diff --git a/packages/kbn-check-mappings-update-cli/current_mappings.json b/packages/kbn-check-mappings-update-cli/current_mappings.json index 663fef8f4fef..37263aa85e1a 100644 --- a/packages/kbn-check-mappings-update-cli/current_mappings.json +++ b/packages/kbn-check-mappings-update-cli/current_mappings.json @@ -17,7 +17,11 @@ }, "action_task_params": { "dynamic": false, - "properties": {} + "properties": { + "apiKeyId": { + "type": "keyword" + } + } }, "ad_hoc_run_params": { "dynamic": false, @@ -3630,6 +3634,9 @@ "partition": { "type": "integer" }, + "priority": { + "type": "integer" + }, "retryAt": { "type": "date" }, diff --git a/packages/kbn-code-owners/index.ts b/packages/kbn-code-owners/index.ts index 8966b9283408..df85bb6d9c62 100644 --- a/packages/kbn-code-owners/index.ts +++ b/packages/kbn-code-owners/index.ts @@ -7,9 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export type { PathWithOwners } from './src/file_code_owner'; +export type { CodeOwnersEntry } from './src/code_owners'; +export * as cli from './src/cli'; export { - getPathsWithOwnersReversed, - getCodeOwnersForFile, - runGetOwnersForFileCli, -} from './src/file_code_owner'; + getCodeOwnersEntries, + findCodeOwnersEntryForPath, + getOwningTeamsForPath, +} from './src/code_owners'; diff --git a/packages/kbn-code-owners/src/cli.ts b/packages/kbn-code-owners/src/cli.ts new file mode 100644 index 000000000000..9e7a839e0546 --- /dev/null +++ b/packages/kbn-code-owners/src/cli.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { run } from '@kbn/dev-cli-runner'; +import { findCodeOwnersEntryForPath } from './code_owners'; +import { throwIfPathIsMissing, throwIfPathNotInRepo } from './path'; + +/** + * CLI entrypoint for finding code owners for a given path. + */ +export async function findCodeOwnersForPath() { + await run( + async ({ flagsReader, log }) => { + const targetPath = flagsReader.requiredPath('path'); + throwIfPathIsMissing(targetPath, 'Target path', true); + throwIfPathNotInRepo(targetPath, true); + + const codeOwnersEntry = findCodeOwnersEntryForPath(targetPath); + + if (!codeOwnersEntry) { + log.warning(`No matching code owners entry found for path ${targetPath}`); + return; + } + + if (flagsReader.boolean('json')) { + // Replacer function that hides irrelevant fields in JSON output + const hideIrrelevantFields = (k: string, v: any) => { + return ['matcher'].includes(k) ? undefined : v; + }; + + log.write(JSON.stringify(codeOwnersEntry, hideIrrelevantFields, 2)); + return; + } + + log.write(`Matching pattern: ${codeOwnersEntry.pattern}`); + log.write('Teams:', codeOwnersEntry.teams); + }, + { + description: `Find code owners for a given path in this local Kibana repository`, + flags: { + string: ['path'], + boolean: ['json'], + help: ` + --path Path to find owners for (required) + --json Output result as JSON`, + }, + } + ); +} diff --git a/packages/kbn-code-owners/src/code_owners.ts b/packages/kbn-code-owners/src/code_owners.ts new file mode 100644 index 000000000000..47aa2a67171c --- /dev/null +++ b/packages/kbn-code-owners/src/code_owners.ts @@ -0,0 +1,127 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { REPO_ROOT } from '@kbn/repo-info'; +import fs from 'node:fs'; +import path from 'node:path'; + +import ignore, { Ignore } from 'ignore'; +import { CODE_OWNERS_FILE, throwIfPathIsMissing, throwIfPathNotInRepo } from './path'; + +export interface CodeOwnersEntry { + pattern: string; + matcher: Ignore; + teams: string[]; + comment?: string; +} + +/** + * Generator function that yields lines from the CODEOWNERS file + */ +export function* getCodeOwnersLines(): Generator { + const codeOwnerLines = fs + .readFileSync(CODE_OWNERS_FILE, { encoding: 'utf8', flag: 'r' }) + .split(/\r?\n/); + + for (const line of codeOwnerLines) { + // Empty line + if (line.length === 0) continue; + + // Comment + if (line.startsWith('#')) continue; + + // Assignment override on backport branches to avoid review requests + if (line.includes('@kibanamachine')) continue; + + yield line.trim(); + } +} + +/** + * Get all code owner entries from the CODEOWNERS file + * + * Entries are ordered in reverse relative to how they're defined in the CODEOWNERS file + * as patterns defined lower in the CODEOWNERS file can override earlier entries. + */ +export function getCodeOwnersEntries(): CodeOwnersEntry[] { + const entries: CodeOwnersEntry[] = []; + + for (const line of getCodeOwnersLines()) { + const comment = line + .match(/#(.+)$/) + ?.at(1) + ?.trim(); + + const [rawPathPattern, ...rawTeams] = line + .replace(/#.+$/, '') // drop comment + .split(/\s+/); + + const pathPattern = rawPathPattern.replace(/\/$/, ''); + + entries.push({ + pattern: pathPattern, + teams: rawTeams.map((t) => t.replace('@', '')).filter((t) => t.length > 0), + comment, + + // Register code owner entry with the `ignores` lib for easy pattern matching later on + matcher: ignore().add(pathPattern), + }); + } + + // Reverse entry order as patterns defined lower in the CODEOWNERS file can override earlier entries + entries.reverse(); + + return entries; +} + +/** + * Get a list of matching code owners for a given path + * + * Tip: + * If you're making a lot of calls to this function, fetch the code owner paths once using + * `getCodeOwnersEntries` and pass it in the `getCodeOwnersEntries` parameter to speed up your queries.. + * + * @param searchPath The path to find code owners for + * @param codeOwnersEntries Pre-defined list of code owner paths to search in + * + * @returns Code owners entry if a match is found. + * @throws Error if `searchPath` does not exist or is not part of this repository + */ +export function findCodeOwnersEntryForPath( + searchPath: string, + codeOwnersEntries?: CodeOwnersEntry[] +): CodeOwnersEntry | undefined { + throwIfPathIsMissing(CODE_OWNERS_FILE, 'Code owners file'); + throwIfPathNotInRepo(searchPath); + const searchPathRelativeToRepo = path.relative(REPO_ROOT, searchPath); + + return (codeOwnersEntries || getCodeOwnersEntries()).find( + (p) => p.matcher.test(searchPathRelativeToRepo).ignored + ); +} + +/** + * Get a list of matching code owners for a given path + * + * Tip: + * If you're making a lot of calls to this function, fetch the code owner paths once using + * `getCodeOwnersEntries` and pass it in the `getCodeOwnersEntries` parameter to speed up your queries. + * + * @param searchPath The path to find code owners for + * @param codeOwnersEntries Pre-defined list of code owner entries + * + * @returns List of code owners for the given path. Empty list if no matching entry is found. + * @throws Error if `searchPath` does not exist or is not part of this repository + */ +export function getOwningTeamsForPath( + searchPath: string, + codeOwnersEntries?: CodeOwnersEntry[] +): string[] { + return findCodeOwnersEntryForPath(searchPath, codeOwnersEntries)?.teams || []; +} diff --git a/packages/kbn-code-owners/src/file_code_owner.ts b/packages/kbn-code-owners/src/file_code_owner.ts deleted file mode 100644 index a7812a6121d9..000000000000 --- a/packages/kbn-code-owners/src/file_code_owner.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { REPO_ROOT } from '@kbn/repo-info'; -import { createFailError, createFlagError } from '@kbn/dev-cli-errors'; -import { join as joinPath } from 'path'; -import { existsSync, readFileSync } from 'fs'; -import { run } from '@kbn/dev-cli-runner'; - -import type { Ignore } from 'ignore'; -import ignore from 'ignore'; - -export interface PathWithOwners { - path: string; - teams: string; - ignorePattern: Ignore; -} -const existOrThrow = (targetFile: string) => { - if (existsSync(targetFile) === false) - throw createFailError(`Unable to determine code owners: file ${targetFile} Not Found`); -}; - -/** - * Get the .github/CODEOWNERS entries, prepared for path matching. - * The last matching CODEOWNERS entry has highest precedence: - * https://help.github.com/articles/about-codeowners/ - * so entries are returned in reversed order to later search for the first match. - */ -export function getPathsWithOwnersReversed(): PathWithOwners[] { - const codeownersPath = joinPath(REPO_ROOT, '.github', 'CODEOWNERS'); - existOrThrow(codeownersPath); - const codeownersContent = readFileSync(codeownersPath, { encoding: 'utf8', flag: 'r' }); - const codeownersLines = codeownersContent.split(/\r?\n/); - const codeowners = codeownersLines - .map((line) => line.trim()) - .filter((line) => line && line[0] !== '#') - // kibanamachine is an assignment override on backport branches to avoid review requests - .filter((line) => line && !line.includes('@kibanamachine')); - - const pathsWithOwners: PathWithOwners[] = codeowners.map((c) => { - const [path, ...ghTeams] = c.split(/\s+/); - const cleanedPath = path.replace(/\/$/, ''); // remove trailing slash - return { - path: cleanedPath, - teams: ghTeams.map((t) => t.replace('@', '')).join(), - // register CODEOWNERS entries with the `ignores` lib for later path matching - ignorePattern: ignore().add([cleanedPath]), - }; - }); - - return pathsWithOwners.reverse(); -} - -/** - * Get the GitHub CODEOWNERS for a file in the repository - * @param filePath the file to get code owners for - * @param reversedCodeowners a cached reversed code owners list, use to speed up multiple requests - */ -export function getCodeOwnersForFile( - filePath: string, - reversedCodeowners?: PathWithOwners[] -): string | undefined { - const pathsWithOwners = reversedCodeowners ?? getPathsWithOwnersReversed(); - - const match = pathsWithOwners.find((p) => p.ignorePattern.test(filePath).ignored); - - return match?.teams; -} - -/** - * Run the getCodeOwnersForFile() method above. - * Report back to the cli with either success and the owner(s), or a failure. - * - * This function depends on a --file param being passed on the cli, like this: - * $ node scripts/get_owners_for_file.js --file SOME-FILE - */ -export async function runGetOwnersForFileCli() { - run( - async ({ flags, log }) => { - const targetFile = flags.file as string; - if (!targetFile) throw createFlagError(`Missing --file argument`); - existOrThrow(targetFile); // This call is duplicated in getPathsWithOwnersReversed(), so this is a short circuit - const result = getCodeOwnersForFile(targetFile); - if (result) log.success(result); - else log.error(`Ownership of file [${targetFile}] is UNKNOWN`); - }, - { - description: 'Report file ownership from GitHub CODEOWNERS file.', - flags: { - string: ['file'], - help: ` - --file Required, path to the file to report owners for. - `, - }, - } - ); -} diff --git a/packages/kbn-code-owners/src/path.ts b/packages/kbn-code-owners/src/path.ts new file mode 100644 index 000000000000..4a8c09b041c8 --- /dev/null +++ b/packages/kbn-code-owners/src/path.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import fs from 'node:fs'; +import path from 'node:path'; +import { createFailError } from '@kbn/dev-cli-errors'; +import { REPO_ROOT } from '@kbn/repo-info'; + +/** CODEOWNERS file path **/ +export const CODE_OWNERS_FILE = path.join(REPO_ROOT, '.github', 'CODEOWNERS'); + +/** + * Throw an error if the given path does not exist + * + * @param targetPath Path to check + * @param description Path description used in the error message if an exception is thrown + * @param cli Whether this function is called from a CLI context + */ +export function throwIfPathIsMissing( + targetPath: fs.PathLike, + description = 'File', + cli: boolean = false +) { + if (fs.existsSync(targetPath)) return; + const msg = `${description} ${targetPath} does not exist`; + throw cli ? createFailError(msg) : new Error(msg); +} + +/** + * Throw an error if the given path does not reside in this repo + * + * @param targetPath Path to check + * @param cli Whether this function is called from a CLI context + */ +export function throwIfPathNotInRepo(targetPath: fs.PathLike, cli: boolean = false) { + const relativePath = path.relative(REPO_ROOT, targetPath.toString()); + + if (relativePath.includes('../')) { + const msg = `Path ${targetPath} is not part of this repository.`; + throw cli ? createFailError(msg) : new Error(msg); + } +} diff --git a/packages/kbn-coloring/src/palettes/types.ts b/packages/kbn-coloring/src/palettes/types.ts index b5e81a437f6d..5a43c6509796 100644 --- a/packages/kbn-coloring/src/palettes/types.ts +++ b/packages/kbn-coloring/src/palettes/types.ts @@ -140,7 +140,9 @@ export interface CustomPaletteParams { progression?: 'fixed'; rangeMin?: number; rangeMax?: number; + /** lower color stops */ stops?: ColorStop[]; + /** upper color stops */ colorStops?: ColorStop[]; steps?: number; maxSteps?: number | undefined; diff --git a/packages/kbn-coloring/src/palettes/utils.test.ts b/packages/kbn-coloring/src/palettes/utils.test.ts index 8292c7440063..e7595a738bf1 100644 --- a/packages/kbn-coloring/src/palettes/utils.test.ts +++ b/packages/kbn-coloring/src/palettes/utils.test.ts @@ -9,6 +9,7 @@ import { getPaletteRegistry } from './mocks/palettes_registry'; import { + applyPaletteParams, getDataMinMax, getPaletteStops, getStepValue, @@ -312,3 +313,43 @@ describe('getStepValue', () => { ).toBe(1); }); }); + +describe('applyPaletteParams', () => { + const paletteRegistry = getPaletteRegistry(); + it('should return a palette stops array only by the name', () => { + expect( + applyPaletteParams( + paletteRegistry, + { name: 'default', type: 'palette', params: { name: 'default' } }, + { min: 0, max: 100 } + ) + ).toEqual([ + // stops are 0 and 50 by with a 20 offset (100 divided by 5 steps) for display + // the mock palette service has only 2 colors so tests are a bit off by that + { color: 'red', stop: 20 }, + { color: 'black', stop: 70 }, + ]); + }); + + it('should return a palette stops array reversed', () => { + expect( + applyPaletteParams( + paletteRegistry, + { name: 'default', type: 'palette', params: { name: 'default', reverse: true } }, + { min: 0, max: 100 } + ) + ).toEqual([ + { color: 'black', stop: 20 }, + { color: 'red', stop: 70 }, + ]); + }); + + it('should pick the default palette from the activePalette object when passed', () => { + expect( + applyPaletteParams(paletteRegistry, { name: 'mocked', type: 'palette' }, { min: 0, max: 100 }) + ).toEqual([ + { color: 'blue', stop: 20 }, + { color: 'yellow', stop: 70 }, + ]); + }); +}); diff --git a/packages/kbn-coloring/src/palettes/utils.ts b/packages/kbn-coloring/src/palettes/utils.ts index c10ef98f825a..a4a3c24f6a79 100644 --- a/packages/kbn-coloring/src/palettes/utils.ts +++ b/packages/kbn-coloring/src/palettes/utils.ts @@ -13,6 +13,7 @@ import { CustomPaletteParams, DataBounds, ColorStop, + PaletteOutput, } from './types'; import { @@ -20,9 +21,10 @@ import { DEFAULT_PALETTE_NAME, DEFAULT_MAX_STOP, DEFAULT_MIN_STOP, + CUSTOM_PALETTE, + COMPLEMENTARY_PALETTE, DEFAULT_FALLBACK_PALETTE, LEGACY_COMPLIMENTARY_PALETTE, - COMPLEMENTARY_PALETTE, } from './constants'; /** @internal **/ @@ -204,3 +206,46 @@ export function getActivePaletteName(name?: string): string { } return paletteName; } + +export function applyPaletteParams>( + palettes: PaletteRegistry, + activePalette: T, + dataBounds: DataBounds +) { + // make a copy of it as they have to be manipulated later on + const displayStops = getPaletteStops(palettes, activePalette?.params || {}, { + dataBounds, + defaultPaletteName: activePalette?.name, + }); + + if (activePalette?.params?.reverse && activePalette?.params?.name !== CUSTOM_PALETTE) { + return reversePalette(displayStops); + } + return displayStops; +} + +/** + * Returns color stops for given palette type: + * + * - custom - User has modified the stops in some way - return stops as is + * - non-custom - Default palette stops - Return new stops based on palette + * + * > This is needed for BWC when switching between kibana themes. + */ +export function getOverridePaletteStops>( + paletteService: PaletteRegistry, + activePalette?: T +) { + if (!activePalette || activePalette.name === CUSTOM_PALETTE || !activePalette.params?.stops) { + return activePalette?.params?.stops; + } + + const { stops, ...otherParams } = activePalette.params; + const colors = paletteService + .get(activePalette.name ?? DEFAULT_PALETTE_NAME) + .getCategoricalColors(stops.length, otherParams); + return stops.map((stop, i) => ({ + ...stop, + color: colors[i], + })); +} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx index 3eebf74205a0..3ebc8064987b 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/__stories__/color_mapping.stories.tsx @@ -8,11 +8,11 @@ */ import React, { FC, useState } from 'react'; +import { getKbnPalettes } from '@kbn/palettes'; import { EuiFlyout, EuiForm, EuiPage, isColorDark } from '@elastic/eui'; import { ComponentStory } from '@storybook/react'; import { css } from '@emotion/react'; import { CategoricalColorMapping, ColorMappingProps } from '../categorical_color_mapping'; -import { AVAILABLE_PALETTES, getPalette, NeutralPalette } from '../palettes'; import { DEFAULT_COLOR_MAPPING_CONFIG } from '../config/default_color_mapping'; import { ColorMapping } from '../config'; import { getColorFactory } from '../color/color_handling'; @@ -30,9 +30,8 @@ const Template: ComponentStory> = (args) => { DEFAULT_COLOR_MAPPING_CONFIG ); - const getPaletteFn = getPalette(AVAILABLE_PALETTES, NeutralPalette); - - const colorFactory = getColorFactory(updatedModel, getPaletteFn, false, args.data); + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + const colorFactory = getColorFactory(updatedModel, palettes, false, args.data); return ( @@ -71,7 +70,7 @@ const Template: ComponentStory> = (args) => { ownFocus={false} > - + @@ -82,6 +81,7 @@ export const Default = Template.bind({}); Default.args = { model: { ...DEFAULT_COLOR_MAPPING_CONFIG, + paletteId: 'eui_amsterdam', colorMode: { type: 'categorical', @@ -119,7 +119,6 @@ Default.args = { ], }, - palettes: AVAILABLE_PALETTES, specialTokens: new Map(), // eslint-disable-next-line no-console onModelUpdate: (model) => console.log(model), diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx index dd7b12305fda..530f16f912d0 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/categorical_color_mapping.test.tsx @@ -10,9 +10,9 @@ import React from 'react'; import { mount } from 'enzyme'; import { CategoricalColorMapping, ColorMappingInputData } from './categorical_color_mapping'; -import { AVAILABLE_PALETTES } from './palettes'; import { DEFAULT_COLOR_MAPPING_CONFIG } from './config/default_color_mapping'; import { MULTI_FIELD_KEY_SEPARATOR } from '@kbn/data-plugin/common'; +import { getKbnPalettes } from '@kbn/palettes'; const ASSIGNMENTS_LIST = '[data-test-subj="lns-colorMapping-assignmentsList"]'; const ASSIGNMENTS_PROMPT = '[data-test-subj="lns-colorMapping-assignmentsPrompt"]'; @@ -20,6 +20,8 @@ const ASSIGNMENTS_PROMPT_ADD_ALL = '[data-test-subj="lns-colorMapping-assignment const ASSIGNMENT_ITEM = (i: number) => `[data-test-subj="lns-colorMapping-assignmentsItem${i}"]`; describe('color mapping', () => { + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + it('load a default color mapping', () => { const dataInput: ColorMappingInputData = { type: 'categories', @@ -31,7 +33,7 @@ describe('color mapping', () => { data={dataInput} isDarkMode={false} model={{ ...DEFAULT_COLOR_MAPPING_CONFIG }} - palettes={AVAILABLE_PALETTES} + palettes={palettes} onModelUpdate={onModelUpdateFn} specialTokens={new Map()} /> @@ -53,7 +55,7 @@ describe('color mapping', () => { data={dataInput} isDarkMode={false} model={{ ...DEFAULT_COLOR_MAPPING_CONFIG }} - palettes={AVAILABLE_PALETTES} + palettes={palettes} onModelUpdate={onModelUpdateFn} specialTokens={new Map()} /> @@ -81,7 +83,7 @@ describe('color mapping', () => { data={dataInput} isDarkMode={false} model={{ ...DEFAULT_COLOR_MAPPING_CONFIG }} - palettes={AVAILABLE_PALETTES} + palettes={palettes} onModelUpdate={onModelUpdateFn} specialTokens={ new Map([ 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 668cdc7ce07f..8bd006ba9c66 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 @@ -11,6 +11,7 @@ import React from 'react'; import { Provider } from 'react-redux'; import { type EnhancedStore, configureStore } from '@reduxjs/toolkit'; import { isEqual } from 'lodash'; +import { KbnPalettes } from '@kbn/palettes'; import { colorMappingReducer, updateModel } from './state/color_mapping'; import { Container } from './components/container/container'; import { ColorMapping } from './config'; @@ -43,8 +44,8 @@ export type ColorMappingInputData = export interface ColorMappingProps { /** The initial color mapping model, usually coming from a the visualization saved object */ model: ColorMapping.Config; - /** A map of paletteId and palette configuration */ - palettes: Map; + /** A collection of palette configurations */ + palettes: KbnPalettes; /** A data description of what needs to be colored */ data: ColorMappingInputData; /** Theme dark mode */ diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts index 627f39e5026a..c97100781e00 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/color/color_handling.test.ts @@ -12,64 +12,52 @@ import { DEFAULT_NEUTRAL_PALETTE_INDEX, } from '../config/default_color_mapping'; import { getColorFactory } from './color_handling'; -import { getPalette, AVAILABLE_PALETTES } from '../palettes'; -import { - EUIAmsterdamColorBlindPalette, - EUI_AMSTERDAM_PALETTE_COLORS, -} from '../palettes/eui_amsterdam'; -import { NeutralPalette, NEUTRAL_COLOR_DARK, NEUTRAL_COLOR_LIGHT } from '../palettes/neutral'; import { toHex } from './color_math'; -import { ColorMapping } from '../config'; +import { KbnPalette, getKbnPalettes } from '@kbn/palettes'; describe('Color mapping - color generation', () => { - const getPaletteFn = getPalette(AVAILABLE_PALETTES, NeutralPalette); + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + const neutralPaletteColors = palettes + .get(KbnPalette.Neutral) + .colors() + .map((c) => c.toLowerCase()); + const elasticPaletteColors = palettes + .get(KbnPalette.Default) + .colors() + .map((c) => c.toLowerCase()); it('returns EUI light colors from default config', () => { - const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, false, { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, palettes, false, { type: 'categories', categories: ['catA', 'catB', 'catC'], }); - expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); - expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); - expect(colorFactory('catC')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + expect(colorFactory('catA')).toBe(elasticPaletteColors[0]); + expect(colorFactory('catB')).toBe(elasticPaletteColors[1]); + expect(colorFactory('catC')).toBe(elasticPaletteColors[2]); // if the category is not available in the `categories` list then a default netural is used // this is an edge case and ideally never happen expect(colorFactory('not_available_1')).toBe( - NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX] + neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX] ); }); // currently there is no difference in the two colors, but this could change in the future // this test will catch the change it('returns EUI dark colors from default config', () => { - const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, true, { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, palettes, true, { type: 'categories', categories: ['catA', 'catB', 'catC'], }); - expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); - expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); - expect(colorFactory('catC')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + expect(colorFactory('catA')).toBe(elasticPaletteColors[0]); + expect(colorFactory('catB')).toBe(elasticPaletteColors[1]); + expect(colorFactory('catC')).toBe(elasticPaletteColors[2]); // if the category is not available in the `categories` list then a default netural is used // this is an edge case and ideally never happen - expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_DARK[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('not_available')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); }); it('by default loops colors defined in palette', () => { - const twoColorPalette: ColorMapping.CategoricalPalette = { - id: 'twoColors', - name: 'twoColors', - colorCount: 2, - type: 'categorical', - getColor(indexInRange, isDarkMode, loop) { - return ['red', 'blue'][loop ? indexInRange % 2 : indexInRange]; - }, - }; - - const simplifiedGetPaletteGn = getPalette( - new Map([[twoColorPalette.id, twoColorPalette]]), - NeutralPalette - ); const colorFactory = getColorFactory( { ...DEFAULT_COLOR_MAPPING_CONFIG, @@ -84,37 +72,26 @@ describe('Color mapping - color generation', () => { touched: false, }, ], - paletteId: twoColorPalette.id, + paletteId: KbnPalette.Neutral, }, - simplifiedGetPaletteGn, + palettes, false, { type: 'categories', - categories: ['cat1', 'cat2', 'cat3', 'cat4'], + categories: ['cat1', 'cat2', 'cat3', 'cat4', 'cat5', 'cat6', 'cat7'], } ); - expect(colorFactory('cat1')).toBe('#ff0000'); - expect(colorFactory('cat2')).toBe('#0000ff'); + expect(colorFactory('cat1')).toBe(neutralPaletteColors[0]); + expect(colorFactory('cat2')).toBe(neutralPaletteColors[1]); + expect(colorFactory('cat3')).toBe(neutralPaletteColors[2]); + expect(colorFactory('cat4')).toBe(neutralPaletteColors[3]); + expect(colorFactory('cat5')).toBe(neutralPaletteColors[4]); // the palette will loop depending on the number of colors available - expect(colorFactory('cat3')).toBe('#ff0000'); - expect(colorFactory('cat4')).toBe('#0000ff'); + expect(colorFactory('cat6')).toBe(neutralPaletteColors[0]); + expect(colorFactory('cat7')).toBe(neutralPaletteColors[1]); }); it('returns the unassigned color if configured statically', () => { - const twoColorPalette: ColorMapping.CategoricalPalette = { - id: 'twoColors', - name: 'twoColors', - colorCount: 2, - type: 'categorical', - getColor(indexInRange, darkMode, loop) { - return ['red', 'blue'][loop ? indexInRange % 2 : indexInRange]; - }, - }; - - const simplifiedGetPaletteGn = getPalette( - new Map([[twoColorPalette.id, twoColorPalette]]), - NeutralPalette - ); const colorFactory = getColorFactory( { ...DEFAULT_COLOR_MAPPING_CONFIG, @@ -122,7 +99,7 @@ describe('Color mapping - color generation', () => { { color: { type: 'categorical', - paletteId: NeutralPalette.id, + paletteId: KbnPalette.Neutral, colorIndex: DEFAULT_NEUTRAL_PALETTE_INDEX, }, rule: { @@ -131,33 +108,32 @@ describe('Color mapping - color generation', () => { touched: false, }, ], - paletteId: twoColorPalette.id, }, - simplifiedGetPaletteGn, + palettes, false, { type: 'categories', categories: ['cat1', 'cat2', 'cat3', 'cat4'], } ); - expect(colorFactory('cat1')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); - expect(colorFactory('cat2')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); - expect(colorFactory('cat3')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); - expect(colorFactory('cat4')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('cat1')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('cat2')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('cat3')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('cat4')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); // if the category is not available in the `categories` list then a default netural is used // this is an edge case and ideally never happen - expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('not_available')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); }); it('handles special tokens, multi-field categories and non-trimmed whitespaces', () => { - const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, getPaletteFn, false, { + const colorFactory = getColorFactory(DEFAULT_COLOR_MAPPING_CONFIG, palettes, false, { type: 'categories', categories: ['__other__', ['fieldA', 'fieldB'], '__empty__', ' with-whitespaces '], }); - expect(colorFactory('__other__')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); - // expect(colorFactory(['fieldA', 'fieldB'])).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); - expect(colorFactory('__empty__')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); - expect(colorFactory(' with-whitespaces ')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[3]); + expect(colorFactory('__other__')).toBe(elasticPaletteColors[0]); + // expect(colorFactory(['fieldA', 'fieldB'])).toBe(elasticPaletteColors[1]); + expect(colorFactory('__empty__')).toBe(elasticPaletteColors[2]); + expect(colorFactory(' with-whitespaces ')).toBe(elasticPaletteColors[3]); }); it('ignores configured assignments in loop mode', () => { @@ -172,17 +148,17 @@ describe('Color mapping - color generation', () => { }, ], }, - getPaletteFn, + palettes, false, { type: 'categories', categories: ['catA', 'catB', 'configuredAssignment', 'nextCat'], } ); - expect(colorFactory('catA')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); - expect(colorFactory('catB')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[1]); + expect(colorFactory('catA')).toBe(elasticPaletteColors[0]); + expect(colorFactory('catB')).toBe(elasticPaletteColors[1]); expect(colorFactory('configuredAssignment')).toBe('red'); - expect(colorFactory('nextCat')).toBe(EUI_AMSTERDAM_PALETTE_COLORS[2]); + expect(colorFactory('nextCat')).toBe(elasticPaletteColors[2]); }); it('color with auto rule are assigned in order of the configured data input', () => { @@ -207,7 +183,7 @@ describe('Color mapping - color generation', () => { }, ], }, - getPaletteFn, + palettes, false, { type: 'categories', @@ -222,7 +198,7 @@ describe('Color mapping - color generation', () => { expect(colorFactory('greenCat')).toBe('green'); // if the category is not available in the `categories` list then a default netural is used // this is an edge case and ideally never happen - expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('not_available')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); }); it('returns sequential gradient colors from darker to lighter [desc, lightMode]', () => { @@ -234,7 +210,7 @@ describe('Color mapping - color generation', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 0, touched: false, }, @@ -242,7 +218,7 @@ describe('Color mapping - color generation', () => { sort: 'desc', }, }, - getPaletteFn, + palettes, false, { type: 'categories', @@ -250,7 +226,7 @@ describe('Color mapping - color generation', () => { } ); // this matches exactly with the initial step selected - expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); + expect(toHex(colorFactory('cat1'))).toBe(toHex(elasticPaletteColors[0])); expect(toHex(colorFactory('cat2'))).toBe('#93cebc'); expect(toHex(colorFactory('cat3'))).toBe('#cce8e0'); }); @@ -264,7 +240,7 @@ describe('Color mapping - color generation', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 0, touched: false, }, @@ -272,7 +248,7 @@ describe('Color mapping - color generation', () => { sort: 'asc', }, }, - getPaletteFn, + palettes, false, { type: 'categories', @@ -284,7 +260,7 @@ describe('Color mapping - color generation', () => { // mid green point expect(toHex(colorFactory('cat2'))).toBe('#93cebc'); // initial gradient color - expect(toHex(colorFactory('cat3'))).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(toHex(colorFactory('cat3'))).toBe(elasticPaletteColors[0]); }); it('sequential gradients and static color from lighter to darker [asc, lightMode]', () => { const colorFactory = getColorFactory( @@ -300,7 +276,7 @@ describe('Color mapping - color generation', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 0, touched: false, }, @@ -312,7 +288,7 @@ describe('Color mapping - color generation', () => { color: { type: 'categorical', colorIndex: DEFAULT_NEUTRAL_PALETTE_INDEX, - paletteId: NeutralPalette.id, + paletteId: KbnPalette.Neutral, }, rule: { type: 'other', @@ -321,7 +297,7 @@ describe('Color mapping - color generation', () => { }, ], }, - getPaletteFn, + palettes, false, { type: 'categories', @@ -329,9 +305,9 @@ describe('Color mapping - color generation', () => { } ); expect(toHex(colorFactory('cat1'))).toBe('#cce8e0'); - expect(toHex(colorFactory('cat2'))).toBe(EUI_AMSTERDAM_PALETTE_COLORS[0]); + expect(toHex(colorFactory('cat2'))).toBe(elasticPaletteColors[0]); // this matches exactly with the initial step selected - expect(toHex(colorFactory('cat3'))).toBe(NEUTRAL_COLOR_LIGHT[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(toHex(colorFactory('cat3'))).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); }); it('returns 2 colors gradient [desc, lightMode]', () => { @@ -343,13 +319,13 @@ describe('Color mapping - color generation', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 0, touched: false, }, { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 2, touched: false, }, @@ -357,16 +333,16 @@ describe('Color mapping - color generation', () => { sort: 'desc', }, }, - getPaletteFn, + palettes, false, { type: 'categories', categories: ['cat1', 'cat2', 'cat3'], } ); - expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); // EUI green - expect(toHex(colorFactory('cat2'))).toBe('#a4908f'); // red gray green - expect(toHex(colorFactory('cat3'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[2])); // EUI pink + expect(toHex(colorFactory('cat1'))).toBe(toHex(elasticPaletteColors[0])); + expect(toHex(colorFactory('cat2'))).toBe('#a4908f'); + expect(toHex(colorFactory('cat3'))).toBe(toHex(elasticPaletteColors[2])); }); it('returns divergent gradient [asc, darkMode]', () => { @@ -378,14 +354,14 @@ describe('Color mapping - color generation', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 0, touched: false, }, - { type: 'categorical', paletteId: NeutralPalette.id, colorIndex: 0, touched: false }, + { type: 'categorical', paletteId: KbnPalette.Neutral, colorIndex: 0, touched: false }, { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Default, colorIndex: 2, touched: false, }, @@ -393,18 +369,18 @@ describe('Color mapping - color generation', () => { sort: 'asc', // testing in ascending order }, }, - getPaletteFn, + palettes, true, // testing in dark mode { type: 'categories', categories: ['cat1', 'cat2', 'cat3'], } ); - expect(toHex(colorFactory('cat1'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[2])); // EUI pink - expect(toHex(colorFactory('cat2'))).toBe(NEUTRAL_COLOR_DARK[0]); // NEUTRAL LIGHT GRAY - expect(toHex(colorFactory('cat3'))).toBe(toHex(EUI_AMSTERDAM_PALETTE_COLORS[0])); // EUI green - // if the category is not available in the `categories` list then a default netural is used + expect(toHex(colorFactory('cat1'))).toBe(toHex(elasticPaletteColors[2])); + expect(toHex(colorFactory('cat2'))).toBe(neutralPaletteColors[0]); + expect(toHex(colorFactory('cat3'))).toBe(toHex(elasticPaletteColors[0])); + // if the category is not available in the `categories` list then a default neutral is used // this is an edge case and ideally never happen - expect(colorFactory('not_available')).toBe(NEUTRAL_COLOR_DARK[DEFAULT_NEUTRAL_PALETTE_INDEX]); + expect(colorFactory('not_available')).toBe(neutralPaletteColors[DEFAULT_NEUTRAL_PALETTE_INDEX]); }); }); 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 373e56e3cb8f..0031ac81908c 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 @@ -9,9 +9,9 @@ import chroma from 'chroma-js'; import { findLast } from 'lodash'; +import { KbnPalette, KbnPalettes } from '@kbn/palettes'; import { ColorMapping } from '../config'; import { changeAlpha, combineColors, getValidColor } from './color_math'; -import { getPalette, NeutralPalette } from '../palettes'; import { ColorMappingInputData } from '../categorical_color_mapping'; import { ruleMatch } from './rule_matching'; import { GradientColorMode } from '../config/types'; @@ -25,7 +25,7 @@ export function getAssignmentColor( color: | ColorMapping.Config['assignments'][number]['color'] | (ColorMapping.LoopColor & { paletteId: string; colorIndex: number }), - getPaletteFn: ReturnType, + palettes: KbnPalettes, isDarkMode: boolean, index: number, total: number @@ -34,12 +34,12 @@ export function getAssignmentColor( case 'colorCode': case 'categorical': case 'loop': - return getColor(color, getPaletteFn, isDarkMode); + return getColor(color, palettes); case 'gradient': { if (colorMode.type === 'categorical') { return 'red'; } - const colorScale = getGradientColorScale(colorMode, getPaletteFn, isDarkMode); + const colorScale = getGradientColorScale(colorMode, palettes, isDarkMode); return total === 0 ? 'red' : total === 1 ? colorScale(0) : colorScale(index / (total - 1)); } } @@ -50,19 +50,16 @@ export function getColor( | ColorMapping.ColorCode | ColorMapping.CategoricalColor | (ColorMapping.LoopColor & { paletteId: string; colorIndex: number }), - getPaletteFn: ReturnType, - isDarkMode: boolean + palettes: KbnPalettes ): string { return color.type === 'colorCode' ? color.colorCode - : getValidColor( - getPaletteFn(color.paletteId).getColor(color.colorIndex, isDarkMode, true) - ).hex(); + : getValidColor(palettes.get(color.paletteId).getColor(color.colorIndex)).hex(); } export function getColorFactory( { assignments, specialAssignments, colorMode, paletteId }: ColorMapping.Config, - getPaletteFn: ReturnType, + palettes: KbnPalettes, isDarkMode: boolean, data: ColorMappingInputData ): (category: string | string[]) => string { @@ -104,7 +101,7 @@ export function getColorFactory( return getAssignmentColor( colorMode, autoByOrderAssignments[nonAssignedCategoryIndex].color, - getPaletteFn, + palettes, isDarkMode, autoAssignmentIndex, assignments.length @@ -129,7 +126,7 @@ export function getColorFactory( paletteId, } : specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX].color, - getPaletteFn, + palettes, isDarkMode, indexIfGradient, totalColorsIfGradient @@ -146,7 +143,7 @@ export function getColorFactory( return getAssignmentColor( colorMode, assignment.color, - getPaletteFn, + palettes, isDarkMode, matchingAssignmentIndex, assignments.length @@ -155,30 +152,29 @@ export function getColorFactory( return getColor( { type: 'categorical', - paletteId: NeutralPalette.id, + paletteId: KbnPalette.Neutral, colorIndex: DEFAULT_NEUTRAL_PALETTE_INDEX, }, - getPaletteFn, - isDarkMode + palettes ); }; } export function getGradientColorScale( colorMode: GradientColorMode, - getPaletteFn: ReturnType, + palettes: KbnPalettes, isDarkMode: boolean ): (value: number) => string { const steps = colorMode.steps.length === 1 ? [ - getColor(colorMode.steps[0], getPaletteFn, isDarkMode), + getColor(colorMode.steps[0], palettes), combineColors( - changeAlpha(getColor(colorMode.steps[0], getPaletteFn, isDarkMode), 0.3), + changeAlpha(getColor(colorMode.steps[0], palettes), 0.3), isDarkMode ? 'black' : 'white' ), ] - : colorMode.steps.map((d) => getColor(d, getPaletteFn, isDarkMode)); + : colorMode.steps.map((d) => getColor(d, palettes)); steps.sort(() => (colorMode.sort === 'asc' ? -1 : 1)); const scale = chroma.scale(steps).mode('lab'); return (value: number) => scale(value).hex(); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/assignment.tsx index 0606aa94e6aa..5a629a18cf95 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 @@ -13,6 +13,7 @@ import { EuiButtonIcon, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; +import { IKbnPalette, KbnPalettes } from '@kbn/palettes'; import { removeAssignment, updateAssignmentColor, @@ -21,7 +22,6 @@ import { import { ColorMapping } from '../../config'; import { Range } from './range'; import { Match } from './match'; -import { getPalette } from '../../palettes'; import { ColorMappingInputData } from '../../categorical_color_mapping'; import { ColorSwatch } from '../color_picker/color_swatch'; @@ -33,8 +33,8 @@ export function Assignment({ index, total, palette, + palettes, colorMode, - getPaletteFn, isDarkMode, specialTokens, assignmentValuesCounter, @@ -45,8 +45,8 @@ export function Assignment({ colorMode: ColorMapping.Config['colorMode']; assignment: ColorMapping.Config['assignments'][number]; disableDelete: boolean; - palette: ColorMapping.CategoricalPalette; - getPaletteFn: ReturnType; + palette: IKbnPalette; + palettes: KbnPalettes; isDarkMode: boolean; specialTokens: Map; assignmentValuesCounter: Map; @@ -62,9 +62,9 @@ export function Assignment({ swatchShape="square" colorMode={colorMode} assignmentColor={assignment.color} - getPaletteFn={getPaletteFn} index={index} palette={palette} + palettes={palettes} total={total} onColorChange={(color) => { dispatch(updateAssignmentColor({ assignmentIndex: index, color })); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx index 3bdab18cbf19..4834ccc57d82 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/assignment/special_assignment.tsx @@ -9,8 +9,7 @@ import { useDispatch } from 'react-redux'; import React from 'react'; -import { ColorMapping } from '../../config'; -import { getPalette } from '../../palettes'; +import { IKbnPalette, KbnPalettes } from '@kbn/palettes'; import { ColorSwatch } from '../color_picker/color_swatch'; import { updateSpecialAssignmentColor } from '../../state/color_mapping'; import { ColorCode, CategoricalColor } from '../../config/types'; @@ -19,15 +18,15 @@ export function SpecialAssignment({ assignmentColor, index, palette, - getPaletteFn, + palettes, isDarkMode, total, }: { isDarkMode: boolean; index: number; assignmentColor: CategoricalColor | ColorCode; - palette: ColorMapping.CategoricalPalette; - getPaletteFn: ReturnType; + palette: IKbnPalette; + palettes: KbnPalettes; total: number; }) { const dispatch = useDispatch(); @@ -36,7 +35,7 @@ export function SpecialAssignment({ forType="specialAssignment" colorMode={{ type: 'categorical' }} assignmentColor={assignmentColor} - getPaletteFn={getPaletteFn} + palettes={palettes} index={index} palette={palette} total={total} 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 e4d42b964569..eafa07793dd5 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 @@ -10,32 +10,29 @@ import React, { useState } from 'react'; import { EuiButtonEmpty, EuiPopoverTitle, EuiTab, EuiTabs, EuiHorizontalRule } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { IKbnPalette, KbnPalette, KbnPalettes } from '@kbn/palettes'; import { ColorMapping } from '../../config'; -import { getPalette } from '../../palettes'; import { PaletteColors } from './palette_colors'; import { RGBPicker } from './rgb_picker'; -import { NeutralPalette } from '../../palettes/neutral'; export function ColorPicker({ - palette, - getPaletteFn, color, + palette, + palettes, close, selectColor, - isDarkMode, deleteStep, }: { color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; - getPaletteFn: ReturnType; - palette: ColorMapping.CategoricalPalette; - isDarkMode: boolean; + palette: IKbnPalette; + palettes: KbnPalettes; close: () => void; selectColor: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; deleteStep?: () => void; }) { const [tab, setTab] = useState( color.type === 'categorical' && - (color.paletteId === palette.id || color.paletteId === NeutralPalette.id) + (color.paletteId === palette.id || color.paletteId === KbnPalette.Neutral) ? 'palette' : 'custom' ); @@ -64,20 +61,12 @@ export function ColorPicker({ {tab === 'palette' ? ( ) : ( - + )} {deleteStep ? ( <> 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 590d66018e80..b1af9d364efd 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 @@ -18,10 +18,10 @@ import React from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; +import { IKbnPalette, KbnPalettes } from '@kbn/palettes'; import { ColorPicker } from './color_picker'; import { getAssignmentColor } from '../../color/color_handling'; import { ColorMapping } from '../../config'; -import { getPalette } from '../../palettes'; import { removeGradientColorStep } from '../../state/color_mapping'; import { selectColorPickerVisibility } from '../../state/selectors'; @@ -31,22 +31,23 @@ import { getValidColor } from '../../color/color_math'; interface ColorPickerSwatchProps { colorMode: ColorMapping.Config['colorMode']; assignmentColor: ColorMapping.Config['assignments'][number]['color']; - getPaletteFn: ReturnType; index: number; total: number; - palette: ColorMapping.CategoricalPalette; + palette: IKbnPalette; + palettes: KbnPalettes; onColorChange: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; swatchShape: 'square' | 'round'; isDarkMode: boolean; forType: 'assignment' | 'specialAssignment' | 'gradient'; } + export const ColorSwatch = ({ colorMode, assignmentColor, - getPaletteFn, index, total, palette, + palettes, onColorChange, swatchShape, isDarkMode, @@ -61,7 +62,7 @@ export const ColorSwatch = ({ const colorHex = getAssignmentColor( colorMode, assignmentColor, - getPaletteFn, + palettes, isDarkMode, index, total @@ -147,11 +148,9 @@ export const ColorSwatch = ({ } color={assignmentColor} palette={palette} - getPaletteFn={getPaletteFn} + palettes={palettes} close={() => dispatch(hideColorPickerVisibility())} - isDarkMode={isDarkMode} selectColor={(color) => { - // dispatch update onColorChange(color); }} deleteStep={ 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 3f58ed5d564e..0ed0d8d68bb6 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 @@ -19,35 +19,33 @@ import { EuiSpacer, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { IKbnPalette, KbnPalette, KbnPalettes } from '@kbn/palettes'; import { ColorMapping } from '../../config'; -import { getPalette } from '../../palettes'; import { isSameColor } from '../../color/color_math'; -import { NeutralPalette } from '../../palettes/neutral'; export function PaletteColors({ palette, - isDarkMode, + palettes, color, - getPaletteFn, selectColor, }: { - palette: ColorMapping.CategoricalPalette; - isDarkMode: boolean; + palette: IKbnPalette; + palettes: KbnPalettes; color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; - getPaletteFn: ReturnType; selectColor: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; }) { const colors = Array.from({ length: palette.colorCount }, (d, i) => { - return palette.getColor(i, isDarkMode, false); + return palette.getColor(i); }); - const neutralColors = Array.from({ length: NeutralPalette.colorCount }, (d, i) => { - return NeutralPalette.getColor(i, isDarkMode, false); + const neutralPalette = palettes.get(KbnPalette.Neutral); + const neutralColors = Array.from({ length: neutralPalette.colorCount }, (d, i) => { + return neutralPalette.getColor(i); }); const originalColor = color.type === 'categorical' - ? color.paletteId === NeutralPalette.id - ? NeutralPalette.getColor(color.colorIndex, isDarkMode, false) - : getPaletteFn(color.paletteId).getColor(color.colorIndex, isDarkMode, false) + ? color.paletteId === neutralPalette.id + ? neutralPalette.getColor(color.colorIndex) + : palettes.get(color.paletteId).getColor(color.colorIndex) : color.colorCode; return ( <> @@ -126,7 +124,7 @@ export function PaletteColors({ onClick={() => selectColor({ type: 'categorical', - paletteId: NeutralPalette.id, + paletteId: neutralPalette.id, colorIndex: index, }) } diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/rgb_picker.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/rgb_picker.tsx index 6c701fbfebac..175d3ae36e71 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/rgb_picker.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/color_picker/rgb_picker.tsx @@ -22,24 +22,19 @@ import chromajs from 'chroma-js'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; +import { KbnPalettes } from '@kbn/palettes'; import { ColorMapping } from '../../config'; import { hasEnoughContrast } from '../../color/color_math'; -import { getPalette } from '../../palettes'; export function RGBPicker({ - isDarkMode, color, - getPaletteFn, + palettes, selectColor, - close, }: { - palette: ColorMapping.CategoricalPalette; - isDarkMode: boolean; color: ColorMapping.CategoricalColor | ColorMapping.ColorCode; - getPaletteFn: ReturnType; + palettes: KbnPalettes; selectColor: (color: ColorMapping.CategoricalColor | ColorMapping.ColorCode) => void; - close: () => void; }) { const [customColorMappingColor, setCustomColorMappingColor] = useState< ColorMapping.CategoricalColor | ColorMapping.ColorCode @@ -47,11 +42,7 @@ export function RGBPicker({ const customColorHex = customColorMappingColor.type === 'categorical' - ? getPaletteFn(customColorMappingColor.paletteId).getColor( - customColorMappingColor.colorIndex, - isDarkMode, - false - ) + ? palettes.get(customColorMappingColor.paletteId).getColor(customColorMappingColor.colorIndex) : customColorMappingColor.colorCode; const [colorTextInput, setColorTextInput] = useState(customColorHex); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/assigments.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/assigments.tsx index 1f9c37b1c60b..6abe702ca8bc 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/assigments.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/assigments.tsx @@ -29,6 +29,7 @@ import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; import { useDispatch, useSelector } from 'react-redux'; import { findLast } from 'lodash'; +import { KbnPalettes } from '@kbn/palettes'; import { Assignment } from '../assignment/assignment'; import { addNewAssignment, @@ -38,7 +39,6 @@ import { import { selectColorMode, selectComputedAssignments, selectPalette } from '../../state/selectors'; import { ColorMappingInputData } from '../../categorical_color_mapping'; import { ColorMapping } from '../../config'; -import { getPalette, NeutralPalette } from '../../palettes'; import { ruleMatch } from '../../color/rule_matching'; export function AssignmentsConfig({ @@ -47,7 +47,7 @@ export function AssignmentsConfig({ isDarkMode, specialTokens, }: { - palettes: Map; + palettes: KbnPalettes; data: ColorMappingInputData; isDarkMode: boolean; /** map between original and formatted tokens used to handle special cases, like the Other bucket and the empty bucket */ @@ -56,8 +56,7 @@ export function AssignmentsConfig({ const [showOtherActions, setShowOtherActions] = useState(false); const dispatch = useDispatch(); - const getPaletteFn = getPalette(palettes, NeutralPalette); - const palette = useSelector(selectPalette(getPaletteFn)); + const palette = useSelector(selectPalette(palettes)); const colorMode = useSelector(selectColorMode); const assignments = useSelector(selectComputedAssignments); @@ -100,13 +99,13 @@ export function AssignmentsConfig({ ? { type: 'categorical', paletteId: palette.id, - colorIndex: nextCategoricalIndex % palette.colorCount, + colorIndex: nextCategoricalIndex % palette.colors().length, } : { type: 'gradient' }, touched: false, }) ); - }, [assignments, colorMode.type, data.type, dispatch, palette.colorCount, palette.id]); + }, [assignments, colorMode.type, data.type, dispatch, palette]); const onClickAddAllCurrentCategories = useCallback(() => { if (data.type === 'categories') { @@ -128,7 +127,7 @@ export function AssignmentsConfig({ ? { type: 'categorical', paletteId: palette.id, - colorIndex: (nextCategoricalIndex + i) % palette.colorCount, + colorIndex: (nextCategoricalIndex + i) % palette.colors().length, } : { type: 'gradient' }, touched: false, @@ -137,15 +136,7 @@ export function AssignmentsConfig({ ); dispatch(addNewAssignments(newAssignments)); } - }, [ - dispatch, - assignments, - colorMode.type, - data.type, - palette.colorCount, - palette.id, - unmatchingCategories, - ]); + }, [data.type, assignments, unmatchingCategories, dispatch, colorMode.type, palette]); return ( ; + palettes: KbnPalettes; data: ColorMappingInputData; isDarkMode: boolean; /** map between original and formatted tokens used to handle special cases, like the Other bucket and the empty bucket */ specialTokens: Map; }) { const dispatch = useDispatch(); - - const getPaletteFn = getPalette(palettes, NeutralPalette); - - const palette = useSelector(selectPalette(getPaletteFn)); + const palette = useSelector(selectPalette(palettes)); const colorMode = useSelector(selectColorMode); const assignments = useSelector(selectComputedAssignments); @@ -55,14 +50,10 @@ export function Container({ gutterSize="s" > - + - + @@ -105,7 +96,7 @@ export function Container({ > diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/unassigned_terms_config.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/unassigned_terms_config.tsx index 3a7469d120f1..4ebaadeeb7b8 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/container/unassigned_terms_config.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/container/unassigned_terms_config.tsx @@ -19,14 +19,13 @@ import { import { i18n } from '@kbn/i18n'; import { useDispatch, useSelector } from 'react-redux'; import { css } from '@emotion/react'; +import { KbnPalette, KbnPalettes } from '@kbn/palettes'; import { updateSpecialAssignmentColor } from '../../state/color_mapping'; -import { getPalette, NeutralPalette } from '../../palettes'; import { DEFAULT_NEUTRAL_PALETTE_INDEX, DEFAULT_OTHER_ASSIGNMENT_INDEX, } from '../../config/default_color_mapping'; import { SpecialAssignment } from '../assignment/special_assignment'; -import { ColorMapping } from '../../config'; import { selectColorMode, selectPalette, selectSpecialAssignments } from '../../state/selectors'; import { ColorMappingInputData } from '../../categorical_color_mapping'; @@ -35,15 +34,13 @@ export function UnassignedTermsConfig({ data, isDarkMode, }: { - palettes: Map; + palettes: KbnPalettes; data: ColorMappingInputData; isDarkMode: boolean; }) { const dispatch = useDispatch(); - - const getPaletteFn = getPalette(palettes, NeutralPalette); - - const palette = useSelector(selectPalette(getPaletteFn)); + const neutralPalette = palettes.get(KbnPalette.Neutral); + const palette = useSelector(selectPalette(palettes)); const colorMode = useSelector(selectColorMode); const specialAssignments = useSelector(selectSpecialAssignments); const otherAssignment = specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX]; @@ -99,7 +96,7 @@ export function UnassignedTermsConfig({ : { type: 'categorical', colorIndex: DEFAULT_NEUTRAL_PALETTE_INDEX, - paletteId: NeutralPalette.id, + paletteId: neutralPalette.id, }, }) ); @@ -122,7 +119,7 @@ export function UnassignedTermsConfig({ index={0} palette={palette} isDarkMode={isDarkMode} - getPaletteFn={getPaletteFn} + palettes={palettes} assignmentColor={otherAssignment.color} total={specialAssignments.length} /> diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient.tsx index c08834fdd384..5fc9dc40f158 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient.tsx @@ -11,9 +11,9 @@ import React from 'react'; import { euiThemeVars } from '@kbn/ui-theme'; import { css } from '@emotion/react'; import { useDispatch } from 'react-redux'; +import { KbnPalettes } from '@kbn/palettes'; import { changeAlpha } from '../../color/color_math'; import { ColorMapping } from '../../config'; -import { getPalette } from '../../palettes'; import { getGradientColorScale } from '../../color/color_handling'; import { AddStop } from './gradient_add_stop'; import { ColorSwatch } from '../color_picker/color_swatch'; @@ -22,21 +22,21 @@ import { updateGradientColorStep } from '../../state/color_mapping'; export function Gradient({ paletteId, colorMode, - getPaletteFn, isDarkMode, + palettes, }: { paletteId: string; isDarkMode: boolean; colorMode: ColorMapping.Config['colorMode']; - getPaletteFn: ReturnType; + palettes: KbnPalettes; }) { const dispatch = useDispatch(); if (colorMode.type === 'categorical') { return null; } - const currentPalette = getPaletteFn(paletteId); - const gradientColorScale = getGradientColorScale(colorMode, getPaletteFn, isDarkMode); + const currentPalette = palettes.get(paletteId); + const gradientColorScale = getGradientColorScale(colorMode, palettes, isDarkMode); const startStepColor = colorMode.sort === 'asc' @@ -104,7 +104,7 @@ export function Gradient({ forType="gradient" colorMode={colorMode} assignmentColor={startStepColor} - getPaletteFn={getPaletteFn} + palettes={palettes} index={startStepIndex} palette={currentPalette} total={colorMode.steps.length} @@ -133,7 +133,7 @@ export function Gradient({ forType="gradient" colorMode={colorMode} assignmentColor={middleStepColor} - getPaletteFn={getPaletteFn} + palettes={palettes} index={middleStepIndex} palette={currentPalette} total={colorMode.steps.length} @@ -161,7 +161,7 @@ export function Gradient({ forType="gradient" colorMode={colorMode} assignmentColor={endStepColor} - getPaletteFn={getPaletteFn} + palettes={palettes} index={endStepIndex} palette={currentPalette} total={colorMode.steps.length} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient_add_stop.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient_add_stop.tsx index 6b89f8143fb8..1c6736262e21 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient_add_stop.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/gradient_add_stop.tsx @@ -20,6 +20,7 @@ import { import { useDispatch } from 'react-redux'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; +import { IKbnPalette } from '@kbn/palettes'; import { ColorMapping } from '../../config'; import { addGradientColorStep } from '../../state/color_mapping'; import { colorPickerVisibility } from '../../state/ui'; @@ -30,7 +31,7 @@ export function AddStop({ at, }: { colorMode: ColorMapping.GradientColorMode; - currentPalette: ColorMapping.CategoricalPalette; + currentPalette: IKbnPalette; at: number; }) { const euiTheme = useEuiTheme(); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx index 1d909f000a41..54c6d05bbed1 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/palette_selector.tsx @@ -7,25 +7,16 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useState, useMemo } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { EuiColorPalettePicker, EuiConfirmModal, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { KbnPalettes } from '@kbn/palettes'; import { RootState, updatePalette } from '../../state/color_mapping'; -import { ColorMapping } from '../../config'; import { updateAssignmentsPalette, updateColorModePalette } from '../../config/assignments'; -import { getPalette } from '../../palettes'; -export function PaletteSelector({ - palettes, - getPaletteFn, - isDarkMode, -}: { - getPaletteFn: ReturnType; - palettes: Map; - isDarkMode: boolean; -}) { +export function PaletteSelector({ palettes }: { palettes: KbnPalettes }) { const dispatch = useDispatch(); const model = useSelector((state: RootState) => state.colorMapping); @@ -38,7 +29,7 @@ export function PaletteSelector({ model.assignments, model.colorMode, selectedPaletteId, - getPaletteFn, + palettes, preserveColorChanges ), colorMode: updateColorModePalette( @@ -49,7 +40,7 @@ export function PaletteSelector({ }) ); }, - [getPaletteFn, model, dispatch] + [dispatch, model.assignments, model.colorMode, palettes] ); const [preserveModalPaletteId, setPreserveModalPaletteId] = useState(null); @@ -85,6 +76,11 @@ export function PaletteSelector({ ) : null; + const currentPaletteId = useMemo( + () => palettes.get(model.paletteId).id, // need to resolve aliased id + [model.paletteId, palettes] + ); + return ( <> {preserveChangesModal} @@ -97,14 +93,15 @@ export function PaletteSelector({ d.name !== 'Neutral') + palettes={palettes + .getAll() + .filter((d) => d.type === 'categorical') .map((palette) => ({ 'data-test-subj': `kbnColoring_ColorMapping_Palette-${palette.id}`, value: palette.id, title: palette.name, palette: Array.from({ length: palette.colorCount }, (_, i) => { - return palette.getColor(i, isDarkMode, false); + return palette.getColor(i); }), type: 'fixed', }))} @@ -118,7 +115,7 @@ export function PaletteSelector({ switchPaletteFn(selectedPaletteId, false); } }} - valueOfSelected={model.paletteId} + valueOfSelected={currentPaletteId} selectionDisplay={'palette'} compressed={true} /> diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale.tsx b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale.tsx index f7249aa12d57..42fea54d6fdb 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale.tsx +++ b/packages/kbn-coloring/src/shared_components/color_mapping/components/palette_selector/scale.tsx @@ -12,12 +12,12 @@ import { useSelector, useDispatch } from 'react-redux'; import { EuiButtonGroup, EuiConfirmModal, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { KbnPalettes } from '@kbn/palettes'; import { RootState, updatePalette } from '../../state/color_mapping'; import { ColorMapping } from '../../config'; import { updateAssignmentsPalette } from '../../config/assignments'; -import { getPalette } from '../../palettes'; -export function ScaleMode({ getPaletteFn }: { getPaletteFn: ReturnType }) { +export function ScaleMode({ palettes }: { palettes: KbnPalettes }) { const dispatch = useDispatch(); const colorMode = useSelector((state: RootState) => state.colorMapping.colorMode); const model = useSelector((state: RootState) => state.colorMapping); @@ -46,12 +46,12 @@ export function ScaleMode({ getPaletteFn }: { getPaletteFn: ReturnType( diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts index 3d30ce3c7f60..5f039c05074d 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/assignments.ts @@ -7,17 +7,17 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { KbnPalettes } from '@kbn/palettes'; import type { ColorMapping } from '.'; -import { getPalette } from '../palettes'; export function updateAssignmentsPalette( assignments: ColorMapping.Config['assignments'], colorMode: ColorMapping.Config['colorMode'], paletteId: string, - getPaletteFn: ReturnType, + palettes: KbnPalettes, preserveColorChanges: boolean ): ColorMapping.Config['assignments'] { - const palette = getPaletteFn(paletteId); + const palette = palettes.get(paletteId); return assignments.map(({ rule, color, touched }, index) => { if (preserveColorChanges && touched) { return { rule, color, touched }; @@ -27,7 +27,7 @@ export function updateAssignmentsPalette( ? { type: 'categorical', paletteId, - colorIndex: index % palette.colorCount, + colorIndex: index % palette.colors().length, } : { type: 'gradient' }; return { diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts index b613d0d76adb..1005f5d89855 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/default_color_mapping.ts @@ -7,11 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { KbnPalettes } from '@kbn/palettes'; import { ColorMapping } from '.'; -import { AVAILABLE_PALETTES, getPalette } from '../palettes'; -import { EUIAmsterdamColorBlindPalette } from '../palettes/eui_amsterdam'; -import { NeutralPalette } from '../palettes/neutral'; import { getColor, getGradientColorScale } from '../color/color_handling'; +import { DEFAULT_FALLBACK_PALETTE } from '../../../palettes'; export const DEFAULT_NEUTRAL_PALETTE_INDEX = 1; export const DEFAULT_OTHER_ASSIGNMENT_INDEX = 0; @@ -32,32 +31,31 @@ export const DEFAULT_COLOR_MAPPING_CONFIG: ColorMapping.Config = { touched: false, }, ], - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: DEFAULT_FALLBACK_PALETTE, colorMode: { type: 'categorical', }, }; export function getPaletteColors( - isDarkMode: boolean, + palettes: KbnPalettes, colorMappings?: ColorMapping.Config ): string[] { const colorMappingModel = colorMappings ?? { ...DEFAULT_COLOR_MAPPING_CONFIG }; - const palette = getPalette(AVAILABLE_PALETTES, NeutralPalette)(colorMappingModel.paletteId); - return getPaletteColorsFromPaletteId(isDarkMode, palette.id); + const palette = palettes.get(colorMappingModel.paletteId); + return getPaletteColorsFromPaletteId(palettes, palette.id); } export function getPaletteColorsFromPaletteId( - isDarkMode: boolean, + palettes: KbnPalettes, paletteId: ColorMapping.Config['paletteId'] ): string[] { - const palette = getPalette(AVAILABLE_PALETTES, NeutralPalette)(paletteId); - return Array.from({ length: palette.colorCount }, (d, i) => - palette.getColor(i, isDarkMode, true) - ); + const palette = palettes.get(paletteId); + return Array.from({ length: palette.colorCount }, (d, i) => palette.getColor(i)); } export function getColorsFromMapping( + palettes: KbnPalettes, isDarkMode: boolean, colorMappings?: ColorMapping.Config ): string[] { @@ -65,27 +63,18 @@ export function getColorsFromMapping( ...DEFAULT_COLOR_MAPPING_CONFIG, }; - const getPaletteFn = getPalette(AVAILABLE_PALETTES, NeutralPalette); if (colorMode.type === 'gradient') { - const colorScale = getGradientColorScale(colorMode, getPaletteFn, isDarkMode); + const colorScale = getGradientColorScale(colorMode, palettes, isDarkMode); return Array.from({ length: 6 }, (d, i) => colorScale(i / 6)); } else { - const palette = getPaletteFn(paletteId); + const palette = palettes.get(paletteId); const otherColors = specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX].color.type === 'loop' - ? Array.from({ length: palette.colorCount }, (d, i) => - palette.getColor(i, isDarkMode, true) - ) - : [ - getColor( - specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX].color, - getPaletteFn, - isDarkMode - ), - ]; + ? Array.from({ length: palette.colorCount }, (d, i) => palette.getColor(i)) + : [getColor(specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX].color, palettes)]; return [ ...assignments.map((a) => { - return a.color.type === 'gradient' ? '' : getColor(a.color, getPaletteFn, isDarkMode); + return a.color.type === 'gradient' ? '' : getColor(a.color, palettes); }), ...otherColors, ].filter((color) => color !== ''); diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts b/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts index 1c8b984dc52d..79be2aa615c3 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/config/types.ts @@ -150,11 +150,3 @@ export interface Config { >; specialAssignments: Array>; } - -export interface CategoricalPalette { - id: string; - name: string; - type: 'categorical'; - colorCount: number; - getColor: (valueInRange: number, isDarkMode: boolean, loop: boolean) => string; -} diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/index.ts b/packages/kbn-coloring/src/shared_components/color_mapping/index.ts index 6337447c1038..5cba53f0eadc 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/index.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/index.ts @@ -15,7 +15,6 @@ export { } from './categorical_color_mapping'; export type { ColorMappingInputData } from './categorical_color_mapping'; export type { ColorMapping } from './config'; -export * from './palettes'; export * from './color/color_handling'; export { SPECIAL_TOKENS_STRING_CONVERSION, getSpecialString } from './color/rule_matching'; export { diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts deleted file mode 100644 index bd8492823b4d..000000000000 --- a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/elastic_brand.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ColorMapping } from '../config'; - -export const ELASTIC_BRAND_PALETTE_COLORS = [ - '#20377d', - '#7de2d1', - '#ff957d', - '#f04e98', - '#0077cc', - '#fec514', -]; - -export const ElasticBrandPalette: ColorMapping.CategoricalPalette = { - id: 'elastic_brand_2023', - name: 'Elastic Brand', - colorCount: ELASTIC_BRAND_PALETTE_COLORS.length, - type: 'categorical', - getColor(indexInRange, isDarkMode, loop) { - return ELASTIC_BRAND_PALETTE_COLORS[ - loop ? indexInRange % ELASTIC_BRAND_PALETTE_COLORS.length : indexInRange - ]; - }, -}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts deleted file mode 100644 index 7a29bc9f343e..000000000000 --- a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/eui_amsterdam.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ColorMapping } from '../config'; - -export const EUI_AMSTERDAM_PALETTE_COLORS = [ - '#54b399', - '#6092c0', - '#d36086', - '#9170b8', - '#ca8eae', - '#d6bf57', - '#b9a888', - '#da8b45', - '#aa6556', - '#e7664c', -]; - -export const EUIAmsterdamColorBlindPalette: ColorMapping.CategoricalPalette = { - id: 'eui_amsterdam_color_blind', - name: 'Default', - colorCount: EUI_AMSTERDAM_PALETTE_COLORS.length, - type: 'categorical', - getColor(indexInRange, isDarkMode, loop) { - return EUI_AMSTERDAM_PALETTE_COLORS[ - loop ? indexInRange % EUI_AMSTERDAM_PALETTE_COLORS.length : indexInRange - ]; - }, -}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts deleted file mode 100644 index ca3d5b950388..000000000000 --- a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/index.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ColorMapping } from '../config'; -import { ElasticBrandPalette } from './elastic_brand'; -import { EUIAmsterdamColorBlindPalette } from './eui_amsterdam'; -import { KibanaV7LegacyPalette } from './kibana_legacy'; -import { NeutralPalette } from './neutral'; - -export const AVAILABLE_PALETTES = new Map([ - [EUIAmsterdamColorBlindPalette.id, EUIAmsterdamColorBlindPalette], - [ElasticBrandPalette.id, ElasticBrandPalette], - [KibanaV7LegacyPalette.id, KibanaV7LegacyPalette], - [NeutralPalette.id, NeutralPalette], -]); - -/** - * This function should be instanciated once at the root of the component with the available palettes and - * a choosed default one and shared across components to keep a single point of truth of the available palettes and the default - * one. - */ -export function getPalette( - palettes: Map, - defaultPalette: ColorMapping.CategoricalPalette -): (paletteId: string) => ColorMapping.CategoricalPalette { - return (paletteId) => palettes.get(paletteId) ?? defaultPalette; -} - -export * from './eui_amsterdam'; -export * from './elastic_brand'; -export * from './kibana_legacy'; -export * from './neutral'; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts deleted file mode 100644 index c0c25049700f..000000000000 --- a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/kibana_legacy.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ColorMapping } from '../config'; - -export const KIBANA_V7_LEGACY_PALETTE_COLORS = [ - '#00a69b', - '#57c17b', - '#6f87d8', - '#663db8', - '#bc52bc', - '#9e3533', - '#daa05d', -]; - -export const KibanaV7LegacyPalette: ColorMapping.CategoricalPalette = { - id: 'kibana_v7_legacy', - name: 'Kibana Legacy', - colorCount: KIBANA_V7_LEGACY_PALETTE_COLORS.length, - type: 'categorical', - getColor(indexInRange, isDarkMode, loop) { - return KIBANA_V7_LEGACY_PALETTE_COLORS[ - loop ? indexInRange % KIBANA_V7_LEGACY_PALETTE_COLORS.length : indexInRange - ]; - }, -}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts b/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.ts deleted file mode 100644 index 5d41ab0fa3c9..000000000000 --- a/packages/kbn-coloring/src/shared_components/color_mapping/palettes/neutral.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ColorMapping } from '../config'; - -const schemeGreys = ['#f2f4fb', '#d4d9e5', '#98a2b3', '#696f7d', '#353642']; -export const NEUTRAL_COLOR_LIGHT = schemeGreys.slice(); -export const NEUTRAL_COLOR_DARK = schemeGreys.slice().reverse(); - -export const NeutralPalette: ColorMapping.CategoricalPalette = { - id: 'neutral', - name: 'Neutral', - colorCount: NEUTRAL_COLOR_LIGHT.length, - type: 'categorical', - getColor(valueInRange, isDarkMode) { - return isDarkMode ? NEUTRAL_COLOR_DARK[valueInRange] : NEUTRAL_COLOR_LIGHT[valueInRange]; - }, -}; diff --git a/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts b/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts index 05454ead22a6..3f8053aa8e92 100644 --- a/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts +++ b/packages/kbn-coloring/src/shared_components/color_mapping/state/selectors.ts @@ -7,11 +7,11 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { getPalette } from '../palettes'; +import { KbnPalettes } from '@kbn/palettes'; import { RootState } from './color_mapping'; -export function selectPalette(getPaletteFn: ReturnType) { - return (state: RootState) => getPaletteFn(state.colorMapping.paletteId); +export function selectPalette(palettes: KbnPalettes) { + return (state: RootState) => palettes.get(state.colorMapping.paletteId); } export function selectColorMode(state: RootState) { return state.colorMapping.colorMode; diff --git a/packages/kbn-coloring/tsconfig.json b/packages/kbn-coloring/tsconfig.json index 3a97faa1b9d3..c3be4a82e8ba 100644 --- a/packages/kbn-coloring/tsconfig.json +++ b/packages/kbn-coloring/tsconfig.json @@ -23,6 +23,7 @@ "@kbn/data-plugin", "@kbn/ui-theme", "@kbn/visualization-utils", + "@kbn/palettes", ], "exclude": [ "target/**/*", diff --git a/packages/kbn-data-stream-adapter/index.ts b/packages/kbn-data-stream-adapter/index.ts deleted file mode 100644 index f03a384dca1f..000000000000 --- a/packages/kbn-data-stream-adapter/index.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { DataStreamAdapter } from './src/data_stream_adapter'; -export { DataStreamSpacesAdapter } from './src/data_stream_spaces_adapter'; - -export { retryTransientEsErrors, ecsFieldMap } from '@kbn/index-adapter'; -export type { - SetComponentTemplateParams, - SetIndexTemplateParams, - InstallParams, - EcsFieldMap, -} from '@kbn/index-adapter'; - -export * from '@kbn/index-adapter/src/field_maps/types'; diff --git a/packages/kbn-data-stream-adapter/jest.config.js b/packages/kbn-data-stream-adapter/jest.config.js deleted file mode 100644 index 9dad2c70d375..000000000000 --- a/packages/kbn-data-stream-adapter/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-data-stream-adapter'], -}; diff --git a/packages/kbn-data-stream-adapter/package.json b/packages/kbn-data-stream-adapter/package.json deleted file mode 100644 index 588c7e4a1cf3..000000000000 --- a/packages/kbn-data-stream-adapter/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/data-stream-adapter", - "version": "1.0.0", - "description": "Utility library for Elasticsearch Data Stream management", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true -} diff --git a/packages/kbn-data-stream-adapter/src/data_stream_adapter.ts b/packages/kbn-data-stream-adapter/src/data_stream_adapter.ts deleted file mode 100644 index f54ed81312d7..000000000000 --- a/packages/kbn-data-stream-adapter/src/data_stream_adapter.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { IndexAdapter, SetIndexTemplateParams, type InstallParams } from '@kbn/index-adapter'; -import { createOrUpdateDataStream } from './create_or_update_data_stream'; - -export class DataStreamAdapter extends IndexAdapter { - public setIndexTemplate(params: SetIndexTemplateParams) { - super.setIndexTemplate({ ...params, isDataStream: true }); - } - - public async install(params: InstallParams) { - this.installed = true; - const { logger, pluginStop$, tasksTimeoutMs } = params; - const esClient = await params.esClient; - - await this.installTemplates(params); - - const installFn = this.getInstallFn({ logger, pluginStop$, tasksTimeoutMs }); - - // create data stream when everything is ready - await installFn( - createOrUpdateDataStream({ - name: this.name, - esClient, - logger, - totalFieldsLimit: this.totalFieldsLimit, - }), - `${this.name} data stream` - ); - } -} diff --git a/packages/kbn-data-stream-adapter/tsconfig.json b/packages/kbn-data-stream-adapter/tsconfig.json deleted file mode 100644 index 8c8bcce97fe7..000000000000 --- a/packages/kbn-data-stream-adapter/tsconfig.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - ] - }, - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/core", - "@kbn/index-adapter", - ], - "exclude": [ - "target/**/*" - ], -} diff --git a/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.test.ts b/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.test.ts index 47792f0aa6d1..fcbf7848603a 100644 --- a/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.test.ts +++ b/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.test.ts @@ -13,7 +13,7 @@ import { LogLevelCoalescedValue } from './get_log_level_coalesed_value'; const euiTheme = { colors: { - lightShade: '#ffffff', + mediumShade: '#d3dae6', }, }; @@ -32,20 +32,20 @@ describe('getLogLevelColor', () => { '#d6bf57' ); expect(getLogLevelColor(LogLevelCoalescedValue.error, euiTheme as EuiThemeComputed)).toBe( - '#df9352' + '#e18774' ); expect(getLogLevelColor(LogLevelCoalescedValue.critical, euiTheme as EuiThemeComputed)).toBe( - '#e7664c' + '#dd7b67' ); expect(getLogLevelColor(LogLevelCoalescedValue.alert, euiTheme as EuiThemeComputed)).toBe( - '#da5e47' + '#d76f5b' ); expect(getLogLevelColor(LogLevelCoalescedValue.emergency, euiTheme as EuiThemeComputed)).toBe( - '#cc5642' + '#d2634e' ); // other expect(getLogLevelColor(LogLevelCoalescedValue.trace, euiTheme as EuiThemeComputed)).toBe( - '#ffffff' + '#d3dae6' ); }); }); diff --git a/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.ts b/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.ts index 3e9d2e419bb7..1418ae7f10f4 100644 --- a/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.ts +++ b/packages/kbn-discover-utils/src/data_types/logs/utils/get_log_level_color.ts @@ -7,7 +7,12 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EuiThemeComputed, euiPaletteForTemperature, euiPaletteForStatus } from '@elastic/eui'; +import { + EuiThemeComputed, + euiPaletteForTemperature, + euiPaletteForStatus, + euiPaletteRed, +} from '@elastic/eui'; import { LogLevelCoalescedValue } from './get_log_level_coalesed_value'; export const getLogLevelColor = ( @@ -16,8 +21,11 @@ export const getLogLevelColor = ( ): string | undefined => { const euiPaletteForTemperature6 = euiPaletteForTemperature(6); const euiPaletteForStatus9 = euiPaletteForStatus(9); + const euiPaletteRed9 = euiPaletteRed(14); switch (logLevelCoalescedValue) { + case LogLevelCoalescedValue.trace: + return euiTheme.colors.mediumShade; case LogLevelCoalescedValue.debug: return euiPaletteForTemperature6[2]; // lighter, closer to the default color for all other unknown log levels case LogLevelCoalescedValue.info: @@ -27,15 +35,16 @@ export const getLogLevelColor = ( case LogLevelCoalescedValue.warning: return euiPaletteForStatus9[4]; case LogLevelCoalescedValue.error: - return euiPaletteForStatus9[5]; + return euiPaletteRed9[9]; case LogLevelCoalescedValue.critical: - return euiPaletteForStatus9[6]; + return euiPaletteRed9[10]; case LogLevelCoalescedValue.alert: - return euiPaletteForStatus9[7]; + return euiPaletteRed9[11]; case LogLevelCoalescedValue.emergency: + return euiPaletteRed9[12]; case LogLevelCoalescedValue.fatal: - return euiPaletteForStatus9[8]; + return euiPaletteRed9[13]; default: - return euiTheme.colors.lightShade; + return euiTheme.colors.mediumShade; } }; diff --git a/packages/kbn-discover-utils/src/utils/get_log_document_overview.ts b/packages/kbn-discover-utils/src/utils/get_log_document_overview.ts index 33c8fdba6852..04c70a87aff4 100644 --- a/packages/kbn-discover-utils/src/utils/get_log_document_overview.ts +++ b/packages/kbn-discover-utils/src/utils/get_log_document_overview.ts @@ -30,8 +30,7 @@ export function getLogDocumentOverview( }; const levelArray = doc.flattened[fieldConstants.LOG_LEVEL_FIELD]; - const level = - Array.isArray(levelArray) && levelArray.length ? levelArray[0].toLowerCase() : levelArray; + const level = Array.isArray(levelArray) && levelArray.length > 0 ? levelArray[0] : levelArray; const message = formatField(fieldConstants.MESSAGE_FIELD); const errorMessage = formatField(fieldConstants.ERROR_MESSAGE_FIELD); const eventOriginal = formatField(fieldConstants.EVENT_ORIGINAL_FIELD); diff --git a/packages/kbn-es-types/index.ts b/packages/kbn-es-types/index.ts index 683fddb541ba..d4ba23840e2a 100644 --- a/packages/kbn-es-types/index.ts +++ b/packages/kbn-es-types/index.ts @@ -13,6 +13,7 @@ export type { SearchHit, ESSearchResponse, ESSearchRequest, + ESSearchRequestWithoutBody, ESSourceOptions, InferSearchResponseOf, AggregationResultOf, diff --git a/packages/kbn-es-types/src/index.ts b/packages/kbn-es-types/src/index.ts index 2ec37ba47478..77d02320b6f2 100644 --- a/packages/kbn-es-types/src/index.ts +++ b/packages/kbn-es-types/src/index.ts @@ -8,6 +8,7 @@ */ import * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import * as estypesWithoutBody from '@elastic/elasticsearch/lib/api/types'; import type { Field, QueryDslFieldAndFormat, @@ -26,6 +27,7 @@ import { export type ESFilter = estypes.QueryDslQueryContainer; export type ESSearchRequest = estypes.SearchRequest; +export type ESSearchRequestWithoutBody = estypesWithoutBody.SearchRequest; export type AggregationOptionsByType = Required; // Typings for Elasticsearch queries and aggregations. These are intended to be diff --git a/packages/kbn-es-types/src/search.ts b/packages/kbn-es-types/src/search.ts index d3675e04c266..1c9a9e16fd4a 100644 --- a/packages/kbn-es-types/src/search.ts +++ b/packages/kbn-es-types/src/search.ts @@ -23,20 +23,15 @@ type InvalidAggregationRequest = unknown; // Union keys are not included in keyof, but extends iterates over the types in a union. type ValidAggregationKeysOf> = T extends T ? keyof T : never; -type KeyOfSource = Record< - keyof T, - (T extends Record ? null : never) | string | number ->; +type KeyOfSource = { + [key in keyof T]: + | (T[key] extends Record ? null : never) + | string + | number; +}; -type KeysOfSources = T extends [any] - ? KeyOfSource - : T extends [any, any] - ? KeyOfSource & KeyOfSource - : T extends [any, any, any] - ? KeyOfSource & KeyOfSource & KeyOfSource - : T extends [any, any, any, any] - ? KeyOfSource & KeyOfSource & KeyOfSource & KeyOfSource - : Record; +// convert to intersection to be able to get all the keys +type KeysOfSources = UnionToIntersection>>>; type CompositeKeysOf = TAggregationContainer extends { diff --git a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts index ca59efd40de4..fc7bf0b6bb50 100644 --- a/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts +++ b/packages/kbn-eslint-plugin-i18n/helpers/get_i18n_identifier_from_file_path.test.ts @@ -13,7 +13,7 @@ const SYSTEMPATH = 'systemPath'; const testMap = [ [ - 'x-pack/plugins/observability_solution/observability/public/header_actions.tsx', + 'x-pack/solutions/observability/plugins/observability/public/header_actions.tsx', 'xpack.observability', ], [ @@ -22,7 +22,7 @@ const testMap = [ ], ['x-pack/plugins/cases/server/components/foo.tsx', 'xpack.cases'], [ - 'x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx', + 'x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx', 'xpack.synthetics', ], ['src/plugins/vis_types/gauge/public/editor/collections.ts', 'visTypeGauge'], diff --git a/packages/kbn-eslint-plugin-i18n/rules/formatted_message_should_start_with_the_right_id.test.ts b/packages/kbn-eslint-plugin-i18n/rules/formatted_message_should_start_with_the_right_id.test.ts index 55d32fb801f0..69d03af917d1 100644 --- a/packages/kbn-eslint-plugin-i18n/rules/formatted_message_should_start_with_the_right_id.test.ts +++ b/packages/kbn-eslint-plugin-i18n/rules/formatted_message_should_start_with_the_right_id.test.ts @@ -52,13 +52,13 @@ for (const [name, tester] of [tsTester, babelTester]) { { name: 'When a string literal is passed to FormattedMessage the ID attribute should start with the correct i18n identifier, and if no existing defaultMessage is passed, it should add an empty default.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ``, }, { name: 'When a string literal is passed to FormattedMessage the ID attribute should start with the correct i18n identifier, and if an existing id and defaultMessage is passed, it should leave them alone.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ``, }, ], @@ -66,7 +66,7 @@ for (const [name, tester] of [tsTester, babelTester]) { { name: 'When a string literal is passed to FormattedMessage the ID attribute should start with the correct i18n identifier, and if no existing defaultMessage is passed, it should add an empty default.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import { FormattedMessage } from '@kbn/i18n-react'; @@ -89,7 +89,7 @@ for (const [name, tester] of [tsTester, babelTester]) { { name: 'When a string literal is passed to the ID attribute of and the root of the i18n identifier is not correct, it should keep the existing identifier but only update the right base app, and keep the default message if available.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import { FormattedMessage } from '@kbn/i18n-react'; @@ -112,7 +112,7 @@ for (const [name, tester] of [tsTester, babelTester]) { { name: 'When no string literal is passed to the ID attribute of it should start with the correct i18n identifier.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import { FormattedMessage } from '@kbn/i18n-react'; @@ -135,7 +135,7 @@ for (const [name, tester] of [tsTester, babelTester]) { { name: 'When i18n is not imported yet, the rule should add it.', filename: - '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` function TestComponent() { return ; diff --git a/packages/kbn-eslint-plugin-i18n/rules/i18n_translate_should_start_with_the_right_id.test.ts b/packages/kbn-eslint-plugin-i18n/rules/i18n_translate_should_start_with_the_right_id.test.ts index 36ddbdd3c425..df701532517b 100644 --- a/packages/kbn-eslint-plugin-i18n/rules/i18n_translate_should_start_with_the_right_id.test.ts +++ b/packages/kbn-eslint-plugin-i18n/rules/i18n_translate_should_start_with_the_right_id.test.ts @@ -45,7 +45,7 @@ const babelTester = [ const invalid: RuleTester.InvalidTestCase[] = [ { name: 'When a string literal is passed to i18n.translate, it should start with the correct i18n identifier, and if no existing defaultMessage is passed, it should add an empty default.', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.ts', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.ts', code: ` import { i18n } from '@kbn/i18n'; @@ -67,7 +67,7 @@ function TestComponent() { }, { name: 'When a string literal is passed to i18n.translate, and the root of the i18n identifier is not correct, it should keep the existing identifier but only update the right base app.', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.ts', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.ts', code: ` import { i18n } from '@kbn/i18n'; @@ -89,7 +89,7 @@ function TestComponent() { }, { name: 'When a string literal is passed to i18n.translate, and the root of the i18n identifier is not correct, it should keep the existing identifier but only update the right base app, and keep the default message if available.', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.ts', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.ts', code: ` import { i18n } from '@kbn/i18n'; @@ -111,7 +111,7 @@ function TestComponent() { }, { name: 'When no string literal is passed to i18n.translate, it should start with the correct i18n identifier.', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.ts', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.ts', code: ` import { i18n } from '@kbn/i18n'; @@ -133,7 +133,7 @@ function TestComponent() { }, { name: 'When i18n is not imported yet, the rule should add it.', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.ts', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.ts', code: ` function TestComponent() { const foo = i18n.translate(); diff --git a/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_formatted_message.test.ts b/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_formatted_message.test.ts index b9aeaed90d1a..298e5976add2 100644 --- a/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_formatted_message.test.ts +++ b/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_formatted_message.test.ts @@ -45,7 +45,7 @@ const babelTester = [ const invalid: RuleTester.InvalidTestCase[] = [ { name: 'A JSX element with a string literal should be translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -76,7 +76,7 @@ function TestComponent() { }, { name: 'A JSX element with a string literal that are inside an Eui component should take the component name of the parent into account', - filename: '/x-pack/plugins/observability_solution/observability/public/another_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/another_component.tsx', code: ` import React from 'react'; @@ -120,7 +120,7 @@ function AnotherComponent() { { name: 'When no import of the translation module is present, the import line should be added', filename: - '/x-pack/plugins/observability_solution/observability/public/yet_another_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/yet_another_component.tsx', code: ` import React from 'react'; @@ -155,7 +155,7 @@ function YetAnotherComponent() { }, { name: 'Import lines without the necessary translation module should be updated to include i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { SomeOtherModule } from '@kbn/i18n-react'; @@ -183,7 +183,7 @@ function TestComponent() { }, { name: 'JSX elements that have a label, aria-label or title prop with a string value should be translated with FormattedMessage', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -239,7 +239,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a string value with quotes in it should be correctly translated with FormattedMessage', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -295,7 +295,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string should be translated with FormattedMessage', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -351,7 +351,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string with quotes in it should be correctly translated with FormattedMessage', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -410,7 +410,7 @@ function TestComponent3() { const valid: RuleTester.ValidTestCase[] = [ { name: 'A JSXText element inside a EuiCode component should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -422,7 +422,7 @@ function TestComponent() { }, { name: 'A JSXText element that contains anything other than alpha characters should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -434,7 +434,7 @@ function TestComponent() { }, { name: 'A JSXText element that is wrapped in three backticks (markdown) should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; diff --git a/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_i18n.test.ts b/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_i18n.test.ts index 17a1e290befb..1d36880057f1 100644 --- a/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_i18n.test.ts +++ b/packages/kbn-eslint-plugin-i18n/rules/strings_should_be_translated_with_i18n.test.ts @@ -45,7 +45,7 @@ const babelTester = [ const invalid: RuleTester.InvalidTestCase[] = [ { name: 'A JSX element with a string literal should be translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -72,7 +72,7 @@ function TestComponent() { }, { name: 'A JSX element with a string literal that are inside an Eui component should take the component name of the parent into account', - filename: '/x-pack/plugins/observability_solution/observability/public/another_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/another_component.tsx', code: ` import React from 'react'; @@ -112,7 +112,7 @@ function AnotherComponent() { { name: 'When no import of the translation module is present, the import line should be added', filename: - '/x-pack/plugins/observability_solution/observability/public/yet_another_component.tsx', + '/x-pack/solutions/observability/plugins/observability/public/yet_another_component.tsx', code: ` import React from 'react'; @@ -143,7 +143,7 @@ function YetAnotherComponent() { }, { name: 'Import lines without the necessary translation module should be updated to include i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { SomeOtherModule } from '@kbn/i18n'; @@ -171,7 +171,7 @@ function TestComponent() { }, { name: 'JSX elements that have a label, aria-label or title prop with a string value should be translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { i18n } from '@kbn/i18n'; @@ -227,7 +227,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a string value with quotes should be correctly translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { i18n } from '@kbn/i18n'; @@ -283,7 +283,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string should be translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { i18n } from '@kbn/i18n'; @@ -339,7 +339,7 @@ function TestComponent3() { }, { name: 'JSX elements that have a label, aria-label or title prop with a JSXExpression value that is a string with quotes in it should be correctly translated with i18n', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; import { i18n } from '@kbn/i18n'; @@ -398,7 +398,7 @@ function TestComponent3() { const valid: RuleTester.ValidTestCase[] = [ { name: 'A JSXText element inside a EuiCode component should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -410,7 +410,7 @@ function TestComponent() { }, { name: 'A JSXText element that contains anything other than alpha characters should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; @@ -422,7 +422,7 @@ function TestComponent() { }, { name: 'A JSXText element that is wrapped in three backticks (markdown) should not be translated', - filename: '/x-pack/plugins/observability_solution/observability/public/test_component.tsx', + filename: '/x-pack/solutions/observability/plugins/observability/public/test_component.tsx', code: ` import React from 'react'; diff --git a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts index 0d5526103fb7..5053c4ca5a8e 100644 --- a/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts +++ b/packages/kbn-eslint-plugin-telemetry/helpers/get_app_name.test.ts @@ -12,7 +12,7 @@ import { getAppName } from './get_app_name'; const SYSTEMPATH = 'systemPath'; const testMap = [ - ['x-pack/plugins/observability_solution/observability/foo/bar/baz/header_actions.tsx', 'o11y'], + ['x-pack/solutions/observability/plugins/observability/foo/bar/baz/header_actions.tsx', 'o11y'], ['x-pack/plugins/observability_solution/apm/baz/header_actions.tsx', 'apm'], ['x-pack/plugins/apm/public/components/app/correlations/correlations_table.tsx', 'apm'], ['x-pack/plugins/observability/foo/bar/baz/header_actions.tsx', 'o11y'], diff --git a/packages/kbn-event-annotation-components/components/annotation_editor_controls/annotation_editor_controls.tsx b/packages/kbn-event-annotation-components/components/annotation_editor_controls/annotation_editor_controls.tsx index de230ac61798..9053494071c0 100644 --- a/packages/kbn-event-annotation-components/components/annotation_editor_controls/annotation_editor_controls.tsx +++ b/packages/kbn-event-annotation-components/components/annotation_editor_controls/annotation_editor_controls.tsx @@ -11,7 +11,14 @@ import './index.scss'; import { isFieldLensCompatible } from '@kbn/visualization-ui-components'; import React, { useCallback, useEffect, useMemo } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFormRow, EuiSwitch, EuiSwitchEvent, EuiButtonGroup, EuiSpacer } from '@elastic/eui'; +import { + EuiFormRow, + EuiSwitch, + EuiSwitchEvent, + EuiButtonGroup, + EuiSpacer, + euiPaletteColorBlind, +} from '@elastic/eui'; import { IconSelectSetting, DimensionEditorSection, @@ -339,6 +346,7 @@ const AnnotationEditorControls = ({ label={i18n.translate('eventAnnotationComponents.xyChart.lineColor.label', { defaultMessage: 'Color', })} + swatches={euiPaletteColorBlind()} /> Run `yarn storybook expandable_flyout` to take a quick look at the expandable flyout in action - -## Design decisions - -The expandable-flyout is making some strict UI design decisions: -- when in collapsed mode (i.e. when only the right/preview section is open), the flyout's width linearly grows from its minimum value of 380px to its maximum value of 750px -- when in expanded mode (i.e. when the left section is opened), the flyout's width changes depending on the browser's width: - - if the window is smaller than 1600px, the flyout takes the entire browser window (minus 48px of padding on the left) - - for windows bigger than 1600px, the flyout's width is 80% of the entire browser window (with a max width of 1500px for the left section, and 750px for the right section) - -> While the expandable-flyout will work on very small screens, having both the right and left sections visible at the same time will not be a good experience to the user. We recommend only showing the right panel, and therefore handling this situation when you build your panels by considering hiding the actions that could open the left panel (like the expand details button in the [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx)). - -## State persistence - -The expandable flyout offers 2 ways of managing its state: - -### Memory storage - -The default behavior saves the state of the flyout in memory. The state is internal to the package and based on an isolated redux context. Using this mode means the state will not be persisted when sharing url or reloading browser pages. - -### Url storage - -The second way (done by setting the `urlKey` prop to a string value) saves the state of the flyout in the url. This allows the flyout to be automatically reopened when users refresh the browser page, or when users share an url. The `urlKey` will be used as the url parameter. - -**_Note: the word `memory` cannot be used as an `urlKey` as it is reserved for the memory storage behavior. You can use any other string value, try to use something that should be unique._** - -> We highly recommend NOT nesting flyouts in your code, as it would cause conflicts for the url keys. We recommend instead to build multiple panels, with each their own context to manage their data (for example, take a look at the Security Solution [setup](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout)). -> -> A good solution is for example to have one instance of a flyout at a page level, and then have multiple panels that can be opened in that flyout. - - -## Package API - -The ExpandableFlyout [React component](https://github.com/elastic/kibana/tree/main/packages/kbn-expandable-flyout/src/index.tsx) renders the UI, leveraging an [EuiFlyout](https://eui.elastic.co/#/layout/flyout). - -To retrieve the flyout's layout (left, right and preview panels), you can utilize [useExpandableFlyoutState](https://github.com/elastic/kibana/blob/main/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_state.ts). - -To control (or mutate) flyout's layout, you can utilize [useExpandableFlyoutApi](https://github.com/elastic/kibana/blob/main/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_api.ts). - -**Expandable Flyout API** exposes the following methods: -- **openFlyout**: open the flyout with a set of panels -- **openRightPanel**: open a right panel -- **openLeftPanel**: open a left panel -- **openPreviewPanel**: open a preview panel -- **closeRightPanel**: close the right panel -- **closeLeftPanel**: close the left panel -- **closePreviewPanel**: close the preview panels -- **previousPreviewPanel**: navigate to the previous preview panel -- **closeFlyout**: close the flyout - -> The expandable flyout propagates the `onClose` callback from the EuiFlyout component. As we recommend having a single instance of the flyout in your application, it's up to the application's code to dispatch the event (through Redux, window events, observable, prop drilling...). - -## Usage - -To use the expandable flyout in your plugin, first you need wrap your code with the [context provider](https://github.com/elastic/kibana/blob/main/packages/kbn-expandable-flyout/src/context.tsx) at a high enough level as follows: -```typescript jsx -// state stored in the url - - ... - - - -// state stored in memory - - ... - -``` - -Then use the [React UI component](https://github.com/elastic/kibana/tree/main/packages/kbn-expandable-flyout/src/index.tsx) where you need: - -```typescript jsx - -``` -_where `myPanels` is a list of all the panels that can be rendered in the flyout_ - -## Optional properties - -The expandable flyout now offers a way for users to change some of the flyout's UI properties. These are done via a gear icon in the top right corner of the flyout, to the left of the close icon. - -The gear icon can be hidden by setting the `hideSettings` property to `true` in the flyout's custom props. -The `typeDisabled` property allows to disable the push/overlay toggle. -```typescript -flyoutCustomProps?: { - hideSettings?: boolean; - typeDisabled?: boolean, -}; -``` - -At the moment, clicking on the gear icon opens a popover that allows you to toggle the flyout between `overlay` and `push` modes (see [EUI](https://eui.elastic.co/#/layout/flyout#push-versus-overlay)). The default value is `overlay`. The package remembers the selected value in local storage, only for expandable flyout that have a urlKey. The state of memory flyouts is not persisted. - -## Terminology - -### Section - -One of the 3 areas of the flyout (**left**, **right** or **preview**). - -### Panel - -A set of properties defining what's displayed in one of the flyout section (see interface [here](https://github.com/elastic/kibana/blob/main/packages/kbn-expandable-flyout/src/types.ts)). diff --git a/packages/kbn-expandable-flyout/__mocks__/index.tsx b/packages/kbn-expandable-flyout/__mocks__/index.tsx deleted file mode 100644 index 75da56c9eb81..000000000000 --- a/packages/kbn-expandable-flyout/__mocks__/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { IStorage } from '@kbn/kibana-utils-plugin/public'; - -export const ExpandableFlyout = jest.fn(); - -export const localStorageMock = (): IStorage => { - let store: Record = {}; - - return { - getItem: (key: string) => { - return store[key] || null; - }, - setItem: (key: string, value: unknown) => { - store[key] = value; - }, - clear() { - store = {}; - }, - removeItem(key: string) { - delete store[key]; - }, - }; -}; diff --git a/packages/kbn-expandable-flyout/index.ts b/packages/kbn-expandable-flyout/index.ts deleted file mode 100644 index 5816b6673dbc..000000000000 --- a/packages/kbn-expandable-flyout/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { ExpandableFlyout } from './src'; - -export { useExpandableFlyoutApi } from './src/hooks/use_expandable_flyout_api'; -export { useExpandableFlyoutState } from './src/hooks/use_expandable_flyout_state'; - -export { type FlyoutPanels as ExpandableFlyoutState } from './src/store/state'; - -export { ExpandableFlyoutProvider } from './src/provider'; - -export type { ExpandableFlyoutProps } from './src'; -export type { FlyoutPanelProps, PanelPath, ExpandableFlyoutApi } from './src/types'; diff --git a/packages/kbn-expandable-flyout/jest.config.js b/packages/kbn-expandable-flyout/jest.config.js deleted file mode 100644 index c318a1b2717b..000000000000 --- a/packages/kbn-expandable-flyout/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-expandable-flyout'], -}; diff --git a/packages/kbn-expandable-flyout/package.json b/packages/kbn-expandable-flyout/package.json deleted file mode 100644 index 7cb64358db0b..000000000000 --- a/packages/kbn-expandable-flyout/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/expandable-flyout", - "private": true, - "version": "1.0.0", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "sideEffects": false -} \ No newline at end of file diff --git a/packages/kbn-expandable-flyout/src/components/left_section.tsx b/packages/kbn-expandable-flyout/src/components/left_section.tsx deleted file mode 100644 index 591062116a97..000000000000 --- a/packages/kbn-expandable-flyout/src/components/left_section.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EuiFlexItem } from '@elastic/eui'; -import React, { memo } from 'react'; -import { LEFT_SECTION_TEST_ID } from './test_ids'; - -interface LeftSectionProps { - /** - * Component to be rendered - */ - component: React.ReactElement; -} - -/** - * Left section of the expanded flyout rendering a panel - */ -export const LeftSection: React.FC = memo(({ component }: LeftSectionProps) => ( - - {component} - -)); - -LeftSection.displayName = 'LeftSection'; diff --git a/packages/kbn-expandable-flyout/src/components/right_section.tsx b/packages/kbn-expandable-flyout/src/components/right_section.tsx deleted file mode 100644 index ab6598b9f8e3..000000000000 --- a/packages/kbn-expandable-flyout/src/components/right_section.tsx +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EuiFlexItem } from '@elastic/eui'; -import React, { memo } from 'react'; -import { RIGHT_SECTION_TEST_ID } from './test_ids'; - -interface RightSectionProps { - /** - * Component to be rendered - */ - component: React.ReactElement; -} - -/** - * Right section of the expanded flyout rendering a panel - */ -export const RightSection: React.FC = memo( - ({ component }: RightSectionProps) => ( - - {component} - - ) -); - -RightSection.displayName = 'RightSection'; diff --git a/packages/kbn-expandable-flyout/src/components/test_ids.ts b/packages/kbn-expandable-flyout/src/components/test_ids.ts deleted file mode 100644 index 22d2e00ed66c..000000000000 --- a/packages/kbn-expandable-flyout/src/components/test_ids.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export const FLYOUT_TEST_ID = 'resizableFlyout'; - -export const RIGHT_SECTION_TEST_ID = 'rightSection'; - -export const LEFT_SECTION_TEST_ID = 'leftSection'; - -export const PREVIEW_SECTION_TEST_ID = 'previewSection'; - -export const PREVIEW_SECTION_CLOSE_BUTTON_TEST_ID = 'previewSectionCloseButton'; - -export const PREVIEW_SECTION_BACK_BUTTON_TEST_ID = 'previewSectionBackButton'; - -export const PREVIEW_SECTION_HEADER_TEST_ID = 'previewSectionHeader'; - -export const SETTINGS_MENU_BUTTON_TEST_ID = 'settingsMenuButton'; - -export const SETTINGS_MENU_FLYOUT_TYPE_TITLE_TEST_ID = 'settingsMenuFlyoutTypeTitle'; - -export const SETTINGS_MENU_FLYOUT_TYPE_INFORMATION_ICON_TEST_ID = - 'settingsMenuFlyoutTypeInformationIcon'; - -export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_TEST_ID = 'settingsMenuFlyoutTypeButtonGroup'; - -export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_OVERLAY_TEST_ID = - 'settingsMenuFlyoutTypeButtonGroupOverlayOption'; - -export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_PUSH_TEST_ID = - 'settingsMenuFlyoutTypeButtonGroupPushOption'; - -export const SETTINGS_MENU_FLYOUT_RESIZE_TITLE_TEST_ID = 'settingsMenuFlyoutSizeTitle'; - -export const SETTINGS_MENU_FLYOUT_RESIZE_INFORMATION_ICON_TEST_ID = - 'settingsMenuFlyoutSizeInformationIcon'; - -export const SETTINGS_MENU_FLYOUT_RESIZE_BUTTON_TEST_ID = 'settingsMenuFlyoutSizeButton'; - -export const RESIZABLE_LEFT_SECTION_TEST_ID = 'resizableLeftSection'; - -export const RESIZABLE_RIGHT_SECTION_TEST_ID = 'resizableRightSection'; - -export const RESIZABLE_BUTTON_TEST_ID = 'resizableButton'; diff --git a/packages/kbn-expandable-flyout/src/components/translations.ts b/packages/kbn-expandable-flyout/src/components/translations.ts deleted file mode 100644 index 01ab016a720c..000000000000 --- a/packages/kbn-expandable-flyout/src/components/translations.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; - -export const BACK_BUTTON = i18n.translate('expandableFlyout.previewSection.backButton', { - defaultMessage: 'Back', -}); - -export const CLOSE_BUTTON = i18n.translate('expandableFlyout.previewSection.closeButton', { - defaultMessage: 'Close', -}); diff --git a/packages/kbn-expandable-flyout/src/constants.ts b/packages/kbn-expandable-flyout/src/constants.ts deleted file mode 100644 index dfabd845a3f2..000000000000 --- a/packages/kbn-expandable-flyout/src/constants.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/** - * This is a reserved word that we use as an id when no urlKey is provided and we are in memory storage mode - */ -export const REDUX_ID_FOR_MEMORY_STORAGE = 'memory'; - -export const EXPANDABLE_FLYOUT_LOCAL_STORAGE = 'expandableFlyout.ui'; -export const PUSH_VS_OVERLAY_LOCAL_STORAGE = 'pushVsOverlay'; -export const USER_COLLAPSED_WIDTH_LOCAL_STORAGE = 'collapsedWidth'; -export const USER_EXPANDED_WIDTH_LOCAL_STORAGE = 'expandedWidth'; -export const USER_SECTION_WIDTHS_LOCAL_STORAGE = 'sectionWidths'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_state.ts b/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_state.ts deleted file mode 100644 index 88a94f66d54a..000000000000 --- a/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_state.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useMemo } from 'react'; -import { REDUX_ID_FOR_MEMORY_STORAGE } from '../constants'; -import { useExpandableFlyoutContext } from '../context'; -import { selectPanelsById, useSelector } from '../store/redux'; - -/** - * This hook allows you to access the flyout state, read open right, left and preview panels. - */ -export const useExpandableFlyoutState = () => { - const { urlKey } = useExpandableFlyoutContext(); - // if no urlKey is provided, we are in memory storage mode and use the reserved word 'memory' - const id = useMemo(() => urlKey || REDUX_ID_FOR_MEMORY_STORAGE, [urlKey]); - - return useSelector(selectPanelsById(id)); -}; diff --git a/packages/kbn-expandable-flyout/src/index.stories.tsx b/packages/kbn-expandable-flyout/src/index.stories.tsx deleted file mode 100644 index 1e8e08d96c07..000000000000 --- a/packages/kbn-expandable-flyout/src/index.stories.tsx +++ /dev/null @@ -1,362 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import type { Story } from '@storybook/react'; -import { - EuiButton, - EuiFlexGroup, - EuiFlexItem, - EuiFlyoutBody, - EuiFlyoutFooter, - EuiFlyoutHeader, - EuiPanel, - EuiTitle, -} from '@elastic/eui'; -import { ExpandableFlyout } from '.'; -import { TestProvider } from './test/provider'; -import { initialUiState, State } from './store/state'; - -export default { - component: ExpandableFlyout, - title: 'ExpandableFlyout', -}; - -const registeredPanels = [ - { - key: 'right', - component: () => ( - <> - - -

{'Right panel header'}

-
-
- -

{'Example of a right component body'}

-
- - - - {'Footer button'} - - - - - ), - }, - { - key: 'left', - component: () => ( - - - - -

{'Left panel header'}

-
-
-

{'Example of a left component content'}

- -
-
- ), - }, - { - key: 'preview1', - component: () => ( - - - - -

{'Preview panel header'}

-
-
-

{'Example of a preview component content'}

- -
-
- ), - }, - { - key: 'preview2', - component: () => ( - - - - -

{'Second preview panel header'}

-
-
-

{'Example of another preview component content'}

- -
-
- ), - }, -]; - -export const Right: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: undefined, - preview: undefined, - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const Left: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: undefined, - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const Preview: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: [ - { - id: 'preview1', - }, - ], - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const MultiplePreviews: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: [ - { - id: 'preview1', - }, - { - id: 'preview2', - }, - ], - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const CollapsedPushMode: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: undefined, - preview: undefined, - }, - }, - }, - ui: { - ...initialUiState, - pushVsOverlay: 'push', - }, - }; - - return ( - - - - ); -}; - -export const ExpandedPushMode: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: undefined, - }, - }, - }, - ui: { - ...initialUiState, - pushVsOverlay: 'push', - }, - }; - - return ( - - - - ); -}; - -export const DisableTypeSelection: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: undefined, - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const ResetWidths: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: undefined, - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; - -export const DisableResizeWidthSelection: Story = () => { - const state: State = { - panels: { - byId: { - memory: { - right: { - id: 'right', - }, - left: { - id: 'left', - }, - preview: undefined, - }, - }, - }, - ui: initialUiState, - }; - - return ( - - - - ); -}; diff --git a/packages/kbn-expandable-flyout/src/index.tsx b/packages/kbn-expandable-flyout/src/index.tsx deleted file mode 100644 index 25425a75e2ba..000000000000 --- a/packages/kbn-expandable-flyout/src/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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useMemo } from 'react'; -import type { Interpolation, Theme } from '@emotion/react'; -import { EuiFlyoutProps } from '@elastic/eui'; -import { EuiFlyoutResizableProps } from '@elastic/eui/src/components/flyout/flyout_resizable'; -import { Container } from './components/container'; -import { useWindowWidth } from './hooks/use_window_width'; -import { useInitializeFromLocalStorage } from './hooks/use_initialize_from_local_storage'; -import { FlyoutCustomProps } from './components/settings_menu'; -import type { Panel } from './types'; - -export interface ExpandableFlyoutProps extends Omit { - /** - * List of all registered panels available for render - */ - registeredPanels: Panel[]; - /** - * Allows for custom styles to be passed to the EuiFlyout component - */ - customStyles?: Interpolation; - /** - * Callback function to let application's code the flyout is closed - */ - onClose?: EuiFlyoutProps['onClose']; - /** - * Set of properties that drive a settings menu - */ - flyoutCustomProps?: FlyoutCustomProps; - /** - * Optional data test subject string to be used on the EuiFlyoutResizable component - */ - 'data-test-subj'?: string; -} - -/** - * Expandable flyout UI React component. - * Displays 3 sections (right, left, preview) depending on the panels in the context. - * - * The behavior expects that the left and preview sections should only be displayed is a right section - * is already rendered. - */ -export const ExpandableFlyout: React.FC = ({ ...props }) => { - const windowWidth = useWindowWidth(); - - useInitializeFromLocalStorage(); - - const container = useMemo(() => , [props]); - - if (windowWidth === 0) { - return null; - } - - return <>{container}; -}; - -ExpandableFlyout.displayName = 'ExpandableFlyout'; diff --git a/packages/kbn-expandable-flyout/src/provider.tsx b/packages/kbn-expandable-flyout/src/provider.tsx deleted file mode 100644 index cad83bb0ee80..000000000000 --- a/packages/kbn-expandable-flyout/src/provider.tsx +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; -import React, { FC, PropsWithChildren, useEffect, useMemo } from 'react'; -import { Provider as ReduxProvider } from 'react-redux'; -import { useHistory } from 'react-router-dom'; -import { ExpandableFlyoutContextProvider, useExpandableFlyoutContext } from './context'; -import { FlyoutPanels } from './store/state'; -import { useExpandableFlyoutState } from './hooks/use_expandable_flyout_state'; -import { Context, selectNeedsSync, store, useDispatch, useSelector } from './store/redux'; -import { urlChangedAction } from './store/actions'; - -/** - * Dispatches actions when url state changes and initializes the state when the app is loaded with flyout url parameters - */ -export const UrlSynchronizer = () => { - const { urlKey } = useExpandableFlyoutContext(); - const panels = useExpandableFlyoutState(); - const needsSync = useSelector(selectNeedsSync()); - const dispatch = useDispatch(); - - const history = useHistory(); - - const urlStorage = useMemo( - () => - createKbnUrlStateStorage({ - history, - useHash: false, - useHashQuery: false, - }), - [history] - ); - - useEffect(() => { - if (!urlKey) { - return; - } - - const currentValue = urlStorage.get(urlKey); - - // Dispatch current value to redux store as it does not happen automatically - if (currentValue) { - dispatch( - urlChangedAction({ - ...currentValue, - preview: currentValue?.preview?.at(-1), - id: urlKey, - }) - ); - } - - const subscription = urlStorage.change$(urlKey).subscribe((value) => { - dispatch(urlChangedAction({ ...value, preview: value?.preview?.at(-1), id: urlKey })); - }); - - return () => subscription.unsubscribe(); - }, [dispatch, urlKey, urlStorage]); - - useEffect(() => { - if (!needsSync || !panels || !urlKey) { - return; - } - - const { left, right, preview } = panels; - urlStorage.set(urlKey, { left, right, preview: [preview?.at(-1)] }); - }, [needsSync, panels, urlKey, urlStorage]); - - return null; -}; - -interface ExpandableFlyoutProviderProps { - /** - * Unique key to be used as url parameter to store the state of the flyout. - * Providing this will save the state of the flyout in the url. - * The word `memory` is reserved, do NOT use it! - */ - urlKey?: string; -} - -/** - * Wrap your plugin with this context for the ExpandableFlyout React component. - */ -export const ExpandableFlyoutProvider: FC> = ({ - children, - urlKey, -}) => { - return ( - - - {urlKey ? : null} - {children} - - - ); -}; diff --git a/packages/kbn-expandable-flyout/src/test/provider.tsx b/packages/kbn-expandable-flyout/src/test/provider.tsx deleted file mode 100644 index 81de83720afd..000000000000 --- a/packages/kbn-expandable-flyout/src/test/provider.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Provider as ReduxProvider } from 'react-redux'; -import { configureStore } from '@reduxjs/toolkit'; -import React, { FC, PropsWithChildren } from 'react'; -import { I18nProvider } from '@kbn/i18n-react'; -import { - savePushVsOverlayToLocalStorageMiddleware, - saveUserSectionWidthsToLocalStorageMiddleware, - saveUserFlyoutWidthsToLocalStorageMiddleware, -} from '../store/middlewares'; -import { ExpandableFlyoutContextProvider } from '../context'; -import { panelsReducer, uiReducer } from '../store/reducers'; -import { Context } from '../store/redux'; -import { initialState, State } from '../store/state'; - -interface TestProviderProps { - state?: State; - urlKey?: string; -} - -export const TestProvider: FC> = ({ - children, - state = initialState, - urlKey, -}) => { - const store = configureStore({ - reducer: { - panels: panelsReducer, - ui: uiReducer, - }, - devTools: false, - preloadedState: state, - middleware: [ - savePushVsOverlayToLocalStorageMiddleware, - saveUserSectionWidthsToLocalStorageMiddleware, - saveUserFlyoutWidthsToLocalStorageMiddleware, - ], - }); - - return ( - - - - {children} - - - - ); -}; diff --git a/packages/kbn-expandable-flyout/src/types.ts b/packages/kbn-expandable-flyout/src/types.ts deleted file mode 100644 index 14e1a06ff460..000000000000 --- a/packages/kbn-expandable-flyout/src/types.ts +++ /dev/null @@ -1,94 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; - -export interface ExpandableFlyoutApi { - /** - * Open the flyout with left, right and/or preview panels - */ - openFlyout: (panels: { - left?: FlyoutPanelProps; - right?: FlyoutPanelProps; - preview?: FlyoutPanelProps; - }) => void; - /** - * Replaces the current right panel with a new one - */ - openRightPanel: (panel: FlyoutPanelProps) => void; - /** - * Replaces the current left panel with a new one - */ - openLeftPanel: (panel: FlyoutPanelProps) => void; - /** - * Add a new preview panel to the list of current preview panels - */ - openPreviewPanel: (panel: FlyoutPanelProps) => void; - /** - * Closes right panel - */ - closeRightPanel: () => void; - /** - * Closes left panel - */ - closeLeftPanel: () => void; - /** - * Closes all preview panels - */ - closePreviewPanel: () => void; - /** - * Go back to previous preview panel - */ - previousPreviewPanel: () => void; - /** - * Close all panels and closes flyout - */ - closeFlyout: () => void; -} - -export interface PanelPath { - /** - * Top level tab that to be displayed - */ - tab: string; - /** - * Optional secondary level to be displayed under top level tab - */ - subTab?: string; -} - -export interface FlyoutPanelProps { - /** - * Unique key to identify the panel - */ - id: string; - /** - * Any parameters necessary for the initial requests within the flyout - */ - params?: Record; - /** - * Tracks the path for what to show in a panel, such as activated tab and subtab - */ - path?: PanelPath; - /** - * Tracks visual state such as whether the panel is collapsed - */ - state?: Record; -} - -export interface Panel { - /** - * Unique key used to identify the panel - */ - key?: string; - /** - * Component to be rendered - */ - component: (props: FlyoutPanelProps) => React.ReactElement; -} diff --git a/packages/kbn-expandable-flyout/tsconfig.json b/packages/kbn-expandable-flyout/tsconfig.json deleted file mode 100644 index 5a0cf87cf61e..000000000000 --- a/packages/kbn-expandable-flyout/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop", - "@testing-library/jest-dom", - "@testing-library/react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/kibana-utils-plugin", - "@kbn/i18n-react" - ] -} diff --git a/packages/kbn-ftr-common-functional-ui-services/index.ts b/packages/kbn-ftr-common-functional-ui-services/index.ts index 1355d112ffaf..c316ecf7db60 100644 --- a/packages/kbn-ftr-common-functional-ui-services/index.ts +++ b/packages/kbn-ftr-common-functional-ui-services/index.ts @@ -15,7 +15,7 @@ export type { CustomCheerioStatic, } from './services/web_element_wrapper/custom_cheerio_api'; export { Browsers } from './services/remote/browsers'; -export { type Browser } from './services/browser'; +export { type Browser, type InterceptResponseFactory } from './services/browser'; export { NETWORK_PROFILES, type NetworkOptions, 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 56888b0a8087..7a3885d7e3f9 100644 --- a/packages/kbn-ftr-common-functional-ui-services/services/browser.ts +++ b/packages/kbn-ftr-common-functional-ui-services/services/browser.ts @@ -13,6 +13,7 @@ import { Key, Origin, type WebDriver } from 'selenium-webdriver'; import { Driver as ChromiumWebDriver } from 'selenium-webdriver/chrome'; import { setTimeout as setTimeoutAsync } from 'timers/promises'; import Url from 'url'; +import { Protocol } from 'devtools-protocol'; import { NoSuchSessionError } from 'selenium-webdriver/lib/error'; import sharp from 'sharp'; @@ -26,7 +27,12 @@ import { import { FtrService, type FtrProviderContext } from './ftr_provider_context'; export type Browser = BrowserService; - +export interface InterceptResponseFactory { + fail: () => ['Fetch.failRequest', Protocol.Fetch.FailRequestRequest]; + fulfill: ( + responseOptions: Omit + ) => ['Fetch.fulfillRequest', Protocol.Fetch.FulfillRequestRequest]; +} class BrowserService extends FtrService { /** * Keyboard events @@ -837,6 +843,59 @@ class BrowserService extends FtrService { throw new Error(message); } } + + /** + * Intercept network requests using the Chrome DevTools Protocol (CDP). + * @param pattern - URL pattern to match intercepted requests. + * @param onIntercept - Callback defining how to handle intercepted requests. + * @param cb - Callback to trigger actions that make requests. + */ + + public async interceptRequest( + pattern: string, + onIntercept: (responseFactory: InterceptResponseFactory) => [string, Record], + cb: () => Promise + ): Promise { + const connection = await this.driver.createCDPConnection('page'); + + return new Promise((resolve, reject) => { + connection._wsConnection.on('message', async (data: Buffer) => { + try { + const parsed = JSON.parse(data.toString()); + this.log.debug(`CDP Event: ${parsed.method} ${parsed.params?.request?.url}`); + + if (parsed.method === 'Fetch.requestPaused') { + const requestId = parsed.params.requestId; + + const [method, params] = onIntercept({ + fail: () => ['Fetch.failRequest', { requestId, errorReason: 'Failed' }], + fulfill: (responseOptions) => [ + 'Fetch.fulfillRequest', + { requestId, ...responseOptions }, + ], + }); + + connection.execute(method, params, () => { + this.log.debug(`Executed command: ${method}`); + }); + } + } catch (error) { + this.log.error(`Error in Fetch.requestPaused handler: ${error.message}`); + } + }); + + connection.execute('Fetch.enable', { patterns: [{ urlPattern: pattern }] }, (result: any) => { + this.log.debug('Fetch.enable result:', result); + + cb() + .then(resolve) + .catch((error) => { + this.log.error(`Error in callback: ${error.message}`); + reject(error); + }); + }); + }); + } } export async function BrowserProvider(ctx: FtrProviderContext) { diff --git a/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts b/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts index 4852cfb9d32c..ab5e294397a6 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor_pit.test.ts @@ -17,6 +17,7 @@ import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_so import { createSearchRequestHandlerContext } from '@kbn/data-plugin/server/search/mocks'; import type { SearchCursorSettings } from './search_cursor'; import { SearchCursorPit } from './search_cursor_pit'; +import { OpenPointInTimeResponse } from '@elastic/elasticsearch/lib/api/types'; class TestSearchCursorPit extends SearchCursorPit { constructor(...args: ConstructorParameters) { @@ -69,7 +70,7 @@ describe('CSV Export Search Cursor', () => { openPointInTimeSpy = jest .spyOn(es.asCurrentUser, 'openPointInTime') - .mockResolvedValue({ id: 'somewhat-pit-id' }); + .mockResolvedValue({ id: 'somewhat-pit-id' } as OpenPointInTimeResponse); logger = loggingSystemMock.createLogger(); }); diff --git a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts index 5d6cd6f67a4d..cdccbca468a7 100644 --- a/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts +++ b/packages/kbn-generate-csv/src/lib/search_cursor_scroll.test.ts @@ -16,6 +16,7 @@ import { createSearchSourceMock } from '@kbn/data-plugin/common/search/search_so import { createSearchRequestHandlerContext } from '@kbn/data-plugin/server/search/mocks'; import type { SearchCursorSettings } from './search_cursor'; import { SearchCursorScroll } from './search_cursor_scroll'; +import type { OpenPointInTimeResponse } from '@elastic/elasticsearch/lib/api/types'; class TestSearchCursorScroll extends SearchCursorScroll { constructor(...args: ConstructorParameters) { @@ -47,7 +48,9 @@ describe('CSV Export Search Cursor', () => { es = elasticsearchServiceMock.createScopedClusterClient(); data = createSearchRequestHandlerContext(); - jest.spyOn(es.asCurrentUser, 'openPointInTime').mockResolvedValue({ id: 'simply-scroll-id' }); + jest + .spyOn(es.asCurrentUser, 'openPointInTime') + .mockResolvedValue({ id: 'simply-scroll-id' } as OpenPointInTimeResponse); logger = loggingSystemMock.createLogger(); }); diff --git a/packages/kbn-grid-layout/grid/grid_height_smoother.tsx b/packages/kbn-grid-layout/grid/grid_height_smoother.tsx index c880832c90a0..5db035504462 100644 --- a/packages/kbn-grid-layout/grid/grid_height_smoother.tsx +++ b/packages/kbn-grid-layout/grid/grid_height_smoother.tsx @@ -10,7 +10,6 @@ import { css } from '@emotion/react'; import React, { PropsWithChildren, useEffect, useRef } from 'react'; import { combineLatest } from 'rxjs'; -import { euiThemeVars } from '@kbn/ui-theme'; import { GridLayoutStateManager } from './types'; export const GridHeightSmoother = ({ @@ -30,6 +29,7 @@ export const GridHeightSmoother = ({ } if (!interactionEvent) { smoothHeightRef.current.style.height = `${dimensions.height}px`; + smoothHeightRef.current.style.userSelect = 'auto'; return; } @@ -42,6 +42,7 @@ export const GridHeightSmoother = ({ dimensions.height ?? 0, smoothHeightRef.current.getBoundingClientRect().height )}px`; + smoothHeightRef.current.style.userSelect = 'none'; }); const expandedPanelSubscription = gridLayoutStateManager.expandedPanelId$.subscribe( @@ -49,19 +50,9 @@ export const GridHeightSmoother = ({ if (!smoothHeightRef.current) return; if (expandedPanelId) { - const smoothHeightRefY = - smoothHeightRef.current.getBoundingClientRect().y + document.documentElement.scrollTop; - const gutterSize = parseFloat(euiThemeVars.euiSizeL); - - // When panel is expanded, ensure the page occupies the full viewport height - // If the parent element is a flex container (preferred approach): - smoothHeightRef.current.style.flexBasis = `100%`; - - // fallback in case parent is not a flex container (less reliable if shifts happen after the time we calculate smoothHeightRefY) - smoothHeightRef.current.style.height = `calc(100vh - ${smoothHeightRefY + gutterSize}px`; + smoothHeightRef.current.style.height = `100%`; smoothHeightRef.current.style.transition = 'none'; } else { - smoothHeightRef.current.style.flexBasis = ''; smoothHeightRef.current.style.height = ''; smoothHeightRef.current.style.transition = ''; } @@ -78,6 +69,8 @@ export const GridHeightSmoother = ({
React.ReactNode; + renderPanelContents: ( + panelId: string, + setDragHandles?: (refs: Array) => void + ) => React.ReactNode; onLayoutChange: (newLayout: GridLayoutData) => void; expandedPanelId?: string; accessMode?: GridAccessMode; diff --git a/packages/kbn-grid-layout/grid/grid_panel/drag_handle.tsx b/packages/kbn-grid-layout/grid/grid_panel/drag_handle.tsx index 90305812ff8d..f175cf227a7e 100644 --- a/packages/kbn-grid-layout/grid/grid_panel/drag_handle.tsx +++ b/packages/kbn-grid-layout/grid/grid_panel/drag_handle.tsx @@ -7,24 +7,88 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React from 'react'; +import React, { useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react'; import { EuiIcon, useEuiTheme } from '@elastic/eui'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; -import { PanelInteractionEvent } from '../types'; +import { GridLayoutStateManager, PanelInteractionEvent } from '../types'; -export const DragHandle = ({ - interactionStart, -}: { - interactionStart: ( - type: PanelInteractionEvent['type'] | 'drop', - e: React.MouseEvent - ) => void; -}) => { +export interface DragHandleApi { + setDragHandles: (refs: Array) => void; +} + +export const DragHandle = React.forwardRef< + DragHandleApi, + { + gridLayoutStateManager: GridLayoutStateManager; + interactionStart: ( + type: PanelInteractionEvent['type'] | 'drop', + e: MouseEvent | React.MouseEvent + ) => void; + } +>(({ gridLayoutStateManager, interactionStart }, ref) => { const { euiTheme } = useEuiTheme(); - return ( + + const removeEventListenersRef = useRef<(() => void) | null>(null); + const [dragHandleCount, setDragHandleCount] = useState(0); + const dragHandleRefs = useRef>([]); + + /** + * We need to memoize the `onMouseDown` callback so that we don't assign a new `onMouseDown` event handler + * every time `setDragHandles` is called + */ + const onMouseDown = useCallback( + (e: MouseEvent | React.MouseEvent) => { + if (gridLayoutStateManager.accessMode$.getValue() !== 'EDIT' || e.button !== 0) { + // ignore anything but left clicks, and ignore clicks when not in edit mode + return; + } + e.stopPropagation(); + interactionStart('drag', e); + }, + [interactionStart, gridLayoutStateManager.accessMode$] + ); + + const setDragHandles = useCallback( + (dragHandles: Array) => { + setDragHandleCount(dragHandles.length); + dragHandleRefs.current = dragHandles; + + for (const handle of dragHandles) { + if (handle === null) return; + handle.addEventListener('mousedown', onMouseDown, { passive: true }); + } + + removeEventListenersRef.current = () => { + for (const handle of dragHandles) { + if (handle === null) return; + handle.removeEventListener('mousedown', onMouseDown); + } + }; + }, + [onMouseDown] + ); + + useEffect(() => { + return () => { + // on unmount, remove all drag handle event listeners + if (removeEventListenersRef.current) { + removeEventListenersRef.current(); + } + }; + }, []); + + useImperativeHandle( + ref, + () => { + return { setDragHandles }; + }, + [setDragHandles] + ); + + return Boolean(dragHandleCount) ? null : ( ); -}; +}); diff --git a/packages/kbn-grid-layout/grid/grid_panel/grid_panel.tsx b/packages/kbn-grid-layout/grid/grid_panel/grid_panel.tsx index e817f5fc3871..c30e6ecc996e 100644 --- a/packages/kbn-grid-layout/grid/grid_panel/grid_panel.tsx +++ b/packages/kbn-grid-layout/grid/grid_panel/grid_panel.tsx @@ -7,24 +7,27 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React, { forwardRef, useEffect, useMemo } from 'react'; +import React, { forwardRef, useEffect, useMemo, useState } from 'react'; import { combineLatest, skip } from 'rxjs'; -import { EuiPanel, euiFullHeight, useEuiOverflowScroll } from '@elastic/eui'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; + import { GridLayoutStateManager, PanelInteractionEvent } from '../types'; import { getKeysInOrder } from '../utils/resolve_grid_row'; -import { DragHandle } from './drag_handle'; +import { DragHandle, DragHandleApi } from './drag_handle'; import { ResizeHandle } from './resize_handle'; export interface GridPanelProps { panelId: string; rowIndex: number; - renderPanelContents: (panelId: string) => React.ReactNode; + renderPanelContents: ( + panelId: string, + setDragHandles?: (refs: Array) => void + ) => React.ReactNode; interactionStart: ( type: PanelInteractionEvent['type'] | 'drop', - e: React.MouseEvent + e: MouseEvent | React.MouseEvent ) => void; gridLayoutStateManager: GridLayoutStateManager; } @@ -34,6 +37,37 @@ export const GridPanel = forwardRef( { panelId, rowIndex, renderPanelContents, interactionStart, gridLayoutStateManager }, panelRef ) => { + const [dragHandleApi, setDragHandleApi] = useState(null); + + useEffect(() => { + const onDropEventHandler = (dropEvent: MouseEvent) => interactionStart('drop', dropEvent); + /** + * Subscription to add a singular "drop" event handler whenever an interaction starts - + * this is handled in a subscription so that it is not lost when the component gets remounted + * (which happens when a panel gets dragged from one grid row to another) + */ + const dropEventSubscription = gridLayoutStateManager.interactionEvent$.subscribe((event) => { + if (!event || event.id !== panelId) return; + + /** + * By adding the "drop" event listener to the document rather than the drag/resize event handler, + * we prevent the element from getting "stuck" in an interaction; however, we only attach this event + * listener **when the drag/resize event starts**, and it only executes once (i.e. it removes itself + * once it executes, so we don't have to manually remove it outside of the unmount condition) + */ + document.addEventListener('mouseup', onDropEventHandler, { + once: true, + passive: true, + }); + }); + + return () => { + dropEventSubscription.unsubscribe(); + document.removeEventListener('mouseup', onDropEventHandler); // removes the event listener on row change + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + /** Set initial styles based on state at mount to prevent styles from "blipping" */ const initialStyles = useMemo(() => { const initialPanel = gridLayoutStateManager.gridLayout$.getValue()[rowIndex].panels[panelId]; @@ -88,24 +122,22 @@ export const GridPanel = forwardRef( // undo any "lock to grid" styles **except** for the top left corner, which stays locked ref.style.gridColumnStart = `${panel.column + 1}`; ref.style.gridRowStart = `${panel.row + 1}`; - ref.style.gridColumnEnd = ``; - ref.style.gridRowEnd = ``; + ref.style.gridColumnEnd = `auto`; + ref.style.gridRowEnd = `auto`; } else { // if the current panel is being dragged, render it with a fixed position + size - ref.style.position = `fixed`; + ref.style.position = 'fixed'; + ref.style.left = `${draggingPosition.left}px`; ref.style.top = `${draggingPosition.top}px`; ref.style.width = `${draggingPosition.right - draggingPosition.left}px`; ref.style.height = `${draggingPosition.bottom - draggingPosition.top}px`; // undo any "lock to grid" styles - ref.style.gridColumnStart = ``; - ref.style.gridRowStart = ``; - ref.style.gridColumnEnd = ``; - ref.style.gridRowEnd = ``; + ref.style.gridArea = `auto`; // shortcut to set all grid styles to `auto` } } else { - ref.style.zIndex = '0'; + ref.style.zIndex = `auto`; // if the panel is not being dragged and/or resized, undo any fixed position styles ref.style.position = ''; @@ -175,32 +207,27 @@ export const GridPanel = forwardRef( * Memoize panel contents to prevent unnecessary re-renders */ const panelContents = useMemo(() => { - return renderPanelContents(panelId); - }, [panelId, renderPanelContents]); + if (!dragHandleApi) return <>; // delays the rendering of the panel until after dragHandleApi is defined + return renderPanelContents(panelId, dragHandleApi.setDragHandles); + }, [panelId, renderPanelContents, dragHandleApi]); return (
- - -
- {panelContents} -
+ + {panelContents} -
+
); } diff --git a/packages/kbn-grid-layout/grid/grid_panel/resize_handle.tsx b/packages/kbn-grid-layout/grid/grid_panel/resize_handle.tsx index 4c4a2d60ee5c..ffee2f2764ed 100644 --- a/packages/kbn-grid-layout/grid/grid_panel/resize_handle.tsx +++ b/packages/kbn-grid-layout/grid/grid_panel/resize_handle.tsx @@ -7,12 +7,11 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React from 'react'; - import { transparentize } from '@elastic/eui'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { i18n } from '@kbn/i18n'; +import { euiThemeVars } from '@kbn/ui-theme'; +import React from 'react'; import { PanelInteractionEvent } from '../types'; export const ResizeHandle = ({ @@ -20,7 +19,7 @@ export const ResizeHandle = ({ }: { interactionStart: ( type: PanelInteractionEvent['type'] | 'drop', - e: React.MouseEvent + e: MouseEvent | React.MouseEvent ) => void; }) => { return ( @@ -42,7 +41,9 @@ export const ResizeHandle = ({ margin: -2px; position: absolute; width: ${euiThemeVars.euiSizeL}; + max-width: 100%; height: ${euiThemeVars.euiSizeL}; + z-index: ${euiThemeVars.euiZLevel9}; transition: opacity 0.2s, border 0.2s; border-radius: 7px 0 7px 0; border-bottom: 2px solid ${euiThemeVars.euiColorSuccess}; diff --git a/packages/kbn-grid-layout/grid/grid_row/grid_row.tsx b/packages/kbn-grid-layout/grid/grid_row/grid_row.tsx index 85d051700e90..d2b046919a62 100644 --- a/packages/kbn-grid-layout/grid/grid_row/grid_row.tsx +++ b/packages/kbn-grid-layout/grid/grid_row/grid_row.tsx @@ -23,7 +23,10 @@ import { GridRowHeader } from './grid_row_header'; export interface GridRowProps { rowIndex: number; - renderPanelContents: (panelId: string) => React.ReactNode; + renderPanelContents: ( + panelId: string, + setDragHandles?: (refs: Array) => void + ) => React.ReactNode; setInteractionEvent: (interactionData?: PanelInteractionEvent) => void; gridLayoutStateManager: GridLayoutStateManager; } @@ -32,19 +35,13 @@ export const GridRow = forwardRef( ({ rowIndex, renderPanelContents, setInteractionEvent, gridLayoutStateManager }, gridRef) => { const currentRow = gridLayoutStateManager.gridLayout$.value[rowIndex]; - const [panelIds, setPanelIds] = useState(() => getKeysInOrder(currentRow.panels)); + const [panelIds, setPanelIds] = useState(Object.keys(currentRow.panels)); + const [panelIdsInOrder, setPanelIdsInOrder] = useState(() => + getKeysInOrder(currentRow.panels) + ); const [rowTitle, setRowTitle] = useState(currentRow.title); const [isCollapsed, setIsCollapsed] = useState(currentRow.isCollapsed); - /** Syncs panel IDs in order after a change in the grid layout, such as adding, removing, or reordering panels. */ - const syncPanelIds = useCallback(() => { - const newPanelIds = getKeysInOrder(gridLayoutStateManager.gridLayout$.value[rowIndex].panels); - const hasOrderChanged = JSON.stringify(panelIds) !== JSON.stringify(newPanelIds); - if (hasOrderChanged) { - setPanelIds(newPanelIds); - } - }, [setPanelIds, gridLayoutStateManager.gridLayout$, rowIndex, panelIds]); - const getRowCount = useCallback( (row: GridRowData) => { const maxRow = Object.values(row.panels).reduce((acc, panel) => { @@ -152,10 +149,6 @@ export const GridRow = forwardRef( * - Title * - Collapsed state * - Panel IDs (adding/removing/replacing, but not reordering) - * - * Note: During dragging or resizing actions, the row should not re-render because panel positions are controlled via CSS styles for performance reasons. - * However, once the user finishes the interaction, the order of rendered panels need to be aligned with how they are displayed in the grid for accessibility reasons (screen readers and focus management). - * This is handled in the syncPanelIds callback. */ const rowStateSubscription = gridLayoutStateManager.gridLayout$ .pipe( @@ -163,7 +156,7 @@ export const GridRow = forwardRef( return { title: gridLayout[rowIndex].title, isCollapsed: gridLayout[rowIndex].isCollapsed, - panelIds: getKeysInOrder(gridLayout[rowIndex].panels), + panelIds: Object.keys(gridLayout[rowIndex].panels), }; }), pairwise() @@ -180,6 +173,9 @@ export const GridRow = forwardRef( ) ) { setPanelIds(newRowData.panelIds); + setPanelIdsInOrder( + getKeysInOrder(gridLayoutStateManager.gridLayout$.getValue()[rowIndex].panels) + ); } }); @@ -194,64 +190,67 @@ export const GridRow = forwardRef( ); /** - * Memoize panel children components to prevent unnecessary re-renders + * Memoize panel children components (independent of their order) to prevent unnecessary re-renders */ - const children = useMemo(() => { - return panelIds.map((panelId) => ( - { - e.preventDefault(); - e.stopPropagation(); + const children: { [panelId: string]: React.ReactNode } = useMemo(() => { + return panelIds.reduce( + (prev, panelId) => ({ + ...prev, + [panelId]: ( + { + e.stopPropagation(); - // Disable interactions when a panel is expanded - const isInteractive = gridLayoutStateManager.expandedPanelId$.value === undefined; - if (!isInteractive) return; + // Disable interactions when a panel is expanded + const isInteractive = gridLayoutStateManager.expandedPanelId$.value === undefined; + if (!isInteractive) return; - const panelRef = gridLayoutStateManager.panelRefs.current[rowIndex][panelId]; - if (!panelRef) return; + const panelRef = gridLayoutStateManager.panelRefs.current[rowIndex][panelId]; + if (!panelRef) return; - const panelRect = panelRef.getBoundingClientRect(); - if (type === 'drop') { - setInteractionEvent(undefined); - // Ensure the row re-renders to reflect the new panel order after a drag-and-drop interaction. - // the order of rendered panels need to be aligned with how they are displayed in the grid for accessibility reasons (screen readers and focus management). - syncPanelIds(); - } else { - setInteractionEvent({ - type, - id: panelId, - panelDiv: panelRef, - targetRowIndex: rowIndex, - mouseOffsets: { - top: e.clientY - panelRect.top, - left: e.clientX - panelRect.left, - right: e.clientX - panelRect.right, - bottom: e.clientY - panelRect.bottom, - }, - }); - } - }} - ref={(element) => { - if (!gridLayoutStateManager.panelRefs.current[rowIndex]) { - gridLayoutStateManager.panelRefs.current[rowIndex] = {}; - } - gridLayoutStateManager.panelRefs.current[rowIndex][panelId] = element; - }} - /> - )); - }, [ - panelIds, - rowIndex, - gridLayoutStateManager, - renderPanelContents, - setInteractionEvent, - syncPanelIds, - ]); + const panelRect = panelRef.getBoundingClientRect(); + if (type === 'drop') { + setInteractionEvent(undefined); + /** + * Ensure the row re-renders to reflect the new panel order after a drag-and-drop interaction, since + * the order of rendered panels need to be aligned with how they are displayed in the grid for accessibility + * reasons (screen readers and focus management). + */ + setPanelIdsInOrder( + getKeysInOrder(gridLayoutStateManager.gridLayout$.getValue()[rowIndex].panels) + ); + } else { + setInteractionEvent({ + type, + id: panelId, + panelDiv: panelRef, + targetRowIndex: rowIndex, + mouseOffsets: { + top: e.clientY - panelRect.top, + left: e.clientX - panelRect.left, + right: e.clientX - panelRect.right, + bottom: e.clientY - panelRect.bottom, + }, + }); + } + }} + ref={(element) => { + if (!gridLayoutStateManager.panelRefs.current[rowIndex]) { + gridLayoutStateManager.panelRefs.current[rowIndex] = {}; + } + gridLayoutStateManager.panelRefs.current[rowIndex][panelId] = element; + }} + /> + ), + }), + {} + ); + }, [panelIds, gridLayoutStateManager, renderPanelContents, rowIndex, setInteractionEvent]); return (
@@ -276,7 +275,8 @@ export const GridRow = forwardRef( ${initialStyles}; `} > - {children} + {/* render the panels **in order** for accessibility, using the memoized panel components */} + {panelIdsInOrder.map((panelId) => children[panelId])}
)} diff --git a/packages/kbn-grid-layout/grid/test_utils/mocks.tsx b/packages/kbn-grid-layout/grid/test_utils/mocks.tsx index 09ffa05a39aa..52b27ef7c823 100644 --- a/packages/kbn-grid-layout/grid/test_utils/mocks.tsx +++ b/packages/kbn-grid-layout/grid/test_utils/mocks.tsx @@ -12,6 +12,7 @@ import { BehaviorSubject } from 'rxjs'; import { ObservedSize } from 'use-resize-observer/polyfilled'; import { ActivePanel, + GridAccessMode, GridLayoutData, GridLayoutStateManager, PanelInteractionEvent, @@ -46,6 +47,7 @@ export const gridLayoutStateManagerMock: GridLayoutStateManager = { runtimeSettings$, panelRefs: { current: [] }, rowRefs: { current: [] }, + accessMode$: new BehaviorSubject('EDIT'), interactionEvent$: new BehaviorSubject(undefined), activePanel$: new BehaviorSubject(undefined), gridDimensions$: new BehaviorSubject({ width: 600, height: 900 }), diff --git a/packages/kbn-grid-layout/grid/types.ts b/packages/kbn-grid-layout/grid/types.ts index cd24855d0764..1e0d541ce343 100644 --- a/packages/kbn-grid-layout/grid/types.ts +++ b/packages/kbn-grid-layout/grid/types.ts @@ -60,6 +60,7 @@ export interface GridLayoutStateManager { gridLayout$: BehaviorSubject; expandedPanelId$: BehaviorSubject; isMobileView$: BehaviorSubject; + accessMode$: BehaviorSubject; gridDimensions$: BehaviorSubject; runtimeSettings$: BehaviorSubject; diff --git a/packages/kbn-grid-layout/grid/use_grid_layout_events.ts b/packages/kbn-grid-layout/grid/use_grid_layout_events.ts index 64cc8f482838..09f12d13d93d 100644 --- a/packages/kbn-grid-layout/grid/use_grid_layout_events.ts +++ b/packages/kbn-grid-layout/grid/use_grid_layout_events.ts @@ -13,18 +13,42 @@ import { resolveGridRow } from './utils/resolve_grid_row'; import { GridPanelData, GridLayoutStateManager } from './types'; import { isGridDataEqual } from './utils/equality_checks'; +const MIN_SPEED = 50; +const MAX_SPEED = 150; + const scrollOnInterval = (direction: 'up' | 'down') => { let count = 0; + let currentSpeed = MIN_SPEED; + let maxSpeed = MIN_SPEED; + let turnAroundPoint: number | undefined; + const interval = setInterval(() => { - // calculate the speed based on how long the interval has been going to create an ease effect - // via the parabola formula `y = a(x - h)^2 + k` - // - the starting speed is k = 50 - // - the maximum speed is 250 - // - the rate at which the speed increases is controlled by a = 0.75 - const speed = Math.min(0.75 * count ** 2 + 50, 250); - window.scrollBy({ top: direction === 'down' ? speed : -speed, behavior: 'smooth' }); - count++; - }, 100); + /** + * Since "smooth" scrolling on an interval is jittery on Chrome, we are manually creating + * an "ease" effect via the parabola formula `y = a(x - h)^2 + k` + * + * Scrolling slowly speeds up as the user drags, and it slows down again as they approach the + * top and/or bottom of the screen. + */ + const nearTop = direction === 'up' && scrollY < window.innerHeight; + const nearBottom = + direction === 'down' && + window.innerHeight + window.scrollY > document.body.scrollHeight - window.innerHeight; + if (!turnAroundPoint && (nearTop || nearBottom)) { + // reverse the direction of the parabola + maxSpeed = currentSpeed; + turnAroundPoint = count; + } + + currentSpeed = turnAroundPoint + ? Math.max(-3 * (count - turnAroundPoint) ** 2 + maxSpeed, MIN_SPEED) // slow down fast + : Math.min(0.1 * count ** 2 + MIN_SPEED, MAX_SPEED); // speed up slowly + window.scrollBy({ + top: direction === 'down' ? currentSpeed : -currentSpeed, + }); + + count++; // increase the counter to increase the time interval used in the parabola formula + }, 60); return interval; }; @@ -56,7 +80,6 @@ export const useGridLayoutEvents = ({ stopAutoScrollIfNecessary(); return; } - e.preventDefault(); e.stopPropagation(); const gridRowElements = gridLayoutStateManager.rowRefs.current; @@ -154,8 +177,11 @@ export const useGridLayoutEvents = ({ // auto scroll when an event is happening close to the top or bottom of the screen const heightPercentage = 100 - ((window.innerHeight - mouseTargetPixel.y) / window.innerHeight) * 100; - const startScrollingUp = !isResize && heightPercentage < 5; // don't scroll up when resizing - const startScrollingDown = heightPercentage > 95; + const atTheTop = window.scrollY <= 0; + const atTheBottom = window.innerHeight + window.scrollY >= document.body.scrollHeight; + + const startScrollingUp = !isResize && heightPercentage < 5 && !atTheTop; // don't scroll up when resizing + const startScrollingDown = heightPercentage > 95 && !atTheBottom; if (startScrollingUp || startScrollingDown) { if (!scrollInterval.current) { // only start scrolling if it's not already happening @@ -202,8 +228,9 @@ export const useGridLayoutEvents = ({ calculateUserEvent(e); }; - document.addEventListener('mousemove', onMouseMove); - document.addEventListener('scroll', calculateUserEvent); + document.addEventListener('mousemove', onMouseMove, { passive: true }); + document.addEventListener('scroll', calculateUserEvent, { passive: true }); + return () => { document.removeEventListener('mousemove', onMouseMove); document.removeEventListener('scroll', calculateUserEvent); diff --git a/packages/kbn-grid-layout/grid/use_grid_layout_state.ts b/packages/kbn-grid-layout/grid/use_grid_layout_state.ts index 8617262829c4..3e76687436bc 100644 --- a/packages/kbn-grid-layout/grid/use_grid_layout_state.ts +++ b/packages/kbn-grid-layout/grid/use_grid_layout_state.ts @@ -10,6 +10,7 @@ import { useEffect, useMemo, useRef } from 'react'; import { BehaviorSubject, combineLatest, debounceTime } from 'rxjs'; import useResizeObserver, { type ObservedSize } from 'use-resize-observer/polyfilled'; +import { cloneDeep } from 'lodash'; import { ActivePanel, @@ -21,6 +22,7 @@ import { RuntimeGridSettings, } from './types'; import { shouldShowMobileView } from './utils/mobile_view'; +import { resolveGridRow } from './utils/resolve_grid_row'; export const useGridLayoutState = ({ layout, @@ -59,7 +61,12 @@ export const useGridLayoutState = ({ }, [accessMode, accessMode$]); const gridLayoutStateManager = useMemo(() => { - const gridLayout$ = new BehaviorSubject(layout); + const resolvedLayout = cloneDeep(layout); + resolvedLayout.forEach((row, rowIndex) => { + resolvedLayout[rowIndex] = resolveGridRow(row); + }); + + const gridLayout$ = new BehaviorSubject(resolvedLayout); const gridDimensions$ = new BehaviorSubject({ width: 0, height: 0 }); const interactionEvent$ = new BehaviorSubject(undefined); const activePanel$ = new BehaviorSubject(undefined); @@ -77,6 +84,7 @@ export const useGridLayoutState = ({ panelIds$, gridLayout$, activePanel$, + accessMode$, gridDimensions$, runtimeSettings$, interactionEvent$, diff --git a/packages/kbn-index-adapter/index.ts b/packages/kbn-index-adapter/index.ts deleted file mode 100644 index 695679213528..000000000000 --- a/packages/kbn-index-adapter/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { IndexAdapter } from './src/index_adapter'; -export { IndexPatternAdapter, type InstallIndex } from './src/index_pattern_adapter'; -export { retryTransientEsErrors } from './src/retry_transient_es_errors'; -export { ecsFieldMap, type EcsFieldMap } from './src/field_maps/ecs_field_map'; -export { createOrUpdateIndexTemplate } from './src/create_or_update_index_template'; -export { createOrUpdateComponentTemplate } from './src/create_or_update_component_template'; - -export type { - SetComponentTemplateParams, - SetIndexTemplateParams, - IndexAdapterParams, - InstallParams, -} from './src/index_adapter'; -export * from './src/field_maps/types'; diff --git a/packages/kbn-index-adapter/jest.config.js b/packages/kbn-index-adapter/jest.config.js deleted file mode 100644 index bf08ec152638..000000000000 --- a/packages/kbn-index-adapter/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-index-adapter'], -}; diff --git a/packages/kbn-index-adapter/package.json b/packages/kbn-index-adapter/package.json deleted file mode 100644 index 70b79abe1b57..000000000000 --- a/packages/kbn-index-adapter/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "@kbn/index-adapter", - "version": "1.0.0", - "description": "Utility library for Elasticsearch index management", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0", - "private": true -} \ No newline at end of file diff --git a/packages/kbn-index-adapter/src/field_maps/types.ts b/packages/kbn-index-adapter/src/field_maps/types.ts deleted file mode 100644 index 90fb44873a34..000000000000 --- a/packages/kbn-index-adapter/src/field_maps/types.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export interface AllowedValue { - description?: string; - name?: string; -} - -export interface MultiField { - flat_name: string; - name: string; - type: string; -} - -export interface EcsMetadata { - allowed_values?: AllowedValue[]; - dashed_name: string; - description: string; - doc_values?: boolean; - example?: string | number | boolean; - flat_name: string; - ignore_above?: number; - index?: boolean; - level: string; - multi_fields?: MultiField[]; - name: string; - normalize: string[]; - required?: boolean; - scaling_factor?: number; - short: string; - type: string; - properties?: Record; -} - -export type FieldMap = Record< - T, - { - type: string; - required: boolean; - array?: boolean; - doc_values?: boolean; - enabled?: boolean; - fields?: Record; - format?: string; - ignore_above?: number; - multi_fields?: MultiField[]; - index?: boolean; - path?: string; - scaling_factor?: number; - dynamic?: boolean | 'strict'; - properties?: Record; - inference_id?: string; - copy_to?: string; - } ->; - -// This utility type flattens all the keys of a schema object and its nested objects as a union type. -// Its purpose is to ensure that the FieldMap keys are always in sync with the schema object. -// It assumes all optional fields of the schema are required in the field map, they can always be omitted from the resulting type. -export type SchemaFieldMapKeys< - T extends Record, - Key = keyof T -> = Key extends string - ? NonNullable extends Record - ? `${Key}` | `${Key}.${SchemaFieldMapKeys>}` - : `${Key}` - : never; diff --git a/packages/kbn-index-adapter/tsconfig.json b/packages/kbn-index-adapter/tsconfig.json deleted file mode 100644 index cca50adbf7eb..000000000000 --- a/packages/kbn-index-adapter/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - ] - }, - "include": ["**/*.ts"], - "kbn_references": [ - "@kbn/core", - "@kbn/std", - "@kbn/safer-lodash-set", - "@kbn/logging-mocks", - ], - "exclude": [ - "target/**/*" - ], -} diff --git a/packages/kbn-investigation-shared/index.ts b/packages/kbn-investigation-shared/index.ts deleted file mode 100644 index 55b900ad5137..000000000000 --- a/packages/kbn-investigation-shared/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", 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 deleted file mode 100644 index 54ed81a5d343..000000000000 --- a/packages/kbn-investigation-shared/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", 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/package.json b/packages/kbn-investigation-shared/package.json deleted file mode 100644 index 7687defb4dc5..000000000000 --- a/packages/kbn-investigation-shared/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "@kbn/investigation-shared", - "private": true, - "version": "1.0.0", - "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" -} diff --git a/packages/kbn-investigation-shared/src/index.ts b/packages/kbn-investigation-shared/src/index.ts deleted file mode 100644 index 8ab81653a18d..000000000000 --- a/packages/kbn-investigation-shared/src/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", 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 deleted file mode 100644 index 8a8e4d62a37e..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/create.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationResponseSchema } from './investigation'; -import { alertOriginSchema, blankOriginSchema } from '../schema'; - -const createInvestigationParamsSchema = z.object({ - body: z.object({ - id: z.string(), - title: z.string(), - params: z.object({ - timeRange: z.object({ from: z.number(), to: z.number() }), - }), - origin: z.union([alertOriginSchema, blankOriginSchema]), - tags: z.array(z.string()), - externalIncidentUrl: z.string().nullable(), - }), -}); - -const createInvestigationResponseSchema = investigationResponseSchema; - -type CreateInvestigationParams = z.infer; -type CreateInvestigationResponse = z.output; - -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 deleted file mode 100644 index 2e9551fcaa36..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/create_item.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { itemSchema } from '../schema'; -import { investigationItemResponseSchema } from './investigation_item'; - -const createInvestigationItemParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), - body: itemSchema, -}); - -const createInvestigationItemResponseSchema = investigationItemResponseSchema; - -type CreateInvestigationItemParams = z.infer; -type CreateInvestigationItemResponse = z.output; - -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 deleted file mode 100644 index bf4c4f62456e..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/create_note.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationNoteResponseSchema } from './investigation_note'; - -const createInvestigationNoteParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), - body: z.object({ - content: z.string(), - }), -}); - -const createInvestigationNoteResponseSchema = investigationNoteResponseSchema; - -type CreateInvestigationNoteParams = z.infer; -type CreateInvestigationNoteResponse = z.output; - -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 deleted file mode 100644 index 32e9b1f26bf6..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/delete.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -const deleteInvestigationParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), -}); - -type DeleteInvestigationParams = z.infer; - -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 deleted file mode 100644 index 712a74e29936..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/delete_item.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const deleteInvestigationItemParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - itemId: z.string(), - }), -}); - -type DeleteInvestigationItemParams = z.infer; - -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 deleted file mode 100644 index c3789ea13a35..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/delete_note.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const deleteInvestigationNoteParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - noteId: z.string(), - }), -}); - -type DeleteInvestigationNoteParams = z.infer; - -export { deleteInvestigationNoteParamsSchema }; -export type { DeleteInvestigationNoteParams }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/entity.ts b/packages/kbn-investigation-shared/src/rest_specs/entity.ts deleted file mode 100644 index 8e571f3e2a4d..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/entity.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const metricsSchema = z.object({ - failedTransactionRate: z.number().optional(), - latency: z.number().optional(), - throughput: z.number().optional(), - logErrorRate: z.number().optional(), - logRate: z.number().optional(), -}); - -const entitySchema = z.object({ - id: z.string(), - definition_id: z.string(), - definition_version: z.string(), - display_name: z.string(), - last_seen_timestamp: z.string(), - identity_fields: z.array(z.string()), - schema_version: z.string(), - type: z.string(), - metrics: metricsSchema, -}); - -const entitySourceSchema = z.object({ - dataStream: z.string().optional(), -}); - -const entityWithSourceSchema = z.intersection( - entitySchema, - z.object({ - sources: z.array(entitySourceSchema), - }) -); - -type EntityWithSource = z.output; -type EntitySource = z.output; - -export { entitySchema, entityWithSourceSchema }; -export type { EntityWithSource, EntitySource }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/event.ts b/packages/kbn-investigation-shared/src/rest_specs/event.ts deleted file mode 100644 index e63083f75c82..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/event.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { eventSchema } from '../schema'; - -const eventResponseSchema = eventSchema; - -type EventResponse = z.output; -type EventSchema = z.output; - -export { eventResponseSchema }; -export type { EventResponse, EventSchema }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/find.ts b/packages/kbn-investigation-shared/src/rest_specs/find.ts deleted file mode 100644 index 7a938212cfba..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/find.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationResponseSchema } from './investigation'; - -const findInvestigationsParamsSchema = z - .object({ - query: z - .object({ - alertId: z.string(), - search: z.string(), - filter: z.string(), - page: z.coerce.number(), - perPage: z.coerce.number(), - }) - .partial(), - }) - .partial(); - -const findInvestigationsResponseSchema = z.object({ - page: z.number(), - perPage: z.number(), - total: z.number(), - results: z.array(investigationResponseSchema), -}); - -type FindInvestigationsParams = z.infer; -type FindInvestigationsResponse = z.output; - -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 deleted file mode 100644 index d9104959c1d7..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationResponseSchema } from './investigation'; - -const getInvestigationParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), -}); - -const getInvestigationResponseSchema = investigationResponseSchema; - -type GetInvestigationParams = z.infer; // Parsed payload used by the backend -type GetInvestigationResponse = z.output; // Raw response sent to the frontend - -export { getInvestigationParamsSchema, getInvestigationResponseSchema }; -export type { GetInvestigationParams, GetInvestigationResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts b/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts deleted file mode 100644 index bee9f15db587..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { statusSchema } from '../schema'; - -const getAllInvestigationStatsParamsSchema = z.object({ - query: z.object({}), -}); - -const getAllInvestigationStatsResponseSchema = z.object({ - count: z.record(statusSchema, z.number()), - total: z.number(), -}); - -type GetAllInvestigationStatsResponse = z.output; - -export { getAllInvestigationStatsParamsSchema, getAllInvestigationStatsResponseSchema }; -export type { GetAllInvestigationStatsResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts b/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts deleted file mode 100644 index 35665b1b3c69..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const getAllInvestigationTagsParamsSchema = z.object({ - query: z.object({}), -}); - -const getAllInvestigationTagsResponseSchema = z.string().array(); - -type GetAllInvestigationTagsResponse = z.output; - -export { getAllInvestigationTagsParamsSchema, getAllInvestigationTagsResponseSchema }; -export type { GetAllInvestigationTagsResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts b/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts deleted file mode 100644 index 383bc21b5808..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { entityWithSourceSchema } from './entity'; - -const getEntitiesParamsSchema = z - .object({ - query: z - .object({ - 'service.name': z.string(), - 'service.environment': z.string(), - 'host.name': z.string(), - 'container.id': z.string(), - }) - .partial(), - }) - .partial(); - -const getEntitiesResponseSchema = z.object({ - entities: z.array(entityWithSourceSchema), -}); - -type GetEntitiesParams = z.infer; -type GetEntitiesResponse = z.output; - -export { getEntitiesParamsSchema, getEntitiesResponseSchema }; -export type { GetEntitiesParams, GetEntitiesResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_events.ts b/packages/kbn-investigation-shared/src/rest_specs/get_events.ts deleted file mode 100644 index 064a75fab156..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_events.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { eventResponseSchema } from './event'; - -const getEventsParamsSchema = z - .object({ - query: z - .object({ - rangeFrom: z.string(), - rangeTo: z.string(), - filter: z.string(), - }) - .partial(), - }) - .partial(); - -const getEventsResponseSchema = z.array(eventResponseSchema); - -type GetEventsParams = z.infer; -type GetEventsResponse = z.output; - -export { getEventsParamsSchema, getEventsResponseSchema }; -export type { GetEventsParams, GetEventsResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/get_items.ts b/packages/kbn-investigation-shared/src/rest_specs/get_items.ts deleted file mode 100644 index eb6ddac42a7a..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_items.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationItemResponseSchema } from './investigation_item'; - -const getInvestigationItemsParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), -}); - -const getInvestigationItemsResponseSchema = z.array(investigationItemResponseSchema); - -type GetInvestigationItemsResponse = z.output; - -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 deleted file mode 100644 index 0a86f19a31d1..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/get_notes.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationNoteResponseSchema } from './investigation_note'; - -const getInvestigationNotesParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), -}); - -const getInvestigationNotesResponseSchema = z.array(investigationNoteResponseSchema); - -type GetInvestigationNotesResponse = z.output; - -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 deleted file mode 100644 index d0070c8b8959..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/index.ts +++ /dev/null @@ -1,54 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export type * from './create'; -export type * from './create_item'; -export type * from './create_note'; -export type * from './delete'; -export type * from './delete_item'; -export type * from './delete_note'; -export type * from './find'; -export type * from './get'; -export type * from './get_items'; -export type * from './get_notes'; -export type * from './get_all_investigation_stats'; -export type * from './get_all_investigation_tags'; -export type * from './investigation'; -export type * from './investigation_item'; -export type * from './investigation_note'; -export type * from './update'; -export type * from './update_item'; -export type * from './update_note'; -export type * from './event'; -export type * from './get_events'; -export type * from './entity'; -export type * from './get_entities'; - -export * from './create'; -export * from './create_item'; -export * from './create_note'; -export * from './delete'; -export * from './delete_item'; -export * from './delete_note'; -export * from './find'; -export * from './get'; -export * from './get_items'; -export * from './get_notes'; -export * from './get_all_investigation_stats'; -export * from './get_all_investigation_tags'; -export * from './investigation'; -export * from './investigation_item'; -export * from './investigation_note'; -export * from './update'; -export * from './update_item'; -export * from './update_note'; -export * from './event'; -export * from './get_events'; -export * from './entity'; -export * from './get_entities'; diff --git a/packages/kbn-investigation-shared/src/rest_specs/investigation.ts b/packages/kbn-investigation-shared/src/rest_specs/investigation.ts deleted file mode 100644 index c02e90cd70d2..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/investigation.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationSchema } from '../schema'; - -const investigationResponseSchema = investigationSchema; - -type InvestigationResponse = z.output; - -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 deleted file mode 100644 index e7faa1d7a283..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationItemSchema } from '../schema'; - -const investigationItemResponseSchema = investigationItemSchema; - -type InvestigationItemResponse = z.output; - -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 deleted file mode 100644 index 73114fe844d5..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationNoteSchema } from '../schema'; - -const investigationNoteResponseSchema = investigationNoteSchema; - -type InvestigationNoteResponse = z.output; - -export { investigationNoteResponseSchema }; -export type { InvestigationNoteResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/update.ts b/packages/kbn-investigation-shared/src/rest_specs/update.ts deleted file mode 100644 index cab773d9549a..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/update.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationResponseSchema } from './investigation'; -import { statusSchema } from '../schema'; - -const updateInvestigationParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - }), - body: z - .object({ - title: z.string(), - status: statusSchema, - params: z.object({ - timeRange: z.object({ from: z.number(), to: z.number() }), - }), - tags: z.array(z.string()), - externalIncidentUrl: z.string().nullable(), - }) - .partial(), -}); - -const updateInvestigationResponseSchema = investigationResponseSchema; - -type UpdateInvestigationParams = z.infer; -type UpdateInvestigationResponse = z.output; - -export { updateInvestigationParamsSchema, updateInvestigationResponseSchema }; -export type { UpdateInvestigationParams, UpdateInvestigationResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/update_item.ts b/packages/kbn-investigation-shared/src/rest_specs/update_item.ts deleted file mode 100644 index 8e96785c452b..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/update_item.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationItemResponseSchema } from './investigation_item'; -import { itemSchema } from '../schema'; - -const updateInvestigationItemParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - itemId: z.string(), - }), - body: itemSchema, -}); - -const updateInvestigationItemResponseSchema = investigationItemResponseSchema; - -type UpdateInvestigationItemParams = z.infer; -type UpdateInvestigationItemResponse = z.output; - -export { updateInvestigationItemParamsSchema, updateInvestigationItemResponseSchema }; -export type { UpdateInvestigationItemParams, UpdateInvestigationItemResponse }; diff --git a/packages/kbn-investigation-shared/src/rest_specs/update_note.ts b/packages/kbn-investigation-shared/src/rest_specs/update_note.ts deleted file mode 100644 index 35862cbe19ae..000000000000 --- a/packages/kbn-investigation-shared/src/rest_specs/update_note.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { investigationNoteResponseSchema } from './investigation_note'; - -const updateInvestigationNoteParamsSchema = z.object({ - path: z.object({ - investigationId: z.string(), - noteId: z.string(), - }), - body: z.object({ - content: z.string(), - }), -}); - -const updateInvestigationNoteResponseSchema = investigationNoteResponseSchema; - -type UpdateInvestigationNoteParams = z.infer; -type UpdateInvestigationNoteResponse = z.output; - -export { updateInvestigationNoteParamsSchema, updateInvestigationNoteResponseSchema }; -export type { UpdateInvestigationNoteParams, UpdateInvestigationNoteResponse }; diff --git a/packages/kbn-investigation-shared/src/schema/event.ts b/packages/kbn-investigation-shared/src/schema/event.ts deleted file mode 100644 index c954a0de13fb..000000000000 --- a/packages/kbn-investigation-shared/src/schema/event.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const eventTypeSchema = z.union([ - z.literal('annotation'), - z.literal('alert'), - z.literal('error_rate'), - z.literal('latency'), - z.literal('anomaly'), -]); - -const annotationEventSchema = z.object({ - eventType: z.literal('annotation'), - annotationType: z.string().optional(), -}); - -const alertStatusSchema = z.union([ - z.literal('active'), - z.literal('flapping'), - z.literal('recovered'), - z.literal('untracked'), -]); - -const alertEventSchema = z.object({ - eventType: z.literal('alert'), - alertStatus: alertStatusSchema, -}); - -const sourceSchema = z.record(z.string(), z.any()); - -const eventSchema = z.intersection( - z.object({ - id: z.string(), - title: z.string(), - description: z.string(), - timestamp: z.number(), - eventType: eventTypeSchema, - source: sourceSchema.optional(), - }), - z.discriminatedUnion('eventType', [annotationEventSchema, alertEventSchema]) -); - -export { eventSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/index.ts b/packages/kbn-investigation-shared/src/schema/index.ts deleted file mode 100644 index f65fe9baf1f6..000000000000 --- a/packages/kbn-investigation-shared/src/schema/index.ts +++ /dev/null @@ -1,16 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './investigation'; -export * from './investigation_item'; -export * from './investigation_note'; -export * from './origin'; -export * from './event'; - -export type * from './investigation'; diff --git a/packages/kbn-investigation-shared/src/schema/investigation.ts b/packages/kbn-investigation-shared/src/schema/investigation.ts deleted file mode 100644 index 751f1a20048a..000000000000 --- a/packages/kbn-investigation-shared/src/schema/investigation.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; -import { alertOriginSchema, blankOriginSchema } from './origin'; -import { investigationNoteSchema } from './investigation_note'; -import { investigationItemSchema } from './investigation_item'; - -const statusSchema = z.union([ - z.literal('triage'), - z.literal('active'), - z.literal('mitigated'), - z.literal('resolved'), - z.literal('cancelled'), -]); - -const investigationSchema = z.object({ - id: z.string(), - title: z.string(), - createdAt: z.number(), - createdBy: z.string(), - updatedAt: z.number(), - params: z.object({ - timeRange: z.object({ from: z.number(), to: z.number() }), - }), - origin: z.union([alertOriginSchema, blankOriginSchema]), - status: statusSchema, - tags: z.array(z.string()), - notes: z.array(investigationNoteSchema), - items: z.array(investigationItemSchema), - externalIncidentUrl: z.string().nullable(), -}); - -type Status = z.infer; - -export type { Status }; -export { investigationSchema, statusSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/investigation_item.ts b/packages/kbn-investigation-shared/src/schema/investigation_item.ts deleted file mode 100644 index 820db8500e5d..000000000000 --- a/packages/kbn-investigation-shared/src/schema/investigation_item.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const itemSchema = z.object({ - title: z.string(), - type: z.string(), - params: z.record(z.string(), z.any()), -}); - -const investigationItemSchema = z.intersection( - z.object({ - id: z.string(), - createdAt: z.number(), - createdBy: z.string(), - updatedAt: z.number(), - }), - itemSchema -); - -type Item = z.infer; -type InvestigationItem = z.infer; - -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 deleted file mode 100644 index ff877ab88412..000000000000 --- a/packages/kbn-investigation-shared/src/schema/investigation_note.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const investigationNoteSchema = z.object({ - id: z.string(), - content: z.string(), - createdAt: z.number(), - updatedAt: z.number(), - createdBy: z.string(), -}); - -export { investigationNoteSchema }; diff --git a/packages/kbn-investigation-shared/src/schema/origin.ts b/packages/kbn-investigation-shared/src/schema/origin.ts deleted file mode 100644 index b0c790db0ad6..000000000000 --- a/packages/kbn-investigation-shared/src/schema/origin.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { z } from '@kbn/zod'; - -const blankOriginSchema = z.object({ type: z.literal('blank') }); -const alertOriginSchema = z.object({ type: z.literal('alert'), id: z.string() }); - -export { alertOriginSchema, blankOriginSchema }; diff --git a/packages/kbn-investigation-shared/tsconfig.json b/packages/kbn-investigation-shared/tsconfig.json deleted file mode 100644 index e8db47aba5c1..000000000000 --- a/packages/kbn-investigation-shared/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/zod" - ] -} diff --git a/packages/kbn-management/settings/components/form/bottom_bar/bottom_bar.tsx b/packages/kbn-management/settings/components/form/bottom_bar/bottom_bar.tsx index e9947ac6f930..dd300aad99c3 100644 --- a/packages/kbn-management/settings/components/form/bottom_bar/bottom_bar.tsx +++ b/packages/kbn-management/settings/components/form/bottom_bar/bottom_bar.tsx @@ -87,7 +87,7 @@ export const BottomBar = ({ /packages/kbn-openapi-common'], +}; diff --git a/packages/kbn-openapi-common/schemas/primitives.gen.ts b/packages/kbn-openapi-common/schemas/primitives.gen.ts index 4f8b19495022..03977a29b997 100644 --- a/packages/kbn-openapi-common/schemas/primitives.gen.ts +++ b/packages/kbn-openapi-common/schemas/primitives.gen.ts @@ -17,15 +17,13 @@ */ import { z } from '@kbn/zod'; +import { isNonEmptyString } from '@kbn/zod-helpers'; /** - * A string that is not empty and does not contain only whitespace + * A string that does not contain only whitespace characters */ export type NonEmptyString = z.infer; -export const NonEmptyString = z - .string() - .min(1) - .regex(/^(?! *$).+$/); +export const NonEmptyString = z.string().min(1).superRefine(isNonEmptyString); /** * A universally unique identifier diff --git a/packages/kbn-openapi-common/schemas/primitives.schema.yaml b/packages/kbn-openapi-common/schemas/primitives.schema.yaml index 177ad2ed30ec..84e436719272 100644 --- a/packages/kbn-openapi-common/schemas/primitives.schema.yaml +++ b/packages/kbn-openapi-common/schemas/primitives.schema.yaml @@ -8,9 +8,9 @@ components: schemas: NonEmptyString: type: string - pattern: ^(?! *$).+$ minLength: 1 - description: A string that is not empty and does not contain only whitespace + format: nonempty + description: A string that does not contain only whitespace characters UUID: type: string diff --git a/packages/kbn-openapi-common/schemas/primitives.test.ts b/packages/kbn-openapi-common/schemas/primitives.test.ts new file mode 100644 index 000000000000..b83f5e6d3463 --- /dev/null +++ b/packages/kbn-openapi-common/schemas/primitives.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ +import { NonEmptyString } from './primitives.gen'; + +describe('NonEmptyString', () => { + describe('accepts ', () => { + // \t\r\n\f + test('accepts newline chars', () => { + expect(() => NonEmptyString.parse('hello \nworld')).not.toThrow(); + }); + test('accepts tab chars', () => { + expect(() => NonEmptyString.parse('hello \tworld')).not.toThrow(); + }); + test('accepts carriage return chars', () => { + expect(() => NonEmptyString.parse('hello \rworld')).not.toThrow(); + }); + test('accepts form feed return chars', () => { + expect(() => NonEmptyString.parse('hello \fworld')).not.toThrow(); + }); + }); + describe('rejects', () => { + test('rejects only tab chars chars', () => { + expect(() => NonEmptyString.parse('\t\t\t\t')).toThrow(); + }); + test('rejects only newline chars chars', () => { + expect(() => NonEmptyString.parse('\n\n\n\n\n')).toThrow(); + }); + test('rejects only carriage return chars chars', () => { + expect(() => NonEmptyString.parse('\r\r\r\r')).toThrow(); + }); + test('rejects only form feed chars chars', () => { + expect(() => NonEmptyString.parse('\f\f\f\f\f')).toThrow(); + }); + test('rejects comment with just spaces', () => { + expect(() => NonEmptyString.parse(' ')).toThrow(); + }); + }); +}); diff --git a/packages/kbn-openapi-common/tsconfig.json b/packages/kbn-openapi-common/tsconfig.json index ca7d7e471536..29a271ba4840 100644 --- a/packages/kbn-openapi-common/tsconfig.json +++ b/packages/kbn-openapi-common/tsconfig.json @@ -8,5 +8,6 @@ "include": ["**/*.ts"], "kbn_references": [ "@kbn/zod", + "@kbn/zod-helpers", ] } 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 759b0d9294b8..b3b1b72bf415 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 @@ -9,7 +9,7 @@ import type { ZodTypeDef } from '@kbn/zod'; import { z } from '@kbn/zod'; -import { requiredOptional, isValidDateMath, ArrayFromString, BooleanFromString } from '@kbn/zod-helpers'; +import { requiredOptional, isValidDateMath, isNonEmptyString, ArrayFromString, BooleanFromString } from '@kbn/zod-helpers'; {{#each imports}} import { diff --git a/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars b/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars index 8e4c5aef616f..de9b66cee31d 100644 --- a/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars +++ b/packages/kbn-openapi-generator/src/template_service/templates/zod_schema_item.handlebars @@ -124,5 +124,8 @@ z.unknown() {{~#if (eq format 'date-math')}}.superRefine(isValidDateMath){{/if~}} {{~#if (eq format 'uuid')}}.uuid(){{/if~}} {{~#if pattern}}.regex(/{{pattern}}/){{/if~}} + {{~#if (eq format 'trim')}}.trim(){{/if~}} + {{~#if (eq format 'nonempty')}}.superRefine(isNonEmptyString){{/if~}} + {{~/if~}} {{~/inline~}} diff --git a/packages/kbn-palettes/README.md b/packages/kbn-palettes/README.md new file mode 100644 index 000000000000..d4c3913e33d2 --- /dev/null +++ b/packages/kbn-palettes/README.md @@ -0,0 +1,3 @@ +# @kbn/palettes + +Package containing shared visualization palette definitions diff --git a/packages/kbn-palettes/classes/categorical_palette.ts b/packages/kbn-palettes/classes/categorical_palette.ts new file mode 100644 index 000000000000..fc352e7b45b3 --- /dev/null +++ b/packages/kbn-palettes/classes/categorical_palette.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Optional } from 'utility-types'; +import { KbnBasePalette, KbnBasePaletteConfig } from './palette'; +import { IKbnPalette } from './types'; + +export interface KbnCategoricalPaletteConfig extends Optional { + colors: string[]; +} + +export class KbnCategoricalPalette extends KbnBasePalette implements IKbnPalette { + public readonly type = 'categorical' as const; + + #colors: string[]; + + constructor({ colors, colorCount = colors.length, ...rest }: KbnCategoricalPaletteConfig) { + super({ ...rest, colorCount }); + + this.#colors = colors; + } + + public colors = (n?: number) => { + const end = n === undefined ? n : Math.max(1, n); + return this.#colors.slice(0, end); + }; +} diff --git a/packages/kbn-palettes/classes/color_fn_palette.ts b/packages/kbn-palettes/classes/color_fn_palette.ts new file mode 100644 index 000000000000..4be79355f110 --- /dev/null +++ b/packages/kbn-palettes/classes/color_fn_palette.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Optional } from 'utility-types'; +import { KbnBasePaletteConfig, KbnBasePalette } from './palette'; +import { IKbnPalette, KbnPaletteType } from './types'; + +const DEFAULT_COLOR_COUNT = 10; + +export interface KbnColorFnPaletteConfig extends Optional { + type: KbnPaletteType; + colorFn: (n: number) => string[]; + /** + * Default number of colors returned from `colors` method. + * + * @default `colorCount` + */ + defaultNumberOfColors?: number; +} + +export class KbnColorFnPalette extends KbnBasePalette implements IKbnPalette { + public readonly type: KbnPaletteType; + + #colorFn: (n: number) => string[]; + #defaultNumberOfColors: number; + + constructor({ + type, + colorFn, + defaultNumberOfColors, + colorCount = DEFAULT_COLOR_COUNT, + ...rest + }: KbnColorFnPaletteConfig) { + super({ ...rest, colorCount }); + + this.type = type; + + this.#colorFn = colorFn; + this.#defaultNumberOfColors = defaultNumberOfColors ?? colorCount; + } + + public colors = (n: number = this.#defaultNumberOfColors) => { + return this.#colorFn(n === undefined ? n : Math.max(1, n)); + }; +} diff --git a/packages/kbn-palettes/classes/index.ts b/packages/kbn-palettes/classes/index.ts new file mode 100644 index 000000000000..6cc89dc1cc1f --- /dev/null +++ b/packages/kbn-palettes/classes/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './types'; +export { KbnPalettes } from './palettes'; diff --git a/packages/kbn-palettes/classes/palette.ts b/packages/kbn-palettes/classes/palette.ts new file mode 100644 index 000000000000..8c707b1c3b7d --- /dev/null +++ b/packages/kbn-palettes/classes/palette.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Optional } from 'utility-types'; +import { IKbnPalette, KbnPaletteType } from './types'; + +export type KbnBasePaletteConfig = Optional< + Pick, + 'legacy' | 'aliases' +>; + +export abstract class KbnBasePalette implements IKbnPalette { + public abstract type: KbnPaletteType; + + public readonly id: string; + public readonly name: string; + public readonly colorCount: number; + public readonly legacy: boolean; + public readonly standalone: boolean; + public readonly aliases: string[]; + + constructor({ + id, + name, + colorCount, + aliases = [], + legacy = false, + standalone = false, + }: KbnBasePaletteConfig) { + this.id = id; + this.name = name; + this.colorCount = colorCount; + this.legacy = legacy; + this.standalone = standalone; + this.aliases = aliases; + } + + public abstract colors: (n?: number | undefined) => string[]; + + public getColor = (colorIndex: number, numberOfColors?: number) => { + const colors = this.colors(numberOfColors); + return colors[colorIndex % colors.length]; // ensure color is always returned + }; +} diff --git a/packages/kbn-palettes/classes/palettes.ts b/packages/kbn-palettes/classes/palettes.ts new file mode 100644 index 000000000000..8b0ea42dd072 --- /dev/null +++ b/packages/kbn-palettes/classes/palettes.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { IKbnPalette } from './types'; + +export class KbnPalettes { + #palettes: Map; + #aliasMappings: Map; + #defaultPalette: IKbnPalette; + + constructor(palettes: IKbnPalette[], defaultPalette: IKbnPalette) { + this.#defaultPalette = defaultPalette; + this.#palettes = new Map(palettes.map((p) => [p.id, p])); + this.#aliasMappings = buildAliasMappings(palettes); + } + + query = (id: string) => { + const aliasedId = (this.#palettes.has(id) ? id : this.#aliasMappings.get(id)) ?? id; + return this.#palettes.get(aliasedId); + }; + + get = (id: string) => { + return this.query(id) ?? this.#defaultPalette; + }; + + getAll = () => { + return [...this.#palettes.values()].filter(({ standalone }) => !standalone); + }; +} + +function buildAliasMappings(palettes: IKbnPalette[]): Map { + return palettes.reduce((acc, { id, aliases }) => { + aliases.forEach((alias) => { + acc.set(alias, id); + }); + return acc; + }, new Map()); +} diff --git a/packages/kbn-palettes/classes/types.ts b/packages/kbn-palettes/classes/types.ts new file mode 100644 index 000000000000..345978a409a5 --- /dev/null +++ b/packages/kbn-palettes/classes/types.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export type KbnPaletteType = 'categorical' | 'gradient'; + +/** + * Common palette definition used throughout kibana + */ +export interface IKbnPalette { + /** + * Unique identifier for the palette + */ + id: string; + /** + * Display name of this palette. + */ + name: string; + /** + * Type of pallette + */ + type: KbnPaletteType; + /** + * Number of colors to display + */ + colorCount: number; + /** + * Palette belongs to an outdated theme set + */ + legacy: boolean; + /** + * Alternate aliases/ids this palette matches + */ + aliases: string[]; + /** + * Excluded from `getAll` but can still query for palette with `get`/`query` + * + * An example would be `KbnPalette.Neutral` palette. I want to exclude it from the list of all available palettes, but I still want to `get`/`query` the palette. + */ + standalone?: boolean; + /** + * Returns array of colors, optionally provide desired number of colors (`n`) + */ + colors: (n?: number) => string[]; + /** + * Returns color provided index and optional total number of colors + */ + getColor: (colorIndex: number, numberOfColors?: number) => string; +} diff --git a/packages/kbn-palettes/constants.ts b/packages/kbn-palettes/constants.ts new file mode 100644 index 000000000000..13ac550577e5 --- /dev/null +++ b/packages/kbn-palettes/constants.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export const DEFAULT_FALLBACK_PALETTE = 'default' as const; + +export const EUI_THEME_AMSTERDAM = 'EUI_THEME_AMSTERDAM'; +export const EUI_THEME_BOREALIS = 'EUI_THEME_BOREALIS'; + +const semantic = { + /** + * Log level palette + */ + LogLevel: 'log_level' as const, +}; + +const categorical = { + /** + * Default kibana theme + */ + Default: DEFAULT_FALLBACK_PALETTE, + /** + * Neutral palette + */ + Neutral: 'neutral' as const, + + // ---- Legacy Palettes ---- + /** + * Kibana legacy theme v7 to v9 + */ + Kibana7: 'eui_amsterdam' as const, + /** + * Kibana behind text legacy theme v7 to v9 + */ + Kibana7BehindText: 'behind_text' as const, + /** + * Kibana legacy theme v4 to v7 + */ + Kibana4: 'kibana_v7_legacy' as const, + /** + * Elastic classic color palette + */ + ElasticClassic: 'elastic_brand_2023' as const, +}; + +const gradient = { + Cool: 'cool' as const, + Gray: 'gray' as const, + Red: 'red' as const, + Green: 'green' as const, + Warm: 'warm' as const, + Temperature: 'temperature' as const, + Complementary: 'complementary' as const, + Status: 'status' as const, +}; + +/** + * Enum of all kbn palette ids, including by type + */ +export const KbnPalette = { + // Categorical palettes + ...categorical, + + // Gradient palettes + ...gradient, + + // Semantic palettes + ...semantic, + + // ---- Deprecated palettes ---- + /** + * Amsterdam theme + * @deprecated use `KbnPalette.kibana7` + */ + Amsterdam: 'eui_amsterdam_color_blind' as const, +}; diff --git a/packages/kbn-palettes/hooks/index.ts b/packages/kbn-palettes/hooks/index.ts new file mode 100644 index 000000000000..b01c38728d15 --- /dev/null +++ b/packages/kbn-palettes/hooks/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './use_kbn_palettes'; diff --git a/packages/kbn-palettes/hooks/use_kbn_palettes.ts b/packages/kbn-palettes/hooks/use_kbn_palettes.ts new file mode 100644 index 000000000000..f78c70ad2ba3 --- /dev/null +++ b/packages/kbn-palettes/hooks/use_kbn_palettes.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { useEuiTheme } from '@elastic/eui'; +import { getPalettes } from '../palettes'; +import { getLegacyKbnPalettes } from '../palettes/legacy'; + +export function useKbnPalettes() { + const { + euiTheme: { themeName }, + colorMode, + } = useEuiTheme(); + + if (themeName === 'EUI_THEME_BOREALIS') { + return getPalettes(colorMode === 'DARK'); + } + + return getLegacyKbnPalettes(colorMode === 'DARK'); +} diff --git a/packages/kbn-palettes/index.ts b/packages/kbn-palettes/index.ts new file mode 100644 index 000000000000..361273837f9c --- /dev/null +++ b/packages/kbn-palettes/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './palettes'; +export * from './classes'; +export { DEFAULT_FALLBACK_PALETTE, KbnPalette } from './constants'; + +export * from './hooks'; diff --git a/packages/kbn-palettes/jest.config.js b/packages/kbn-palettes/jest.config.js new file mode 100644 index 000000000000..ba851fd1d70f --- /dev/null +++ b/packages/kbn-palettes/jest.config.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../..', + roots: ['/packages/kbn-palettes'], +}; diff --git a/packages/kbn-palettes/kibana.jsonc b/packages/kbn-palettes/kibana.jsonc new file mode 100644 index 000000000000..940c34426c2b --- /dev/null +++ b/packages/kbn-palettes/kibana.jsonc @@ -0,0 +1,5 @@ +{ + "type": "shared-common", + "id": "@kbn/palettes", + "owner": "@elastic/kibana-visualizations" +} diff --git a/packages/kbn-palettes/package.json b/packages/kbn-palettes/package.json new file mode 100644 index 000000000000..6400900ccfba --- /dev/null +++ b/packages/kbn-palettes/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/palettes", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" +} \ No newline at end of file diff --git a/packages/kbn-palettes/palettes/categorical/elastic.ts b/packages/kbn-palettes/palettes/categorical/elastic.ts new file mode 100644 index 000000000000..239b1c009d5d --- /dev/null +++ b/packages/kbn-palettes/palettes/categorical/elastic.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteColorBlind } from '@elastic/eui'; +import { KbnPalette } from '../../constants'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; + +/** + * This is not correctly returning the updated vis colors from eui. + * All gradient function work correctly. + */ +export const elasticPalette = new KbnColorFnPalette({ + id: KbnPalette.Default, + type: 'categorical', + aliases: [ + 'elastic_borealis', // placeholder - not yet used + KbnPalette.Amsterdam, // to assign to existing default palettes + ], + colorCount: 10, + defaultNumberOfColors: 30, + name: i18n.translate('palettes.elastic.name', { + defaultMessage: 'Elastic (default)', + }), + // Return exact colors requested given enough rotations + colorFn: (n) => euiPaletteColorBlind({ rotations: Math.ceil(n / 10) }).slice(0, n), +}); diff --git a/packages/kbn-palettes/palettes/categorical/index.ts b/packages/kbn-palettes/palettes/categorical/index.ts new file mode 100644 index 000000000000..63638c387f71 --- /dev/null +++ b/packages/kbn-palettes/palettes/categorical/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './neutral'; +export * from './elastic'; diff --git a/packages/kbn-palettes/palettes/categorical/neutral.ts b/packages/kbn-palettes/palettes/categorical/neutral.ts new file mode 100644 index 000000000000..13de3a45cb94 --- /dev/null +++ b/packages/kbn-palettes/palettes/categorical/neutral.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { + KbnCategoricalPalette, + KbnCategoricalPaletteConfig, +} from '../../classes/categorical_palette'; +import { KbnPalette } from '../../constants'; + +const commonProps = { + id: KbnPalette.Neutral, + standalone: true, + name: i18n.translate('palettes.elastic.name', { + defaultMessage: 'Neutral', + }), +} satisfies Omit; + +const lightNeutralPalette = new KbnCategoricalPalette({ + ...commonProps, + colors: ['#F6F9FC', '#D0D4DA', '#989FAA', '#666D78', '#373D45'], +}); + +const darkNeutralPalette = new KbnCategoricalPalette({ + ...commonProps, + colors: ['#F6F9FC', '#C9D4E6', '#89A0C4', '#546D95', '#283C5C'], +}); + +export const getNeutralPalette = (darkMode: boolean) => + darkMode ? darkNeutralPalette : lightNeutralPalette; diff --git a/packages/kbn-palettes/palettes/get_kbn_palettes.ts b/packages/kbn-palettes/palettes/get_kbn_palettes.ts new file mode 100644 index 000000000000..0519a2d4bf9a --- /dev/null +++ b/packages/kbn-palettes/palettes/get_kbn_palettes.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { CoreTheme } from '@kbn/core-theme-browser'; +import { getPalettes } from '.'; +import { getLegacyKbnPalettes } from './legacy'; + +export function getKbnPalettes({ name, darkMode }: CoreTheme) { + if (name === 'amsterdam') { + return getLegacyKbnPalettes(darkMode); + } + + return getPalettes(darkMode); +} diff --git a/packages/kbn-palettes/palettes/gradient/complementary.ts b/packages/kbn-palettes/palettes/gradient/complementary.ts new file mode 100644 index 000000000000..c61fc8d140d5 --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/complementary.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteComplementary } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const complementaryPalette = new KbnColorFnPalette({ + id: KbnPalette.Complementary, + type: 'gradient', + name: i18n.translate('palettes.complementary.name', { + defaultMessage: 'Complementary', + }), + colorFn: euiPaletteComplementary, +}); diff --git a/packages/kbn-palettes/palettes/gradient/cool.ts b/packages/kbn-palettes/palettes/gradient/cool.ts new file mode 100644 index 000000000000..2982cba8a35d --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/cool.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteCool } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const coolPalette = new KbnColorFnPalette({ + id: KbnPalette.Cool, + type: 'gradient', + name: i18n.translate('palettes.cool.name', { + defaultMessage: 'Cool', + }), + colorFn: euiPaletteCool, +}); diff --git a/packages/kbn-palettes/palettes/gradient/gray.ts b/packages/kbn-palettes/palettes/gradient/gray.ts new file mode 100644 index 000000000000..24d6d2444ce5 --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/gray.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteGray } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const grayPalette = new KbnColorFnPalette({ + id: KbnPalette.Gray, + type: 'gradient', + name: i18n.translate('palettes.gray.name', { + defaultMessage: 'Gray', + }), + colorFn: euiPaletteGray, +}); diff --git a/packages/kbn-palettes/palettes/gradient/green.ts b/packages/kbn-palettes/palettes/gradient/green.ts new file mode 100644 index 000000000000..bb6655d575ea --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/green.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteGreen } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const greenPalette = new KbnColorFnPalette({ + id: KbnPalette.Green, + type: 'gradient', + name: i18n.translate('palettes.green.name', { + defaultMessage: 'Positive', + }), + colorFn: euiPaletteGreen, +}); diff --git a/packages/kbn-palettes/palettes/gradient/index.ts b/packages/kbn-palettes/palettes/gradient/index.ts new file mode 100644 index 000000000000..7781fdd5ec7a --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './cool'; +export * from './gray'; +export * from './red'; +export * from './green'; +export * from './warm'; +export * from './temperature'; +export * from './complementary'; +export * from './status'; diff --git a/packages/kbn-palettes/palettes/gradient/red.ts b/packages/kbn-palettes/palettes/gradient/red.ts new file mode 100644 index 000000000000..e2cd76df1e45 --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/red.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteRed } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const redPalette = new KbnColorFnPalette({ + id: KbnPalette.Red, + type: 'gradient', + name: i18n.translate('palettes.red.name', { + defaultMessage: 'Negative', + }), + colorFn: euiPaletteRed, +}); diff --git a/packages/kbn-palettes/palettes/gradient/status.ts b/packages/kbn-palettes/palettes/gradient/status.ts new file mode 100644 index 000000000000..db0c1931aae7 --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/status.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteForStatus } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const statusPalette = new KbnColorFnPalette({ + id: KbnPalette.Status, + type: 'gradient', + name: i18n.translate('palettes.status.name', { + defaultMessage: 'Status', + }), + colorFn: euiPaletteForStatus, +}); diff --git a/packages/kbn-palettes/palettes/gradient/temperature.ts b/packages/kbn-palettes/palettes/gradient/temperature.ts new file mode 100644 index 000000000000..5cf802db6c1f --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/temperature.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteForTemperature } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const temperaturePalette = new KbnColorFnPalette({ + id: KbnPalette.Temperature, + type: 'gradient', + name: i18n.translate('palettes.temperature.name', { + defaultMessage: 'Temperature', + }), + colorFn: euiPaletteForTemperature, +}); diff --git a/packages/kbn-palettes/palettes/gradient/warm.ts b/packages/kbn-palettes/palettes/gradient/warm.ts new file mode 100644 index 000000000000..16ada3059903 --- /dev/null +++ b/packages/kbn-palettes/palettes/gradient/warm.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteWarm } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../classes/color_fn_palette'; +import { KbnPalette } from '../../constants'; + +export const warmPalette = new KbnColorFnPalette({ + id: KbnPalette.Warm, + type: 'gradient', + name: i18n.translate('palettes.warm.name', { + defaultMessage: 'Warm', + }), + colorFn: euiPaletteWarm, +}); diff --git a/packages/kbn-palettes/palettes/index.ts b/packages/kbn-palettes/palettes/index.ts new file mode 100644 index 000000000000..5f70cafaa6b2 --- /dev/null +++ b/packages/kbn-palettes/palettes/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { KbnPalettes } from '../classes/palettes'; +import { elasticPalette, getNeutralPalette } from './categorical'; +import { elasticClassicPalette, kibana4Palette, kibana7Palette } from './legacy/categorical'; +import { + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, +} from './gradient'; +export { logLevelPalette } from './semantic'; + +const darkKbnPalettes = new KbnPalettes( + [ + elasticPalette, + kibana7Palette, + kibana4Palette, + getNeutralPalette(true), + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, + elasticClassicPalette, + ], + elasticPalette +); + +const lightKbnPalettes = new KbnPalettes( + [ + elasticPalette, + kibana7Palette, + kibana4Palette, + getNeutralPalette(true), + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, + elasticClassicPalette, + ], + elasticPalette +); + +export const getPalettes = (darkMode: boolean) => (darkMode ? darkKbnPalettes : lightKbnPalettes); + +export { elasticPalette } from './categorical'; +export * from './get_kbn_palettes'; diff --git a/packages/kbn-palettes/palettes/legacy/categorical/elastic_classic.ts b/packages/kbn-palettes/palettes/legacy/categorical/elastic_classic.ts new file mode 100644 index 000000000000..5a4347b8b7cc --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/elastic_classic.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { KbnCategoricalPalette } from '../../../classes/categorical_palette'; +import { KbnPalette } from '../../../constants'; + +export const elasticClassicPalette = new KbnCategoricalPalette({ + id: KbnPalette.ElasticClassic, + name: i18n.translate('palettes.classic.name', { + defaultMessage: 'Elastic classic', + }), + colors: ['#20377d', '#7de2d1', '#ff957d', '#f04e98', '#0077cc', '#fec514'], +}); diff --git a/packages/kbn-palettes/palettes/legacy/categorical/index.ts b/packages/kbn-palettes/palettes/legacy/categorical/index.ts new file mode 100644 index 000000000000..52e244344f20 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './kibana_7'; +export * from './kibana_7_behind_text'; +export * from './kibana_4'; +export * from './elastic_classic'; +export * from './neutral'; diff --git a/packages/kbn-palettes/palettes/legacy/categorical/kibana_4.ts b/packages/kbn-palettes/palettes/legacy/categorical/kibana_4.ts new file mode 100644 index 000000000000..ff8019a8fb02 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/kibana_4.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { KbnCategoricalPalette } from '../../../classes/categorical_palette'; +import { KbnPalette } from '../../../constants'; + +export const kibana4Palette = new KbnCategoricalPalette({ + id: KbnPalette.Kibana4, + name: i18n.translate('palettes.kibana4.name', { + defaultMessage: 'Kibana 4', + }), + colors: ['#00a69b', '#57c17b', '#6f87d8', '#663db8', '#bc52bc', '#9e3533', '#daa05d'], +}); diff --git a/packages/kbn-palettes/palettes/legacy/categorical/kibana_7.ts b/packages/kbn-palettes/palettes/legacy/categorical/kibana_7.ts new file mode 100644 index 000000000000..75ec1c7073c6 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/kibana_7.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { KbnCategoricalPalette } from '../../../classes/categorical_palette'; +import { KbnPalette } from '../../../constants'; + +export const kibana7Palette = new KbnCategoricalPalette({ + id: KbnPalette.Kibana7, + aliases: [ + KbnPalette.Default, // needed when switching between new and old themes + KbnPalette.Amsterdam, // to assign to existing default palettes + ], + name: i18n.translate('palettes.kibana7.name', { + defaultMessage: 'Kibana 7', + }), + colorCount: 10, + colors: [ + '#54b399', + '#6092c0', + '#d36086', + '#9170b8', + '#ca8eae', + '#d6bf57', + '#b9a888', + '#da8b45', + '#aa6556', + '#e7664c', + '#7fc6b3', + '#88aed0', + '#de88a5', + '#ad94ca', + '#d8abc3', + '#e1cf81', + '#cbbea6', + '#e4a874', + '#c08c81', + '#ed8d79', + '#aad9cc', + '#b0c9e0', + '#e9b0c3', + '#c8b8dc', + '#e5c7d7', + '#ebdfab', + '#dcd4c4', + '#edc5a2', + '#d5b2ab', + '#f3b3a6', + ], +}); diff --git a/packages/kbn-palettes/palettes/legacy/categorical/kibana_7_behind_text.ts b/packages/kbn-palettes/palettes/legacy/categorical/kibana_7_behind_text.ts new file mode 100644 index 000000000000..578afcdff628 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/kibana_7_behind_text.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { KbnCategoricalPalette } from '../../../classes/categorical_palette'; +import { KbnPalette } from '../../../constants'; + +export const kibana7BehindText = new KbnCategoricalPalette({ + id: KbnPalette.Kibana7BehindText, + name: i18n.translate('palettes.kibana7BehindText.name', { + defaultMessage: 'Kibana 7 (behind text)', + }), + standalone: true, + colorCount: 10, + colors: [ + '#6dccb1', + '#79aad9', + '#ee789d', + '#a987d1', + '#e4a6c7', + '#f1d86f', + '#d2c0a0', + '#f5a35c', + '#c47c6c', + '#ff7e62', + '#98dfcc', + '#a0c7e9', + '#f8a0bd', + '#c6ace3', + '#f2c4dc', + '#fbe899', + '#e4d7be', + '#ffc08b', + '#daa498', + '#ffa590', + '#c3f3e5', + '#c9e2fa', + '#ffc9dc', + '#e1d1f6', + '#ffe0f1', + '#fff9c4', + '#f6eddd', + '#ffdeba', + '#efcbc4', + '#ffccbe', + ], +}); diff --git a/packages/kbn-palettes/palettes/legacy/categorical/neutral.ts b/packages/kbn-palettes/palettes/legacy/categorical/neutral.ts new file mode 100644 index 000000000000..99bb21e42f39 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/categorical/neutral.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { KbnCategoricalPalette } from '../../../classes/categorical_palette'; +import { KbnPalette } from '../../../constants'; + +const schemeGreys = ['#f2f4fb', '#d4d9e5', '#98a2b3', '#696f7d', '#353642']; +const NEUTRAL_COLOR_LIGHT = schemeGreys.slice(); +const NEUTRAL_COLOR_DARK = schemeGreys.slice().reverse(); + +export const getNeutralPalette = (darkMode: boolean) => + new KbnCategoricalPalette({ + id: KbnPalette.Neutral, + name: i18n.translate('palettes.elastic.name', { + defaultMessage: 'Neutral', + }), + standalone: true, + colors: darkMode ? NEUTRAL_COLOR_DARK : NEUTRAL_COLOR_LIGHT, + }); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/complementary.ts b/packages/kbn-palettes/palettes/legacy/gradient/complementary.ts new file mode 100644 index 000000000000..be730d39e89b --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/complementary.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteComplementary } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const complementaryPalette = new KbnColorFnPalette({ + id: KbnPalette.Complementary, + type: 'gradient', + name: i18n.translate('palettes.complementary.name', { + defaultMessage: 'Complementary', + }), + colorFn: euiPaletteComplementary, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/cool.ts b/packages/kbn-palettes/palettes/legacy/gradient/cool.ts new file mode 100644 index 000000000000..178b7f2afeae --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/cool.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteCool } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const coolPalette = new KbnColorFnPalette({ + id: KbnPalette.Cool, + type: 'gradient', + name: i18n.translate('palettes.cool.name', { + defaultMessage: 'Cool', + }), + colorFn: euiPaletteCool, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/gray.ts b/packages/kbn-palettes/palettes/legacy/gradient/gray.ts new file mode 100644 index 000000000000..c0176eba2262 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/gray.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteGray } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const grayPalette = new KbnColorFnPalette({ + id: KbnPalette.Gray, + type: 'gradient', + name: i18n.translate('palettes.gray.name', { + defaultMessage: 'Gray', + }), + colorFn: euiPaletteGray, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/green.ts b/packages/kbn-palettes/palettes/legacy/gradient/green.ts new file mode 100644 index 000000000000..3e84be1c923f --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/green.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteGreen } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const greenPalette = new KbnColorFnPalette({ + id: KbnPalette.Green, + type: 'gradient', + name: i18n.translate('palettes.green.name', { + defaultMessage: 'Positive', + }), + colorFn: euiPaletteGreen, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/index.ts b/packages/kbn-palettes/palettes/legacy/gradient/index.ts new file mode 100644 index 000000000000..7781fdd5ec7a --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './cool'; +export * from './gray'; +export * from './red'; +export * from './green'; +export * from './warm'; +export * from './temperature'; +export * from './complementary'; +export * from './status'; diff --git a/packages/kbn-palettes/palettes/legacy/gradient/red.ts b/packages/kbn-palettes/palettes/legacy/gradient/red.ts new file mode 100644 index 000000000000..9c028502ce60 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/red.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteRed } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const redPalette = new KbnColorFnPalette({ + id: KbnPalette.Red, + type: 'gradient', + name: i18n.translate('palettes.red.name', { + defaultMessage: 'Negative', + }), + colorFn: euiPaletteRed, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/status.ts b/packages/kbn-palettes/palettes/legacy/gradient/status.ts new file mode 100644 index 000000000000..d367efe4752f --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/status.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteForStatus } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const statusPalette = new KbnColorFnPalette({ + id: KbnPalette.Status, + type: 'gradient', + name: i18n.translate('palettes.status.name', { + defaultMessage: 'Status', + }), + colorFn: euiPaletteForStatus, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/temperature.ts b/packages/kbn-palettes/palettes/legacy/gradient/temperature.ts new file mode 100644 index 000000000000..2ff7a7fbf65d --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/temperature.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteForTemperature } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const temperaturePalette = new KbnColorFnPalette({ + id: KbnPalette.Temperature, + type: 'gradient', + name: i18n.translate('palettes.temperature.name', { + defaultMessage: 'Temperature', + }), + colorFn: euiPaletteForTemperature, +}); diff --git a/packages/kbn-palettes/palettes/legacy/gradient/warm.ts b/packages/kbn-palettes/palettes/legacy/gradient/warm.ts new file mode 100644 index 000000000000..f19a8eb148db --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/gradient/warm.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { euiPaletteWarm } from '@elastic/eui'; +import { KbnColorFnPalette } from '../../../classes/color_fn_palette'; +import { KbnPalette } from '../../../constants'; + +export const warmPalette = new KbnColorFnPalette({ + id: KbnPalette.Warm, + type: 'gradient', + name: i18n.translate('palettes.warm.name', { + defaultMessage: 'Warm', + }), + colorFn: euiPaletteWarm, +}); diff --git a/packages/kbn-palettes/palettes/legacy/index.ts b/packages/kbn-palettes/palettes/legacy/index.ts new file mode 100644 index 000000000000..ced72336fc37 --- /dev/null +++ b/packages/kbn-palettes/palettes/legacy/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { KbnPalettes } from '../../classes/palettes'; + +import { + kibana7Palette, + kibana4Palette, + elasticClassicPalette, + getNeutralPalette, + kibana7BehindText, +} from './categorical'; +import { + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, +} from './gradient'; + +const darkLegacyKbnPalettes = new KbnPalettes( + [ + kibana7Palette, + kibana4Palette, + kibana7BehindText, + getNeutralPalette(true), + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, + elasticClassicPalette, + ], + kibana7Palette +); + +const lightLegacyKbnPalettes = new KbnPalettes( + [ + kibana7Palette, + kibana4Palette, + kibana7BehindText, + getNeutralPalette(true), + complementaryPalette, + coolPalette, + grayPalette, + greenPalette, + redPalette, + statusPalette, + temperaturePalette, + warmPalette, + elasticClassicPalette, + ], + kibana7Palette +); + +export const getLegacyKbnPalettes = (darkMode: boolean) => + darkMode ? darkLegacyKbnPalettes : lightLegacyKbnPalettes; diff --git a/packages/kbn-palettes/palettes/semantic/index.ts b/packages/kbn-palettes/palettes/semantic/index.ts new file mode 100644 index 000000000000..cfc7c779dacf --- /dev/null +++ b/packages/kbn-palettes/palettes/semantic/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export * from './log_level'; diff --git a/packages/kbn-palettes/palettes/semantic/log_level.ts b/packages/kbn-palettes/palettes/semantic/log_level.ts new file mode 100644 index 000000000000..cbcbbdaee3de --- /dev/null +++ b/packages/kbn-palettes/palettes/semantic/log_level.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { i18n } from '@kbn/i18n'; +import { $Keys } from 'utility-types'; +import { KbnPalette } from '../../constants'; + +// TODO: update colors to vis colors +const logLevelColors = { + Emerg: '#F66D64', + Alert: '#E78E76', + Crit: '#E7A584', + Error: '#E7BD91', + Warn: '#E8D297', + Notice: '#C7D59', + Info: '#9CB1D3', + Debug: '#718FBC', + Other: '#CED4DE', +}; +type LogLevelKeys = $Keys; + +/** + * Defines a palette to be used directly and does not fully implement IKbnPalette + */ +export const logLevelPalette = { + id: KbnPalette.LogLevel, + name: i18n.translate('palettes.logLevel.name', { + defaultMessage: 'Log Level', + }), + getColor: (key: LogLevelKeys) => { + return logLevelColors[key]; + }, + colors: logLevelColors, +}; diff --git a/packages/kbn-palettes/tsconfig.json b/packages/kbn-palettes/tsconfig.json new file mode 100644 index 000000000000..546dace9495b --- /dev/null +++ b/packages/kbn-palettes/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/core-theme-browser" + ] +} diff --git a/packages/kbn-relocate/README.md b/packages/kbn-relocate/README.md new file mode 100644 index 000000000000..3ceb2432c69d --- /dev/null +++ b/packages/kbn-relocate/README.md @@ -0,0 +1,66 @@ +# @kbn/relocate + +This package contains a CLI tool to help move modules (plugins and packages) into their intended folders, according to the _Sustainable Kibana Architecture. + +## Prerequisites + +You must have `gh` CLI tool installed. You can install it by running: + +```sh +brew install gh +``` + +You must also configure your "default" kibana repo in `gh`, so that it can find PRs.: + +```sh +gh repo set-default elastic/kibana +``` + +You must have `elastic/kibana` remote configured under the name `upstream`. + +You must have a remote named `origin` pointing to your fork of the Kibana repo. + +## Usage + +First of all, you need to decide whether you want to contribute to an existing PR or to create a new one. Use the `--pr` flag to specify the PR you are trying to update: + +```sh +node scripts/relocate --pr +``` + +Note that when specifying an existing PR, the logic will undo + rewrite history for that PR, by force-pushing changes. + +To relocate modules for a given team, identify the "team handle" (e.g. @elastic/kibana-core), and run the following command from the root of the Kibana repo: + +```sh +node scripts/relocate --pr --team +``` + +You can relocate modules by path, e.g. all modules that are under `x-pack/plugins/observability_solution/`: + +```sh +node scripts/relocate --pr --path "x-pack/plugins/observability_solution/" +``` + +You can specify indivual packages by ID: + +```sh +node scripts/relocate --pr --include "@kbn/data-forge" --include "@kbn/deeplinks-observability" +``` + +You can also specify combinations of the above filters, to include modules that match ANY of the criteria. +Excluding modules explictly is also supported: + +```sh +node scripts/relocate --pr --team "@elastic/obs-ux-management-team" --exclude "@kbn/data-forge" +``` + +## Details + +The script generates log / description files of the form `relocate_YYYYMMDDhhmmss_.out`. You can inspect them if you encounter any errors. + +In particular, the file `relocate_YYYYMMDDhhmmss_description.out` contains the auto-generated PR description. You can push it to the PR by running: + +```sh +gh pr edit -F relocate_YYYYMMDDhhmmss_description.out -R elastic/kibana +``` diff --git a/packages/kbn-relocate/constants.ts b/packages/kbn-relocate/constants.ts new file mode 100644 index 000000000000..0ba7e9d50314 --- /dev/null +++ b/packages/kbn-relocate/constants.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import dedent from 'dedent'; + +export const BASE_FOLDER = process.cwd() + '/'; +export const BASE_FOLDER_DEPTH = process.cwd().split('/').length; +export const KIBANA_FOLDER = process.cwd().split('/').pop()!; +export const EXCLUDED_MODULES = ['@kbn/core']; +export const TARGET_FOLDERS = [ + 'src/platform/plugins/', + 'src/platform/packages/', + 'x-pack/platform/plugins/', + 'x-pack/platform/packages/', + 'x-pack/solutions/', +]; +export const EXTENSIONS = [ + 'eslintignore', + 'gitignore', + 'js', + 'mjs', + 'txt', + 'json', + 'lock', + 'bazel', + 'md', + 'mdz', + 'asciidoc', + 'sh', + 'ts', + 'jsonc', + 'yaml', + 'yml', +]; + +export const EXCLUDED_FOLDERS = [ + './api_docs', // autogenerated daily https://buildkite.com/elastic/kibana-api-docs-daily + './.chromium', + './.devcontainer', + './.es', + './.git', + // './.github', + './.native_modules', + './.node_binaries', + './.vscode', + './.yarn-local-mirror', + './build', + './core_http.codeql', + './data', + './node_modules', + './target', + './test.codeql', + './test2.codeql', + './trash', +]; + +export const NO_GREP = EXCLUDED_FOLDERS.map((f) => `--exclude-dir "${f}"`).join(' '); + +// These two constants are singletons, used and updated throughout the process +export const UPDATED_REFERENCES = new Set(); +export const UPDATED_RELATIVE_PATHS = new Set(); +export const SCRIPT_ERRORS: string[] = []; + +export const YMDMS = new Date() + .toISOString() + .replace(/[^0-9]/g, '') + .slice(0, -3); + +export const DESCRIPTION = `relocate_${YMDMS}_description.out`; +export const NEW_BRANCH = `kbn-team-1309-relocate-${YMDMS}`; + +export const GLOBAL_DESCRIPTION = dedent` +## Summary + +This PR aims at relocating some of the Kibana modules (plugins and packages) into a new folder structure, according to the _Sustainable Kibana Architecture_ initiative. + +> [!IMPORTANT] +> * We kindly ask you to: +> * Manually fix the errors in the error section below (if there are any). +> * Search for the \`packages[\/\\]\` and \`plugins[\/\\]\` patterns in the source code (Babel and Eslint config files), and update them appropriately. +> * Manually review \`.buildkite/scripts/pipelines/pull_request/pipeline.ts\` to ensure that any CI pipeline customizations continue to be correctly applied after the changed path names +> * Review all of the updated files, specially the \`.ts\` and \`.js\` files listed in the sections below, as some of them contain relative paths that have been updated. +> * Think of potential impact of the move, including tooling and configuration files that can be pointing to the relocated modules. E.g.: +> * customised eslint rules +> * docs pointing to source code + +> [!NOTE] +> * This PR has been auto-generated. +> * Any manual contributions will be lost if the 'relocate' script is re-run. +> * Try to obtain the missing reviews / approvals before applying manual fixes, and/or keep your changes in a .patch / git stash. +> * Please use [#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E) Slack channel for feedback. + +`; diff --git a/packages/kbn-relocate/index.ts b/packages/kbn-relocate/index.ts new file mode 100644 index 000000000000..cddaa307ab7b --- /dev/null +++ b/packages/kbn-relocate/index.ts @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { run } from '@kbn/dev-cli-runner'; +import { findAndRelocateModules, findAndMoveModule } from './relocate'; + +const toStringArray = (flag: string | boolean | string[] | undefined): string[] => { + if (typeof flag === 'string') { + return [flag].filter(Boolean); + } else if (typeof flag === 'boolean') { + return []; + } else if (Array.isArray(flag)) { + return flag.filter(Boolean); + } + return []; +}; + +const toOptString = ( + flagName: string, + flag: string | boolean | string[] | undefined, + defaultValue?: string +): string | undefined => { + if (typeof flag === 'boolean') { + throw Error(`You must specify a valid string for the --${flagName} flag`); + } else if (Array.isArray(flag)) { + throw Error(`Cannot specify multiple values for --${flagName} flag`); + } + return flag || defaultValue; +}; + +/** + * A CLI to move Kibana modules into the right folder structure, + * according to the Sustainable Kibana Architecture + */ +export const runKbnRelocateCli = () => { + run( + async ({ log, flags }) => { + if (typeof flags.moveOnly === 'string' && flags.moveOnly.length > 0) { + log.info('When using --moveOnly flag, the rest of flags are ignored.'); + await findAndMoveModule(flags.moveOnly, log); + } else { + const { pr, team, path, include, exclude, baseBranch } = flags; + await findAndRelocateModules({ + prNumber: toOptString('prNumber', pr), + baseBranch: toOptString('baseBranch', baseBranch, 'main')!, + teams: toStringArray(team), + paths: toStringArray(path), + included: toStringArray(include), + excluded: toStringArray(exclude), + log, + }); + } + }, + { + log: { + defaultLevel: 'info', + }, + flags: { + string: ['pr', 'team', 'path', 'include', 'exclude', 'baseBranch', 'moveOnly'], + help: ` + Usage: node scripts/relocate [options] + + --moveOnly Only move the specified module in the current branch (no cleanup, no branching, no commit) + --pr Use the given PR number instead of creating a new one + --team Include all modules (packages and plugins) belonging to the specified owner (can specify multiple teams) + --path Include all modules (packages and plugins) under the specified path (can specify multiple paths) + --include Include the specified module in the relocation (can specify multiple modules) + --exclude Exclude the specified module from the relocation (can use multiple times) + --baseBranch Use a branch different than 'main' (e.g. "8.x") + + E.g. relocate all modules owned by Core team and also modules owned by Operations team, excluding 'foo-module-id'. Force push into PR 239847: + node scripts/relocate --pr 239847 --team @elastic/kibana-core --team @elastic/kibana-operations --exclude @kbn/foo-module-id + `, + }, + } + ); +}; diff --git a/packages/kbn-relocate/jest.config.js b/packages/kbn-relocate/jest.config.js new file mode 100644 index 000000000000..f63ccebc0ab4 --- /dev/null +++ b/packages/kbn-relocate/jest.config.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test/jest_node', + rootDir: '../..', + roots: ['/packages/kbn-relocate'], +}; diff --git a/packages/kbn-relocate/kibana.jsonc b/packages/kbn-relocate/kibana.jsonc new file mode 100644 index 000000000000..bae4e5f6e9c6 --- /dev/null +++ b/packages/kbn-relocate/kibana.jsonc @@ -0,0 +1,6 @@ +{ + "type": "shared-server", + "id": "@kbn/relocate", + "owner": "@elastic/kibana-core", + "devOnly": true +} diff --git a/packages/kbn-relocate/package.json b/packages/kbn-relocate/package.json new file mode 100644 index 000000000000..5091a883ce6a --- /dev/null +++ b/packages/kbn-relocate/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/relocate", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0 OR AGPL-3.0-only OR SSPL-1.0" +} diff --git a/packages/kbn-relocate/relocate.ts b/packages/kbn-relocate/relocate.ts new file mode 100644 index 000000000000..646a3ba5bef0 --- /dev/null +++ b/packages/kbn-relocate/relocate.ts @@ -0,0 +1,222 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { join } from 'path'; +import { existsSync } from 'fs'; +import { rename, mkdir, rm } from 'fs/promises'; +import inquirer from 'inquirer'; +import { orderBy } from 'lodash'; +import type { ToolingLog } from '@kbn/tooling-log'; +import { getPackages } from '@kbn/repo-packages'; +import { REPO_ROOT } from '@kbn/repo-info'; +import type { Package } from './types'; +import { + DESCRIPTION, + EXCLUDED_MODULES, + KIBANA_FOLDER, + NEW_BRANCH, + TARGET_FOLDERS, +} from './constants'; +import { + belongsTo, + calculateModuleTargetFolder, + replaceReferences, + replaceRelativePaths, +} from './utils.relocate'; +import { safeExec } from './utils.exec'; +import { relocatePlan, relocateSummary } from './utils.logging'; +import { checkoutBranch, checkoutResetPr } from './utils.git'; + +const moveModule = async (module: Package, log: ToolingLog) => { + const destination = calculateModuleTargetFolder(module); + log.info(`Moving ${module.directory} to ${destination}`); + const chunks = destination.split('/'); + chunks.pop(); // discard module folder + if (existsSync(destination)) { + await rm(destination, { recursive: true }); + } + await mkdir(join('/', ...chunks), { recursive: true }); + await rename(module.directory, destination); + await replaceReferences(module, destination, log); + await replaceRelativePaths(module, destination, log); +}; + +const relocateModules = async (toMove: Package[], log: ToolingLog): Promise => { + let relocated: number = 0; + for (let i = 0; i < toMove.length; ++i) { + const module = toMove[i]; + + if (TARGET_FOLDERS.some((folder) => module.directory.includes(folder))) { + log.warning(`The module ${module.id} is already in a "sustainable" folder. Skipping`); + // skip modules that are already moved + continue; + } + log.info(''); + log.info('--------------------------------------------------------------------------------'); + log.info(`\t${module.id} (${i + 1} of ${toMove.length})`); + log.info('--------------------------------------------------------------------------------'); + await moveModule(module, log); + + // after move operations + await safeExec('yarn kbn bootstrap'); + await safeExec('node scripts/build_plugin_list_docs'); + await safeExec('node scripts/generate codeowners'); + await safeExec('node scripts/lint_packages --fix'); + await safeExec('node scripts/eslint --no-cache --fix'); + await safeExec('node scripts/precommit_hook --fix'); + + // single commit per module now + await safeExec(`git add .`); + await safeExec(`git commit -m "Relocating module \\\`${module.id}\\\`"`); + ++relocated; + } + return relocated; +}; + +interface FindModulesParams { + teams: string[]; + paths: string[]; + included: string[]; + excluded: string[]; +} + +export interface RelocateModulesParams { + baseBranch: string; + prNumber?: string; + teams: string[]; + paths: string[]; + included: string[]; + excluded: string[]; + log: ToolingLog; +} + +const findModules = ({ teams, paths, included, excluded }: FindModulesParams) => { + // get all modules + const modules = getPackages(REPO_ROOT); + + // find modules selected by user filters + return orderBy( + modules + // exclude devOnly modules (they will remain in /packages) + .filter(({ manifest }) => !manifest.devOnly) + // exclude modules that do not specify a group + .filter(({ manifest }) => manifest.group) + // explicit exclusions + .filter(({ id }) => !EXCLUDED_MODULES.includes(id) && !excluded.includes(id)) + // we don't want to move test modules (just yet) + .filter( + ({ directory }) => + !directory.includes(`/${KIBANA_FOLDER}/test/`) && + !directory.includes(`/${KIBANA_FOLDER}/x-pack/test/`) + ) + // the module is under the umbrella specified by the user + .filter( + (module) => + included.includes(module.id) || + teams.some((team) => belongsTo(module, team)) || + paths.some((path) => module.directory.includes(path)) + ) + // the module is not explicitly excluded + .filter(({ id }) => !excluded.includes(id)), + 'id' + ); +}; + +export const findAndMoveModule = async (moduleId: string, log: ToolingLog) => { + const modules = findModules({ teams: [], paths: [], included: [moduleId], excluded: [] }); + if (!modules.length) { + log.warning(`Cannot move ${moduleId}, either not found or not allowed!`); + } else { + await moveModule(modules[0], log); + } +}; + +export const findAndRelocateModules = async (params: RelocateModulesParams) => { + const { prNumber, log, baseBranch, ...findParams } = params; + + const toMove = findModules(findParams); + if (!toMove.length) { + log.info( + `No packages match the specified filters. Please tune your '--path' and/or '--team' and/or '--include' flags` + ); + return; + } + + relocatePlan(toMove, log); + const res1 = await inquirer.prompt({ + type: 'confirm', + name: 'confirmPlan', + message: `The script will RESET CHANGES in this repository, relocate the modules above and update references. Proceed?`, + }); + + if (!res1.confirmPlan) { + log.info('Aborting'); + return; + } + + // start with a clean repo + await safeExec(`git restore --staged .`); + await safeExec(`git restore .`); + await safeExec(`git clean -f -d`); + await safeExec(`git checkout ${baseBranch} && git pull upstream ${baseBranch}`); + + if (prNumber) { + // checkout existing PR, reset all commits, rebase from baseBranch + try { + if (!(await checkoutResetPr(baseBranch, prNumber))) { + log.info('Aborting'); + return; + } + } catch (error) { + log.error(`Error checking out / resetting PR #${prNumber}:`); + log.error(error); + return; + } + } else { + // checkout [new] branch + await checkoutBranch(NEW_BRANCH); + } + + // relocate modules + await safeExec(`yarn kbn bootstrap`); + const movedCount = await relocateModules(toMove, log); + + if (movedCount === 0) { + log.warning( + 'No modules were relocated, aborting operation to prevent force-pushing empty changes (this would close the existing PR!)' + ); + return; + } + relocateSummary(log); + + // push changes in the branch + const res2 = await inquirer.prompt({ + type: 'confirm', + name: 'pushBranch', + message: `Relocation finished! You can commit extra changes at this point. Confirm to proceed pushing the current branch`, + }); + + const pushCmd = prNumber + ? `git push --force-with-lease` + : `git push --set-upstream origin ${NEW_BRANCH}`; + + if (!res2.pushBranch) { + log.info(`Remember to push changes with "${pushCmd}"`); + return; + } + await safeExec(pushCmd); + + if (prNumber) { + await safeExec(`gh pr edit ${prNumber} -F ${DESCRIPTION} -R elastic/kibana`); + log.info(`Access the PR at: https://github.com/elastic/kibana/pull/${prNumber}`); + } else { + log.info('TIP: Run the following command to quickly create a PR:'); + log.info(`$ gh pr create -d -t "" -F ${DESCRIPTION} -R elastic/kibana`); + } +}; diff --git a/packages/kbn-relocate/transforms.ts b/packages/kbn-relocate/transforms.ts new file mode 100644 index 000000000000..72f57a24daa0 --- /dev/null +++ b/packages/kbn-relocate/transforms.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { Package } from './types'; + +type TransformFunction = (param: string) => string; +const TRANSFORMS: Record<string, string | TransformFunction> = { + 'x-pack/solutions/security/packages/security-solution/': 'x-pack/solutions/security/packages/', + 'x-pack/solutions/observability/plugins/observability_solution/': + 'x-pack/solutions/observability/plugins/', + 'x-pack/solutions/observability/packages/observability/': + 'x-pack/solutions/observability/packages/', + 'src/core/packages/core/': (path: string) => { + const relativePath = path.split('src/core/packages/')[1]; + const relativeChunks = relativePath.split('/'); + const packageName = relativeChunks.pop(); + const unneededPrefix = relativeChunks.join('-') + '-'; + + // strip the spare /core/ folder + path = path.replace('src/core/packages/core/', 'src/core/packages/'); + + if (packageName?.startsWith(unneededPrefix)) { + return path.replace(unneededPrefix, ''); + } else { + return path; + } + }, +}; +export const applyTransforms = (module: Package, path: string): string => { + const transform = Object.entries(TRANSFORMS).find(([what]) => path.includes(what)); + if (!transform) { + return path; + } else { + const [what, by] = transform; + if (typeof by === 'function') { + return by(path); + } else if (typeof by === 'string') { + return path.replace(what, by); + } else { + throw new Error('Invalid transform function', by); + } + } +}; diff --git a/packages/kbn-relocate/tsconfig.json b/packages/kbn-relocate/tsconfig.json new file mode 100644 index 000000000000..cd1126848613 --- /dev/null +++ b/packages/kbn-relocate/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/dev-cli-runner", + "@kbn/repo-info", + "@kbn/repo-packages", + "@kbn/tooling-log", + ] +} diff --git a/packages/kbn-relocate/types.ts b/packages/kbn-relocate/types.ts new file mode 100644 index 000000000000..391cef336d63 --- /dev/null +++ b/packages/kbn-relocate/types.ts @@ -0,0 +1,25 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export type { Package } from '@kbn/repo-packages'; + +export interface CommitAuthor { + login: string; +} + +export interface Commit { + messageHeadline: string; + authors: CommitAuthor[]; +} + +export interface PullRequest { + number: string; + commits: Commit[]; + headRefName: string; +} diff --git a/packages/kbn-relocate/utils.exec.ts b/packages/kbn-relocate/utils.exec.ts new file mode 100644 index 000000000000..afd9391dfcab --- /dev/null +++ b/packages/kbn-relocate/utils.exec.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import util from 'util'; +import { exec } from 'child_process'; + +export const execAsync = util.promisify(exec); + +export const safeExec = async (command: string, critical = true, log = true) => { + try { + if (log) { + // eslint-disable-next-line no-console + console.log(' >', command); + } + const result = await execAsync(command, { maxBuffer: 1024 * 1024 * 128 }); + return result; + } catch (err) { + const message = `Error executing ${command}: ${err}`; + + if (critical) { + throw err; + } + return { stdout: '', stderr: message }; + } +}; + +export const quietExec = async (command: string) => { + return await safeExec(command, false, false); +}; diff --git a/packages/kbn-relocate/utils.git.ts b/packages/kbn-relocate/utils.git.ts new file mode 100644 index 000000000000..743e6522c585 --- /dev/null +++ b/packages/kbn-relocate/utils.git.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import inquirer from 'inquirer'; +import type { Commit, PullRequest } from './types'; +import { safeExec } from './utils.exec'; + +export const findPr = async (number: string): Promise<PullRequest> => { + const res = await safeExec(`gh pr view ${number} --json commits,headRefName`); + return { ...JSON.parse(res.stdout), number }; +}; + +export function hasManualCommits(commits: Commit[]) { + const manualCommits = commits.filter( + (commit) => + !commit.messageHeadline.startsWith('Relocating module ') && + !commit.messageHeadline.startsWith('Moving modules owned by ') && + commit.authors.some((author) => author.login !== 'kibanamachine') + ); + + return manualCommits.length > 0; +} + +export async function getLastCommitMessage() { + return (await safeExec('git log -1 --pretty=%B')).stdout.split('\n')[0]; +} + +export async function resetAllCommits(numCommits: number) { + await safeExec(`git reset --hard HEAD~${numCommits}`); + + let msg = await getLastCommitMessage(); + while (msg.startsWith('Relocating module ')) { + await safeExec(`git reset --hard HEAD~1`); + msg = await getLastCommitMessage(); + } + await safeExec('git restore --staged .'); + await safeExec('git restore .'); + await safeExec('git clean -f -d'); +} + +export async function localBranchExists(branchName: string): Promise<boolean> { + const res = await safeExec('git branch -l'); + const branches = res.stdout + .split('\n') + .filter(Boolean) + .map((name) => name.trim()); + return branches.includes(branchName); +} + +async function deleteBranches(...branchNames: string[]) { + const res = await safeExec('git branch -l'); + const branches = res.stdout + .split('\n') + .filter(Boolean) + .map((branchName) => branchName.trim()); + + await Promise.all( + branchNames + .filter((toDelete) => branches.includes(toDelete)) + .map((toDelete) => safeExec(`git branch -D ${toDelete}`).catch(() => {})) + ); +} + +export const checkoutResetPr = async (baseBranch: string, prNumber: string): Promise<boolean> => { + const pr = await findPr(prNumber); + + if (hasManualCommits(pr.commits)) { + const res = await inquirer.prompt({ + type: 'confirm', + name: 'overrideManualCommits', + message: 'Detected manual commits in the PR, do you want to override them?', + }); + if (!res.overrideManualCommits) { + return false; + } + } + + // previous cleanup on current branch + await safeExec(`git restore --staged .`); + await safeExec(`git restore .`); + await safeExec(`git clean -f -d`); + + // delete existing branch + await deleteBranches(pr.headRefName); + + // checkout the PR branch + await safeExec(`gh pr checkout ${prNumber}`); + await resetAllCommits(pr.commits.length); + await safeExec(`git rebase ${baseBranch}`); + return true; +}; + +export const checkoutBranch = async (branch: string) => { + // create a new branch / PR + if (await localBranchExists(branch)) { + throw new Error('The local branch already exists, aborting!'); + } else { + await safeExec(`git checkout -b ${branch}`); + } +}; diff --git a/packages/kbn-relocate/utils.logging.ts b/packages/kbn-relocate/utils.logging.ts new file mode 100644 index 000000000000..5b290292dd75 --- /dev/null +++ b/packages/kbn-relocate/utils.logging.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import type { ToolingLog } from '@kbn/tooling-log'; +import { appendFileSync, writeFileSync } from 'fs'; +import dedent from 'dedent'; +import type { Package } from './types'; +import { calculateModuleTargetFolder } from './utils.relocate'; +import { + BASE_FOLDER, + DESCRIPTION, + GLOBAL_DESCRIPTION, + SCRIPT_ERRORS, + UPDATED_REFERENCES, + UPDATED_RELATIVE_PATHS, +} from './constants'; + +export const relocatePlan = (modules: Package[], log: ToolingLog) => { + const plugins = modules.filter((module) => module.manifest.type === 'plugin'); + const packages = modules.filter((module) => module.manifest.type !== 'plugin'); + + const target = (module: Package) => calculateModuleTargetFolder(module).replace(BASE_FOLDER, ''); + writeFileSync(DESCRIPTION, GLOBAL_DESCRIPTION); + + if (plugins.length) { + const pluginList = dedent` + \n\n#### ${plugins.length} plugin(s) are going to be relocated:\n + | Id | Target folder | + | -- | ------------- | + ${plugins.map((plg) => `| \`${plg.id}\` | \`${target(plg)}\` |`).join('\n')} + \n\n`; + + appendFileSync(DESCRIPTION, pluginList); + log.info( + `${plugins.length} plugin(s) are going to be relocated:\n${plugins + .map((plg) => `${plg.id} => ${target(plg)}`) + .join('\n')}` + ); + } + + if (packages.length) { + const packageList = dedent` + \n\n#### ${packages.length} packages(s) are going to be relocated:\n + | Id | Target folder | + | -- | ------------- | + ${packages.map((pkg) => `| \`${pkg.id}\` | \`${target(pkg)}\` |`).join('\n')} + \n\n`; + + appendFileSync(DESCRIPTION, packageList); + log.info( + `${packages.length} packages(s) are going to be relocated:\n${packages + .map((plg) => `${plg.id} => ${target(plg)}`) + .join('\n')}` + ); + } +}; + +export const appendCollapsible = ( + fileName: string, + title: string, + contents: string, + open = false +) => { + appendFileSync( + fileName, + dedent` + <details ${open ? 'open' : ''}> + <summary>${title}</summary> + + \`\`\` + ${contents} + \`\`\` + + </details>` + ); +}; + +export const relocateSummary = (log: ToolingLog) => { + if (SCRIPT_ERRORS.length > 0) { + const contents = SCRIPT_ERRORS.sort().join('\n'); + appendCollapsible(DESCRIPTION, 'Script errors', contents, true); + log.warning(`Please address the following errors:\n${contents}`); + } + + if (UPDATED_REFERENCES.size > 0) { + const contents = Array.from(UPDATED_REFERENCES).sort().join('\n'); + appendCollapsible(DESCRIPTION, 'Updated references', contents); + log.info( + `The following files have been updated to replace references to modules:\n${contents}` + ); + } + + if (UPDATED_RELATIVE_PATHS.size > 0) { + const contents = Array.from(UPDATED_RELATIVE_PATHS) + .sort() + .map((ref) => ref.replace(BASE_FOLDER, '')) + .join('\n'); + appendCollapsible(DESCRIPTION, 'Updated relative paths', contents); + log.info(`The following files contain relative paths that have been updated:\n${contents}`); + } +}; diff --git a/packages/kbn-relocate/utils.relocate.ts b/packages/kbn-relocate/utils.relocate.ts new file mode 100644 index 000000000000..c76c1f48790b --- /dev/null +++ b/packages/kbn-relocate/utils.relocate.ts @@ -0,0 +1,210 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { join } from 'path'; +import type { ToolingLog } from '@kbn/tooling-log'; +import { orderBy } from 'lodash'; +import type { Package } from './types'; +import { applyTransforms } from './transforms'; +import { + BASE_FOLDER, + BASE_FOLDER_DEPTH, + EXTENSIONS, + KIBANA_FOLDER, + NO_GREP, + SCRIPT_ERRORS, + TARGET_FOLDERS, + UPDATED_REFERENCES, + UPDATED_RELATIVE_PATHS, +} from './constants'; +import { quietExec, safeExec } from './utils.exec'; + +export const belongsTo = (module: Package, owner: string): boolean => { + return Array.from(module.manifest.owner)[0] === owner; +}; + +export const stripFirstChunk = (path: string): string => { + const chunks = path.split('/'); + chunks.shift(); + return chunks.join('/'); +}; + +export const calculateModuleTargetFolder = (module: Package): string => { + const group = module.manifest.group!; + const isPlugin = module.manifest.type === 'plugin'; + const fullPath = join(BASE_FOLDER, module.directory); + let moduleDelimiter = isPlugin ? '/plugins/' : '/packages/'; + if (TARGET_FOLDERS.some((folder) => module.directory.includes(folder)) && group === 'platform') { + // if a platform module has already been relocated, strip the /private/ or /shared/ part too + moduleDelimiter += `${module.visibility}/`; + } + const moduleFolder = fullPath.split(moduleDelimiter).pop()!; + let path: string; + + if (group === 'platform') { + if (fullPath.includes(`/${KIBANA_FOLDER}/packages/core/`)) { + // packages/core/* => src/core/packages/* + path = join(BASE_FOLDER, 'src', 'core', 'packages', moduleFolder); + } else { + const isXpack = fullPath.includes(`/${KIBANA_FOLDER}/x-pack/`); + const visibility = module.manifest.visibility!; + + path = join( + BASE_FOLDER, + isXpack ? 'x-pack' : 'src', + group, + isPlugin ? 'plugins' : 'packages', + visibility, + moduleFolder + ); + } + } else { + path = join( + BASE_FOLDER, + 'x-pack', // all solution modules are 'x-pack' + 'solutions', + group, + isPlugin ? 'plugins' : 'packages', + moduleFolder + ); + } + + // after-creation transforms + return applyTransforms(module, path); +}; + +export const replaceReferences = async (module: Package, destination: string, log: ToolingLog) => { + const dir = module.directory; + const source = + dir.startsWith(KIBANA_FOLDER) || dir.startsWith(`/${KIBANA_FOLDER}`) + ? join(BASE_FOLDER, dir) + : dir; + const relativeSource = source.replace(BASE_FOLDER, ''); + const relativeDestination = destination.replace(BASE_FOLDER, ''); + + if ( + (relativeSource.startsWith('src') && relativeDestination.startsWith('src')) || + (relativeSource.startsWith('x-pack') && relativeDestination.startsWith('x-pack')) + ) { + await replaceReferencesInternal( + stripFirstChunk(relativeSource), + stripFirstChunk(relativeDestination), + log + ); + } else { + await replaceReferencesInternal(relativeSource, relativeDestination, log); + } +}; + +const replaceReferencesInternal = async ( + relativeSource: string, + relativeDestination: string, + log: ToolingLog +) => { + log.info(`Finding and replacing "${relativeSource}" by "${relativeDestination}"`); + + const src = relativeSource.replaceAll('/', '\\/'); + const dst = relativeDestination.replaceAll('/', '\\/'); + + const result = await safeExec( + `grep -I -s -R -l ${EXTENSIONS.map((ext) => `--include="*.${ext}"`).join(' ')} \ + ${NO_GREP} "${relativeSource}"`, + false + ); + + const matchingFiles = result.stdout.split('\n').filter(Boolean); + + for (let i = 0; i < matchingFiles.length; ++i) { + const file = matchingFiles[i]; + if (file.includes('/target/types/') || file.includes('/target/public/')) { + continue; + } + + const md5Before = (await quietExec(`md5 ${file} --quiet`)).stdout.trim(); + // if we are updating packages/cloud references, we must pay attention to not update packages/cloud_defend too + await safeExec(`sed -i '' -E "/${src}[\-_a-zA-Z0-9]/! s/${src}/${dst}/g" ${file}`, false); + const md5After = (await quietExec(`md5 ${file} --quiet`)).stdout.trim(); + + if (md5Before !== md5After) { + UPDATED_REFERENCES.add(file); + } + } + + // plugins\/pluginName special treatment (.buildkite/scripts/pipelines/pull_request/pipeline.ts) + const backFwdSrc = relativeSource.replaceAll('/', `\\\\\\/`); + const backFwdDst = relativeDestination.replaceAll('/', `\\\\\\/`); + await safeExec( + `sed -i '' -E '/${src}[\-_a-zA-Z0-9]/! s/${backFwdSrc}/${backFwdDst}/g' .buildkite/scripts/pipelines/pull_request/pipeline.ts`, + false + ); +}; + +const getRelativeDepth = (directory: string): number => { + const fullPath = directory.startsWith(BASE_FOLDER) ? directory : join(BASE_FOLDER, directory); + return fullPath.split('/').length - BASE_FOLDER_DEPTH; +}; + +export const replaceRelativePaths = async ( + module: Package, + destination: string, + log: ToolingLog +) => { + log.info('Updating relative paths at fault'); + + const relativeDepthBefore = getRelativeDepth(module.directory); + const relativeDepthAfter = getRelativeDepth(destination); + const relativeDepthDiff = relativeDepthAfter - relativeDepthBefore; + + const result = await safeExec( + `grep -I -s -R -n -o ${NO_GREP} -E "\\.\\.(/\\.\\.)+/?" ${destination}`, + false + ); + const matches = result.stdout.split('\n').filter(Boolean); + + const brokenReferences = orderBy( + matches + .map((line) => line.split(':')) + .map(([path, line, match]) => { + if (match.endsWith('/')) { + match = match.substring(0, match.length - 1); + } + let moduleRelativePath = path.replace(destination, ''); + if (moduleRelativePath.startsWith('/')) { + moduleRelativePath = moduleRelativePath.substring(1); + } + const moduleRelativeDepth = moduleRelativePath.split('/').length - 1; // do not count filename + const matchDepth = match.split('/').length; + + return { path, line, moduleRelativeDepth, match, matchDepth }; + }) + .filter(({ matchDepth, moduleRelativeDepth }) => matchDepth > moduleRelativeDepth), + 'matchDepth', + 'desc' + ); + + for (let i = 0; i < brokenReferences.length; ++i) { + const { path, line, match, matchDepth } = brokenReferences[i]; + + if (path.includes('/target/types/') || path.includes('/target/public/')) { + continue; + } + const pathLine = `${path}:${line}`; + + if (UPDATED_RELATIVE_PATHS.has(pathLine)) { + const message = `Cannot replace multiple occurrences of "${match}" in the same line, please fix manually:\t${pathLine}`; + SCRIPT_ERRORS.push(message); + } else { + const escapedMatch = match.replaceAll('/', '\\/').replaceAll('.', '\\.'); // escape '.' too (regexp any char) + const escapedReplacement = new Array(matchDepth + relativeDepthDiff).fill('..').join('\\/'); + + await safeExec(`sed -i '' "${line}s/${escapedMatch}/${escapedReplacement}/" ${path}`, false); + UPDATED_RELATIVE_PATHS.add(pathLine); + } + } +}; diff --git a/packages/kbn-scout-reporting/src/reporting/playwright.ts b/packages/kbn-scout-reporting/src/reporting/playwright.ts index fdea17cb844c..98ad6655626a 100644 --- a/packages/kbn-scout-reporting/src/reporting/playwright.ts +++ b/packages/kbn-scout-reporting/src/reporting/playwright.ts @@ -23,7 +23,11 @@ import { ToolingLog } from '@kbn/tooling-log'; import { SCOUT_REPORT_OUTPUT_ROOT } from '@kbn/scout-info'; import stripANSI from 'strip-ansi'; import { REPO_ROOT } from '@kbn/repo-info'; -import { PathWithOwners, getPathsWithOwnersReversed, getCodeOwnersForFile } from '@kbn/code-owners'; +import { + type CodeOwnersEntry, + getCodeOwnersEntries, + getOwningTeamsForPath, +} from '@kbn/code-owners'; import { generateTestRunId, getTestIDForTitle, ScoutReport, ScoutReportEventAction } from '.'; import { environmentMetadata } from '../datasources'; @@ -43,7 +47,7 @@ export class ScoutPlaywrightReporter implements Reporter { readonly name: string; readonly runId: string; private report: ScoutReport; - private readonly pathsWithOwners: PathWithOwners[]; + private readonly codeOwnersEntries: CodeOwnersEntry[]; constructor(private reporterOptions: ScoutPlaywrightReporterOptions = {}) { this.log = new ToolingLog({ @@ -56,20 +60,11 @@ export class ScoutPlaywrightReporter implements Reporter { this.log.info(`Scout test run ID: ${this.runId}`); this.report = new ScoutReport(this.log); - this.pathsWithOwners = getPathsWithOwnersReversed(); + this.codeOwnersEntries = getCodeOwnersEntries(); } private getFileOwners(filePath: string): string[] { - const concatenatedOwners = getCodeOwnersForFile(filePath, this.pathsWithOwners); - - if (concatenatedOwners === undefined) { - return []; - } - - return concatenatedOwners - .replace(/#.+$/, '') - .split(',') - .filter((value) => value.length > 0); + return getOwningTeamsForPath(filePath, this.codeOwnersEntries); } /** diff --git a/packages/kbn-scout/index.ts b/packages/kbn-scout/index.ts index 5cb95662f422..733d0bae1ecd 100644 --- a/packages/kbn-scout/index.ts +++ b/packages/kbn-scout/index.ts @@ -8,7 +8,7 @@ */ export * as cli from './src/cli'; -export { expect, test, createPlaywrightConfig, createLazyPageObject } from './src/playwright'; +export { expect, test, tags, createPlaywrightConfig, createLazyPageObject } from './src/playwright'; export type { ScoutPage, ScoutPlaywrightOptions, diff --git a/packages/kbn-scout/src/config/serverless/es.serverless.config.ts b/packages/kbn-scout/src/config/serverless/es.serverless.config.ts index 89e27b4e877e..0ae2c7e6f0b3 100644 --- a/packages/kbn-scout/src/config/serverless/es.serverless.config.ts +++ b/packages/kbn-scout/src/config/serverless/es.serverless.config.ts @@ -17,6 +17,7 @@ export const servers: ScoutLoaderConfig = { serverArgs: [...defaultConfig.esTestCluster.serverArgs], }, kbnTestServer: { + ...defaultConfig.kbnTestServer, serverArgs: [ ...defaultConfig.kbnTestServer.serverArgs, '--serverless=es', diff --git a/packages/kbn-scout/src/config/serverless/oblt.serverless.config.ts b/packages/kbn-scout/src/config/serverless/oblt.serverless.config.ts index 3f283f140479..08eb4d9d7cf5 100644 --- a/packages/kbn-scout/src/config/serverless/oblt.serverless.config.ts +++ b/packages/kbn-scout/src/config/serverless/oblt.serverless.config.ts @@ -22,6 +22,7 @@ export const servers: ScoutLoaderConfig = { ], }, kbnTestServer: { + ...defaultConfig.kbnTestServer, serverArgs: [ ...defaultConfig.kbnTestServer.serverArgs, '--serverless=oblt', diff --git a/packages/kbn-scout/src/config/serverless/security.serverless.config.ts b/packages/kbn-scout/src/config/serverless/security.serverless.config.ts index f1fa4f53f898..289790a9ffeb 100644 --- a/packages/kbn-scout/src/config/serverless/security.serverless.config.ts +++ b/packages/kbn-scout/src/config/serverless/security.serverless.config.ts @@ -20,6 +20,7 @@ export const servers: ScoutLoaderConfig = { ], }, kbnTestServer: { + ...defaultConfig.kbnTestServer, serverArgs: [ ...defaultConfig.kbnTestServer.serverArgs, '--serverless=security', diff --git a/packages/kbn-scout/src/config/serverless/serverless.base.config.ts b/packages/kbn-scout/src/config/serverless/serverless.base.config.ts index 8b4852f9c9e6..a20a0c3bbe7a 100644 --- a/packages/kbn-scout/src/config/serverless/serverless.base.config.ts +++ b/packages/kbn-scout/src/config/serverless/serverless.base.config.ts @@ -80,6 +80,11 @@ export const defaultConfig: ScoutLoaderConfig = { 'xpack.security.authc.realms.jwt.jwt1.order=-98', `xpack.security.authc.realms.jwt.jwt1.pkc_jwkset_path=${getDockerFileMountPath(JWKS_PATH)}`, `xpack.security.authc.realms.jwt.jwt1.token_type=access_token`, + 'serverless.indices.validate_dot_prefixes=true', + // controller cluster-settings + `cluster.service.slow_task_logging_threshold=15s`, + `cluster.service.slow_task_thread_dump_timeout=5s`, + `serverless.search.enable_replicas_for_instant_failover=true`, ], ssl: true, // SSL is required for SAML realm }, @@ -136,7 +141,15 @@ export const defaultConfig: ScoutLoaderConfig = { // This ensures that we register the Security SAML API endpoints. // In the real world the SAML config is injected by control plane. `--plugin-path=${SAML_IDP_PLUGIN_PATH}`, + '--xpack.cloud.base_url=https://fake-cloud.elastic.co', + '--xpack.cloud.billing_url=/billing/overview/', + '--xpack.cloud.deployments_url=/deployments', '--xpack.cloud.id=ftr_fake_cloud_id', + '--xpack.cloud.organization_url=/account/', + '--xpack.cloud.profile_url=/user/settings/', + '--xpack.cloud.projects_url=/projects/', + '--xpack.cloud.serverless.project_id=fakeprojectid', + '--xpack.cloud.users_and_roles_url=/account/members/', // Ensure that SAML is used as the default authentication method whenever a user navigates to Kibana. In other // words, Kibana should attempt to authenticate the user using the provider with the lowest order if the Login // Selector is disabled (which is how Serverless Kibana is configured). By declaring `cloud-basic` with a higher diff --git a/packages/kbn-scout/src/playwright/fixtures/test/index.ts b/packages/kbn-scout/src/playwright/fixtures/test/index.ts index 41bfedcf39dc..3e2ea85b90bc 100644 --- a/packages/kbn-scout/src/playwright/fixtures/test/index.ts +++ b/packages/kbn-scout/src/playwright/fixtures/test/index.ts @@ -11,9 +11,11 @@ import { mergeTests } from '@playwright/test'; import { browserAuthFixture } from './browser_auth'; import { scoutPageFixture } from './page'; import { pageObjectsFixture } from './page_objects'; +import { validateTagsFixture } from './validate_tags'; export const scoutTestFixtures = mergeTests( browserAuthFixture, scoutPageFixture, - pageObjectsFixture + pageObjectsFixture, + validateTagsFixture ); diff --git a/packages/kbn-scout/src/playwright/fixtures/test/validate_tags.ts b/packages/kbn-scout/src/playwright/fixtures/test/validate_tags.ts new file mode 100644 index 000000000000..1866935440e1 --- /dev/null +++ b/packages/kbn-scout/src/playwright/fixtures/test/validate_tags.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { test as base } from '@playwright/test'; +import { tags } from '../../tags'; + +const supportedTags = tags.DEPLOYMENT_AGNOSTIC; + +export const validateTagsFixture = base.extend<{ validateTags: void }>({ + validateTags: [ + async ({}, use, testInfo) => { + if (testInfo.tags.length === 0) { + throw new Error(`At least one tag is required: ${supportedTags.join(', ')}`); + } + + const invalidTags = testInfo.tags.filter((tag: string) => !supportedTags.includes(tag)); + if (invalidTags.length > 0) { + throw new Error( + `Unsupported tag(s) found in test suite "${testInfo.title}": ${invalidTags.join( + ', ' + )}. ` + `Supported tags are: ${supportedTags.join(', ')}.` + ); + } + + await use(); + }, + { auto: true }, + ], +}); diff --git a/packages/kbn-scout/src/playwright/index.ts b/packages/kbn-scout/src/playwright/index.ts index 5294274c41bc..0a82bc0468fc 100644 --- a/packages/kbn-scout/src/playwright/index.ts +++ b/packages/kbn-scout/src/playwright/index.ts @@ -25,3 +25,6 @@ export type { ScoutPage, EsArchiverFixture, } from './fixtures'; + +// use to tag tests +export { tags } from './tags'; diff --git a/packages/kbn-scout/src/playwright/runner/run_tests.ts b/packages/kbn-scout/src/playwright/runner/run_tests.ts index a5d8aa137dbf..766209f16996 100644 --- a/packages/kbn-scout/src/playwright/runner/run_tests.ts +++ b/packages/kbn-scout/src/playwright/runner/run_tests.ts @@ -18,12 +18,14 @@ import { loadServersConfig } from '../../config'; import { silence } from '../../common'; import { RunTestsOptions } from './flags'; import { getExtraKbnOpts } from '../../servers/run_kibana_server'; +import { getPlaywrightGrepTag } from '../utils'; export async function runTests(log: ToolingLog, options: RunTestsOptions) { const runStartTime = Date.now(); - const reportTime = getTimeReporter(log, 'scripts/scout_test'); + const reportTime = getTimeReporter(log, 'scripts/scout run-tests'); const config = await loadServersConfig(options.mode, log); + const playwrightGrepTag = getPlaywrightGrepTag(config); const playwrightConfigPath = options.configPath; await withProcRunner(log, async (procs) => { @@ -59,7 +61,12 @@ export async function runTests(log: ToolingLog, options: RunTestsOptions) { // Running 'npx playwright test --config=${playwrightConfigPath}' await procs.run(`playwright`, { cmd: resolve(REPO_ROOT, './node_modules/.bin/playwright'), - args: ['test', `--config=${playwrightConfigPath}`, ...(options.headed ? ['--headed'] : [])], + args: [ + 'test', + `--config=${playwrightConfigPath}`, + `--grep=${playwrightGrepTag}`, + ...(options.headed ? ['--headed'] : []), + ], cwd: resolve(REPO_ROOT), env: { ...process.env, diff --git a/packages/kbn-scout/src/playwright/tags.ts b/packages/kbn-scout/src/playwright/tags.ts new file mode 100644 index 000000000000..a022b6afd343 --- /dev/null +++ b/packages/kbn-scout/src/playwright/tags.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +const SERVERLESS_ONLY = ['@svlSecurity', '@svlOblt', '@svlSearch']; +const ESS_ONLY = ['@ess']; +const DEPLOYMENT_AGNOSTIC = SERVERLESS_ONLY.concat(ESS_ONLY); + +export const tags = { + ESS_ONLY, + SERVERLESS_ONLY, + DEPLOYMENT_AGNOSTIC, +}; + +export const tagsByMode = { + stateful: '@ess', + serverless: { + es: '@svlSearch', + oblt: '@svlOblt', + security: '@svlSecurity', + }, +}; diff --git a/packages/kbn-scout/src/playwright/utils/index.ts b/packages/kbn-scout/src/playwright/utils/index.ts index 4b6fcafcbcfa..8956c6d7cc18 100644 --- a/packages/kbn-scout/src/playwright/utils/index.ts +++ b/packages/kbn-scout/src/playwright/utils/index.ts @@ -8,6 +8,8 @@ */ import moment from 'moment'; +import { Config } from '../../config'; +import { tagsByMode } from '../tags'; export const serviceLoadedMsg = (name: string) => `scout service loaded: ${name}`; @@ -18,3 +20,10 @@ export const isValidUTCDate = (date: string): boolean => { export function formatTime(date: string, fmt: string = 'MMM D, YYYY @ HH:mm:ss.SSS') { return moment.utc(date, fmt).format(); } + +export const getPlaywrightGrepTag = (config: Config): string => { + const serversConfig = config.getTestServersConfig(); + return serversConfig.serverless + ? tagsByMode.serverless[serversConfig.projectType!] + : tagsByMode.stateful; +}; diff --git a/packages/kbn-scout/src/types/config.d.ts b/packages/kbn-scout/src/types/config.d.ts index 2f0c3a764d65..08c4bc5f3f9b 100644 --- a/packages/kbn-scout/src/types/config.d.ts +++ b/packages/kbn-scout/src/types/config.d.ts @@ -25,9 +25,9 @@ export interface ScoutLoaderConfig { ssl: boolean; }; kbnTestServer: { - env?: any; - buildArgs?: string[]; - sourceArgs?: string[]; + env: any; + buildArgs: string[]; + sourceArgs: string[]; serverArgs: string[]; useDedicatedTestRunner?: boolean; }; diff --git a/packages/kbn-search-response-warnings/src/handle_warnings.tsx b/packages/kbn-search-response-warnings/src/handle_warnings.tsx index 95ce6e2b112a..7287c3185cc5 100644 --- a/packages/kbn-search-response-warnings/src/handle_warnings.tsx +++ b/packages/kbn-search-response-warnings/src/handle_warnings.tsx @@ -14,6 +14,7 @@ import type { AnalyticsServiceStart, NotificationsStart, ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import { toMountPoint } from '@kbn/react-kibana-mount'; import type { I18nStart } from '@kbn/core-i18n-browser'; @@ -36,6 +37,7 @@ interface Services { inspector: InspectorStart; notifications: NotificationsStart; theme: ThemeServiceStart; + userProfile: UserProfileService; } /** diff --git a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts index 49a4b0d5eb40..942ccbc29c38 100644 --- a/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts +++ b/packages/kbn-securitysolution-autocomplete/src/es_field_selector/__tests__/use_es_field.test.ts @@ -9,11 +9,7 @@ import { DataViewFieldBase } from '@kbn/es-query'; import { ReactElement } from 'react'; -import { act } from '@testing-library/react'; - -import { renderHook } from '@testing-library/react-hooks'; -import TestRenderer from 'react-test-renderer'; -const { act: actTestRenderer } = TestRenderer; +import { act, renderHook } from '@testing-library/react'; import { fields } from '../../fields/index.mock'; import { useEsField } from '../use_es_field'; @@ -480,7 +476,7 @@ describe('useField', () => { useEsField({ indexPattern, onChange: onChangeMock, isRequired: true }) ); - actTestRenderer(() => { + act(() => { result.current.handleTouch(); }); expect(result.current.isInvalid).toBeTruthy(); @@ -490,7 +486,7 @@ describe('useField', () => { useEsField({ indexPattern, onChange: onChangeMock, isRequired: true, selectedField }) ); - actTestRenderer(() => { + act(() => { result.current.handleTouch(); }); expect(result.current.isInvalid).toBeFalsy(); @@ -498,7 +494,7 @@ describe('useField', () => { it('should return isInvalid equals false when isRequired is false', () => { const { result } = renderHook(() => useEsField({ indexPattern, onChange: onChangeMock })); - actTestRenderer(() => { + act(() => { result.current.handleTouch(); }); expect(result.current.isInvalid).toBeFalsy(); diff --git a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts index aae858aa6308..836744f3ede2 100644 --- a/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts +++ b/packages/kbn-securitysolution-autocomplete/src/hooks/use_field_value_autocomplete/index.test.ts @@ -7,14 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { ListOperatorTypeEnum as OperatorTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn, - useFieldValueAutocomplete, -} from '.'; +import { UseFieldValueAutocompleteReturn, useFieldValueAutocomplete } from '.'; import { getField } from '../../fields/index.mock'; import { autocompleteStartMock } from '../../autocomplete/index.mock'; import { DataViewFieldBase } from '@kbn/es-query'; @@ -46,140 +42,115 @@ describe('use_field_value_autocomplete', () => { }); test('initializes hook', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: undefined, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: undefined, - }) - ); - await waitForNextUpdate(); - - expect(result.current).toEqual([false, true, [], result.current[3]]); - }); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: undefined, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: undefined, + }) + ); + await waitFor(() => expect(result.current).toEqual([false, true, [], result.current[3]])); }); test('does not call autocomplete service if "operatorType" is "exists"', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: getField('machine.os'), - }) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: getField('machine.os'), + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); }); }); test('does not call autocomplete service if "selectedField" is undefined', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: undefined, - }) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: undefined, + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); }); }); test('does not call autocomplete service if "indexPattern" is undefined', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: undefined, - operatorType: OperatorTypeEnum.EXISTS, - query: '', - selectedField: getField('machine.os'), - }) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: undefined, + operatorType: OperatorTypeEnum.EXISTS, + query: '', + selectedField: getField('machine.os'), + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [false, true, [], result.current[3]]; - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); }); }); test('it uses full path name for nested fields to fetch suggestions', async () => { const suggestionsMock = jest.fn().mockResolvedValue([]); - await act(async () => { - const selectedField: DataViewFieldBase | undefined = getField('nestedField.child'); - if (selectedField == null) { - throw new TypeError('selectedField for this test should always be defined'); - } - - const { signal } = new AbortController(); - const { waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: suggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: { ...selectedField, name: 'child' }, - }) - ); - // Note: initial `waitForNextUpdate` is hook initialization - await waitForNextUpdate(); - await waitForNextUpdate(); + const selectedField: DataViewFieldBase | undefined = getField('nestedField.child'); + if (selectedField == null) { + throw new TypeError('selectedField for this test should always be defined'); + } + + const { signal } = new AbortController(); + renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: suggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: { ...selectedField, name: 'child' }, + }) + ); + await waitFor(() => expect(suggestionsMock).toHaveBeenCalledWith({ field: { ...getField('nestedField.child'), name: 'nestedField.child' }, indexPattern: { @@ -199,63 +170,51 @@ describe('use_field_value_autocomplete', () => { query: '', signal, useTimeRange: false, - }); - }); + }) + ); }); test('returns "isSuggestingValues" of false if field type is boolean', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('ssl'), - }) - ); - // Note: initial `waitForNextUpdate` is hook initialization - await waitForNextUpdate(); - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('ssl'), + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; - expect(getValueSuggestionsMock).not.toHaveBeenCalled(); expect(result.current).toEqual(expectedResult); + expect(getValueSuggestionsMock).not.toHaveBeenCalled(); }); }); test('returns "isSuggestingValues" of false to note that autocomplete service is not in use if no autocomplete suggestions available', async () => { const suggestionsMock = jest.fn().mockResolvedValue([]); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: suggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('bytes'), - }) - ); - // Note: initial `waitForNextUpdate` is hook initialization - await waitForNextUpdate(); - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: suggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('bytes'), + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [false, false, [], result.current[3]]; expect(suggestionsMock).toHaveBeenCalled(); @@ -264,28 +223,22 @@ describe('use_field_value_autocomplete', () => { }); test('returns suggestions', async () => { - await act(async () => { - const { signal } = new AbortController(); - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('@tags'), - }) - ); - // Note: initial `waitForNextUpdate` is hook initialization - await waitForNextUpdate(); - await waitForNextUpdate(); + const { signal } = new AbortController(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('@tags'), + }) + ); + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [ false, true, @@ -305,42 +258,34 @@ describe('use_field_value_autocomplete', () => { }); test('returns new suggestions on subsequent calls', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseFieldValueAutocompleteProps, - UseFieldValueAutocompleteReturn - >(() => - useFieldValueAutocomplete({ - autocompleteService: { - ...autocompleteStartMock, - getValueSuggestions: getValueSuggestionsMock, - }, - fieldValue: '', - indexPattern: stubIndexPatternWithFields, - operatorType: OperatorTypeEnum.MATCH, - query: '', - selectedField: getField('@tags'), - }) - ); - // Note: initial `waitForNextUpdate` is hook initialization - await waitForNextUpdate(); - await waitForNextUpdate(); - - expect(result.current[3]).not.toBeNull(); - - // Added check for typescripts sake, if null, - // would not reach below logic as test would stop above - if (result.current[3] != null) { - result.current[3]({ - fieldSelected: getField('@tags'), - patterns: stubIndexPatternWithFields, - searchQuery: '', - value: 'hello', - }); - } - - await waitForNextUpdate(); + const { result } = renderHook(() => + useFieldValueAutocomplete({ + autocompleteService: { + ...autocompleteStartMock, + getValueSuggestions: getValueSuggestionsMock, + }, + fieldValue: '', + indexPattern: stubIndexPatternWithFields, + operatorType: OperatorTypeEnum.MATCH, + query: '', + selectedField: getField('@tags'), + }) + ); + + await waitFor(() => expect(result.current[3]).not.toBeNull()); + + // Added check for typescripts sake, if null, + // would not reach below logic as test would stop above + if (result.current[3] != null) { + result.current[3]({ + fieldSelected: getField('@tags'), + patterns: stubIndexPatternWithFields, + searchQuery: '', + value: 'hello', + }); + } + await waitFor(() => { const expectedResult: UseFieldValueAutocompleteReturn = [ false, true, diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml index 366efe23d586..2aac93167d2a 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/ess/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml @@ -846,9 +846,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object diff --git a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml index 0ecce40ef34d..1257b37622ad 100644 --- a/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-endpoint-exceptions-common/docs/openapi/serverless/security_solution_endpoint_exceptions_api_2023_10_31.bundled.schema.yaml @@ -846,9 +846,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object diff --git a/packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts b/packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts index 99c6ffc3d05b..29e526350be6 100644 --- a/packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts +++ b/packages/kbn-securitysolution-es-utils/src/get_index_aliases/index.ts @@ -20,26 +20,30 @@ interface IndexAlias { * * @param esClient An {@link ElasticsearchClient} * @param alias alias name used to filter results + * @param index index name used to filter results * * @returns an array of {@link IndexAlias} objects */ export const getIndexAliases = async ({ esClient, alias, + index, }: { esClient: ElasticsearchClient; alias: string; + index?: string; }): Promise<IndexAlias[]> => { const response = await esClient.indices.getAlias( { name: alias, + ...(index ? { index } : {}), }, { meta: true } ); - return Object.keys(response.body).map((index) => ({ + return Object.keys(response.body).map((indexName) => ({ alias, - index, - isWriteIndex: response.body[index].aliases[alias]?.is_write_index === true, + index: indexName, + isWriteIndex: response.body[indexName].aliases[alias]?.is_write_index === true, })); }; diff --git a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts index cd3e9d8ab581..5c04c8772714 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/exception_item_card/use_exception_item_card.test.ts @@ -8,7 +8,7 @@ */ import { ExceptionListTypeEnum } from '@kbn/securitysolution-io-ts-list-types'; -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { getExceptionListItemSchemaMock } from '../mocks/exception_list_item_schema.mock'; import { useExceptionItemCard } from './use_exception_item_card'; import * as i18n from './translations'; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts b/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts index e98263779120..65b532a55c83 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/edit_modal/use_edit_modal.test.ts @@ -8,7 +8,7 @@ */ import { ChangeEvent, SyntheticEvent } from 'react'; -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { useEditModal } from './use_edit_modal'; const listDetails = { name: 'test-name', description: 'test-description' }; diff --git a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts b/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts index d3c17a4aefc4..e16681d2b184 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/list_header/use_list_header.test.ts @@ -7,8 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { waitFor } from '@testing-library/react'; -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { useExceptionListHeader } from './use_list_header'; describe('useExceptionListHeader', () => { diff --git a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts b/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts index f05066bb6149..e90408f1e161 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/pagination/use_pagination.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { usePagination } from './use_pagination'; const onPaginationChange = jest.fn(); diff --git a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts b/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts index ab0c87c110df..51954c0140e6 100644 --- a/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts +++ b/packages/kbn-securitysolution-exception-list-components/src/value_with_space_warning/use_value_with_space_warning.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useValueWithSpaceWarning } from './use_value_with_space_warning'; describe('useValueWithSpaceWarning', () => { diff --git a/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml index bf290e872f91..c4f44ca0e85f 100644 --- a/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-exceptions-common/docs/openapi/ess/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml @@ -1846,9 +1846,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object @@ -1899,9 +1899,55 @@ components: security: - BasicAuth: [] tags: - - 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. + - description: > + Exceptions are associated with detection and endpoint rules, and are used + to prevent a rule from generating an alert from incoming events, even when + the rule's other criteria are met. They can help reduce the number of + false positives and prevent trusted processes and network activity from + generating unnecessary alerts. + + + Exceptions are made up of: + + + * **Exception containers**: A container for related exceptions. Generally, + a single exception container contains all the exception items relevant for + a subset of rules. For example, a container can be used to group together + network-related exceptions that are relevant for a large number of network + rules. The container can then be associated with all the relevant rules. + + * **Exception items**: The query (fields, values, and logic) used to + prevent rules from generating alerts. When an exception item's query + evaluates to `true`, the rule does not generate an alert. + + + For detection rules, you can also use lists to define rule exceptions. A + list holds multiple values of the same Elasticsearch data type, such as IP + addresses. These values are used to determine when an exception prevents + an alert from being generated. + + > info + + > You cannot use lists with endpoint rule exceptions. + + + > info + + > Only exception containers can be associated with rules. You cannot + directly associate an exception item or a list container with a rule. To + use list exceptions, create an exception item that references the relevant + list container. + + + ## Exceptions requirements + + + Before you can start working with exceptions that use value lists, you + must create the `.lists` and `.items` data streams for the relevant Kibana + space. To do this, use the [Create list data + streams](../operation/operation-createlistindex) endpoint. Once these data + streams are created, your role needs privileges to manage rules. For a + complete list of requirements, refer to [Enable and access + detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui). name: Security Exceptions API x-displayName: Security exceptions diff --git a/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml index 115658261c90..c686d57b725f 100644 --- a/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-exceptions-common/docs/openapi/serverless/security_solution_exceptions_api_2023_10_31.bundled.schema.yaml @@ -1846,9 +1846,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object @@ -1899,9 +1899,55 @@ components: security: - BasicAuth: [] tags: - - 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. + - description: > + Exceptions are associated with detection and endpoint rules, and are used + to prevent a rule from generating an alert from incoming events, even when + the rule's other criteria are met. They can help reduce the number of + false positives and prevent trusted processes and network activity from + generating unnecessary alerts. + + + Exceptions are made up of: + + + * **Exception containers**: A container for related exceptions. Generally, + a single exception container contains all the exception items relevant for + a subset of rules. For example, a container can be used to group together + network-related exceptions that are relevant for a large number of network + rules. The container can then be associated with all the relevant rules. + + * **Exception items**: The query (fields, values, and logic) used to + prevent rules from generating alerts. When an exception item's query + evaluates to `true`, the rule does not generate an alert. + + + For detection rules, you can also use lists to define rule exceptions. A + list holds multiple values of the same Elasticsearch data type, such as IP + addresses. These values are used to determine when an exception prevents + an alert from being generated. + + > info + + > You cannot use lists with endpoint rule exceptions. + + + > info + + > Only exception containers can be associated with rules. You cannot + directly associate an exception item or a list container with a rule. To + use list exceptions, create an exception item that references the relevant + list container. + + + ## Exceptions requirements + + + Before you can start working with exceptions that use value lists, you + must create the `.lists` and `.items` data streams for the relevant Kibana + space. To do this, use the [Create list data + streams](../operation/operation-createlistindex) endpoint. Once these data + streams are created, your role needs privileges to manage rules. For a + complete list of requirements, refer to [Enable and access + detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui). name: Security Exceptions API x-displayName: Security exceptions diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js index 83c84d91daaf..70299e56eac2 100644 --- a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js +++ b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle.js @@ -22,21 +22,7 @@ const ROOT = resolve(__dirname, '..'); ), options: { includeLabels: ['serverless'], - prototypeDocument: { - info: { - title: 'Security Exceptions API (Elastic Cloud Serverless)', - 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.", - }, - tags: [ - { - name: 'Security Exceptions API', - 'x-displayName': 'Security exceptions', - 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.", - }, - ], - }, + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_serverless.info.yaml'), }, }); @@ -48,21 +34,7 @@ const ROOT = resolve(__dirname, '..'); ), options: { includeLabels: ['ess'], - prototypeDocument: { - info: { - title: 'Security Exceptions API (Elastic Cloud and self-hosted)', - 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.", - }, - tags: [ - { - name: 'Security Exceptions API', - 'x-displayName': 'Security exceptions', - 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.", - }, - ], - }, + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/exceptions_ess.info.yaml'), }, }); })(); diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml new file mode 100644 index 000000000000..855870c444c7 --- /dev/null +++ b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_ess.info.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.3 +info: + title: "Security Exceptions API (Elastic Cloud and self-hosted)" + 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." + +tags: + - name: "Security Exceptions API" + x-displayName: "Security exceptions" + description: | + Exceptions are associated with detection and endpoint rules, and are used to prevent a rule from generating an alert from incoming events, even when the rule's other criteria are met. They can help reduce the number of false positives and prevent trusted processes and network activity from generating unnecessary alerts. + + Exceptions are made up of: + + * **Exception containers**: A container for related exceptions. Generally, a single exception container contains all the exception items relevant for a subset of rules. For example, a container can be used to group together network-related exceptions that are relevant for a large number of network rules. The container can then be associated with all the relevant rules. + * **Exception items**: The query (fields, values, and logic) used to prevent rules from generating alerts. When an exception item's query evaluates to `true`, the rule does not generate an alert. + + For detection rules, you can also use lists to define rule exceptions. A list holds multiple values of the same Elasticsearch data type, such as IP addresses. These values are used to determine when an exception prevents an alert from being generated. + > info + > You cannot use lists with endpoint rule exceptions. + + > info + > Only exception containers can be associated with rules. You cannot directly associate an exception item or a list container with a rule. To use list exceptions, create an exception item that references the relevant list container. + + ## Exceptions requirements + + Before you can start working with exceptions that use value lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. For a complete list of requirements, refer to [Enable and access detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui). diff --git a/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml new file mode 100644 index 000000000000..a8894d997be9 --- /dev/null +++ b/packages/kbn-securitysolution-exceptions-common/scripts/openapi_bundle_info/exceptions_serverless.info.yaml @@ -0,0 +1,26 @@ +openapi: 3.0.3 +info: + title: "Security Exceptions API (Elastic Cloud Serverless)" + 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." + +tags: + - name: "Security Exceptions API" + x-displayName: "Security exceptions" + description: | + Exceptions are associated with detection and endpoint rules, and are used to prevent a rule from generating an alert from incoming events, even when the rule's other criteria are met. They can help reduce the number of false positives and prevent trusted processes and network activity from generating unnecessary alerts. + + Exceptions are made up of: + + * **Exception containers**: A container for related exceptions. Generally, a single exception container contains all the exception items relevant for a subset of rules. For example, a container can be used to group together network-related exceptions that are relevant for a large number of network rules. The container can then be associated with all the relevant rules. + * **Exception items**: The query (fields, values, and logic) used to prevent rules from generating alerts. When an exception item's query evaluates to `true`, the rule does not generate an alert. + + For detection rules, you can also use lists to define rule exceptions. A list holds multiple values of the same Elasticsearch data type, such as IP addresses. These values are used to determine when an exception prevents an alert from being generated. + > info + > You cannot use lists with endpoint rule exceptions. + + > info + > Only exception containers can be associated with rules. You cannot directly associate an exception item or a list container with a rule. To use list exceptions, create an exception item that references the relevant list container. + + ## Exceptions requirements + + Before you can start working with exceptions that use value lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. For a complete list of requirements, refer to [Enable and access detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui). diff --git a/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts index a9f02622df30..99417c1fe329 100644 --- a/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts +++ b/packages/kbn-securitysolution-hook-utils/src/use_async/index.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { useAsync } from '.'; @@ -20,8 +20,8 @@ type TestReturn = Promise<unknown>; describe('useAsync', () => { /** - * Timeout for both jest tests and for the waitForNextUpdate. - * jest tests default to 5 seconds and waitForNextUpdate defaults to 1 second. + * Timeout for both jest tests and for the waitFor. + * jest tests default to 5 seconds and waitFor defaults to 1 second. * 20_0000 = 20,000 milliseconds = 20 seconds */ const timeout = 20_000; @@ -42,43 +42,42 @@ describe('useAsync', () => { it( 'invokes the function when start is called', async () => { - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); act(() => { result.current.start(args); }); - await waitForNextUpdate({ timeout }); - - expect(fn).toHaveBeenCalled(); + await waitFor(() => expect(fn).toHaveBeenCalled(), { timeout }); }, timeout ); it('invokes the function with start args', async () => { - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); const expectedArgs = { ...args }; act(() => { result.current.start(args); }); - await waitForNextUpdate({ timeout }); - - expect(fn).toHaveBeenCalledWith(expectedArgs); + await waitFor(() => expect(fn).toHaveBeenCalledWith(expectedArgs), { timeout }); }); it( 'populates result with the resolved value of the fn', async () => { - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); fn.mockResolvedValue({ resolved: 'value' }); act(() => { result.current.start(args); }); - await waitForNextUpdate({ timeout }); - - expect(result.current.result).toEqual({ resolved: 'value' }); - expect(result.current.error).toBeUndefined(); + await waitFor( + () => { + expect(result.current.result).toEqual({ resolved: 'value' }); + expect(result.current.error).toBeUndefined(); + }, + { timeout } + ); }, timeout ); @@ -87,15 +86,19 @@ describe('useAsync', () => { 'populates error if function rejects', async () => { fn.mockRejectedValue(new Error('whoops')); - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); act(() => { result.current.start(args); }); - await waitForNextUpdate({ timeout }); - expect(result.current.result).toBeUndefined(); - expect(result.current.error).toEqual(new Error('whoops')); + await waitFor( + () => { + expect(result.current.result).toBeUndefined(); + expect(result.current.error).toEqual(new Error('whoops')); + }, + { timeout } + ); }, timeout ); @@ -106,7 +109,7 @@ describe('useAsync', () => { let resolve: () => void; fn.mockImplementation(() => new Promise<void>((_resolve) => (resolve = _resolve))); - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); act(() => { result.current.start(args); @@ -115,9 +118,7 @@ describe('useAsync', () => { expect(result.current.loading).toBe(true); act(() => resolve()); - await waitForNextUpdate({ timeout }); - - expect(result.current.loading).toBe(false); + await waitFor(() => expect(result.current.loading).toBe(false), { timeout }); }, timeout ); @@ -128,7 +129,7 @@ describe('useAsync', () => { let resolve: (result: string) => void; fn.mockImplementation(() => new Promise((_resolve) => (resolve = _resolve))); - const { result, waitForNextUpdate } = renderHook(() => useAsync(fn)); + const { result } = renderHook(() => useAsync(fn)); act(() => { result.current.start(args); @@ -137,10 +138,13 @@ describe('useAsync', () => { expect(result.current.loading).toBe(true); act(() => resolve('result')); - await waitForNextUpdate({ timeout }); - - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('result'); + await waitFor( + () => { + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('result'); + }, + { timeout } + ); act(() => { result.current.start(args); @@ -149,10 +153,13 @@ describe('useAsync', () => { expect(result.current.loading).toBe(true); expect(result.current.result).toBe(undefined); act(() => resolve('result')); - await waitForNextUpdate({ timeout }); - - expect(result.current.loading).toBe(false); - expect(result.current.result).toBe('result'); + await waitFor( + () => { + expect(result.current.loading).toBe(false); + expect(result.current.result).toBe('result'); + }, + { timeout } + ); }, timeout ); diff --git a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts index 3435fc838382..a8013a65441c 100644 --- a/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts +++ b/packages/kbn-securitysolution-hook-utils/src/use_is_mounted/index.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useIsMounted } from '.'; diff --git a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts b/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts index d0608c5d1017..8d90bffeb3ee 100644 --- a/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts +++ b/packages/kbn-securitysolution-hook-utils/src/use_observable/index.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { Subject, throwError } from 'rxjs'; import { useObservable } from '.'; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts index c4464704b7cd..ca94eda81f95 100644 --- a/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts +++ b/packages/kbn-securitysolution-list-hooks/src/use_cursor/index.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { UseCursorProps, useCursor } from '.'; diff --git a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts b/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts index fa68009be9d9..fcce54ac3be3 100644 --- a/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts +++ b/packages/kbn-securitysolution-list-hooks/src/use_find_lists/index.test.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { useFindLists } from '.'; import { httpServiceMock } from '@kbn/core-http-browser-mocks'; @@ -26,14 +26,14 @@ describe('useFindLists', () => { }); it('invokes Api.findLists', async () => { - const { result, waitForNextUpdate } = renderHook(() => useFindLists()); + const { result } = renderHook(() => useFindLists()); act(() => { result.current.start({ http: httpMock, pageIndex: 1, pageSize: 10 }); }); - await waitForNextUpdate(); - - expect(Api.findLists).toHaveBeenCalledWith( - expect.objectContaining({ http: httpMock, pageIndex: 1, pageSize: 10 }) + await waitFor(() => + expect(Api.findLists).toHaveBeenCalledWith( + expect.objectContaining({ http: httpMock, pageIndex: 1, pageSize: 10 }) + ) ); }); }); diff --git a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts index e5166dc3f0f9..79f8748345fd 100644 --- a/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts +++ b/packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { Dispatch, useEffect, useState } from 'react'; +import { Dispatch, useEffect, useRef, useState } from 'react'; import type { CreateExceptionListItemSchema, PersistHookProps, @@ -47,57 +47,63 @@ export const usePersistExceptionItem = ({ const [isLoading, setIsLoading] = useState(false); const isUpdateExceptionItem = (item: unknown): item is UpdateExceptionListItemSchema => Boolean(item && (item as UpdateExceptionListItemSchema).id != null); + const isSubscribed = useRef(false); useEffect(() => { - let isSubscribed = true; - const abortCtrl = new AbortController(); + let abortCtrl: AbortController | null = null; + isSubscribed.current = true; setIsSaved(false); const saveExceptionItem = async (): Promise<void> => { - if (exceptionListItem != null) { - try { - setIsLoading(true); - - if (isUpdateExceptionItem(exceptionListItem)) { - // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes - // for context around the temporary `id` - const transformedList = transformOutput(exceptionListItem); - - await updateExceptionListItem({ - http, - listItem: transformedList, - signal: abortCtrl.signal, - }); - } else { - // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes - // for context around the temporary `id` - const transformedList = transformNewItemOutput(exceptionListItem); - - await addExceptionListItem({ - http, - listItem: transformedList, - signal: abortCtrl.signal, - }); - } - - if (isSubscribed) { - setIsSaved(true); - } - } catch (error) { - if (isSubscribed) { - onError(error); - } + if (exceptionListItem === null) { + return; + } + + try { + abortCtrl = new AbortController(); + setIsLoading(true); + + if (isUpdateExceptionItem(exceptionListItem)) { + // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes + // for context around the temporary `id` + const transformedList = transformOutput(exceptionListItem); + + await updateExceptionListItem({ + http, + listItem: transformedList, + signal: abortCtrl.signal, + }); + } else { + // Please see `x-pack/plugins/lists/public/exceptions/transforms.ts` doc notes + // for context around the temporary `id` + const transformedList = transformNewItemOutput(exceptionListItem); + + await addExceptionListItem({ + http, + listItem: transformedList, + signal: abortCtrl.signal, + }); } - if (isSubscribed) { + + if (isSubscribed.current) { + setIsSaved(true); + } + } catch (error) { + if (isSubscribed.current) { + onError(error); + } + } finally { + if (isSubscribed.current) { setIsLoading(false); } } }; saveExceptionItem(); + return (): void => { - isSubscribed = false; - abortCtrl.abort(); + isSubscribed.current = false; + abortCtrl?.abort(); }; }, [http, exceptionListItem, onError]); diff --git a/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml index 17eef19505e4..a8324753a679 100644 --- a/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-lists-common/docs/openapi/ess/security_solution_lists_api_2023_10_31.bundled.schema.yaml @@ -1528,9 +1528,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object @@ -1562,6 +1562,79 @@ components: security: - BasicAuth: [] tags: - - description: Lists API allows you to manage lists of keywords, IPs or IP ranges items. + - description: > + Lists can be used with detection rule exceptions to define values that + prevent a rule from generating alerts. + + + Lists are made up of: + + + * **List containers**: A container for values of the same Elasticsearch + data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception + prevents an alert from being generated. + + + All list items in the same list container must be of the same data type, + and each item defines a single value. For example, an IP list container + named `internal-ip-addresses-southport` contains five items, where each + item defines one internal IP address: + + 1. `192.168.1.1` + + 2. `192.168.1.3` + + 3. `192.168.1.18` + + 4. `192.168.1.12` + + 5. `192.168.1.7` + + + To use these IP addresses as values for defining rule exceptions, use the + Security exceptions API to [create an exception list + item](../operation/operation-createexceptionlistitem) that references the + `internal-ip-addresses-southport` list. + + > info + + > Lists cannot be added directly to rules, nor do they define the + operators used to determine when exceptions are applied (`is in list`, `is + not in list`). Use an exception item to define the operator and associate + it with an [exception + container](../operation/operation-createexceptionlist). You can then add + the exception container to a rule's `exceptions_list` object. + + + ## Lists requirements + + + Before you can start using lists, you must create the `.lists` and + `.items` data streams for the relevant Kibana space. To do this, use the + [Create list data streams](../operation/operation-createlistindex) + endpoint. Once these data streams are created, your role needs privileges + to manage rules. Refer to [Enable and access + detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui) + for a complete list of requirements. name: Security Lists API x-displayName: Security lists diff --git a/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml b/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml index 5348d9404a0e..5cba050e50c3 100644 --- a/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml +++ b/packages/kbn-securitysolution-lists-common/docs/openapi/serverless/security_solution_lists_api_2023_10_31.bundled.schema.yaml @@ -1528,9 +1528,9 @@ components: - text type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string PlatformErrorResponse: type: object @@ -1562,6 +1562,79 @@ components: security: - BasicAuth: [] tags: - - description: Lists API allows you to manage lists of keywords, IPs or IP ranges items. + - description: > + Lists can be used with detection rule exceptions to define values that + prevent a rule from generating alerts. + + + Lists are made up of: + + + * **List containers**: A container for values of the same Elasticsearch + data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception + prevents an alert from being generated. + + + All list items in the same list container must be of the same data type, + and each item defines a single value. For example, an IP list container + named `internal-ip-addresses-southport` contains five items, where each + item defines one internal IP address: + + 1. `192.168.1.1` + + 2. `192.168.1.3` + + 3. `192.168.1.18` + + 4. `192.168.1.12` + + 5. `192.168.1.7` + + + To use these IP addresses as values for defining rule exceptions, use the + Security exceptions API to [create an exception list + item](../operation/operation-createexceptionlistitem) that references the + `internal-ip-addresses-southport` list. + + > info + + > Lists cannot be added directly to rules, nor do they define the + operators used to determine when exceptions are applied (`is in list`, `is + not in list`). Use an exception item to define the operator and associate + it with an [exception + container](../operation/operation-createexceptionlist). You can then add + the exception container to a rule's `exceptions_list` object. + + + ## Lists requirements + + + Before you can start using lists, you must create the `.lists` and + `.items` data streams for the relevant Kibana space. To do this, use the + [Create list data streams](../operation/operation-createlistindex) + endpoint. Once these data streams are created, your role needs privileges + to manage rules. Refer to [Enable and access + detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui) + for a complete list of requirements. name: Security Lists API x-displayName: Security lists diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js index b8ea2ea2e837..7a6172475917 100644 --- a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js +++ b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle.js @@ -22,20 +22,7 @@ const ROOT = resolve(__dirname, '..'); ), options: { includeLabels: ['serverless'], - prototypeDocument: { - info: { - title: 'Security Lists API (Elastic Cloud Serverless)', - description: 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.', - }, - tags: [ - { - name: 'Security Lists API', - 'x-displayName': 'Security lists', - description: - 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.', - }, - ], - }, + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_serverless.info.yaml'), }, }); @@ -47,20 +34,7 @@ const ROOT = resolve(__dirname, '..'); ), options: { includeLabels: ['ess'], - prototypeDocument: { - info: { - title: 'Security Lists API (Elastic Cloud and self-hosted)', - description: 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.', - }, - tags: [ - { - name: 'Security Lists API', - 'x-displayName': 'Security lists', - description: - 'Lists API allows you to manage lists of keywords, IPs or IP ranges items.', - }, - ], - }, + prototypeDocument: join(ROOT, 'scripts/openapi_bundle_info/lists_ess.info.yaml'), }, }); })(); diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml new file mode 100644 index 000000000000..f2f528c8d7ba --- /dev/null +++ b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_ess.info.yaml @@ -0,0 +1,49 @@ +openapi: 3.0.3 +info: + title: "Security Lists API (Elastic Cloud and self-hosted)" + description: "Lists API allows you to manage lists of keywords, IPs or IP ranges items." + +tags: + - name: "Security Lists API" + x-displayName: "Security lists" + description: | + Lists can be used with detection rule exceptions to define values that prevent a rule from generating alerts. + + Lists are made up of: + + * **List containers**: A container for values of the same Elasticsearch data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception prevents an alert from being generated. + + All list items in the same list container must be of the same data type, and each item defines a single value. For example, an IP list container named `internal-ip-addresses-southport` contains five items, where each item defines one internal IP address: + 1. `192.168.1.1` + 2. `192.168.1.3` + 3. `192.168.1.18` + 4. `192.168.1.12` + 5. `192.168.1.7` + + To use these IP addresses as values for defining rule exceptions, use the Security exceptions API to [create an exception list item](../operation/operation-createexceptionlistitem) that references the `internal-ip-addresses-southport` list. + > info + > Lists cannot be added directly to rules, nor do they define the operators used to determine when exceptions are applied (`is in list`, `is not in list`). Use an exception item to define the operator and associate it with an [exception container](../operation/operation-createexceptionlist). You can then add the exception container to a rule's `exceptions_list` object. + + ## Lists requirements + + Before you can start using lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. Refer to [Enable and access detections](https://www.elastic.co/guide/en/security/current/detections-permissions-section.html#enable-detections-ui) for a complete list of requirements. diff --git a/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml new file mode 100644 index 000000000000..8f3245db29a9 --- /dev/null +++ b/packages/kbn-securitysolution-lists-common/scripts/openapi_bundle_info/lists_serverless.info.yaml @@ -0,0 +1,49 @@ +openapi: 3.0.3 +info: + title: "Security Lists API (Elastic Cloud Serverless)" + description: "Lists API allows you to manage lists of keywords, IPs or IP ranges items." + +tags: + - name: "Security Lists API" + x-displayName: "Security lists" + description: | + Lists can be used with detection rule exceptions to define values that prevent a rule from generating alerts. + + Lists are made up of: + + * **List containers**: A container for values of the same Elasticsearch data type. The following data types can be used: + * `boolean` + * `byte` + * `date` + * `date_nanos` + * `date_range` + * `double` + * `double_range` + * `float` + * `float_range` + * `half_float` + * `integer` + * `integer_range` + * `ip` + * `ip_range` + * `keyword` + * `long` + * `long_range` + * `short` + * `text` + * **List items**: The values used to determine whether the exception prevents an alert from being generated. + + All list items in the same list container must be of the same data type, and each item defines a single value. For example, an IP list container named `internal-ip-addresses-southport` contains five items, where each item defines one internal IP address: + 1. `192.168.1.1` + 2. `192.168.1.3` + 3. `192.168.1.18` + 4. `192.168.1.12` + 5. `192.168.1.7` + + To use these IP addresses as values for defining rule exceptions, use the Security exceptions API to [create an exception list item](../operation/operation-createexceptionlistitem) that references the `internal-ip-addresses-southport` list. + > info + > Lists cannot be added directly to rules, nor do they define the operators used to determine when exceptions are applied (`is in list`, `is not in list`). Use an exception item to define the operator and associate it with an [exception container](../operation/operation-createexceptionlist). You can then add the exception container to a rule's `exceptions_list` object. + + ## Lists requirements + + Before you can start using lists, you must create the `.lists` and `.items` data streams for the relevant Kibana space. To do this, use the [Create list data streams](../operation/operation-createlistindex) endpoint. Once these data streams are created, your role needs privileges to manage rules. Refer to [Enable and access detections](https://www.elastic.co/guide/en/serverless/current/security-detections-requirements.html#enable-detections-ui) for a complete list of requirements. diff --git a/packages/kbn-server-route-repository/src/register_routes.ts b/packages/kbn-server-route-repository/src/register_routes.ts index 6201ffcd869e..90c4f42b9ce4 100644 --- a/packages/kbn-server-route-repository/src/register_routes.ts +++ b/packages/kbn-server-route-repository/src/register_routes.ts @@ -98,8 +98,15 @@ export function registerRoutes<TDependencies extends Record<string, any>>({ if (isKibanaResponse(result)) { return result; } else if (isObservable(result)) { + const controller = new AbortController(); + request.events.aborted$.subscribe(() => { + controller.abort(); + }); return response.ok({ - body: observableIntoEventSourceStream(result as Observable<ServerSentEvent>), + body: observableIntoEventSourceStream(result as Observable<ServerSentEvent>, { + logger, + signal: controller.signal, + }), }); } else { const body = result || {}; diff --git a/packages/kbn-sse-utils-server/kibana.jsonc b/packages/kbn-sse-utils-server/kibana.jsonc index 8c533af1953e..c4778482e456 100644 --- a/packages/kbn-sse-utils-server/kibana.jsonc +++ b/packages/kbn-sse-utils-server/kibana.jsonc @@ -5,5 +5,5 @@ "@elastic/obs-knowledge-team" ], "group": "platform", - "visibility": "private" -} \ No newline at end of file + "visibility": "shared" +} diff --git a/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.test.ts b/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.test.ts new file mode 100644 index 000000000000..9f4f8ffa8428 --- /dev/null +++ b/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.test.ts @@ -0,0 +1,198 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Logger } from '@kbn/logging'; +import { observableIntoEventSourceStream } from './observable_into_event_source_stream'; +import { PassThrough } from 'node:stream'; +import { Subject } from 'rxjs'; +import { ServerSentEvent, ServerSentEventType } from '@kbn/sse-utils/src/events'; +import { + ServerSentEventErrorCode, + createSSEInternalError, + createSSERequestError, +} from '@kbn/sse-utils/src/errors'; + +describe('observableIntoEventSourceStream', () => { + let logger: jest.Mocked<Logger>; + + let controller: AbortController; + + let stream: PassThrough; + let source$: Subject<ServerSentEvent>; + + let data: string[]; + + beforeEach(() => { + jest.useFakeTimers(); + logger = { + debug: jest.fn(), + error: jest.fn(), + } as unknown as jest.Mocked<Logger>; + + controller = new AbortController(); + source$ = new Subject(); + data = []; + + stream = observableIntoEventSourceStream(source$, { logger, signal: controller.signal }); + stream.on('data', (chunk) => { + data.push(chunk.toString()); + }); + }); + + afterEach(() => { + jest.clearAllTimers(); + }); + + it('writes events into the stream in SSE format', () => { + source$.next({ type: ServerSentEventType.data, data: { foo: 'bar' } }); + source$.complete(); + + jest.runAllTimers(); + + expect(data).toEqual(['event: data\ndata: {"data":{"foo":"bar"}}\n\n']); + }); + + it('handles SSE errors', () => { + const sseError = createSSEInternalError('Invalid input'); + + source$.error(sseError); + + jest.runAllTimers(); + + expect(logger.error).toHaveBeenCalledWith(sseError); + expect(logger.debug).toHaveBeenCalled(); + const debugFn = logger.debug.mock.calls[0][0] as () => string; + const loggedError = JSON.parse(debugFn()); + expect(loggedError).toEqual({ + type: 'error', + error: { + code: ServerSentEventErrorCode.internalError, + message: 'Invalid input', + meta: {}, + }, + }); + + expect(data).toEqual([ + `event: error\ndata: ${JSON.stringify({ + error: { + code: ServerSentEventErrorCode.internalError, + message: 'Invalid input', + meta: {}, + }, + })}\n\n`, + ]); + }); + + it('handles SSE errors with metadata', () => { + const sseError = createSSERequestError('Invalid request', 400); + + source$.error(sseError); + + jest.runAllTimers(); + + expect(logger.error).toHaveBeenCalledWith(sseError); + expect(logger.debug).toHaveBeenCalled(); + const debugFn = logger.debug.mock.calls[0][0] as () => string; + const loggedError = JSON.parse(debugFn()); + expect(loggedError).toEqual({ + type: 'error', + error: { + code: ServerSentEventErrorCode.requestError, + message: 'Invalid request', + meta: { + status: 400, + }, + }, + }); + + expect(data).toEqual([ + `event: error\ndata: ${JSON.stringify({ + error: { + code: ServerSentEventErrorCode.requestError, + message: 'Invalid request', + meta: { + status: 400, + }, + }, + })}\n\n`, + ]); + }); + + it('handles non-SSE errors', () => { + const error = new Error('Non-SSE Error'); + + source$.error(error); + + jest.runAllTimers(); + + expect(logger.error).toHaveBeenCalledWith(error); + expect(data).toEqual([ + `event: error\ndata: ${JSON.stringify({ + error: { + code: ServerSentEventErrorCode.internalError, + message: 'Non-SSE Error', + }, + })}\n\n`, + ]); + }); + + it('should send keep-alive comments every 10 seconds', () => { + jest.advanceTimersByTime(10000); + expect(data).toContain(': keep-alive'); + + jest.advanceTimersByTime(10000); + expect(data.filter((d) => d === ': keep-alive')).toHaveLength(2); + }); + + describe('without fake timers', () => { + beforeEach(() => { + jest.useFakeTimers({ doNotFake: ['nextTick'] }); + }); + + it('should end the stream when the observable completes', async () => { + jest.useFakeTimers({ doNotFake: ['nextTick'] }); + + const endSpy = jest.fn(); + stream.on('end', endSpy); + + source$.complete(); + + await new Promise((resolve) => process.nextTick(resolve)); + + expect(endSpy).toHaveBeenCalled(); + }); + + it('should end stream when signal is aborted', async () => { + const endSpy = jest.fn(); + stream.on('end', endSpy); + + // Emit some data + source$.next({ type: ServerSentEventType.data, data: { initial: 'data' } }); + + // Abort the signal + controller.abort(); + + // Emit more data after abort + source$.next({ type: ServerSentEventType.data, data: { after: 'abort' } }); + + await new Promise((resolve) => process.nextTick(resolve)); + + expect(endSpy).toHaveBeenCalled(); + + // Data after abort should not be received + expect(data).toEqual([ + `event: data\ndata: ${JSON.stringify({ data: { initial: 'data' } })}\n\n`, + ]); + }); + + afterEach(() => { + jest.useFakeTimers(); + }); + }); +}); diff --git a/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts b/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts index e0d653e44dab..0a71cd60192e 100644 --- a/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts +++ b/packages/kbn-sse-utils-server/src/observable_into_event_source_stream.ts @@ -7,12 +7,51 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { map, Observable } from 'rxjs'; +import { Logger } from '@kbn/logging'; +import { + isSSEError, + ServerSentErrorEvent, + ServerSentEventErrorCode, +} from '@kbn/sse-utils/src/errors'; +import { ServerSentEvent, ServerSentEventType } from '@kbn/sse-utils/src/events'; +import { catchError, map, Observable, of } from 'rxjs'; import { PassThrough } from 'stream'; -import { ServerSentEvent } from '@kbn/sse-utils'; -export function observableIntoEventSourceStream(source$: Observable<ServerSentEvent>): PassThrough { - const withSerializedEvents$ = source$.pipe( +export function observableIntoEventSourceStream( + source$: Observable<ServerSentEvent>, + { + logger, + signal, + }: { + logger: Pick<Logger, 'debug' | 'error'>; + signal: AbortSignal; + } +) { + const withSerializedErrors$ = source$.pipe( + catchError((error): Observable<ServerSentErrorEvent> => { + if (isSSEError(error)) { + logger.error(error); + logger.debug(() => JSON.stringify(error)); + return of({ + type: ServerSentEventType.error, + error: { + code: error.code, + message: error.message, + meta: error.meta, + }, + }); + } + + logger.error(error); + + return of({ + type: ServerSentEventType.error, + error: { + code: ServerSentEventErrorCode.internalError, + message: error.message as string, + }, + }); + }), map((event) => { const { type, ...rest } = event; return `event: ${type}\ndata: ${JSON.stringify(rest)}\n\n`; @@ -21,18 +60,38 @@ export function observableIntoEventSourceStream(source$: Observable<ServerSentEv const stream = new PassThrough(); - withSerializedEvents$.subscribe({ + const intervalId = setInterval(() => { + // `:` denotes a comment - this is to keep the connection open + // it will be ignored by the SSE parser on the client + stream.write(': keep-alive'); + }, 10000); + + const subscription = withSerializedErrors$.subscribe({ next: (line) => { stream.write(line); }, complete: () => { stream.end(); + clearTimeout(intervalId); }, error: (error) => { - stream.write(`event: error\ndata: ${JSON.stringify(error)}\n\n`); + clearTimeout(intervalId); + stream.write( + `event:error\ndata: ${JSON.stringify({ + error: { + code: ServerSentEventErrorCode.internalError, + message: error.message, + }, + })}\n\n` + ); stream.end(); }, }); + signal.addEventListener('abort', () => { + subscription.unsubscribe(); + stream.end(); + }); + return stream; } diff --git a/packages/kbn-sse-utils-server/tsconfig.json b/packages/kbn-sse-utils-server/tsconfig.json index 9053749c5898..7f9b7b7e8f52 100644 --- a/packages/kbn-sse-utils-server/tsconfig.json +++ b/packages/kbn-sse-utils-server/tsconfig.json @@ -15,5 +15,6 @@ ], "kbn_references": [ "@kbn/sse-utils", + "@kbn/logging", ] } diff --git a/packages/kbn-sse-utils/README.md b/packages/kbn-sse-utils/README.md index ad6dbf8b67c0..948376fb7e4e 100644 --- a/packages/kbn-sse-utils/README.md +++ b/packages/kbn-sse-utils/README.md @@ -21,7 +21,8 @@ function myRequestHandler( data: { anyData: {}, }, - }) + }), + logger ), }); } diff --git a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/scout_ftr_reporter.ts b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/scout_ftr_reporter.ts index 4ffef48ec644..8ded1efba8a9 100644 --- a/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/scout_ftr_reporter.ts +++ b/packages/kbn-test/src/functional_test_runner/lib/mocha/reporter/scout_ftr_reporter.ts @@ -18,7 +18,11 @@ import { ScoutReportEventAction, datasources, } from '@kbn/scout-reporting'; -import { getCodeOwnersForFile, getPathsWithOwnersReversed, PathWithOwners } from '@kbn/code-owners'; +import { + getOwningTeamsForPath, + getCodeOwnersEntries, + type CodeOwnersEntry, +} from '@kbn/code-owners'; import { Runner, Test } from '../../../fake_mocha_types'; /** @@ -37,7 +41,7 @@ export class ScoutFTRReporter { readonly name: string; readonly runId: string; private report: ScoutReport; - private readonly pathsWithOwners: PathWithOwners[]; + private readonly codeOwnersEntries: CodeOwnersEntry[]; constructor(private runner: Runner, private reporterOptions: ScoutFTRReporterOptions = {}) { this.log = new ToolingLog({ @@ -50,7 +54,7 @@ export class ScoutFTRReporter { this.log.info(`Scout test run ID: ${this.runId}`); this.report = new ScoutReport(this.log); - this.pathsWithOwners = getPathsWithOwnersReversed(); + this.codeOwnersEntries = getCodeOwnersEntries(); // Register event listeners for (const [eventName, listener] of Object.entries({ @@ -64,16 +68,7 @@ export class ScoutFTRReporter { } private getFileOwners(filePath: string): string[] { - const concatenatedOwners = getCodeOwnersForFile(filePath, this.pathsWithOwners); - - if (concatenatedOwners === undefined) { - return []; - } - - return concatenatedOwners - .replace(/#.+$/, '') - .split(',') - .filter((value) => value.length > 0); + return getOwningTeamsForPath(filePath, this.codeOwnersEntries); } /** diff --git a/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts b/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts index 6d99938ceea8..8a1ec50bd1a3 100644 --- a/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts +++ b/packages/kbn-test/src/functional_test_runner/run_check_ftr_code_owners.ts @@ -10,7 +10,7 @@ import { run } from '@kbn/dev-cli-runner'; import { createFailError } from '@kbn/dev-cli-errors'; import { getRepoFiles } from '@kbn/get-repo-files'; -import { getCodeOwnersForFile, getPathsWithOwnersReversed } from '@kbn/code-owners'; +import { getOwningTeamsForPath, getCodeOwnersEntries } from '@kbn/code-owners'; const TEST_DIRECTORIES = ['test', 'x-pack/test', 'x-pack/test_serverless']; @@ -32,17 +32,22 @@ export async function runCheckFtrCodeOwnersCli() { const missingOwners = new Set<string>(); // cache codeowners for quicker lookup - const reversedCodeowners = getPathsWithOwnersReversed(); + log.info('Reading CODEOWNERS file'); + const codeOwnersEntries = getCodeOwnersEntries(); const testFiles = await getRepoFiles(TEST_DIRECTORIES); + log.info(`Checking ownership for ${testFiles.length} test files (this will take a while)`); + for (const { repoRel } of testFiles) { - const owners = getCodeOwnersForFile(repoRel, reversedCodeowners); - if (owners === undefined || owners === '') { + const owners = getOwningTeamsForPath(repoRel, codeOwnersEntries); + + if (owners.length === 0) { missingOwners.add(repoRel); } } const timeSpent = fmtMs(performance.now() - start); + log.info(`Ownership check complete (took ${timeSpent})`); if (missingOwners.size) { log.error( @@ -53,9 +58,7 @@ export async function runCheckFtrCodeOwnersCli() { ); } - log.success( - `All test files have a code owner (checked ${testFiles.length} test files in ${timeSpent})` - ); + log.success(`All test files have a code owner. 🥳`); }, { description: 'Check that all test files are covered by GitHub CODEOWNERS', diff --git a/packages/kbn-test/src/mocha/junit_report_generation.js b/packages/kbn-test/src/mocha/junit_report_generation.js index 03bdc37f7672..976cbfb7540d 100644 --- a/packages/kbn-test/src/mocha/junit_report_generation.js +++ b/packages/kbn-test/src/mocha/junit_report_generation.js @@ -8,7 +8,7 @@ */ import { REPO_ROOT } from '@kbn/repo-info'; -import { getCodeOwnersForFile, getPathsWithOwnersReversed } from '@kbn/code-owners'; +import { getOwningTeamsForPath, getCodeOwnersEntries } from '@kbn/code-owners'; import { dirname, relative } from 'path'; import { writeFileSync, mkdirSync } from 'fs'; import { inspect } from 'util'; @@ -94,10 +94,10 @@ export function setupJUnitReportGeneration(runner, options = {}) { .filter((node) => node.pending || !results.find((result) => result.node === node)) .map((node) => ({ skipped: true, node })); - // cache codeowners for quicker lookup - let reversedCodeowners = []; + // cache codeowner entries for quicker lookup + let codeOwnersEntries = []; try { - reversedCodeowners = getPathsWithOwnersReversed(); + codeOwnersEntries = getCodeOwnersEntries(); } catch { /* no-op */ } @@ -142,8 +142,9 @@ export function setupJUnitReportGeneration(runner, options = {}) { // adding code owners only for the failed test case if (failed) { const testCaseRelativePath = getPath(node); - const owners = getCodeOwnersForFile(testCaseRelativePath, reversedCodeowners); - attrs.owners = owners || ''; // empty string when no codeowners are defined + + // Comma-separated list of owners. Empty string if no owners are found. + attrs.owners = getOwningTeamsForPath(testCaseRelativePath, codeOwnersEntries).join(','); } return testsuitesEl.ele('testcase', attrs); diff --git a/packages/kbn-unified-field-list/src/components/field_stats/field_stats.tsx b/packages/kbn-unified-field-list/src/components/field_stats/field_stats.tsx index 58ff36069dd8..74c85662754f 100755 --- a/packages/kbn-unified-field-list/src/components/field_stats/field_stats.tsx +++ b/packages/kbn-unified-field-list/src/components/field_stats/field_stats.tsx @@ -19,7 +19,14 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import DateMath from '@kbn/datemath'; -import { EuiButtonGroup, EuiLoadingSpinner, EuiSpacer, EuiText, EuiTitle } from '@elastic/eui'; +import { + EuiButtonGroup, + EuiLoadingSpinner, + EuiSpacer, + EuiText, + EuiTitle, + useEuiTheme, +} from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; import { Axis, @@ -120,7 +127,7 @@ const FieldStatsComponent: React.FC<FieldStatsProps> = ({ toDate, dataViewOrDataViewId, field, - color = getDefaultColor(), + color: originalColor, 'data-test-subj': dataTestSubject = 'fieldStats', overrideMissingContent, overrideFooter, @@ -128,6 +135,9 @@ const FieldStatsComponent: React.FC<FieldStatsProps> = ({ overrideFieldTopValueBar, onStateChange, }) => { + const { euiTheme } = useEuiTheme(); + const color = originalColor ?? getDefaultColor(euiTheme.themeName); + const { fieldFormats, uiSettings, charts, dataViews, data } = services; const [state, changeState] = useState<FieldStatsState>({ isLoading: false, diff --git a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx index 7817fd027890..edb38d461086 100644 --- a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx +++ b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.test.tsx @@ -59,6 +59,7 @@ describe('UnifiedFieldList <FieldTopValues />', () => { key: 'sourceB', }, ], + color: '#000', 'data-test-subj': 'testing', }; }); diff --git a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.tsx b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.tsx index a2f57d03bf51..31ee1479bb08 100755 --- a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.tsx +++ b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values.tsx @@ -20,7 +20,7 @@ export interface FieldTopValuesProps { dataView: DataView; field: DataViewField; sampledValuesCount: number; - color?: string; + color: string; 'data-test-subj': string; onAddFilter?: AddFieldFilterHandler; overrideFieldTopValueBar?: OverrideFieldTopValueBarCallback; @@ -32,7 +32,7 @@ export const FieldTopValues: React.FC<FieldTopValuesProps> = ({ dataView, field, sampledValuesCount, - color = getDefaultColor(), + color, 'data-test-subj': dataTestSubject, onAddFilter, overrideFieldTopValueBar, @@ -106,7 +106,10 @@ export const FieldTopValues: React.FC<FieldTopValuesProps> = ({ ); }; -export const getDefaultColor = () => euiPaletteColorBlind()[1]; +export const getDefaultColor = (euiThemeName: string) => + euiThemeName?.toLowerCase().includes('borealis') + ? euiPaletteColorBlind()[2] + : euiPaletteColorBlind()[1]; // FIXME: remove in 9.x when Borealis becomes the default theme export const getFormattedPercentageValue = ( currentValue: number, diff --git a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx index 77266edc2de0..a53bbcdebc46 100755 --- a/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx +++ b/packages/kbn-unified-field-list/src/components/field_stats/field_top_values_bucket.tsx @@ -15,7 +15,10 @@ import { EuiProgress, EuiText, EuiTextBlockTruncate, + EuiThemeComputed, EuiToolTip, + makeHighContrastColor, + useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; @@ -53,6 +56,7 @@ const FieldTopValuesBucket: React.FC<FieldTopValuesBucketProps> = ({ overrideFieldTopValueBar, ...fieldTopValuesBucketOverridableProps }) => { + const { euiTheme } = useEuiTheme(); const overrides = overrideFieldTopValueBar ? overrideFieldTopValueBar(fieldTopValuesBucketOverridableProps) : ({} as FieldTopValuesBucketParams); @@ -141,7 +145,7 @@ const FieldTopValuesBucket: React.FC<FieldTopValuesBucketProps> = ({ })} delay="long" > - <EuiText size="xs" textAlign="left" color={color}> + <EuiText size="xs" textAlign="left" color={getPercentageColor(euiTheme, color)}> {formattedPercentage} </EuiText> </EuiToolTip> @@ -207,6 +211,11 @@ const FieldTopValuesBucket: React.FC<FieldTopValuesBucketProps> = ({ ); }; +const getPercentageColor = (euiTheme: EuiThemeComputed, color: string) => + euiTheme.themeName?.toLowerCase().includes('borealis') + ? makeHighContrastColor(color)(euiTheme) + : color; // FIXME: remove in 9.x when Borealis becomes the default theme + // Necessary for React.lazy // eslint-disable-next-line import/no-default-export export default FieldTopValuesBucket; diff --git a/packages/kbn-visualization-ui-components/components/color_picker.tsx b/packages/kbn-visualization-ui-components/components/color_picker.tsx index 589066726300..e3ca47e63e65 100644 --- a/packages/kbn-visualization-ui-components/components/color_picker.tsx +++ b/packages/kbn-visualization-ui-components/components/color_picker.tsx @@ -10,14 +10,7 @@ import React, { useEffect, useRef, useState } from 'react'; import { i18n } from '@kbn/i18n'; import { TooltipWrapper } from '@kbn/visualization-utils'; -import { - EuiFormRow, - EuiColorPicker, - EuiColorPickerProps, - EuiToolTip, - EuiIcon, - euiPaletteColorBlind, -} from '@elastic/eui'; +import { EuiFormRow, EuiColorPicker, EuiColorPickerProps, EuiToolTip, EuiIcon } from '@elastic/eui'; import { getColorAlpha, makeColorWithAlpha } from '@kbn/coloring'; const tooltipContent = { @@ -38,6 +31,7 @@ export interface ColorPickerProps { disableHelpTooltip?: boolean; disabledMessage?: string; showAlpha?: boolean; + swatches: string[]; } export const ColorPicker = ({ @@ -49,6 +43,7 @@ export const ColorPicker = ({ disableHelpTooltip, disabledMessage, showAlpha, + swatches, }: ColorPickerProps) => { const [colorText, setColorText] = useState(overwriteColor || defaultColor); const [validatedColor, setValidatedColor] = useState(overwriteColor || defaultColor); @@ -112,8 +107,8 @@ export const ColorPicker = ({ showAlpha={showAlpha} swatches={ currentColorAlpha === 1 - ? euiPaletteColorBlind() - : euiPaletteColorBlind().map((c) => makeColorWithAlpha(c, currentColorAlpha).hex()) + ? swatches + : swatches.map((c) => makeColorWithAlpha(c, currentColorAlpha).hex()) } /> ); diff --git a/packages/kbn-zod-helpers/index.ts b/packages/kbn-zod-helpers/index.ts index cbd864e327a2..65624b7ec6c8 100644 --- a/packages/kbn-zod-helpers/index.ts +++ b/packages/kbn-zod-helpers/index.ts @@ -16,3 +16,4 @@ export * from './src/required_optional'; export * from './src/safe_parse_result'; export * from './src/stringify_zod_error'; export * from './src/build_route_validation_with_zod'; +export * from './src/non_empty_string'; diff --git a/packages/kbn-zod-helpers/src/non_empty_string.ts b/packages/kbn-zod-helpers/src/non_empty_string.ts new file mode 100644 index 000000000000..d007c2f4f0a2 --- /dev/null +++ b/packages/kbn-zod-helpers/src/non_empty_string.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import * as z from '@kbn/zod'; + +export function isNonEmptyString(input: string, ctx: z.RefinementCtx): void { + if (input.trim() === '') { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'No empty strings allowed', + }); + } +} diff --git a/packages/presentation/presentation_containers/index.ts b/packages/presentation/presentation_containers/index.ts index e339b0ace389..833e8f5b4a0c 100644 --- a/packages/presentation/presentation_containers/index.ts +++ b/packages/presentation/presentation_containers/index.ts @@ -29,7 +29,6 @@ export { export { canTrackContentfulRender, type TrackContentfulRender, - type TracksQueryPerformance, } from './interfaces/performance_trackers'; export { apiIsPresentationContainer, diff --git a/packages/presentation/presentation_containers/interfaces/performance_trackers.ts b/packages/presentation/presentation_containers/interfaces/performance_trackers.ts index ef8cfeb9caf9..ec2b2e363d30 100644 --- a/packages/presentation/presentation_containers/interfaces/performance_trackers.ts +++ b/packages/presentation/presentation_containers/interfaces/performance_trackers.ts @@ -17,10 +17,3 @@ export interface TrackContentfulRender { export const canTrackContentfulRender = (root: unknown): root is TrackContentfulRender => { return root !== null && typeof root === 'object' && 'trackContentfulRender' in root; }; - -export interface TracksQueryPerformance { - firstLoad: boolean; - creationStartTime?: number; - creationEndTime?: number; - lastLoadStartTime?: number; -} diff --git a/packages/presentation/presentation_containers/interfaces/serialized_state.ts b/packages/presentation/presentation_containers/interfaces/serialized_state.ts index 21011d46b240..0368bd751ce7 100644 --- a/packages/presentation/presentation_containers/interfaces/serialized_state.ts +++ b/packages/presentation/presentation_containers/interfaces/serialized_state.ts @@ -8,7 +8,6 @@ */ import type { Reference } from '@kbn/content-management-utils'; -import type { MaybePromise } from '@kbn/utility-types'; /** * A package containing the serialized Embeddable state, with references extracted. When saving Embeddables using any @@ -24,7 +23,7 @@ export interface HasSerializableState<State extends object = object> { * Serializes all state into a format that can be saved into * some external store. The opposite of `deserialize` in the {@link ReactEmbeddableFactory} */ - serializeState: () => MaybePromise<SerializedPanelState<State>>; + serializeState: () => SerializedPanelState<State>; } export const apiHasSerializableState = (api: unknown | null): api is HasSerializableState => { diff --git a/packages/presentation/presentation_containers/interfaces/tracks_overlays.ts b/packages/presentation/presentation_containers/interfaces/tracks_overlays.ts index 76e18a17436e..b46d5ad312c2 100644 --- a/packages/presentation/presentation_containers/interfaces/tracks_overlays.ts +++ b/packages/presentation/presentation_containers/interfaces/tracks_overlays.ts @@ -9,7 +9,7 @@ import { OverlayRef } from '@kbn/core-mount-utils-browser'; -interface TracksOverlaysOptions { +export interface TracksOverlaysOptions { /** * If present, the panel with this ID will be focused when the overlay is opened. This can be used in tandem with a push * flyout to edit a panel's settings in context diff --git a/packages/presentation/presentation_containers/tsconfig.json b/packages/presentation/presentation_containers/tsconfig.json index 15fe39786170..8e25a7b80c6e 100644 --- a/packages/presentation/presentation_containers/tsconfig.json +++ b/packages/presentation/presentation_containers/tsconfig.json @@ -10,6 +10,5 @@ "@kbn/presentation-publishing", "@kbn/core-mount-utils-browser", "@kbn/content-management-utils", - "@kbn/utility-types", ] } diff --git a/packages/presentation/presentation_publishing/index.ts b/packages/presentation/presentation_publishing/index.ts index b290d49a8434..09e645358666 100644 --- a/packages/presentation/presentation_publishing/index.ts +++ b/packages/presentation/presentation_publishing/index.ts @@ -39,6 +39,7 @@ export { initializeTimeRange, type SerializedTimeRange, } from './interfaces/fetch/initialize_time_range'; +export { apiPublishesReload, type PublishesReload } from './interfaces/fetch/publishes_reload'; export { apiPublishesFilters, apiPublishesPartialUnifiedSearch, diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts b/packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts index 3e5459e5d8ae..5fa99938fdc8 100644 --- a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts +++ b/packages/presentation/presentation_publishing/interfaces/fetch/publishes_reload.ts @@ -7,10 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { PublishingSubject } from '../../publishing_subject'; +import { Observable } from 'rxjs'; export interface PublishesReload { - reload$: PublishingSubject<void>; + reload$: Omit<Observable<void>, 'next'>; } export const apiPublishesReload = (unknownApi: null | unknown): unknownApi is PublishesReload => { diff --git a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts b/packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts index aec8c33715c0..08a21f16ca5e 100644 --- a/packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts +++ b/packages/presentation/presentation_publishing/interfaces/fetch/publishes_unified_search.ts @@ -7,7 +7,15 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; +import { + AggregateQuery, + COMPARE_ALL_OPTIONS, + Filter, + Query, + TimeRange, + onlyDisabledFiltersChanged, +} from '@kbn/es-query'; +import fastIsEqual from 'fast-deep-equal'; import { useEffect, useMemo } from 'react'; import { BehaviorSubject } from 'rxjs'; import { PublishingSubject } from '../../publishing_subject'; @@ -113,15 +121,27 @@ export function useSearchApi({ }, []); useEffect(() => { - searchApi.filters$.next(filters); + if ( + !onlyDisabledFiltersChanged(searchApi.filters$.getValue(), filters, { + ...COMPARE_ALL_OPTIONS, + // do not compare $state to avoid refreshing when filter is pinned/unpinned (which does not impact results) + state: false, + }) + ) { + searchApi.filters$.next(filters); + } }, [filters, searchApi.filters$]); useEffect(() => { - searchApi.query$.next(query); + if (!fastIsEqual(searchApi.query$.getValue(), query)) { + searchApi.query$.next(query); + } }, [query, searchApi.query$]); useEffect(() => { - searchApi.timeRange$.next(timeRange); + if (!fastIsEqual(searchApi.timeRange$.getValue(), timeRange)) { + searchApi.timeRange$.next(timeRange); + } }, [timeRange, searchApi.timeRange$]); return searchApi; diff --git a/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts b/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts index 68c3e1c85441..34723605e481 100644 --- a/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts +++ b/packages/presentation/presentation_publishing/interfaces/titles/titles_api.ts @@ -39,9 +39,15 @@ export const initializeTitles = ( const panelDescription = new BehaviorSubject<string | undefined>(rawState.description); const hidePanelTitle = new BehaviorSubject<boolean | undefined>(rawState.hidePanelTitles); - const setPanelTitle = (value: string | undefined) => panelTitle.next(value); - const setHidePanelTitle = (value: boolean | undefined) => hidePanelTitle.next(value); - const setPanelDescription = (value: string | undefined) => panelDescription.next(value); + const setPanelTitle = (value: string | undefined) => { + if (value !== panelTitle.value) panelTitle.next(value); + }; + const setHidePanelTitle = (value: boolean | undefined) => { + if (value !== hidePanelTitle.value) hidePanelTitle.next(value); + }; + const setPanelDescription = (value: string | undefined) => { + if (value !== panelDescription.value) panelDescription.next(value); + }; const titleComparators: StateComparators<SerializedTitles> = { title: [panelTitle, setPanelTitle], diff --git a/packages/react/kibana_context/common/tsconfig.json b/packages/react/kibana_context/common/tsconfig.json index 0d78dace105e..994137ade7df 100644 --- a/packages/react/kibana_context/common/tsconfig.json +++ b/packages/react/kibana_context/common/tsconfig.json @@ -13,5 +13,6 @@ "exclude": [ "target/**/*" ], - "kbn_references": [] + "kbn_references": [ + ] } diff --git a/packages/react/kibana_context/common/types.ts b/packages/react/kibana_context/common/types.ts index 05e7ab7a0c7d..e6c15e3cb391 100644 --- a/packages/react/kibana_context/common/types.ts +++ b/packages/react/kibana_context/common/types.ts @@ -35,4 +35,5 @@ export interface KibanaTheme { */ export interface ThemeServiceStart { theme$: Observable<KibanaTheme>; + getTheme?(): KibanaTheme; } diff --git a/packages/react/kibana_context/root/eui_provider.tsx b/packages/react/kibana_context/root/eui_provider.tsx index fa1d92e89780..9b089829a347 100644 --- a/packages/react/kibana_context/root/eui_provider.tsx +++ b/packages/react/kibana_context/root/eui_provider.tsx @@ -65,16 +65,22 @@ const cache = { default: emotionCache, global: globalCache, utility: utilitiesCa * should not be used. Instead, refer to `KibanaRootContextProvider` to set up the root of Kibana. */ export const KibanaEuiProvider: FC<PropsWithChildren<KibanaEuiProviderProps>> = ({ - theme: { theme$ }, + theme, globalStyles: globalStylesProp, colorMode: colorModeProp, modify, children, }) => { - const kibanaTheme = useObservable(theme$, defaultTheme); + const { theme$ } = theme; + + // use the selected theme if available before using the defaultTheme; this ensures that + // Kibana loads with the currently selected theme without additional updates from default to selected + const initialTheme = theme.getTheme?.() ?? defaultTheme; + + const kibanaTheme = useObservable(theme$, initialTheme); const themeColorMode = useMemo(() => getColorMode(kibanaTheme), [kibanaTheme]); - const theme = useMemo(() => { + const _theme = useMemo(() => { const config = getThemeConfigByName(kibanaTheme.name) || DEFAULT_THEME_CONFIG; return config.euiTheme; }, [kibanaTheme.name]); @@ -95,7 +101,7 @@ export const KibanaEuiProvider: FC<PropsWithChildren<KibanaEuiProviderProps>> = colorMode, globalStyles, utilityClasses: globalStyles, - theme, + theme: _theme, }} > {children} diff --git a/packages/response-ops/rule_form/src/create_rule_form.tsx b/packages/response-ops/rule_form/src/create_rule_form.tsx index d7ba54593549..2f5e0472dcd5 100644 --- a/packages/response-ops/rule_form/src/create_rule_form.tsx +++ b/packages/response-ops/rule_form/src/create_rule_form.tsx @@ -64,7 +64,7 @@ export const CreateRuleForm = (props: CreateRuleFormProps) => { onSubmit, } = props; - const { http, docLinks, notifications, ruleTypeRegistry, i18n, theme } = plugins; + const { http, docLinks, notifications, ruleTypeRegistry, ...deps } = plugins; const { toasts } = notifications; const { mutate, isLoading: isSaving } = useCreateRule({ @@ -82,7 +82,7 @@ export const CreateRuleForm = (props: CreateRuleFormProps) => { ...(message.details && { text: toMountPoint( <RuleFormCircuitBreakerError>{message.details}</RuleFormCircuitBreakerError>, - { i18n, theme } + deps ), }), }); diff --git a/packages/response-ops/rule_form/src/edit_rule_form.tsx b/packages/response-ops/rule_form/src/edit_rule_form.tsx index 7350a42475b6..392447114edd 100644 --- a/packages/response-ops/rule_form/src/edit_rule_form.tsx +++ b/packages/response-ops/rule_form/src/edit_rule_form.tsx @@ -45,7 +45,7 @@ export const EditRuleForm = (props: EditRuleFormProps) => { onCancel, onSubmit, } = props; - const { http, notifications, docLinks, ruleTypeRegistry, i18n, theme, application } = plugins; + const { http, notifications, docLinks, ruleTypeRegistry, application, ...deps } = plugins; const { toasts } = notifications; const { mutate, isLoading: isSaving } = useUpdateRule({ @@ -63,7 +63,7 @@ export const EditRuleForm = (props: EditRuleFormProps) => { ...(message.details && { text: toMountPoint( <RuleFormCircuitBreakerError>{message.details}</RuleFormCircuitBreakerError>, - { i18n, theme } + deps ), }), }); diff --git a/packages/response-ops/rule_form/src/rule_form.tsx b/packages/response-ops/rule_form/src/rule_form.tsx index c09add5ae1c0..f34f811a7b48 100644 --- a/packages/response-ops/rule_form/src/rule_form.tsx +++ b/packages/response-ops/rule_form/src/rule_form.tsx @@ -28,13 +28,46 @@ export interface RuleFormProps { } export const RuleForm = (props: RuleFormProps) => { - const { plugins, onCancel, onSubmit } = props; + const { plugins: _plugins, onCancel, onSubmit } = props; const { id, ruleTypeId } = useParams<{ id?: string; ruleTypeId?: string; }>(); + const { + http, + i18n, + theme, + userProfile, + application, + notifications, + charts, + settings, + data, + dataViews, + unifiedSearch, + docLinks, + ruleTypeRegistry, + actionTypeRegistry, + } = _plugins; + const ruleFormComponent = useMemo(() => { + const plugins = { + http, + i18n, + theme, + userProfile, + application, + notifications, + charts, + settings, + data, + dataViews, + unifiedSearch, + docLinks, + ruleTypeRegistry, + actionTypeRegistry, + }; if (id) { return <EditRuleForm id={id} plugins={plugins} onCancel={onCancel} onSubmit={onSubmit} />; } @@ -60,7 +93,26 @@ export const RuleForm = (props: RuleFormProps) => { } /> ); - }, [id, ruleTypeId, plugins, onCancel, onSubmit]); + }, [ + http, + i18n, + theme, + userProfile, + application, + notifications, + charts, + settings, + data, + dataViews, + unifiedSearch, + docLinks, + ruleTypeRegistry, + actionTypeRegistry, + id, + ruleTypeId, + onCancel, + onSubmit, + ]); return <QueryClientProvider client={queryClient}>{ruleFormComponent}</QueryClientProvider>; }; diff --git a/packages/response-ops/rule_form/src/types.ts b/packages/response-ops/rule_form/src/types.ts index 48ba6952b47f..07f34e4c5902 100644 --- a/packages/response-ops/rule_form/src/types.ts +++ b/packages/response-ops/rule_form/src/types.ts @@ -16,6 +16,7 @@ import type { HttpStart } from '@kbn/core-http-browser'; import type { I18nStart } from '@kbn/core-i18n-browser'; import type { NotificationsStart } from '@kbn/core-notifications-browser'; import type { ThemeServiceStart } from '@kbn/core-theme-browser'; +import type { UserProfileService } from '@kbn/core-user-profile-browser'; import type { SettingsStart } from '@kbn/core-ui-settings-browser'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; @@ -54,6 +55,7 @@ export interface RuleFormPlugins { http: HttpStart; i18n: I18nStart; theme: ThemeServiceStart; + userProfile: UserProfileService; application: ApplicationStart; notifications: NotificationsStart; charts: ChartsPluginSetup; diff --git a/packages/response-ops/rule_form/tsconfig.json b/packages/response-ops/rule_form/tsconfig.json index 3f39fc766bd1..cea1478df1ef 100644 --- a/packages/response-ops/rule_form/tsconfig.json +++ b/packages/response-ops/rule_form/tsconfig.json @@ -39,5 +39,6 @@ "@kbn/kibana-react-plugin", "@kbn/core-i18n-browser", "@kbn/core-theme-browser", + "@kbn/core-user-profile-browser", ] } diff --git a/packages/shared-ux/button_toolbar/kibana.jsonc b/packages/shared-ux/button_toolbar/kibana.jsonc index 1a61c5ffc3d4..909aeb3209de 100644 --- a/packages/shared-ux/button_toolbar/kibana.jsonc +++ b/packages/shared-ux/button_toolbar/kibana.jsonc @@ -1,9 +1,9 @@ { - "type": "shared-common", + "type": "shared-browser", "id": "@kbn/shared-ux-button-toolbar", "owner": [ "@elastic/appex-sharedux" ], "group": "platform", "visibility": "shared" -} \ No newline at end of file +} diff --git a/packages/shared-ux/button_toolbar/src/buttons/toolbar_button/toolbar_button.styles.ts b/packages/shared-ux/button_toolbar/src/buttons/toolbar_button/toolbar_button.styles.ts index a5bb10542435..b70993ed8b02 100644 --- a/packages/shared-ux/button_toolbar/src/buttons/toolbar_button/toolbar_button.styles.ts +++ b/packages/shared-ux/button_toolbar/src/buttons/toolbar_button/toolbar_button.styles.ts @@ -24,9 +24,9 @@ export const ToolbarButtonStyles = ({ euiTheme }: UseEuiTheme) => { borderColor: euiTheme.border.color, }, emptyButton: { - backgroundColor: euiTheme.colors.emptyShade, + backgroundColor: euiTheme.colors.backgroundBasePlain, border: `${euiTheme.border.thin}`, - color: `${euiTheme.colors.text}`, + color: `${euiTheme.colors.textParagraph}`, }, buttonPositions: { left: { diff --git a/packages/shared-ux/chrome/navigation/src/ui/components/panel/label_badge.tsx b/packages/shared-ux/chrome/navigation/src/ui/components/panel/label_badge.tsx index 8ea6fc971812..ceff96fde7ed 100644 --- a/packages/shared-ux/chrome/navigation/src/ui/components/panel/label_badge.tsx +++ b/packages/shared-ux/chrome/navigation/src/ui/components/panel/label_badge.tsx @@ -25,14 +25,13 @@ export const LabelBadge = ({ className?: string; }) => { const { euiTheme } = useEuiTheme(); - return ( <EuiBetaBadge label={text} size="s" css={css` margin-left: ${euiTheme.size.s}; - color: ${euiTheme.colors.text}; + color: ${euiTheme.colors.textParagraph}; vertical-align: middle; margin-bottom: ${euiTheme.size.xxs}; `} diff --git a/packages/shared-ux/code_editor/impl/placeholder_widget.ts b/packages/shared-ux/code_editor/impl/placeholder_widget.ts index 67a70af58ea1..cf74087af115 100644 --- a/packages/shared-ux/code_editor/impl/placeholder_widget.ts +++ b/packages/shared-ux/code_editor/impl/placeholder_widget.ts @@ -31,7 +31,7 @@ export class PlaceholderWidget implements monaco.editor.IContentWidget { const domNode = document.createElement('div'); domNode.innerText = this.placeholderText; domNode.className = css` - color: ${this.euiTheme.colors.subduedText}; + color: ${this.euiTheme.colors.textSubdued}; width: max-content; pointer-events: none; `; diff --git a/packages/shared-ux/file/file_picker/impl/kibana.jsonc b/packages/shared-ux/file/file_picker/impl/kibana.jsonc index 9d7bc72bb634..e812b97c9a08 100644 --- a/packages/shared-ux/file/file_picker/impl/kibana.jsonc +++ b/packages/shared-ux/file/file_picker/impl/kibana.jsonc @@ -1,9 +1,9 @@ { - "type": "shared-common", + "type": "shared-browser", "id": "@kbn/shared-ux-file-picker", "owner": [ "@elastic/appex-sharedux" ], "group": "platform", "visibility": "shared" -} \ No newline at end of file +} diff --git a/packages/shared-ux/file/file_upload/impl/kibana.jsonc b/packages/shared-ux/file/file_upload/impl/kibana.jsonc index ed5b6366e2a7..406982d80f1d 100644 --- a/packages/shared-ux/file/file_upload/impl/kibana.jsonc +++ b/packages/shared-ux/file/file_upload/impl/kibana.jsonc @@ -1,9 +1,9 @@ { - "type": "shared-common", + "type": "shared-browser", "id": "@kbn/shared-ux-file-upload", "owner": [ "@elastic/appex-sharedux" ], "group": "platform", "visibility": "shared" -} \ No newline at end of file +} diff --git a/packages/shared-ux/file/file_upload/impl/src/components/cancel_button.tsx b/packages/shared-ux/file/file_upload/impl/src/components/cancel_button.tsx index 5a2ae29e9fe3..9c34aa1bc59b 100644 --- a/packages/shared-ux/file/file_upload/impl/src/components/cancel_button.tsx +++ b/packages/shared-ux/file/file_upload/impl/src/components/cancel_button.tsx @@ -34,12 +34,13 @@ export const CancelButton: FunctionComponent<Props> = ({ onClick, compressed }) /> ) : ( <EuiButton + color="danger" + fill={true} key="cancelButton" size="s" data-test-subj="cancelButton" disabled={disabled} onClick={onClick} - color="danger" > {i18nTexts.cancel} </EuiButton> diff --git a/packages/shared-ux/file/file_upload/impl/src/components/upload_button.tsx b/packages/shared-ux/file/file_upload/impl/src/components/upload_button.tsx index ba712fefff53..447f6acfdcda 100644 --- a/packages/shared-ux/file/file_upload/impl/src/components/upload_button.tsx +++ b/packages/shared-ux/file/file_upload/impl/src/components/upload_button.tsx @@ -30,6 +30,7 @@ export const UploadButton: FunctionComponent<Props> = ({ onClick }) => { key="uploadButton" isLoading={uploading} color={done ? 'success' : 'primary'} + fill={true} iconType={done ? 'checkInCircleFilled' : undefined} disabled={Boolean(!files.length || error || done)} onClick={onClick} diff --git a/packages/shared-ux/file/file_upload/impl/src/file_upload.component.tsx b/packages/shared-ux/file/file_upload/impl/src/file_upload.component.tsx index 0cff9a248d13..d79bd18dc751 100644 --- a/packages/shared-ux/file/file_upload/impl/src/file_upload.component.tsx +++ b/packages/shared-ux/file/file_upload/impl/src/file_upload.component.tsx @@ -7,27 +7,30 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { css } from '@emotion/react'; import React from 'react'; +import useObservable from 'react-use/lib/useObservable'; + import { - EuiText, - EuiSpacer, - EuiFlexItem, - EuiFlexGroup, EuiFilePicker, + EuiFlexGroup, + EuiFlexItem, + EuiSpacer, + EuiText, useEuiTheme, useGeneratedHtmlId, + mathWithUnits, } from '@elastic/eui'; import type { EuiFilePickerClass, EuiFilePickerProps, } from '@elastic/eui/src/components/form/file_picker/file_picker'; -import { euiThemeVars } from '@kbn/ui-theme'; + import { useBehaviorSubject } from '@kbn/shared-ux-file-util'; -import { css } from '@emotion/react'; -import useObservable from 'react-use/lib/useObservable'; -import { i18nTexts } from './i18n_texts'; -import { ControlButton, ClearButton } from './components'; + +import { ClearButton, ControlButton } from './components'; import { useUploadState } from './context'; +import { i18nTexts } from './i18n_texts'; export interface Props { meta?: unknown; @@ -41,8 +44,6 @@ export interface Props { className?: string; } -const { euiFormMaxWidth, euiButtonHeightSmall } = euiThemeVars; - const styles = { horizontalContainer: css` display: flex; @@ -79,12 +80,15 @@ export const FileUpload = React.forwardRef<EuiFilePickerClass, Props>( const id = useGeneratedHtmlId({ prefix: 'filesFileUpload' }); const errorId = `${id}_error`; + // FIXME: add a token for this on euiTheme.components. https://github.com/elastic/eui/issues/8217 + const formMaxWidth = mathWithUnits(euiTheme.size.base, (x) => x * 25); + return ( <div data-test-subj="filesFileUpload" css={[ css` - max-width: ${fullWidth ? '100%' : euiFormMaxWidth}; + max-width: ${fullWidth ? '100%' : formMaxWidth}; `, fullWidth ? styles.fullWidth : undefined, compressed ? styles.horizontalContainer : undefined, @@ -143,7 +147,7 @@ export const FileUpload = React.forwardRef<EuiFilePickerClass, Props>( css={css` display: flex; align-items: center; - min-height: ${euiButtonHeightSmall}; + min-height: ${euiTheme.size.xl}; `} size="s" color="danger" diff --git a/packages/shared-ux/file/file_upload/impl/tsconfig.json b/packages/shared-ux/file/file_upload/impl/tsconfig.json index 81d7704f03f7..7fbdf2f04dc6 100644 --- a/packages/shared-ux/file/file_upload/impl/tsconfig.json +++ b/packages/shared-ux/file/file_upload/impl/tsconfig.json @@ -15,7 +15,6 @@ ], "kbn_references": [ "@kbn/i18n", - "@kbn/ui-theme", "@kbn/shared-ux-file-context", "@kbn/shared-ux-file-util", "@kbn/shared-ux-file-types", diff --git a/scripts/get_owners_for_file.js b/scripts/get_owners_for_file.js index f5a07b76ee04..15c21a3f06d9 100644 --- a/scripts/get_owners_for_file.js +++ b/scripts/get_owners_for_file.js @@ -8,4 +8,4 @@ */ require('../src/setup_node_env'); -require('@kbn/code-owners').runGetOwnersForFileCli(); +void require('@kbn/code-owners').cli.findCodeOwnersForPath(); diff --git a/scripts/relocate.js b/scripts/relocate.js new file mode 100644 index 000000000000..1a8c71373c67 --- /dev/null +++ b/scripts/relocate.js @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +require('../src/setup_node_env'); +require('@kbn/relocate').runKbnRelocateCli(); diff --git a/src/core/server/docs/kib_core_deprecations_service.mdx b/src/core/server/docs/kib_core_deprecations_service.mdx index 2594bd2f0dd6..1cf5fd50869f 100644 --- a/src/core/server/docs/kib_core_deprecations_service.mdx +++ b/src/core/server/docs/kib_core_deprecations_service.mdx @@ -152,9 +152,13 @@ coreSetup.deprecations.registerDeprecations({ ``` The `getDeprecations` function is invoked when the user requests to see the deprecations affecting their deployment. -The function provides a context object which contains a scoped Elasticsearch client and a saved objects client. +The function provides a context object which contains a scoped Elasticsearch client and a Saved Objects client. -To check the full TS types of the service please check the [generated core docs](../../../../docs/development/core/server/kibana-plugin-core-server.deprecationsservicesetup.md). +⚠️When using the Saved Objects client, bear in mind that all Spaces must be checked for deprecations: +By default, the Saved Objects client retrieves data from the current Space only. To override this behavior, add the +option `namespaces: ['*']` to search in all Spaces. When getting by ID, it's best to loop through all the spaces and get with `namespaces: [mySpaceOverride]`. + +To check the full TS types of the service please check the [generated core docs](https://docs.elastic.dev/kibana-dev-docs/api/kbn-core-deprecations-server). ### Example ```ts 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 b2d9693cfcc2..a9c62e1595ab 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 @@ -57,8 +57,8 @@ describe('checking migration metadata changes on all registered SO types', () => expect(hashMap).toMatchInlineSnapshot(` Object { "action": "0e6fc0b74c7312a8c11ff6b14437b93a997358b8", - "action_task_params": "b50cb5c8a493881474918e8d4985e61374ca4c30", - "ad_hoc_run_params": "d4e3c5c794151d0a4f5c71e886b2aa638da73ad2", + "action_task_params": "2e475d8b62e2de50b77f58cda309efb537e1d543", + "ad_hoc_run_params": "c7419760e878207231c3c8a25ec4d78360e07bf7", "alert": "556a03378f5ee1c31593c3a37c66b54555ee14ff", "api_key_pending_invalidation": "8f5554d1984854011b8392d9a6f7ef985bcac03c", "apm-custom-dashboards": "b67128f78160c288bd7efe25b2da6e2afd5e82fc", @@ -170,7 +170,7 @@ describe('checking migration metadata changes on all registered SO types', () => "synthetics-private-location": "8cecc9e4f39637d2f8244eb7985c0690ceab24be", "synthetics-privates-locations": "f53d799d5c9bc8454aaa32c6abc99a899b025d5c", "tag": "e2544392fe6563e215bb677abc8b01c2601ef2dc", - "task": "3c89a7c918d5b896a5f8800f06e9114ad7e7aea3", + "task": "ca8020259e46f713965a754ffae286c02d3cf05d", "telemetry": "7b00bcf1c7b4f6db1192bb7405a6a63e78b699fd", "threshold-explorer-view": "175306806f9fc8e13fcc1c8953ec4ba89bda1b70", "ui-metric": "d227284528fd19904e9d972aea0a13716fc5fe24", diff --git a/src/core/server/integration_tests/logging/rolling_file_appender.test.ts b/src/core/server/integration_tests/logging/rolling_file_appender.test.ts index d21724be2de0..c9d2ce5a62d2 100644 --- a/src/core/server/integration_tests/logging/rolling_file_appender.test.ts +++ b/src/core/server/integration_tests/logging/rolling_file_appender.test.ts @@ -13,7 +13,7 @@ import moment from 'moment-timezone'; import { getNextRollingTime } from '@kbn/core-logging-server-internal'; import { createRoot as createkbnTestServerRoot } from '@kbn/core-test-helpers-kbn-server'; -const flushDelay = 250; +const flushDelay = 2000; const delay = (waitInMs: number) => new Promise((resolve) => setTimeout(resolve, waitInMs)); const flush = async () => delay(flushDelay); diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile index 94d604d72656..e868cb73cb8d 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/base/Dockerfile @@ -134,7 +134,7 @@ RUN for iter in {1..10}; do \ (exit $exit_code) {{/ubuntu}} {{#wolfi}} -RUN apk --no-cache add bash curl fontconfig libstdc++ libnss findutils shadow +RUN apk --no-cache add bash curl fontconfig libstdc++ libnss findutils shadow ca-certificates {{/wolfi}} # Bring in Kibana from the initial stage. diff --git a/src/dev/storybook/aliases.ts b/src/dev/storybook/aliases.ts index c89df73f1b87..9e2919616bc7 100644 --- a/src/dev/storybook/aliases.ts +++ b/src/dev/storybook/aliases.ts @@ -29,10 +29,9 @@ export const storybookAliases = { dashboard: 'src/plugins/dashboard/.storybook', data: 'src/plugins/data/.storybook', discover: 'src/plugins/discover/.storybook', - embeddable: 'src/plugins/embeddable/.storybook', esql_ast_inspector: 'examples/esql_ast_inspector/.storybook', es_ui_shared: 'src/plugins/es_ui_shared/.storybook', - expandable_flyout: 'packages/kbn-expandable-flyout/.storybook', + expandable_flyout: 'x-pack/solutions/security/packages/kbn-expandable-flyout/.storybook', expression_error: 'src/plugins/expression_error/.storybook', expression_image: 'src/plugins/expression_image/.storybook', expression_metric_vis: 'src/plugins/chart_expressions/expression_legacy_metric/.storybook', @@ -47,16 +46,16 @@ export const storybookAliases = { home: 'src/plugins/home/.storybook', infra: 'x-pack/plugins/observability_solution/infra/.storybook', inventory: 'x-pack/plugins/observability_solution/inventory/.storybook', - investigate: 'x-pack/plugins/observability_solution/investigate_app/.storybook', + investigate: 'x-pack/solutions/observability/plugins/investigate_app/.storybook', kibana_react: 'src/plugins/kibana_react/.storybook', lists: 'x-pack/plugins/lists/.storybook', logs_explorer: 'x-pack/plugins/observability_solution/logs_explorer/.storybook', management: 'packages/kbn-management/storybook/config', - observability: 'x-pack/plugins/observability_solution/observability/.storybook', + observability: 'x-pack/solutions/observability/plugins/observability/.storybook', observability_ai_assistant: - 'x-pack/plugins/observability_solution/observability_ai_assistant/.storybook', + 'x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook', observability_ai_assistant_app: - 'x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook', + 'x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook', observability_inventory: 'x-pack/plugins/observability_solution/inventory/.storybook', observability_shared: 'x-pack/plugins/observability_solution/observability_shared/.storybook', observability_slo: 'x-pack/plugins/observability_solution/slo/.storybook', @@ -64,11 +63,11 @@ export const storybookAliases = { random_sampling: 'x-pack/packages/kbn-random-sampling/.storybook', esql_editor: 'src/platform/packages/private/kbn-esql-editor/.storybook', security_solution: 'x-pack/plugins/security_solution/.storybook', - security_solution_packages: 'x-pack/packages/security-solution/storybook/config', + security_solution_packages: 'x-pack/solutions/security/packages/storybook/config', serverless: 'packages/serverless/storybook/config', shared_ux: 'packages/shared-ux/storybook/config', slo: 'x-pack/plugins/observability_solution/slo/.storybook', - threat_intelligence: 'x-pack/plugins/threat_intelligence/.storybook', + threat_intelligence: 'x-pack/solutions/security/plugins/threat_intelligence/.storybook', triggers_actions_ui: 'x-pack/plugins/triggers_actions_ui/.storybook', ui_actions_enhanced: 'src/plugins/ui_actions_enhanced/.storybook', unified_search: 'src/plugins/unified_search/.storybook', diff --git a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx index eb3da01abd50..628bab839bdb 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx +++ b/src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx @@ -169,25 +169,25 @@ export const ESQLEditor = memo(function ESQLEditor({ const currentSelection = editor1?.current?.getSelection(); const startLineNumber = currentSelection?.startLineNumber; const endLineNumber = currentSelection?.endLineNumber; + const edits = []; if (startLineNumber && endLineNumber) { for (let lineNumber = startLineNumber; lineNumber <= endLineNumber; lineNumber++) { const lineContent = editorModel.current?.getLineContent(lineNumber) ?? ''; const hasComment = lineContent?.startsWith('//'); const commentedLine = hasComment ? lineContent?.replace('//', '') : `//${lineContent}`; - // executeEdits allows to keep edit in history - editor1.current?.executeEdits('comment', [ - { - range: { - startLineNumber: lineNumber, - startColumn: 0, - endLineNumber: lineNumber, - endColumn: (lineContent?.length ?? 0) + 1, - }, - text: commentedLine, + edits.push({ + range: { + startLineNumber: lineNumber, + startColumn: 0, + endLineNumber: lineNumber, + endColumn: (lineContent?.length ?? 0) + 1, }, - ]); + text: commentedLine, + }); } + // executeEdits allows to keep edit in history + editor1.current?.executeEdits('comment', edits); } }, []); diff --git a/src/platform/packages/private/kbn-esql-editor/src/fetch_fields_from_esql.ts b/src/platform/packages/private/kbn-esql-editor/src/fetch_fields_from_esql.ts index 7df17498b803..9098ef2bd9ed 100644 --- a/src/platform/packages/private/kbn-esql-editor/src/fetch_fields_from_esql.ts +++ b/src/platform/packages/private/kbn-esql-editor/src/fetch_fields_from_esql.ts @@ -12,7 +12,7 @@ import { lastValueFrom } from 'rxjs'; import { Query, AggregateQuery, TimeRange } from '@kbn/es-query'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; import type { Datatable } from '@kbn/expressions-plugin/public'; -import { type DataView, textBasedQueryStateToAstWithValidation } from '@kbn/data-plugin/common'; +import { textBasedQueryStateToAstWithValidation } from '@kbn/data-plugin/common'; interface TextBasedLanguagesErrorResponse { error: { @@ -26,16 +26,20 @@ export function fetchFieldsFromESQL( expressions: ExpressionsStart, time?: TimeRange, abortController?: AbortController, - dataView?: DataView + timeFieldName?: string ) { return textBasedQueryStateToAstWithValidation({ query, time, - dataView, + timeFieldName, }) .then((ast) => { if (ast) { - const executionContract = expressions.execute(ast, null); + const executionContract = expressions.execute(ast, null, { + searchContext: { + timeRange: time, + }, + }); if (abortController) { abortController.signal.onabort = () => { diff --git a/packages/deeplinks/observability/README.md b/src/platform/packages/shared/deeplinks/observability/README.md similarity index 100% rename from packages/deeplinks/observability/README.md rename to src/platform/packages/shared/deeplinks/observability/README.md diff --git a/packages/deeplinks/observability/constants.ts b/src/platform/packages/shared/deeplinks/observability/constants.ts similarity index 100% rename from packages/deeplinks/observability/constants.ts rename to src/platform/packages/shared/deeplinks/observability/constants.ts diff --git a/packages/deeplinks/observability/deep_links.ts b/src/platform/packages/shared/deeplinks/observability/deep_links.ts similarity index 100% rename from packages/deeplinks/observability/deep_links.ts rename to src/platform/packages/shared/deeplinks/observability/deep_links.ts diff --git a/packages/deeplinks/observability/index.ts b/src/platform/packages/shared/deeplinks/observability/index.ts similarity index 100% rename from packages/deeplinks/observability/index.ts rename to src/platform/packages/shared/deeplinks/observability/index.ts diff --git a/src/platform/packages/shared/deeplinks/observability/jest.config.js b/src/platform/packages/shared/deeplinks/observability/jest.config.js new file mode 100644 index 000000000000..132706f9af30 --- /dev/null +++ b/src/platform/packages/shared/deeplinks/observability/jest.config.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/src/platform/packages/shared/deeplinks/observability'], +}; diff --git a/packages/deeplinks/observability/kibana.jsonc b/src/platform/packages/shared/deeplinks/observability/kibana.jsonc similarity index 100% rename from packages/deeplinks/observability/kibana.jsonc rename to src/platform/packages/shared/deeplinks/observability/kibana.jsonc diff --git a/packages/deeplinks/observability/locators/dataset_quality.ts b/src/platform/packages/shared/deeplinks/observability/locators/dataset_quality.ts similarity index 100% rename from packages/deeplinks/observability/locators/dataset_quality.ts rename to src/platform/packages/shared/deeplinks/observability/locators/dataset_quality.ts diff --git a/packages/deeplinks/observability/locators/dataset_quality_details.ts b/src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts similarity index 100% rename from packages/deeplinks/observability/locators/dataset_quality_details.ts rename to src/platform/packages/shared/deeplinks/observability/locators/dataset_quality_details.ts diff --git a/packages/deeplinks/observability/locators/index.ts b/src/platform/packages/shared/deeplinks/observability/locators/index.ts similarity index 100% rename from packages/deeplinks/observability/locators/index.ts rename to src/platform/packages/shared/deeplinks/observability/locators/index.ts diff --git a/packages/deeplinks/observability/locators/logs_explorer.ts b/src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts similarity index 100% rename from packages/deeplinks/observability/locators/logs_explorer.ts rename to src/platform/packages/shared/deeplinks/observability/locators/logs_explorer.ts diff --git a/packages/deeplinks/observability/locators/observability_logs_explorer.ts b/src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts similarity index 100% rename from packages/deeplinks/observability/locators/observability_logs_explorer.ts rename to src/platform/packages/shared/deeplinks/observability/locators/observability_logs_explorer.ts diff --git a/packages/deeplinks/observability/locators/observability_onboarding.ts b/src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts similarity index 100% rename from packages/deeplinks/observability/locators/observability_onboarding.ts rename to src/platform/packages/shared/deeplinks/observability/locators/observability_onboarding.ts diff --git a/packages/deeplinks/observability/locators/uptime.ts b/src/platform/packages/shared/deeplinks/observability/locators/uptime.ts similarity index 100% rename from packages/deeplinks/observability/locators/uptime.ts rename to src/platform/packages/shared/deeplinks/observability/locators/uptime.ts diff --git a/packages/deeplinks/observability/package.json b/src/platform/packages/shared/deeplinks/observability/package.json similarity index 100% rename from packages/deeplinks/observability/package.json rename to src/platform/packages/shared/deeplinks/observability/package.json diff --git a/src/platform/packages/shared/deeplinks/observability/tsconfig.json b/src/platform/packages/shared/deeplinks/observability/tsconfig.json new file mode 100644 index 000000000000..e1c207f1ba4d --- /dev/null +++ b/src/platform/packages/shared/deeplinks/observability/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/utility-types", + "@kbn/es-query", + ] +} diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts index 6fb176c9624f..865d8ef64e27 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/__tests__/commands.test.ts @@ -141,6 +141,35 @@ describe('commands', () => { ]); }); + it('KEEP (with param)', () => { + const query = 'FROM index | KEEP abc, ?param'; + const { ast } = parse(query); + + expect(ast).toMatchObject([ + {}, + { + type: 'command', + name: 'keep', + args: [ + { + type: 'column', + name: 'abc', + }, + { + type: 'column', + args: [ + { + type: 'literal', + literalType: 'param', + value: 'param', + }, + ], + }, + ], + }, + ]); + }); + it('SORT', () => { const query = 'FROM index | SORT 1'; const { ast } = parse(query); diff --git a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts index 388469e82ab9..feada64c3cf9 100644 --- a/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts +++ b/src/platform/packages/shared/kbn-esql-ast/src/parser/factories.ts @@ -526,11 +526,21 @@ export function createColumn(ctx: ParserRuleContext): ESQLColumn { if (ctx instanceof QualifiedNamePatternContext) { const list = ctx.identifierPattern_list(); - for (const identifier of list) { - const name = parseIdentifier(identifier.getText()); - const node = Builder.identifier({ name }, createParserFields(identifier)); + for (const identifierPattern of list) { + const ID_PATTERN = identifierPattern.ID_PATTERN(); - args.push(node); + if (ID_PATTERN) { + const name = parseIdentifier(ID_PATTERN.getText()); + const node = Builder.identifier({ name }, createParserFields(identifierPattern)); + + args.push(node); + } else { + const parameter = createParam(identifierPattern.parameter()); + + if (parameter) { + args.push(parameter); + } + } } } else if (ctx instanceof QualifiedNameContext) { const list = ctx.identifierOrParameter_list(); diff --git a/src/plugins/ai_assistant_management/selection/README.md b/src/platform/plugins/shared/ai_assistant_management/selection/README.md similarity index 100% rename from src/plugins/ai_assistant_management/selection/README.md rename to src/platform/plugins/shared/ai_assistant_management/selection/README.md diff --git a/src/plugins/ai_assistant_management/selection/common/ai_assistant_type.ts b/src/platform/plugins/shared/ai_assistant_management/selection/common/ai_assistant_type.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/common/ai_assistant_type.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/common/ai_assistant_type.ts diff --git a/src/plugins/ai_assistant_management/selection/common/ui_setting_keys.ts b/src/platform/plugins/shared/ai_assistant_management/selection/common/ui_setting_keys.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/common/ui_setting_keys.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/common/ui_setting_keys.ts diff --git a/src/platform/plugins/shared/ai_assistant_management/selection/jest.config.js b/src/platform/plugins/shared/ai_assistant_management/selection/jest.config.js new file mode 100644 index 000000000000..7082a96250d3 --- /dev/null +++ b/src/platform/plugins/shared/ai_assistant_management/selection/jest.config.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: ['<rootDir>/src/platform/plugins/shared/ai_assistant_management/selection'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/src/platform/plugins/shared/ai_assistant_management/selection', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '<rootDir>/src/platform/plugins/shared/ai_assistant_management/selection/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/src/plugins/ai_assistant_management/selection/kibana.jsonc b/src/platform/plugins/shared/ai_assistant_management/selection/kibana.jsonc similarity index 100% rename from src/plugins/ai_assistant_management/selection/kibana.jsonc rename to src/platform/plugins/shared/ai_assistant_management/selection/kibana.jsonc diff --git a/src/plugins/ai_assistant_management/selection/public/app_context.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/app_context.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/app_context.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/app_context.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/index.ts b/src/platform/plugins/shared/ai_assistant_management/selection/public/index.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/index.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/public/index.ts diff --git a/src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/management_section/mount_section.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/management_section/mount_section.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/plugin.ts b/src/platform/plugins/shared/ai_assistant_management/selection/public/plugin.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/plugin.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/public/plugin.ts diff --git a/src/plugins/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.test.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.test.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.test.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.test.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/ai_assistant_selection_page.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/routes/components/redirect_to_home_if_unauthorized.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/redirect_to_home_if_unauthorized.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/routes/components/redirect_to_home_if_unauthorized.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/routes/components/redirect_to_home_if_unauthorized.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/routes/config.tsx b/src/platform/plugins/shared/ai_assistant_management/selection/public/routes/config.tsx similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/routes/config.tsx rename to src/platform/plugins/shared/ai_assistant_management/selection/public/routes/config.tsx diff --git a/src/plugins/ai_assistant_management/selection/public/types.ts b/src/platform/plugins/shared/ai_assistant_management/selection/public/types.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/public/types.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/public/types.ts diff --git a/src/plugins/ai_assistant_management/selection/server/config.ts b/src/platform/plugins/shared/ai_assistant_management/selection/server/config.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/server/config.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/server/config.ts diff --git a/src/plugins/ai_assistant_management/selection/server/index.ts b/src/platform/plugins/shared/ai_assistant_management/selection/server/index.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/server/index.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/server/index.ts diff --git a/src/plugins/ai_assistant_management/selection/server/plugin.ts b/src/platform/plugins/shared/ai_assistant_management/selection/server/plugin.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/server/plugin.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/server/plugin.ts diff --git a/src/plugins/ai_assistant_management/selection/server/types.ts b/src/platform/plugins/shared/ai_assistant_management/selection/server/types.ts similarity index 100% rename from src/plugins/ai_assistant_management/selection/server/types.ts rename to src/platform/plugins/shared/ai_assistant_management/selection/server/types.ts diff --git a/src/platform/plugins/shared/ai_assistant_management/selection/tsconfig.json b/src/platform/plugins/shared/ai_assistant_management/selection/tsconfig.json new file mode 100644 index 000000000000..0fc6cec45481 --- /dev/null +++ b/src/platform/plugins/shared/ai_assistant_management/selection/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["common/**/*", "public/**/*", "server/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/management-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/core-chrome-browser", + "@kbn/typed-react-router-config", + "@kbn/serverless", + "@kbn/config-schema", + "@kbn/core-plugins-server", + "@kbn/features-plugin", + "@kbn/config", + "@kbn/doc-links" + ], + "exclude": ["target/**/*"] +} diff --git a/src/plugins/ai_assistant_management/selection/jest.config.js b/src/plugins/ai_assistant_management/selection/jest.config.js deleted file mode 100644 index 9106de820a29..000000000000 --- a/src/plugins/ai_assistant_management/selection/jest.config.js +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/src/plugins/ai_assistant_management/selection'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/src/plugins/ai_assistant_management/selection', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/src/plugins/ai_assistant_management/selection/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/src/plugins/ai_assistant_management/selection/tsconfig.json b/src/plugins/ai_assistant_management/selection/tsconfig.json deleted file mode 100644 index 6bd8efe0e80b..000000000000 --- a/src/plugins/ai_assistant_management/selection/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": ["common/**/*", "public/**/*", "server/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/home-plugin", - "@kbn/kibana-react-plugin", - "@kbn/management-plugin", - "@kbn/i18n", - "@kbn/i18n-react", - "@kbn/core-chrome-browser", - "@kbn/typed-react-router-config", - "@kbn/serverless", - "@kbn/config-schema", - "@kbn/core-plugins-server", - "@kbn/features-plugin", - "@kbn/config", - "@kbn/doc-links" - ], - "exclude": ["target/**/*"] -} diff --git a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts index 5e4bd45c03f5..0a00a0cbf73d 100644 --- a/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts +++ b/src/plugins/chart_expressions/expression_metric/common/expression_functions/metric_vis_function.ts @@ -212,7 +212,7 @@ export const metricVisFunction = (): MetricVisExpressionFunctionDefinition => ({ secondaryPrefix: args.secondaryPrefix, color: args.color, icon: args.icon, - palette: args.palette?.params, + palette: args.palette, progressDirection: args.progressDirection, titlesTextAlign: args.titlesTextAlign, valuesTextAlign: args.valuesTextAlign, diff --git a/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts index 2eae93f88c02..f07a8297540e 100644 --- a/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_metric/common/types/expression_renderers.ts @@ -10,6 +10,7 @@ import { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common'; import { CustomPaletteState } from '@kbn/charts-plugin/common'; import { LayoutDirection, MetricStyle } from '@elastic/charts'; +import { PaletteOutput } from '@kbn/coloring'; import { TrendlineResult } from './expression_functions'; export const visType = 'metric'; @@ -26,7 +27,7 @@ export interface MetricVisParam { secondaryPrefix?: string; color?: string; icon?: string; - palette?: CustomPaletteState; + palette?: PaletteOutput<CustomPaletteState>; progressDirection?: LayoutDirection; titlesTextAlign: MetricStyle['titlesTextAlign']; valuesTextAlign: MetricStyle['valuesTextAlign']; 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 38d8e4d695c8..db0a85f1f9f3 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 @@ -27,6 +27,7 @@ import { CustomPaletteState } from '@kbn/charts-plugin/common/expressions/palett import { DimensionsVisParam, MetricVisParam } from '../../common'; import { euiThemeVars } from '@kbn/ui-theme'; import { DEFAULT_TRENDLINE_NAME } from '../../common/constants'; +import { PaletteOutput } from '@kbn/coloring'; import { faker } from '@faker-js/faker'; const mockDeserialize = jest.fn(({ id }: { id: string }) => { @@ -1160,12 +1161,16 @@ describe('MetricVisComponent', function () { // should be overridden color: 'static-color', palette: { - colors: [], - gradient: true, - stops: [], - range: 'number', - rangeMin: 2, - rangeMax: 10, + type: 'palette', + name: 'default', + params: { + colors: [], + gradient: true, + stops: [], + range: 'number', + rangeMin: 2, + rangeMax: 10, + }, }, }, }} @@ -1200,7 +1205,7 @@ describe('MetricVisComponent', function () { describe('percent-based', () => { const renderWithPalette = ( - palette: CustomPaletteState, + palette: PaletteOutput<CustomPaletteState>, dimensions: MetricVisComponentProps['config']['dimensions'] ) => shallow( @@ -1238,13 +1243,17 @@ describe('MetricVisComponent', function () { renderWithPalette( { - range: 'percent', - // the rest of these params don't matter - colors: [], - gradient: false, - stops: [], - rangeMin: 2, - rangeMax: 10, + type: 'palette', + name: 'default', + params: { + range: 'percent', + // the rest of these params don't matter + colors: [], + gradient: false, + stops: [], + rangeMin: 2, + rangeMax: 10, + }, }, dimensions as DimensionsVisParam ); 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 4a75f5cdf7b0..00fe4ac948f0 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 @@ -36,7 +36,7 @@ import { FieldFormatConvertFunction, SerializedFieldFormat, } from '@kbn/field-formats-plugin/common'; -import { CUSTOM_PALETTE } from '@kbn/coloring'; +import { CUSTOM_PALETTE, PaletteOutput } from '@kbn/coloring'; import { css } from '@emotion/react'; import { euiThemeVars } from '@kbn/ui-theme'; import { useResizeObserver, useEuiScrollBar, EuiIcon } from '@elastic/eui'; @@ -100,14 +100,14 @@ const getMetricFormatter = ( const getColor = ( value: number, - paletteParams: CustomPaletteState, + palette: PaletteOutput<CustomPaletteState>, accessors: { metric: string; max?: string; breakdownBy?: string }, data: Datatable, rowNumber: number ) => { const { min, max } = getDataBoundsForPalette(accessors, data, rowNumber); - return getPaletteService().get(CUSTOM_PALETTE)?.getColorForValue?.(value, paletteParams, { + return getPaletteService().get(CUSTOM_PALETTE)?.getColorForValue?.(value, palette.params, { min, max, }); @@ -236,7 +236,7 @@ export const MetricVis = ({ icon: config.metric?.icon ? getIcon(config.metric?.icon) : undefined, extra: renderSecondaryMetric(data.columns, row, config), color: - config.metric.palette && value != null + config.metric.palette?.params && value != null ? getColor( value, config.metric.palette, diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.tsx b/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.tsx index 816a10509b42..549742b7e340 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.tsx +++ b/src/plugins/chart_expressions/expression_partition_vis/public/components/partition_vis_component.tsx @@ -41,6 +41,7 @@ import { } from '@kbn/expressions-plugin/public'; import type { FieldFormat } from '@kbn/field-formats-plugin/common'; import { getOverridesFor } from '@kbn/chart-expressions-common'; +import { useKbnPalettes } from '@kbn/palettes'; import { useAppFixedViewport } from '@kbn/core-rendering-browser'; import { consolidateMetricColumns } from '../../common/utils'; import { DEFAULT_PERCENT_DECIMALS } from '../../common/constants'; @@ -117,6 +118,7 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => { } = props; const visParams = useMemo(() => filterOutConfig(visType, preVisParams), [preVisParams, visType]); const chartBaseTheme = props.chartsThemeService.useChartsBaseTheme(); + const palettes = useKbnPalettes(); const { table: visData, @@ -312,6 +314,7 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => { { ...props.uiState?.get('vis.colors', {}), ...props.visParams.labels.colorOverrides }, visData.rows, props.palettesRegistry, + palettes, formatters, services.fieldFormats, syncColors, @@ -325,6 +328,7 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => { props.uiState, props.visParams.labels.colorOverrides, props.palettesRegistry, + palettes, formatters, services.fieldFormats, syncColors, diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts index dcfcccaa3b53..8368e98b8371 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/colors/color_mapping_accessors.ts @@ -8,7 +8,7 @@ */ import { NodeColorAccessor, PATH_KEY } from '@elastic/charts'; -import { lightenColor } from '@kbn/charts-plugin/public'; +import { decreaseOpacity } from '@kbn/charts-plugin/public'; import { MultiFieldKey } from '@kbn/data-plugin/common'; import { getColorFactory } from '@kbn/coloring'; import { isMultiFieldKey } from '@kbn/data-plugin/common'; @@ -34,8 +34,8 @@ const getPieFillColor = // first two are: small multiple and pie whole center. const category = getCategoryKeys(path[2].value); const color = getColorFn(category); - // increase the lightness of the color on each layer. - return lightenColor(color, layerIndex + 1, numOfLayers); + // progressively decrease opacity of base color on each layer. + return decreaseOpacity(color, layerIndex + 1, numOfLayers); }; /** diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts index b6de7fc728ed..6bd8d188f78c 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_color.ts @@ -75,7 +75,7 @@ const getDistinctColor = ( isSplitChart: boolean, overwriteColors: { [key: string]: string } = {}, visParams: PartitionVisParams, - palettes: PaletteRegistry | null, + paletteService: PaletteRegistry | null, syncColors: boolean, { parentSeries, allSeries }: DistinctSeries, formattedCategoricalKey: string @@ -93,7 +93,7 @@ const getDistinctColor = ( const index = allSeries.findIndex((d) => isEqual(d, categoricalKey)); const isSplitParentLayer = isSplitChart && parentSeries.includes(categoricalKey); - return palettes?.get(visParams.palette.name).getCategoricalColor( + return paletteService?.get(visParams.palette.name).getCategoricalColor( [ { name: categoricalKey, @@ -207,7 +207,7 @@ export const getColor = ( distinctSeries: DistinctSeries, { columnsLength, rowsLength }: { columnsLength: number; rowsLength: number }, visParams: PartitionVisParams, - palettes: PaletteRegistry | null, + paletteService: PaletteRegistry | null, byDataPalette: ReturnType<typeof byDataColorPaletteMap> | undefined, syncColors: boolean, isDarkMode: boolean, @@ -230,7 +230,7 @@ export const getColor = ( isSplitChart, overwriteColors, visParams, - palettes, + paletteService, syncColors, distinctSeries, name @@ -271,7 +271,7 @@ export const getColor = ( } } - const outputColor = palettes?.get(visParams.palette.name).getCategoricalColor( + const outputColor = paletteService?.get(visParams.palette.name).getCategoricalColor( seriesLayers, { behindText: visParams.labels.show || isTreemapOrMosaicChart(chartType), diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.test.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.test.ts index d6c6e7d31592..eb211ad48189 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.test.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.test.ts @@ -13,8 +13,11 @@ import { BucketColumns, ChartTypes } from '../../../common/types'; import { createMockPieParams, createMockVisData } from '../../mocks'; import { getPaletteRegistry } from '../../__mocks__/palettes'; import { getLayers } from './get_layers'; +import { getKbnPalettes } from '@kbn/palettes'; describe('getLayers', () => { + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + it('preserves slice order for multi-metric layer', () => { const visData = createMockVisData(); const columns: BucketColumns[] = [ @@ -43,6 +46,7 @@ describe('getLayers', () => { {}, [], getPaletteRegistry(), + palettes, {}, fieldFormatsMock, false, @@ -153,6 +157,7 @@ describe('getLayers', () => { {}, [], getPaletteRegistry(), + palettes, {}, fieldFormatsMock, false, diff --git a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts index c83353d4d839..4346dd6ae492 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts +++ b/src/plugins/chart_expressions/expression_partition_vis/public/utils/layers/get_layers.ts @@ -8,19 +8,14 @@ */ import { Datum, PartitionLayer } from '@elastic/charts'; -import { - PaletteRegistry, - getColorFactory, - getPalette, - AVAILABLE_PALETTES, - NeutralPalette, -} from '@kbn/coloring'; +import { PaletteRegistry, getColorFactory } from '@kbn/coloring'; import { i18n } from '@kbn/i18n'; import { FieldFormat } from '@kbn/field-formats-plugin/common'; import type { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import type { Datatable, DatatableRow } from '@kbn/expressions-plugin/public'; import { getColorCategories } from '@kbn/chart-expressions-common'; +import { KbnPalettes } from '@kbn/palettes'; import { getDistinctSeries } from '..'; import { BucketColumns, ChartTypes, PartitionVisParams } from '../../../common/types'; import { sortPredicateByType, sortPredicateSaveSourceOrder } from './sort_predicate'; @@ -41,7 +36,8 @@ export const getLayers = ( visData: Datatable, overwriteColors: { [key: string]: string } = {}, rows: DatatableRow[], - palettes: PaletteRegistry | null, + paletteService: PaletteRegistry | null, + palettes: KbnPalettes, formatters: Record<string, FieldFormat | undefined>, formatter: FieldFormatsStart, syncColors: boolean, @@ -59,11 +55,11 @@ export const getLayers = ( const isSplitChart = Boolean(visParams.dimensions.splitColumn || visParams.dimensions.splitRow); let byDataPalette: ReturnType<typeof byDataColorPaletteMap>; - if (!syncColors && columns[1]?.id && palettes && visParams.palette) { + if (!syncColors && columns[1]?.id && paletteService && visParams.palette) { byDataPalette = byDataColorPaletteMap( rows, columns[1], - palettes?.get(visParams.palette.name), + paletteService?.get(visParams.palette.name), visParams.palette, formatters, formatter @@ -79,8 +75,9 @@ export const getLayers = ( chartType, columns, rows, - isDarkMode, - visParams + palettes, + visParams, + isDarkMode ); return columns.map((col, layerIndex) => { @@ -110,7 +107,7 @@ export const getLayers = ( distinctSeries, { columnsLength: columns.length, rowsLength: rows.length }, visParams, - palettes, + paletteService, byDataPalette, syncColors, isDarkMode, @@ -131,8 +128,9 @@ function getColorFromMappingFactory( chartType: ChartTypes, columns: Array<Partial<BucketColumns>>, rows: DatatableRow[], - isDarkMode: boolean, - visParams: PartitionVisParams + palettes: KbnPalettes, + visParams: PartitionVisParams, + isDarkMode: boolean ): undefined | ((category: string | string[]) => string) { const { colorMapping, dimensions } = visParams; @@ -151,19 +149,14 @@ function getColorFromMappingFactory( } // the mosaic configures the main categories in the second column, instead of the first // as it happens in all the other partition types. - // Independentely from the bucket aggregation used, the categories will always be casted + // Independently from the bucket aggregation used, the categories will always be casted // as string to make it nicely working with a text input field, avoiding a field const categories = chartType === ChartTypes.MOSAIC && columns.length === 2 ? getColorCategories(rows, columns[1]?.id) : getColorCategories(rows, columns[0]?.id); - return getColorFactory( - JSON.parse(colorMapping), - getPalette(AVAILABLE_PALETTES, NeutralPalette), - isDarkMode, - { - type: 'categories', - categories, - } - ); + return getColorFactory(JSON.parse(colorMapping), palettes, isDarkMode, { + type: 'categories', + categories, + }); } diff --git a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json index 1d8c4c409872..ec1ac8ee94ed 100644 --- a/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json +++ b/src/plugins/chart_expressions/expression_partition_vis/tsconfig.json @@ -31,6 +31,7 @@ "@kbn/cell-actions", "@kbn/react-kibana-context-render", "@kbn/core-rendering-browser", + "@kbn/palettes", ], "exclude": [ "target/**/*", 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 12a7991a68ad..46064ebd6b6e 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 @@ -23,19 +23,13 @@ import { WordCloudElementEvent, } from '@elastic/charts'; import { EmptyPlaceholder } from '@kbn/charts-plugin/public'; -import { - PaletteRegistry, - PaletteOutput, - getColorFactory, - getPalette, - AVAILABLE_PALETTES, - NeutralPalette, -} from '@kbn/coloring'; +import { PaletteRegistry, PaletteOutput, getColorFactory } from '@kbn/coloring'; import { IInterpreterRenderHandlers, DatatableRow } from '@kbn/expressions-plugin/public'; import { getColorCategories, getOverridesFor } from '@kbn/chart-expressions-common'; import type { AllowedSettingsOverrides, AllowedChartOverrides } from '@kbn/charts-plugin/common'; import { getColumnByAccessor, getFormatByAccessor } from '@kbn/visualizations-plugin/common/utils'; import { isMultiFieldKey } from '@kbn/data-plugin/common'; +import { KbnPalettes, useKbnPalettes } from '@kbn/palettes'; import { getFormatService } from '../format_service'; import { TagcloudRendererConfig } from '../../common/types'; import { ScaleOptions, Orientation } from '../../common/constants'; @@ -56,13 +50,13 @@ const calculateWeight = (value: number, x1: number, y1: number, x2: number, y2: ((value - x1) * (y2 - x2)) / (y1 - x1) + x2; const getColor = ( - palettes: PaletteRegistry, + paletteService: PaletteRegistry, activePalette: PaletteOutput, text: string, values: string[], syncColors: boolean ) => { - return palettes?.get(activePalette?.name)?.getCategoricalColor( + return paletteService?.get(activePalette?.name)?.getCategoricalColor( [ { name: text, @@ -106,6 +100,7 @@ export const TagCloudChart = ({ isDarkMode, }: TagCloudChartProps) => { const [warning, setWarning] = useState(false); + const palettes = useKbnPalettes(); const { bucket, metric, scale, palette, showLabel, orientation, colorMapping } = visParams; const bucketFormatter = useMemo(() => { @@ -128,6 +123,7 @@ export const TagCloudChart = ({ const colorFromMappingFn = getColorFromMappingFactory( tagColumn, visData.rows, + palettes, isDarkMode, colorMapping ); @@ -149,15 +145,16 @@ export const TagCloudChart = ({ }); }, [ bucket, - bucketFormatter, - metric, - palette, - palettesRegistry, - syncColors, visData.columns, visData.rows, - colorMapping, + metric, + palettes, isDarkMode, + colorMapping, + bucketFormatter, + palettesRegistry, + palette, + syncColors, ]); useEffect(() => { @@ -320,6 +317,7 @@ export { TagCloudChart as default }; function getColorFromMappingFactory( tagColumn: string | undefined, rows: DatatableRow[], + palettes: KbnPalettes, isDarkMode: boolean, colorMapping?: string ): undefined | ((category: string | string[]) => string) { @@ -327,13 +325,8 @@ function getColorFromMappingFactory( // return undefined, we will use the legacy color mapping instead return undefined; } - return getColorFactory( - JSON.parse(colorMapping), - getPalette(AVAILABLE_PALETTES, NeutralPalette), - isDarkMode, - { - type: 'categories', - categories: getColorCategories(rows, tagColumn), - } - ); + return getColorFactory(JSON.parse(colorMapping), palettes, isDarkMode, { + type: 'categories', + categories: getColorCategories(rows, tagColumn), + }); } diff --git a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json index 40caf4e3b00f..485c561bda28 100644 --- a/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json +++ b/src/plugins/chart_expressions/expression_tagcloud/tsconfig.json @@ -28,6 +28,7 @@ "@kbn/chart-icons", "@kbn/data-plugin", "@kbn/react-kibana-context-render", + "@kbn/palettes", ], "exclude": [ "target/**/*", 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 5cfd34c6c8b5..c01267bf3acd 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 @@ -1751,6 +1751,13 @@ exports[`XYChart component it renders area 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -3306,6 +3313,13 @@ exports[`XYChart component it renders bar 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -4861,6 +4875,13 @@ exports[`XYChart component it renders horizontal bar 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -6416,6 +6437,13 @@ exports[`XYChart component it renders line 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -7971,6 +7999,13 @@ exports[`XYChart component it renders stacked area 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -9526,6 +9561,13 @@ exports[`XYChart component it renders stacked bar 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -11081,6 +11123,13 @@ exports[`XYChart component it renders stacked horizontal bar 1`] = ` "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -12862,6 +12911,13 @@ exports[`XYChart component split chart should render split chart if both, splitR "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -14650,6 +14706,13 @@ exports[`XYChart component split chart should render split chart if splitColumnA "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" @@ -16436,6 +16499,13 @@ exports[`XYChart component split chart should render split chart if splitRowAcce "getAll": [MockFunction], } } + palettes={ + KbnPalettes { + "get": [Function], + "getAll": [Function], + "query": [Function], + } + } shouldShowValueLabels={true} syncColors={false} timeZone="UTC" 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 3335f2902990..df51a0869ece 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 @@ -20,6 +20,7 @@ import { PaletteRegistry } from '@kbn/coloring'; import { FormatFactory } from '@kbn/field-formats-plugin/common'; import { getAccessorByDimension } from '@kbn/visualizations-plugin/common/utils'; import { PersistedState } from '@kbn/visualizations-plugin/public'; +import { KbnPalettes } from '@kbn/palettes'; import { CommonXYDataLayerConfig, EndValue, @@ -49,6 +50,7 @@ interface Props { fittingFunction?: FittingFunction; endValue?: EndValue | undefined; paletteService: PaletteRegistry; + palettes: KbnPalettes; formattedDatatables: DatatablesWithFormatInfo; syncColors: boolean; timeZone: string; @@ -75,6 +77,7 @@ export const DataLayers: FC<Props> = ({ minBarHeight, formatFactory, paletteService, + palettes, fittingFunction, emphasizeFitting, yAxesConfiguration, @@ -163,6 +166,7 @@ export const DataLayers: FC<Props> = ({ formatFactory, columnToLabelMap, paletteService, + palettes, formattedDatatableInfo, syncColors, yAxis, diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx index 349af46eb101..3ebc9efcd6c0 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx @@ -38,6 +38,7 @@ import { IconType } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { PaletteRegistry } from '@kbn/coloring'; import { RenderMode } from '@kbn/expressions-plugin/common'; +import { useKbnPalettes } from '@kbn/palettes'; import { ESQL_TABLE_TYPE } from '@kbn/data-plugin/common'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { EmptyPlaceholder, LegendToggle } from '@kbn/charts-plugin/public'; @@ -233,6 +234,7 @@ export function XYChart({ const chartRef = useRef<Chart>(null); const chartBaseTheme = chartsThemeService.useChartsBaseTheme(); const darkMode = chartsThemeService.useDarkMode(); + const palettes = useKbnPalettes(); const appFixedViewport = useAppFixedViewport(); const filteredLayers = getFilteredLayers(layers); const layersById = filteredLayers.reduce<Record<string, CommonXYLayerConfig>>( @@ -989,6 +991,7 @@ export function XYChart({ minBarHeight={args.minBarHeight} formatFactory={formatFactory} paletteService={paletteService} + palettes={palettes} fittingFunction={fittingFunction} emphasizeFitting={emphasizeFitting} yAxesConfiguration={yAxesConfiguration} diff --git a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts index 650b8fba2a6d..71b8bb35ac22 100644 --- a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts +++ b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/index.ts @@ -8,4 +8,4 @@ */ export { getXyChartRenderer } from './xy_chart_renderer'; -export type { GetStartDepsFn } from './xy_chart_renderer'; +export type { GetStartDeps } from './xy_chart_renderer'; diff --git a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx index 57387a46388a..cb7a75fcdf69 100644 --- a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx @@ -32,6 +32,7 @@ import { extractVisualizationType, } from '@kbn/chart-expressions-common'; +import { ThemeServiceSetup } from '@kbn/core/public'; import type { getDataLayers } from '../helpers'; import { LayerTypes, SeriesTypes } from '../../common/constants'; import type { CommonXYDataLayerConfig, XYChartProps } from '../../common'; @@ -43,10 +44,11 @@ import type { StartServices, } from '../types'; -export type GetStartDepsFn = () => Promise<{ +export interface GetStartDeps { data: DataPublicPluginStart; formatFactory: FormatFactory; theme: ChartsPluginStart['theme']; + kibanaTheme: ThemeServiceSetup; activeCursor: ChartsPluginStart['activeCursor']; paletteService: PaletteRegistry; timeZone: string; @@ -55,10 +57,10 @@ export type GetStartDepsFn = () => Promise<{ usageCollection?: UsageCollectionStart; timeFormat: string; startServices: StartServices; -}>; +} interface XyChartRendererDeps { - getStartDeps: GetStartDepsFn; + getStartDeps: () => Promise<GetStartDeps>; } export const extractCounterEvents = ( diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts index 6923a9a2f540..93b498f5b57e 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/color/color_mapping_accessor.ts @@ -10,13 +10,14 @@ import { SeriesColorAccessorFn } from '@elastic/charts'; import { getColorFactory, type ColorMapping, type ColorMappingInputData } from '@kbn/coloring'; import { MULTI_FIELD_KEY_SEPARATOR } from '@kbn/data-plugin/common'; +import { KbnPalettes } from '@kbn/palettes'; /** * Return a color accessor function for XY charts depending on the split accessors received. */ export function getColorSeriesAccessorFn( config: ColorMapping.Config, - getPaletteFn: (paletteId: string) => ColorMapping.CategoricalPalette, + palettes: KbnPalettes, isDarkMode: boolean, mappingData: ColorMappingInputData, fieldId: string, @@ -28,7 +29,7 @@ export function getColorSeriesAccessorFn( [...specialTokens.entries()].map((d) => [d[1], d[0]]) ); - const getColor = getColorFactory(config, getPaletteFn, isDarkMode, mappingData); + const getColor = getColorFactory(config, palettes, isDarkMode, mappingData); return ({ splitAccessors }) => { const splitValue = splitAccessors.get(fieldId); 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 942909880f30..11cd6b05fc16 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 @@ -25,13 +25,9 @@ import { Datatable } from '@kbn/expressions-plugin/common'; import { getAccessorByDimension } from '@kbn/visualizations-plugin/common/utils'; import type { ExpressionValueVisDimension } from '@kbn/visualizations-plugin/common/expression_functions'; import { PaletteRegistry, SeriesLayer } from '@kbn/coloring'; -import { - getPalette, - AVAILABLE_PALETTES, - NeutralPalette, - SPECIAL_TOKENS_STRING_CONVERSION, -} from '@kbn/coloring'; +import { SPECIAL_TOKENS_STRING_CONVERSION } from '@kbn/coloring'; import { getColorCategories } from '@kbn/chart-expressions-common'; +import { KbnPalettes } from '@kbn/palettes'; import { isDataLayer } from '../../common/utils/layer_types_guards'; import { CommonXYDataLayerConfig, CommonXYLayerConfig, XScaleType } from '../../common'; import { AxisModes, SeriesTypes } from '../../common/constants'; @@ -54,6 +50,7 @@ type GetSeriesPropsFn = (config: { colorAssignments: ColorAssignments; columnToLabelMap: Record<string, string>; paletteService: PaletteRegistry; + palettes: KbnPalettes; yAxis?: GroupsConfiguration[number]; xAxis?: GroupsConfiguration[number]; syncColors: boolean; @@ -392,6 +389,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ formatFactory, columnToLabelMap, paletteService, + palettes, syncColors, yAxis, xAxis, @@ -490,7 +488,7 @@ export const getSeriesProps: GetSeriesPropsFn = ({ layer.colorMapping && splitColumnIds.length > 0 ? getColorSeriesAccessorFn( JSON.parse(layer.colorMapping), // the color mapping is at this point just a stringified JSON - getPalette(AVAILABLE_PALETTES, NeutralPalette), + palettes, isDarkMode, { type: 'categories', diff --git a/src/plugins/chart_expressions/expression_xy/public/plugin.ts b/src/plugins/chart_expressions/expression_xy/public/plugin.ts index 04ba0ac2b3bc..8415e2bc7d04 100755 --- a/src/plugins/chart_expressions/expression_xy/public/plugin.ts +++ b/src/plugins/chart_expressions/expression_xy/public/plugin.ts @@ -31,7 +31,7 @@ import { extendedAnnotationLayerFunction, referenceLineDecorationConfigFunction, } from '../common/expression_functions'; -import { GetStartDepsFn, getXyChartRenderer } from './expression_renderers'; +import { GetStartDeps, getXyChartRenderer } from './expression_renderers'; import { eventAnnotationsResult } from '../common/expression_functions/event_annotations_result'; export interface XYPluginStartDependencies { @@ -71,7 +71,7 @@ export class ExpressionXyPlugin { expressions.registerFunction(xyVisFunction); expressions.registerFunction(layeredXyVisFunction); - const getStartDeps: GetStartDepsFn = async () => { + const getStartDeps = async () => { const [coreStart, deps] = await core.getStartServices(); const { data, @@ -100,7 +100,7 @@ export class ExpressionXyPlugin { timeZone: getTimeZone(core.uiSettings), timeFormat: core.uiSettings.get('dateFormat'), startServices: coreStart, - }; + } satisfies GetStartDeps; }; expressions.registerRenderer(getXyChartRenderer({ getStartDeps })); diff --git a/src/plugins/chart_expressions/expression_xy/public/types.ts b/src/plugins/chart_expressions/expression_xy/public/types.ts index ed287da3801e..0187df456405 100755 --- a/src/plugins/chart_expressions/expression_xy/public/types.ts +++ b/src/plugins/chart_expressions/expression_xy/public/types.ts @@ -32,7 +32,7 @@ export interface StartDeps { expression: ExpressionsServiceStart; } -export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme'>; +export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme' | 'userProfile'>; export type ExpressionXyPluginSetup = void; export type ExpressionXyPluginStart = void; diff --git a/src/plugins/chart_expressions/expression_xy/tsconfig.json b/src/plugins/chart_expressions/expression_xy/tsconfig.json index cd8bd4db90b8..5ffa2904e04b 100644 --- a/src/plugins/chart_expressions/expression_xy/tsconfig.json +++ b/src/plugins/chart_expressions/expression_xy/tsconfig.json @@ -36,6 +36,7 @@ "@kbn/cell-actions", "@kbn/react-kibana-context-render", "@kbn/core-rendering-browser", + "@kbn/palettes", ], "exclude": [ "target/**/*", diff --git a/src/plugins/charts/public/index.ts b/src/plugins/charts/public/index.ts index 6b70018ac590..711f38b7d92f 100644 --- a/src/plugins/charts/public/index.ts +++ b/src/plugins/charts/public/index.ts @@ -22,7 +22,8 @@ export const plugin = () => new ChartsPlugin(); export type { ChartsPluginSetup, ChartsPluginStart } from './plugin'; export * from './static'; -export { lightenColor } from './services/palettes/lighten_color'; +export * from './services/palettes/lighten_color'; +export * from './services/palettes/decrease_opacity'; export { useActiveCursor } from './services/active_cursor'; export interface ClickTriggerEvent { diff --git a/src/plugins/charts/public/mocks.ts b/src/plugins/charts/public/mocks.ts index aa7518d1df9f..db6bd2bab421 100644 --- a/src/plugins/charts/public/mocks.ts +++ b/src/plugins/charts/public/mocks.ts @@ -7,6 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ +import { createCoreSetupMock } from '@kbn/core-lifecycle-browser-mocks/src/core_setup.mock'; import { ChartsPlugin } from './plugin'; import { themeServiceMock } from './services/theme/mock'; import { activeCursorMock } from './services/active_cursor/mock'; @@ -19,13 +20,13 @@ export type Start = jest.Mocked<ReturnType<ChartsPlugin['start']>>; const createSetupContract = (): Setup => ({ theme: themeServiceMock, - palettes: paletteServiceMock.setup(), + palettes: paletteServiceMock.setup(createCoreSetupMock().theme.getTheme()), }); const createStartContract = (): Start => ({ theme: themeServiceMock, activeCursor: activeCursorMock, - palettes: paletteServiceMock.setup(), + palettes: paletteServiceMock.setup(createCoreSetupMock().theme.getTheme()), }); export const chartPluginMock = { diff --git a/src/plugins/charts/public/plugin.ts b/src/plugins/charts/public/plugin.ts index 4d058c3beea3..06a7236545ab 100644 --- a/src/plugins/charts/public/plugin.ts +++ b/src/plugins/charts/public/plugin.ts @@ -42,8 +42,8 @@ export class ChartsPlugin implements Plugin<ChartsPluginSetup, ChartsPluginStart dependencies.expressions.registerFunction(palette); dependencies.expressions.registerFunction(systemPalette); this.themeService.init(core.theme); - this.palettes = this.paletteService.setup(); - + // TODO: make this reactive to changes in $theme + this.palettes = this.paletteService.setup(core.theme.getTheme()); this.activeCursor.setup(); return { diff --git a/src/plugins/charts/public/services/palettes/decrease_opacity.test.ts b/src/plugins/charts/public/services/palettes/decrease_opacity.test.ts new file mode 100644 index 000000000000..845021e76875 --- /dev/null +++ b/src/plugins/charts/public/services/palettes/decrease_opacity.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import chroma from 'chroma-js'; +import { decreaseOpacity } from './decrease_opacity'; + +describe('decrease_opacity', () => { + it('should keep existing color if there is a single color step', () => { + expect(decreaseOpacity('#FF0000', 1, 1)).toEqual('#FF0000'); + }); + + it('should keep existing color for the first step', () => { + expect(decreaseOpacity('#FF0000', 1, 10)).toEqual('#FF0000'); + }); + + it('should decrease color opacity', () => { + const baseColor = '#FF0000'; + + const color1 = chroma(decreaseOpacity(baseColor, 2, 4)); + const color2 = chroma(decreaseOpacity(baseColor, 3, 4)); + + expect(chroma(baseColor).luminance()).toBeLessThan(color1.luminance()); + expect(color1.luminance()).toBeLessThan(color2.luminance()); + }); + + it('should not exceed top luminance', () => { + const result = decreaseOpacity('#000', 12, 10); + + expect(chroma(result).luminance()).toBeLessThan(0.8); + }); +}); diff --git a/src/plugins/charts/public/services/palettes/decrease_opacity.ts b/src/plugins/charts/public/services/palettes/decrease_opacity.ts new file mode 100644 index 000000000000..bd49ba66b170 --- /dev/null +++ b/src/plugins/charts/public/services/palettes/decrease_opacity.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import chroma from 'chroma-js'; +import { euiThemeVars } from '@kbn/ui-theme'; + +const MIN_OPACITY = 0.2; + +/** + * Reduces color opacity, by mixing color with background color. + * + * This is used when the resulting color needs to be opaque (i.e. alpha of 1). + */ +export function decreaseOpacity(baseColor: string, step: number, totalSteps: number) { + if (totalSteps === 1) { + return baseColor; + } + + const backgroundColor = euiThemeVars.euiColorEmptyShade; + const ratio = Math.min(0.2 * (step - 1), 1 - MIN_OPACITY); + const color = chroma(baseColor).mix(backgroundColor, ratio, 'lch'); + + return color.hex().toUpperCase(); +} diff --git a/src/plugins/charts/public/services/palettes/lighten_color.ts b/src/plugins/charts/public/services/palettes/lighten_color.ts index 80298f5c8b53..b7c1908375eb 100644 --- a/src/plugins/charts/public/services/palettes/lighten_color.ts +++ b/src/plugins/charts/public/services/palettes/lighten_color.ts @@ -23,5 +23,6 @@ export function lightenColor(baseColor: string, step: number, totalSteps: number const currentLevelTargetLightness = outputColorLightness + lightnessSpace * ((step - 1) / (totalSteps - 1)); const lightenedColor = hslColor.lightness(currentLevelTargetLightness); + return lightenedColor.hex(); } diff --git a/src/plugins/charts/public/services/palettes/palettes.test.tsx b/src/plugins/charts/public/services/palettes/palettes.test.tsx index a9567b0c1217..a962da6776c4 100644 --- a/src/plugins/charts/public/services/palettes/palettes.test.tsx +++ b/src/plugins/charts/public/services/palettes/palettes.test.tsx @@ -11,7 +11,7 @@ import { buildPalettes } from './palettes'; import { euiPaletteColorBlind, euiPaletteColorBlindBehindText } from '@elastic/eui'; describe('palettes', () => { - const palettes = buildPalettes(); + const palettes = buildPalettes({ name: 'amsterdam', darkMode: false }); describe('default palette', () => { describe('syncColors: false', () => { diff --git a/src/plugins/charts/public/services/palettes/palettes.tsx b/src/plugins/charts/public/services/palettes/palettes.tsx index fc9d2370694b..4858bf0547d4 100644 --- a/src/plugins/charts/public/services/palettes/palettes.tsx +++ b/src/plugins/charts/public/services/palettes/palettes.tsx @@ -9,29 +9,19 @@ import chroma from 'chroma-js'; import { i18n } from '@kbn/i18n'; -import { - euiPaletteColorBlind, - euiPaletteCool, - euiPaletteGray, - euiPaletteRed, - euiPaletteGreen, - euiPaletteWarm, - euiPaletteForStatus, - euiPaletteForTemperature, - euiPaletteComplementary, - euiPaletteColorBlindBehindText, -} from '@elastic/eui'; +import { getKbnPalettes, KbnPalette, type IKbnPalette } from '@kbn/palettes'; import type { ChartColorConfiguration, PaletteDefinition, SeriesLayer } from '@kbn/coloring'; import { flatten, zip } from 'lodash'; +import { CoreTheme } from '@kbn/core/public'; import { createColorPalette as createLegacyColorPalette } from '../..'; -import { lightenColor } from './lighten_color'; import { MappedColors } from '../mapped_colors'; import { workoutColorForValue } from './helpers'; +import { decreaseOpacity } from './decrease_opacity'; function buildRoundRobinCategoricalWithMappedColors( - id = 'default', - colors = euiPaletteColorBlind({ rotations: 2 }), - behindTextColors = euiPaletteColorBlindBehindText({ rotations: 2 }) + id: string, + colors: string[], + behindTextColors?: string[] ): Omit<PaletteDefinition, 'title'> { const behindTextColorMap: Record<string, string> = Object.fromEntries( zip(colors, behindTextColors) @@ -50,21 +40,22 @@ function buildRoundRobinCategoricalWithMappedColors( const mappedColor = mappedColors.get(colorKey); outputColor = chartConfiguration.behindText ? behindTextColorMap[mappedColor] : mappedColor; } else { - outputColor = chartConfiguration.behindText - ? behindTextColors[series[0].rankAtDepth % behindTextColors.length] - : colors[series[0].rankAtDepth % colors.length]; + outputColor = + chartConfiguration.behindText && behindTextColors + ? behindTextColors[series[0].rankAtDepth % behindTextColors.length] + : colors[series[0].rankAtDepth % colors.length]; } if (!chartConfiguration.maxDepth || chartConfiguration.maxDepth === 1) { return outputColor; } - return lightenColor(outputColor, series.length, chartConfiguration.maxDepth); + return decreaseOpacity(outputColor, series.length, chartConfiguration.maxDepth); } return { id, getCategoricalColor: getColor, - getCategoricalColors: () => colors.slice(0, 10), + getCategoricalColors: (size: number) => colors.slice(0, size), toExpression: () => ({ type: 'expression', chain: [ @@ -80,29 +71,27 @@ function buildRoundRobinCategoricalWithMappedColors( }; } -function buildGradient( - id: string, - colors: (n: number) => string[] -): Omit<PaletteDefinition, 'title'> { +function buildGradient(id: string, palette: IKbnPalette): PaletteDefinition { function getColor( series: SeriesLayer[], chartConfiguration: ChartColorConfiguration = { behindText: false } ) { const totalSeriesAtDepth = series[0].totalSeriesAtDepth; const rankAtDepth = series[0].rankAtDepth; - const actualColors = colors(totalSeriesAtDepth); + const actualColors = palette.colors(totalSeriesAtDepth); const outputColor = actualColors[rankAtDepth]; if (!chartConfiguration.maxDepth || chartConfiguration.maxDepth === 1) { return outputColor; } - return lightenColor(outputColor, series.length, chartConfiguration.maxDepth); + return decreaseOpacity(outputColor, series.length, chartConfiguration.maxDepth); } return { id, + title: palette.name, getCategoricalColor: getColor, - getCategoricalColors: colors, + getCategoricalColors: palette.colors, canDynamicColoring: true, toExpression: () => ({ type: 'expression', @@ -153,7 +142,7 @@ function buildCustomPalette(): PaletteDefinition { return outputColor; } - return lightenColor(outputColor, series.length, chartConfiguration.maxDepth); + return decreaseOpacity(outputColor, series.length, chartConfiguration.maxDepth); }, internal: true, title: i18n.translate('charts.palettes.customLabel', { defaultMessage: 'Custom' }), @@ -220,50 +209,32 @@ function buildCustomPalette(): PaletteDefinition { } as PaletteDefinition<unknown>; } -export const buildPalettes = (): Record<string, PaletteDefinition> => ({ - default: { - title: i18n.translate('charts.palettes.defaultPaletteLabel', { defaultMessage: 'Default' }), - ...buildRoundRobinCategoricalWithMappedColors(), - }, - status: { - title: i18n.translate('charts.palettes.statusLabel', { defaultMessage: 'Status' }), - ...buildGradient('status', euiPaletteForStatus), - }, - temperature: { - title: i18n.translate('charts.palettes.temperatureLabel', { defaultMessage: 'Temperature' }), - ...buildGradient('temperature', euiPaletteForTemperature), - }, - complementary: { - title: i18n.translate('charts.palettes.complementaryLabel', { - defaultMessage: 'Complementary', - }), - ...buildGradient('complementary', euiPaletteComplementary), - }, - negative: { - title: i18n.translate('charts.palettes.negativeLabel', { defaultMessage: 'Negative' }), - ...buildGradient('negative', euiPaletteRed), - }, - positive: { - title: i18n.translate('charts.palettes.positiveLabel', { defaultMessage: 'Positive' }), - ...buildGradient('positive', euiPaletteGreen), - }, - cool: { - title: i18n.translate('charts.palettes.coolLabel', { defaultMessage: 'Cool' }), - ...buildGradient('cool', euiPaletteCool), - }, - warm: { - title: i18n.translate('charts.palettes.warmLabel', { defaultMessage: 'Warm' }), - ...buildGradient('warm', euiPaletteWarm), - }, - gray: { - title: i18n.translate('charts.palettes.grayLabel', { defaultMessage: 'Gray' }), - ...buildGradient('gray', euiPaletteGray), - }, - kibana_palette: { - title: i18n.translate('charts.palettes.kibanaPaletteLabel', { - defaultMessage: 'Compatibility', - }), - ...buildRoundRobinCategoricalWithMappedColors('kibana_palette', createLegacyColorPalette(20)), - }, - custom: buildCustomPalette() as PaletteDefinition<unknown>, -}); +export const buildPalettes = (theme: CoreTheme): Record<string, PaletteDefinition> => { + const kbnPalettes = getKbnPalettes(theme); + const defaultPalette = kbnPalettes.get(KbnPalette.Default); + return { + default: { + title: defaultPalette.name, + ...buildRoundRobinCategoricalWithMappedColors( + 'default', // needs to match key of palette definition + defaultPalette.colors(), + kbnPalettes.query(KbnPalette.Kibana7BehindText)?.colors() + ), + }, + status: buildGradient('status', kbnPalettes.get('status')), + temperature: buildGradient('temperature', kbnPalettes.get('temperature')), + complementary: buildGradient('complementary', kbnPalettes.get('complementary')), + negative: buildGradient('negative', kbnPalettes.get('red')), + positive: buildGradient('positive', kbnPalettes.get('green')), + cool: buildGradient('cool', kbnPalettes.get('cool')), + warm: buildGradient('warm', kbnPalettes.get('warm')), + gray: buildGradient('gray', kbnPalettes.get('gray')), + kibana_palette: { + title: i18n.translate('charts.palettes.kibanaPaletteLabel', { + defaultMessage: 'Compatibility', + }), + ...buildRoundRobinCategoricalWithMappedColors('kibana_palette', createLegacyColorPalette(20)), + }, + custom: buildCustomPalette(), + }; +}; diff --git a/src/plugins/charts/public/services/palettes/service.ts b/src/plugins/charts/public/services/palettes/service.ts index 30c58172ad42..5e66a5d9e650 100644 --- a/src/plugins/charts/public/services/palettes/service.ts +++ b/src/plugins/charts/public/services/palettes/service.ts @@ -10,6 +10,7 @@ import type { PaletteRegistry, PaletteDefinition } from '@kbn/coloring'; import { getActivePaletteName } from '@kbn/coloring'; import type { ExpressionsSetup } from '@kbn/expressions-plugin/public'; +import { CoreTheme } from '@kbn/core/public'; import type { ChartsPluginSetup } from '../..'; export interface PaletteSetupPlugins { @@ -21,12 +22,12 @@ export class PaletteService { private palettes: Record<string, PaletteDefinition<unknown>> | undefined = undefined; constructor() {} - public setup() { + public setup(theme: CoreTheme) { return { getPalettes: async (): Promise<PaletteRegistry> => { if (!this.palettes) { const { buildPalettes } = await import('./palettes'); - this.palettes = buildPalettes(); + this.palettes = buildPalettes(theme); } return { get: (name: string) => { diff --git a/src/plugins/charts/public/services/theme/theme.test.tsx b/src/plugins/charts/public/services/theme/theme.test.tsx index da89ec475d57..df0acfbede1c 100644 --- a/src/plugins/charts/public/services/theme/theme.test.tsx +++ b/src/plugins/charts/public/services/theme/theme.test.tsx @@ -82,19 +82,19 @@ describe('ThemeService', () => { const { useChartsBaseTheme } = themeService; const { result } = renderHook(() => useChartsBaseTheme()); - expect(result.current).toBe(LIGHT_THEME); + expect(result.current).toStrictEqual(LIGHT_THEME); act(() => { setUpMockTheme.theme$ = createTheme$Mock(true); themeService.init(setUpMockTheme); }); - expect(result.current).toBe(DARK_THEME); + expect(result.current).toStrictEqual(DARK_THEME); act(() => { setUpMockTheme.theme$ = createTheme$Mock(false); themeService.init(setUpMockTheme); }); // act(() => darkMode$.next(false)); - expect(result.current).toBe(LIGHT_THEME); + expect(result.current).toStrictEqual(LIGHT_THEME); }); it('should not rerender when emitting the same value', () => { diff --git a/src/plugins/charts/public/services/theme/theme.ts b/src/plugins/charts/public/services/theme/theme.ts index d7ec8c03e506..765daf957e74 100644 --- a/src/plugins/charts/public/services/theme/theme.ts +++ b/src/plugins/charts/public/services/theme/theme.ts @@ -12,6 +12,7 @@ import { Observable, BehaviorSubject } from 'rxjs'; import { CoreSetup, CoreTheme } from '@kbn/core/public'; import { DARK_THEME, LIGHT_THEME, PartialTheme, Theme } from '@elastic/charts'; +import { euiThemeVars } from '@kbn/ui-theme'; export class ThemeService { /** Returns default charts theme */ @@ -102,8 +103,21 @@ export class ThemeService { */ public init(theme: CoreSetup['theme']) { this.theme$ = theme.theme$; - this.theme$.subscribe(({ darkMode }) => { - this._chartsBaseTheme$.next(darkMode ? DARK_THEME : LIGHT_THEME); + this.theme$.subscribe((newTheme) => { + this._chartsBaseTheme$.next(getChartTheme(newTheme)); }); } } + +// TODO: define these overrides in elastic/charts when Borealis becomes default +function getChartTheme(theme: CoreTheme): Theme { + const chartTheme = theme.darkMode ? DARK_THEME : LIGHT_THEME; + + if (theme.name !== 'amsterdam') { + const backgroundColor = euiThemeVars.euiColorEmptyShade; + chartTheme.background.color = backgroundColor; + chartTheme.background.fallbackColor = backgroundColor; + } + + return chartTheme; +} diff --git a/src/plugins/charts/tsconfig.json b/src/plugins/charts/tsconfig.json index 8ad33a851703..0bd9814e5557 100644 --- a/src/plugins/charts/tsconfig.json +++ b/src/plugins/charts/tsconfig.json @@ -16,6 +16,8 @@ "@kbn/shared-ux-utility", "@kbn/config-schema", "@kbn/data-plugin", + "@kbn/core-lifecycle-browser-mocks", + "@kbn/palettes", ], "exclude": [ "target/**/*", diff --git a/src/plugins/console/public/application/lib/load_from.test.ts b/src/plugins/console/public/application/lib/load_from.test.ts index 8e79dae8764d..d7a2066f7204 100644 --- a/src/plugins/console/public/application/lib/load_from.test.ts +++ b/src/plugins/console/public/application/lib/load_from.test.ts @@ -102,11 +102,11 @@ describe('load from lib', () => { it('works with a non-hash route', () => { mockWindow.location = { ...mockWindow.location, - pathname: '/foo/app/enterprise_search/overview', + pathname: '/foo/app/elasticsearch/overview', }; const codeSnippet = 'GET /_stats'; const expectedUrl = - 'https://my-kibana.elastic.co/foo/app/enterprise_search/overview?load_from=data%3Atext%2Fplain%2COIUQKgBA9A%2BgzgFwIYLkA'; + 'https://my-kibana.elastic.co/foo/app/elasticsearch/overview?load_from=data%3Atext%2Fplain%2COIUQKgBA9A%2BgzgFwIYLkA'; setLoadFromParameter(codeSnippet); expect(mockWindow.history.pushState).toHaveBeenCalledTimes(1); @@ -121,12 +121,12 @@ describe('load from lib', () => { it('works with a non-hash route and other params', () => { mockWindow.location = { ...mockWindow.location, - pathname: '/foo/app/enterprise_search/overview', + pathname: '/foo/app/elasticsearch/overview', search: '?foo=bar', }; const codeSnippet = 'GET /_stats'; const expectedUrl = - 'https://my-kibana.elastic.co/foo/app/enterprise_search/overview?foo=bar&load_from=data%3Atext%2Fplain%2COIUQKgBA9A%2BgzgFwIYLkA'; + 'https://my-kibana.elastic.co/foo/app/elasticsearch/overview?foo=bar&load_from=data%3Atext%2Fplain%2COIUQKgBA9A%2BgzgFwIYLkA'; setLoadFromParameter(codeSnippet); expect(mockWindow.history.pushState).toHaveBeenCalledTimes(1); diff --git a/src/plugins/controls/public/control_group/open_edit_control_group_flyout.tsx b/src/plugins/controls/public/control_group/open_edit_control_group_flyout.tsx index 459913d98de0..52a19aef8b1e 100644 --- a/src/plugins/controls/public/control_group/open_edit_control_group_flyout.tsx +++ b/src/plugins/controls/public/control_group/open_edit_control_group_flyout.tsx @@ -92,10 +92,7 @@ export const openEditControlGroupFlyout = ( onDeleteAll={() => onDeleteAll(overlay)} onCancel={() => closeOverlay(overlay)} />, - { - theme: coreServices.theme, - i18n: coreServices.i18n, - } + coreServices ), { 'aria-label': i18n.translate('controls.controlGroup.manageControl', { diff --git a/src/plugins/controls/public/controls/data_controls/open_data_control_editor.tsx b/src/plugins/controls/public/controls/data_controls/open_data_control_editor.tsx index c01f9aa83cea..c34af20001de 100644 --- a/src/plugins/controls/public/controls/data_controls/open_data_control_editor.tsx +++ b/src/plugins/controls/public/controls/data_controls/open_data_control_editor.tsx @@ -91,10 +91,7 @@ export const openDataControlEditor = < onSave({ type: selectedControlType, state }); }} />, - { - theme: coreServices.theme, - i18n: coreServices.i18n, - } + coreServices ), { size: 'm', diff --git a/src/plugins/controls/public/controls/types.ts b/src/plugins/controls/public/controls/types.ts index dd5d38e96346..8cc33b351326 100644 --- a/src/plugins/controls/public/controls/types.ts +++ b/src/plugins/controls/public/controls/types.ts @@ -9,7 +9,7 @@ import { BehaviorSubject } from 'rxjs'; -import { SerializedPanelState } from '@kbn/presentation-containers'; +import { HasSerializableState } from '@kbn/presentation-containers'; import { PanelCompatibleComponent } from '@kbn/presentation-panel-plugin/public/panel_component/types'; import { HasParentApi, @@ -39,16 +39,12 @@ export type DefaultControlApi = PublishesDataLoading & CanClearSelections & HasType & HasUniqueId & + HasSerializableState<DefaultControlState> & HasParentApi<ControlGroupApi> & { setDataLoading: (loading: boolean) => void; setBlockingError: (error: Error | undefined) => void; grow: PublishingSubject<boolean | undefined>; width: PublishingSubject<ControlWidth | undefined>; - - // Can not use HasSerializableState interface - // HasSerializableState types serializeState as function returning 'MaybePromise' - // Controls serializeState is sync - serializeState: () => SerializedPanelState<DefaultControlState>; }; export type ControlApiRegistration<ControlApi extends DefaultControlApi = DefaultControlApi> = Omit< diff --git a/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_action.tsx b/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_action.tsx index 10b21fc36edc..9b3e9a536a86 100644 --- a/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_action.tsx +++ b/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_action.tsx @@ -83,12 +83,11 @@ export class CopyToDashboardAction implements Action<EmbeddableApiContext> { public async execute({ embeddable }: EmbeddableApiContext) { if (!apiIsCompatible(embeddable)) throw new IncompatibleActionError(); - const { theme, i18n } = coreServices; const session = coreServices.overlays.openModal( - toMountPoint(<CopyToDashboardModal closeModal={() => session.close()} api={embeddable} />, { - theme, - i18n, - }), + toMountPoint( + <CopyToDashboardModal closeModal={() => session.close()} api={embeddable} />, + coreServices + ), { maxWidth: 400, 'data-test-subj': 'copyToDashboardPanel', diff --git a/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_modal.tsx b/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_modal.tsx index 66b0ed367481..858b241ad7e5 100644 --- a/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_modal.tsx +++ b/src/plugins/dashboard/public/dashboard_actions/copy_to_dashboard_modal.tsx @@ -50,9 +50,9 @@ export function CopyToDashboardModal({ api, closeModal }: CopyToDashboardModalPr const dashboardId = api.parentApi.savedObjectId.value; - const onSubmit = useCallback(async () => { + const onSubmit = useCallback(() => { const dashboard = api.parentApi; - const panelToCopy = await dashboard.getDashboardPanelFromId(api.uuid); + const panelToCopy = dashboard.getDashboardPanelFromId(api.uuid); const runtimeSnapshot = apiHasSnapshottableState(api) ? api.snapshotRuntimeState() : undefined; if (!panelToCopy && !runtimeSnapshot) { diff --git a/src/plugins/dashboard/public/dashboard_api/are_panel_layouts_equal.ts b/src/plugins/dashboard/public/dashboard_api/are_panel_layouts_equal.ts new file mode 100644 index 000000000000..3af80356bc73 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/are_panel_layouts_equal.ts @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { isEmpty, xor } from 'lodash'; +import fastIsEqual from 'fast-deep-equal'; +import { DashboardPanelMap } from '../../common'; + +/** + * Checks whether the panel maps have the same keys, and if they do, whether all of the other keys inside each panel + * are equal. Skips explicit input as that needs to be handled asynchronously. + */ +export const arePanelLayoutsEqual = ( + originalPanels: DashboardPanelMap, + newPanels: DashboardPanelMap +) => { + const originalEmbeddableIds = Object.keys(originalPanels); + const newEmbeddableIds = Object.keys(newPanels); + + const embeddableIdDiff = xor(originalEmbeddableIds, newEmbeddableIds); + if (embeddableIdDiff.length > 0) { + return false; + } + const commonPanelDiff = <T>(originalObj: Partial<T>, newObj: Partial<T>) => { + const differences: Partial<T> = {}; + const keys = [ + ...new Set([ + ...(Object.keys(originalObj) as Array<keyof T>), + ...(Object.keys(newObj) as Array<keyof T>), + ]), + ]; + for (const key of keys) { + if (key === undefined) continue; + if (!fastIsEqual(originalObj[key], newObj[key])) differences[key] = newObj[key]; + } + return differences; + }; + + for (const embeddableId of newEmbeddableIds) { + const { + explicitInput: originalExplicitInput, + panelRefName: panelRefA, + ...commonPanelDiffOriginal + } = originalPanels[embeddableId]; + const { + explicitInput: newExplicitInput, + panelRefName: panelRefB, + ...commonPanelDiffNew + } = newPanels[embeddableId]; + + if (!isEmpty(commonPanelDiff(commonPanelDiffOriginal, commonPanelDiffNew))) return false; + } + return true; +}; diff --git a/src/plugins/dashboard/public/dashboard_api/data_loading_manager.ts b/src/plugins/dashboard/public/dashboard_api/data_loading_manager.ts new file mode 100644 index 000000000000..064ea20672d6 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/data_loading_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { BehaviorSubject, debounceTime, first, map } from 'rxjs'; +import { + PublishesDataLoading, + PublishingSubject, + apiPublishesDataLoading, +} from '@kbn/presentation-publishing'; +import { combineCompatibleChildrenApis } from '@kbn/presentation-containers'; + +export function initializeDataLoadingManager( + children$: PublishingSubject<{ [key: string]: unknown }> +) { + const dataLoading$ = new BehaviorSubject<boolean | undefined>(undefined); + + const dataLoadingSubscription = combineCompatibleChildrenApis< + PublishesDataLoading, + boolean | undefined + >( + { children$ }, + 'dataLoading', + apiPublishesDataLoading, + undefined, + // flatten method + (values) => { + return values.some((isLoading) => isLoading); + } + ).subscribe((isAtLeastOneChildLoading) => { + dataLoading$.next(isAtLeastOneChildLoading); + }); + + return { + api: { + dataLoading: dataLoading$, + }, + internalApi: { + waitForPanelsToLoad$: dataLoading$.pipe( + // debounce to give time for panels to start loading if they are going to load + debounceTime(300), + first((isLoading: boolean | undefined) => { + return !isLoading; + }), + map(() => { + // Observable notifies subscriber when loading is finished + // Return void to not expose internal implementation details of observable + return; + }) + ), + }, + cleanup: () => { + dataLoadingSubscription.unsubscribe(); + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/data_views_manager.ts b/src/plugins/dashboard/public/dashboard_api/data_views_manager.ts new file mode 100644 index 000000000000..000c1e815b2b --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/data_views_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { uniqBy } from 'lodash'; +import { BehaviorSubject, combineLatest, Observable, of, switchMap } from 'rxjs'; + +import { DataView } from '@kbn/data-views-plugin/common'; +import { combineCompatibleChildrenApis } from '@kbn/presentation-containers'; +import { + apiPublishesDataViews, + PublishesDataViews, + PublishingSubject, +} from '@kbn/presentation-publishing'; + +import { ControlGroupApi } from '@kbn/controls-plugin/public'; +import { dataService } from '../services/kibana_services'; + +export function initializeDataViewsManager( + controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>, + children$: PublishingSubject<{ [key: string]: unknown }> +) { + const dataViews = new BehaviorSubject<DataView[] | undefined>([]); + + const controlGroupDataViewsPipe: Observable<DataView[] | undefined> = controlGroupApi$.pipe( + switchMap((controlGroupApi) => { + return controlGroupApi ? controlGroupApi.dataViews : of([]); + }) + ); + + const childDataViewsPipe = combineCompatibleChildrenApis<PublishesDataViews, DataView[]>( + { children$ }, + 'dataViews', + apiPublishesDataViews, + [] + ); + + const dataViewsSubscription = combineLatest([controlGroupDataViewsPipe, childDataViewsPipe]) + .pipe( + switchMap(async ([controlGroupDataViews, childDataViews]) => { + const allDataViews = [...(controlGroupDataViews ?? []), ...childDataViews]; + if (allDataViews.length === 0) { + try { + const defaultDataView = await dataService.dataViews.getDefaultDataView(); + if (defaultDataView) { + allDataViews.push(defaultDataView); + } + } catch (error) { + // ignore error getting default data view + } + } + return uniqBy(allDataViews, 'id'); + }) + ) + .subscribe((newDataViews) => { + dataViews.next(newDataViews); + }); + + return { + api: { + dataViews, + }, + cleanup: () => { + dataViewsSubscription.unsubscribe(); + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts b/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts index 2af37846eecd..8b29ed8b1d9f 100644 --- a/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts +++ b/src/plugins/dashboard/public/dashboard_api/get_dashboard_api.ts @@ -7,47 +7,267 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { BehaviorSubject } from 'rxjs'; -import type { DashboardContainerInput } from '../../common'; +import { BehaviorSubject, debounceTime, merge } from 'rxjs'; +import { omit } from 'lodash'; +import { v4 } from 'uuid'; +import type { Reference } from '@kbn/content-management-utils'; +import { ControlGroupApi, ControlGroupSerializedState } from '@kbn/controls-plugin/public'; +import { EmbeddablePackageState } from '@kbn/embeddable-plugin/public'; +import { + getReferencesForControls, + getReferencesForPanelId, +} from '../../common/dashboard_container/persistable_state/dashboard_container_references'; import { initializeTrackPanel } from './track_panel'; import { initializeTrackOverlay } from './track_overlay'; -import { initializeUnsavedChanges } from './unsaved_changes'; - -export interface InitialComponentState { - anyMigrationRun: boolean; - isEmbeddedExternally: boolean; - lastSavedInput: DashboardContainerInput; - lastSavedId: string | undefined; - managed: boolean; - fullScreenMode: boolean; -} +import { initializeUnsavedChangesManager } from './unsaved_changes_manager'; +import { DASHBOARD_APP_ID, DEFAULT_DASHBOARD_INPUT } from '../dashboard_constants'; +import { LoadDashboardReturn } from '../services/dashboard_content_management_service/types'; +import { initializePanelsManager } from './panels_manager'; +import { + DASHBOARD_API_TYPE, + DashboardApi, + DashboardCreationOptions, + DashboardInternalApi, + DashboardState, +} from './types'; +import { initializeDataViewsManager } from './data_views_manager'; +import { initializeSettingsManager } from './settings_manager'; +import { initializeUnifiedSearchManager } from './unified_search_manager'; +import { initializeDataLoadingManager } from './data_loading_manager'; +import { PANELS_CONTROL_GROUP_KEY } from '../services/dashboard_backup_service'; +import { getDashboardContentManagementService } from '../services/dashboard_content_management_service'; +import { openSaveModal } from './open_save_modal'; +import { initializeSearchSessionManager } from './search_session_manager'; +import { initializeViewModeManager } from './view_mode_manager'; +import { UnsavedPanelState } from '../dashboard_container/types'; +import { initializeTrackContentfulRender } from './track_contentful_render'; -export function getDashboardApi( - initialComponentState: InitialComponentState, - untilEmbeddableLoaded: (id: string) => Promise<unknown> -) { +export function getDashboardApi({ + creationOptions, + incomingEmbeddable, + initialState, + initialPanelsRuntimeState, + savedObjectResult, + savedObjectId, +}: { + creationOptions?: DashboardCreationOptions; + incomingEmbeddable?: EmbeddablePackageState | undefined; + initialState: DashboardState; + initialPanelsRuntimeState?: UnsavedPanelState; + savedObjectResult?: LoadDashboardReturn; + savedObjectId?: string; +}) { const animatePanelTransforms$ = new BehaviorSubject(false); // set panel transforms to false initially to avoid panels animating on initial render. - const fullScreenMode$ = new BehaviorSubject(initialComponentState.fullScreenMode); - const managed$ = new BehaviorSubject(initialComponentState.managed); - const savedObjectId$ = new BehaviorSubject<string | undefined>(initialComponentState.lastSavedId); + const controlGroupApi$ = new BehaviorSubject<ControlGroupApi | undefined>(undefined); + const fullScreenMode$ = new BehaviorSubject(creationOptions?.fullScreenMode ?? false); + const isManaged = savedObjectResult?.managed ?? false; + let references: Reference[] = savedObjectResult?.references ?? []; + const savedObjectId$ = new BehaviorSubject<string | undefined>(savedObjectId); - const trackPanel = initializeTrackPanel(untilEmbeddableLoaded); + const viewModeManager = initializeViewModeManager(incomingEmbeddable, savedObjectResult); + const trackPanel = initializeTrackPanel( + async (id: string) => await panelsManager.api.untilEmbeddableLoaded(id) + ); + function getPanelReferences(id: string) { + const panelReferences = getReferencesForPanelId(id, references); + // references from old installations may not be prefixed with panel id + // fall back to passing all references in these cases to preserve backwards compatability + return panelReferences.length > 0 ? panelReferences : references; + } + const panelsManager = initializePanelsManager( + incomingEmbeddable, + initialState.panels, + initialPanelsRuntimeState ?? {}, + trackPanel, + getPanelReferences, + (refs: Reference[]) => references.push(...refs) + ); + const dataLoadingManager = initializeDataLoadingManager(panelsManager.api.children$); + const dataViewsManager = initializeDataViewsManager( + controlGroupApi$, + panelsManager.api.children$ + ); + const unifiedSearchManager = initializeUnifiedSearchManager( + initialState, + controlGroupApi$, + dataLoadingManager.internalApi.waitForPanelsToLoad$, + () => unsavedChangesManager.internalApi.getLastSavedState(), + creationOptions + ); + const settingsManager = initializeSettingsManager({ + initialState, + setTimeRestore: unifiedSearchManager.internalApi.setTimeRestore, + timeRestore$: unifiedSearchManager.internalApi.timeRestore$, + }); + const unsavedChangesManager = initializeUnsavedChangesManager({ + creationOptions, + controlGroupApi$, + lastSavedState: omit(savedObjectResult?.dashboardInput, 'controlGroupInput') ?? { + ...DEFAULT_DASHBOARD_INPUT, + }, + panelsManager, + savedObjectId$, + settingsManager, + viewModeManager, + unifiedSearchManager, + }); + function getState() { + const { panels, references: panelReferences } = panelsManager.internalApi.getState(); + const dashboardState: DashboardState = { + ...settingsManager.internalApi.getState(), + ...unifiedSearchManager.internalApi.getState(), + panels, + viewMode: viewModeManager.api.viewMode.value, + }; - return { + const controlGroupApi = controlGroupApi$.value; + let controlGroupReferences: Reference[] | undefined; + if (controlGroupApi) { + const { rawState: controlGroupSerializedState, references: extractedReferences } = + controlGroupApi.serializeState(); + controlGroupReferences = extractedReferences; + dashboardState.controlGroupInput = controlGroupSerializedState; + } + + return { + dashboardState, + controlGroupReferences, + panelReferences, + }; + } + + const trackOverlayApi = initializeTrackOverlay(trackPanel.setFocusedPanelId); + + // Start animating panel transforms 500 ms after dashboard is created. + setTimeout(() => animatePanelTransforms$.next(true), 500); + + const dashboardApi = { + ...viewModeManager.api, + ...dataLoadingManager.api, + ...dataViewsManager.api, + ...panelsManager.api, + ...settingsManager.api, ...trackPanel, - ...initializeTrackOverlay(trackPanel.setFocusedPanelId), - ...initializeUnsavedChanges( - initialComponentState.anyMigrationRun, - initialComponentState.lastSavedInput - ), - animatePanelTransforms$, + ...unifiedSearchManager.api, + ...unsavedChangesManager.api, + ...trackOverlayApi, + ...initializeTrackContentfulRender(), + controlGroupApi$, + executionContext: { + type: 'dashboard', + description: settingsManager.api.panelTitle.value, + }, fullScreenMode$, - isEmbeddedExternally: initialComponentState.isEmbeddedExternally, - managed$, + getAppContext: () => { + const embeddableAppContext = creationOptions?.getEmbeddableAppContext?.(savedObjectId$.value); + return { + ...embeddableAppContext, + currentAppId: embeddableAppContext?.currentAppId ?? DASHBOARD_APP_ID, + }; + }, + isEmbeddedExternally: Boolean(creationOptions?.isEmbeddedExternally), + isManaged, + reload$: merge( + unifiedSearchManager.internalApi.controlGroupReload$, + unifiedSearchManager.internalApi.panelsReload$ + ).pipe(debounceTime(0)), + runInteractiveSave: async () => { + trackOverlayApi.clearOverlays(); + const saveResult = await openSaveModal({ + isManaged, + lastSavedId: savedObjectId$.value, + viewMode: viewModeManager.api.viewMode.value, + ...getState(), + }); + + if (saveResult) { + unsavedChangesManager.internalApi.onSave(saveResult.savedState); + const settings = settingsManager.api.getSettings(); + settingsManager.api.setSettings({ + ...settings, + hidePanelTitles: settings.hidePanelTitles ?? false, + description: saveResult.savedState.description, + tags: saveResult.savedState.tags, + timeRestore: saveResult.savedState.timeRestore, + title: saveResult.savedState.title, + }); + savedObjectId$.next(saveResult.id); + + references = saveResult.references ?? []; + } + + return saveResult; + }, + runQuickSave: async () => { + if (isManaged) return; + const { controlGroupReferences, dashboardState, panelReferences } = getState(); + const saveResult = await getDashboardContentManagementService().saveDashboardState({ + controlGroupReferences, + currentState: dashboardState, + panelReferences, + saveOptions: {}, + lastSavedId: savedObjectId$.value, + }); + + unsavedChangesManager.internalApi.onSave(dashboardState); + references = saveResult.references ?? []; + + return; + }, savedObjectId: savedObjectId$, - setAnimatePanelTransforms: (animate: boolean) => animatePanelTransforms$.next(animate), setFullScreenMode: (fullScreenMode: boolean) => fullScreenMode$.next(fullScreenMode), - setManaged: (managed: boolean) => managed$.next(managed), setSavedObjectId: (id: string | undefined) => savedObjectId$.next(id), + type: DASHBOARD_API_TYPE as 'dashboard', + uuid: v4(), + } as Omit<DashboardApi, 'searchSessionId$'>; + + const searchSessionManager = initializeSearchSessionManager( + creationOptions?.searchSessionSettings, + incomingEmbeddable, + dashboardApi + ); + + return { + api: { + ...dashboardApi, + ...searchSessionManager.api, + }, + internalApi: { + ...panelsManager.internalApi, + ...unifiedSearchManager.internalApi, + animatePanelTransforms$, + getSerializedStateForControlGroup: () => { + return { + rawState: savedObjectResult?.dashboardInput?.controlGroupInput + ? savedObjectResult.dashboardInput.controlGroupInput + : ({ + autoApplySelections: true, + chainingSystem: 'HIERARCHICAL', + controls: [], + ignoreParentSettings: { + ignoreFilters: false, + ignoreQuery: false, + ignoreTimerange: false, + ignoreValidations: false, + }, + labelPosition: 'oneLine', + showApplySelections: false, + } as ControlGroupSerializedState), + references: getReferencesForControls(references), + }; + }, + getRuntimeStateForControlGroup: () => { + return panelsManager!.api.getRuntimeStateForChild(PANELS_CONTROL_GROUP_KEY); + }, + setControlGroupApi: (controlGroupApi: ControlGroupApi) => + controlGroupApi$.next(controlGroupApi), + } as DashboardInternalApi, + cleanup: () => { + dataLoadingManager.cleanup(); + dataViewsManager.cleanup(); + searchSessionManager.cleanup(); + unifiedSearchManager.cleanup(); + unsavedChangesManager.cleanup(); + }, }; } diff --git a/src/plugins/dashboard/public/dashboard_api/load_dashboard_api.ts b/src/plugins/dashboard/public/dashboard_api/load_dashboard_api.ts new file mode 100644 index 000000000000..00fd32fd56ac --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/load_dashboard_api.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { ContentInsightsClient } from '@kbn/content-management-content-insights-public'; +import { DashboardPanelMap } from '../../common'; +import { getDashboardContentManagementService } from '../services/dashboard_content_management_service'; +import { DashboardCreationOptions, DashboardState } from './types'; +import { getDashboardApi } from './get_dashboard_api'; +import { startQueryPerformanceTracking } from '../dashboard_container/embeddable/create/performance/query_performance_tracking'; +import { coreServices } from '../services/kibana_services'; +import { + PANELS_CONTROL_GROUP_KEY, + getDashboardBackupService, +} from '../services/dashboard_backup_service'; +import { UnsavedPanelState } from '../dashboard_container/types'; +import { DEFAULT_DASHBOARD_INPUT } from '../dashboard_constants'; + +export async function loadDashboardApi({ + getCreationOptions, + savedObjectId, +}: { + getCreationOptions?: () => Promise<DashboardCreationOptions>; + savedObjectId?: string; +}) { + const creationStartTime = performance.now(); + const creationOptions = await getCreationOptions?.(); + const incomingEmbeddable = creationOptions?.getIncomingEmbeddable?.(); + const savedObjectResult = await getDashboardContentManagementService().loadDashboardState({ + id: savedObjectId, + }); + + // -------------------------------------------------------------------------------------- + // Run validation. + // -------------------------------------------------------------------------------------- + const validationResult = + savedObjectResult && creationOptions?.validateLoadedSavedObject?.(savedObjectResult); + if (validationResult === 'invalid') { + // throw error to stop the rest of Dashboard loading and make the factory throw an Error + throw new Error('Dashboard failed saved object result validation'); + } else if (validationResult === 'redirected') { + return; + } + + // -------------------------------------------------------------------------------------- + // Combine saved object state and session storage state + // -------------------------------------------------------------------------------------- + const dashboardBackupState = getDashboardBackupService().getState(savedObjectResult.dashboardId); + const initialPanelsRuntimeState: UnsavedPanelState = creationOptions?.useSessionStorageIntegration + ? dashboardBackupState?.panels ?? {} + : {}; + + const sessionStorageInput = ((): Partial<DashboardState> | undefined => { + if (!creationOptions?.useSessionStorageIntegration) return; + return dashboardBackupState?.dashboardState; + })(); + + const combinedSessionState: DashboardState = { + ...DEFAULT_DASHBOARD_INPUT, + ...(savedObjectResult?.dashboardInput ?? {}), + ...sessionStorageInput, + }; + + // -------------------------------------------------------------------------------------- + // Combine state with overrides. + // -------------------------------------------------------------------------------------- + const overrideState = creationOptions?.getInitialInput?.(); + if (overrideState?.panels) { + const overridePanels: DashboardPanelMap = {}; + for (const panel of Object.values(overrideState?.panels)) { + overridePanels[panel.explicitInput.id] = { + ...panel, + + /** + * here we need to keep the state of the panel that was already in the Dashboard if one exists. + * This is because this state will become the "last saved state" for this panel. + */ + ...(combinedSessionState.panels[panel.explicitInput.id] ?? []), + }; + /** + * We also need to add the state of this react embeddable into the runtime state to be restored. + */ + initialPanelsRuntimeState[panel.explicitInput.id] = panel.explicitInput; + } + overrideState.panels = overridePanels; + } + // Back up any view mode passed in explicitly. + if (overrideState?.viewMode) { + getDashboardBackupService().storeViewMode(overrideState?.viewMode); + } + if (overrideState?.controlGroupState) { + initialPanelsRuntimeState[PANELS_CONTROL_GROUP_KEY] = overrideState.controlGroupState; + } + + // -------------------------------------------------------------------------------------- + // get dashboard Api + // -------------------------------------------------------------------------------------- + const { api, cleanup, internalApi } = getDashboardApi({ + creationOptions, + incomingEmbeddable, + initialState: { + ...combinedSessionState, + ...overrideState, + }, + initialPanelsRuntimeState, + savedObjectResult, + savedObjectId, + }); + + const performanceSubscription = startQueryPerformanceTracking(api, { + firstLoad: true, + creationStartTime, + }); + + if (savedObjectId && !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 + const contentInsightsClient = new ContentInsightsClient( + { http: coreServices.http }, + { domainId: 'dashboard' } + ); + contentInsightsClient.track(savedObjectId, 'viewed'); + } + + return { + api, + cleanup: () => { + cleanup(); + performanceSubscription.unsubscribe(); + }, + internalApi, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/open_save_modal.tsx b/src/plugins/dashboard/public/dashboard_api/open_save_modal.tsx new file mode 100644 index 000000000000..e5b2676d7198 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/open_save_modal.tsx @@ -0,0 +1,171 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import React from 'react'; +import { ViewMode } from '@kbn/presentation-publishing'; +import type { Reference } from '@kbn/content-management-utils'; +import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; +import { showSaveModal } from '@kbn/saved-objects-plugin/public'; +import { i18n } from '@kbn/i18n'; +import { SaveDashboardReturn } from '../services/dashboard_content_management_service/types'; +import { DashboardSaveOptions } from '../dashboard_container/types'; +import { coreServices, dataService, savedObjectsTaggingService } from '../services/kibana_services'; +import { getDashboardContentManagementService } from '../services/dashboard_content_management_service'; +import { DashboardState } from './types'; +import { DASHBOARD_CONTENT_ID, SAVED_OBJECT_POST_TIME } from '../dashboard_constants'; +import { extractTitleAndCount } from '../dashboard_container/embeddable/api/lib/extract_title_and_count'; +import { DashboardSaveModal } from '../dashboard_container/embeddable/api/overlays/save_modal'; + +/** + * @description exclusively for user directed dashboard save actions, also + * accounts for scenarios of cloning elastic managed dashboard into user managed dashboards + */ +export async function openSaveModal({ + controlGroupReferences, + dashboardState, + isManaged, + lastSavedId, + panelReferences, + viewMode, +}: { + controlGroupReferences?: Reference[]; + dashboardState: DashboardState; + isManaged: boolean; + lastSavedId: string | undefined; + panelReferences: Reference[]; + viewMode: ViewMode; +}) { + if (viewMode === 'edit' && isManaged) { + return undefined; + } + const dashboardContentManagementService = getDashboardContentManagementService(); + const saveAsTitle = lastSavedId + ? await getSaveAsTitle(dashboardState.title) + : dashboardState.title; + return new Promise<(SaveDashboardReturn & { savedState: DashboardState }) | undefined>( + (resolve, reject) => { + const onSaveAttempt = async ({ + newTags, + newTitle, + newDescription, + newCopyOnSave, + newTimeRestore, + onTitleDuplicate, + isTitleDuplicateConfirmed, + }: DashboardSaveOptions): Promise<SaveDashboardReturn> => { + const saveOptions = { + confirmOverwrite: false, + isTitleDuplicateConfirmed, + onTitleDuplicate, + saveAsCopy: lastSavedId ? true : newCopyOnSave, + }; + + try { + if ( + !(await dashboardContentManagementService.checkForDuplicateDashboardTitle({ + title: newTitle, + onTitleDuplicate, + lastSavedTitle: dashboardState.title, + copyOnSave: saveOptions.saveAsCopy, + isTitleDuplicateConfirmed, + })) + ) { + return {}; + } + + const dashboardStateToSave: DashboardState = { + ...dashboardState, + title: newTitle, + tags: savedObjectsTaggingService && newTags ? newTags : ([] as string[]), + description: newDescription, + timeRestore: newTimeRestore, + timeRange: newTimeRestore + ? dataService.query.timefilter.timefilter.getTime() + : undefined, + refreshInterval: newTimeRestore + ? dataService.query.timefilter.timefilter.getRefreshInterval() + : undefined, + }; + + // TODO If this is a managed dashboard - unlink all by reference embeddables on clone + // https://github.com/elastic/kibana/issues/190138 + + const beforeAddTime = window.performance.now(); + + const saveResult = await dashboardContentManagementService.saveDashboardState({ + controlGroupReferences, + panelReferences, + saveOptions, + currentState: dashboardStateToSave, + lastSavedId, + }); + + const addDuration = window.performance.now() - beforeAddTime; + + reportPerformanceMetricEvent(coreServices.analytics, { + eventName: SAVED_OBJECT_POST_TIME, + duration: addDuration, + meta: { + saved_object_type: DASHBOARD_CONTENT_ID, + }, + }); + + resolve({ ...saveResult, savedState: dashboardStateToSave }); + return saveResult; + } catch (error) { + reject(error); + return error; + } + }; + + showSaveModal( + <DashboardSaveModal + tags={dashboardState.tags} + title={saveAsTitle} + onClose={() => resolve(undefined)} + timeRestore={dashboardState.timeRestore} + showStoreTimeOnSave={!lastSavedId} + description={dashboardState.description ?? ''} + showCopyOnSave={false} + onSave={onSaveAttempt} + customModalTitle={getCustomModalTitle(viewMode)} + /> + ); + } + ); +} + +function getCustomModalTitle(viewMode: ViewMode) { + if (viewMode === 'edit') + return i18n.translate('dashboard.topNav.editModeInteractiveSave.modalTitle', { + defaultMessage: 'Save as new dashboard', + }); + + if (viewMode === 'view') + return i18n.translate('dashboard.topNav.viewModeInteractiveSave.modalTitle', { + defaultMessage: 'Duplicate dashboard', + }); + return undefined; +} + +async function getSaveAsTitle(title: string) { + const [baseTitle, baseCount] = extractTitleAndCount(title); + let saveAsTitle = `${baseTitle} (${baseCount + 1})`; + await getDashboardContentManagementService().checkForDuplicateDashboardTitle({ + title: saveAsTitle, + lastSavedTitle: title, + copyOnSave: true, + isTitleDuplicateConfirmed: false, + onTitleDuplicate(speculativeSuggestion) { + saveAsTitle = speculativeSuggestion; + }, + }); + + return saveAsTitle; +} diff --git a/src/plugins/dashboard/public/dashboard_api/panels_manager.ts b/src/plugins/dashboard/public/dashboard_api/panels_manager.ts new file mode 100644 index 000000000000..5188a604631b --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/panels_manager.ts @@ -0,0 +1,455 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { BehaviorSubject, merge } from 'rxjs'; +import { filter, map, max } from 'lodash'; +import { v4 } from 'uuid'; +import { asyncForEach } from '@kbn/std'; +import type { Reference } from '@kbn/content-management-utils'; +import { METRIC_TYPE } from '@kbn/analytics'; +import { PanelPackage, apiHasSerializableState } from '@kbn/presentation-containers'; +import { + DefaultEmbeddableApi, + EmbeddablePackageState, + PanelNotFoundError, +} from '@kbn/embeddable-plugin/public'; +import { + StateComparators, + apiHasInPlaceLibraryTransforms, + apiHasLibraryTransforms, + apiPublishesPanelTitle, + apiPublishesUnsavedChanges, + getPanelTitle, + stateHasTitles, +} from '@kbn/presentation-publishing'; +import { apiHasSnapshottableState } from '@kbn/presentation-containers/interfaces/serialized_state'; +import { i18n } from '@kbn/i18n'; +import { coreServices, usageCollectionService } from '../services/kibana_services'; +import { DashboardPanelMap, DashboardPanelState, prefixReferencesFromPanel } from '../../common'; +import type { initializeTrackPanel } from './track_panel'; +import { getPanelAddedSuccessString } from '../dashboard_app/_dashboard_app_strings'; +import { runPanelPlacementStrategy } from '../dashboard_container/panel_placement/place_new_panel_strategies'; +import { + DASHBOARD_UI_METRIC_ID, + DEFAULT_PANEL_HEIGHT, + DEFAULT_PANEL_WIDTH, + PanelPlacementStrategy, +} from '../dashboard_constants'; +import { getDashboardPanelPlacementSetting } from '../dashboard_container/panel_placement/panel_placement_registry'; +import { UnsavedPanelState } from '../dashboard_container/types'; +import { DashboardState } from './types'; +import { arePanelLayoutsEqual } from './are_panel_layouts_equal'; +import { dashboardClonePanelActionStrings } from '../dashboard_actions/_dashboard_actions_strings'; +import { placeClonePanel } from '../dashboard_container/panel_placement'; + +export function initializePanelsManager( + incomingEmbeddable: EmbeddablePackageState | undefined, + initialPanels: DashboardPanelMap, + initialPanelsRuntimeState: UnsavedPanelState, + trackPanel: ReturnType<typeof initializeTrackPanel>, + getReferencesForPanelId: (id: string) => Reference[], + pushReferences: (references: Reference[]) => void +) { + const children$ = new BehaviorSubject<{ + [key: string]: unknown; + }>({}); + const panels$ = new BehaviorSubject(initialPanels); + function setPanels(panels: DashboardPanelMap) { + if (panels !== panels$.value) panels$.next(panels); + } + let restoredRuntimeState: UnsavedPanelState = initialPanelsRuntimeState; + + function setRuntimeStateForChild(childId: string, state: object) { + restoredRuntimeState[childId] = state; + } + + // -------------------------------------------------------------------------------------- + // Place the incoming embeddable if there is one + // -------------------------------------------------------------------------------------- + if (incomingEmbeddable) { + let incomingEmbeddablePanelState: DashboardPanelState; + if ( + incomingEmbeddable.embeddableId && + Boolean(panels$.value[incomingEmbeddable.embeddableId]) + ) { + // this embeddable already exists, just update the explicit input. + incomingEmbeddablePanelState = panels$.value[incomingEmbeddable.embeddableId]; + const sameType = incomingEmbeddablePanelState.type === incomingEmbeddable.type; + + incomingEmbeddablePanelState.type = incomingEmbeddable.type; + setRuntimeStateForChild(incomingEmbeddable.embeddableId, { + // if the incoming panel is the same type as what was there before we can safely spread the old panel's explicit input + ...(sameType ? incomingEmbeddablePanelState.explicitInput : {}), + + ...incomingEmbeddable.input, + id: incomingEmbeddable.embeddableId, + + // maintain hide panel titles setting. + hidePanelTitles: incomingEmbeddablePanelState.explicitInput.hidePanelTitles, + }); + incomingEmbeddablePanelState.explicitInput = { + id: incomingEmbeddablePanelState.explicitInput.id, + }; + } else { + // otherwise this incoming embeddable is brand new. + const embeddableId = incomingEmbeddable.embeddableId ?? v4(); + setRuntimeStateForChild(embeddableId, incomingEmbeddable.input); + const { newPanelPlacement } = runPanelPlacementStrategy( + PanelPlacementStrategy.findTopLeftMostOpenSpace, + { + width: incomingEmbeddable.size?.width ?? DEFAULT_PANEL_WIDTH, + height: incomingEmbeddable.size?.height ?? DEFAULT_PANEL_HEIGHT, + currentPanels: panels$.value, + } + ); + incomingEmbeddablePanelState = { + explicitInput: { id: embeddableId }, + type: incomingEmbeddable.type, + gridData: { + ...newPanelPlacement, + i: embeddableId, + }, + }; + } + + setPanels({ + ...panels$.value, + [incomingEmbeddablePanelState.explicitInput.id]: incomingEmbeddablePanelState, + }); + trackPanel.setScrollToPanelId(incomingEmbeddablePanelState.explicitInput.id); + trackPanel.setHighlightPanelId(incomingEmbeddablePanelState.explicitInput.id); + } + + async function untilEmbeddableLoaded<ApiType>(id: string): Promise<ApiType | undefined> { + if (!panels$.value[id]) { + throw new PanelNotFoundError(); + } + + if (children$.value[id]) { + return children$.value[id] as ApiType; + } + + return new Promise((resolve, reject) => { + const subscription = merge(children$, panels$).subscribe(() => { + if (children$.value[id]) { + subscription.unsubscribe(); + resolve(children$.value[id] as ApiType); + } + + // If we hit this, the panel was removed before the embeddable finished loading. + if (panels$.value[id] === undefined) { + subscription.unsubscribe(); + resolve(undefined); + } + }); + }); + } + + function getDashboardPanelFromId(panelId: string) { + const panel = panels$.value[panelId]; + const child = children$.value[panelId]; + if (!child || !panel) throw new PanelNotFoundError(); + const serialized = apiHasSerializableState(child) ? child.serializeState() : { rawState: {} }; + return { + type: panel.type, + explicitInput: { ...panel.explicitInput, ...serialized.rawState }, + gridData: panel.gridData, + references: serialized.references, + }; + } + + async function getPanelTitles(): Promise<string[]> { + const titles: string[] = []; + await asyncForEach(Object.keys(panels$.value), async (id) => { + const childApi = await untilEmbeddableLoaded(id); + const title = apiPublishesPanelTitle(childApi) ? getPanelTitle(childApi) : ''; + if (title) titles.push(title); + }); + return titles; + } + + function duplicateReactEmbeddableInput( + childApi: unknown, + panelToClone: DashboardPanelState, + panelTitles: string[] + ) { + const id = v4(); + const lastTitle = apiPublishesPanelTitle(childApi) ? getPanelTitle(childApi) ?? '' : ''; + const newTitle = getClonedPanelTitle(panelTitles, lastTitle); + + /** + * For react embeddables that have library transforms, we need to ensure + * to clone them with serialized state and references. + * + * TODO: remove this section once all by reference capable react embeddables + * use in-place library transforms + */ + if (apiHasLibraryTransforms(childApi)) { + const byValueSerializedState = childApi.getByValueState(); + if (panelToClone.references) { + pushReferences(prefixReferencesFromPanel(id, panelToClone.references)); + } + return { + type: panelToClone.type, + explicitInput: { + ...byValueSerializedState, + title: newTitle, + id, + }, + }; + } + + const runtimeSnapshot = (() => { + if (apiHasInPlaceLibraryTransforms(childApi)) return childApi.getByValueRuntimeSnapshot(); + return apiHasSnapshottableState(childApi) ? childApi.snapshotRuntimeState() : {}; + })(); + if (stateHasTitles(runtimeSnapshot)) runtimeSnapshot.title = newTitle; + + setRuntimeStateForChild(id, runtimeSnapshot); + return { + type: panelToClone.type, + explicitInput: { + id, + }, + }; + } + + return { + api: { + addNewPanel: async <ApiType extends unknown = unknown>( + panelPackage: PanelPackage, + displaySuccessMessage?: boolean + ) => { + usageCollectionService?.reportUiCounter( + DASHBOARD_UI_METRIC_ID, + METRIC_TYPE.CLICK, + panelPackage.panelType + ); + + const newId = v4(); + + const getCustomPlacementSettingFunc = getDashboardPanelPlacementSetting( + panelPackage.panelType + ); + + const customPlacementSettings = getCustomPlacementSettingFunc + ? await getCustomPlacementSettingFunc(panelPackage.initialState) + : undefined; + + const { newPanelPlacement, otherPanels } = runPanelPlacementStrategy( + customPlacementSettings?.strategy ?? PanelPlacementStrategy.findTopLeftMostOpenSpace, + { + currentPanels: panels$.value, + height: customPlacementSettings?.height ?? DEFAULT_PANEL_HEIGHT, + width: customPlacementSettings?.width ?? DEFAULT_PANEL_WIDTH, + } + ); + const newPanel: DashboardPanelState = { + type: panelPackage.panelType, + gridData: { + ...newPanelPlacement, + i: newId, + }, + explicitInput: { + id: newId, + }, + }; + if (panelPackage.initialState) { + setRuntimeStateForChild(newId, panelPackage.initialState); + } + setPanels({ ...otherPanels, [newId]: newPanel }); + if (displaySuccessMessage) { + coreServices.notifications.toasts.addSuccess({ + title: getPanelAddedSuccessString(newPanel.explicitInput.title), + 'data-test-subj': 'addEmbeddableToDashboardSuccess', + }); + trackPanel.setScrollToPanelId(newId); + trackPanel.setHighlightPanelId(newId); + } + return await untilEmbeddableLoaded<ApiType>(newId); + }, + canRemovePanels: () => trackPanel.expandedPanelId.value === undefined, + children$, + duplicatePanel: async (idToDuplicate: string) => { + const panelToClone = getDashboardPanelFromId(idToDuplicate); + + const duplicatedPanelState = duplicateReactEmbeddableInput( + children$.value[idToDuplicate], + panelToClone, + await getPanelTitles() + ); + + coreServices.notifications.toasts.addSuccess({ + title: dashboardClonePanelActionStrings.getSuccessMessage(), + 'data-test-subj': 'addObjectToContainerSuccess', + }); + + const { newPanelPlacement, otherPanels } = placeClonePanel({ + width: panelToClone.gridData.w, + height: panelToClone.gridData.h, + currentPanels: panels$.value, + placeBesideId: panelToClone.explicitInput.id, + }); + + const newPanel = { + ...duplicatedPanelState, + gridData: { + ...newPanelPlacement, + i: duplicatedPanelState.explicitInput.id, + }, + }; + + setPanels({ + ...otherPanels, + [newPanel.explicitInput.id]: newPanel, + }); + }, + getDashboardPanelFromId, + getPanelCount: () => { + return Object.keys(panels$.value).length; + }, + getSerializedStateForChild: (childId: string) => { + const rawState = panels$.value[childId]?.explicitInput ?? { id: childId }; + const { id, ...serializedState } = rawState; + return Object.keys(serializedState).length === 0 + ? undefined + : { + rawState, + references: getReferencesForPanelId(childId), + }; + }, + getRuntimeStateForChild: (childId: string) => { + return restoredRuntimeState?.[childId]; + }, + panels$, + removePanel: (id: string) => { + const panels = { ...panels$.value }; + if (panels[id]) { + delete panels[id]; + setPanels(panels); + } + const children = { ...children$.value }; + if (children[id]) { + delete children[id]; + children$.next(children); + } + }, + replacePanel: async (idToRemove: string, { panelType, initialState }: PanelPackage) => { + const panels = { ...panels$.value }; + if (!panels[idToRemove]) { + throw new PanelNotFoundError(); + } + + const id = v4(); + const oldPanel = panels[idToRemove]; + delete panels[idToRemove]; + setPanels({ + ...panels, + [id]: { + ...oldPanel, + explicitInput: { ...initialState, id }, + type: panelType, + }, + }); + + const children = { ...children$.value }; + if (children[idToRemove]) { + delete children[idToRemove]; + children$.next(children); + } + + await untilEmbeddableLoaded(id); + return id; + }, + setPanels, + setRuntimeStateForChild, + untilEmbeddableLoaded, + }, + comparators: { + panels: [panels$, setPanels, arePanelLayoutsEqual], + } as StateComparators<Pick<DashboardState, 'panels'>>, + internalApi: { + registerChildApi: (api: DefaultEmbeddableApi) => { + children$.next({ + ...children$.value, + [api.uuid]: api, + }); + }, + reset: (lastSavedState: DashboardState) => { + setPanels(lastSavedState.panels); + restoredRuntimeState = {}; + let resetChangedPanelCount = false; + const currentChildren = children$.value; + for (const panelId of Object.keys(currentChildren)) { + if (panels$.value[panelId]) { + const child = currentChildren[panelId]; + if (apiPublishesUnsavedChanges(child)) { + const success = child.resetUnsavedChanges(); + if (!success) { + coreServices.notifications.toasts.addWarning( + i18n.translate('dashboard.reset.panelError', { + defaultMessage: 'Unable to reset panel changes', + }) + ); + } + } + } else { + // if reset resulted in panel removal, we need to update the list of children + delete currentChildren[panelId]; + resetChangedPanelCount = true; + } + } + if (resetChangedPanelCount) children$.next(currentChildren); + }, + getState: (): { + panels: DashboardState['panels']; + references: Reference[]; + } => { + const references: Reference[] = []; + + const panels = Object.keys(panels$.value).reduce((acc, id) => { + const childApi = children$.value[id]; + const serializeResult = apiHasSerializableState(childApi) + ? childApi.serializeState() + : { rawState: {} }; + acc[id] = { ...panels$.value[id], explicitInput: { ...serializeResult.rawState, id } }; + + references.push(...prefixReferencesFromPanel(id, serializeResult.references ?? [])); + + return acc; + }, {} as DashboardPanelMap); + + return { panels, references }; + }, + }, + }; +} + +function getClonedPanelTitle(panelTitles: string[], rawTitle: string) { + if (rawTitle === '') return ''; + + const clonedTag = dashboardClonePanelActionStrings.getClonedTag(); + const cloneRegex = new RegExp(`\\(${clonedTag}\\)`, 'g'); + const cloneNumberRegex = new RegExp(`\\(${clonedTag} [0-9]+\\)`, 'g'); + const baseTitle = rawTitle.replace(cloneNumberRegex, '').replace(cloneRegex, '').trim(); + const similarTitles = filter(panelTitles, (title: string) => { + return title.startsWith(baseTitle); + }); + + const cloneNumbers = map(similarTitles, (title: string) => { + if (title.match(cloneRegex)) return 0; + const cloneTag = title.match(cloneNumberRegex); + return cloneTag ? parseInt(cloneTag[0].replace(/[^0-9.]/g, ''), 10) : -1; + }); + const similarBaseTitlesCount = max(cloneNumbers) || 0; + + return similarBaseTitlesCount < 0 + ? baseTitle + ` (${clonedTag})` + : baseTitle + ` (${clonedTag} ${similarBaseTitlesCount + 1})`; +} diff --git a/src/plugins/dashboard/public/dashboard_api/search_session_manager.ts b/src/plugins/dashboard/public/dashboard_api/search_session_manager.ts new file mode 100644 index 000000000000..dbca51f03ac1 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/search_session_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { BehaviorSubject } from 'rxjs'; +import { EmbeddablePackageState } from '@kbn/embeddable-plugin/public'; +import { DashboardApi, DashboardCreationOptions } from './types'; +import { dataService } from '../services/kibana_services'; +import { startDashboardSearchSessionIntegration } from '../dashboard_container/embeddable/create/search_sessions/start_dashboard_search_session_integration'; + +export function initializeSearchSessionManager( + searchSessionSettings: DashboardCreationOptions['searchSessionSettings'], + incomingEmbeddable: EmbeddablePackageState | undefined, + dashboardApi: Omit<DashboardApi, 'searchSessionId$'> +) { + const searchSessionId$ = new BehaviorSubject<string | undefined>(undefined); + + let stopSearchSessionIntegration: (() => void) | undefined; + if (searchSessionSettings) { + const { sessionIdToRestore } = searchSessionSettings; + + // if this incoming embeddable has a session, continue it. + if (incomingEmbeddable?.searchSessionId) { + dataService.search.session.continue(incomingEmbeddable.searchSessionId); + } + if (sessionIdToRestore) { + dataService.search.session.restore(sessionIdToRestore); + } + const existingSession = dataService.search.session.getSessionId(); + + const initialSearchSessionId = + sessionIdToRestore ?? + (existingSession && incomingEmbeddable + ? existingSession + : dataService.search.session.start()); + searchSessionId$.next(initialSearchSessionId); + + stopSearchSessionIntegration = startDashboardSearchSessionIntegration( + { + ...dashboardApi, + searchSessionId$, + }, + searchSessionSettings, + (searchSessionId: string) => searchSessionId$.next(searchSessionId) + ); + } + return { + api: { + searchSessionId$, + }, + cleanup: () => { + stopSearchSessionIntegration?.(); + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/settings_manager.ts b/src/plugins/dashboard/public/dashboard_api/settings_manager.ts new file mode 100644 index 000000000000..0b4903a506a9 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/settings_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import fastIsEqual from 'fast-deep-equal'; +import { + PublishingSubject, + StateComparators, + initializeTitles, +} from '@kbn/presentation-publishing'; +import { BehaviorSubject } from 'rxjs'; +import { DashboardState } from './types'; +import { DEFAULT_DASHBOARD_INPUT } from '../dashboard_constants'; +import { DashboardStateFromSettingsFlyout } from '../dashboard_container/types'; + +export function initializeSettingsManager({ + initialState, + setTimeRestore, + timeRestore$, +}: { + initialState?: DashboardState; + setTimeRestore: (timeRestore: boolean) => void; + timeRestore$: PublishingSubject<boolean | undefined>; +}) { + const syncColors$ = new BehaviorSubject<boolean>( + initialState?.syncColors ?? DEFAULT_DASHBOARD_INPUT.syncColors + ); + function setSyncColors(syncColors: boolean) { + if (syncColors !== syncColors$.value) syncColors$.next(syncColors); + } + const syncCursor$ = new BehaviorSubject<boolean>( + initialState?.syncCursor ?? DEFAULT_DASHBOARD_INPUT.syncCursor + ); + function setSyncCursor(syncCursor: boolean) { + if (syncCursor !== syncCursor$.value) syncCursor$.next(syncCursor); + } + const syncTooltips$ = new BehaviorSubject<boolean>( + initialState?.syncTooltips ?? DEFAULT_DASHBOARD_INPUT.syncTooltips + ); + function setSyncTooltips(syncTooltips: boolean) { + if (syncTooltips !== syncTooltips$.value) syncTooltips$.next(syncTooltips); + } + const tags$ = new BehaviorSubject<string[]>(initialState?.tags ?? DEFAULT_DASHBOARD_INPUT.tags); + function setTags(tags: string[]) { + if (!fastIsEqual(tags, tags$.value)) tags$.next(tags); + } + const titleManager = initializeTitles(initialState ?? {}); + const useMargins$ = new BehaviorSubject<boolean>( + initialState?.useMargins ?? DEFAULT_DASHBOARD_INPUT.useMargins + ); + function setUseMargins(useMargins: boolean) { + if (useMargins !== useMargins$.value) useMargins$.next(useMargins); + } + + function getSettings() { + return { + ...titleManager.serializeTitles(), + syncColors: syncColors$.value, + syncCursor: syncCursor$.value, + syncTooltips: syncTooltips$.value, + tags: tags$.value, + timeRestore: timeRestore$.value, + useMargins: useMargins$.value, + }; + } + + function setSettings(settings: DashboardStateFromSettingsFlyout) { + setSyncColors(settings.syncColors); + setSyncCursor(settings.syncCursor); + setSyncTooltips(settings.syncTooltips); + setTags(settings.tags); + setTimeRestore(settings.timeRestore); + setUseMargins(settings.useMargins); + titleManager.titlesApi.setHidePanelTitle(settings.hidePanelTitles); + titleManager.titlesApi.setPanelDescription(settings.description); + titleManager.titlesApi.setPanelTitle(settings.title); + } + + return { + api: { + ...titleManager.titlesApi, + getSettings, + settings: { + syncColors$, + syncCursor$, + syncTooltips$, + useMargins$, + }, + setSettings, + setTags, + timeRestore$, + }, + comparators: { + ...titleManager.titleComparators, + syncColors: [syncColors$, setSyncColors], + syncCursor: [syncCursor$, setSyncCursor], + syncTooltips: [syncTooltips$, setSyncTooltips], + useMargins: [useMargins$, setUseMargins], + } as StateComparators< + Pick< + DashboardState, + | 'description' + | 'hidePanelTitles' + | 'syncColors' + | 'syncCursor' + | 'syncTooltips' + | 'title' + | 'useMargins' + > + >, + internalApi: { + getState: (): Pick< + DashboardState, + | 'description' + | 'hidePanelTitles' + | 'syncColors' + | 'syncCursor' + | 'syncTooltips' + | 'tags' + | 'title' + | 'useMargins' + > => { + const settings = getSettings(); + return { + ...settings, + title: settings.title ?? '', + hidePanelTitles: settings.hidePanelTitles ?? DEFAULT_DASHBOARD_INPUT.hidePanelTitles, + }; + }, + reset: (lastSavedState: DashboardState) => { + setSettings(lastSavedState); + }, + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/track_contentful_render.ts b/src/plugins/dashboard/public/dashboard_api/track_contentful_render.ts new file mode 100644 index 000000000000..359dadaa4261 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/track_contentful_render.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { coreServices } from '../services/kibana_services'; + +// seperate from performance metrics +// reports when a dashboard renders with data +export function initializeTrackContentfulRender() { + let hadContentfulRender = false; + + return { + trackContentfulRender: () => { + if (!hadContentfulRender) { + coreServices.analytics.reportEvent('dashboard_loaded_with_data', {}); + } + hadContentfulRender = true; + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/track_panel.ts b/src/plugins/dashboard/public/dashboard_api/track_panel.ts index b9f9b3218488..07fe1134d4dc 100644 --- a/src/plugins/dashboard/public/dashboard_api/track_panel.ts +++ b/src/plugins/dashboard/public/dashboard_api/track_panel.ts @@ -9,7 +9,7 @@ import { BehaviorSubject } from 'rxjs'; -export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Promise<unknown>) { +export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Promise<undefined>) { const expandedPanelId$ = new BehaviorSubject<string | undefined>(undefined); const focusedPanelId$ = new BehaviorSubject<string | undefined>(undefined); const highlightPanelId$ = new BehaviorSubject<string | undefined>(undefined); @@ -27,7 +27,7 @@ export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Prom return { expandedPanelId: expandedPanelId$, expandPanel: (panelId: string) => { - const isPanelExpanded = Boolean(expandedPanelId$.value); + const isPanelExpanded = panelId === expandedPanelId$.value; if (isPanelExpanded) { setExpandedPanelId(undefined); @@ -79,7 +79,6 @@ export function initializeTrackPanel(untilEmbeddableLoaded: (id: string) => Prom scrollToTop: () => { window.scroll(0, 0); }, - setExpandedPanelId, setFocusedPanelId: (id: string | undefined) => { if (focusedPanelId$.value !== id) focusedPanelId$.next(id); setScrollToPanelId(id); diff --git a/src/plugins/dashboard/public/dashboard_api/types.ts b/src/plugins/dashboard/public/dashboard_api/types.ts index ec89a93dcd66..3805d31df1d2 100644 --- a/src/plugins/dashboard/public/dashboard_api/types.ts +++ b/src/plugins/dashboard/public/dashboard_api/types.ts @@ -10,25 +10,36 @@ import { CanExpandPanels, HasRuntimeChildState, + HasSaveNotification, HasSerializedChildState, PresentationContainer, + PublishesSettings, SerializedPanelState, + TrackContentfulRender, TracksOverlays, } from '@kbn/presentation-containers'; import { EmbeddableAppContext, HasAppContext, + HasExecutionContext, HasType, + HasUniqueId, + PublishesDataLoading, PublishesDataViews, PublishesPanelDescription, PublishesPanelTitle, PublishesSavedObjectId, PublishesUnifiedSearch, PublishesViewMode, + PublishesWritableViewMode, PublishingSubject, ViewMode, } from '@kbn/presentation-publishing'; -import { ControlGroupApi, ControlGroupSerializedState } from '@kbn/controls-plugin/public'; +import { + ControlGroupApi, + ControlGroupRuntimeState, + ControlGroupSerializedState, +} from '@kbn/controls-plugin/public'; import { Filter, Query, TimeRange } from '@kbn/es-query'; import { DefaultEmbeddableApi, @@ -36,19 +47,27 @@ import { ErrorEmbeddable, IEmbeddable, } from '@kbn/embeddable-plugin/public'; -import { Observable } from 'rxjs'; -import { SearchSessionInfoProvider } from '@kbn/data-plugin/public'; +import { Observable, Subject } from 'rxjs'; +import { RefreshInterval, SearchSessionInfoProvider } from '@kbn/data-plugin/public'; import { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; +import { PublishesReload } from '@kbn/presentation-publishing/interfaces/fetch/publishes_reload'; +import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; +import { LocatorPublic } from '@kbn/share-plugin/common'; import { DashboardPanelMap, DashboardPanelState } from '../../common'; +import type { DashboardOptions } from '../../server/content_management'; import { LoadDashboardReturn, SaveDashboardReturn, - SavedDashboardInput, } from '../services/dashboard_content_management_service/types'; -import { DashboardStateFromSettingsFlyout, UnsavedPanelState } from '../dashboard_container/types'; +import { + DashboardLocatorParams, + DashboardStateFromSettingsFlyout, +} from '../dashboard_container/types'; + +export const DASHBOARD_API_TYPE = 'dashboard'; export interface DashboardCreationOptions { - getInitialInput?: () => Partial<SavedDashboardInput>; + getInitialInput?: () => Partial<DashboardState>; getIncomingEmbeddable?: () => EmbeddablePackageState | undefined; @@ -74,57 +93,101 @@ export interface DashboardCreationOptions { getEmbeddableAppContext?: (dashboardId?: string) => EmbeddableAppContext; } +export interface DashboardState extends DashboardOptions { + // filter context to be passed to children + query: Query; + filters: Filter[]; + timeRestore: boolean; + timeRange?: TimeRange; + refreshInterval?: RefreshInterval; + + // dashboard meta info + title: string; + tags: string[]; + viewMode: ViewMode; + description?: string; + + // settings from DashboardOptions + + // dashboard contents + panels: DashboardPanelMap; + + /** + * Serialized control group state. + * Contains state loaded from dashboard saved object + */ + controlGroupInput?: ControlGroupSerializedState | undefined; + /** + * Runtime control group state. + * Contains state passed from dashboard locator + * Use runtime state when building input for portable dashboards + */ + controlGroupState?: Partial<ControlGroupRuntimeState>; +} + export type DashboardApi = CanExpandPanels & HasAppContext & + HasExecutionContext & HasRuntimeChildState & + HasSaveNotification & HasSerializedChildState & - HasType<'dashboard'> & + HasType<typeof DASHBOARD_API_TYPE> & + HasUniqueId & PresentationContainer & + PublishesDataLoading & PublishesDataViews & PublishesPanelDescription & Pick<PublishesPanelTitle, 'panelTitle'> & + PublishesReload & PublishesSavedObjectId & + PublishesSearchSession & + PublishesSettings & PublishesUnifiedSearch & PublishesViewMode & + PublishesWritableViewMode & + TrackContentfulRender & TracksOverlays & { - addFromLibrary: () => void; - animatePanelTransforms$: PublishingSubject<boolean>; asyncResetToLastSavedState: () => Promise<void>; controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>; fullScreenMode$: PublishingSubject<boolean>; focusedPanelId$: PublishingSubject<string | undefined>; forceRefresh: () => void; - getRuntimeStateForControlGroup: () => UnsavedPanelState | undefined; - getSerializedStateForControlGroup: () => SerializedPanelState<ControlGroupSerializedState>; getSettings: () => DashboardStateFromSettingsFlyout; - getDashboardPanelFromId: (id: string) => Promise<DashboardPanelState>; + getDashboardPanelFromId: (id: string) => DashboardPanelState; hasOverlays$: PublishingSubject<boolean>; - hasRunMigrations$: PublishingSubject<boolean>; hasUnsavedChanges$: PublishingSubject<boolean>; highlightPanel: (panelRef: HTMLDivElement) => void; highlightPanelId$: PublishingSubject<string | undefined>; isEmbeddedExternally: boolean; - managed$: PublishingSubject<boolean>; + isManaged: boolean; + locator?: Pick<LocatorPublic<DashboardLocatorParams>, 'navigate' | 'getRedirectUrl'>; panels$: PublishingSubject<DashboardPanelMap>; - registerChildApi: (api: DefaultEmbeddableApi) => void; - runInteractiveSave: (interactionMode: ViewMode) => Promise<SaveDashboardReturn | undefined>; + runInteractiveSave: () => Promise<SaveDashboardReturn | undefined>; runQuickSave: () => Promise<void>; scrollToPanel: (panelRef: HTMLDivElement) => void; scrollToPanelId$: PublishingSubject<string | undefined>; scrollToTop: () => void; - setControlGroupApi: (controlGroupApi: ControlGroupApi) => void; - setSettings: (settings: DashboardStateFromSettingsFlyout) => void; setFilters: (filters?: Filter[] | undefined) => void; setFullScreenMode: (fullScreenMode: boolean) => void; + setHighlightPanelId: (id: string | undefined) => void; setPanels: (panels: DashboardPanelMap) => void; setQuery: (query?: Query | undefined) => void; + setScrollToPanelId: (id: string | undefined) => void; + setSettings: (settings: DashboardStateFromSettingsFlyout) => void; setTags: (tags: string[]) => void; setTimeRange: (timeRange?: TimeRange | undefined) => void; - setViewMode: (viewMode: ViewMode) => void; - useMargins$: PublishingSubject<boolean | undefined>; - // TODO replace with HasUniqueId once dashboard is refactored and navigateToDashboard is removed - uuid$: PublishingSubject<string>; + unifiedSearchFilters$: PublishesUnifiedSearch['filters$']; // TODO remove types below this line - from legacy embeddable system untilEmbeddableLoaded: (id: string) => Promise<IEmbeddable | ErrorEmbeddable>; }; + +export interface DashboardInternalApi { + animatePanelTransforms$: PublishingSubject<boolean>; + controlGroupReload$: Subject<void>; + panelsReload$: Subject<void>; + getRuntimeStateForControlGroup: () => object | undefined; + getSerializedStateForControlGroup: () => SerializedPanelState<ControlGroupSerializedState>; + registerChildApi: (api: DefaultEmbeddableApi) => void; + setControlGroupApi: (controlGroupApi: ControlGroupApi) => void; +} diff --git a/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts b/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts new file mode 100644 index 000000000000..1310f0104a5e --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/unified_search_manager.ts @@ -0,0 +1,371 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the "Elastic License + * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { + COMPARE_ALL_OPTIONS, + Filter, + Query, + TimeRange, + compareFilters, + isFilterPinned, +} from '@kbn/es-query'; +import { + BehaviorSubject, + Observable, + Subject, + Subscription, + combineLatest, + debounceTime, + distinctUntilChanged, + finalize, + map, + of, + switchMap, + tap, +} from 'rxjs'; +import fastIsEqual from 'fast-deep-equal'; +import { PublishingSubject, StateComparators } from '@kbn/presentation-publishing'; +import { ControlGroupApi } from '@kbn/controls-plugin/public'; +import { cloneDeep } from 'lodash'; +import { + GlobalQueryStateFromUrl, + RefreshInterval, + connectToQueryState, + syncGlobalQueryStateWithUrl, +} from '@kbn/data-plugin/public'; +import moment, { Moment } from 'moment'; +import { cleanFiltersForSerialize } from '../utils/clean_filters_for_serialize'; +import { dataService } from '../services/kibana_services'; +import { DashboardCreationOptions, DashboardState } from './types'; +import { DEFAULT_DASHBOARD_INPUT, GLOBAL_STATE_STORAGE_KEY } from '../dashboard_constants'; + +export function initializeUnifiedSearchManager( + initialState: DashboardState, + controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>, + waitForPanelsToLoad$: Observable<void>, + getLastSavedState: () => DashboardState | undefined, + creationOptions?: DashboardCreationOptions +) { + const { + queryString, + filterManager, + timefilter: { timefilter: timefilterService }, + } = dataService.query; + + const controlGroupReload$ = new Subject<void>(); + const filters$ = new BehaviorSubject<Filter[] | undefined>(undefined); + const panelsReload$ = new Subject<void>(); + const query$ = new BehaviorSubject<Query | undefined>(initialState.query); + // setAndSyncQuery method not needed since query synced with 2-way data binding + function setQuery(query: Query) { + if (!fastIsEqual(query, query$.value)) { + query$.next(query); + } + } + const refreshInterval$ = new BehaviorSubject<RefreshInterval | undefined>( + initialState.refreshInterval + ); + function setRefreshInterval(refreshInterval: RefreshInterval) { + if (!fastIsEqual(refreshInterval, refreshInterval$.value)) { + refreshInterval$.next(refreshInterval); + } + } + function setAndSyncRefreshInterval(refreshInterval: RefreshInterval | undefined) { + const refreshIntervalOrDefault = + refreshInterval ?? timefilterService.getRefreshIntervalDefaults(); + setRefreshInterval(refreshIntervalOrDefault); + if (creationOptions?.useUnifiedSearchIntegration) { + timefilterService.setRefreshInterval(refreshIntervalOrDefault); + } + } + const timeRange$ = new BehaviorSubject<TimeRange | undefined>(initialState.timeRange); + function setTimeRange(timeRange: TimeRange) { + if (!fastIsEqual(timeRange, timeRange$.value)) { + timeRange$.next(timeRange); + } + } + function setAndSyncTimeRange(timeRange: TimeRange | undefined) { + const timeRangeOrDefault = timeRange ?? timefilterService.getTimeDefaults(); + setTimeRange(timeRangeOrDefault); + if (creationOptions?.useUnifiedSearchIntegration) { + timefilterService.setTime(timeRangeOrDefault); + } + } + const timeRestore$ = new BehaviorSubject<boolean | undefined>( + initialState?.timeRestore ?? DEFAULT_DASHBOARD_INPUT.timeRestore + ); + function setTimeRestore(timeRestore: boolean) { + if (timeRestore !== timeRestore$.value) timeRestore$.next(timeRestore); + } + const timeslice$ = new BehaviorSubject<[number, number] | undefined>(undefined); + const unifiedSearchFilters$ = new BehaviorSubject<Filter[] | undefined>(initialState.filters); + // setAndSyncUnifiedSearchFilters method not needed since filters synced with 2-way data binding + function setUnifiedSearchFilters(unifiedSearchFilters: Filter[]) { + if (!fastIsEqual(unifiedSearchFilters, unifiedSearchFilters$.value)) { + unifiedSearchFilters$.next(unifiedSearchFilters); + } + } + + // -------------------------------------------------------------------------------------- + // Set up control group integration + // -------------------------------------------------------------------------------------- + const controlGroupSubscriptions: Subscription = new Subscription(); + const controlGroupFilters$ = controlGroupApi$.pipe( + switchMap((controlGroupApi) => (controlGroupApi ? controlGroupApi.filters$ : of(undefined))) + ); + const controlGroupTimeslice$ = controlGroupApi$.pipe( + switchMap((controlGroupApi) => (controlGroupApi ? controlGroupApi.timeslice$ : of(undefined))) + ); + controlGroupSubscriptions.add( + combineLatest([unifiedSearchFilters$, controlGroupFilters$]).subscribe( + ([unifiedSearchFilters, controlGroupFilters]) => { + filters$.next([...(unifiedSearchFilters ?? []), ...(controlGroupFilters ?? [])]); + } + ) + ); + controlGroupSubscriptions.add(controlGroupFilters$.subscribe(() => panelsReload$.next())); + controlGroupSubscriptions.add( + controlGroupTimeslice$.subscribe((timeslice) => { + if (timeslice !== timeslice$.value) timeslice$.next(timeslice); + }) + ); + + // -------------------------------------------------------------------------------------- + // Set up unified search integration. + // -------------------------------------------------------------------------------------- + const unifiedSearchSubscriptions: Subscription = new Subscription(); + let stopSyncingWithUrl: (() => void) | undefined; + let stopSyncingAppFilters: (() => void) | undefined; + if ( + creationOptions?.useUnifiedSearchIntegration && + creationOptions?.unifiedSearchSettings?.kbnUrlStateStorage + ) { + // apply filters and query to the query service + filterManager.setAppFilters(cloneDeep(unifiedSearchFilters$.value ?? [])); + queryString.setQuery(query$.value ?? queryString.getDefaultQuery()); + + /** + * Get initial time range, and set up dashboard time restore if applicable + */ + const initialTimeRange: TimeRange = (() => { + // if there is an explicit time range in the URL it always takes precedence. + const urlOverrideTimeRange = + creationOptions.unifiedSearchSettings.kbnUrlStateStorage.get<GlobalQueryStateFromUrl>( + GLOBAL_STATE_STORAGE_KEY + )?.time; + if (urlOverrideTimeRange) return urlOverrideTimeRange; + + // if this Dashboard has timeRestore return the time range that was saved with the dashboard. + if (timeRestore$.value && timeRange$.value) return timeRange$.value; + + // otherwise fall back to the time range from the timefilterService. + return timefilterService.getTime(); + })(); + setTimeRange(initialTimeRange); + if (timeRestore$.value) { + if (timeRange$.value) timefilterService.setTime(timeRange$.value); + if (refreshInterval$.value) timefilterService.setRefreshInterval(refreshInterval$.value); + } + + // start syncing global query state with the URL. + const { stop } = syncGlobalQueryStateWithUrl( + dataService.query, + creationOptions?.unifiedSearchSettings.kbnUrlStateStorage + ); + stopSyncingWithUrl = stop; + + stopSyncingAppFilters = connectToQueryState( + dataService.query, + { + get: () => ({ + filters: unifiedSearchFilters$.value ?? [], + query: query$.value ?? dataService.query.queryString.getDefaultQuery(), + }), + set: ({ filters: newFilters, query: newQuery }) => { + setUnifiedSearchFilters(cleanFiltersForSerialize(newFilters)); + setQuery(newQuery); + }, + state$: combineLatest([query$, unifiedSearchFilters$]).pipe( + debounceTime(0), + map(([query, unifiedSearchFilters]) => { + return { + query: query ?? dataService.query.queryString.getDefaultQuery(), + filters: unifiedSearchFilters ?? [], + }; + }), + distinctUntilChanged() + ), + }, + { + query: true, + filters: true, + } + ); + + unifiedSearchSubscriptions.add( + timefilterService.getTimeUpdate$().subscribe(() => { + const urlOverrideTimeRange = + creationOptions?.unifiedSearchSettings?.kbnUrlStateStorage.get<GlobalQueryStateFromUrl>( + GLOBAL_STATE_STORAGE_KEY + )?.time; + if (urlOverrideTimeRange) { + setTimeRange(urlOverrideTimeRange); + return; + } + + const lastSavedTimeRange = getLastSavedState()?.timeRange; + if (timeRestore$.value && lastSavedTimeRange) { + setAndSyncTimeRange(lastSavedTimeRange); + return; + } + + setTimeRange(timefilterService.getTime()); + }) + ); + unifiedSearchSubscriptions.add( + timefilterService.getRefreshIntervalUpdate$().subscribe(() => { + const urlOverrideRefreshInterval = + creationOptions?.unifiedSearchSettings?.kbnUrlStateStorage.get<GlobalQueryStateFromUrl>( + GLOBAL_STATE_STORAGE_KEY + )?.refreshInterval; + if (urlOverrideRefreshInterval) { + setRefreshInterval(urlOverrideRefreshInterval); + return; + } + + const lastSavedRefreshInterval = getLastSavedState()?.refreshInterval; + if (timeRestore$.value && lastSavedRefreshInterval) { + setAndSyncRefreshInterval(lastSavedRefreshInterval); + return; + } + + setRefreshInterval(timefilterService.getRefreshInterval()); + }) + ); + unifiedSearchSubscriptions.add( + timefilterService + .getAutoRefreshFetch$() + .pipe( + tap(() => { + controlGroupReload$.next(); + panelsReload$.next(); + }), + switchMap((done) => waitForPanelsToLoad$.pipe(finalize(done))) + ) + .subscribe() + ); + } + + return { + api: { + filters$, + forceRefresh: () => { + controlGroupReload$.next(); + panelsReload$.next(); + }, + query$, + refreshInterval$, + setFilters: setUnifiedSearchFilters, + setQuery, + setTimeRange: setAndSyncTimeRange, + timeRange$, + timeslice$, + unifiedSearchFilters$, + }, + comparators: { + filters: [ + unifiedSearchFilters$, + setUnifiedSearchFilters, + // exclude pinned filters from comparision because pinned filters are not part of application state + (a, b) => + compareFilters( + (a ?? []).filter((f) => !isFilterPinned(f)), + (b ?? []).filter((f) => !isFilterPinned(f)), + COMPARE_ALL_OPTIONS + ), + ], + query: [query$, setQuery, fastIsEqual], + refreshInterval: [ + refreshInterval$, + (refreshInterval: RefreshInterval | undefined) => { + if (timeRestore$.value) setAndSyncRefreshInterval(refreshInterval); + }, + (a: RefreshInterval | undefined, b: RefreshInterval | undefined) => + timeRestore$.value ? fastIsEqual(a, b) : true, + ], + timeRange: [ + timeRange$, + (timeRange: TimeRange | undefined) => { + if (timeRestore$.value) setAndSyncTimeRange(timeRange); + }, + (a: TimeRange | undefined, b: TimeRange | undefined) => { + if (!timeRestore$.value) return true; // if time restore is set to false, time range doesn't count as a change. + if (!areTimesEqual(a?.from, b?.from) || !areTimesEqual(a?.to, b?.to)) { + return false; + } + return true; + }, + ], + timeRestore: [timeRestore$, setTimeRestore], + } as StateComparators< + Pick<DashboardState, 'filters' | 'query' | 'refreshInterval' | 'timeRange' | 'timeRestore'> + >, + internalApi: { + controlGroupReload$, + panelsReload$, + reset: (lastSavedState: DashboardState) => { + setUnifiedSearchFilters([ + ...(unifiedSearchFilters$.value ?? []).filter(isFilterPinned), + ...lastSavedState.filters, + ]); + setQuery(lastSavedState.query); + setTimeRestore(lastSavedState.timeRestore); + if (lastSavedState.timeRestore) { + setAndSyncRefreshInterval(lastSavedState.refreshInterval); + setAndSyncTimeRange(lastSavedState.timeRange); + } + }, + getState: (): Pick< + DashboardState, + 'filters' | 'query' | 'refreshInterval' | 'timeRange' | 'timeRestore' + > => ({ + filters: unifiedSearchFilters$.value ?? DEFAULT_DASHBOARD_INPUT.filters, + query: query$.value ?? DEFAULT_DASHBOARD_INPUT.query, + refreshInterval: refreshInterval$.value, + timeRange: timeRange$.value, + timeRestore: timeRestore$.value ?? DEFAULT_DASHBOARD_INPUT.timeRestore, + }), + setTimeRestore, + timeRestore$, + }, + cleanup: () => { + controlGroupSubscriptions.unsubscribe(); + unifiedSearchSubscriptions.unsubscribe(); + stopSyncingWithUrl?.(); + stopSyncingAppFilters?.(); + }, + }; +} + +const convertTimeToUTCString = (time?: string | Moment): undefined | string => { + if (moment(time).isValid()) { + return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); + } else { + // If it's not a valid moment date, then it should be a string representing a relative time + // like 'now' or 'now-15m'. + return time as string; + } +}; + +export const areTimesEqual = ( + timeA?: string | Moment | undefined, + timeB?: string | Moment | undefined +) => { + return convertTimeToUTCString(timeA) === convertTimeToUTCString(timeB); +}; diff --git a/src/plugins/dashboard/public/dashboard_api/unsaved_changes.ts b/src/plugins/dashboard/public/dashboard_api/unsaved_changes.ts deleted file mode 100644 index af588081ecc8..000000000000 --- a/src/plugins/dashboard/public/dashboard_api/unsaved_changes.ts +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { BehaviorSubject } from 'rxjs'; -import type { DashboardContainerInput } from '../../common'; - -export function initializeUnsavedChanges( - anyMigrationRun: boolean, - lastSavedInput: DashboardContainerInput -) { - const hasRunMigrations$ = new BehaviorSubject(anyMigrationRun); - const hasUnsavedChanges$ = new BehaviorSubject(false); - const lastSavedInput$ = new BehaviorSubject<DashboardContainerInput>(lastSavedInput); - - return { - hasRunMigrations$, - hasUnsavedChanges$, - lastSavedInput$, - setHasUnsavedChanges: (hasUnsavedChanges: boolean) => - hasUnsavedChanges$.next(hasUnsavedChanges), - setLastSavedInput: (input: DashboardContainerInput) => { - lastSavedInput$.next(input); - - // if we set the last saved input, it means we have saved this Dashboard - therefore clientside migrations have - // been serialized into the SO. - hasRunMigrations$.next(false); - }, - }; -} diff --git a/src/plugins/dashboard/public/dashboard_api/unsaved_changes_manager.ts b/src/plugins/dashboard/public/dashboard_api/unsaved_changes_manager.ts new file mode 100644 index 000000000000..46ae02de87fc --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/unsaved_changes_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { BehaviorSubject, Subject, combineLatest, debounceTime, skipWhile, switchMap } from 'rxjs'; +import { PublishesSavedObjectId, PublishingSubject } from '@kbn/presentation-publishing'; +import { ControlGroupApi } from '@kbn/controls-plugin/public'; +import { childrenUnsavedChanges$, initializeUnsavedChanges } from '@kbn/presentation-containers'; +import { omit } from 'lodash'; +import { DashboardCreationOptions, DashboardState } from './types'; +import { initializePanelsManager } from './panels_manager'; +import { initializeSettingsManager } from './settings_manager'; +import { initializeUnifiedSearchManager } from './unified_search_manager'; +import { + PANELS_CONTROL_GROUP_KEY, + getDashboardBackupService, +} from '../services/dashboard_backup_service'; +import { initializeViewModeManager } from './view_mode_manager'; + +export function initializeUnsavedChangesManager({ + creationOptions, + controlGroupApi$, + lastSavedState, + panelsManager, + savedObjectId$, + settingsManager, + viewModeManager, + unifiedSearchManager, +}: { + creationOptions?: DashboardCreationOptions; + controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>; + lastSavedState: DashboardState; + panelsManager: ReturnType<typeof initializePanelsManager>; + savedObjectId$: PublishesSavedObjectId['savedObjectId']; + settingsManager: ReturnType<typeof initializeSettingsManager>; + viewModeManager: ReturnType<typeof initializeViewModeManager>; + unifiedSearchManager: ReturnType<typeof initializeUnifiedSearchManager>; +}) { + const hasUnsavedChanges$ = new BehaviorSubject(false); + const lastSavedState$ = new BehaviorSubject<DashboardState>(lastSavedState); + const saveNotification$ = new Subject<void>(); + + const dashboardUnsavedChanges = initializeUnsavedChanges< + Omit<DashboardState, 'controlGroupInput' | 'controlGroupState' | 'timeslice' | 'tags'> + >( + lastSavedState, + { saveNotification$ }, + { + ...panelsManager.comparators, + ...settingsManager.comparators, + ...viewModeManager.comparators, + ...unifiedSearchManager.comparators, + } + ); + + const unsavedChangesSubscription = combineLatest([ + dashboardUnsavedChanges.api.unsavedChanges, + childrenUnsavedChanges$(panelsManager.api.children$), + controlGroupApi$.pipe( + skipWhile((controlGroupApi) => !controlGroupApi), + switchMap((controlGroupApi) => { + return controlGroupApi!.unsavedChanges; + }) + ), + ]) + .pipe(debounceTime(0)) + .subscribe(([dashboardChanges, unsavedPanelState, controlGroupChanges]) => { + // viewMode needs to be stored in session state because + // its used to exclude 'view' dashboards on the listing page + // However, viewMode should not trigger unsaved changes notification + // otherwise, opening a dashboard in edit mode will always show unsaved changes + const hasDashboardChanges = + Object.keys(omit(dashboardChanges ?? {}, ['viewMode'])).length > 0; + const hasUnsavedChanges = + hasDashboardChanges || unsavedPanelState !== undefined || controlGroupChanges !== undefined; + if (hasUnsavedChanges !== hasUnsavedChanges$.value) { + hasUnsavedChanges$.next(hasUnsavedChanges); + } + + // backup unsaved changes if configured to do so + if (creationOptions?.useSessionStorageIntegration) { + // Current behaviour expects time range not to be backed up. Revisit this? + const dashboardStateToBackup = omit(dashboardChanges ?? {}, [ + 'timeRange', + 'refreshInterval', + ]); + const reactEmbeddableChanges = unsavedPanelState ? { ...unsavedPanelState } : {}; + if (controlGroupChanges) { + reactEmbeddableChanges[PANELS_CONTROL_GROUP_KEY] = controlGroupChanges; + } + + getDashboardBackupService().setState( + savedObjectId$.value, + dashboardStateToBackup, + reactEmbeddableChanges + ); + } + }); + + return { + api: { + asyncResetToLastSavedState: async () => { + panelsManager.internalApi.reset(lastSavedState$.value); + settingsManager.internalApi.reset(lastSavedState$.value); + unifiedSearchManager.internalApi.reset(lastSavedState$.value); + await controlGroupApi$.value?.asyncResetUnsavedChanges(); + }, + hasUnsavedChanges$, + saveNotification$, + }, + cleanup: () => { + dashboardUnsavedChanges.cleanup(); + unsavedChangesSubscription.unsubscribe(); + }, + internalApi: { + getLastSavedState: () => lastSavedState$.value, + onSave: (savedState: DashboardState) => { + lastSavedState$.next(savedState); + saveNotification$.next(); + }, + }, + }; +} diff --git a/src/plugins/dashboard/public/dashboard_api/use_dashboard_internal_api.ts b/src/plugins/dashboard/public/dashboard_api/use_dashboard_internal_api.ts new file mode 100644 index 000000000000..bb9e25bd0065 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/use_dashboard_internal_api.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { createContext, useContext } from 'react'; +import { DashboardInternalApi } from './types'; + +export const DashboardInternalContext = createContext<DashboardInternalApi | undefined>(undefined); + +export const useDashboardInternalApi = (): DashboardInternalApi => { + const internalApi = useContext<DashboardInternalApi | undefined>(DashboardInternalContext); + if (!internalApi) { + throw new Error('useDashboardInternalApi must be used inside DashboardContext'); + } + return internalApi; +}; diff --git a/src/plugins/dashboard/public/dashboard_api/view_mode_manager.ts b/src/plugins/dashboard/public/dashboard_api/view_mode_manager.ts new file mode 100644 index 000000000000..1ef1a19c9563 --- /dev/null +++ b/src/plugins/dashboard/public/dashboard_api/view_mode_manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { EmbeddablePackageState } from '@kbn/embeddable-plugin/public'; +import { StateComparators, ViewMode } from '@kbn/presentation-publishing'; +import { BehaviorSubject } from 'rxjs'; +import { LoadDashboardReturn } from '../services/dashboard_content_management_service/types'; +import { getDashboardBackupService } from '../services/dashboard_backup_service'; +import { getDashboardCapabilities } from '../utils/get_dashboard_capabilities'; +import { DashboardState } from './types'; + +export function initializeViewModeManager( + incomingEmbeddable?: EmbeddablePackageState, + savedObjectResult?: LoadDashboardReturn +) { + const dashboardBackupService = getDashboardBackupService(); + function getInitialViewMode() { + if (savedObjectResult?.managed || !getDashboardCapabilities().showWriteControls) { + return 'view'; + } + + if ( + incomingEmbeddable || + savedObjectResult?.newDashboardCreated || + dashboardBackupService.dashboardHasUnsavedEdits(savedObjectResult?.dashboardId) + ) + return 'edit'; + + return dashboardBackupService.getViewMode(); + } + + const viewMode$ = new BehaviorSubject<ViewMode>(getInitialViewMode()); + + function setViewMode(viewMode: ViewMode) { + // block the Dashboard from entering edit mode if this Dashboard is managed. + if (savedObjectResult?.managed && viewMode?.toLowerCase() === 'edit') { + return; + } + viewMode$.next(viewMode); + } + + return { + api: { + viewMode: viewMode$, + setViewMode, + }, + comparators: { + viewMode: [ + viewMode$, + setViewMode, + // When compared view mode is always considered unequal so that it gets backed up. + // view mode unsaved changes do not show unsaved badge + () => false, + ], + } as StateComparators<Pick<DashboardState, 'viewMode'>>, + }; +} 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 9c6526ce3403..45fc421e4b90 100644 --- a/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts +++ b/src/plugins/dashboard/public/dashboard_app/_dashboard_app_strings.ts @@ -67,15 +67,6 @@ export const unsavedChangesBadgeStrings = { defaultMessage: ' You have unsaved changes in this dashboard. To remove this label, save the dashboard.', }), - getHasRunMigrationsText: () => - i18n.translate('dashboard.hasRunMigrationsBadge', { - defaultMessage: 'Save recommended', - }), - getHasRunMigrationsToolTipContent: () => - i18n.translate('dashboard.hasRunMigrationsBadgeToolTipContent', { - defaultMessage: - 'One or more panels on this dashboard have been updated to a new version. Save the dashboard so it loads faster next time.', - }), }; export const getCreateVisualizationButtonTitle = () => @@ -139,6 +130,22 @@ export const shareModalStrings = { defaultMessage: 'One or more panels on this dashboard have changed. Before you generate a snapshot, save the dashboard.', }), + getDraftSharePanelChangesWarning: () => + i18n.translate('dashboard.snapshotShare.panelChangesWarning', { + defaultMessage: + 'You are about to share a dashboard with unsaved changes, and the link may not work properly. Save the dashboard first to create a permanent link.', + }), + getEmbedSharePanelChangesWarning: () => + i18n.translate('dashboard.embedShare.draftWarning', { + defaultMessage: + 'You are about to create an embedded dashboard with unsaved changes, and the embed code may not work properly. Save the dashboard first to create a permanent embedded dashboard.', + }), + getDraftShareWarning: (shareType: 'embed' | 'link') => + i18n.translate('dashboard.snapshotShare.draftWarning', { + defaultMessage: + 'This dashboard has unsaved changes. Consider saving your dashboard before generating the {shareType}.', + values: { shareType: shareType === 'embed' ? 'embed code' : 'link' }, + }), }; /* diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_app.test.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_app.test.tsx index 2bed3ce44ea6..ba6ec626f234 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_app.test.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_app.test.tsx @@ -12,11 +12,10 @@ import React, { useEffect } from 'react'; import { render, waitFor } from '@testing-library/react'; -import { DashboardApi } from '..'; import type { DashboardRendererProps } from '../dashboard_container/external_api/dashboard_renderer'; import { LazyDashboardRenderer } from '../dashboard_container/external_api/lazy_dashboard_renderer'; import { DashboardTopNav } from '../dashboard_top_nav'; -import { buildMockDashboard } from '../mocks'; +import { buildMockDashboardApi } from '../mocks'; import { dataService } from '../services/kibana_services'; import { DashboardApp } from './dashboard_app'; @@ -26,12 +25,12 @@ jest.mock('../dashboard_top_nav'); describe('Dashboard App', () => { dataService.query.filterManager.getFilters = jest.fn().mockImplementation(() => []); - const mockDashboard = buildMockDashboard(); + const { api: dashboardApi, cleanup } = buildMockDashboardApi(); let mockHistory: MemoryHistory; // this is in url_utils dashboardApi expandedPanel subscription let historySpy: jest.SpyInstance; // this is in the dashboard app for the renderer when provided an expanded panel id - const expandPanelSpy = jest.spyOn(mockDashboard, 'expandPanel'); + const expandPanelSpy = jest.spyOn(dashboardApi, 'expandPanel'); beforeAll(() => { mockHistory = createMemoryHistory(); @@ -46,7 +45,7 @@ describe('Dashboard App', () => { ({ onApiAvailable }: DashboardRendererProps) => { // we need overwrite the onApiAvailable prop to get access to the dashboard API in this test useEffect(() => { - onApiAvailable?.(mockDashboard as DashboardApi); + onApiAvailable?.(dashboardApi); }, [onApiAvailable]); return <div>Test renderer</div>; @@ -60,23 +59,27 @@ describe('Dashboard App', () => { historySpy.mockClear(); }); + afterAll(() => { + cleanup(); + }); + it('test the default behavior without an expandedPanel id passed as a prop to the DashboardApp', async () => { render(<DashboardApp redirectTo={jest.fn()} history={mockHistory} />); await waitFor(() => { expect(expandPanelSpy).not.toHaveBeenCalled(); // this value should be undefined by default - expect(mockDashboard.expandedPanelId.getValue()).toBe(undefined); + expect(dashboardApi.expandedPanelId.getValue()).toBe(undefined); // history should not be called expect(historySpy).toHaveBeenCalledTimes(0); expect(mockHistory.location.pathname).toBe('/'); }); // simulate expanding a panel - mockDashboard.expandPanel('123'); + dashboardApi.expandPanel('123'); await waitFor(() => { - expect(mockDashboard.expandedPanelId.getValue()).toBe('123'); + expect(dashboardApi.expandedPanelId.getValue()).toBe('123'); expect(historySpy).toHaveBeenCalledTimes(1); expect(mockHistory.location.pathname).toBe('/create/123'); }); @@ -91,10 +94,10 @@ describe('Dashboard App', () => { }); // simulate minimizing a panel - mockDashboard.expandedPanelId.next(undefined); + dashboardApi.expandPanel('456'); await waitFor(() => { - expect(mockDashboard.expandedPanelId.getValue()).toBe(undefined); + expect(dashboardApi.expandedPanelId.getValue()).toBe(undefined); expect(historySpy).toHaveBeenCalledTimes(1); expect(mockHistory.location.pathname).toBe('/create'); }); diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx index 400d56e97df0..06f56669630e 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx @@ -9,7 +9,6 @@ import { History } from 'history'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; -import useMount from 'react-use/lib/useMount'; import useObservable from 'react-use/lib/useObservable'; import { debounceTime } from 'rxjs'; import { v4 as uuidv4 } from 'uuid'; @@ -70,10 +69,33 @@ export function DashboardApp({ }: DashboardAppProps) { const [showNoDataPage, setShowNoDataPage] = useState<boolean>(false); const [regenerateId, setRegenerateId] = useState(uuidv4()); + const incomingEmbeddable = useMemo(() => { + return embeddableService + .getStateTransfer() + .getIncomingEmbeddablePackage(DASHBOARD_APP_ID, true); + }, []); - useMount(() => { - (async () => setShowNoDataPage(await isDashboardAppInNoDataState()))(); - }); + useEffect(() => { + let canceled = false; + // show dashboard when there is an incoming embeddable + if (incomingEmbeddable) { + return; + } + + isDashboardAppInNoDataState() + .then((isInNotDataState) => { + if (!canceled && isInNotDataState) { + setShowNoDataPage(true); + } + }) + .catch((error) => { + // show dashboard application if inNoDataState can not be determined + }); + + return () => { + canceled = true; + }; + }, [incomingEmbeddable]); const [dashboardApi, setDashboardApi] = useState<DashboardApi | undefined>(undefined); const showPlainSpinner = useObservable(coreServices.customBranding.hasCustomBranding$, false); @@ -138,8 +160,7 @@ export function DashboardApp({ }; return Promise.resolve<DashboardCreationOptions>({ - getIncomingEmbeddable: () => - embeddableService.getStateTransfer().getIncomingEmbeddablePackage(DASHBOARD_APP_ID, true), + getIncomingEmbeddable: () => incomingEmbeddable, // integrations useSessionStorageIntegration: true, @@ -166,7 +187,14 @@ export function DashboardApp({ getCurrentPath: () => `#${createDashboardEditUrl(dashboardId)}`, }), }); - }, [history, embedSettings, validateOutcome, getScopedHistory, kbnUrlStateStorage]); + }, [ + history, + embedSettings, + validateOutcome, + getScopedHistory, + kbnUrlStateStorage, + incomingEmbeddable, + ]); useEffect(() => { if (!dashboardApi) return; diff --git a/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx b/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx index 6ceaede806fe..f994d9aa20c8 100644 --- a/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx +++ b/src/plugins/dashboard/public/dashboard_app/dashboard_router.tsx @@ -104,6 +104,7 @@ export async function mountApp({ } return ( <DashboardApp + key={routeProps.match.params.id ?? 'newDashboard'} history={routeProps.history} embedSettings={globalEmbedSettings} savedDashboardId={routeProps.match.params.id} diff --git a/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_no_match.tsx b/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_no_match.tsx index 3ad35d34b7fd..d68c4a76e9f7 100644 --- a/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_no_match.tsx +++ b/src/plugins/dashboard/public/dashboard_app/listing_page/dashboard_no_match.tsx @@ -49,7 +49,7 @@ export const DashboardNoMatch = ({ history }: { history: RouteComponentProps['hi /> </p> </EuiCallOut>, - { analytics: coreServices.analytics, i18n: coreServices.i18n, theme: coreServices.theme } + coreServices ) ); diff --git a/src/plugins/dashboard/public/dashboard_app/no_data/dashboard_app_no_data.tsx b/src/plugins/dashboard/public/dashboard_app/no_data/dashboard_app_no_data.tsx index 366726267c31..69279269b171 100644 --- a/src/plugins/dashboard/public/dashboard_app/no_data/dashboard_app_no_data.tsx +++ b/src/plugins/dashboard/public/dashboard_app/no_data/dashboard_app_no_data.tsx @@ -21,7 +21,6 @@ import { withSuspense } from '@kbn/shared-ux-utility'; import type { TypedLensByValueInput } from '@kbn/lens-plugin/public'; import { getLensAttributesFromSuggestion } from '@kbn/visualization-utils'; -import { DASHBOARD_APP_ID } from '../../dashboard_constants'; import { coreServices, dataService, @@ -153,15 +152,8 @@ export const DashboardAppNoDataPage = ({ export const isDashboardAppInNoDataState = async () => { const hasUserDataView = await dataService.dataViews.hasData.hasUserDataView().catch(() => false); - if (hasUserDataView) return false; - // consider has data if there is an incoming embeddable - const hasIncomingEmbeddable = embeddableService - .getStateTransfer() - .getIncomingEmbeddablePackage(DASHBOARD_APP_ID, false); - if (hasIncomingEmbeddable) return false; - // consider has data if there is unsaved dashboard with edits if (getDashboardBackupService().dashboardHasUnsavedEdits()) return false; diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx index ddc629854aff..6f9e0b5892a8 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/dashboard_editing_toolbar.tsx @@ -27,6 +27,7 @@ import { import { getCreateVisualizationButtonTitle } from '../_dashboard_app_strings'; import { ControlsToolbarButton } from './controls_toolbar_button'; import { EditorMenu } from './editor_menu'; +import { addFromLibrary } from '../../dashboard_container/embeddable/api'; export function DashboardEditingToolbar({ isDisabled }: { isDisabled?: boolean }) { const { euiTheme } = useEuiTheme(); @@ -89,7 +90,7 @@ export function DashboardEditingToolbar({ isDisabled }: { isDisabled?: boolean } const extraButtons = [ <EditorMenu createNewVisType={createNewVisType} isDisabled={isDisabled} />, <AddFromLibraryButton - onClick={() => dashboardApi.addFromLibrary()} + onClick={() => addFromLibrary(dashboardApi)} size="s" data-test-subj="dashboardAddFromLibraryButton" isDisabled={isDisabled} diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx index 7850c1e9ed74..e1bbef897d53 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.test.tsx @@ -9,10 +9,9 @@ import { render } from '@testing-library/react'; import React from 'react'; -import { buildMockDashboard } from '../../mocks'; +import { buildMockDashboardApi } from '../../mocks'; import { EditorMenu } from './editor_menu'; -import { DashboardApi } from '../../dashboard_api/types'; import { DashboardContext } from '../../dashboard_api/use_dashboard_api'; import { embeddableService, @@ -27,13 +26,10 @@ jest.spyOn(visualizationsService, 'getAliases').mockReturnValue([]); describe('editor menu', () => { it('renders without crashing', async () => { + const { api } = buildMockDashboardApi(); render(<EditorMenu createNewVisType={jest.fn()} />, { wrapper: ({ children }) => { - return ( - <DashboardContext.Provider value={buildMockDashboard() as DashboardApi}> - {children} - </DashboardContext.Provider> - ); + return <DashboardContext.Provider value={api}>{children}</DashboardContext.Provider>; }, }); }); diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.tsx index cf7f9c65c661..6d052225d6fb 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/editor_menu.tsx @@ -57,7 +57,7 @@ export const EditorMenu = ({ createNewVisType, isDisabled }: EditorMenuProps) => /> ); }), - { analytics: coreServices.analytics, theme: coreServices.theme, i18n: coreServices.i18n } + coreServices ); dashboardApi.openOverlay( diff --git a/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx b/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx index 2e3690e40d4e..41a290844328 100644 --- a/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx +++ b/src/plugins/dashboard/public/dashboard_app/top_nav/share/show_share_modal.tsx @@ -11,7 +11,7 @@ import { omit } from 'lodash'; import moment from 'moment'; import React, { ReactElement, useState } from 'react'; -import { EuiCheckboxGroup } from '@elastic/eui'; +import { EuiCallOut, EuiCheckboxGroup } from '@elastic/eui'; import type { Capabilities } from '@kbn/core/public'; import { QueryState } from '@kbn/data-plugin/common'; import { DASHBOARD_APP_LOCATOR } from '@kbn/deeplinks-analytics'; @@ -19,6 +19,7 @@ import { ViewMode } from '@kbn/embeddable-plugin/public'; import { i18n } from '@kbn/i18n'; import { getStateFromKbnUrl, setStateToKbnUrl, unhashUrl } from '@kbn/kibana-utils-plugin/public'; +import { FormattedMessage } from '@kbn/i18n-react'; import { convertPanelMapToPanelsArray, DashboardPanelMap } from '../../../../common'; import { DashboardLocatorParams } from '../../../dashboard_container'; import { @@ -122,7 +123,7 @@ export function ShowShareModal({ const allUnsavedPanels = (() => { if ( Object.keys(unsavedDashboardState?.panels ?? {}).length === 0 && - Object.keys(panelModifications ?? {}).length === 0 + Object.keys(omit(panelModifications ?? {}, PANELS_CONTROL_GROUP_KEY)).length === 0 ) { // if this dashboard has no modifications or unsaved panels return early. No overrides needed. return; @@ -195,11 +196,13 @@ export function ShowShareModal({ unhashUrl(baseUrl) ); + const allowShortUrl = getDashboardCapabilities().createShortUrl; + shareService.toggleShareContextMenu({ isDirty, anchorElement, allowEmbed: true, - allowShortUrl: getDashboardCapabilities().createShortUrl, + allowShortUrl, shareableUrl, objectId: savedObjectId, objectType: 'dashboard', @@ -207,6 +210,44 @@ export function ShowShareModal({ title: i18n.translate('dashboard.share.shareModal.title', { defaultMessage: 'Share this dashboard', }), + config: { + link: { + draftModeCallOut: ( + <EuiCallOut + color="warning" + data-test-subj="DashboardDraftModeCopyLinkCallOut" + title={ + <FormattedMessage + id="dashboard.share.shareModal.draftModeCallout.title" + defaultMessage="Unsaved changes" + /> + } + > + {Boolean(unsavedDashboardState?.panels) + ? shareModalStrings.getDraftSharePanelChangesWarning() + : shareModalStrings.getDraftShareWarning('link')} + </EuiCallOut> + ), + }, + embed: { + draftModeCallOut: ( + <EuiCallOut + color="warning" + data-test-subj="DashboardDraftModeEmbedCallOut" + title={ + <FormattedMessage + id="dashboard.share.shareModal.draftModeCallout.title" + defaultMessage="Unsaved changes" + /> + } + > + {Boolean(unsavedDashboardState?.panels) + ? shareModalStrings.getEmbedSharePanelChangesWarning() + : shareModalStrings.getDraftShareWarning('embed')} + </EuiCallOut> + ), + }, + }, }, sharingData: { title: 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 ca58d3c74bd3..07e29db545e7 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 @@ -8,7 +8,6 @@ */ import { Dispatch, SetStateAction, useCallback, useMemo, useState } from 'react'; -import { batch } from 'react-redux'; import { ViewMode } from '@kbn/embeddable-plugin/public'; import type { TopNavMenuData } from '@kbn/navigation-plugin/public'; @@ -42,28 +41,16 @@ export const useDashboardMenuItems = ({ const [isSaveInProgress, setIsSaveInProgress] = useState(false); - /** - * Unpack dashboard state from redux - */ const dashboardApi = useDashboardApi(); - const [ - dashboardTitle, - hasOverlays, - hasRunMigrations, - hasUnsavedChanges, - lastSavedId, - managed, - viewMode, - ] = useBatchedPublishingSubjects( - dashboardApi.panelTitle, - dashboardApi.hasOverlays$, - dashboardApi.hasRunMigrations$, - dashboardApi.hasUnsavedChanges$, - dashboardApi.savedObjectId, - dashboardApi.managed$, - dashboardApi.viewMode - ); + const [dashboardTitle, hasOverlays, hasUnsavedChanges, lastSavedId, viewMode] = + useBatchedPublishingSubjects( + dashboardApi.panelTitle, + dashboardApi.hasOverlays$, + dashboardApi.hasUnsavedChanges$, + dashboardApi.savedObjectId, + dashboardApi.viewMode + ); const disableTopNav = isSaveInProgress || hasOverlays; /** @@ -96,8 +83,8 @@ export const useDashboardMenuItems = ({ * initiate interactive dashboard copy action */ const dashboardInteractiveSave = useCallback(() => { - dashboardApi.runInteractiveSave(viewMode).then((result) => maybeRedirect(result)); - }, [maybeRedirect, dashboardApi, viewMode]); + dashboardApi.runInteractiveSave().then((result) => maybeRedirect(result)); + }, [maybeRedirect, dashboardApi]); /** * Show the dashboard's "Confirm reset changes" modal. If confirmed: @@ -118,15 +105,13 @@ export const useDashboardMenuItems = ({ switchModes?.(); return; } - confirmDiscardUnsavedChanges(() => { - batch(async () => { - setIsResetting(true); - await dashboardApi.asyncResetToLastSavedState(); - if (isMounted()) { - setIsResetting(false); - switchModes?.(); - } - }); + confirmDiscardUnsavedChanges(async () => { + setIsResetting(true); + await dashboardApi.asyncResetToLastSavedState(); + if (isMounted()) { + setIsResetting(false); + switchModes?.(); + } }, viewMode as ViewMode); }, [dashboardApi, hasUnsavedChanges, viewMode, isMounted] @@ -175,7 +160,7 @@ export const useDashboardMenuItems = ({ emphasize: true, isLoading: isSaveInProgress, testId: 'dashboardQuickSaveMenuItem', - disableButton: disableTopNav || !(hasRunMigrations || hasUnsavedChanges), + disableButton: disableTopNav || !hasUnsavedChanges, run: () => quickSaveDashboard(), } as TopNavMenuData, @@ -225,7 +210,6 @@ export const useDashboardMenuItems = ({ }, [ disableTopNav, isSaveInProgress, - hasRunMigrations, hasUnsavedChanges, lastSavedId, dashboardInteractiveSave, @@ -273,7 +257,7 @@ export const useDashboardMenuItems = ({ const labsMenuItem = isLabsEnabled ? [menuItems.labs] : []; const shareMenuItem = shareService ? [menuItems.share] : []; const duplicateMenuItem = showWriteControls ? [menuItems.interactiveSave] : []; - const editMenuItem = showWriteControls && !managed ? [menuItems.edit] : []; + const editMenuItem = showWriteControls && !dashboardApi.isManaged ? [menuItems.edit] : []; const mayberesetChangesMenuItem = showResetChange ? [resetChangesMenuItem] : []; return [ @@ -284,7 +268,7 @@ export const useDashboardMenuItems = ({ ...mayberesetChangesMenuItem, ...editMenuItem, ]; - }, [isLabsEnabled, menuItems, managed, showResetChange, resetChangesMenuItem]); + }, [isLabsEnabled, menuItems, dashboardApi.isManaged, showResetChange, resetChangesMenuItem]); const editModeTopNavConfig = useMemo(() => { const labsMenuItem = isLabsEnabled ? [menuItems.labs] : []; diff --git a/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts b/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts index 0fc8ce7173e6..37c9af6944f7 100644 --- a/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts +++ b/src/plugins/dashboard/public/dashboard_app/url/search_sessions_integration.ts @@ -51,7 +51,7 @@ export function createSessionRestorationDataProvider( ): SearchSessionInfoProvider<DashboardLocatorParams> { return { getName: async () => - dashboardApi.panelTitle.value ?? dashboardApi.savedObjectId.value ?? dashboardApi.uuid$.value, + dashboardApi.panelTitle.value ?? dashboardApi.savedObjectId.value ?? dashboardApi.uuid, getLocatorData: async () => ({ id: DASHBOARD_APP_LOCATOR, initialState: getLocatorParams({ dashboardApi, shouldRestoreSearchSession: false }), diff --git a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.test.tsx b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.test.tsx index b167f68e1595..6a8da6aa9f21 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.test.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.test.tsx @@ -11,27 +11,29 @@ import { findTestSubject } from '@elastic/eui/lib/test'; import { mountWithIntl } from '@kbn/test-jest-helpers'; import React from 'react'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; -import { DashboardApi } from '../../../dashboard_api/types'; import { DashboardContext } from '../../../dashboard_api/use_dashboard_api'; -import { buildMockDashboard } from '../../../mocks'; +import { DashboardApi } from '../../../dashboard_api/types'; import { coreServices, visualizationsService } from '../../../services/kibana_services'; import { DashboardEmptyScreen } from './dashboard_empty_screen'; +import { ViewMode } from '@kbn/presentation-publishing'; +import { BehaviorSubject } from 'rxjs'; visualizationsService.getAliases = jest.fn().mockReturnValue([{ name: 'lens' }]); describe('DashboardEmptyScreen', () => { function mountComponent(viewMode: ViewMode) { - const dashboardApi = buildMockDashboard({ overrides: { viewMode } }) as DashboardApi; + const mockDashboardApi = { + viewMode: new BehaviorSubject<ViewMode>(viewMode), + } as unknown as DashboardApi; return mountWithIntl( - <DashboardContext.Provider value={dashboardApi}> + <DashboardContext.Provider value={mockDashboardApi}> <DashboardEmptyScreen /> </DashboardContext.Provider> ); } test('renders correctly with view mode', () => { - const component = mountComponent(ViewMode.VIEW); + const component = mountComponent('view'); expect(component.render()).toMatchSnapshot(); const emptyReadWrite = findTestSubject(component, 'dashboardEmptyReadWrite'); @@ -43,7 +45,7 @@ describe('DashboardEmptyScreen', () => { }); test('renders correctly with edit mode', () => { - const component = mountComponent(ViewMode.EDIT); + const component = mountComponent('edit'); expect(component.render()).toMatchSnapshot(); const emptyReadWrite = findTestSubject(component, 'dashboardEmptyReadWrite'); @@ -57,7 +59,7 @@ describe('DashboardEmptyScreen', () => { test('renders correctly with readonly mode', () => { (coreServices.application.capabilities as any).dashboard.showWriteControls = false; - const component = mountComponent(ViewMode.VIEW); + const component = mountComponent('view'); expect(component.render()).toMatchSnapshot(); const emptyReadWrite = findTestSubject(component, 'dashboardEmptyReadWrite'); @@ -72,7 +74,7 @@ describe('DashboardEmptyScreen', () => { test('renders correctly with readonly and edit mode', () => { (coreServices.application.capabilities as any).dashboard.showWriteControls = false; - const component = mountComponent(ViewMode.EDIT); + const component = mountComponent('edit'); expect(component.render()).toMatchSnapshot(); const emptyReadWrite = findTestSubject(component, 'dashboardEmptyReadWrite'); diff --git a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx index e4e82339e7c2..b7a4facde1c1 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/empty_screen/dashboard_empty_screen.tsx @@ -34,6 +34,7 @@ import { } from '../../../services/kibana_services'; import { getDashboardCapabilities } from '../../../utils/get_dashboard_capabilities'; import { emptyScreenStrings } from '../../_dashboard_container_strings'; +import { addFromLibrary } from '../../embeddable/api'; export function DashboardEmptyScreen() { const lensAlias = useMemo( @@ -120,7 +121,7 @@ export function DashboardEmptyScreen() { <EuiButtonEmpty flush="left" iconType="folderOpen" - onClick={() => dashboardApi.addFromLibrary()} + onClick={() => addFromLibrary(dashboardApi)} > {emptyScreenStrings.getAddFromLibraryButtonTitle()} </EuiButtonEmpty> diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx index 7f51a9137920..543d6b745627 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.test.tsx @@ -10,13 +10,12 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { CONTACT_CARD_EMBEDDABLE } from '@kbn/embeddable-plugin/public/lib/test_samples/embeddables'; import { DashboardGrid } from './dashboard_grid'; -import { buildMockDashboard } from '../../../mocks'; +import { buildMockDashboardApi } from '../../../mocks'; import type { Props as DashboardGridItemProps } from './dashboard_grid_item'; import { DashboardContext } from '../../../dashboard_api/use_dashboard_api'; -import { DashboardApi } from '../../../dashboard_api/types'; +import { DashboardInternalContext } from '../../../dashboard_api/use_dashboard_internal_api'; import { DashboardPanelMap } from '../../../../common'; jest.mock('./dashboard_grid_item', () => { @@ -50,29 +49,30 @@ jest.mock('./dashboard_grid_item', () => { const PANELS = { '1': { gridData: { x: 0, y: 0, w: 6, h: 6, i: '1' }, - type: CONTACT_CARD_EMBEDDABLE, + type: 'lens', explicitInput: { id: '1' }, }, '2': { gridData: { x: 6, y: 6, w: 6, h: 6, i: '2' }, - type: CONTACT_CARD_EMBEDDABLE, + type: 'lens', explicitInput: { id: '2' }, }, }; const createAndMountDashboardGrid = async (panels: DashboardPanelMap = PANELS) => { - const dashboardContainer = buildMockDashboard({ + const { api, internalApi } = buildMockDashboardApi({ overrides: { panels, }, }); - await dashboardContainer.untilContainerInitialized(); const component = mountWithIntl( - <DashboardContext.Provider value={dashboardContainer as DashboardApi}> - <DashboardGrid viewportWidth={1000} /> + <DashboardContext.Provider value={api}> + <DashboardInternalContext.Provider value={internalApi}> + <DashboardGrid viewportWidth={1000} /> + </DashboardInternalContext.Provider> </DashboardContext.Provider> ); - return { dashboardApi: dashboardContainer, component }; + return { dashboardApi: api, component }; }; test('renders DashboardGrid', async () => { @@ -101,7 +101,8 @@ test('DashboardGrid removes panel when removed from container', async () => { test('DashboardGrid renders expanded panel', async () => { const { dashboardApi, component } = await createAndMountDashboardGrid(); - dashboardApi.setExpandedPanelId('1'); + // maximize panel + dashboardApi.expandPanel('1'); await new Promise((resolve) => setTimeout(resolve, 1)); component.update(); // Both panels should still exist in the dom, so nothing needs to be re-fetched once minimized. @@ -110,7 +111,8 @@ test('DashboardGrid renders expanded panel', async () => { expect(component.find('#mockDashboardGridItem_1').hasClass('expandedPanel')).toBe(true); expect(component.find('#mockDashboardGridItem_2').hasClass('hiddenPanel')).toBe(true); - dashboardApi.setExpandedPanelId(); + // minimize panel + dashboardApi.expandPanel('1'); await new Promise((resolve) => setTimeout(resolve, 1)); component.update(); expect(component.find('GridItem').length).toBe(2); diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx index 76a545d1ea9f..1f5e48dd7a5d 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid.tsx @@ -23,7 +23,8 @@ import { DashboardPanelState } from '../../../../common'; import { DashboardGridItem } from './dashboard_grid_item'; import { useDashboardGridSettings } from './use_dashboard_grid_settings'; import { useDashboardApi } from '../../../dashboard_api/use_dashboard_api'; -import { getPanelLayoutsAreEqual } from '../../state/diffing/dashboard_diffing_utils'; +import { arePanelLayoutsEqual } from '../../../dashboard_api/are_panel_layouts_equal'; +import { useDashboardInternalApi } from '../../../dashboard_api/use_dashboard_internal_api'; import { DASHBOARD_GRID_HEIGHT, DASHBOARD_MARGIN_SIZE } from '../../../dashboard_constants'; export const DashboardGrid = ({ @@ -34,14 +35,15 @@ export const DashboardGrid = ({ viewportWidth: number; }) => { const dashboardApi = useDashboardApi(); + const dashboardInternalApi = useDashboardInternalApi(); const [animatePanelTransforms, expandedPanelId, focusedPanelId, panels, useMargins, viewMode] = useBatchedPublishingSubjects( - dashboardApi.animatePanelTransforms$, + dashboardInternalApi.animatePanelTransforms$, dashboardApi.expandedPanelId, dashboardApi.focusedPanelId$, dashboardApi.panels$, - dashboardApi.useMargins$, + dashboardApi.settings.useMargins$, dashboardApi.viewMode ); @@ -116,7 +118,7 @@ export const DashboardGrid = ({ }, {} as { [key: string]: DashboardPanelState } ); - if (!getPanelLayoutsAreEqual(panels, updatedPanels)) { + if (!arePanelLayoutsEqual(panels, updatedPanels)) { dashboardApi.setPanels(updatedPanels); } }, diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.test.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.test.tsx index 416448f6d813..268c352e91ad 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.test.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.test.tsx @@ -10,19 +10,18 @@ import React from 'react'; import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { CONTACT_CARD_EMBEDDABLE } from '@kbn/embeddable-plugin/public/lib/test_samples/embeddables'; -import { buildMockDashboard } from '../../../mocks'; +import { buildMockDashboardApi } from '../../../mocks'; import { Item, Props as DashboardGridItemProps } from './dashboard_grid_item'; import { DashboardContext } from '../../../dashboard_api/use_dashboard_api'; -import { DashboardApi } from '../../../dashboard_api/types'; +import { DashboardInternalContext } from '../../../dashboard_api/use_dashboard_internal_api'; jest.mock('@kbn/embeddable-plugin/public', () => { const original = jest.requireActual('@kbn/embeddable-plugin/public'); return { ...original, - EmbeddablePanel: (props: DashboardGridItemProps) => { + ReactEmbeddableRenderer: (props: DashboardGridItemProps) => { return ( <div className="embedPanel" id={`mockEmbedPanel_${props.id}`}> mockEmbeddablePanel @@ -32,34 +31,40 @@ jest.mock('@kbn/embeddable-plugin/public', () => { }; }); +// Value of panel type does not effect test output +// since test mocks ReactEmbeddableRenderer to render static content regardless of embeddable type +const TEST_EMBEDDABLE = 'TEST_EMBEDDABLE'; + const createAndMountDashboardGridItem = (props: DashboardGridItemProps) => { const panels = { '1': { gridData: { x: 0, y: 0, w: 6, h: 6, i: '1' }, - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, explicitInput: { id: '1' }, }, '2': { gridData: { x: 6, y: 6, w: 6, h: 6, i: '2' }, - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, explicitInput: { id: '2' }, }, }; - const dashboardApi = buildMockDashboard({ overrides: { panels } }) as DashboardApi; + const { api, internalApi } = buildMockDashboardApi({ overrides: { panels } }); const component = mountWithIntl( - <DashboardContext.Provider value={dashboardApi}> - <Item {...props} /> + <DashboardContext.Provider value={api}> + <DashboardInternalContext.Provider value={internalApi}> + <Item {...props} /> + </DashboardInternalContext.Provider> </DashboardContext.Provider> ); - return { dashboardApi, component }; + return { dashboardApi: api, component }; }; test('renders Item', async () => { const { component } = createAndMountDashboardGridItem({ id: '1', key: '1', - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, }); const panelElements = component.find('.embedPanel'); expect(panelElements.length).toBe(1); @@ -75,7 +80,7 @@ test('renders expanded panel', async () => { const { component } = createAndMountDashboardGridItem({ id: '1', key: '1', - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, expandedPanelId: '1', }); expect(component.find('#panel-1').hasClass('dshDashboardGrid__item--expanded')).toBe(true); @@ -86,7 +91,7 @@ test('renders hidden panel', async () => { const { component } = createAndMountDashboardGridItem({ id: '1', key: '1', - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, expandedPanelId: '2', }); expect(component.find('#panel-1').hasClass('dshDashboardGrid__item--expanded')).toBe(false); @@ -97,7 +102,7 @@ test('renders focused panel', async () => { const { component } = createAndMountDashboardGridItem({ id: '1', key: '1', - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, focusedPanelId: '1', }); @@ -109,7 +114,7 @@ test('renders blurred panel', async () => { const { component } = createAndMountDashboardGridItem({ id: '1', key: '1', - type: CONTACT_CARD_EMBEDDABLE, + type: TEST_EMBEDDABLE, focusedPanelId: '2', }); diff --git a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx index 5ad1363e6f8a..ded3cc709540 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/grid/dashboard_grid_item.tsx @@ -12,13 +12,14 @@ import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 're import { EuiLoadingChart } from '@elastic/eui'; import { css } from '@emotion/react'; -import { EmbeddablePanel, ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; import { DASHBOARD_MARGIN_SIZE } from '../../../dashboard_constants'; +import { useDashboardInternalApi } from '../../../dashboard_api/use_dashboard_internal_api'; import { DashboardPanelState } from '../../../../common'; import { useDashboardApi } from '../../../dashboard_api/use_dashboard_api'; -import { embeddableService, presentationUtilService } from '../../../services/kibana_services'; +import { presentationUtilService } from '../../../services/kibana_services'; type DivProps = Pick<React.HTMLAttributes<HTMLDivElement>, 'className' | 'style' | 'children'>; @@ -54,10 +55,11 @@ export const Item = React.forwardRef<HTMLDivElement, Props>( ref ) => { const dashboardApi = useDashboardApi(); + const dashboardInternalApi = useDashboardInternalApi(); const [highlightPanelId, scrollToPanelId, useMargins, viewMode] = useBatchedPublishingSubjects( dashboardApi.highlightPanelId$, dashboardApi.scrollToPanelId$, - dashboardApi.useMargins$, + dashboardApi.settings.useMargins$, dashboardApi.viewMode ); @@ -118,29 +120,20 @@ export const Item = React.forwardRef<HTMLDivElement, Props>( showShadow: false, }; - // render React embeddable - if (embeddableService.reactEmbeddableRegistryHasKey(type)) { - return ( - <ReactEmbeddableRenderer - type={type} - maybeId={id} - getParentApi={() => dashboardApi} - key={`${type}_${id}`} - panelProps={panelProps} - onApiAvailable={(api) => dashboardApi.registerChildApi(api)} - /> - ); - } - // render legacy embeddable return ( - <EmbeddablePanel - key={type} - index={index} - embeddable={() => dashboardApi.untilEmbeddableLoaded(id)} - {...panelProps} + <ReactEmbeddableRenderer + type={type} + maybeId={id} + getParentApi={() => ({ + ...dashboardApi, + reload$: dashboardInternalApi.panelsReload$, + })} + key={`${type}_${id}`} + panelProps={panelProps} + onApiAvailable={(api) => dashboardInternalApi.registerChildApi(api)} /> ); - }, [id, dashboardApi, type, index, useMargins]); + }, [id, dashboardApi, dashboardInternalApi, type, useMargins]); return ( <div diff --git a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx index 51f414bfcc29..32f1f830ba93 100644 --- a/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx +++ b/src/plugins/dashboard/public/dashboard_container/component/viewport/dashboard_viewport.tsx @@ -25,6 +25,7 @@ import { CONTROL_GROUP_TYPE } from '@kbn/controls-plugin/common'; import { useBatchedPublishingSubjects } from '@kbn/presentation-publishing'; import { DashboardGrid } from '../grid'; import { useDashboardApi } from '../../../dashboard_api/use_dashboard_api'; +import { useDashboardInternalApi } from '../../../dashboard_api/use_dashboard_internal_api'; import { DashboardEmptyScreen } from '../empty_screen/dashboard_empty_screen'; export const useDebouncedWidthObserver = (skipDebounce = false, wait = 100) => { @@ -43,6 +44,7 @@ export const useDebouncedWidthObserver = (skipDebounce = false, wait = 100) => { export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: HTMLElement }) => { const dashboardApi = useDashboardApi(); + const dashboardInternalApi = useDashboardInternalApi(); const [hasControls, setHasControls] = useState(false); const [ controlGroupApi, @@ -53,7 +55,6 @@ export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: panels, viewMode, useMargins, - uuid, fullScreenMode, ] = useBatchedPublishingSubjects( dashboardApi.controlGroupApi$, @@ -63,8 +64,7 @@ export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: dashboardApi.focusedPanelId$, dashboardApi.panels$, dashboardApi.viewMode, - dashboardApi.useMargins$, - dashboardApi.uuid$, + dashboardApi.settings.useMargins$, dashboardApi.fullScreenMode$ ); const onExit = useCallback(() => { @@ -126,7 +126,7 @@ export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: ControlGroupRuntimeState, ControlGroupApi > - key={uuid} + key={dashboardApi.uuid} hidePanelChrome={true} panelProps={{ hideLoader: true }} type={CONTROL_GROUP_TYPE} @@ -134,11 +134,12 @@ export const DashboardViewport = ({ dashboardContainer }: { dashboardContainer?: getParentApi={() => { return { ...dashboardApi, - getSerializedStateForChild: dashboardApi.getSerializedStateForControlGroup, - getRuntimeStateForChild: dashboardApi.getRuntimeStateForControlGroup, + reload$: dashboardInternalApi.controlGroupReload$, + getSerializedStateForChild: dashboardInternalApi.getSerializedStateForControlGroup, + getRuntimeStateForChild: dashboardInternalApi.getRuntimeStateForControlGroup, }; }} - onApiAvailable={(api) => dashboardApi.setControlGroupApi(api)} + onApiAvailable={(api) => dashboardInternalApi.setControlGroupApi(api)} /> </div> ) : null} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/add_panel_from_library.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/api/add_panel_from_library.ts index f5e76cff53b0..70122182305c 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/add_panel_from_library.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/api/add_panel_from_library.ts @@ -7,16 +7,15 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { isErrorEmbeddable, openAddFromLibraryFlyout } from '@kbn/embeddable-plugin/public'; -import { DashboardContainer } from '../dashboard_container'; +import { openAddFromLibraryFlyout } from '@kbn/embeddable-plugin/public'; +import { DashboardApi } from '../../../dashboard_api/types'; -export function addFromLibrary(this: DashboardContainer) { - if (isErrorEmbeddable(this)) return; - this.openOverlay( +export function addFromLibrary(dashboardApi: DashboardApi) { + dashboardApi.openOverlay( openAddFromLibraryFlyout({ - container: this, + container: dashboardApi, onClose: () => { - this.clearOverlays(); + dashboardApi.clearOverlays(); }, }) ); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.test.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.test.tsx deleted file mode 100644 index 47732d52ad40..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.test.tsx +++ /dev/null @@ -1,330 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CoreStart } from '@kbn/core/public'; -import { coreMock } from '@kbn/core/public/mocks'; -import { - isErrorEmbeddable, - ReactEmbeddableFactory, - ReferenceOrValueEmbeddable, -} from '@kbn/embeddable-plugin/public'; -import { - CONTACT_CARD_EMBEDDABLE, - ContactCardEmbeddable, - ContactCardEmbeddableFactory, - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, -} from '@kbn/embeddable-plugin/public/lib/test_samples/embeddables'; -import { embeddablePluginMock } from '@kbn/embeddable-plugin/public/mocks'; -import { - DefaultEmbeddableApi, - ReactEmbeddableRenderer, - registerReactEmbeddableFactory, -} from '@kbn/embeddable-plugin/public/react_embeddable_system'; -import { BuildReactEmbeddableApiRegistration } from '@kbn/embeddable-plugin/public/react_embeddable_system/types'; -import { HasSnapshottableState, SerializedPanelState } from '@kbn/presentation-containers'; -import { HasInPlaceLibraryTransforms, HasLibraryTransforms } from '@kbn/presentation-publishing'; -import { render } from '@testing-library/react'; -import React from 'react'; -import { BehaviorSubject, lastValueFrom, Subject } from 'rxjs'; -import { buildMockDashboard, getSampleDashboardPanel } from '../../../mocks'; -import { embeddableService } from '../../../services/kibana_services'; -import { DashboardContainer } from '../dashboard_container'; -import { duplicateDashboardPanel, incrementPanelTitle } from './duplicate_dashboard_panel'; - -describe('Legacy embeddables', () => { - let container: DashboardContainer; - let genericEmbeddable: ContactCardEmbeddable; - let byRefOrValEmbeddable: ContactCardEmbeddable & ReferenceOrValueEmbeddable; - let coreStart: CoreStart; - beforeEach(async () => { - coreStart = coreMock.createStart(); - coreStart.savedObjects.client = { - ...coreStart.savedObjects.client, - get: jest.fn().mockImplementation(() => ({ attributes: { title: 'Holy moly' } })), - find: jest.fn().mockImplementation(() => ({ total: 15 })), - create: jest.fn().mockImplementation(() => ({ id: 'brandNewSavedObject' })), - }; - - const mockEmbeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); - - embeddableService.getEmbeddableFactory = jest.fn().mockReturnValue(mockEmbeddableFactory); - container = buildMockDashboard({ - overrides: { - panels: { - '123': getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { firstName: 'Kibanana', id: '123' }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }, - }); - - const refOrValContactCardEmbeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'RefOrValEmbeddable', - }); - - const nonRefOrValueContactCard = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Not a refOrValEmbeddable', - }); - - if ( - isErrorEmbeddable(refOrValContactCardEmbeddable) || - isErrorEmbeddable(nonRefOrValueContactCard) - ) { - throw new Error('Failed to create embeddables'); - } else { - genericEmbeddable = nonRefOrValueContactCard; - byRefOrValEmbeddable = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - ContactCardEmbeddableInput - >(refOrValContactCardEmbeddable, { - mockedByReferenceInput: { - savedObjectId: 'testSavedObjectId', - id: refOrValContactCardEmbeddable.id, - }, - mockedByValueInput: { - firstName: 'RefOrValEmbeddable', - id: refOrValContactCardEmbeddable.id, - }, - }); - jest.spyOn(byRefOrValEmbeddable, 'getInputAsValueType'); - } - }); - test('Duplication adds a new embeddable', async () => { - const originalPanelCount = Object.keys(container.getInput().panels).length; - const originalPanelKeySet = new Set(Object.keys(container.getInput().panels)); - await duplicateDashboardPanel.bind(container)(byRefOrValEmbeddable.id); - - expect(Object.keys(container.getInput().panels).length).toEqual(originalPanelCount + 1); - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - expect(newPanelId).toBeDefined(); - const newPanel = container.getInput().panels[newPanelId!]; - expect(newPanel.type).toEqual(byRefOrValEmbeddable.type); - }); - - test('Duplicates a RefOrVal embeddable by value', async () => { - const originalPanelKeySet = new Set(Object.keys(container.getInput().panels)); - await duplicateDashboardPanel.bind(container)(byRefOrValEmbeddable.id); - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - - const originalFirstName = ( - container.getInput().panels[byRefOrValEmbeddable.id] - .explicitInput as ContactCardEmbeddableInput - ).firstName; - - const newFirstName = ( - container.getInput().panels[newPanelId!].explicitInput as ContactCardEmbeddableInput - ).firstName; - - expect(byRefOrValEmbeddable.getInputAsValueType).toHaveBeenCalled(); - - expect(originalFirstName).toEqual(newFirstName); - expect(container.getInput().panels[newPanelId!].type).toEqual(byRefOrValEmbeddable.type); - }); - - test('Duplicates a non RefOrVal embeddable by value', async () => { - const originalPanelKeySet = new Set(Object.keys(container.getInput().panels)); - await duplicateDashboardPanel.bind(container)(genericEmbeddable.id); - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - - const originalFirstName = ( - container.getInput().panels[genericEmbeddable.id].explicitInput as ContactCardEmbeddableInput - ).firstName; - - const newFirstName = ( - container.getInput().panels[newPanelId!].explicitInput as ContactCardEmbeddableInput - ).firstName; - - expect(originalFirstName).toEqual(newFirstName); - expect(container.getInput().panels[newPanelId!].type).toEqual(genericEmbeddable.type); - }); - - test('Gets a unique title from the dashboard', async () => { - expect(await incrementPanelTitle(container, '')).toEqual(''); - - container.getPanelTitles = jest.fn().mockImplementation(() => { - return ['testDuplicateTitle', 'testDuplicateTitle (copy)', 'testUniqueTitle']; - }); - expect(await incrementPanelTitle(container, 'testUniqueTitle')).toEqual( - 'testUniqueTitle (copy)' - ); - expect(await incrementPanelTitle(container, 'testDuplicateTitle')).toEqual( - 'testDuplicateTitle (copy 1)' - ); - - container.getPanelTitles = jest.fn().mockImplementation(() => { - return ['testDuplicateTitle', 'testDuplicateTitle (copy)'].concat( - Array.from([...Array(39)], (_, index) => `testDuplicateTitle (copy ${index + 1})`) - ); - }); - expect(await incrementPanelTitle(container, 'testDuplicateTitle')).toEqual( - 'testDuplicateTitle (copy 40)' - ); - expect(await incrementPanelTitle(container, 'testDuplicateTitle (copy 100)')).toEqual( - 'testDuplicateTitle (copy 40)' - ); - - container.getPanelTitles = jest.fn().mockImplementation(() => { - return ['testDuplicateTitle (copy 100)']; - }); - expect(await incrementPanelTitle(container, 'testDuplicateTitle')).toEqual( - 'testDuplicateTitle (copy 101)' - ); - expect(await incrementPanelTitle(container, 'testDuplicateTitle (copy 100)')).toEqual( - 'testDuplicateTitle (copy 101)' - ); - }); -}); - -describe('React embeddables', () => { - const testId = '1234'; - const buildDashboardWithReactEmbeddable = async <Api extends DefaultEmbeddableApi>( - testType: string, - mockApi: BuildReactEmbeddableApiRegistration<{}, {}, Api> - ) => { - const fullApi$ = new Subject<Api & HasSnapshottableState<{}>>(); - const reactEmbeddableFactory: ReactEmbeddableFactory<{}, {}, Api> = { - type: testType, - deserializeState: jest.fn().mockImplementation((state) => state.rawState), - buildEmbeddable: async (state, registerApi) => { - const fullApi = registerApi( - { - ...mockApi, - }, - {} - ); - return { - Component: () => <div> TEST DUPLICATE </div>, - api: fullApi, - }; - }, - }; - registerReactEmbeddableFactory(testType, async () => reactEmbeddableFactory); - const dashboard = buildMockDashboard({ - overrides: { - panels: { - [testId]: getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { id: testId }, - type: testType, - }), - }, - }, - }); - - // render a fake Dashboard to initialize react embeddables - const FakeDashboard = () => { - return ( - <div> - {Object.keys(dashboard.getInput().panels).map((panelId) => { - const panel = dashboard.getInput().panels[panelId]; - return ( - <div style={{ width: '100%', height: '100px' }} key={panelId}> - <ReactEmbeddableRenderer - type={panel.type} - onApiAvailable={(api) => { - fullApi$.next(api as Api & HasSnapshottableState<{}>); - fullApi$.complete(); - dashboard.children$.next({ [panelId]: api }); - }} - getParentApi={() => ({ - getSerializedStateForChild: () => - panel.explicitInput as unknown as SerializedPanelState<object> | undefined, - })} - /> - </div> - ); - })} - </div> - ); - }; - render(<FakeDashboard />); - - return { dashboard, apiPromise: lastValueFrom(fullApi$) }; - }; - - it('Duplicates child without library transforms', async () => { - const mockApi = { - serializeState: jest.fn().mockImplementation(() => ({ rawState: {} })), - }; - const { dashboard, apiPromise } = await buildDashboardWithReactEmbeddable( - 'byValueOnly', - mockApi - ); - const api = await apiPromise; - - const snapshotSpy = jest.spyOn(api, 'snapshotRuntimeState'); - - await duplicateDashboardPanel.bind(dashboard)(testId); - - expect(snapshotSpy).toHaveBeenCalled(); - expect(Object.keys(dashboard.getInput().panels).length).toBe(2); - }); - - it('Duplicates child with library transforms', async () => { - const libraryTransformsMockApi: BuildReactEmbeddableApiRegistration< - {}, - {}, - DefaultEmbeddableApi & HasLibraryTransforms - > = { - serializeState: jest.fn().mockImplementation(() => ({ rawState: {} })), - saveToLibrary: jest.fn(), - getByReferenceState: jest.fn(), - getByValueState: jest.fn(), - canLinkToLibrary: jest.fn(), - canUnlinkFromLibrary: jest.fn(), - checkForDuplicateTitle: jest.fn(), - }; - const { dashboard, apiPromise } = await buildDashboardWithReactEmbeddable( - 'libraryTransforms', - libraryTransformsMockApi - ); - await apiPromise; - - await duplicateDashboardPanel.bind(dashboard)(testId); - expect(libraryTransformsMockApi.getByValueState).toHaveBeenCalled(); - }); - - it('Duplicates a child with in place library transforms', async () => { - const inPlaceLibraryTransformsMockApi: BuildReactEmbeddableApiRegistration< - {}, - {}, - DefaultEmbeddableApi & HasInPlaceLibraryTransforms - > = { - unlinkFromLibrary: jest.fn(), - saveToLibrary: jest.fn(), - checkForDuplicateTitle: jest.fn(), - libraryId$: new BehaviorSubject<string | undefined>(''), - getByValueRuntimeSnapshot: jest.fn(), - serializeState: jest.fn().mockImplementation(() => ({ rawState: {} })), - }; - const { dashboard, apiPromise } = await buildDashboardWithReactEmbeddable( - 'inPlaceLibraryTransforms', - inPlaceLibraryTransformsMockApi - ); - await apiPromise; - - await duplicateDashboardPanel.bind(dashboard)(testId); - expect(inPlaceLibraryTransformsMockApi.getByValueRuntimeSnapshot).toHaveBeenCalled(); - }); -}); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.ts deleted file mode 100644 index d62bb78b3b64..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/duplicate_dashboard_panel.ts +++ /dev/null @@ -1,165 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { filter, map, max } from 'lodash'; -import { v4 as uuidv4 } from 'uuid'; - -import { isReferenceOrValueEmbeddable, PanelNotFoundError } from '@kbn/embeddable-plugin/public'; -import { apiHasSnapshottableState } from '@kbn/presentation-containers/interfaces/serialized_state'; -import { - apiHasInPlaceLibraryTransforms, - apiHasLibraryTransforms, - apiPublishesPanelTitle, - getPanelTitle, - stateHasTitles, -} from '@kbn/presentation-publishing'; - -import { DashboardPanelState, prefixReferencesFromPanel } from '../../../../common'; -import { dashboardClonePanelActionStrings } from '../../../dashboard_actions/_dashboard_actions_strings'; -import { coreServices, embeddableService } from '../../../services/kibana_services'; -import { placeClonePanel } from '../../panel_placement'; -import { DashboardContainer } from '../dashboard_container'; - -const duplicateLegacyInput = async ( - dashboard: DashboardContainer, - panelToClone: DashboardPanelState, - idToDuplicate: string -) => { - const embeddable = dashboard.getChild(idToDuplicate); - if (!panelToClone || !embeddable) throw new PanelNotFoundError(); - - const newTitle = await incrementPanelTitle(dashboard, embeddable.getTitle() || ''); - const id = uuidv4(); - if (isReferenceOrValueEmbeddable(embeddable)) { - return { - type: embeddable.type, - explicitInput: { - ...(await embeddable.getInputAsValueType()), - hidePanelTitles: panelToClone.explicitInput.hidePanelTitles, - ...(newTitle ? { title: newTitle } : {}), - id, - }, - }; - } - return { - type: embeddable.type, - explicitInput: { - ...panelToClone.explicitInput, - title: newTitle, - id, - }, - }; -}; - -const duplicateReactEmbeddableInput = async ( - dashboard: DashboardContainer, - panelToClone: DashboardPanelState, - idToDuplicate: string -) => { - const id = uuidv4(); - const child = dashboard.children$.value[idToDuplicate]; - const lastTitle = apiPublishesPanelTitle(child) ? getPanelTitle(child) ?? '' : ''; - const newTitle = await incrementPanelTitle(dashboard, lastTitle); - - /** - * For react embeddables that have library transforms, we need to ensure - * to clone them with serialized state and references. - * - * TODO: remove this section once all by reference capable react embeddables - * use in-place library transforms - */ - if (apiHasLibraryTransforms(child)) { - const byValueSerializedState = await child.getByValueState(); - if (panelToClone.references) { - dashboard.savedObjectReferences.push( - ...prefixReferencesFromPanel(id, panelToClone.references) - ); - } - return { - type: panelToClone.type, - explicitInput: { - ...byValueSerializedState, - title: newTitle, - id, - }, - }; - } - - const runtimeSnapshot = (() => { - if (apiHasInPlaceLibraryTransforms(child)) return child.getByValueRuntimeSnapshot(); - return apiHasSnapshottableState(child) ? child.snapshotRuntimeState() : {}; - })(); - if (stateHasTitles(runtimeSnapshot)) runtimeSnapshot.title = newTitle; - - dashboard.setRuntimeStateForChild(id, runtimeSnapshot); - return { - type: panelToClone.type, - explicitInput: { - id, - }, - }; -}; - -export async function duplicateDashboardPanel(this: DashboardContainer, idToDuplicate: string) { - const panelToClone = await this.getDashboardPanelFromId(idToDuplicate); - - const duplicatedPanelState = embeddableService.reactEmbeddableRegistryHasKey(panelToClone.type) - ? await duplicateReactEmbeddableInput(this, panelToClone, idToDuplicate) - : await duplicateLegacyInput(this, panelToClone, idToDuplicate); - - coreServices.notifications.toasts.addSuccess({ - title: dashboardClonePanelActionStrings.getSuccessMessage(), - 'data-test-subj': 'addObjectToContainerSuccess', - }); - - const { newPanelPlacement, otherPanels } = placeClonePanel({ - width: panelToClone.gridData.w, - height: panelToClone.gridData.h, - currentPanels: this.getInput().panels, - placeBesideId: panelToClone.explicitInput.id, - }); - - const newPanel = { - ...duplicatedPanelState, - gridData: { - ...newPanelPlacement, - i: duplicatedPanelState.explicitInput.id, - }, - }; - - this.updateInput({ - panels: { - ...otherPanels, - [newPanel.explicitInput.id]: newPanel, - }, - }); -} - -export const incrementPanelTitle = async (dashboard: DashboardContainer, rawTitle: string) => { - if (rawTitle === '') return ''; - - const clonedTag = dashboardClonePanelActionStrings.getClonedTag(); - const cloneRegex = new RegExp(`\\(${clonedTag}\\)`, 'g'); - const cloneNumberRegex = new RegExp(`\\(${clonedTag} [0-9]+\\)`, 'g'); - const baseTitle = rawTitle.replace(cloneNumberRegex, '').replace(cloneRegex, '').trim(); - const similarTitles = filter(await dashboard.getPanelTitles(), (title: string) => { - return title.startsWith(baseTitle); - }); - - const cloneNumbers = map(similarTitles, (title: string) => { - if (title.match(cloneRegex)) return 0; - const cloneTag = title.match(cloneNumberRegex); - return cloneTag ? parseInt(cloneTag[0].replace(/[^0-9.]/g, ''), 10) : -1; - }); - const similarBaseTitlesCount = max(cloneNumbers) || 0; - - return similarBaseTitlesCount < 0 - ? baseTitle + ` (${clonedTag})` - : baseTitle + ` (${clonedTag} ${similarBaseTitlesCount + 1})`; -}; diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/index.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/api/index.ts index 4829a7b61318..e8f10192a0e8 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/index.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/api/index.ts @@ -9,5 +9,3 @@ export { openSettingsFlyout } from './open_settings_flyout'; export { addFromLibrary } from './add_panel_from_library'; -export { addOrUpdateEmbeddable } from './panel_management'; -export { runQuickSave, runInteractiveSave } from './run_save_functions'; diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx index 867e6ae9d047..0f78bcc96a97 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/api/open_settings_flyout.tsx @@ -27,7 +27,7 @@ export function openSettingsFlyout(dashboardApi: DashboardApi) { }} /> </DashboardContext.Provider>, - { analytics: coreServices.analytics, i18n: coreServices.i18n, theme: coreServices.theme } + coreServices ), { size: 's', diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/api/panel_management.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/api/panel_management.ts deleted file mode 100644 index c8a909b68221..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/panel_management.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from '@kbn/embeddable-plugin/public'; -import { DashboardContainer } from '../dashboard_container'; - -export async function addOrUpdateEmbeddable< - EEI extends EmbeddableInput = EmbeddableInput, - EEO extends EmbeddableOutput = EmbeddableOutput, - E extends IEmbeddable<EEI, EEO> = IEmbeddable<EEI, EEO> ->(this: DashboardContainer, type: string, explicitInput: Partial<EEI>, embeddableId?: string) { - const idToReplace = embeddableId || explicitInput.id; - if (idToReplace && this.input.panels[idToReplace]) { - const previousPanelState = this.input.panels[idToReplace]; - const newPanelState = { - type, - explicitInput: { - ...explicitInput, - id: idToReplace, - }, - }; - const panelId = await this.replaceEmbeddable( - previousPanelState.explicitInput.id, - { - ...newPanelState.explicitInput, - id: previousPanelState.explicitInput.id, - }, - newPanelState.type, - true - ); - return panelId; - } - return this.addNewEmbeddable<EEI, EEO, E>(type, explicitInput); -} 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 deleted file mode 100644 index e5355bdb2988..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/api/run_save_functions.tsx +++ /dev/null @@ -1,334 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { cloneDeep } from 'lodash'; -import React from 'react'; -import { batch } from 'react-redux'; - -import type { Reference } from '@kbn/content-management-utils'; -import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; -import { - EmbeddableInput, - isReferenceOrValueEmbeddable, - ViewMode, -} from '@kbn/embeddable-plugin/public'; -import { i18n } from '@kbn/i18n'; -import { apiHasSerializableState, SerializedPanelState } from '@kbn/presentation-containers'; -import { showSaveModal } from '@kbn/saved-objects-plugin/public'; - -import { - DashboardContainerInput, - DashboardPanelMap, - prefixReferencesFromPanel, -} from '../../../../common'; -import type { DashboardAttributes } from '../../../../server/content_management'; -import { DASHBOARD_CONTENT_ID, SAVED_OBJECT_POST_TIME } from '../../../dashboard_constants'; -import { - SaveDashboardReturn, - SavedDashboardInput, -} from '../../../services/dashboard_content_management_service/types'; -import { getDashboardContentManagementService } from '../../../services/dashboard_content_management_service'; -import { - coreServices, - dataService, - embeddableService, - savedObjectsTaggingService, -} from '../../../services/kibana_services'; -import { DashboardSaveOptions, DashboardStateFromSaveModal } from '../../types'; -import { DashboardContainer } from '../dashboard_container'; -import { extractTitleAndCount } from './lib/extract_title_and_count'; -import { DashboardSaveModal } from './overlays/save_modal'; - -const serializeAllPanelState = async ( - dashboard: DashboardContainer -): Promise<{ panels: DashboardContainerInput['panels']; references: Reference[] }> => { - const references: Reference[] = []; - const panels = cloneDeep(dashboard.getInput().panels); - - const serializePromises: Array< - Promise<{ uuid: string; serialized: SerializedPanelState<object> }> - > = []; - for (const [uuid, panel] of Object.entries(panels)) { - if (!embeddableService.reactEmbeddableRegistryHasKey(panel.type)) continue; - const api = dashboard.children$.value[uuid]; - - if (api && apiHasSerializableState(api)) { - serializePromises.push( - (async () => { - const serialized = await api.serializeState(); - return { uuid, serialized }; - })() - ); - } - } - - const serializeResults = await Promise.all(serializePromises); - for (const result of serializeResults) { - panels[result.uuid].explicitInput = { ...result.serialized.rawState, id: result.uuid }; - references.push(...prefixReferencesFromPanel(result.uuid, result.serialized.references ?? [])); - } - - return { panels, references }; -}; - -/** - * Save the current state of this dashboard to a saved object without showing any save modal. - */ -export async function runQuickSave(this: DashboardContainer) { - const { explicitInput: currentState } = this.getState(); - - const lastSavedId = this.savedObjectId.value; - - if (this.managed$.value) return; - - const { panels: nextPanels, references } = await serializeAllPanelState(this); - const dashboardStateToSave: DashboardContainerInput = { ...currentState, panels: nextPanels }; - let stateToSave: SavedDashboardInput = dashboardStateToSave; - const controlGroupApi = this.controlGroupApi$.value; - let controlGroupReferences: Reference[] | undefined; - if (controlGroupApi) { - const { rawState: controlGroupSerializedState, references: extractedReferences } = - await controlGroupApi.serializeState(); - controlGroupReferences = extractedReferences; - stateToSave = { - ...stateToSave, - controlGroupInput: - controlGroupSerializedState as unknown as DashboardAttributes['controlGroupInput'], - }; - } - - const saveResult = await getDashboardContentManagementService().saveDashboardState({ - controlGroupReferences, - panelReferences: references, - currentState: stateToSave, - saveOptions: {}, - lastSavedId, - }); - - this.savedObjectReferences = saveResult.references ?? []; - this.setLastSavedInput(dashboardStateToSave); - this.saveNotification$.next(); - - return saveResult; -} - -/** - * @description exclusively for user directed dashboard save actions, also - * accounts for scenarios of cloning elastic managed dashboard into user managed dashboards - */ -export async function runInteractiveSave(this: DashboardContainer, interactionMode: ViewMode) { - const { explicitInput: currentState } = this.getState(); - const dashboardContentManagementService = getDashboardContentManagementService(); - const lastSavedId = this.savedObjectId.value; - const managed = this.managed$.value; - - return new Promise<SaveDashboardReturn | undefined>((resolve, reject) => { - if (interactionMode === ViewMode.EDIT && managed) { - resolve(undefined); - } - - const onSaveAttempt = async ({ - newTags, - newTitle, - newDescription, - newCopyOnSave, - newTimeRestore, - onTitleDuplicate, - isTitleDuplicateConfirmed, - }: DashboardSaveOptions): Promise<SaveDashboardReturn> => { - const saveOptions = { - confirmOverwrite: false, - isTitleDuplicateConfirmed, - onTitleDuplicate, - saveAsCopy: lastSavedId ? true : newCopyOnSave, - }; - - try { - if ( - !(await dashboardContentManagementService.checkForDuplicateDashboardTitle({ - title: newTitle, - onTitleDuplicate, - lastSavedTitle: currentState.title, - copyOnSave: saveOptions.saveAsCopy, - isTitleDuplicateConfirmed, - })) - ) { - return {}; - } - - const stateFromSaveModal: DashboardStateFromSaveModal = { - title: newTitle, - tags: [] as string[], - description: newDescription, - timeRestore: newTimeRestore, - timeRange: newTimeRestore ? dataService.query.timefilter.timefilter.getTime() : undefined, - refreshInterval: newTimeRestore - ? dataService.query.timefilter.timefilter.getRefreshInterval() - : undefined, - }; - - if (savedObjectsTaggingService && newTags) { - // remove `hasSavedObjectsTagging` once the savedObjectsTagging service is optional - stateFromSaveModal.tags = newTags; - } - - let dashboardStateToSave: SavedDashboardInput = { - ...currentState, - ...stateFromSaveModal, - }; - - const controlGroupApi = this.controlGroupApi$.value; - let controlGroupReferences: Reference[] | undefined; - if (controlGroupApi) { - const { rawState: controlGroupSerializedState, references } = - await controlGroupApi.serializeState(); - controlGroupReferences = references; - dashboardStateToSave = { - ...dashboardStateToSave, - controlGroupInput: - controlGroupSerializedState as unknown as DashboardAttributes['controlGroupInput'], - }; - } - - const { panels: nextPanels, references } = await serializeAllPanelState(this); - - const newPanels = await (async () => { - if (!managed) return nextPanels; - - // this is a managed dashboard - unlink all by reference embeddables on clone - const unlinkedPanels: DashboardPanelMap = {}; - for (const [panelId, panel] of Object.entries(nextPanels)) { - const child = this.getChild(panelId); - if ( - child && - isReferenceOrValueEmbeddable(child) && - child.inputIsRefType(child.getInput() as EmbeddableInput) - ) { - const valueTypeInput = await child.getInputAsValueType(); - unlinkedPanels[panelId] = { - ...panel, - explicitInput: valueTypeInput, - }; - continue; - } - unlinkedPanels[panelId] = panel; - } - return unlinkedPanels; - })(); - - const beforeAddTime = window.performance.now(); - - const saveResult = await dashboardContentManagementService.saveDashboardState({ - controlGroupReferences, - panelReferences: references, - saveOptions, - currentState: { - ...dashboardStateToSave, - panels: newPanels, - title: newTitle, - }, - lastSavedId, - }); - - const addDuration = window.performance.now() - beforeAddTime; - - reportPerformanceMetricEvent(coreServices.analytics, { - eventName: SAVED_OBJECT_POST_TIME, - duration: addDuration, - meta: { - saved_object_type: DASHBOARD_CONTENT_ID, - }, - }); - - if (saveResult.id) { - batch(() => { - this.dispatch.setStateFromSaveModal(stateFromSaveModal); - this.setSavedObjectId(saveResult.id); - this.setLastSavedInput(dashboardStateToSave); - }); - } - - this.savedObjectReferences = saveResult.references ?? []; - this.saveNotification$.next(); - - resolve(saveResult); - - return saveResult; - } catch (error) { - reject(error); - return error; - } - }; - - (async () => { - try { - let customModalTitle; - let newTitle = currentState.title; - - if (lastSavedId) { - const [baseTitle, baseCount] = extractTitleAndCount(newTitle); - - newTitle = `${baseTitle} (${baseCount + 1})`; - - await dashboardContentManagementService.checkForDuplicateDashboardTitle({ - title: newTitle, - lastSavedTitle: currentState.title, - copyOnSave: true, - isTitleDuplicateConfirmed: false, - onTitleDuplicate(speculativeSuggestion) { - newTitle = speculativeSuggestion; - }, - }); - - switch (interactionMode) { - case ViewMode.EDIT: { - customModalTitle = i18n.translate( - 'dashboard.topNav.editModeInteractiveSave.modalTitle', - { - defaultMessage: 'Save as new dashboard', - } - ); - break; - } - case ViewMode.VIEW: { - customModalTitle = i18n.translate( - 'dashboard.topNav.viewModeInteractiveSave.modalTitle', - { - defaultMessage: 'Duplicate dashboard', - } - ); - break; - } - default: { - customModalTitle = undefined; - } - } - } - - const dashboardDuplicateModal = ( - <DashboardSaveModal - tags={currentState.tags} - title={newTitle} - onClose={() => resolve(undefined)} - timeRestore={currentState.timeRestore} - showStoreTimeOnSave={!lastSavedId} - description={currentState.description ?? ''} - showCopyOnSave={false} - onSave={onSaveAttempt} - customModalTitle={customModalTitle} - /> - ); - this.clearOverlays(); - showSaveModal(dashboardDuplicateModal); - } catch (error) { - reject(error); - } - })(); - }); -} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.test.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.test.ts deleted file mode 100644 index 3a18acd242e4..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.test.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Filter } from '@kbn/es-query'; -import { combineDashboardFiltersWithControlGroupFilters } from './dashboard_control_group_integration'; -import { BehaviorSubject } from 'rxjs'; - -const testFilter1: Filter = { - meta: { - key: 'testfield', - alias: null, - disabled: false, - negate: false, - }, - query: { match_phrase: { testfield: 'hello' } }, -}; - -const testFilter2: Filter = { - meta: { - key: 'testfield', - alias: null, - disabled: false, - negate: false, - }, - query: { match_phrase: { testfield: 'guten tag' } }, -}; - -const testFilter3: Filter = { - meta: { - key: 'testfield', - alias: null, - disabled: false, - negate: false, - }, - query: { - bool: { - should: { - 0: { match_phrase: { testfield: 'hola' } }, - 1: { match_phrase: { testfield: 'bonjour' } }, - }, - }, - }, -}; - -describe('combineDashboardFiltersWithControlGroupFilters', () => { - it('Combined filter pills do not get overwritten', async () => { - const dashboardFilterPills = [testFilter1, testFilter2]; - const mockControlGroupApi = { - filters$: new BehaviorSubject<Filter[] | undefined>([]), - }; - const combinedFilters = combineDashboardFiltersWithControlGroupFilters( - dashboardFilterPills, - mockControlGroupApi - ); - expect(combinedFilters).toEqual(dashboardFilterPills); - }); - - it('Combined control filters do not get overwritten', async () => { - const controlGroupFilters = [testFilter1, testFilter2]; - const mockControlGroupApi = { - filters$: new BehaviorSubject<Filter[] | undefined>(controlGroupFilters), - }; - const combinedFilters = combineDashboardFiltersWithControlGroupFilters( - [] as Filter[], - mockControlGroupApi - ); - expect(combinedFilters).toEqual(controlGroupFilters); - }); - - it('Combined dashboard filter pills and control filters do not get overwritten', async () => { - const dashboardFilterPills = [testFilter1, testFilter2]; - const controlGroupFilters = [testFilter3]; - const mockControlGroupApi = { - filters$: new BehaviorSubject<Filter[] | undefined>(controlGroupFilters), - }; - const combinedFilters = combineDashboardFiltersWithControlGroupFilters( - dashboardFilterPills, - mockControlGroupApi - ); - expect(combinedFilters).toEqual(dashboardFilterPills.concat(controlGroupFilters)); - }); -}); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.ts deleted file mode 100644 index 299b8111e37e..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/controls/dashboard_control_group_integration.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { COMPARE_ALL_OPTIONS, compareFilters, type Filter } from '@kbn/es-query'; -import { - BehaviorSubject, - combineLatest, - distinctUntilChanged, - map, - of, - skip, - startWith, - switchMap, -} from 'rxjs'; -import { PublishesFilters, PublishingSubject } from '@kbn/presentation-publishing'; -import { DashboardContainer } from '../../dashboard_container'; - -export function startSyncingDashboardControlGroup(dashboard: DashboardContainer) { - const controlGroupFilters$ = dashboard.controlGroupApi$.pipe( - switchMap((controlGroupApi) => (controlGroupApi ? controlGroupApi.filters$ : of(undefined))) - ); - const controlGroupTimeslice$ = dashboard.controlGroupApi$.pipe( - switchMap((controlGroupApi) => (controlGroupApi ? controlGroupApi.timeslice$ : of(undefined))) - ); - - // -------------------------------------------------------------------------------------- - // dashboard.unifiedSearchFilters$ - // -------------------------------------------------------------------------------------- - const unifiedSearchFilters$ = new BehaviorSubject<Filter[] | undefined>( - dashboard.getInput().filters - ); - dashboard.unifiedSearchFilters$ = unifiedSearchFilters$ as PublishingSubject< - Filter[] | undefined - >; - dashboard.publishingSubscription.add( - dashboard - .getInput$() - .pipe( - startWith(dashboard.getInput()), - map((input) => input.filters), - distinctUntilChanged((previous, current) => { - return compareFilters(previous ?? [], current ?? [], COMPARE_ALL_OPTIONS); - }) - ) - .subscribe((unifiedSearchFilters) => { - unifiedSearchFilters$.next(unifiedSearchFilters); - }) - ); - - // -------------------------------------------------------------------------------------- - // Set dashboard.filters$ to include unified search filters and control group filters - // -------------------------------------------------------------------------------------- - function getCombinedFilters() { - return combineDashboardFiltersWithControlGroupFilters( - dashboard.getInput().filters ?? [], - dashboard.controlGroupApi$.value - ); - } - - const filters$ = new BehaviorSubject<Filter[] | undefined>(getCombinedFilters()); - dashboard.filters$ = filters$; - - dashboard.publishingSubscription.add( - combineLatest([dashboard.unifiedSearchFilters$, controlGroupFilters$]).subscribe(() => { - filters$.next(getCombinedFilters()); - }) - ); - - // -------------------------------------------------------------------------------------- - // when control group outputs filters, force a refresh! - // -------------------------------------------------------------------------------------- - dashboard.publishingSubscription.add( - controlGroupFilters$ - .pipe( - skip(1) // skip first filter output because it will have been applied in initialize - ) - .subscribe(() => dashboard.forceRefresh(false)) // we should not reload the control group when the control group output changes - otherwise, performance is severely impacted - ); - - // -------------------------------------------------------------------------------------- - // when control group outputs timeslice, dispatch timeslice - // -------------------------------------------------------------------------------------- - dashboard.publishingSubscription.add( - controlGroupTimeslice$.subscribe((timeslice) => { - dashboard.dispatch.setTimeslice(timeslice); - }) - ); -} - -export const combineDashboardFiltersWithControlGroupFilters = ( - dashboardFilters: Filter[], - controlGroupApi?: PublishesFilters -): Filter[] => { - return [...dashboardFilters, ...(controlGroupApi?.filters$.value ?? [])]; -}; diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts deleted file mode 100644 index ddcdeff25ea4..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.test.ts +++ /dev/null @@ -1,521 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddablePackageState, ViewMode } from '@kbn/embeddable-plugin/public'; -import { - CONTACT_CARD_EMBEDDABLE, - ContactCardEmbeddable, - ContactCardEmbeddableFactory, - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, -} from '@kbn/embeddable-plugin/public/lib/test_samples'; -import { Filter } from '@kbn/es-query'; -import { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; - -import { DEFAULT_DASHBOARD_INPUT } from '../../../dashboard_constants'; -import { getSampleDashboardPanel, mockControlGroupApi } from '../../../mocks'; -import { dataService, embeddableService } from '../../../services/kibana_services'; -import { DashboardCreationOptions } from '../../..'; -import { createDashboard } from './create_dashboard'; -import { getDashboardContentManagementService } from '../../../services/dashboard_content_management_service'; -import { getDashboardBackupService } from '../../../services/dashboard_backup_service'; - -const dashboardBackupService = getDashboardBackupService(); -const dashboardContentManagementService = getDashboardContentManagementService(); - -test("doesn't throw error when no data views are available", async () => { - dataService.dataViews.defaultDataViewExists = jest.fn().mockReturnValue(false); - expect(await createDashboard()).toBeDefined(); - - // reset get default data view - dataService.dataViews.defaultDataViewExists = jest.fn().mockResolvedValue(true); -}); - -test('throws error when provided validation function returns invalid', async () => { - const creationOptions: DashboardCreationOptions = { - validateLoadedSavedObject: jest.fn().mockImplementation(() => 'invalid'), - }; - await expect(async () => { - await createDashboard(creationOptions, 0, 'test-id'); - }).rejects.toThrow('Dashboard failed saved object result validation'); -}); - -test('returns undefined when provided validation function returns redirected', async () => { - const creationOptions: DashboardCreationOptions = { - validateLoadedSavedObject: jest.fn().mockImplementation(() => 'redirected'), - }; - const dashboard = await createDashboard(creationOptions, 0, 'test-id'); - expect(dashboard).toBeUndefined(); -}); - -/** - * Because the getInitialInput function may have side effects, we only want to call it once we are certain that the - * the loaded saved object passes validation. - * - * This is especially relevant in the Dashboard App case where calling the getInitialInput function removes the _a - * param from the URL. In alais match situations this caused a bug where the state from the URL wasn't properly applied - * after the redirect. - */ -test('does not get initial input when provided validation function returns redirected', async () => { - const creationOptions: DashboardCreationOptions = { - validateLoadedSavedObject: jest.fn().mockImplementation(() => 'redirected'), - getInitialInput: jest.fn(), - }; - const dashboard = await createDashboard(creationOptions, 0, 'test-id'); - expect(dashboard).toBeUndefined(); - expect(creationOptions.getInitialInput).not.toHaveBeenCalled(); -}); - -test('pulls state from dashboard saved object when given a saved object id', async () => { - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - description: `wow would you look at that? Wow.`, - }, - }); - const dashboard = await createDashboard({}, 0, 'wow-such-id'); - expect(dashboardContentManagementService.loadDashboardState).toHaveBeenCalledWith({ - id: 'wow-such-id', - }); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.description).toBe(`wow would you look at that? Wow.`); -}); - -test('passes managed state from the saved object into the Dashboard component state', async () => { - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - description: 'wow this description is okay', - }, - managed: true, - }); - const dashboard = await createDashboard({}, 0, 'what-an-id'); - expect(dashboard).toBeDefined(); - expect(dashboard!.managed$.value).toBe(true); -}); - -test('pulls view mode from dashboard backup', async () => { - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: DEFAULT_DASHBOARD_INPUT, - }); - dashboardBackupService.getViewMode = jest.fn().mockReturnValue(ViewMode.EDIT); - const dashboard = await createDashboard({ useSessionStorageIntegration: true }, 0, 'what-an-id'); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.viewMode).toBe(ViewMode.EDIT); -}); - -test('new dashboards start in edit mode', async () => { - dashboardBackupService.getViewMode = jest.fn().mockReturnValue(ViewMode.VIEW); - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - newDashboardCreated: true, - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - description: 'wow this description is okay', - }, - }); - const dashboard = await createDashboard({ useSessionStorageIntegration: true }, 0, 'wow-such-id'); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.viewMode).toBe(ViewMode.EDIT); -}); - -test('managed dashboards start in view mode', async () => { - dashboardBackupService.getViewMode = jest.fn().mockReturnValue(ViewMode.EDIT); - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: DEFAULT_DASHBOARD_INPUT, - managed: true, - }); - const dashboard = await createDashboard({}, 0, 'what-an-id'); - expect(dashboard).toBeDefined(); - expect(dashboard!.managed$.value).toBe(true); - expect(dashboard!.getState().explicitInput.viewMode).toBe(ViewMode.VIEW); -}); - -test('pulls state from backup which overrides state from saved object', async () => { - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - description: 'wow this description is okay', - }, - }); - dashboardBackupService.getState = jest - .fn() - .mockReturnValue({ dashboardState: { description: 'wow this description marginally better' } }); - const dashboard = await createDashboard({ useSessionStorageIntegration: true }, 0, 'wow-such-id'); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.description).toBe( - 'wow this description marginally better' - ); -}); - -test('pulls state from override input which overrides all other state sources', async () => { - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - description: 'wow this description is okay', - }, - }); - dashboardBackupService.getState = jest - .fn() - .mockReturnValue({ description: 'wow this description marginally better' }); - const dashboard = await createDashboard( - { - useSessionStorageIntegration: true, - getInitialInput: () => ({ description: 'wow this description is a masterpiece' }), - }, - 0, - 'wow-such-id' - ); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.description).toBe( - 'wow this description is a masterpiece' - ); -}); - -test('pulls panels from override input', async () => { - embeddableService.reactEmbeddableRegistryHasKey = jest - .fn() - .mockImplementation((type: string) => type === 'reactEmbeddable'); - dashboardContentManagementService.loadDashboardState = jest.fn().mockResolvedValue({ - dashboardInput: { - ...DEFAULT_DASHBOARD_INPUT, - panels: { - ...DEFAULT_DASHBOARD_INPUT.panels, - someLegacyPanel: { - type: 'legacy', - gridData: { x: 0, y: 0, w: 0, h: 0, i: 'someLegacyPanel' }, - explicitInput: { - id: 'someLegacyPanel', - title: 'stateFromSavedObject', - }, - }, - someReactEmbeddablePanel: { - type: 'reactEmbeddable', - gridData: { x: 0, y: 0, w: 0, h: 0, i: 'someReactEmbeddablePanel' }, - explicitInput: { - id: 'someReactEmbeddablePanel', - title: 'stateFromSavedObject', - }, - }, - }, - }, - }); - const dashboard = await createDashboard( - { - useSessionStorageIntegration: true, - getInitialInput: () => ({ - ...DEFAULT_DASHBOARD_INPUT, - panels: { - ...DEFAULT_DASHBOARD_INPUT.panels, - someLegacyPanel: { - type: 'legacy', - gridData: { x: 0, y: 0, w: 0, h: 0, i: 'someLegacyPanel' }, - explicitInput: { - id: 'someLegacyPanel', - title: 'Look at me, I am the override now', - }, - }, - someReactEmbeddablePanel: { - type: 'reactEmbeddable', - gridData: { x: 0, y: 0, w: 0, h: 0, i: 'someReactEmbeddablePanel' }, - explicitInput: { - id: 'someReactEmbeddablePanel', - title: 'an elegant override, from a more civilized age', - }, - }, - }, - }), - }, - 0, - 'wow-such-id' - ); - expect(dashboard).toBeDefined(); - - // legacy panels should be completely overwritten directly in the explicitInput - expect(dashboard!.getState().explicitInput.panels.someLegacyPanel.explicitInput.title).toBe( - 'Look at me, I am the override now' - ); - - // React embeddable should still have the old state in their explicit input - expect( - dashboard!.getState().explicitInput.panels.someReactEmbeddablePanel.explicitInput.title - ).toBe('stateFromSavedObject'); - - // instead, the unsaved changes for React embeddables should be applied to the "restored runtime state" property of the Dashboard. - expect( - (dashboard!.getRuntimeStateForChild('someReactEmbeddablePanel') as { title: string }).title - ).toEqual('an elegant override, from a more civilized age'); -}); - -test('applies filters and query from state to query service', async () => { - const filters: Filter[] = [ - { meta: { alias: 'test', disabled: false, negate: false, index: 'test' } }, - ]; - const query = { language: 'kql', query: 'query' }; - await createDashboard({ - useUnifiedSearchIntegration: true, - unifiedSearchSettings: { - kbnUrlStateStorage: createKbnUrlStateStorage(), - }, - getInitialInput: () => ({ filters, query }), - }); - expect(dataService.query.queryString.setQuery).toHaveBeenCalledWith(query); - expect(dataService.query.filterManager.setAppFilters).toHaveBeenCalledWith(filters); -}); - -test('applies time range and refresh interval from initial input to query service if time restore is on', async () => { - const timeRange = { from: new Date().toISOString(), to: new Date().toISOString() }; - const refreshInterval = { pause: false, value: 42 }; - await createDashboard({ - useUnifiedSearchIntegration: true, - unifiedSearchSettings: { - kbnUrlStateStorage: createKbnUrlStateStorage(), - }, - getInitialInput: () => ({ timeRange, refreshInterval, timeRestore: true }), - }); - expect(dataService.query.timefilter.timefilter.setTime).toHaveBeenCalledWith(timeRange); - expect(dataService.query.timefilter.timefilter.setRefreshInterval).toHaveBeenCalledWith( - refreshInterval - ); -}); - -test('applies time range from query service to initial input if time restore is on but there is an explicit time range in the URL', async () => { - const urlTimeRange = { from: new Date().toISOString(), to: new Date().toISOString() }; - const savedTimeRange = { from: 'now - 7 days', to: 'now' }; - dataService.query.timefilter.timefilter.getTime = jest.fn().mockReturnValue(urlTimeRange); - const kbnUrlStateStorage = createKbnUrlStateStorage(); - kbnUrlStateStorage.get = jest.fn().mockReturnValue({ time: urlTimeRange }); - - const dashboard = await createDashboard({ - useUnifiedSearchIntegration: true, - unifiedSearchSettings: { - kbnUrlStateStorage, - }, - getInitialInput: () => ({ - timeRestore: true, - timeRange: savedTimeRange, - }), - }); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.timeRange).toEqual(urlTimeRange); -}); - -test('applies time range from query service to initial input if time restore is off', async () => { - const timeRange = { from: new Date().toISOString(), to: new Date().toISOString() }; - dataService.query.timefilter.timefilter.getTime = jest.fn().mockReturnValue(timeRange); - const dashboard = await createDashboard({ - useUnifiedSearchIntegration: true, - unifiedSearchSettings: { - kbnUrlStateStorage: createKbnUrlStateStorage(), - }, - }); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.timeRange).toEqual(timeRange); -}); - -test('replaces panel with incoming embeddable if id matches existing panel', async () => { - const incomingEmbeddable: EmbeddablePackageState = { - type: CONTACT_CARD_EMBEDDABLE, - input: { - id: 'i_match', - firstName: 'wow look at this replacement wow', - } as ContactCardEmbeddableInput, - embeddableId: 'i_match', - }; - const dashboard = await createDashboard({ - getIncomingEmbeddable: () => incomingEmbeddable, - getInitialInput: () => ({ - panels: { - i_match: getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { - id: 'i_match', - firstName: 'oh no, I am about to get replaced', - }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }), - }); - expect(dashboard).toBeDefined(); - expect(dashboard!.getState().explicitInput.panels.i_match.explicitInput).toStrictEqual( - expect.objectContaining({ - id: 'i_match', - firstName: 'wow look at this replacement wow', - }) - ); -}); - -test('creates new embeddable with incoming embeddable if id does not match existing panel', async () => { - const incomingEmbeddable: EmbeddablePackageState = { - type: CONTACT_CARD_EMBEDDABLE, - input: { - id: 'i_match', - firstName: 'wow look at this new panel wow', - } as ContactCardEmbeddableInput, - embeddableId: 'i_match', - }; - const mockContactCardFactory = { - create: jest.fn().mockReturnValue({ destroy: jest.fn() }), - getDefaultInput: jest.fn().mockResolvedValue({}), - }; - embeddableService.getEmbeddableFactory = jest.fn().mockReturnValue(mockContactCardFactory); - - const dashboard = await createDashboard({ - getIncomingEmbeddable: () => incomingEmbeddable, - getInitialInput: () => ({ - panels: { - i_do_not_match: getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { - id: 'i_do_not_match', - firstName: 'phew... I will not be replaced', - }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }), - }); - dashboard?.setControlGroupApi(mockControlGroupApi); - - // flush promises - await new Promise((r) => setTimeout(r, 1)); - expect(mockContactCardFactory.create).toHaveBeenCalledWith( - expect.objectContaining({ - id: 'i_match', - firstName: 'wow look at this new panel wow', - }), - expect.any(Object) - ); - expect(dashboard!.getState().explicitInput.panels.i_match.explicitInput).toStrictEqual( - expect.objectContaining({ - id: 'i_match', - firstName: 'wow look at this new panel wow', - }) - ); - expect(dashboard!.getState().explicitInput.panels.i_do_not_match.explicitInput).toStrictEqual( - expect.objectContaining({ - id: 'i_do_not_match', - firstName: 'phew... I will not be replaced', - }) - ); - - // expect panel to be created with the default size. - expect(dashboard!.getState().explicitInput.panels.i_match.gridData.w).toBe(24); - expect(dashboard!.getState().explicitInput.panels.i_match.gridData.h).toBe(15); -}); - -test('creates new embeddable with specified size if size is provided', async () => { - const incomingEmbeddable: EmbeddablePackageState = { - type: CONTACT_CARD_EMBEDDABLE, - input: { - id: 'new_panel', - firstName: 'what a tiny lil panel', - } as ContactCardEmbeddableInput, - size: { width: 1, height: 1 }, - embeddableId: 'new_panel', - }; - const mockContactCardFactory = { - create: jest.fn().mockReturnValue({ destroy: jest.fn() }), - getDefaultInput: jest.fn().mockResolvedValue({}), - }; - embeddableService.getEmbeddableFactory = jest.fn().mockReturnValue(mockContactCardFactory); - - const dashboard = await createDashboard({ - getIncomingEmbeddable: () => incomingEmbeddable, - getInitialInput: () => ({ - panels: { - i_do_not_match: getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { - id: 'i_do_not_match', - firstName: 'phew... I will not be replaced', - }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }), - }); - dashboard?.setControlGroupApi(mockControlGroupApi); - - // flush promises - await new Promise((r) => setTimeout(r, 1)); - - expect(mockContactCardFactory.create).toHaveBeenCalledWith( - expect.objectContaining({ - id: 'new_panel', - firstName: 'what a tiny lil panel', - }), - expect.any(Object) - ); - expect(dashboard!.getState().explicitInput.panels.new_panel.explicitInput).toStrictEqual( - expect.objectContaining({ - id: 'new_panel', - firstName: 'what a tiny lil panel', - }) - ); - expect(dashboard!.getState().explicitInput.panels.new_panel.gridData.w).toBe(1); - expect(dashboard!.getState().explicitInput.panels.new_panel.gridData.h).toBe(1); -}); - -/* - * dashboard.getInput$() subscriptions are used to update: - * 1) dashboard instance searchSessionId state - * 2) child input on parent input changes - * - * Rxjs subscriptions are executed in the order that they are created. - * This test ensures that searchSessionId update subscription is created before child input subscription - * to ensure child input subscription includes updated searchSessionId. - */ -test('searchSessionId is updated prior to child embeddable parent subscription execution', async () => { - const embeddableFactory = { - create: new ContactCardEmbeddableFactory((() => null) as any, {} as any), - getDefaultInput: jest.fn().mockResolvedValue({ - timeRange: { - to: 'now', - from: 'now-15m', - }, - }), - }; - embeddableService.getEmbeddableFactory = jest.fn().mockReturnValue(embeddableFactory); - let sessionCount = 0; - dataService.search.session.start = () => { - sessionCount++; - return `searchSessionId${sessionCount}`; - }; - const dashboard = await createDashboard({ - searchSessionSettings: { - getSearchSessionIdFromURL: () => undefined, - removeSessionIdFromUrl: () => {}, - createSessionRestorationDataProvider: () => {}, - } as unknown as DashboardCreationOptions['searchSessionSettings'], - }); - dashboard?.setControlGroupApi(mockControlGroupApi); - expect(dashboard).toBeDefined(); - const embeddable = await dashboard!.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Bob', - }); - - expect(embeddable.getInput().searchSessionId).toBe('searchSessionId1'); - - dashboard!.updateInput({ - timeRange: { - to: 'now', - from: 'now-7d', - }, - }); - - expect(sessionCount).toBeGreaterThan(1); - const embeddableInput = embeddable.getInput(); - expect((embeddableInput as any).timeRange).toEqual({ - to: 'now', - from: 'now-7d', - }); - expect(embeddableInput.searchSessionId).toBe(`searchSessionId${sessionCount}`); -}); 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 deleted file mode 100644 index 2510f2e015df..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts +++ /dev/null @@ -1,522 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { cloneDeep, omit } from 'lodash'; -import { Subject } from 'rxjs'; -import { v4 } from 'uuid'; - -import { ContentInsightsClient } from '@kbn/content-management-content-insights-public'; -import { GlobalQueryStateFromUrl, syncGlobalQueryStateWithUrl } from '@kbn/data-plugin/public'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; -import { TimeRange } from '@kbn/es-query'; -import { lazyLoadReduxToolsPackage } from '@kbn/presentation-util-plugin/public'; - -import { - DashboardContainerInput, - DashboardPanelMap, - DashboardPanelState, -} from '../../../../common'; -import { - DEFAULT_DASHBOARD_INPUT, - DEFAULT_PANEL_HEIGHT, - DEFAULT_PANEL_WIDTH, - GLOBAL_STATE_STORAGE_KEY, - PanelPlacementStrategy, -} from '../../../dashboard_constants'; -import { - PANELS_CONTROL_GROUP_KEY, - getDashboardBackupService, -} from '../../../services/dashboard_backup_service'; -import { getDashboardContentManagementService } from '../../../services/dashboard_content_management_service'; -import { - LoadDashboardReturn, - SavedDashboardInput, -} from '../../../services/dashboard_content_management_service/types'; -import { coreServices, dataService, embeddableService } from '../../../services/kibana_services'; -import { getDashboardCapabilities } from '../../../utils/get_dashboard_capabilities'; -import { runPanelPlacementStrategy } from '../../panel_placement/place_new_panel_strategies'; -import { startDiffingDashboardState } from '../../state/diffing/dashboard_diffing_integration'; -import { UnsavedPanelState } from '../../types'; -import { DashboardContainer } from '../dashboard_container'; -import type { DashboardCreationOptions } from '../../..'; -import { startSyncingDashboardDataViews } from './data_views/sync_dashboard_data_views'; -import { startQueryPerformanceTracking } from './performance/query_performance_tracking'; -import { startDashboardSearchSessionIntegration } from './search_sessions/start_dashboard_search_session_integration'; -import { syncUnifiedSearchState } from './unified_search/sync_dashboard_unified_search_state'; -import { InitialComponentState } from '../../../dashboard_api/get_dashboard_api'; - -/** - * Builds a new Dashboard from scratch. - */ -export const createDashboard = async ( - creationOptions?: DashboardCreationOptions, - dashboardCreationStartTime?: number, - savedObjectId?: string -): Promise<DashboardContainer | undefined> => { - // -------------------------------------------------------------------------------------- - // Create method which allows work to be done on the dashboard container when it's ready. - // -------------------------------------------------------------------------------------- - const dashboardContainerReady$ = new Subject<DashboardContainer>(); - const untilDashboardReady = () => - new Promise<DashboardContainer>((resolve) => { - const subscription = dashboardContainerReady$.subscribe((container) => { - subscription.unsubscribe(); - resolve(container); - }); - }); - - // -------------------------------------------------------------------------------------- - // Lazy load required systems and Dashboard saved object. - // -------------------------------------------------------------------------------------- - const reduxEmbeddablePackagePromise = lazyLoadReduxToolsPackage(); - const defaultDataViewExistsPromise = dataService.dataViews.defaultDataViewExists(); - const dashboardContentManagementService = getDashboardContentManagementService(); - const dashboardSavedObjectPromise = dashboardContentManagementService.loadDashboardState({ - id: savedObjectId, - }); - - const [reduxEmbeddablePackage, savedObjectResult] = await Promise.all([ - reduxEmbeddablePackagePromise, - dashboardSavedObjectPromise, - defaultDataViewExistsPromise /* the result is not used, but the side effect of setting the default data view is needed. */, - ]); - - // -------------------------------------------------------------------------------------- - // Initialize Dashboard integrations - // -------------------------------------------------------------------------------------- - const initializeResult = await initializeDashboard({ - loadDashboardReturn: savedObjectResult, - untilDashboardReady, - creationOptions, - }); - if (!initializeResult) return; - const { input, searchSessionId } = initializeResult; - - // -------------------------------------------------------------------------------------- - // Build the dashboard container. - // -------------------------------------------------------------------------------------- - const initialComponentState: InitialComponentState = { - anyMigrationRun: savedObjectResult.anyMigrationRun ?? false, - isEmbeddedExternally: creationOptions?.isEmbeddedExternally ?? false, - lastSavedInput: omit(savedObjectResult?.dashboardInput, 'controlGroupInput') ?? { - ...DEFAULT_DASHBOARD_INPUT, - id: input.id, - }, - lastSavedId: savedObjectId, - managed: savedObjectResult.managed ?? false, - fullScreenMode: creationOptions?.fullScreenMode ?? false, - }; - - const dashboardContainer = new DashboardContainer( - input, - reduxEmbeddablePackage, - searchSessionId, - dashboardCreationStartTime, - undefined, - creationOptions, - initialComponentState - ); - - // -------------------------------------------------------------------------------------- - // Start the diffing integration after all other integrations are set up. - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((container) => { - startDiffingDashboardState.bind(container)(creationOptions); - }); - - dashboardContainerReady$.next(dashboardContainer); - return dashboardContainer; -}; - -/** - * Initializes a Dashboard and starts all of its integrations - */ -export const initializeDashboard = async ({ - loadDashboardReturn, - untilDashboardReady, - creationOptions, -}: { - loadDashboardReturn: LoadDashboardReturn; - untilDashboardReady: () => Promise<DashboardContainer>; - creationOptions?: DashboardCreationOptions; -}) => { - const { - queryString, - filterManager, - timefilter: { timefilter: timefilterService }, - } = dataService.query; - const dashboardBackupService = getDashboardBackupService(); - - const { - getInitialInput, - searchSessionSettings, - unifiedSearchSettings, - validateLoadedSavedObject, - useUnifiedSearchIntegration, - useSessionStorageIntegration, - } = creationOptions ?? {}; - - // -------------------------------------------------------------------------------------- - // Run validation. - // -------------------------------------------------------------------------------------- - const validationResult = loadDashboardReturn && validateLoadedSavedObject?.(loadDashboardReturn); - if (validationResult === 'invalid') { - // throw error to stop the rest of Dashboard loading and make the factory return an ErrorEmbeddable. - throw new Error('Dashboard failed saved object result validation'); - } else if (validationResult === 'redirected') { - return; - } - - // -------------------------------------------------------------------------------------- - // Combine input from saved object, and session storage - // -------------------------------------------------------------------------------------- - const dashboardBackupState = dashboardBackupService.getState(loadDashboardReturn.dashboardId); - const runtimePanelsToRestore: UnsavedPanelState = useSessionStorageIntegration - ? dashboardBackupState?.panels ?? {} - : {}; - - const sessionStorageInput = ((): Partial<SavedDashboardInput> | undefined => { - if (!useSessionStorageIntegration) return; - return dashboardBackupState?.dashboardState; - })(); - const initialViewMode = (() => { - if (loadDashboardReturn.managed || !getDashboardCapabilities().showWriteControls) - return ViewMode.VIEW; - if ( - loadDashboardReturn.newDashboardCreated || - dashboardBackupService.dashboardHasUnsavedEdits(loadDashboardReturn.dashboardId) - ) { - return ViewMode.EDIT; - } - - return dashboardBackupService.getViewMode(); - })(); - - const combinedSessionInput: DashboardContainerInput = { - ...DEFAULT_DASHBOARD_INPUT, - ...(loadDashboardReturn?.dashboardInput ?? {}), - ...sessionStorageInput, - }; - - // -------------------------------------------------------------------------------------- - // Combine input with overrides. - // -------------------------------------------------------------------------------------- - const overrideInput = getInitialInput?.(); - if (overrideInput?.panels) { - /** - * react embeddables and legacy embeddables share state very differently, so we need different - * treatment here. TODO remove this distinction when we remove the legacy embeddable system. - */ - const overridePanels: DashboardPanelMap = {}; - - for (const panel of Object.values(overrideInput?.panels)) { - if (embeddableService.reactEmbeddableRegistryHasKey(panel.type)) { - overridePanels[panel.explicitInput.id] = { - ...panel, - - /** - * here we need to keep the state of the panel that was already in the Dashboard if one exists. - * This is because this state will become the "last saved state" for this panel. - */ - ...(combinedSessionInput.panels[panel.explicitInput.id] ?? []), - }; - /** - * We also need to add the state of this react embeddable into the runtime state to be restored. - */ - runtimePanelsToRestore[panel.explicitInput.id] = panel.explicitInput; - } else { - /** - * if this is a legacy embeddable, the override state needs to completely overwrite the existing - * state for this panel. - */ - overridePanels[panel.explicitInput.id] = panel; - } - } - - /** - * If this is a React embeddable, we leave the "panel" state as-is and add this state to the - * runtime state to be restored on dashboard load. - */ - overrideInput.panels = overridePanels; - } - const combinedOverrideInput: DashboardContainerInput = { - ...combinedSessionInput, - ...(initialViewMode ? { viewMode: initialViewMode } : {}), - ...overrideInput, - }; - - // -------------------------------------------------------------------------------------- - // Combine input from saved object, session storage, & passed input to create initial input. - // -------------------------------------------------------------------------------------- - const initialDashboardInput: DashboardContainerInput = omit( - cloneDeep(combinedOverrideInput), - 'controlGroupInput' - ); - - // Back up any view mode passed in explicitly. - if (overrideInput?.viewMode) { - dashboardBackupService.storeViewMode(overrideInput?.viewMode); - } - - initialDashboardInput.executionContext = { - type: 'dashboard', - description: initialDashboardInput.title, - }; - - // -------------------------------------------------------------------------------------- - // Track references - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((dashboard) => { - dashboard.savedObjectReferences = loadDashboardReturn?.references; - dashboard.controlGroupInput = loadDashboardReturn?.dashboardInput?.controlGroupInput; - }); - - // -------------------------------------------------------------------------------------- - // Set up unified search integration. - // -------------------------------------------------------------------------------------- - if (useUnifiedSearchIntegration && unifiedSearchSettings?.kbnUrlStateStorage) { - const { - query, - filters, - timeRestore, - timeRange: savedTimeRange, - refreshInterval: savedRefreshInterval, - } = initialDashboardInput; - const { kbnUrlStateStorage } = unifiedSearchSettings; - - // apply filters and query to the query service - filterManager.setAppFilters(cloneDeep(filters ?? [])); - queryString.setQuery(query ?? queryString.getDefaultQuery()); - - /** - * Get initial time range, and set up dashboard time restore if applicable - */ - const initialTimeRange: TimeRange = (() => { - // if there is an explicit time range in the URL it always takes precedence. - const urlOverrideTimeRange = - kbnUrlStateStorage.get<GlobalQueryStateFromUrl>(GLOBAL_STATE_STORAGE_KEY)?.time; - if (urlOverrideTimeRange) return urlOverrideTimeRange; - - // if this Dashboard has timeRestore return the time range that was saved with the dashboard. - if (timeRestore && savedTimeRange) return savedTimeRange; - - // otherwise fall back to the time range from the timefilterService. - return timefilterService.getTime(); - })(); - initialDashboardInput.timeRange = initialTimeRange; - if (timeRestore) { - if (savedTimeRange) timefilterService.setTime(savedTimeRange); - if (savedRefreshInterval) timefilterService.setRefreshInterval(savedRefreshInterval); - } - - // start syncing global query state with the URL. - const { stop: stopSyncingQueryServiceStateWithUrl } = syncGlobalQueryStateWithUrl( - dataService.query, - kbnUrlStateStorage - ); - - untilDashboardReady().then((dashboardContainer) => { - const stopSyncingUnifiedSearchState = - syncUnifiedSearchState.bind(dashboardContainer)(kbnUrlStateStorage); - dashboardContainer.stopSyncingWithUnifiedSearch = () => { - stopSyncingUnifiedSearchState(); - stopSyncingQueryServiceStateWithUrl(); - }; - }); - } - - // -------------------------------------------------------------------------------------- - // Place the incoming embeddable if there is one - // -------------------------------------------------------------------------------------- - const incomingEmbeddable = creationOptions?.getIncomingEmbeddable?.(); - if (incomingEmbeddable) { - const scrolltoIncomingEmbeddable = (container: DashboardContainer, id: string) => { - container.setScrollToPanelId(id); - container.setHighlightPanelId(id); - }; - - initialDashboardInput.viewMode = ViewMode.EDIT; // view mode must always be edit to recieve an embeddable. - if ( - incomingEmbeddable.embeddableId && - Boolean(initialDashboardInput.panels[incomingEmbeddable.embeddableId]) - ) { - // this embeddable already exists, we will update the explicit input. - const panelToUpdate = initialDashboardInput.panels[incomingEmbeddable.embeddableId]; - const sameType = panelToUpdate.type === incomingEmbeddable.type; - - panelToUpdate.type = incomingEmbeddable.type; - const nextRuntimeState = { - // if the incoming panel is the same type as what was there before we can safely spread the old panel's explicit input - ...(sameType ? panelToUpdate.explicitInput : {}), - - ...incomingEmbeddable.input, - id: incomingEmbeddable.embeddableId, - - // maintain hide panel titles setting. - hidePanelTitles: panelToUpdate.explicitInput.hidePanelTitles, - }; - if (embeddableService.reactEmbeddableRegistryHasKey(incomingEmbeddable.type)) { - panelToUpdate.explicitInput = { id: panelToUpdate.explicitInput.id }; - runtimePanelsToRestore[incomingEmbeddable.embeddableId] = nextRuntimeState; - } else { - panelToUpdate.explicitInput = nextRuntimeState; - } - - untilDashboardReady().then((container) => - scrolltoIncomingEmbeddable(container, incomingEmbeddable.embeddableId as string) - ); - } else { - // otherwise this incoming embeddable is brand new and can be added after the dashboard container is created. - - untilDashboardReady().then(async (container) => { - const createdEmbeddable = await (async () => { - // if there is no width or height we can add the panel using the default behaviour. - if (!incomingEmbeddable.size) { - return await container.addNewPanel<{ uuid: string }>({ - panelType: incomingEmbeddable.type, - initialState: incomingEmbeddable.input, - }); - } - - // if the incoming embeddable has an explicit width or height we add the panel to the grid directly. - const { width, height } = incomingEmbeddable.size; - const currentPanels = container.getInput().panels; - const embeddableId = incomingEmbeddable.embeddableId ?? v4(); - const { newPanelPlacement } = runPanelPlacementStrategy( - PanelPlacementStrategy.findTopLeftMostOpenSpace, - { - width: width ?? DEFAULT_PANEL_WIDTH, - height: height ?? DEFAULT_PANEL_HEIGHT, - currentPanels, - } - ); - const newPanelState: DashboardPanelState = (() => { - if (embeddableService.reactEmbeddableRegistryHasKey(incomingEmbeddable.type)) { - runtimePanelsToRestore[embeddableId] = incomingEmbeddable.input; - return { - explicitInput: { id: embeddableId }, - type: incomingEmbeddable.type, - gridData: { - ...newPanelPlacement, - i: embeddableId, - }, - }; - } - return { - explicitInput: { ...incomingEmbeddable.input, id: embeddableId }, - type: incomingEmbeddable.type, - gridData: { - ...newPanelPlacement, - i: embeddableId, - }, - }; - })(); - container.updateInput({ - panels: { - ...container.getInput().panels, - [newPanelState.explicitInput.id]: newPanelState, - }, - }); - - return await container.untilEmbeddableLoaded(embeddableId); - })(); - if (createdEmbeddable) { - scrolltoIncomingEmbeddable(container, createdEmbeddable.uuid); - } - }); - } - } - - // -------------------------------------------------------------------------------------- - // Set restored runtime state for react embeddables. - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((dashboardContainer) => { - if (overrideInput?.controlGroupState) { - dashboardContainer.setRuntimeStateForChild( - PANELS_CONTROL_GROUP_KEY, - overrideInput.controlGroupState - ); - } - - for (const idWithRuntimeState of Object.keys(runtimePanelsToRestore)) { - const restoredRuntimeStateForChild = runtimePanelsToRestore[idWithRuntimeState]; - if (!restoredRuntimeStateForChild) continue; - dashboardContainer.setRuntimeStateForChild(idWithRuntimeState, restoredRuntimeStateForChild); - } - }); - - // -------------------------------------------------------------------------------------- - // Start the data views integration. - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((dashboardContainer) => { - dashboardContainer.integrationSubscriptions.add( - startSyncingDashboardDataViews.bind(dashboardContainer)() - ); - }); - - // -------------------------------------------------------------------------------------- - // Start performance tracker - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((dashboardContainer) => - dashboardContainer.integrationSubscriptions.add( - startQueryPerformanceTracking(dashboardContainer) - ) - ); - - // -------------------------------------------------------------------------------------- - // Start animating panel transforms 500 ms after dashboard is created. - // -------------------------------------------------------------------------------------- - untilDashboardReady().then((dashboard) => - setTimeout(() => dashboard.setAnimatePanelTransforms(true), 500) - ); - - // -------------------------------------------------------------------------------------- - // Set up search sessions integration. - // -------------------------------------------------------------------------------------- - let initialSearchSessionId; - if (searchSessionSettings) { - const { sessionIdToRestore } = searchSessionSettings; - - // if this incoming embeddable has a session, continue it. - if (incomingEmbeddable?.searchSessionId) { - dataService.search.session.continue(incomingEmbeddable.searchSessionId); - } - if (sessionIdToRestore) { - dataService.search.session.restore(sessionIdToRestore); - } - const existingSession = dataService.search.session.getSessionId(); - - initialSearchSessionId = - sessionIdToRestore ?? - (existingSession && incomingEmbeddable - ? existingSession - : dataService.search.session.start()); - - untilDashboardReady().then(async (container) => { - await container.untilContainerInitialized(); - startDashboardSearchSessionIntegration.bind(container)( - creationOptions?.searchSessionSettings - ); - }); - } - - 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 - const contentInsightsClient = new ContentInsightsClient( - { http: coreServices.http }, - { domainId: 'dashboard' } - ); - contentInsightsClient.track(loadDashboardReturn.dashboardId, 'viewed'); - } - - return { input: initialDashboardInput, searchSessionId: initialSearchSessionId }; -}; diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/data_views/sync_dashboard_data_views.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/data_views/sync_dashboard_data_views.ts deleted file mode 100644 index 3060987e296c..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/data_views/sync_dashboard_data_views.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { uniqBy } from 'lodash'; -import { combineLatest, Observable, of, switchMap } from 'rxjs'; - -import { DataView } from '@kbn/data-views-plugin/common'; -import { combineCompatibleChildrenApis } from '@kbn/presentation-containers'; -import { apiPublishesDataViews, PublishesDataViews } from '@kbn/presentation-publishing'; - -import { dataService } from '../../../../services/kibana_services'; -import { DashboardContainer } from '../../dashboard_container'; - -export function startSyncingDashboardDataViews(this: DashboardContainer) { - const controlGroupDataViewsPipe: Observable<DataView[] | undefined> = this.controlGroupApi$.pipe( - switchMap((controlGroupApi) => { - return controlGroupApi ? controlGroupApi.dataViews : of([]); - }) - ); - - const childDataViewsPipe = combineCompatibleChildrenApis<PublishesDataViews, DataView[]>( - this, - 'dataViews', - apiPublishesDataViews, - [] - ); - - return combineLatest([controlGroupDataViewsPipe, childDataViewsPipe]) - .pipe( - switchMap(([controlGroupDataViews, childDataViews]) => { - const allDataViews = [ - ...(controlGroupDataViews ? controlGroupDataViews : []), - ...childDataViews, - ]; - if (allDataViews.length === 0) { - return (async () => { - const defaultDataViewId = await dataService.dataViews.getDefaultId(); - return [await dataService.dataViews.get(defaultDataViewId!)]; - })(); - } - return of(uniqBy(allDataViews, 'id')); - }) - ) - .subscribe((newDataViews) => { - this.setAllDataViews(newDataViews); - }); -} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.test.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.test.ts index 963914bea1c3..09cb313d1f5a 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.test.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.test.ts @@ -9,12 +9,12 @@ import type { CoreStart } from '@kbn/core/public'; import { PerformanceMetricEvent } from '@kbn/ebt-tools'; -import { PresentationContainer, TracksQueryPerformance } from '@kbn/presentation-containers'; +import { PresentationContainer } from '@kbn/presentation-containers'; import { getMockPresentationContainer } from '@kbn/presentation-containers/mocks'; import { PhaseEvent, PhaseEventType, apiPublishesPhaseEvents } from '@kbn/presentation-publishing'; import { waitFor } from '@testing-library/react'; import { BehaviorSubject } from 'rxjs'; -import { startQueryPerformanceTracking } from './query_performance_tracking'; +import { PerformanceState, startQueryPerformanceTracking } from './query_performance_tracking'; const mockMetricEvent = jest.fn(); jest.mock('@kbn/ebt-tools', () => ({ @@ -26,7 +26,8 @@ jest.mock('@kbn/ebt-tools', () => ({ const mockDashboard = ( children: {} = {} ): { - dashboard: PresentationContainer & TracksQueryPerformance; + dashboard: PresentationContainer; + performanceState: PerformanceState; children$: BehaviorSubject<{ [key: string]: unknown }>; } => { const children$ = new BehaviorSubject<{ [key: string]: unknown }>(children); @@ -35,6 +36,8 @@ const mockDashboard = ( ...getMockPresentationContainer(), children$, getPanelCount: () => Object.keys(children$.value).length, + }, + performanceState: { firstLoad: true, creationStartTime: Date.now(), }, @@ -68,16 +71,16 @@ describe('startQueryPerformanceTracking', () => { phase$: new BehaviorSubject<PhaseEvent>({ status: 'loading', id: '', timeToEvent: 0 }), }, }; - const { dashboard } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); - expect(dashboard.lastLoadStartTime).toBeDefined(); + expect(performanceState.lastLoadStartTime).toBeDefined(); }); it('sets creation end time when no children are present', async () => { - const { dashboard } = mockDashboard(); - startQueryPerformanceTracking(dashboard); - expect(dashboard.creationEndTime).toBeDefined(); + const { dashboard, performanceState } = mockDashboard(); + startQueryPerformanceTracking(dashboard, performanceState); + expect(performanceState.creationEndTime).toBeDefined(); }); it('sets creation end time when all panels with phase event reporting have rendered', async () => { @@ -89,11 +92,11 @@ describe('startQueryPerformanceTracking', () => { phase$: new BehaviorSubject<PhaseEvent>({ status: 'loading', id: '', timeToEvent: 0 }), }, }; - const { dashboard } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); setChildrenStatus(children, 'rendered'); await waitFor(() => { - expect(dashboard.creationEndTime).toBeDefined(); + expect(performanceState.creationEndTime).toBeDefined(); }); }); @@ -106,8 +109,8 @@ describe('startQueryPerformanceTracking', () => { phase$: new BehaviorSubject<PhaseEvent>({ status: 'loading', id: '', timeToEvent: 0 }), }, }; - const { dashboard } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); expect(mockMetricEvent).not.toHaveBeenCalled(); setChildrenStatus(children, 'rendered'); @@ -136,8 +139,8 @@ describe('startQueryPerformanceTracking', () => { panel3: { wow: 'wow' }, panel4: { wow: 'wow' }, }; - const { dashboard } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); setChildrenStatus(children, 'rendered'); expect(mockMetricEvent).toHaveBeenCalledWith( @@ -164,8 +167,8 @@ describe('startQueryPerformanceTracking', () => { panel3: { wow: 'wow' }, panel4: { wow: 'wow' }, }; - const { dashboard } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); setChildrenStatus(children, 'rendered'); await waitFor(() => { @@ -193,8 +196,8 @@ describe('startQueryPerformanceTracking', () => { phase$: new BehaviorSubject<PhaseEvent>({ status: 'loading', id: '', timeToEvent: 0 }), }, }; - const { dashboard, children$ } = mockDashboard(children); - startQueryPerformanceTracking(dashboard); + const { dashboard, performanceState, children$ } = mockDashboard(children); + startQueryPerformanceTracking(dashboard, performanceState); setChildrenStatus(children, 'rendered'); expect(mockMetricEvent).toHaveBeenCalledTimes(1); @@ -218,9 +221,9 @@ describe('startQueryPerformanceTracking', () => { it('ensures the duration is at least as long as the time to data', async () => { // start an empty Dashboard. This will set the creation end time to some short value - const { dashboard, children$ } = mockDashboard(); - startQueryPerformanceTracking(dashboard); - expect(dashboard.creationEndTime).toBeDefined(); + const { dashboard, children$, performanceState } = mockDashboard(); + startQueryPerformanceTracking(dashboard, performanceState); + expect(performanceState.creationEndTime).toBeDefined(); // add a panel that takes a long time to load const children = { diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.ts index 4b138f6ffa21..edccfd7fb280 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/performance/query_performance_tracking.ts @@ -10,13 +10,20 @@ import { combineLatest, map, pairwise, startWith, switchMap, skipWhile, of } from 'rxjs'; import { reportPerformanceMetricEvent } from '@kbn/ebt-tools'; -import { PresentationContainer, TracksQueryPerformance } from '@kbn/presentation-containers'; +import { PresentationContainer } from '@kbn/presentation-containers'; import { PublishesPhaseEvents, apiPublishesPhaseEvents } from '@kbn/presentation-publishing'; import { DASHBOARD_LOADED_EVENT } from '../../../../dashboard_constants'; import { coreServices } from '../../../../services/kibana_services'; import { DashboardLoadType } from '../../../types'; +export interface PerformanceState { + firstLoad: boolean; + creationStartTime?: number; + creationEndTime?: number; + lastLoadStartTime?: number; +} + let isFirstDashboardLoadOfSession = true; const loadTypesMapping: { [key in DashboardLoadType]: number } = { @@ -26,7 +33,8 @@ const loadTypesMapping: { [key in DashboardLoadType]: number } = { }; export function startQueryPerformanceTracking( - dashboard: PresentationContainer & TracksQueryPerformance + dashboard: PresentationContainer, + performanceState: PerformanceState ) { return dashboard.children$ .pipe( @@ -66,31 +74,31 @@ export function startQueryPerformanceTracking( const now = performance.now(); const loadType: DashboardLoadType = isFirstDashboardLoadOfSession ? 'sessionFirstLoad' - : dashboard.firstLoad + : performanceState.firstLoad ? 'dashboardFirstLoad' : 'dashboardSubsequentLoad'; const queryHasStarted = !wasDashboardStillLoading && isDashboardStillLoading; const queryHasFinished = wasDashboardStillLoading && !isDashboardStillLoading; - if (dashboard.firstLoad && (panelCount === 0 || queryHasFinished)) { + if (performanceState.firstLoad && (panelCount === 0 || queryHasFinished)) { /** * we consider the Dashboard creation to be finished when all the panels are loaded. */ - dashboard.creationEndTime = now; + performanceState.creationEndTime = now; isFirstDashboardLoadOfSession = false; - dashboard.firstLoad = false; + performanceState.firstLoad = false; } if (queryHasStarted) { - dashboard.lastLoadStartTime = now; + performanceState.lastLoadStartTime = now; return; } if (queryHasFinished) { - const timeToData = now - (dashboard.lastLoadStartTime ?? now); + const timeToData = now - (performanceState.lastLoadStartTime ?? now); const completeLoadDuration = - (dashboard.creationEndTime ?? now) - (dashboard.creationStartTime ?? now); + (performanceState.creationEndTime ?? now) - (performanceState.creationStartTime ?? now); reportPerformanceMetrics({ timeToData, panelCount, diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/new_session.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/new_session.ts index 949f425a9ba9..8c2b88d81b63 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/new_session.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/new_session.ts @@ -11,9 +11,8 @@ import { Filter, TimeRange, onlyDisabledFiltersChanged } from '@kbn/es-query'; import { combineLatest, distinctUntilChanged, Observable, skip } from 'rxjs'; import { shouldRefreshFilterCompareOptions } from '@kbn/embeddable-plugin/public'; import { apiPublishesSettings } from '@kbn/presentation-containers/interfaces/publishes_settings'; -import { apiPublishesUnifiedSearch } from '@kbn/presentation-publishing'; -import { areTimesEqual } from '../../../state/diffing/dashboard_diffing_utils'; -import { DashboardContainer } from '../../dashboard_container'; +import { apiPublishesReload, apiPublishesUnifiedSearch } from '@kbn/presentation-publishing'; +import { areTimesEqual } from '../../../../dashboard_api/unified_search_manager'; export function newSession$(api: unknown) { const observables: Array<Observable<unknown>> = []; @@ -21,7 +20,6 @@ export function newSession$(api: unknown) { if (apiPublishesUnifiedSearch(api)) { observables.push( api.filters$.pipe( - // TODO move onlyDisabledFiltersChanged to appliedFilters$ interface distinctUntilChanged((previous: Filter[] | undefined, current: Filter[] | undefined) => { return onlyDisabledFiltersChanged(previous, current, shouldRefreshFilterCompareOptions); }) @@ -57,9 +55,8 @@ export function newSession$(api: unknown) { } } - // TODO replace lastReloadRequestTime$ with reload$ when removing legacy embeddable framework - if ((api as DashboardContainer).lastReloadRequestTime$) { - observables.push((api as DashboardContainer).lastReloadRequestTime$); + if (apiPublishesReload(api)) { + observables.push(api.reload$); } return combineLatest(observables).pipe(skip(1)); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/start_dashboard_search_session_integration.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/start_dashboard_search_session_integration.ts index 70f841db869a..7d229e31ddf0 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/start_dashboard_search_session_integration.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/search_sessions/start_dashboard_search_session_integration.ts @@ -12,7 +12,6 @@ import { skip } from 'rxjs'; import { noSearchSessionStorageCapabilityMessage } from '@kbn/data-plugin/public'; import { dataService } from '../../../../services/kibana_services'; -import { DashboardContainer } from '../../dashboard_container'; import type { DashboardApi, DashboardCreationOptions } from '../../../..'; import { newSession$ } from './new_session'; import { getDashboardCapabilities } from '../../../../utils/get_dashboard_capabilities'; @@ -21,8 +20,9 @@ import { getDashboardCapabilities } from '../../../../utils/get_dashboard_capabi * Enables dashboard search sessions. */ export function startDashboardSearchSessionIntegration( - this: DashboardContainer, - searchSessionSettings: DashboardCreationOptions['searchSessionSettings'] + dashboardApi: DashboardApi, + searchSessionSettings: DashboardCreationOptions['searchSessionSettings'], + setSearchSessionId: (searchSessionId: string) => void ) { if (!searchSessionSettings) return; @@ -33,26 +33,23 @@ export function startDashboardSearchSessionIntegration( createSessionRestorationDataProvider, } = searchSessionSettings; - dataService.search.session.enableStorage( - createSessionRestorationDataProvider(this as DashboardApi), - { - isDisabled: () => - getDashboardCapabilities().storeSearchSession - ? { disabled: false } - : { - disabled: true, - reasonText: noSearchSessionStorageCapabilityMessage, - }, - } - ); + dataService.search.session.enableStorage(createSessionRestorationDataProvider(dashboardApi), { + isDisabled: () => + getDashboardCapabilities().storeSearchSession + ? { disabled: false } + : { + disabled: true, + reasonText: noSearchSessionStorageCapabilityMessage, + }, + }); // force refresh when the session id in the URL changes. This will also fire off the "handle search session change" below. const searchSessionIdChangeSubscription = sessionIdUrlChangeObservable ?.pipe(skip(1)) - .subscribe(() => this.forceRefresh()); + .subscribe(() => dashboardApi.forceRefresh()); - newSession$(this).subscribe(() => { - const currentSearchSessionId = this.getState().explicitInput.searchSessionId; + const newSessionSubscription = newSession$(dashboardApi).subscribe(() => { + const currentSearchSessionId = dashboardApi.searchSessionId$.value; const updatedSearchSessionId: string | undefined = (() => { let searchSessionIdFromURL = getSearchSessionIdFromURL(); @@ -72,10 +69,12 @@ export function startDashboardSearchSessionIntegration( })(); if (updatedSearchSessionId && updatedSearchSessionId !== currentSearchSessionId) { - this.searchSessionId = updatedSearchSessionId; - this.searchSessionId$.next(updatedSearchSessionId); + setSearchSessionId(updatedSearchSessionId); } }); - this.integrationSubscriptions.add(searchSessionIdChangeSubscription); + return () => { + searchSessionIdChangeSubscription?.unsubscribe(); + newSessionSubscription.unsubscribe(); + }; } diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/unified_search/sync_dashboard_unified_search_state.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/unified_search/sync_dashboard_unified_search_state.ts deleted file mode 100644 index b6043f03b26c..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/unified_search/sync_dashboard_unified_search_state.ts +++ /dev/null @@ -1,155 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Subject } from 'rxjs'; -import fastIsEqual from 'fast-deep-equal'; -import { distinctUntilChanged, finalize, switchMap, tap } from 'rxjs'; - -import type { Filter, Query } from '@kbn/es-query'; -import { IKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; -import { cleanFiltersForSerialize } from '@kbn/presentation-util-plugin/public'; -import { - connectToQueryState, - GlobalQueryStateFromUrl, - waitUntilNextSessionCompletes$, -} from '@kbn/data-plugin/public'; - -import { DashboardContainer } from '../../dashboard_container'; -import { GLOBAL_STATE_STORAGE_KEY } from '../../../../dashboard_constants'; -import { areTimesEqual } from '../../../state/diffing/dashboard_diffing_utils'; -import { dataService } from '../../../../services/kibana_services'; - -/** - * Sets up syncing and subscriptions between the filter state from the Data plugin - * and the dashboard Redux store. - */ -export function syncUnifiedSearchState( - this: DashboardContainer, - kbnUrlStateStorage: IKbnUrlStateStorage -) { - const timefilterService = dataService.query.timefilter.timefilter; - - // get Observable for when the dashboard's saved filters or query change. - const OnFiltersChange$ = new Subject<{ filters: Filter[]; query: Query }>(); - const unsubscribeFromSavedFilterChanges = this.onStateChange(() => { - const { - explicitInput: { filters, query }, - } = this.getState(); - OnFiltersChange$.next({ - filters: filters ?? [], - query: query ?? dataService.query.queryString.getDefaultQuery(), - }); - }); - - // starts syncing app filters between dashboard state and filterManager - const { - explicitInput: { filters, query }, - } = this.getState(); - const intermediateFilterState: { filters: Filter[]; query: Query } = { - query: query ?? dataService.query.queryString.getDefaultQuery(), - filters: filters ?? [], - }; - - const stopSyncingAppFilters = connectToQueryState( - dataService.query, - { - get: () => intermediateFilterState, - set: ({ filters: newFilters, query: newQuery }) => { - intermediateFilterState.filters = cleanFiltersForSerialize(newFilters); - intermediateFilterState.query = newQuery; - this.dispatch.setFiltersAndQuery(intermediateFilterState); - }, - state$: OnFiltersChange$.pipe(distinctUntilChanged()), - }, - { - query: true, - filters: true, - } - ); - - const timeUpdateSubscription = timefilterService.getTimeUpdate$().subscribe(() => { - const newTimeRange = (() => { - // if there is an override time range in the URL, use it. - const urlOverrideTimeRange = - kbnUrlStateStorage.get<GlobalQueryStateFromUrl>(GLOBAL_STATE_STORAGE_KEY)?.time; - if (urlOverrideTimeRange) return urlOverrideTimeRange; - - // if there is no url override time range, check if this dashboard uses time restore, and restore to that. - const timeRestoreTimeRange = - this.getState().explicitInput.timeRestore && this.lastSavedInput$.value.timeRange; - if (timeRestoreTimeRange) { - timefilterService.setTime(timeRestoreTimeRange); - return timeRestoreTimeRange; - } - - // otherwise fall back to the time range from the time filter service - return timefilterService.getTime(); - })(); - - const lastTimeRange = this.getState().explicitInput.timeRange; - if ( - !areTimesEqual(newTimeRange.from, lastTimeRange?.from) || - !areTimesEqual(newTimeRange.to, lastTimeRange?.to) - ) { - this.dispatch.setTimeRange(newTimeRange); - } - }); - - const refreshIntervalSubscription = timefilterService - .getRefreshIntervalUpdate$() - .subscribe(() => { - const newRefreshInterval = (() => { - // if there is an override refresh interval in the URL, dispatch that to the dashboard. - const urlOverrideRefreshInterval = - kbnUrlStateStorage.get<GlobalQueryStateFromUrl>( - GLOBAL_STATE_STORAGE_KEY - )?.refreshInterval; - if (urlOverrideRefreshInterval) return urlOverrideRefreshInterval; - - // if there is no url override refresh interval, check if this dashboard uses time restore, and restore to that. - const timeRestoreRefreshInterval = - this.getState().explicitInput.timeRestore && this.lastSavedInput$.value.refreshInterval; - if (timeRestoreRefreshInterval) { - timefilterService.setRefreshInterval(timeRestoreRefreshInterval); - return timeRestoreRefreshInterval; - } - - // otherwise fall back to the refresh interval from the time filter service - return timefilterService.getRefreshInterval(); - })(); - - const lastRefreshInterval = this.getState().explicitInput.refreshInterval; - if (!fastIsEqual(newRefreshInterval, lastRefreshInterval)) { - this.dispatch.setRefreshInterval(newRefreshInterval); - } - }); - - const autoRefreshSubscription = timefilterService - .getAutoRefreshFetch$() - .pipe( - tap(() => { - this.forceRefresh(); - }), - switchMap((done) => - // best way on a dashboard to estimate that panels are updated is to rely on search session service state - waitUntilNextSessionCompletes$(dataService.search.session).pipe(finalize(done)) - ) - ) - .subscribe(); - - const stopSyncingUnifiedSearchState = () => { - autoRefreshSubscription.unsubscribe(); - timeUpdateSubscription.unsubscribe(); - refreshIntervalSubscription.unsubscribe(); - unsubscribeFromSavedFilterChanges(); - stopSyncingAppFilters(); - }; - - return stopSyncingUnifiedSearchState; -} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.test.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.test.tsx deleted file mode 100644 index 167ee2605516..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { isErrorEmbeddable, ViewMode } from '@kbn/embeddable-plugin/public'; -import { - CONTACT_CARD_EMBEDDABLE, - ContactCardEmbeddable, - ContactCardEmbeddableFactory, - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - EMPTY_EMBEDDABLE, -} from '@kbn/embeddable-plugin/public/lib/test_samples/embeddables'; -import type { TimeRange } from '@kbn/es-query'; -import { mockedReduxEmbeddablePackage } from '@kbn/presentation-util-plugin/public/mocks'; - -import { - buildMockDashboard, - getSampleDashboardInput, - getSampleDashboardPanel, - mockControlGroupApi, -} from '../../mocks'; -import { embeddableService } from '../../services/kibana_services'; -import { DashboardContainer } from './dashboard_container'; - -const embeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); -embeddableService.getEmbeddableFactory = jest.fn().mockReturnValue(embeddableFactory); - -test('DashboardContainer initializes embeddables', (done) => { - const container = buildMockDashboard({ - overrides: { - panels: { - '123': getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { firstName: 'Sam', id: '123' }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }, - }); - - const subscription = container.getOutput$().subscribe((output) => { - if (container.getOutput().embeddableLoaded['123']) { - const embeddable = container.getChild<ContactCardEmbeddable>('123'); - expect(embeddable).toBeDefined(); - expect(embeddable.id).toBe('123'); - done(); - } - }); - - if (container.getOutput().embeddableLoaded['123']) { - const embeddable = container.getChild<ContactCardEmbeddable>('123'); - expect(embeddable).toBeDefined(); - expect(embeddable.id).toBe('123'); - subscription.unsubscribe(); - done(); - } -}); - -test('DashboardContainer.addNewEmbeddable', async () => { - const container = buildMockDashboard(); - const embeddable = await container.addNewEmbeddable<ContactCardEmbeddableInput>( - CONTACT_CARD_EMBEDDABLE, - { - firstName: 'Kibana', - } - ); - expect(embeddable).toBeDefined(); - - if (!isErrorEmbeddable(embeddable)) { - expect(embeddable.getInput().firstName).toBe('Kibana'); - } else { - expect(false).toBe(true); - } - - const embeddableInContainer = container.getChild<ContactCardEmbeddable>(embeddable.id); - expect(embeddableInContainer).toBeDefined(); - expect(embeddableInContainer.id).toBe(embeddable.id); -}); - -test('DashboardContainer.replacePanel', (done) => { - const ID = '123'; - - const container = buildMockDashboard({ - overrides: { - panels: { - [ID]: getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { firstName: 'Sam', id: ID }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }, - }); - let counter = 0; - - const subscription = container.getInput$().subscribe( - jest.fn(({ panels }) => { - counter++; - expect(panels[ID]).toBeDefined(); - // It should be called exactly 2 times and exit the second time - switch (counter) { - case 1: - return expect(panels[ID].type).toBe(CONTACT_CARD_EMBEDDABLE); - - case 2: { - expect(panels[ID].type).toBe(EMPTY_EMBEDDABLE); - subscription.unsubscribe(); - done(); - return; - } - - default: - throw Error('Called too many times!'); - } - }) - ); - - // replace the panel now - container.replaceEmbeddable( - container.getInput().panels[ID].explicitInput.id, - { id: ID }, - EMPTY_EMBEDDABLE - ); -}); - -test('Container view mode change propagates to existing children', async () => { - const container = buildMockDashboard({ - overrides: { - panels: { - '123': getSampleDashboardPanel<ContactCardEmbeddableInput>({ - explicitInput: { firstName: 'Sam', id: '123' }, - type: CONTACT_CARD_EMBEDDABLE, - }), - }, - }, - }); - - const embeddable = await container.untilEmbeddableLoaded('123'); - expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); - container.updateInput({ viewMode: ViewMode.EDIT }); - expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); -}); - -test('Container view mode change propagates to new children', async () => { - const container = buildMockDashboard(); - const embeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Bob', - }); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); - - container.updateInput({ viewMode: ViewMode.EDIT }); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); -}); - -test('searchSessionId propagates to children', async () => { - const searchSessionId1 = 'searchSessionId1'; - const sampleInput = getSampleDashboardInput(); - const container = new DashboardContainer( - sampleInput, - mockedReduxEmbeddablePackage, - searchSessionId1, - 0, - undefined, - undefined, - { - anyMigrationRun: false, - isEmbeddedExternally: false, - lastSavedInput: sampleInput, - lastSavedId: undefined, - managed: false, - fullScreenMode: false, - } - ); - container?.setControlGroupApi(mockControlGroupApi); - const embeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Bob', - }); - - expect(embeddable.getInput().searchSessionId).toBe(searchSessionId1); -}); - -describe('getInheritedInput', () => { - const dashboardTimeRange = { - to: 'now', - from: 'now-15m', - }; - const dashboardTimeslice = [1688061910000, 1688062209000] as [number, number]; - - test('Should pass dashboard timeRange and timeslice to panel when panel does not have custom time range', async () => { - const container = buildMockDashboard(); - container.updateInput({ - timeRange: dashboardTimeRange, - timeslice: dashboardTimeslice, - }); - const embeddable = await container.addNewEmbeddable<ContactCardEmbeddableInput>( - CONTACT_CARD_EMBEDDABLE, - { - firstName: 'Kibana', - } - ); - expect(embeddable).toBeDefined(); - - const embeddableInput = container - .getChild<ContactCardEmbeddable>(embeddable.id) - .getInput() as ContactCardEmbeddableInput & { - timeRange: TimeRange; - timeslice: [number, number]; - }; - expect(embeddableInput.timeRange).toEqual(dashboardTimeRange); - expect(embeddableInput.timeslice).toEqual(dashboardTimeslice); - }); - - test('Should not pass dashboard timeRange and timeslice to panel when panel has custom time range', async () => { - const container = buildMockDashboard(); - container.updateInput({ - timeRange: dashboardTimeRange, - timeslice: dashboardTimeslice, - }); - const embeddableTimeRange = { - to: 'now', - from: 'now-24h', - }; - const embeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput & { timeRange: TimeRange } - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Kibana', - timeRange: embeddableTimeRange, - }); - - const embeddableInput = container - .getChild<ContactCardEmbeddable>(embeddable.id) - .getInput() as ContactCardEmbeddableInput & { - timeRange: TimeRange; - timeslice: [number, number]; - }; - expect(embeddableInput.timeRange).toEqual(embeddableTimeRange); - expect(embeddableInput.timeslice).toBeUndefined(); - }); - - test('Should pass dashboard settings to inherited input', async () => { - const container = buildMockDashboard({}); - const embeddable = await container.addNewEmbeddable<ContactCardEmbeddableInput>( - CONTACT_CARD_EMBEDDABLE, - { - firstName: 'Kibana', - } - ); - expect(embeddable).toBeDefined(); - - const embeddableInput = container - .getChild<ContactCardEmbeddable>(embeddable.id) - .getInput() as ContactCardEmbeddableInput & { - timeRange: TimeRange; - timeslice: [number, number]; - }; - expect(embeddableInput.syncTooltips).toBe(false); - expect(embeddableInput.syncColors).toBe(false); - expect(embeddableInput.syncCursor).toBe(true); - }); -}); diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx deleted file mode 100644 index 7063414ccca7..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container.tsx +++ /dev/null @@ -1,979 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import deepEqual from 'fast-deep-equal'; -import { omit } from 'lodash'; -import React from 'react'; -import ReactDOM from 'react-dom'; -import { - BehaviorSubject, - Subject, - Subscription, - distinctUntilChanged, - first, - map, - skipWhile, - switchMap, -} from 'rxjs'; -import { v4 } from 'uuid'; - -import { METRIC_TYPE } from '@kbn/analytics'; -import type { Reference } from '@kbn/content-management-utils'; -import { ControlGroupApi } from '@kbn/controls-plugin/public'; -import type { KibanaExecutionContext, OverlayRef } from '@kbn/core/public'; -import { RefreshInterval } from '@kbn/data-plugin/public'; -import type { DataView } from '@kbn/data-views-plugin/public'; -import { - Container, - DefaultEmbeddableApi, - EmbeddableFactoryNotFoundError, - PanelNotFoundError, - ViewMode, - embeddableInputToSubject, - isExplicitInputWithAttributes, - type EmbeddableFactory, - type EmbeddableInput, - type EmbeddableOutput, - type IEmbeddable, -} from '@kbn/embeddable-plugin/public'; -import type { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query'; -import { - HasRuntimeChildState, - HasSaveNotification, - HasSerializedChildState, - PanelPackage, - TrackContentfulRender, - TracksQueryPerformance, - combineCompatibleChildrenApis, -} from '@kbn/presentation-containers'; -import { PublishesSettings } from '@kbn/presentation-containers/interfaces/publishes_settings'; -import { apiHasSerializableState } from '@kbn/presentation-containers/interfaces/serialized_state'; -import { - PublishesDataLoading, - PublishesViewMode, - apiPublishesDataLoading, - apiPublishesPanelTitle, - apiPublishesUnsavedChanges, - getPanelTitle, - type PublishingSubject, -} from '@kbn/presentation-publishing'; -import { ReduxEmbeddableTools, ReduxToolsPackage } from '@kbn/presentation-util-plugin/public'; -import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { LocatorPublic } from '@kbn/share-plugin/common'; -import { ExitFullScreenButtonKibanaProvider } from '@kbn/shared-ux-button-exit-full-screen'; - -import { i18n } from '@kbn/i18n'; -import { DASHBOARD_CONTAINER_TYPE, DashboardApi, DashboardLocatorParams } from '../..'; -import type { DashboardAttributes } from '../../../server/content_management'; -import { DashboardContainerInput, DashboardPanelMap, DashboardPanelState } from '../../../common'; -import { - getReferencesForControls, - getReferencesForPanelId, -} from '../../../common/dashboard_container/persistable_state/dashboard_container_references'; -import { DashboardContext } from '../../dashboard_api/use_dashboard_api'; -import { getPanelAddedSuccessString } from '../../dashboard_app/_dashboard_app_strings'; -import { - DASHBOARD_APP_ID, - DASHBOARD_UI_METRIC_ID, - DEFAULT_PANEL_HEIGHT, - DEFAULT_PANEL_WIDTH, - PanelPlacementStrategy, -} from '../../dashboard_constants'; -import { PANELS_CONTROL_GROUP_KEY } from '../../services/dashboard_backup_service'; -import { getDashboardContentManagementService } from '../../services/dashboard_content_management_service'; -import { - coreServices, - dataService, - embeddableService, - usageCollectionService, -} from '../../services/kibana_services'; -import { getDashboardCapabilities } from '../../utils/get_dashboard_capabilities'; -import { DashboardViewport } from '../component/viewport/dashboard_viewport'; -import { placePanel } from '../panel_placement'; -import { getDashboardPanelPlacementSetting } from '../panel_placement/panel_placement_registry'; -import { runPanelPlacementStrategy } from '../panel_placement/place_new_panel_strategies'; -import { dashboardContainerReducers } from '../state/dashboard_container_reducers'; -import { getDiffingMiddleware } from '../state/diffing/dashboard_diffing_integration'; -import { DashboardReduxState, DashboardStateFromSettingsFlyout, UnsavedPanelState } from '../types'; -import { addFromLibrary, addOrUpdateEmbeddable, runInteractiveSave, runQuickSave } from './api'; -import { duplicateDashboardPanel } from './api/duplicate_dashboard_panel'; -import { - combineDashboardFiltersWithControlGroupFilters, - startSyncingDashboardControlGroup, -} from './create/controls/dashboard_control_group_integration'; -import { initializeDashboard } from './create/create_dashboard'; -import { - dashboardTypeDisplayLowercase, - dashboardTypeDisplayName, -} from './dashboard_container_factory'; -import { InitialComponentState, getDashboardApi } from '../../dashboard_api/get_dashboard_api'; -import type { DashboardCreationOptions } from '../..'; - -export interface InheritedChildInput { - filters: Filter[]; - query: Query; - timeRange?: TimeRange; - timeslice?: [number, number]; - refreshConfig?: RefreshInterval; - viewMode: ViewMode; - hidePanelTitles?: boolean; - id: string; - searchSessionId?: string; - syncColors?: boolean; - syncCursor?: boolean; - syncTooltips?: boolean; - executionContext?: KibanaExecutionContext; -} - -type DashboardReduxEmbeddableTools = ReduxEmbeddableTools< - DashboardReduxState, - typeof dashboardContainerReducers ->; - -export class DashboardContainer - extends Container<InheritedChildInput, DashboardContainerInput> - implements - TrackContentfulRender, - TracksQueryPerformance, - HasSaveNotification, - HasRuntimeChildState, - HasSerializedChildState, - PublishesSettings, - Partial<PublishesViewMode> -{ - public readonly type = DASHBOARD_CONTAINER_TYPE; - - // state management - public select: DashboardReduxEmbeddableTools['select']; - public getState: DashboardReduxEmbeddableTools['getState']; - public dispatch: DashboardReduxEmbeddableTools['dispatch']; - public onStateChange: DashboardReduxEmbeddableTools['onStateChange']; - public anyReducerRun: Subject<null> = new Subject(); - public setAnimatePanelTransforms: (animate: boolean) => void; - public setManaged: (managed: boolean) => void; - public setHasUnsavedChanges: (hasUnsavedChanges: boolean) => void; - public openOverlay: (ref: OverlayRef, options?: { focusedPanelId?: string }) => void; - public clearOverlays: () => void; - public highlightPanel: (panelRef: HTMLDivElement) => void; - public setScrollToPanelId: (id: string | undefined) => void; - public setFullScreenMode: (fullScreenMode: boolean) => void; - public setExpandedPanelId: (newId?: string) => void; - public setHighlightPanelId: (highlightPanelId: string | undefined) => void; - public setLastSavedInput: (lastSavedInput: DashboardContainerInput) => void; - public lastSavedInput$: PublishingSubject<DashboardContainerInput>; - public setSavedObjectId: (id: string | undefined) => void; - public expandPanel: (panelId: string) => void; - public scrollToPanel: (panelRef: HTMLDivElement) => Promise<void>; - public scrollToTop: () => void; - - public integrationSubscriptions: Subscription = new Subscription(); - public publishingSubscription: Subscription = new Subscription(); - public diffingSubscription: Subscription = new Subscription(); - public controlGroupApi$: PublishingSubject<ControlGroupApi | undefined>; - public settings: Record<string, PublishingSubject<boolean | undefined>>; - - public searchSessionId?: string; - public lastReloadRequestTime$ = new BehaviorSubject<string | undefined>(undefined); - public searchSessionId$ = new BehaviorSubject<string | undefined>(undefined); - public reload$ = new Subject<void>(); - public timeRestore$: BehaviorSubject<boolean | undefined>; - public timeslice$: BehaviorSubject<[number, number] | undefined>; - public unifiedSearchFilters$?: PublishingSubject<Filter[] | undefined>; - public locator?: Pick<LocatorPublic<DashboardLocatorParams>, 'navigate' | 'getRedirectUrl'>; - - public readonly executionContext: KibanaExecutionContext; - - private domNode?: HTMLElement; - - // performance monitoring - public lastLoadStartTime?: number; - public creationStartTime?: number; - public creationEndTime?: number; - public firstLoad: boolean = true; - private hadContentfulRender = false; - - // setup - public untilContainerInitialized: () => Promise<void>; - - // cleanup - public stopSyncingWithUnifiedSearch?: () => void; - private cleanupStateTools: () => void; - - // Services that are used in the Dashboard container code - private creationOptions?: DashboardCreationOptions; - private showWriteControls: boolean; - - public trackContentfulRender() { - if (!this.hadContentfulRender) { - coreServices.analytics.reportEvent('dashboard_loaded_with_data', {}); - } - this.hadContentfulRender = true; - } - - private trackPanelAddMetric: - | ((type: string, eventNames: string | string[], count?: number | undefined) => void) - | undefined; - // new embeddable framework - public savedObjectReferences: Reference[] = []; - public controlGroupInput: DashboardAttributes['controlGroupInput'] | undefined; - - constructor( - initialInput: DashboardContainerInput, - reduxToolsPackage: ReduxToolsPackage, - initialSessionId?: string, - dashboardCreationStartTime?: number, - parent?: Container, - creationOptions?: DashboardCreationOptions, - initialComponentState?: InitialComponentState - ) { - const controlGroupApi$ = new BehaviorSubject<ControlGroupApi | undefined>(undefined); - async function untilContainerInitialized(): Promise<void> { - return new Promise((resolve) => { - controlGroupApi$ - .pipe( - skipWhile((controlGroupApi) => !controlGroupApi), - switchMap(async (controlGroupApi) => { - // Bug in main where panels are loaded before control filters are ready - // Want to migrate to react embeddable controls with same behavior - // TODO - do not load panels until control filters are ready - /* - await controlGroupApi?.untilInitialized(); - */ - }), - first() - ) - .subscribe(() => { - resolve(); - }); - }); - } - - super( - { - ...initialInput, - }, - { embeddableLoaded: {} }, - embeddableService.getEmbeddableFactory, - parent, - { untilContainerInitialized } - ); - - ({ showWriteControls: this.showWriteControls } = getDashboardCapabilities()); - - this.controlGroupApi$ = controlGroupApi$; - this.untilContainerInitialized = untilContainerInitialized; - - this.trackPanelAddMetric = usageCollectionService?.reportUiCounter.bind( - usageCollectionService, - DASHBOARD_UI_METRIC_ID - ); - - this.creationOptions = creationOptions; - this.searchSessionId = initialSessionId; - this.searchSessionId$.next(initialSessionId); - this.creationStartTime = dashboardCreationStartTime; - - // start diffing dashboard state - const diffingMiddleware = getDiffingMiddleware.bind(this)(); - - // build redux embeddable tools - const reduxTools = reduxToolsPackage.createReduxEmbeddableTools< - DashboardReduxState, - typeof dashboardContainerReducers - >({ - embeddable: this, - reducers: dashboardContainerReducers, - additionalMiddleware: [diffingMiddleware], - }); - this.onStateChange = reduxTools.onStateChange; - this.cleanupStateTools = reduxTools.cleanup; - this.getState = reduxTools.getState; - this.dispatch = reduxTools.dispatch; - this.select = reduxTools.select; - - this.uuid$ = embeddableInputToSubject<string>( - this.publishingSubscription, - this, - 'id' - ) as BehaviorSubject<string>; - - const dashboardApi = getDashboardApi( - initialComponentState - ? initialComponentState - : { - anyMigrationRun: false, - isEmbeddedExternally: false, - lastSavedInput: initialInput, - lastSavedId: undefined, - fullScreenMode: false, - managed: false, - }, - (id: string) => this.untilEmbeddableLoaded(id) - ); - this.animatePanelTransforms$ = dashboardApi.animatePanelTransforms$; - this.fullScreenMode$ = dashboardApi.fullScreenMode$; - this.hasUnsavedChanges$ = dashboardApi.hasUnsavedChanges$; - this.isEmbeddedExternally = dashboardApi.isEmbeddedExternally; - this.managed$ = dashboardApi.managed$; - this.setAnimatePanelTransforms = dashboardApi.setAnimatePanelTransforms; - this.setFullScreenMode = dashboardApi.setFullScreenMode; - this.setHasUnsavedChanges = dashboardApi.setHasUnsavedChanges; - this.setManaged = dashboardApi.setManaged; - this.expandedPanelId = dashboardApi.expandedPanelId; - this.focusedPanelId$ = dashboardApi.focusedPanelId$; - this.highlightPanelId$ = dashboardApi.highlightPanelId$; - this.highlightPanel = dashboardApi.highlightPanel; - this.setExpandedPanelId = dashboardApi.setExpandedPanelId; - this.setHighlightPanelId = dashboardApi.setHighlightPanelId; - this.scrollToPanelId$ = dashboardApi.scrollToPanelId$; - this.setScrollToPanelId = dashboardApi.setScrollToPanelId; - this.clearOverlays = dashboardApi.clearOverlays; - this.hasOverlays$ = dashboardApi.hasOverlays$; - this.openOverlay = dashboardApi.openOverlay; - this.hasRunMigrations$ = dashboardApi.hasRunMigrations$; - this.setLastSavedInput = dashboardApi.setLastSavedInput; - this.lastSavedInput$ = dashboardApi.lastSavedInput$; - this.savedObjectId = dashboardApi.savedObjectId; - this.setSavedObjectId = dashboardApi.setSavedObjectId; - this.expandPanel = dashboardApi.expandPanel; - this.scrollToPanel = dashboardApi.scrollToPanel; - this.scrollToTop = dashboardApi.scrollToTop; - - this.useMargins$ = new BehaviorSubject(this.getState().explicitInput.useMargins); - this.panels$ = new BehaviorSubject(this.getState().explicitInput.panels); - this.publishingSubscription.add( - this.onStateChange(() => { - const state = this.getState(); - if (this.useMargins$.value !== state.explicitInput.useMargins) { - this.useMargins$.next(state.explicitInput.useMargins); - } - if (this.panels$.value !== state.explicitInput.panels) { - this.panels$.next(state.explicitInput.panels); - } - }) - ); - - this.startAuditingReactEmbeddableChildren(); - - this.settings = { - syncColors$: embeddableInputToSubject<boolean | undefined, DashboardContainerInput>( - this.publishingSubscription, - this, - 'syncColors' - ), - syncCursor$: embeddableInputToSubject<boolean | undefined, DashboardContainerInput>( - this.publishingSubscription, - this, - 'syncCursor' - ), - syncTooltips$: embeddableInputToSubject<boolean | undefined, DashboardContainerInput>( - this.publishingSubscription, - this, - 'syncTooltips' - ), - }; - this.timeRestore$ = embeddableInputToSubject<boolean | undefined, DashboardContainerInput>( - this.publishingSubscription, - this, - 'timeRestore' - ); - this.timeslice$ = embeddableInputToSubject< - [number, number] | undefined, - DashboardContainerInput - >(this.publishingSubscription, this, 'timeslice'); - this.lastReloadRequestTime$ = embeddableInputToSubject< - string | undefined, - DashboardContainerInput - >(this.publishingSubscription, this, 'lastReloadRequestTime'); - - startSyncingDashboardControlGroup(this); - - this.executionContext = initialInput.executionContext; - - this.dataLoading = new BehaviorSubject<boolean | undefined>(false); - this.publishingSubscription.add( - combineCompatibleChildrenApis<PublishesDataLoading, boolean | undefined>( - this, - 'dataLoading', - apiPublishesDataLoading, - undefined, - // flatten method - (values) => { - return values.some((isLoading) => isLoading); - } - ).subscribe((isAtLeastOneChildLoading) => { - (this.dataLoading as BehaviorSubject<boolean | undefined>).next(isAtLeastOneChildLoading); - }) - ); - - this.dataViews = new BehaviorSubject<DataView[] | undefined>([]); - - const query$ = new BehaviorSubject<Query | AggregateQuery | undefined>(this.getInput().query); - this.query$ = query$; - this.publishingSubscription.add( - this.getInput$().subscribe((input) => { - if (!deepEqual(query$.getValue() ?? [], input.query)) { - query$.next(input.query); - } - }) - ); - } - - public setControlGroupApi(controlGroupApi: ControlGroupApi) { - (this.controlGroupApi$ as BehaviorSubject<ControlGroupApi | undefined>).next(controlGroupApi); - } - - public getAppContext() { - const embeddableAppContext = this.creationOptions?.getEmbeddableAppContext?.( - this.savedObjectId.value - ); - return { - ...embeddableAppContext, - currentAppId: embeddableAppContext?.currentAppId ?? DASHBOARD_APP_ID, - }; - } - - protected createNewPanelState< - TEmbeddableInput extends EmbeddableInput, - TEmbeddable extends IEmbeddable<TEmbeddableInput, any> - >( - factory: EmbeddableFactory<TEmbeddableInput, any, TEmbeddable>, - partial: Partial<TEmbeddableInput> = {}, - attributes?: unknown - ): { - newPanel: DashboardPanelState<TEmbeddableInput>; - otherPanels: DashboardContainerInput['panels']; - } { - const { newPanel } = super.createNewPanelState(factory, partial, attributes); - return placePanel(factory, newPanel, this.input.panels, attributes); - } - - public render(dom: HTMLElement) { - if (this.domNode) { - ReactDOM.unmountComponentAtNode(this.domNode); - } - this.domNode = dom; - this.domNode.className = 'dashboardContainer'; - - ReactDOM.render( - <KibanaRenderContextProvider - analytics={coreServices.analytics} - i18n={coreServices.i18n} - theme={coreServices.theme} - > - <ExitFullScreenButtonKibanaProvider - coreStart={{ chrome: coreServices.chrome, customBranding: coreServices.customBranding }} - > - <DashboardContext.Provider value={this as DashboardApi}> - <DashboardViewport dashboardContainer={this.domNode} /> - </DashboardContext.Provider> - </ExitFullScreenButtonKibanaProvider> - </KibanaRenderContextProvider>, - dom - ); - } - - public updateInput(changes: Partial<DashboardContainerInput>): void { - // block the Dashboard from entering edit mode if this Dashboard is managed. - if ( - (this.managed$.value || !this.showWriteControls) && - changes.viewMode?.toLowerCase() === ViewMode.EDIT?.toLowerCase() - ) { - const { viewMode, ...rest } = changes; - super.updateInput(rest); - return; - } - super.updateInput(changes); - } - - protected getInheritedInput(id: string): InheritedChildInput { - const { - query, - filters, - viewMode, - timeRange, - timeslice, - syncColors, - syncTooltips, - syncCursor, - hidePanelTitles, - refreshInterval, - executionContext, - panels, - } = this.input; - - const combinedFilters = combineDashboardFiltersWithControlGroupFilters( - filters, - this.controlGroupApi$?.value - ); - const hasCustomTimeRange = Boolean( - (panels[id]?.explicitInput as Partial<InheritedChildInput>)?.timeRange - ); - return { - searchSessionId: this.searchSessionId, - refreshConfig: refreshInterval, - filters: combinedFilters, - hidePanelTitles, - executionContext, - syncTooltips, - syncColors, - syncCursor, - viewMode, - query, - id, - // do not pass any time information from dashboard to panel when panel has custom time range - // to avoid confusing panel which timeRange should be used - timeRange: hasCustomTimeRange ? undefined : timeRange, - timeslice: hasCustomTimeRange ? undefined : timeslice, - }; - } - - // ------------------------------------------------------------------------------------------------------ - // Cleanup - // ------------------------------------------------------------------------------------------------------ - public destroy() { - super.destroy(); - this.cleanupStateTools(); - this.diffingSubscription.unsubscribe(); - this.publishingSubscription.unsubscribe(); - this.integrationSubscriptions.unsubscribe(); - this.stopSyncingWithUnifiedSearch?.(); - if (this.domNode) ReactDOM.unmountComponentAtNode(this.domNode); - } - - // ------------------------------------------------------------------------------------------------------ - // Dashboard API - // ------------------------------------------------------------------------------------------------------ - public runInteractiveSave = runInteractiveSave; - public runQuickSave = runQuickSave; - - public addFromLibrary = addFromLibrary; - - public duplicatePanel(id: string) { - duplicateDashboardPanel.bind(this)(id); - } - - public canRemovePanels = () => this.expandedPanelId.value === undefined; - - public getTypeDisplayName = () => dashboardTypeDisplayName; - public getTypeDisplayNameLowerCase = () => dashboardTypeDisplayLowercase; - - public savedObjectId: BehaviorSubject<string | undefined>; - public expandedPanelId: BehaviorSubject<string | undefined>; - public focusedPanelId$: BehaviorSubject<string | undefined>; - public managed$: BehaviorSubject<boolean>; - public fullScreenMode$: BehaviorSubject<boolean>; - public hasRunMigrations$: BehaviorSubject<boolean>; - public hasUnsavedChanges$: BehaviorSubject<boolean>; - public hasOverlays$: BehaviorSubject<boolean>; - public useMargins$: BehaviorSubject<boolean>; - public scrollToPanelId$: BehaviorSubject<string | undefined>; - public highlightPanelId$: BehaviorSubject<string | undefined>; - public animatePanelTransforms$: BehaviorSubject<boolean>; - public panels$: BehaviorSubject<DashboardPanelMap>; - public isEmbeddedExternally: boolean; - public uuid$: BehaviorSubject<string>; - - public async replacePanel(idToRemove: string, { panelType, initialState }: PanelPackage) { - const newId = await this.replaceEmbeddable( - idToRemove, - initialState as Partial<EmbeddableInput>, - panelType, - true - ); - if (this.expandedPanelId.value !== undefined) { - this.setExpandedPanelId(newId); - } - this.setHighlightPanelId(newId); - return newId; - } - - public async addNewPanel<ApiType extends unknown = unknown>( - panelPackage: PanelPackage, - displaySuccessMessage?: boolean - ) { - const onSuccess = (id?: string, title?: string) => { - if (!displaySuccessMessage) return; - coreServices.notifications.toasts.addSuccess({ - title: getPanelAddedSuccessString(title), - 'data-test-subj': 'addEmbeddableToDashboardSuccess', - }); - this.setScrollToPanelId(id); - this.setHighlightPanelId(id); - }; - - if (this.trackPanelAddMetric) { - this.trackPanelAddMetric(METRIC_TYPE.CLICK, panelPackage.panelType); - } - if (embeddableService.reactEmbeddableRegistryHasKey(panelPackage.panelType)) { - const newId = v4(); - - const getCustomPlacementSettingFunc = getDashboardPanelPlacementSetting( - panelPackage.panelType - ); - - const customPlacementSettings = getCustomPlacementSettingFunc - ? await getCustomPlacementSettingFunc(panelPackage.initialState) - : {}; - - const placementSettings = { - width: DEFAULT_PANEL_WIDTH, - height: DEFAULT_PANEL_HEIGHT, - strategy: PanelPlacementStrategy.findTopLeftMostOpenSpace, - ...customPlacementSettings, - }; - - const { width, height, strategy } = placementSettings; - - const { newPanelPlacement, otherPanels } = runPanelPlacementStrategy(strategy, { - currentPanels: this.getInput().panels, - height, - width, - }); - const newPanel: DashboardPanelState = { - type: panelPackage.panelType, - gridData: { - ...newPanelPlacement, - i: newId, - }, - explicitInput: { - id: newId, - }, - }; - if (panelPackage.initialState) { - this.setRuntimeStateForChild(newId, panelPackage.initialState); - } - this.updateInput({ panels: { ...otherPanels, [newId]: newPanel } }); - onSuccess(newId, newPanel.explicitInput.title); - return await this.untilReactEmbeddableLoaded<ApiType>(newId); - } - - const embeddableFactory = embeddableService.getEmbeddableFactory(panelPackage.panelType); - if (!embeddableFactory) { - throw new EmbeddableFactoryNotFoundError(panelPackage.panelType); - } - const initialInput = panelPackage.initialState as Partial<EmbeddableInput>; - - let explicitInput: Partial<EmbeddableInput>; - let attributes: unknown; - try { - if (initialInput) { - explicitInput = initialInput; - } else { - const explicitInputReturn = await embeddableFactory.getExplicitInput(undefined, this); - if (isExplicitInputWithAttributes(explicitInputReturn)) { - explicitInput = explicitInputReturn.newInput; - attributes = explicitInputReturn.attributes; - } else { - explicitInput = explicitInputReturn; - } - } - } catch (e) { - // error likely means user canceled embeddable creation - return; - } - - const newEmbeddable = await this.addNewEmbeddable( - embeddableFactory.type, - explicitInput, - attributes - ); - - if (newEmbeddable) { - onSuccess(newEmbeddable.id, newEmbeddable.getTitle()); - } - return newEmbeddable as ApiType; - } - - public getDashboardPanelFromId = async (panelId: string) => { - const panel = this.getInput().panels[panelId]; - if (embeddableService.reactEmbeddableRegistryHasKey(panel.type)) { - const child = this.children$.value[panelId]; - if (!child) throw new PanelNotFoundError(); - const serialized = apiHasSerializableState(child) - ? await child.serializeState() - : { rawState: {} }; - return { - type: panel.type, - explicitInput: { ...panel.explicitInput, ...serialized.rawState }, - gridData: panel.gridData, - references: serialized.references, - }; - } - return panel; - }; - - public addOrUpdateEmbeddable = addOrUpdateEmbeddable; - - public forceRefresh(refreshControlGroup: boolean = true) { - this.dispatch.setLastReloadRequestTimeToNow({}); - if (refreshControlGroup) { - // only reload all panels if this refresh does not come from the control group. - this.reload$.next(); - } - } - - public async asyncResetToLastSavedState() { - this.dispatch.resetToLastSavedInput(this.lastSavedInput$.value); - const { - explicitInput: { timeRange, refreshInterval }, - } = this.getState(); - - const { timeRestore: lastSavedTimeRestore } = this.lastSavedInput$.value; - - if (this.controlGroupApi$.value) { - await this.controlGroupApi$.value.asyncResetUnsavedChanges(); - } - - // if we are using the unified search integration, we need to force reset the time picker. - if (this.creationOptions?.useUnifiedSearchIntegration && lastSavedTimeRestore) { - const timeFilterService = dataService.query.timefilter.timefilter; - if (timeRange) timeFilterService.setTime(timeRange); - if (refreshInterval) timeFilterService.setRefreshInterval(refreshInterval); - } - this.resetAllReactEmbeddables(); - } - - public navigateToDashboard = async ( - newSavedObjectId?: string, - newCreationOptions?: Partial<DashboardCreationOptions> - ) => { - this.integrationSubscriptions.unsubscribe(); - this.integrationSubscriptions = new Subscription(); - this.stopSyncingWithUnifiedSearch?.(); - - if (newCreationOptions) { - this.creationOptions = { ...this.creationOptions, ...newCreationOptions }; - } - const loadDashboardReturn = await getDashboardContentManagementService().loadDashboardState({ - id: newSavedObjectId, - }); - - const dashboardContainerReady$ = new Subject<DashboardContainer>(); - const untilDashboardReady = () => - new Promise<DashboardContainer>((resolve) => { - const subscription = dashboardContainerReady$.subscribe((container) => { - subscription.unsubscribe(); - resolve(container); - }); - }); - - const initializeResult = await initializeDashboard({ - creationOptions: this.creationOptions, - untilDashboardReady, - loadDashboardReturn, - }); - if (!initializeResult) return; - const { input: newInput, searchSessionId } = initializeResult; - - this.searchSessionId = searchSessionId; - this.searchSessionId$.next(searchSessionId); - - this.setAnimatePanelTransforms(false); // prevents panels from animating on navigate. - this.setManaged(loadDashboardReturn?.managed ?? false); - this.setExpandedPanelId(undefined); - this.setLastSavedInput(omit(loadDashboardReturn?.dashboardInput, 'controlGroupInput')); - this.setSavedObjectId(newSavedObjectId); - this.firstLoad = true; - this.updateInput(newInput); - dashboardContainerReady$.next(this); - }; - - /** - * Use this to set the dataviews that are used in the dashboard when they change/update - * @param newDataViews The new array of dataviews that will overwrite the old dataviews array - */ - public setAllDataViews = (newDataViews: DataView[]) => { - (this.dataViews as BehaviorSubject<DataView[] | undefined>).next(newDataViews); - }; - - public getPanelsState = () => { - return this.getState().explicitInput.panels; - }; - - public getSettings = (): DashboardStateFromSettingsFlyout => { - const state = this.getState(); - return { - description: state.explicitInput.description, - hidePanelTitles: state.explicitInput.hidePanelTitles, - syncColors: state.explicitInput.syncColors, - syncCursor: state.explicitInput.syncCursor, - syncTooltips: state.explicitInput.syncTooltips, - tags: state.explicitInput.tags, - timeRestore: state.explicitInput.timeRestore, - title: state.explicitInput.title, - useMargins: state.explicitInput.useMargins, - }; - }; - - public setSettings = (settings: DashboardStateFromSettingsFlyout) => { - this.dispatch.setStateFromSettingsFlyout(settings); - }; - - public setViewMode = (viewMode: ViewMode) => { - // block the Dashboard from entering edit mode if this Dashboard is managed. - if (this.managed$.value && viewMode?.toLowerCase() === ViewMode.EDIT) { - return; - } - this.dispatch.setViewMode(viewMode); - }; - - public setQuery = (query?: Query | undefined) => this.updateInput({ query }); - - public setFilters = (filters?: Filter[] | undefined) => this.updateInput({ filters }); - - public setTags = (tags: string[]) => { - this.updateInput({ tags }); - }; - - public getPanelCount = () => { - return Object.keys(this.getInput().panels).length; - }; - - public async getPanelTitles(): Promise<string[]> { - const titles: string[] = []; - for (const [id, panel] of Object.entries(this.getInput().panels)) { - const title = await (async () => { - if (embeddableService.reactEmbeddableRegistryHasKey(panel.type)) { - const child = this.children$.value[id]; - return apiPublishesPanelTitle(child) ? getPanelTitle(child) : ''; - } - await this.untilEmbeddableLoaded(id); - const child: IEmbeddable<EmbeddableInput, EmbeddableOutput> = this.getChild(id); - if (!child) return undefined; - return child.getTitle(); - })(); - if (title) titles.push(title); - } - return titles; - } - - public setPanels = (panels: DashboardPanelMap) => { - this.dispatch.setPanels(panels); - }; - - // ------------------------------------------------------------------------------------------------------ - // React Embeddable system - // ------------------------------------------------------------------------------------------------------ - public registerChildApi = (api: DefaultEmbeddableApi) => { - this.children$.next({ - ...this.children$.value, - [api.uuid]: api as DefaultEmbeddableApi, - }); - }; - - public saveNotification$: Subject<void> = new Subject<void>(); - - public getSerializedStateForChild = (childId: string) => { - const rawState = this.getInput().panels[childId].explicitInput; - const { id, ...serializedState } = rawState; - if (!rawState || Object.keys(serializedState).length === 0) return; - const references = getReferencesForPanelId(childId, this.savedObjectReferences); - return { - rawState, - // references from old installations may not be prefixed with panel id - // fall back to passing all references in these cases to preserve backwards compatability - references: references.length > 0 ? references : this.savedObjectReferences, - }; - }; - - public getSerializedStateForControlGroup = () => { - return { - rawState: this.controlGroupInput - ? this.controlGroupInput - : { - labelPosition: 'oneLine', - chainingSystem: 'HIERARCHICAL', - autoApplySelections: true, - controls: [], - ignoreParentSettings: { - ignoreFilters: false, - ignoreQuery: false, - ignoreTimerange: false, - ignoreValidations: false, - }, - }, - references: getReferencesForControls(this.savedObjectReferences), - }; - }; - - private restoredRuntimeState: UnsavedPanelState | undefined = undefined; - public setRuntimeStateForChild = (childId: string, state: object) => { - const runtimeState = this.restoredRuntimeState ?? {}; - runtimeState[childId] = state; - this.restoredRuntimeState = runtimeState; - }; - public getRuntimeStateForChild = (childId: string) => { - return this.restoredRuntimeState?.[childId]; - }; - - public getRuntimeStateForControlGroup = () => { - return this.getRuntimeStateForChild(PANELS_CONTROL_GROUP_KEY); - }; - - public removePanel(id: string) { - const type = this.getInput().panels[id]?.type; - this.removeEmbeddable(id); - if (embeddableService.reactEmbeddableRegistryHasKey(type)) { - const { [id]: childToRemove, ...otherChildren } = this.children$.value; - this.children$.next(otherChildren); - } - } - - public startAuditingReactEmbeddableChildren = () => { - const auditChildren = () => { - const currentChildren = this.children$.value; - let panelsChanged = false; - for (const panelId of Object.keys(currentChildren)) { - if (!this.getInput().panels[panelId]) { - delete currentChildren[panelId]; - panelsChanged = true; - } - } - if (panelsChanged) this.children$.next(currentChildren); - }; - - // audit children when panels change - this.publishingSubscription.add( - this.getInput$() - .pipe( - map(() => Object.keys(this.getInput().panels)), - distinctUntilChanged(deepEqual) - ) - .subscribe(() => auditChildren()) - ); - auditChildren(); - }; - - public resetAllReactEmbeddables = () => { - this.restoredRuntimeState = undefined; - let resetChangedPanelCount = false; - const currentChildren = this.children$.value; - for (const panelId of Object.keys(currentChildren)) { - if (this.getInput().panels[panelId]) { - const child = currentChildren[panelId]; - if (apiPublishesUnsavedChanges(child)) { - const success = child.resetUnsavedChanges(); - if (!success) { - coreServices.notifications.toasts.addWarning( - i18n.translate('dashboard.reset.panelError', { - defaultMessage: 'Unable to reset panel changes', - }) - ); - } - } - } else { - // if reset resulted in panel removal, we need to update the list of children - delete currentChildren[panelId]; - resetChangedPanelCount = true; - } - } - if (resetChangedPanelCount) this.children$.next(currentChildren); - }; -} diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx b/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.tsx deleted file mode 100644 index 52d7d84f6749..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/dashboard_container_factory.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { EmbeddablePersistableStateService } from '@kbn/embeddable-plugin/common'; -import { - Container, - ContainerOutput, - EmbeddableFactory, - EmbeddableFactoryDefinition, - ErrorEmbeddable, -} from '@kbn/embeddable-plugin/public'; - -import { DASHBOARD_CONTAINER_TYPE } from '..'; -import { createExtract, createInject, DashboardContainerInput } from '../../../common'; -import { DEFAULT_DASHBOARD_INPUT } from '../../dashboard_constants'; -import type { DashboardContainer } from './dashboard_container'; -import type { DashboardCreationOptions } from '../..'; - -export type DashboardContainerFactory = EmbeddableFactory< - DashboardContainerInput, - ContainerOutput, - DashboardContainer ->; - -export const dashboardTypeDisplayName = i18n.translate('dashboard.factory.displayName', { - defaultMessage: 'Dashboard', -}); - -export const dashboardTypeDisplayLowercase = i18n.translate( - 'dashboard.factory.displayNameLowercase', - { - defaultMessage: 'dashboard', - } -); - -export class DashboardContainerFactoryDefinition - implements - EmbeddableFactoryDefinition<DashboardContainerInput, ContainerOutput, DashboardContainer> -{ - public readonly isContainerType = true; - public readonly type = DASHBOARD_CONTAINER_TYPE; - - public inject: EmbeddablePersistableStateService['inject']; - public extract: EmbeddablePersistableStateService['extract']; - - constructor(private readonly persistableStateService: EmbeddablePersistableStateService) { - this.inject = createInject(this.persistableStateService); - this.extract = createExtract(this.persistableStateService); - } - - public isEditable = async () => { - // Currently unused for dashboards - return false; - }; - - public readonly getDisplayName = () => dashboardTypeDisplayName; - - public getDefaultInput(): Partial<DashboardContainerInput> { - return DEFAULT_DASHBOARD_INPUT; - } - - public create = async ( - initialInput: DashboardContainerInput, - parent?: Container, - creationOptions?: DashboardCreationOptions, - savedObjectId?: string - ): Promise<DashboardContainer | ErrorEmbeddable | undefined> => { - const dashboardCreationStartTime = performance.now(); - const { createDashboard } = await import('./create/create_dashboard'); - try { - const dashboard = await createDashboard( - creationOptions, - dashboardCreationStartTime, - savedObjectId - ); - return dashboard; - } catch (e) { - return new ErrorEmbeddable(e, { id: e.id }); - } - }; -} diff --git a/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.test.tsx b/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.test.tsx deleted file mode 100644 index 6a81a8c4fd60..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.test.tsx +++ /dev/null @@ -1,305 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { setStubKibanaServices } from '@kbn/embeddable-plugin/public/mocks'; -import { NotFoundPrompt } from '@kbn/shared-ux-prompt-not-found'; -import { mountWithIntl } from '@kbn/test-jest-helpers'; -import { ReactWrapper } from 'enzyme'; -import React from 'react'; -import { act } from 'react-dom/test-utils'; - -import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/common'; -import { setStubKibanaServices as setPresentationPanelMocks } from '@kbn/presentation-panel-plugin/public/mocks'; -import { BehaviorSubject } from 'rxjs'; -import { DashboardContainerFactory } from '..'; -import { DashboardCreationOptions } from '../..'; -import { DashboardContainer } from '../embeddable/dashboard_container'; -import { DashboardRenderer } from './dashboard_renderer'; - -jest.mock('../embeddable/dashboard_container_factory', () => ({})); - -describe('dashboard renderer', () => { - let mockDashboardContainer: DashboardContainer; - let mockDashboardFactory: DashboardContainerFactory; - - beforeEach(() => { - mockDashboardContainer = { - destroy: jest.fn(), - render: jest.fn(), - select: jest.fn(), - navigateToDashboard: jest.fn().mockResolvedValue({}), - getInput: jest.fn().mockResolvedValue({}), - } as unknown as DashboardContainer; - mockDashboardFactory = { - create: jest.fn().mockReturnValue(mockDashboardContainer), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockDashboardFactory); - setPresentationPanelMocks(); - }); - - test('calls create method on the Dashboard embeddable factory', async () => { - await act(async () => { - mountWithIntl(<DashboardRenderer />); - }); - expect(mockDashboardFactory.create).toHaveBeenCalled(); - }); - - test('saved object id & creation options are passed to dashboard factory', async () => { - const options: DashboardCreationOptions = { - useSessionStorageIntegration: true, - useUnifiedSearchIntegration: true, - }; - await act(async () => { - mountWithIntl( - <DashboardRenderer - savedObjectId="saved_object_kibanana" - getCreationOptions={() => Promise.resolve(options)} - /> - ); - }); - expect(mockDashboardFactory.create).toHaveBeenCalledWith( - expect.any(Object), - undefined, - options, - 'saved_object_kibanana' - ); - }); - - test('destroys dashboard container on unmount', async () => { - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - wrapper!.unmount(); - expect(mockDashboardContainer.destroy).toHaveBeenCalledTimes(1); - }); - - test('calls navigate and does not destroy dashboard container on ID change', async () => { - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - await act(async () => { - await wrapper.setProps({ savedObjectId: 'saved_object_kibanakiwi' }); - }); - expect(mockDashboardContainer.destroy).not.toHaveBeenCalled(); - expect(mockDashboardContainer.navigateToDashboard).toHaveBeenCalledWith( - 'saved_object_kibanakiwi' - ); - }); - - test('renders and destroys an error embeddable when the dashboard factory create method throws an error', async () => { - const mockErrorEmbeddable = { - error: 'oh my goodness an error', - destroy: jest.fn(), - render: jest.fn(), - } as unknown as DashboardContainer; - mockDashboardFactory = { - create: jest.fn().mockReturnValue(mockErrorEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockDashboardFactory); - - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - - expect(mockErrorEmbeddable.render).toHaveBeenCalled(); - wrapper!.unmount(); - expect(mockErrorEmbeddable.destroy).toHaveBeenCalledTimes(1); - }); - - test('creates a new dashboard container when the ID changes, and the first created dashboard resulted in an error', async () => { - // ensure that the first attempt at creating a dashboard results in an error embeddable - const mockErrorEmbeddable = { - error: 'oh my goodness an error', - destroy: jest.fn(), - render: jest.fn(), - } as unknown as DashboardContainer; - const mockErrorFactory = { - create: jest.fn().mockReturnValue(mockErrorEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockErrorFactory); - - // render the dashboard - it should run into an error and render the error embeddable. - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - expect(mockErrorEmbeddable.render).toHaveBeenCalled(); - expect(mockErrorFactory.create).toHaveBeenCalledTimes(1); - - // ensure that the next attempt at creating a dashboard is successfull. - const mockSuccessEmbeddable = { - destroy: jest.fn(), - render: jest.fn(), - navigateToDashboard: jest.fn(), - select: jest.fn(), - getInput: jest.fn().mockResolvedValue({}), - } as unknown as DashboardContainer; - const mockSuccessFactory = { - create: jest.fn().mockReturnValue(mockSuccessEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockSuccessFactory); - - // update the saved object id to trigger another dashboard load. - await act(async () => { - await wrapper.setProps({ savedObjectId: 'saved_object_kibanakiwi' }); - }); - - expect(mockErrorEmbeddable.destroy).toHaveBeenCalled(); - - // because a new dashboard container has been created, we should not call navigate. - expect(mockSuccessEmbeddable.navigateToDashboard).not.toHaveBeenCalled(); - - // instead we should call create on the factory again. - expect(mockSuccessFactory.create).toHaveBeenCalledTimes(1); - }); - - test('renders a 404 page when initial dashboard creation returns a savedObjectNotFound error', async () => { - // mock embeddable dependencies so that the embeddable panel renders - setStubKibanaServices(); - - // ensure that the first attempt at creating a dashboard results in a 404 - const mockErrorEmbeddable = { - error: new SavedObjectNotFound('dashboard', 'gat em'), - destroy: jest.fn(), - render: jest.fn(), - } as unknown as DashboardContainer; - const mockErrorFactory = { - create: jest.fn().mockReturnValue(mockErrorEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockErrorFactory); - - // render the dashboard - it should run into an error and render the error embeddable. - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - await wrapper!.update(); - - // The shared UX not found prompt should be rendered. - expect(wrapper!.find(NotFoundPrompt).exists()).toBeTruthy(); - }); - - test('renders a 404 page when dashboard navigation returns a savedObjectNotFound error', async () => { - mockDashboardContainer.navigateToDashboard = jest - .fn() - .mockRejectedValue(new SavedObjectNotFound('dashboard', 'gat em')); - - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl(<DashboardRenderer savedObjectId="saved_object_kibanana" />); - }); - // The shared UX not found prompt should not be rendered. - expect(wrapper!.find(NotFoundPrompt).exists()).toBeFalsy(); - - expect(mockDashboardContainer.render).toHaveBeenCalled(); - await act(async () => { - await wrapper.setProps({ savedObjectId: 'saved_object_kibanakiwi' }); - }); - await wrapper!.update(); - - // The shared UX not found prompt should be rendered. - expect(wrapper!.find(NotFoundPrompt).exists()).toBeTruthy(); - }); - - test('does not add a class to the parent element when expandedPanelId is undefined', async () => { - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl( - <div id="superParent"> - <DashboardRenderer /> - </div> - ); - }); - await wrapper!.update(); - - expect( - wrapper!.find('#superParent').getDOMNode().classList.contains('dshDashboardViewportWrapper') - ).toBe(false); - }); - - test('adds a class to the parent element when expandedPanelId is truthy', async () => { - const mockSuccessEmbeddable = { - destroy: jest.fn(), - render: jest.fn(), - navigateToDashboard: jest.fn(), - select: jest.fn().mockReturnValue('WhatAnExpandedPanel'), - getInput: jest.fn().mockResolvedValue({}), - expandedPanelId: new BehaviorSubject('panel1'), - } as unknown as DashboardContainer; - const mockSuccessFactory = { - create: jest.fn().mockReturnValue(mockSuccessEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockSuccessFactory); - - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl( - <div id="superParent"> - <DashboardRenderer savedObjectId="saved_object_kibanana" /> - </div> - ); - }); - - expect( - wrapper!.find('#superParent').getDOMNode().classList.contains('dshDashboardViewportWrapper') - ).toBe(true); - }); - - test('adds a class to apply default background color when dashboard has use margin option set to false', async () => { - const mockUseMarginFalseEmbeddable = { - ...mockDashboardContainer, - getInput: jest.fn().mockResolvedValue({ useMargins: false }), - } as unknown as DashboardContainer; - - const mockUseMarginFalseFactory = { - create: jest.fn().mockReturnValue(mockUseMarginFalseEmbeddable), - } as unknown as DashboardContainerFactory; - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../embeddable/dashboard_container_factory').DashboardContainerFactoryDefinition = jest - .fn() - .mockReturnValue(mockUseMarginFalseFactory); - - let wrapper: ReactWrapper; - await act(async () => { - wrapper = await mountWithIntl( - <div id="superParent"> - <DashboardRenderer savedObjectId="saved_object_kibanana" /> - </div> - ); - }); - - expect( - wrapper! - .find('#superParent') - .getDOMNode() - .classList.contains('dshDashboardViewportWrapper--defaultBg') - ).not.toBe(null); - }); -}); diff --git a/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.tsx b/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.tsx index 40b54e42e6ff..c6b5467e25be 100644 --- a/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.tsx +++ b/src/plugins/dashboard/public/dashboard_container/external_api/dashboard_renderer.tsx @@ -10,24 +10,23 @@ import '../_dashboard_container.scss'; import classNames from 'classnames'; -import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; -import useUnmount from 'react-use/lib/useUnmount'; -import { v4 as uuidv4 } from 'uuid'; +import React, { useEffect, useLayoutEffect, useRef, useState } from 'react'; import { EuiLoadingElastic, EuiLoadingSpinner } from '@elastic/eui'; -import { ErrorEmbeddable, isErrorEmbeddable } from '@kbn/embeddable-plugin/public'; import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/common'; import { useStateFromPublishingSubject } from '@kbn/presentation-publishing'; import { LocatorPublic } from '@kbn/share-plugin/common'; -import { DashboardContainerInput } from '../../../common'; -import { DashboardApi } from '../../dashboard_api/types'; -import { embeddableService, screenshotModeService } from '../../services/kibana_services'; -import type { DashboardContainer } from '../embeddable/dashboard_container'; -import { DashboardContainerFactoryDefinition } from '../embeddable/dashboard_container_factory'; +import { ExitFullScreenButtonKibanaProvider } from '@kbn/shared-ux-button-exit-full-screen'; +import { DashboardApi, DashboardInternalApi } from '../../dashboard_api/types'; +import { coreServices, screenshotModeService } from '../../services/kibana_services'; import type { DashboardCreationOptions } from '../..'; import { DashboardLocatorParams, DashboardRedirect } from '../types'; import { Dashboard404Page } from './dashboard_404'; +import { DashboardContext } from '../../dashboard_api/use_dashboard_api'; +import { DashboardViewport } from '../component/viewport/dashboard_viewport'; +import { loadDashboardApi } from '../../dashboard_api/load_dashboard_api'; +import { DashboardInternalContext } from '../../dashboard_api/use_dashboard_internal_api'; export interface DashboardRendererProps { onApiAvailable?: (api: DashboardApi) => void; @@ -46,93 +45,55 @@ export function DashboardRenderer({ locator, onApiAvailable, }: DashboardRendererProps) { - const dashboardRoot = useRef(null); const dashboardViewport = useRef(null); - const [loading, setLoading] = useState(true); - const [dashboardContainer, setDashboardContainer] = useState<DashboardContainer>(); - const [fatalError, setFatalError] = useState<ErrorEmbeddable | undefined>(); - const [dashboardMissing, setDashboardMissing] = useState(false); - - const id = useMemo(() => uuidv4(), []); + const dashboardContainer = useRef(null); + const [dashboardApi, setDashboardApi] = useState<DashboardApi | undefined>(); + const [dashboardInternalApi, setDashboardInternalApi] = useState< + DashboardInternalApi | undefined + >(); + const [error, setError] = useState<Error | undefined>(); useEffect(() => { /* In case the locator prop changes, we need to reassign the value in the container */ - if (dashboardContainer) dashboardContainer.locator = locator; - }, [dashboardContainer, locator]); + if (dashboardApi) dashboardApi.locator = locator; + }, [dashboardApi, locator]); useEffect(() => { - /** - * Here we attempt to build a dashboard or navigate to a new dashboard. Clear all error states - * if they exist in case this dashboard loads correctly. - */ - fatalError?.destroy(); - setDashboardMissing(false); - setFatalError(undefined); - - if (dashboardContainer) { - // When a dashboard already exists, don't rebuild it, just set a new id. - dashboardContainer.navigateToDashboard(savedObjectId).catch((e) => { - dashboardContainer?.destroy(); - setDashboardContainer(undefined); - setFatalError(new ErrorEmbeddable(e, { id })); - if (e instanceof SavedObjectNotFound) { - setDashboardMissing(true); - } - }); - return; - } + if (error) setError(undefined); + if (dashboardApi) setDashboardApi(undefined); + if (dashboardInternalApi) setDashboardInternalApi(undefined); - setLoading(true); let canceled = false; - (async () => { - const creationOptions = await getCreationOptions?.(); - - const dashboardFactory = new DashboardContainerFactoryDefinition(embeddableService); - const container = await dashboardFactory.create( - { id } as unknown as DashboardContainerInput, // Input from creationOptions is used instead. - undefined, - creationOptions, - savedObjectId - ); - setLoading(false); - - if (canceled || !container) { - setDashboardContainer(undefined); - container?.destroy(); - return; - } - - if (isErrorEmbeddable(container)) { - setFatalError(container); - if (container.error instanceof SavedObjectNotFound) { - setDashboardMissing(true); + let cleanupDashboardApi: (() => void) | undefined; + loadDashboardApi({ getCreationOptions, savedObjectId }) + .then((results) => { + if (!results) return; + if (canceled) { + results.cleanup(); + return; } - return; - } - if (dashboardRoot.current) { - container.render(dashboardRoot.current); - } + cleanupDashboardApi = results.cleanup; + setDashboardApi(results.api); + setDashboardInternalApi(results.internalApi); + onApiAvailable?.(results.api); + }) + .catch((err) => { + if (!canceled) setError(err); + }); - setDashboardContainer(container); - onApiAvailable?.(container as DashboardApi); - })(); return () => { + cleanupDashboardApi?.(); canceled = true; }; // Disabling exhaustive deps because embeddable should only be created on first render. // eslint-disable-next-line react-hooks/exhaustive-deps }, [savedObjectId]); - useUnmount(() => { - fatalError?.destroy(); - dashboardContainer?.destroy(); - }); - const viewportClasses = classNames( 'dashboardViewport', { 'dashboardViewport--screenshotMode': screenshotModeService.isScreenshotMode() }, - { 'dashboardViewport--loading': loading } + { 'dashboardViewport--loading': !error && !dashboardApi } ); const loadingSpinner = showPlainSpinner ? ( @@ -142,22 +103,43 @@ export function DashboardRenderer({ ); const renderDashboardContents = () => { - if (dashboardMissing) return <Dashboard404Page dashboardRedirect={dashboardRedirect} />; - if (fatalError) return fatalError.render(); - if (loading) return loadingSpinner; - return <div ref={dashboardRoot} />; + if (error) { + return error instanceof SavedObjectNotFound ? ( + <Dashboard404Page dashboardRedirect={dashboardRedirect} /> + ) : ( + error.message + ); + } + + return dashboardApi && dashboardInternalApi ? ( + <div className="dashboardContainer" ref={dashboardContainer}> + <ExitFullScreenButtonKibanaProvider + coreStart={{ chrome: coreServices.chrome, customBranding: coreServices.customBranding }} + > + <DashboardContext.Provider value={dashboardApi}> + <DashboardInternalContext.Provider value={dashboardInternalApi}> + <DashboardViewport + dashboardContainer={ + dashboardContainer.current ? dashboardContainer.current : undefined + } + /> + </DashboardInternalContext.Provider> + </DashboardContext.Provider> + </ExitFullScreenButtonKibanaProvider> + </div> + ) : ( + loadingSpinner + ); }; return ( <div ref={dashboardViewport} className={viewportClasses}> - {dashboardViewport?.current && - dashboardContainer && - !isErrorEmbeddable(dashboardContainer) && ( - <ParentClassController - viewportRef={dashboardViewport.current} - dashboardApi={dashboardContainer as DashboardApi} - /> - )} + {dashboardViewport?.current && dashboardApi && ( + <ParentClassController + viewportRef={dashboardViewport.current} + dashboardApi={dashboardApi} + /> + )} {renderDashboardContents()} </div> ); diff --git a/src/plugins/dashboard/public/dashboard_container/index.ts b/src/plugins/dashboard/public/dashboard_container/index.ts index b4ecb30f3c25..c3f1989d66cd 100644 --- a/src/plugins/dashboard/public/dashboard_container/index.ts +++ b/src/plugins/dashboard/public/dashboard_container/index.ts @@ -14,9 +14,6 @@ export const DASHBOARD_CONTAINER_TYPE = 'dashboard'; export const LATEST_DASHBOARD_CONTAINER_VERSION = convertNumberToDashboardVersion(LATEST_VERSION); -export type { DashboardContainer } from './embeddable/dashboard_container'; -export { type DashboardContainerFactory } from './embeddable/dashboard_container_factory'; - export { LazyDashboardRenderer } from './external_api/lazy_dashboard_renderer'; export type { DashboardLocatorParams } from './types'; export type { IProvidesLegacyPanelPlacementSettings } from './panel_placement'; diff --git a/src/plugins/dashboard/public/dashboard_container/panel_placement/index.ts b/src/plugins/dashboard/public/dashboard_container/panel_placement/index.ts index 81b7c7d6b38a..d90388669574 100644 --- a/src/plugins/dashboard/public/dashboard_container/panel_placement/index.ts +++ b/src/plugins/dashboard/public/dashboard_container/panel_placement/index.ts @@ -7,8 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { placePanel } from './place_panel'; - export { placeClonePanel } from './place_clone_panel_strategy'; export { registerDashboardPanelPlacementSetting } from './panel_placement_registry'; diff --git a/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.test.ts b/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.test.ts deleted file mode 100644 index 4dabd35a3567..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { DashboardPanelState } from '../../../common'; -import { EmbeddableFactory, EmbeddableInput } from '@kbn/embeddable-plugin/public'; -import { CONTACT_CARD_EMBEDDABLE } from '@kbn/embeddable-plugin/public/lib/test_samples'; -import { DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH } from '../../dashboard_constants'; - -import { placePanel } from './place_panel'; -import { IProvidesLegacyPanelPlacementSettings } from './types'; - -interface TestInput extends EmbeddableInput { - test: string; -} -const panels: { [key: string]: DashboardPanelState } = {}; - -test('adds a new panel state in 0,0 position', () => { - const { newPanel: panelState } = placePanel<TestInput>( - {} as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'hi', id: '123' }, - }, - panels - ); - expect(panelState.explicitInput.test).toBe('hi'); - expect(panelState.type).toBe(CONTACT_CARD_EMBEDDABLE); - expect(panelState.explicitInput.id).toBeDefined(); - expect(panelState.gridData.x).toBe(0); - expect(panelState.gridData.y).toBe(0); - expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - - panels[panelState.explicitInput.id] = panelState; -}); - -test('adds a second new panel state', () => { - const { newPanel: panelState } = placePanel<TestInput>( - {} as unknown as EmbeddableFactory, - { type: CONTACT_CARD_EMBEDDABLE, explicitInput: { test: 'bye', id: '456' } }, - panels - ); - - expect(panelState.gridData.x).toBe(DEFAULT_PANEL_WIDTH); - expect(panelState.gridData.y).toBe(0); - expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - - panels[panelState.explicitInput.id] = panelState; -}); - -test('adds a third new panel state', () => { - const { newPanel: panelState } = placePanel<TestInput>( - {} as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'bye', id: '789' }, - }, - panels - ); - expect(panelState.gridData.x).toBe(0); - expect(panelState.gridData.y).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - - panels[panelState.explicitInput.id] = panelState; -}); - -test('adds a new panel state in the top most position when it is open', () => { - // deleting panel 456 means that the top leftmost open position will be at the top of the Dashboard. - delete panels['456']; - const { newPanel: panelState } = placePanel<TestInput>( - {} as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'bye', id: '987' }, - }, - panels - ); - expect(panelState.gridData.x).toBe(DEFAULT_PANEL_WIDTH); - expect(panelState.gridData.y).toBe(0); - expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - - // replace the topmost panel. - panels[panelState.explicitInput.id] = panelState; -}); - -test('adds a new panel state at the very top of the Dashboard with default sizing', () => { - const embeddableFactoryStub: IProvidesLegacyPanelPlacementSettings = { - getLegacyPanelPlacementSettings: jest.fn().mockImplementation(() => { - return { strategy: 'placeAtTop' }; - }), - }; - - const { newPanel: panelState } = placePanel<TestInput>( - embeddableFactoryStub as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'wowee', id: '9001' }, - }, - panels - ); - expect(panelState.gridData.x).toBe(0); - expect(panelState.gridData.y).toBe(0); - expect(panelState.gridData.h).toBe(DEFAULT_PANEL_HEIGHT); - expect(panelState.gridData.w).toBe(DEFAULT_PANEL_WIDTH); - - expect(embeddableFactoryStub.getLegacyPanelPlacementSettings).toHaveBeenCalledWith( - { id: '9001', test: 'wowee' }, - undefined - ); -}); - -test('adds a new panel state at the very top of the Dashboard with custom sizing', () => { - const embeddableFactoryStub: IProvidesLegacyPanelPlacementSettings = { - getLegacyPanelPlacementSettings: jest.fn().mockImplementation(() => { - return { strategy: 'placeAtTop', width: 10, height: 5 }; - }), - }; - - const { newPanel: panelState } = placePanel<TestInput>( - embeddableFactoryStub as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'woweee', id: '9002' }, - }, - panels - ); - expect(panelState.gridData.x).toBe(0); - expect(panelState.gridData.y).toBe(0); - expect(panelState.gridData.h).toBe(5); - expect(panelState.gridData.w).toBe(10); - - expect(embeddableFactoryStub.getLegacyPanelPlacementSettings).toHaveBeenCalledWith( - { id: '9002', test: 'woweee' }, - undefined - ); -}); - -test('passes through given attributes', () => { - const embeddableFactoryStub: IProvidesLegacyPanelPlacementSettings = { - getLegacyPanelPlacementSettings: jest.fn().mockImplementation(() => { - return { strategy: 'placeAtTop', width: 10, height: 5 }; - }), - }; - - placePanel<TestInput>( - embeddableFactoryStub as unknown as EmbeddableFactory, - { - type: CONTACT_CARD_EMBEDDABLE, - explicitInput: { test: 'wow', id: '9004' }, - }, - panels, - { testAttr: 'hello' } - ); - - expect(embeddableFactoryStub.getLegacyPanelPlacementSettings).toHaveBeenCalledWith( - { id: '9004', test: 'wow' }, - { testAttr: 'hello' } - ); -}); diff --git a/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.ts b/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.ts deleted file mode 100644 index 488cb6f1d463..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/panel_placement/place_panel.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { PanelState, EmbeddableInput, EmbeddableFactory } from '@kbn/embeddable-plugin/public'; - -import { DashboardPanelState } from '../../../common'; -import { IProvidesLegacyPanelPlacementSettings } from './types'; -import { runPanelPlacementStrategy } from './place_new_panel_strategies'; -import { - DEFAULT_PANEL_HEIGHT, - DEFAULT_PANEL_WIDTH, - PanelPlacementStrategy, -} from '../../dashboard_constants'; - -export const providesLegacyPanelPlacementSettings = ( - value: unknown -): value is IProvidesLegacyPanelPlacementSettings => { - return Boolean((value as IProvidesLegacyPanelPlacementSettings).getLegacyPanelPlacementSettings); -}; - -export function placePanel<TEmbeddableInput extends EmbeddableInput>( - factory: EmbeddableFactory, - newPanel: PanelState<TEmbeddableInput>, - currentPanels: { [key: string]: DashboardPanelState }, - attributes?: unknown -): { - newPanel: DashboardPanelState<TEmbeddableInput>; - otherPanels: { [key: string]: DashboardPanelState }; -} { - let placementSettings = { - width: DEFAULT_PANEL_WIDTH, - height: DEFAULT_PANEL_HEIGHT, - strategy: PanelPlacementStrategy.findTopLeftMostOpenSpace, - }; - if (providesLegacyPanelPlacementSettings(factory)) { - placementSettings = { - ...placementSettings, - ...factory.getLegacyPanelPlacementSettings(newPanel.explicitInput, attributes), - }; - } - const { width, height, strategy } = placementSettings; - - const { newPanelPlacement, otherPanels } = runPanelPlacementStrategy(strategy, { - currentPanels, - height, - width, - }); - - return { - newPanel: { - gridData: { - ...newPanelPlacement, - i: newPanel.explicitInput.id, - }, - ...newPanel, - }, - otherPanels, - }; -} diff --git a/src/plugins/dashboard/public/dashboard_container/state/dashboard_container_reducers.ts b/src/plugins/dashboard/public/dashboard_container/state/dashboard_container_reducers.ts deleted file mode 100644 index c0c39b0ffd28..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/state/dashboard_container_reducers.ts +++ /dev/null @@ -1,173 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { PayloadAction } from '@reduxjs/toolkit'; - -import { isFilterPinned } from '@kbn/es-query'; -import { - DashboardReduxState, - DashboardStateFromSaveModal, - DashboardStateFromSettingsFlyout, -} from '../types'; -import { DashboardContainerInput } from '../../../common'; - -export const dashboardContainerReducers = { - // ------------------------------------------------------------------------------ - // Content Reducers - // ------------------------------------------------------------------------------ - setPanels: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['panels']> - ) => { - state.explicitInput.panels = action.payload; - }, - - // ------------------------------------------------------------------------------ - // Meta info Reducers - // ------------------------------------------------------------------------------ - setStateFromSaveModal: ( - state: DashboardReduxState, - action: PayloadAction<DashboardStateFromSaveModal> - ) => { - state.explicitInput.tags = action.payload.tags; - state.explicitInput.title = action.payload.title; - state.explicitInput.description = action.payload.description; - state.explicitInput.timeRestore = action.payload.timeRestore; - - if (action.payload.refreshInterval) { - state.explicitInput.refreshInterval = action.payload.refreshInterval; - } - if (action.payload.timeRange) { - state.explicitInput.timeRange = action.payload.timeRange; - } - }, - - setStateFromSettingsFlyout: ( - state: DashboardReduxState, - action: PayloadAction<DashboardStateFromSettingsFlyout> - ) => { - state.explicitInput.tags = action.payload.tags; - state.explicitInput.title = action.payload.title; - state.explicitInput.description = action.payload.description; - state.explicitInput.timeRestore = action.payload.timeRestore; - - state.explicitInput.useMargins = action.payload.useMargins; - state.explicitInput.syncColors = action.payload.syncColors; - state.explicitInput.syncCursor = action.payload.syncCursor; - state.explicitInput.syncTooltips = action.payload.syncTooltips; - state.explicitInput.hidePanelTitles = action.payload.hidePanelTitles; - }, - - setDescription: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['description']> - ) => { - state.explicitInput.description = action.payload; - }, - - setViewMode: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['viewMode']> - ) => { - state.explicitInput.viewMode = action.payload; - }, - - setTags: (state: DashboardReduxState, action: PayloadAction<DashboardContainerInput['tags']>) => { - state.explicitInput.tags = action.payload; - }, - - setTitle: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['title']> - ) => { - state.explicitInput.title = action.payload; - }, - - /** - * Resets the dashboard to the last saved input, excluding: - * 1) The time range, unless `timeRestore` is `true` - if we include the time range on reset even when - * `timeRestore` is `false`, this causes unecessary data fetches for the control group. - * 2) The view mode, since resetting should never impact this - sometimes the Dashboard saved objects - * have this saved in and we don't want resetting to cause unexpected view mode changes. - * 3) Pinned filters. - */ - resetToLastSavedInput: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput> - ) => { - const keepPinnedFilters = [ - ...state.explicitInput.filters.filter(isFilterPinned), - ...action.payload.filters, - ]; - - state.explicitInput = { - ...action.payload, - filters: keepPinnedFilters, - ...(!state.explicitInput.timeRestore && { timeRange: state.explicitInput.timeRange }), - viewMode: state.explicitInput.viewMode, - }; - }, - - // ------------------------------------------------------------------------------ - // Filtering Reducers - // ------------------------------------------------------------------------------ - setFiltersAndQuery: ( - state: DashboardReduxState, - action: PayloadAction<Pick<DashboardContainerInput, 'filters' | 'query'>> - ) => { - state.explicitInput.filters = action.payload.filters; - state.explicitInput.query = action.payload.query; - }, - - setLastReloadRequestTimeToNow: (state: DashboardReduxState) => { - state.explicitInput.lastReloadRequestTime = new Date().getTime(); - }, - - setFilters: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['filters']> - ) => { - state.explicitInput.filters = action.payload; - }, - - setQuery: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['query']> - ) => { - state.explicitInput.query = action.payload; - }, - - setTimeRestore: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['timeRestore']> - ) => { - state.explicitInput.timeRestore = action.payload; - }, - - setTimeRange: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['timeRange']> - ) => { - state.explicitInput.timeRange = action.payload; - }, - - setRefreshInterval: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['refreshInterval']> - ) => { - state.explicitInput.refreshInterval = action.payload; - }, - - setTimeslice: ( - state: DashboardReduxState, - action: PayloadAction<DashboardContainerInput['timeslice']> - ) => { - state.explicitInput.timeslice = action.payload; - }, -}; diff --git a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_functions.ts b/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_functions.ts deleted file mode 100644 index 2803d9be0e32..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_functions.ts +++ /dev/null @@ -1,135 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import fastIsEqual from 'fast-deep-equal'; - -import { COMPARE_ALL_OPTIONS, compareFilters, isFilterPinned } from '@kbn/es-query'; - -import { DashboardContainerInput } from '../../../../common'; -import { embeddableService } from '../../../services/kibana_services'; -import { DashboardContainer } from '../../embeddable/dashboard_container'; -import { DashboardContainerInputWithoutId } from '../../types'; -import { areTimesEqual, getPanelLayoutsAreEqual } from './dashboard_diffing_utils'; - -export interface DiffFunctionProps<Key extends keyof DashboardContainerInput> { - currentValue: DashboardContainerInput[Key]; - lastValue: DashboardContainerInput[Key]; - - currentInput: DashboardContainerInputWithoutId; - lastInput: DashboardContainerInputWithoutId; - container: DashboardContainer; -} - -export type DashboardDiffFunctions = { - [key in keyof Partial<DashboardContainerInput>]: ( - props: DiffFunctionProps<key> - ) => boolean | Promise<boolean>; -}; - -export const isKeyEqualAsync = async ( - key: keyof DashboardContainerInput, - diffFunctionProps: DiffFunctionProps<typeof key>, - diffingFunctions: DashboardDiffFunctions -) => { - const propsAsNever = diffFunctionProps as never; // todo figure out why props has conflicting types in some constituents. - const diffingFunction = diffingFunctions[key]; - if (diffingFunction) { - return diffingFunction?.prototype?.name === 'AsyncFunction' - ? await diffingFunction(propsAsNever) - : diffingFunction(propsAsNever); - } - return fastIsEqual(diffFunctionProps.currentValue, diffFunctionProps.lastValue); -}; - -export const isKeyEqual = ( - key: keyof Omit<DashboardContainerInput, 'panels'>, // only Panels is async - diffFunctionProps: DiffFunctionProps<typeof key>, - diffingFunctions: DashboardDiffFunctions -) => { - const propsAsNever = diffFunctionProps as never; // todo figure out why props has conflicting types in some constituents. - const diffingFunction = diffingFunctions[key]; - if (!diffingFunction) { - return fastIsEqual(diffFunctionProps.currentValue, diffFunctionProps.lastValue); - } - - if (diffingFunction?.prototype?.name === 'AsyncFunction') { - throw new Error( - `The function for key "${key}" is async, must use isKeyEqualAsync for asynchronous functions` - ); - } - return diffingFunction(propsAsNever); -}; - -/** - * A collection of functions which diff individual keys of dashboard state. If a key is missing from this list it is - * diffed by the default diffing function, fastIsEqual. - */ -export const unsavedChangesDiffingFunctions: DashboardDiffFunctions = { - panels: async ({ currentValue, lastValue, container }) => { - if (!getPanelLayoutsAreEqual(currentValue ?? {}, lastValue ?? {})) return false; - - const explicitInputComparePromises = Object.values(currentValue ?? {}).map( - (panel) => - new Promise<boolean>((resolve, reject) => { - const embeddableId = panel.explicitInput.id; - if (!embeddableId || embeddableService.reactEmbeddableRegistryHasKey(panel.type)) { - // if this is a new style embeddable, it will handle its own diffing. - reject(); - return; - } - try { - container.untilEmbeddableLoaded(embeddableId).then((embeddable) => - embeddable - .getExplicitInputIsEqual(lastValue[embeddableId].explicitInput) - .then((isEqual) => { - if (isEqual) { - // rejecting the promise if the input is equal. - reject(); - } else { - // resolving false here means that the panel is unequal. The first promise to resolve this way will return false from this function. - resolve(false); - } - }) - ); - } catch (e) { - reject(); - } - }) - ); - - // If any promise resolves, return false. The catch here is only called if all promises reject which means all panels are equal. - return await Promise.any(explicitInputComparePromises).catch(() => true); - }, - - // exclude pinned filters from comparision because pinned filters are not part of application state - filters: ({ currentValue, lastValue }) => - compareFilters( - (currentValue ?? []).filter((f) => !isFilterPinned(f)), - (lastValue ?? []).filter((f) => !isFilterPinned(f)), - COMPARE_ALL_OPTIONS - ), - - timeRange: ({ currentValue, lastValue, currentInput }) => { - if (!currentInput.timeRestore) return true; // if time restore is set to false, time range doesn't count as a change. - if ( - !areTimesEqual(currentValue?.from, lastValue?.from) || - !areTimesEqual(currentValue?.to, lastValue?.to) - ) { - return false; - } - return true; - }, - - refreshInterval: ({ currentValue, lastValue, currentInput }) => { - if (!currentInput.timeRestore) return true; // if time restore is set to false, refresh interval doesn't count as a change. - return fastIsEqual(currentValue, lastValue); - }, - - viewMode: () => false, // When compared view mode is always considered unequal so that it gets backed up. -}; diff --git a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_integration.ts b/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_integration.ts deleted file mode 100644 index ad33b2e5fb11..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_integration.ts +++ /dev/null @@ -1,198 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ -import { childrenUnsavedChanges$ } from '@kbn/presentation-containers'; -import { omit } from 'lodash'; -import { AnyAction, Middleware } from 'redux'; -import { combineLatest, debounceTime, skipWhile, startWith, switchMap } from 'rxjs'; -import { DashboardContainer } from '../..'; -import { DashboardCreationOptions } from '../../..'; -import { DashboardContainerInput } from '../../../../common'; -import { CHANGE_CHECK_DEBOUNCE } from '../../../dashboard_constants'; -import { - PANELS_CONTROL_GROUP_KEY, - getDashboardBackupService, -} from '../../../services/dashboard_backup_service'; -import { UnsavedPanelState } from '../../types'; -import { dashboardContainerReducers } from '../dashboard_container_reducers'; -import { isKeyEqualAsync, unsavedChangesDiffingFunctions } from './dashboard_diffing_functions'; - -/** - * An array of reducers which cannot cause unsaved changes. Unsaved changes only compares the explicit input - * and the last saved input, so we can safely ignore any output reducers, and most componentState reducers. - * This is only for performance reasons, because the diffing function itself can be quite heavy. - */ -export const reducersToIgnore: Array<keyof typeof dashboardContainerReducers> = ['setTimeslice']; - -/** - * Some keys will often have deviated from their last saved state, but should not persist over reloads - */ -const keysToOmitFromSessionStorage: Array<keyof DashboardContainerInput> = [ - 'lastReloadRequestTime', - 'executionContext', - 'timeslice', - 'id', - - 'timeRange', // Current behaviour expects time range not to be backed up. Revisit this? - 'refreshInterval', -]; - -/** - * Some keys will often have deviated from their last saved state, but should be - * ignored when calculating whether or not this dashboard has unsaved changes. - */ -export const keysNotConsideredUnsavedChanges: Array<keyof DashboardContainerInput> = [ - 'lastReloadRequestTime', - 'executionContext', - 'timeslice', - 'viewMode', - 'id', -]; - -/** - * build middleware that fires an event any time a reducer that could cause unsaved changes is run - */ -export function getDiffingMiddleware(this: DashboardContainer) { - const diffingMiddleware: Middleware<AnyAction> = (store) => (next) => (action) => { - const dispatchedActionName = action.type.split('/')?.[1]; - if ( - dispatchedActionName && - dispatchedActionName !== 'updateEmbeddableReduxOutput' && // ignore any generic output updates. - !reducersToIgnore.includes(dispatchedActionName) - ) { - this.anyReducerRun.next(null); - } - next(action); - }; - return diffingMiddleware; -} - -/** - * Does an initial diff between @param initialInput and @param initialLastSavedInput, and creates a middleware - * which listens to the redux store and pushes updates to the `hasUnsavedChanges` and `backupUnsavedChanges` behaviour - * subjects so that the corresponding subscriptions can dispatch updates as necessary - */ -export function startDiffingDashboardState( - this: DashboardContainer, - creationOptions?: DashboardCreationOptions -) { - /** - * Create an observable stream that checks for unsaved changes in the Dashboard state - * and the state of all of its legacy embeddable children. - */ - const dashboardUnsavedChanges = combineLatest([ - this.anyReducerRun.pipe(startWith(null)), - this.lastSavedInput$, - ]).pipe( - debounceTime(CHANGE_CHECK_DEBOUNCE), - switchMap(([, lastSavedInput]) => { - return (async () => { - const { explicitInput: currentInput } = this.getState(); - const unsavedChanges = await getDashboardUnsavedChanges.bind(this)( - lastSavedInput, - currentInput - ); - return unsavedChanges; - })(); - }) - ); - - /** - * Combine unsaved changes from all sources together. Set unsaved changes state and backup unsaved changes when any of the sources emit. - */ - this.diffingSubscription.add( - combineLatest([ - dashboardUnsavedChanges, - childrenUnsavedChanges$(this.children$), - this.controlGroupApi$.pipe( - skipWhile((controlGroupApi) => !controlGroupApi), - switchMap((controlGroupApi) => { - return controlGroupApi!.unsavedChanges; - }) - ), - ]).subscribe(([dashboardChanges, unsavedPanelState, controlGroupChanges]) => { - // calculate unsaved changes - const hasUnsavedChanges = - Object.keys(omit(dashboardChanges, keysNotConsideredUnsavedChanges)).length > 0 || - unsavedPanelState !== undefined || - controlGroupChanges !== undefined; - if (hasUnsavedChanges !== this.hasUnsavedChanges$.value) { - this.setHasUnsavedChanges(hasUnsavedChanges); - } - - // backup unsaved changes if configured to do so - if (creationOptions?.useSessionStorageIntegration) { - const reactEmbeddableChanges = unsavedPanelState ? { ...unsavedPanelState } : {}; - if (controlGroupChanges) { - reactEmbeddableChanges[PANELS_CONTROL_GROUP_KEY] = controlGroupChanges; - } - backupUnsavedChanges.bind(this)(dashboardChanges, reactEmbeddableChanges); - } - }) - ); -} - -/** - * Does a shallow diff between @param lastInput and @param input and - * @returns an object out of the keys which are different. - */ -export async function getDashboardUnsavedChanges( - this: DashboardContainer, - lastInput: DashboardContainerInput, - input: DashboardContainerInput -): Promise<Partial<DashboardContainerInput>> { - const allKeys = [...new Set([...Object.keys(lastInput), ...Object.keys(input)])] as Array< - keyof DashboardContainerInput - >; - const keyComparePromises = allKeys.map( - (key) => - new Promise<{ key: keyof DashboardContainerInput; isEqual: boolean }>((resolve) => { - if (input[key] === undefined && lastInput[key] === undefined) { - resolve({ key, isEqual: true }); - } - isKeyEqualAsync( - key, - { - container: this, - - currentValue: input[key], - currentInput: input, - - lastValue: lastInput[key], - lastInput, - }, - unsavedChangesDiffingFunctions - ).then((isEqual) => resolve({ key, isEqual })); - }) - ); - const inputChanges = (await Promise.allSettled(keyComparePromises)).reduce((changes, current) => { - if (current.status === 'fulfilled') { - const { key, isEqual } = current.value; - if (!isEqual) (changes as { [key: string]: unknown })[key] = input[key]; - } - return changes; - }, {} as Partial<DashboardContainerInput>); - return inputChanges; -} - -function backupUnsavedChanges( - this: DashboardContainer, - dashboardChanges: Partial<DashboardContainerInput>, - reactEmbeddableChanges: UnsavedPanelState -) { - const dashboardStateToBackup = omit(dashboardChanges, keysToOmitFromSessionStorage); - - getDashboardBackupService().setState( - this.savedObjectId.value, - { - ...dashboardStateToBackup, - panels: dashboardChanges.panels, - }, - reactEmbeddableChanges - ); -} diff --git a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_utils.ts b/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_utils.ts deleted file mode 100644 index 5b13239da174..000000000000 --- a/src/plugins/dashboard/public/dashboard_container/state/diffing/dashboard_diffing_utils.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { isEmpty, xor } from 'lodash'; -import moment, { Moment } from 'moment'; -import fastIsEqual from 'fast-deep-equal'; - -import { DashboardPanelMap } from '../../../../common'; - -const convertTimeToUTCString = (time?: string | Moment): undefined | string => { - if (moment(time).isValid()) { - return moment(time).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]'); - } else { - // If it's not a valid moment date, then it should be a string representing a relative time - // like 'now' or 'now-15m'. - return time as string; - } -}; - -export const areTimesEqual = ( - timeA?: string | Moment | undefined, - timeB?: string | Moment | undefined -) => { - return convertTimeToUTCString(timeA) === convertTimeToUTCString(timeB); -}; - -export const defaultDiffFunction = (a: unknown, b: unknown) => fastIsEqual(a, b); - -/** - * Checks whether the panel maps have the same keys, and if they do, whether all of the other keys inside each panel - * are equal. Skips explicit input as that needs to be handled asynchronously. - */ -export const getPanelLayoutsAreEqual = ( - originalPanels: DashboardPanelMap, - newPanels: DashboardPanelMap -) => { - const originalEmbeddableIds = Object.keys(originalPanels); - const newEmbeddableIds = Object.keys(newPanels); - - const embeddableIdDiff = xor(originalEmbeddableIds, newEmbeddableIds); - if (embeddableIdDiff.length > 0) { - return false; - } - const commonPanelDiff = <T>(originalObj: Partial<T>, newObj: Partial<T>) => { - const differences: Partial<T> = {}; - const keys = [ - ...new Set([ - ...(Object.keys(originalObj) as Array<keyof T>), - ...(Object.keys(newObj) as Array<keyof T>), - ]), - ]; - for (const key of keys) { - if (key === undefined) continue; - if (!defaultDiffFunction(originalObj[key], newObj[key])) differences[key] = newObj[key]; - } - return differences; - }; - - for (const embeddableId of newEmbeddableIds) { - const { - explicitInput: originalExplicitInput, - panelRefName: panelRefA, - ...commonPanelDiffOriginal - } = originalPanels[embeddableId]; - const { - explicitInput: newExplicitInput, - panelRefName: panelRefB, - ...commonPanelDiffNew - } = newPanels[embeddableId]; - - if (!isEmpty(commonPanelDiff(commonPanelDiffOriginal, commonPanelDiffNew))) return false; - } - return true; -}; diff --git a/src/plugins/dashboard/public/dashboard_container/types.ts b/src/plugins/dashboard/public/dashboard_container/types.ts index cf307924e00f..eac2a782f11c 100644 --- a/src/plugins/dashboard/public/dashboard_container/types.ts +++ b/src/plugins/dashboard/public/dashboard_container/types.ts @@ -8,7 +8,6 @@ */ import type { ContainerOutput } from '@kbn/embeddable-plugin/public'; -import type { ReduxEmbeddableState } from '@kbn/presentation-util-plugin/public'; import { SerializableRecord } from '@kbn/utility-types'; import { ControlGroupRuntimeState } from '@kbn/controls-plugin/public'; @@ -19,11 +18,6 @@ export interface UnsavedPanelState { [key: string]: object | undefined; } -export type DashboardReduxState = ReduxEmbeddableState< - DashboardContainerInput, - DashboardContainerOutput ->; - export type DashboardRedirect = (props: RedirectToProps) => void; export type RedirectToProps = | { destination: 'dashboard'; id?: string; useReplace?: boolean; editMode?: boolean } @@ -31,7 +25,7 @@ export type RedirectToProps = export type DashboardStateFromSaveModal = Pick< DashboardContainerInput, - 'title' | 'description' | 'tags' | 'timeRestore' | 'timeRange' | 'refreshInterval' + 'title' | 'description' | 'tags' | 'timeRestore' >; export type DashboardStateFromSettingsFlyout = DashboardStateFromSaveModal & DashboardOptions; diff --git a/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx b/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx index f3dac2e9bb62..a2adea2470ab 100644 --- a/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx +++ b/src/plugins/dashboard/public/dashboard_listing/confirm_overlays.tsx @@ -112,7 +112,7 @@ export const confirmCreateWithUnsaved = ( </div> </EuiOutsideClickDetector> </EuiFocusTrap>, - { analytics: coreServices.analytics, i18n: coreServices.i18n, theme: coreServices.theme } + coreServices ), { 'data-test-subj': 'dashboardCreateConfirmModal', 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 index 0c3b4b583e8b..75e46e0e2331 100644 --- 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 @@ -8,16 +8,19 @@ */ import React from 'react'; -import { BehaviorSubject } from 'rxjs'; import { render } from '@testing-library/react'; -import { buildMockDashboard } from '../mocks'; +import { buildMockDashboardApi } from '../mocks'; import { InternalDashboardTopNav } from './internal_dashboard_top_nav'; import { setMockedPresentationUtilServices } from '@kbn/presentation-util-plugin/public/mocks'; import { TopNavMenuProps } from '@kbn/navigation-plugin/public'; import { DashboardContext } from '../dashboard_api/use_dashboard_api'; -import { DashboardApi } from '../dashboard_api/types'; import { dataService, navigationService } from '../services/kibana_services'; +jest.mock('../dashboard_app/top_nav/dashboard_editing_toolbar', () => ({ + DashboardEditingToolbar: () => { + return <div>mockDashboardEditingToolbar</div>; + }, +})); describe('Internal dashboard top nav', () => { const mockTopNav = (badges: TopNavMenuProps['badges'] | undefined[]) => { if (badges) { @@ -41,7 +44,7 @@ describe('Internal dashboard top nav', () => { it('should not render the managed badge by default', async () => { const component = render( - <DashboardContext.Provider value={buildMockDashboard() as DashboardApi}> + <DashboardContext.Provider value={buildMockDashboardApi().api}> <InternalDashboardTopNav redirectTo={jest.fn()} /> </DashboardContext.Provider> ); @@ -50,11 +53,11 @@ describe('Internal dashboard top nav', () => { }); it('should render the managed badge when the dashboard is managed', async () => { - const container = buildMockDashboard(); + const { api } = buildMockDashboardApi(); const dashboardApi = { - ...container, - managed$: new BehaviorSubject(true), - } as unknown as DashboardApi; + ...api, + isManaged: true, + }; const component = render( <DashboardContext.Provider value={dashboardApi}> <InternalDashboardTopNav redirectTo={jest.fn()} /> 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 47a84b620ede..0511c13f9032 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 @@ -87,10 +87,8 @@ export function InternalDashboardTopNav({ allDataViews, focusedPanelId, fullScreenMode, - hasRunMigrations, hasUnsavedChanges, lastSavedId, - managed, query, title, viewMode, @@ -98,10 +96,8 @@ export function InternalDashboardTopNav({ dashboardApi.dataViews, dashboardApi.focusedPanelId$, dashboardApi.fullScreenMode$, - dashboardApi.hasRunMigrations$, dashboardApi.hasUnsavedChanges$, dashboardApi.savedObjectId, - dashboardApi.managed$, dashboardApi.query$, dashboardApi.panelTitle, dashboardApi.viewMode @@ -269,22 +265,9 @@ export function InternalDashboardTopNav({ } as EuiToolTipProps, }); } - if (hasRunMigrations && viewMode === 'edit') { - allBadges.push({ - 'data-test-subj': 'dashboardSaveRecommendedBadge', - badgeText: unsavedChangesBadgeStrings.getHasRunMigrationsText(), - title: '', - color: 'success', - iconType: 'save', - toolTipProps: { - content: unsavedChangesBadgeStrings.getHasRunMigrationsToolTipContent(), - position: 'bottom', - } as EuiToolTipProps, - }); - } const { showWriteControls } = getDashboardCapabilities(); - if (showWriteControls && managed) { + if (showWriteControls && dashboardApi.isManaged) { const badgeProps = { ...getManagedContentBadge(dashboardManagedBadge.getBadgeAriaLabel()), onClick: () => setIsPopoverOpen(!isPopoverOpen), @@ -311,9 +294,7 @@ export function InternalDashboardTopNav({ <EuiLink id="dashboardManagedContentPopoverButton" onClick={() => { - dashboardApi - .runInteractiveSave(viewMode) - .then((result) => maybeRedirect(result)); + dashboardApi.runInteractiveSave().then((result) => maybeRedirect(result)); }} aria-label={dashboardManagedBadge.getDuplicateButtonAriaLabel()} > @@ -332,15 +313,7 @@ export function InternalDashboardTopNav({ }); } return allBadges; - }, [ - hasUnsavedChanges, - viewMode, - hasRunMigrations, - managed, - isPopoverOpen, - dashboardApi, - maybeRedirect, - ]); + }, [hasUnsavedChanges, viewMode, isPopoverOpen, dashboardApi, maybeRedirect]); return ( <div className="dashboardTopNav"> diff --git a/src/plugins/dashboard/public/mocks.tsx b/src/plugins/dashboard/public/mocks.tsx index 2374788e60ea..1a275d805e5e 100644 --- a/src/plugins/dashboard/public/mocks.tsx +++ b/src/plugins/dashboard/public/mocks.tsx @@ -7,14 +7,14 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { EmbeddableInput, ViewMode } from '@kbn/embeddable-plugin/public'; -import { mockedReduxEmbeddablePackage } from '@kbn/presentation-util-plugin/public/mocks'; - import { ControlGroupApi } from '@kbn/controls-plugin/public'; import { BehaviorSubject } from 'rxjs'; -import { DashboardContainerInput, DashboardPanelState } from '../common'; -import { DashboardContainer } from './dashboard_container/embeddable/dashboard_container'; +import { ViewMode } from '@kbn/embeddable-plugin/public'; import { DashboardStart } from './plugin'; +import { DashboardState } from './dashboard_api/types'; +import { getDashboardApi } from './dashboard_api/get_dashboard_api'; +import { DashboardPanelState } from '../common'; +import { SavedDashboardInput } from './services/dashboard_content_management_service/types'; export type Start = jest.Mocked<DashboardStart>; @@ -78,37 +78,36 @@ export const mockControlGroupApi = { unsavedChanges: new BehaviorSubject(undefined), } as unknown as ControlGroupApi; -export function buildMockDashboard({ +export function buildMockDashboardApi({ overrides, savedObjectId, }: { - overrides?: Partial<DashboardContainerInput>; + overrides?: Partial<DashboardState>; savedObjectId?: string; } = {}) { - const initialInput = getSampleDashboardInput(overrides); - const dashboardContainer = new DashboardContainer( - initialInput, - mockedReduxEmbeddablePackage, - undefined, - undefined, - undefined, - undefined, - { - anyMigrationRun: false, - isEmbeddedExternally: false, - lastSavedInput: initialInput, - lastSavedId: savedObjectId, + const initialState = getSampleDashboardState(overrides); + const results = getDashboardApi({ + initialState, + savedObjectId, + savedObjectResult: { + dashboardFound: true, + newDashboardCreated: savedObjectId === undefined, + dashboardId: savedObjectId, managed: false, - fullScreenMode: false, - } - ); - dashboardContainer?.setControlGroupApi(mockControlGroupApi); - return dashboardContainer; + dashboardInput: { + ...initialState, + executionContext: { type: 'dashboard' }, + viewMode: initialState.viewMode as ViewMode, + id: savedObjectId ?? '123', + } as SavedDashboardInput, + references: [], + }, + }); + results.internalApi.setControlGroupApi(mockControlGroupApi); + return results; } -export function getSampleDashboardInput( - overrides?: Partial<DashboardContainerInput> -): DashboardContainerInput { +export function getSampleDashboardState(overrides?: Partial<DashboardState>): DashboardState { return { // options useMargins: true, @@ -117,7 +116,6 @@ export function getSampleDashboardInput( syncTooltips: false, hidePanelTitles: false, - id: '123', tags: [], filters: [], title: 'My Dashboard', @@ -130,17 +128,14 @@ export function getSampleDashboardInput( from: 'now-15m', }, timeRestore: false, - viewMode: ViewMode.VIEW, + viewMode: 'view', panels: {}, - executionContext: { - type: 'dashboard', - }, ...overrides, }; } -export function getSampleDashboardPanel<TEmbeddableInput extends EmbeddableInput = EmbeddableInput>( - overrides: Partial<DashboardPanelState<TEmbeddableInput>> & { +export function getSampleDashboardPanel( + overrides: Partial<DashboardPanelState> & { explicitInput: { id: string }; type: string; } diff --git a/src/plugins/dashboard/public/services/dashboard_backup_service.ts b/src/plugins/dashboard/public/services/dashboard_backup_service.ts index 5ffff35ff3d7..eab90df27b6a 100644 --- a/src/plugins/dashboard/public/services/dashboard_backup_service.ts +++ b/src/plugins/dashboard/public/services/dashboard_backup_service.ts @@ -10,15 +10,15 @@ import { isEqual } from 'lodash'; import { firstValueFrom } from 'rxjs'; -import { ViewMode } from '@kbn/embeddable-plugin/public'; import { Storage } from '@kbn/kibana-utils-plugin/public'; import { set } from '@kbn/safer-lodash-set'; -import type { DashboardContainerInput } from '../../common'; +import { ViewMode } from '@kbn/presentation-publishing'; import { backupServiceStrings } from '../dashboard_container/_dashboard_container_strings'; import { UnsavedPanelState } from '../dashboard_container/types'; import { coreServices, spacesService } from './kibana_services'; -import { SavedDashboardInput } from './dashboard_content_management_service/types'; +import { DashboardState } from '../dashboard_api/types'; +import { DEFAULT_DASHBOARD_INPUT } from '../dashboard_constants'; export const DASHBOARD_PANELS_UNSAVED_ID = 'unsavedDashboard'; export const PANELS_CONTROL_GROUP_KEY = 'controlGroup'; @@ -32,13 +32,13 @@ interface DashboardBackupServiceType { clearState: (id?: string) => void; getState: (id: string | undefined) => | { - dashboardState?: Partial<SavedDashboardInput>; + dashboardState?: Partial<DashboardState>; panels?: UnsavedPanelState; } | undefined; setState: ( id: string | undefined, - dashboardState: Partial<SavedDashboardInput>, + dashboardState: Partial<DashboardState>, panels: UnsavedPanelState ) => void; getViewMode: () => ViewMode; @@ -67,7 +67,7 @@ class DashboardBackupService implements DashboardBackupServiceType { } public getViewMode = (): ViewMode => { - return this.localStorage.get(DASHBOARD_VIEWMODE_LOCAL_KEY); + return this.localStorage.get(DASHBOARD_VIEWMODE_LOCAL_KEY) ?? DEFAULT_DASHBOARD_INPUT.viewMode; }; public storeViewMode = (viewMode: ViewMode) => { @@ -112,7 +112,7 @@ class DashboardBackupService implements DashboardBackupServiceType { try { const dashboardState = this.sessionStorage.get(DASHBOARD_STATE_SESSION_KEY)?.[ this.activeSpaceId - ]?.[id] as Partial<DashboardContainerInput> | undefined; + ]?.[id] as Partial<DashboardState> | undefined; const panels = this.sessionStorage.get(DASHBOARD_PANELS_SESSION_KEY)?.[this.activeSpaceId]?.[ id ] as UnsavedPanelState | undefined; @@ -128,7 +128,7 @@ class DashboardBackupService implements DashboardBackupServiceType { public setState( id = DASHBOARD_PANELS_UNSAVED_ID, - newState: Partial<DashboardContainerInput>, + newState: Partial<DashboardState>, unsavedPanels: UnsavedPanelState ) { try { @@ -159,7 +159,7 @@ class DashboardBackupService implements DashboardBackupServiceType { [...Object.keys(panelStatesInSpace), ...Object.keys(dashboardStatesInSpace)].map( (dashboardId) => { if ( - dashboardStatesInSpace[dashboardId].viewMode === ViewMode.EDIT && + dashboardStatesInSpace[dashboardId].viewMode === 'edit' && (Object.keys(dashboardStatesInSpace[dashboardId]).some( (stateKey) => stateKey !== 'viewMode' ) || diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.test.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.test.ts index e03a078e0df4..b0c470de8812 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.test.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.test.ts @@ -8,7 +8,6 @@ */ import { getDashboardContentManagementCache } from '..'; -import { getSampleDashboardInput } from '../../../mocks'; import { contentManagementService } from '../../kibana_services'; import { loadDashboardState } from './load_dashboard_state'; @@ -33,8 +32,7 @@ describe('Load dashboard state', () => { }); contentManagementService.client.get = jest.fn(); dashboardContentManagementCache.addDashboard = jest.fn(); - - const { id } = getSampleDashboardInput(); + const id = '123'; const result = await loadDashboardState({ id, }); @@ -61,9 +59,8 @@ describe('Load dashboard state', () => { }, }); }); - const { id } = getSampleDashboardInput(); await loadDashboardState({ - id, + id: '123', }); expect(dashboardContentManagementCache.fetchDashboard).toBeCalled(); expect(dashboardContentManagementCache.addDashboard).not.toBeCalled(); diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts index 2694411ed001..9773291b2ca5 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/load_dashboard_state.ts @@ -14,8 +14,8 @@ import { injectSearchSourceReferences } from '@kbn/data-plugin/public'; import { ViewMode } from '@kbn/embeddable-plugin/public'; import { Filter, Query } from '@kbn/es-query'; import { SavedObjectNotFound } from '@kbn/kibana-utils-plugin/public'; -import { cleanFiltersForSerialize } from '@kbn/presentation-util-plugin/public'; +import { cleanFiltersForSerialize } from '../../../utils/clean_filters_for_serialize'; import { getDashboardContentManagementCache } from '..'; import { convertPanelsArrayToPanelMap, injectReferences } from '../../../../common'; import type { DashboardGetIn, DashboardGetOut } from '../../../../server/content_management'; @@ -32,7 +32,6 @@ import type { LoadDashboardReturn, } from '../types'; import { convertNumberToDashboardVersion } from './dashboard_versioning'; -import { migrateDashboardInput } from './migrate_dashboard_input'; export function migrateLegacyQuery(query: Query | { [key: string]: any } | string): Query { // Lucene was the only option before, so language-less queries are all lucene @@ -171,34 +170,32 @@ export const loadDashboardState = async ({ const panelMap = convertPanelsArrayToPanelMap(panels ?? []); - const { dashboardInput, anyMigrationRun } = migrateDashboardInput({ - ...DEFAULT_DASHBOARD_INPUT, - ...options, - - id: embeddableId, - refreshInterval, - timeRestore, - description, - timeRange, - filters, - panels: panelMap, - query, - title, - - viewMode: ViewMode.VIEW, // dashboards loaded from saved object default to view mode. If it was edited recently, the view mode from session storage will override this. - tags: savedObjectsTaggingService?.getTaggingApi()?.ui.getTagIdsFromReferences(references) ?? [], - - controlGroupInput: attributes.controlGroupInput, - - ...(version && { version: convertNumberToDashboardVersion(version) }), - }); - return { managed, references, resolveMeta, - dashboardInput, - anyMigrationRun, + dashboardInput: { + ...DEFAULT_DASHBOARD_INPUT, + ...options, + + id: embeddableId, + refreshInterval, + timeRestore, + description, + timeRange, + filters, + panels: panelMap, + query, + title, + + viewMode: ViewMode.VIEW, // dashboards loaded from saved object default to view mode. If it was edited recently, the view mode from session storage will override this. + tags: + savedObjectsTaggingService?.getTaggingApi()?.ui.getTagIdsFromReferences(references) ?? [], + + controlGroupInput: attributes.controlGroupInput, + + ...(version && { version: convertNumberToDashboardVersion(version) }), + }, dashboardFound: true, dashboardId: savedObjectId, }; diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts deleted file mode 100644 index ad0a5cc386b2..000000000000 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.test.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { getSampleDashboardInput, getSampleDashboardPanel } from '../../../mocks'; -import { embeddableService } from '../../kibana_services'; -import { SavedDashboardInput } from '../types'; -import { migrateDashboardInput } from './migrate_dashboard_input'; - -jest.mock('@kbn/embeddable-plugin/public', () => { - return { - ...jest.requireActual('@kbn/embeddable-plugin/public'), - runEmbeddableFactoryMigrations: jest - .fn() - .mockImplementation((input) => ({ input, migrationRun: true })), - }; -}); - -describe('Migrate dashboard input', () => { - it('should run factory migrations on all Dashboard content', () => { - const dashboardInput: SavedDashboardInput = getSampleDashboardInput(); - dashboardInput.panels = { - panel1: getSampleDashboardPanel({ type: 'superLens', explicitInput: { id: 'panel1' } }), - panel2: getSampleDashboardPanel({ type: 'superLens', explicitInput: { id: 'panel2' } }), - panel3: getSampleDashboardPanel({ type: 'ultraDiscover', explicitInput: { id: 'panel3' } }), - panel4: getSampleDashboardPanel({ type: 'ultraDiscover', explicitInput: { id: 'panel4' } }), - }; - - embeddableService.getEmbeddableFactory = jest.fn(() => ({ - latestVersion: '1.0.0', - migrations: {}, - })) as unknown as typeof embeddableService.getEmbeddableFactory; - - const result = migrateDashboardInput(dashboardInput); - - // migration run should be true because the runEmbeddableFactoryMigrations mock above returns true. - expect(result.anyMigrationRun).toBe(true); - - expect(embeddableService.getEmbeddableFactory).toHaveBeenCalledTimes(4); // should be called 4 times for the panels, and 3 times for the controls - expect(embeddableService.getEmbeddableFactory).toHaveBeenCalledWith('superLens'); - expect(embeddableService.getEmbeddableFactory).toHaveBeenCalledWith('ultraDiscover'); - }); -}); diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.ts deleted file mode 100644 index b0cfac9f97ce..000000000000 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/migrate_dashboard_input.ts +++ /dev/null @@ -1,54 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - EmbeddableFactoryNotFoundError, - runEmbeddableFactoryMigrations, -} from '@kbn/embeddable-plugin/public'; -import { DashboardContainerInput, DashboardPanelState } from '../../../../common'; -import { embeddableService } from '../../kibana_services'; -import { SavedDashboardInput } from '../types'; - -/** - * Run Dashboard migrations clientside. We pre-emptively run all migrations for all content on this Dashboard so that - * we can ensure the `last saved state` which eventually resides in the Dashboard public state is fully migrated. - * This prevents the reset button from un-migrating the panels on the Dashboard. This also means that the migrations may - * get skipped at Embeddable create time - unless states with older versions are saved in the URL or session storage. - */ -export const migrateDashboardInput = (dashboardInput: SavedDashboardInput) => { - let anyMigrationRun = false; - if (!dashboardInput) return dashboardInput; - - const migratedPanels: DashboardContainerInput['panels'] = {}; - for (const [id, panel] of Object.entries(dashboardInput.panels)) { - // if the panel type is registered in the new embeddable system, we do not need to run migrations for it. - if (embeddableService.reactEmbeddableRegistryHasKey(panel.type)) { - migratedPanels[id] = panel; - continue; - } - - const factory = embeddableService.getEmbeddableFactory(panel.type); - if (!factory) throw new EmbeddableFactoryNotFoundError(panel.type); - // run last saved migrations for by value panels only. - if (!panel.explicitInput.savedObjectId) { - const { input: newInput, migrationRun: panelMigrationRun } = runEmbeddableFactoryMigrations( - panel.explicitInput, - factory - ); - if (panelMigrationRun) anyMigrationRun = true; - panel.explicitInput = newInput as DashboardPanelState['explicitInput']; - } else if (factory.latestVersion) { - // by reference panels are always considered to be of the latest version - panel.explicitInput.version = factory.latestVersion; - } - migratedPanels[id] = panel; - } - dashboardInput.panels = migratedPanels; - return { dashboardInput, anyMigrationRun }; -}; diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.test.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.test.ts index 7e35b0ec1c16..a1b18aca3aca 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.test.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.test.ts @@ -8,7 +8,7 @@ */ import { DashboardContainerInput } from '../../../../common'; -import { getSampleDashboardInput } from '../../../mocks'; +import { getSampleDashboardState } from '../../../mocks'; import { contentManagementService, coreServices, @@ -48,7 +48,7 @@ describe('Save dashboard state', () => { it('should save the dashboard using the same ID', async () => { const result = await saveDashboardState({ currentState: { - ...getSampleDashboardInput(), + ...getSampleDashboardState(), title: 'BOO', } as unknown as DashboardContainerInput, lastSavedId: 'Boogaloo', @@ -69,7 +69,7 @@ describe('Save dashboard state', () => { it('should save the dashboard using a new id, and return redirect required', async () => { const result = await saveDashboardState({ currentState: { - ...getSampleDashboardInput(), + ...getSampleDashboardState(), title: 'BooToo', } as unknown as DashboardContainerInput, lastSavedId: 'Boogaloonie', @@ -93,7 +93,7 @@ describe('Save dashboard state', () => { it('should generate new panel IDs for dashboard panels when save as copy is true', async () => { const result = await saveDashboardState({ currentState: { - ...getSampleDashboardInput(), + ...getSampleDashboardState(), title: 'BooThree', panels: { aVerySpecialVeryUniqueId: { type: 'boop' } }, } as unknown as DashboardContainerInput, @@ -119,7 +119,7 @@ describe('Save dashboard state', () => { it('should update prefixes on references when save as copy is true', async () => { const result = await saveDashboardState({ currentState: { - ...getSampleDashboardInput(), + ...getSampleDashboardState(), title: 'BooFour', panels: { idOne: { type: 'boop' } }, } as unknown as DashboardContainerInput, @@ -147,7 +147,7 @@ describe('Save dashboard state', () => { contentManagementService.client.create = jest.fn().mockRejectedValue('Whoops'); const result = await saveDashboardState({ currentState: { - ...getSampleDashboardInput(), + ...getSampleDashboardState(), title: 'BooThree', panels: { idOne: { type: 'boop' } }, } as unknown as DashboardContainerInput, diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.ts index 27e6a53da1f9..58492f51f4d3 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/lib/save_dashboard_state.ts @@ -137,7 +137,7 @@ export const saveDashboardState = async ({ const rawDashboardAttributes: DashboardAttributes = { version: convertDashboardVersionToNumber(LATEST_DASHBOARD_CONTAINER_VERSION), - controlGroupInput, + controlGroupInput: controlGroupInput as DashboardAttributes['controlGroupInput'], kibanaSavedObjectMeta: { searchSource }, description: description ?? '', refreshInterval, diff --git a/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts b/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts index 0f4fe1c86a56..1922ed3e30da 100644 --- a/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts +++ b/src/plugins/dashboard/public/services/dashboard_content_management_service/types.ts @@ -20,6 +20,7 @@ import { SearchDashboardsArgs, SearchDashboardsResponse, } from './lib/find_dashboards'; +import { DashboardState } from '../../dashboard_api/types'; export interface DashboardContentManagementService { findDashboards: FindDashboardsService; @@ -66,7 +67,6 @@ export interface LoadDashboardReturn { managed?: boolean; resolveMeta?: DashboardResolveMeta; dashboardInput: SavedDashboardInput; - anyMigrationRun?: boolean; /** * Raw references returned directly from the Dashboard saved object. These @@ -82,7 +82,7 @@ export type SavedDashboardSaveOpts = SavedObjectSaveOpts & { saveAsCopy?: boolea export interface SaveDashboardProps { controlGroupReferences?: Reference[]; - currentState: SavedDashboardInput; + currentState: DashboardState; saveOptions: SavedDashboardSaveOpts; panelReferences?: Reference[]; lastSavedId?: string; diff --git a/src/plugins/dashboard/public/utils/clean_filters_for_serialize.test.ts b/src/plugins/dashboard/public/utils/clean_filters_for_serialize.test.ts new file mode 100644 index 000000000000..9b0e05515d29 --- /dev/null +++ b/src/plugins/dashboard/public/utils/clean_filters_for_serialize.test.ts @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Filter } from '@kbn/es-query'; +import { cleanFiltersForSerialize } from './clean_filters_for_serialize'; + +describe('cleanFiltersForSerialize', () => { + test('should return an empty array if filters is not provided', () => { + expect(cleanFiltersForSerialize()).toEqual([]); + }); + + test('should remove "meta.value" property from each filter', () => { + const filters: Filter[] = [ + { query: { a: 'a' }, meta: { value: 'value1' } }, + { query: { b: 'b' }, meta: { value: 'value2' } }, + ]; + + const cleanedFilters = cleanFiltersForSerialize(filters); + + expect(cleanedFilters[0]).toEqual({ query: { a: 'a' }, meta: {} }); + expect(cleanedFilters[1]).toEqual({ query: { b: 'b' }, meta: {} }); + }); + + test('should not fail if meta is missing from filters', () => { + const filters: Filter[] = [{ query: { a: 'a' } }, { query: { b: 'b' } }] as unknown as Filter[]; + + const cleanedFilters = cleanFiltersForSerialize(filters as unknown as Filter[]); + + expect(cleanedFilters[0]).toEqual({ query: { a: 'a' } }); + expect(cleanedFilters[1]).toEqual({ query: { b: 'b' } }); + }); +}); diff --git a/src/plugins/dashboard/public/utils/clean_filters_for_serialize.ts b/src/plugins/dashboard/public/utils/clean_filters_for_serialize.ts new file mode 100644 index 000000000000..70f1d09eb97f --- /dev/null +++ b/src/plugins/dashboard/public/utils/clean_filters_for_serialize.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { Filter } from '@kbn/es-query'; + +export function cleanFiltersForSerialize(filters?: Filter[]): Filter[] { + if (!filters) return []; + return filters.map((filter) => { + if (filter.meta?.value) delete filter.meta.value; + return filter; + }); +} diff --git a/src/plugins/dashboard/tsconfig.json b/src/plugins/dashboard/tsconfig.json index 1bf6827433b6..3370a7fd85f8 100644 --- a/src/plugins/dashboard/tsconfig.json +++ b/src/plugins/dashboard/tsconfig.json @@ -81,7 +81,8 @@ "@kbn/core-custom-branding-browser-mocks", "@kbn/core-mount-utils-browser", "@kbn/visualization-utils", - "@kbn/core-rendering-browser", + "@kbn/std", + "@kbn/core-rendering-browser" ], "exclude": ["target/**/*"] } diff --git a/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts index 3d80fb4fd3f9..30720bcd3031 100644 --- a/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts +++ b/src/plugins/data/common/datatable_utilities/datatable_utilities_service.ts @@ -74,10 +74,7 @@ export class DatatableUtilitiesService { timeZone: string; }> = {} ): DateHistogramMeta | undefined { - if (column.meta.source !== 'esaggs') { - return; - } - if (column.meta.sourceParams?.type !== BUCKET_TYPES.DATE_HISTOGRAM) { + if (!column.meta.sourceParams || !column.meta.sourceParams.params) { return; } diff --git a/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.test.ts b/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.test.ts index c8aafc01e2bc..068ffa599fa9 100644 --- a/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.test.ts +++ b/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.test.ts @@ -7,7 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { createStubDataView } from '@kbn/data-views-plugin/common/mocks'; import { textBasedQueryStateToAstWithValidation } from './text_based_query_state_to_ast_with_validation'; describe('textBasedQueryStateToAstWithValidation', () => { @@ -25,13 +24,6 @@ describe('textBasedQueryStateToAstWithValidation', () => { }); it('returns an object with the correct structure for an SQL query with existing dataview', async () => { - const dataView = createStubDataView({ - spec: { - id: 'foo', - title: 'foo', - timeFieldName: '@timestamp', - }, - }); const actual = await textBasedQueryStateToAstWithValidation({ filters: [], query: { esql: 'FROM foo' }, @@ -39,7 +31,7 @@ describe('textBasedQueryStateToAstWithValidation', () => { from: 'now', to: 'now+7d', }, - dataView, + timeFieldName: '@timestamp', }); expect(actual).toHaveProperty( @@ -76,13 +68,6 @@ describe('textBasedQueryStateToAstWithValidation', () => { }); it('returns an object with the correct structure for ES|QL', async () => { - const dataView = createStubDataView({ - spec: { - id: 'foo', - title: 'foo', - timeFieldName: '@timestamp', - }, - }); const actual = await textBasedQueryStateToAstWithValidation({ filters: [], query: { esql: 'from logs*' }, @@ -90,7 +75,7 @@ describe('textBasedQueryStateToAstWithValidation', () => { from: 'now', to: 'now+7d', }, - dataView, + timeFieldName: '@timestamp', titleForInspector: 'Custom title', descriptionForInspector: 'Custom desc', }); diff --git a/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.ts b/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.ts index 170bc4c55a92..8bcc37775417 100644 --- a/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.ts +++ b/src/plugins/data/common/query/text_based_query_state_to_ast_with_validation.ts @@ -8,12 +8,10 @@ */ import { isOfAggregateQueryType, Query } from '@kbn/es-query'; -import type { DataView } from '@kbn/data-views-plugin/common'; import type { QueryState } from '..'; import { textBasedQueryStateToExpressionAst } from './text_based_query_state_to_ast'; interface Args extends QueryState { - dataView?: DataView; inputQuery?: Query; timeFieldName?: string; titleForInspector?: string; @@ -26,7 +24,7 @@ interface Args extends QueryState { * @param query kibana query or aggregate query * @param inputQuery * @param time kibana time range - * @param dataView + * @param timeFieldName * @param titleForInspector * @param descriptionForInspector */ @@ -35,7 +33,7 @@ export async function textBasedQueryStateToAstWithValidation({ query, inputQuery, time, - dataView, + timeFieldName, titleForInspector, descriptionForInspector, }: Args) { @@ -46,7 +44,7 @@ export async function textBasedQueryStateToAstWithValidation({ query, inputQuery, time, - timeFieldName: dataView?.timeFieldName, + timeFieldName, titleForInspector, descriptionForInspector, }); diff --git a/src/plugins/data/common/search/expressions/esql.ts b/src/plugins/data/common/search/expressions/esql.ts index a93996f16396..cc1180ff57e4 100644 --- a/src/plugins/data/common/search/expressions/esql.ts +++ b/src/plugins/data/common/search/expressions/esql.ts @@ -315,7 +315,17 @@ export const getEsqlFn = ({ getStartDependencies }: EsqlFnArguments) => { (body.all_columns ?? body.columns)?.map(({ name, type }) => ({ id: name, name, - meta: { type: esFieldTypeToKibanaFieldType(type), esType: type }, + meta: { + type: esFieldTypeToKibanaFieldType(type), + esType: type, + sourceParams: + type === 'date' + ? { + appliedTimeRange: input?.timeRange, + params: {}, + } + : {}, + }, isNull: hasEmptyColumns ? !lookup.has(name) : false, })) ?? []; diff --git a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts index 8b312cd2fab8..068265943ecd 100644 --- a/src/plugins/data/public/search/search_interceptor/search_interceptor.ts +++ b/src/plugins/data/public/search/search_interceptor/search_interceptor.ts @@ -47,6 +47,7 @@ import type { IUiSettingsClient, ThemeServiceStart, ToastsSetup, + UserProfileService, } from '@kbn/core/public'; import { toMountPoint } from '@kbn/react-kibana-mount'; @@ -127,6 +128,7 @@ export class SearchInterceptor { analytics: Pick<AnalyticsServiceStart, 'reportEvent'>; i18n: I18nStart; theme: Pick<ThemeServiceStart, 'theme$'>; + userProfile: UserProfileService; }; /* @@ -136,10 +138,10 @@ export class SearchInterceptor { this.deps.http.addLoadingCountSource(this.pendingCount$); this.deps.startServices.then(([coreStart, depsStart]) => { - const { application, docLinks, analytics, i18n: i18nStart, theme } = coreStart; + const { application, docLinks, ...startRenderServices } = coreStart; this.application = application; this.docLinks = docLinks; - this.startRenderServices = { analytics, i18n: i18nStart, theme }; + this.startRenderServices = startRenderServices; this.inspector = (depsStart as SearchServiceStartDependencies).inspector; }); diff --git a/src/plugins/data/public/search/search_service.ts b/src/plugins/data/public/search/search_service.ts index d1e5d02e5d84..6d2e09a5ef30 100644 --- a/src/plugins/data/public/search/search_service.ts +++ b/src/plugins/data/public/search/search_service.ts @@ -217,16 +217,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { } public start( - { - analytics, - http, - theme, - uiSettings, - chrome, - application, - notifications, - i18n: i18nStart, - }: CoreStart, + { http, uiSettings, chrome, application, notifications, ...startServices }: CoreStart, { fieldFormats, indexPatterns, @@ -245,11 +236,9 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { const aggs = this.aggsService.start({ fieldFormats, indexPatterns }); const warningsServices = { - analytics, - i18n: i18nStart, inspector, notifications, - theme, + ...startServices, }; const searchSourceDependencies: SearchSourceDependencies = { @@ -305,7 +294,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { tourDisabled: screenshotMode.isScreenshotMode(), }) ), - { analytics, i18n: i18nStart, theme } + startServices ), }); } diff --git a/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx b/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx index f78681904406..4c375be8534c 100644 --- a/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx +++ b/src/plugins/data/public/search/session/sessions_mgmt/application/render.tsx @@ -16,7 +16,7 @@ import { SearchSessionsMgmtMain } from '../components/main'; export const renderApp = ( elem: HTMLElement | null, - { i18n, uiSettings, ...homeDeps }: AppDependencies + { uiSettings, ...homeDeps }: AppDependencies ) => { if (!elem) { return () => undefined; @@ -28,7 +28,7 @@ export const renderApp = ( }); render( - <KibanaRenderContextProvider theme={homeDeps.core.theme} i18n={i18n}> + <KibanaRenderContextProvider {...homeDeps.core}> <KibanaReactContextProvider> <SearchSessionsMgmtMain {...homeDeps} timezone={uiSettings.get('dateFormat:tz')} /> </KibanaReactContextProvider> diff --git a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts index 9fb6fafb11db..ad03451bf869 100644 --- a/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts +++ b/src/plugins/data/server/search/strategies/sql_search/sql_search_strategy.ts @@ -11,7 +11,7 @@ import type { IncomingHttpHeaders } from 'http'; import type { IScopedClusterClient, Logger } from '@kbn/core/server'; import { catchError, tap } from 'rxjs'; import type { DiagnosticResult } from '@elastic/transport'; -import { SqlQueryResponse } from '@elastic/elasticsearch/lib/api/types'; +import { SqlQueryResponse, type SqlQuerySqlFormat } from '@elastic/elasticsearch/lib/api/types'; import { getKbnServerError } from '@kbn/kibana-utils-plugin/server'; import { getKbnSearchError } from '../../report_search_error'; import type { ISearchStrategy, SearchStrategyDependencies } from '../../types'; @@ -61,9 +61,9 @@ export const sqlSearchStrategyProvider = ( } else { ({ headers, body, meta } = await client.sql.query( { - format: params.format ?? 'json', ...getDefaultAsyncSubmitParams(searchConfig, options), ...params, + format: (params.format ?? 'json') as SqlQuerySqlFormat, }, { ...options.transport, signal: options.abortSignal, meta: true } )); diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/__snapshots__/color.test.tsx.snap b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/__snapshots__/color.test.tsx.snap index 1e97b4a59ed0..c0caa836b45c 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/__snapshots__/color.test.tsx.snap +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/__snapshots__/color.test.tsx.snap @@ -1,5 +1,99 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`ColorFormatEditor should render boolean type normally 1`] = ` +<Fragment> + <EuiBasicTable + columns={ + Array [ + Object { + "field": "boolean", + "name": <Memo(MemoizedFormattedMessage) + defaultMessage="Boolean" + id="indexPatternFieldEditor.color.booleanLabel" + />, + "render": [Function], + }, + Object { + "field": "text", + "name": <Memo(MemoizedFormattedMessage) + defaultMessage="Text color" + id="indexPatternFieldEditor.color.textColorLabel" + />, + "render": [Function], + }, + Object { + "field": "background", + "name": <Memo(MemoizedFormattedMessage) + defaultMessage="Background color" + id="indexPatternFieldEditor.color.backgroundLabel" + />, + "render": [Function], + }, + Object { + "name": <Memo(MemoizedFormattedMessage) + defaultMessage="Example" + id="indexPatternFieldEditor.color.exampleLabel" + />, + "render": [Function], + }, + Object { + "actions": Array [ + Object { + "available": [Function], + "color": "danger", + "data-test-subj": "colorEditorRemoveColor", + "description": "Delete color format", + "icon": "trash", + "name": "Delete", + "onClick": [Function], + "type": "icon", + }, + ], + "field": "actions", + "name": "Actions", + }, + ] + } + items={ + Array [ + Object { + "background": "#ffffff", + "boolean": "true", + "index": 0, + "range": "-Infinity:Infinity", + "regex": "<insert regex>", + "text": "#000000", + }, + ] + } + noItemsMessage={ + <EuiI18n + default="No items found" + token="euiBasicTable.noItemsMessage" + /> + } + tableLayout="fixed" + /> + <EuiSpacer + size="m" + /> + <EuiButton + data-test-subj="colorEditorAddColor" + iconType="plusInCircle" + onClick={[Function]} + size="s" + > + <MemoizedFormattedMessage + defaultMessage="Add color" + id="indexPatternFieldEditor.color.addColorButton" + /> + </EuiButton> + <EuiSpacer + size="l" + /> +</Fragment> +`; + exports[`ColorFormatEditor should render multiple colors 1`] = ` <Fragment> <EuiBasicTable @@ -58,6 +152,7 @@ exports[`ColorFormatEditor should render multiple colors 1`] = ` Array [ Object { "background": "#ffffff", + "boolean": "true", "index": 0, "range": "-Infinity:Infinity", "regex": "<insert regex>", @@ -65,6 +160,7 @@ exports[`ColorFormatEditor should render multiple colors 1`] = ` }, Object { "background": "#ffffff", + "boolean": "true", "index": 1, "range": "-Infinity:Infinity", "regex": "<insert regex>", @@ -158,6 +254,7 @@ exports[`ColorFormatEditor should render other type normally (range field) 1`] = Array [ Object { "background": "#ffffff", + "boolean": "true", "index": 0, "range": "-Infinity:Infinity", "regex": "<insert regex>", @@ -251,6 +348,7 @@ exports[`ColorFormatEditor should render string type normally (regex field) 1`] Array [ Object { "background": "#ffffff", + "boolean": "true", "index": 0, "range": "-Infinity:Infinity", "regex": "<insert regex>", diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx index a44845ad93f0..7b75c38aa02a 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.test.tsx @@ -57,6 +57,20 @@ describe('ColorFormatEditor', () => { expect(component).toMatchSnapshot(); }); + it('should render boolean type normally', async () => { + const component = shallowWithI18nProvider( + <ColorFormatEditor + fieldType={'boolean'} + format={format as unknown as FieldFormat} + formatParams={formatParams} + onChange={onChange} + onError={onError} + /> + ); + + expect(component).toMatchSnapshot(); + }); + it('should render other type normally (range field)', async () => { const component = shallowWithI18nProvider( <ColorFormatEditor diff --git a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.tsx b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.tsx index 9ed18eb7f8bd..85343826a58f 100644 --- a/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.tsx +++ b/src/plugins/data_view_field_editor/public/components/field_format_editor/editors/color/color.tsx @@ -15,6 +15,7 @@ import { EuiColorPicker, EuiIcon, EuiFieldText, + EuiSelect, EuiSpacer, } from '@elastic/eui'; @@ -29,6 +30,7 @@ import { FormatEditorProps } from '../types'; interface Color { range?: string; regex?: string; + boolean?: string; text: string; background: string; } @@ -76,6 +78,90 @@ export class ColorFormatEditor extends DefaultFormatEditor<ColorFormatEditorForm }); }; + getFirstColumn = (fieldType: string) => { + if (fieldType === 'boolean') + return { + field: 'boolean', + name: ( + <FormattedMessage + id="indexPatternFieldEditor.color.booleanLabel" + defaultMessage="Boolean" + /> + ), + render: (value: string, item: IndexedColor) => { + return ( + <EuiSelect + options={[ + { value: 'true', text: 'true' }, + { value: 'false', text: 'false' }, + ]} + value={value} + data-test-subj={`colorEditorKeyBoolean ${item.index}`} + onChange={(e) => { + this.onColorChange( + { + boolean: e.target.value, + }, + item.index + ); + }} + /> + ); + }, + }; + if (fieldType === 'string') + return { + field: 'regex', + name: ( + <FormattedMessage + id="indexPatternFieldEditor.color.patternLabel" + defaultMessage="Pattern (regular expression)" + /> + ), + render: (value: string, item: IndexedColor) => { + return ( + <EuiFieldText + value={value} + data-test-subj={`colorEditorKeyPattern ${item.index}`} + onChange={(e) => { + this.onColorChange( + { + regex: e.target.value, + }, + item.index + ); + }} + /> + ); + }, + }; + return { + field: 'range', + name: ( + <FormattedMessage + id="indexPatternFieldEditor.color.rangeLabel" + defaultMessage="Range (min:max)" + /> + ), + render: (value: string, item: IndexedColor) => { + return ( + <EuiFieldText + value={value} + data-test-subj={`colorEditorKeyRange ${item.index}`} + onChange={(e) => { + this.onColorChange( + { + range: e.target.value, + }, + item.index + ); + }} + /> + ); + }, + }; + }; + render() { const { formatParams, fieldType } = this.props; @@ -91,57 +177,7 @@ export class ColorFormatEditor extends DefaultFormatEditor<ColorFormatEditorForm []; const columns = [ - fieldType === 'string' - ? { - field: 'regex', - name: ( - <FormattedMessage - id="indexPatternFieldEditor.color.patternLabel" - defaultMessage="Pattern (regular expression)" - /> - ), - render: (value: string, item: IndexedColor) => { - return ( - <EuiFieldText - value={value} - data-test-subj={`colorEditorKeyPattern ${item.index}`} - onChange={(e) => { - this.onColorChange( - { - regex: e.target.value, - }, - item.index - ); - }} - /> - ); - }, - } - : { - field: 'range', - name: ( - <FormattedMessage - id="indexPatternFieldEditor.color.rangeLabel" - defaultMessage="Range (min:max)" - /> - ), - render: (value: string, item: IndexedColor) => { - return ( - <EuiFieldText - value={value} - data-test-subj={`colorEditorKeyRange ${item.index}`} - onChange={(e) => { - this.onColorChange( - { - range: e.target.value, - }, - item.index - ); - }} - /> - ); - }, - }, + this.getFirstColumn(fieldType), { field: 'text', name: ( diff --git a/src/plugins/data_view_field_editor/server/routes/field_preview.ts b/src/plugins/data_view_field_editor/server/routes/field_preview.ts index 8d585a768871..a7df6a9f4e2a 100644 --- a/src/plugins/data_view_field_editor/server/routes/field_preview.ts +++ b/src/plugins/data_view_field_editor/server/routes/field_preview.ts @@ -81,9 +81,8 @@ export const registerFieldPreviewRoute = ({ router }: RouteDependencies): void = }; try { - // client types need to be update to support this request format + // client types need to be updated to support this request format // when it does, supply response types - // @ts-expect-error const { result } = await client.asCurrentUser.scriptsPainlessExecute(body); return res.ok({ body: { values: result } }); diff --git a/src/plugins/data_view_management/public/types.ts b/src/plugins/data_view_management/public/types.ts index 161ee3b1e21d..eaee8b28d614 100644 --- a/src/plugins/data_view_management/public/types.ts +++ b/src/plugins/data_view_management/public/types.ts @@ -33,7 +33,7 @@ import { SharePluginStart } from '@kbn/share-plugin/public'; import type { IndexPatternManagementStart } from '.'; import type { DataViewMgmtService } from './management_app/data_view_management_service'; -export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme'>; +export type StartServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme' | 'userProfile'>; export interface IndexPatternManagmentContext extends StartServices { dataViewMgmtService: DataViewMgmtService; diff --git a/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts b/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts index dca01247296a..d7cad10b177f 100644 --- a/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts +++ b/src/plugins/discover/public/application/main/data_fetching/fetch_esql.ts @@ -56,7 +56,7 @@ export function fetchEsql({ filters, query, time: timeRange, - dataView, + timeFieldName: dataView.timeFieldName, inputQuery, titleForInspector: i18n.translate('discover.inspectorEsqlRequestTitle', { defaultMessage: 'Table', 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 205926cf4943..c88774d6f9e1 100644 --- a/src/plugins/discover/public/application/main/discover_main_route.tsx +++ b/src/plugins/discover/public/application/main/discover_main_route.tsx @@ -206,7 +206,7 @@ export function DiscoverMainRoute({ onBeforeRedirect() { services.urlTracker.setTrackedUrl('/'); }, - theme: core.theme, + ...core, })(e); } else { setError(e); @@ -222,8 +222,7 @@ export function DiscoverMainRoute({ services, chrome.recentlyAccessed, history, - core.application.navigateToApp, - core.theme, + core, basePath, toastNotifications, ] diff --git a/src/plugins/discover/public/build_services.ts b/src/plugins/discover/public/build_services.ts index df194bc03fa0..0aef34338c37 100644 --- a/src/plugins/discover/public/build_services.ts +++ b/src/plugins/discover/public/build_services.ts @@ -23,6 +23,8 @@ import type { AnalyticsServiceStart, AppMountParameters, ScopedHistory, + ThemeServiceStart, + UserProfileService, } from '@kbn/core/public'; import type { FilterManager, @@ -96,7 +98,8 @@ export interface DiscoverServices { history: History<HistoryLocationState>; getScopedHistory: <T>() => ScopedHistory<T | undefined> | undefined; setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; - theme: CoreStart['theme']; + theme: ThemeServiceStart; + userProfile: UserProfileService; filterManager: FilterManager; fieldFormats: FieldFormatsStart; dataViews: DataViewsContract; @@ -185,6 +188,7 @@ export const buildServices = memoize( embeddable: plugins.embeddable, i18n: core.i18n, theme: core.theme, + userProfile: core.userProfile, fieldFormats: plugins.fieldFormats, filterManager: plugins.data.query.filterManager, history, diff --git a/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/consts.ts b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/consts.ts new file mode 100644 index 000000000000..1e6e0b1b2e9d --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/consts.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export const DEPRECATION_LOGS_PROFILE_ID = 'deprecation-logs-profile'; +export const DEPRECATION_LOGS_PATTERN_PREFIX = '.logs-deprecation'; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/index.ts b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/index.ts new file mode 100644 index 000000000000..8110f3371ce8 --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export { createDeprecationLogsDataSourceProfileProvider } from './profile'; diff --git a/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.test.ts b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.test.ts new file mode 100644 index 000000000000..c961f310f6e5 --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { createStubIndexPattern } from '@kbn/data-views-plugin/common/data_view.stub'; +import { createDataViewDataSource } from '../../../../../common/data_sources'; +import { DataSourceCategory, RootContext, SolutionType } from '../../../profiles'; +import { createDeprecationLogsDataSourceProfileProvider } from './profile'; +import type { ContextWithProfileId } from '../../../profile_service'; +import { DEPRECATION_LOGS_PROFILE_ID } from './consts'; + +describe('deprecationLogsProfileProvider', () => { + const deprecationLogsProfileProvider = createDeprecationLogsDataSourceProfileProvider(); + const VALID_INDEX_PATTERN = '.logs-deprecation.elasticsearch-default'; + const VALID_MIXED_INDEX_PATTERN = + '.logs-deprecation.elasticsearch-default,.logs-deprecation.abc,.logs-deprecation.def'; + const INVALID_MIXED_INDEX_PATTERN = '.logs-deprecation.elasticsearch-default,metrics-*'; + const INVALID_INDEX_PATTERN = 'my_source-access-*'; + const ROOT_CONTEXT: ContextWithProfileId<RootContext> = { + profileId: DEPRECATION_LOGS_PROFILE_ID, + solutionType: SolutionType.Default, + }; + const RESOLUTION_MATCH = { + isMatch: true, + context: { + category: DataSourceCategory.Logs, + }, + }; + const RESOLUTION_MISMATCH = { + isMatch: false, + }; + + it('should match data view sources with an allowed index pattern', () => { + const result = deprecationLogsProfileProvider.resolve({ + rootContext: ROOT_CONTEXT, + dataSource: createDataViewDataSource({ dataViewId: VALID_INDEX_PATTERN }), + dataView: createStubIndexPattern({ spec: { title: VALID_INDEX_PATTERN } }), + }); + expect(result).toEqual(RESOLUTION_MATCH); + }); + + it('should match data view sources with a mixed pattern containing allowed index patterns', () => { + const result = deprecationLogsProfileProvider.resolve({ + rootContext: ROOT_CONTEXT, + dataSource: createDataViewDataSource({ dataViewId: VALID_MIXED_INDEX_PATTERN }), + dataView: createStubIndexPattern({ spec: { title: VALID_MIXED_INDEX_PATTERN } }), + }); + expect(result).toEqual(RESOLUTION_MATCH); + }); + + it('should NOT match data view sources with not allowed index pattern', () => { + const result = deprecationLogsProfileProvider.resolve({ + rootContext: ROOT_CONTEXT, + dataSource: createDataViewDataSource({ dataViewId: INVALID_INDEX_PATTERN }), + dataView: createStubIndexPattern({ spec: { title: INVALID_INDEX_PATTERN } }), + }); + expect(result).toEqual(RESOLUTION_MISMATCH); + }); + + it('should NOT match data view sources with a mixed pattern containing not allowed index patterns', () => { + const result = deprecationLogsProfileProvider.resolve({ + rootContext: ROOT_CONTEXT, + dataSource: createDataViewDataSource({ dataViewId: INVALID_MIXED_INDEX_PATTERN }), + dataView: createStubIndexPattern({ spec: { title: INVALID_MIXED_INDEX_PATTERN } }), + }); + expect(result).toEqual(RESOLUTION_MISMATCH); + }); +}); diff --git a/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.ts b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.ts new file mode 100644 index 000000000000..4d220892aea2 --- /dev/null +++ b/src/plugins/discover/public/context_awareness/profile_providers/common/deprecation_logs/profile.ts @@ -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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { DataSourceCategory } from '../../../profiles'; +import { type DataSourceProfileProvider } from '../../../profiles'; +import { DEPRECATION_LOGS_PATTERN_PREFIX, DEPRECATION_LOGS_PROFILE_ID } from './consts'; +import { extractIndexPatternFrom } from '../../extract_index_pattern_from'; + +export const createDeprecationLogsDataSourceProfileProvider = + (): DataSourceProfileProvider<{}> => ({ + profileId: DEPRECATION_LOGS_PROFILE_ID, + profile: { + getDefaultAppState: () => () => ({ + columns: [ + { name: 'log.level', width: 150 }, + { name: 'message' }, + { name: 'elasticsearch.http.request.x_opaque_id', width: 250 }, + { name: 'elasticsearch.cluster.name', width: 250 }, + { name: 'elasticsearch.event.category', width: 250 }, + ], + }), + }, + resolve: (params) => { + const indexPattern = extractIndexPatternFrom(params); + + if (!checkAllIndicesInPatternAreDeprecationLogs(indexPattern)) { + return { isMatch: false }; + } + + return { + isMatch: true, + context: { + category: DataSourceCategory.Logs, + }, + }; + }, + }); + +/* + This function returns true if the index pattern belongs to deprecation logs. + It also considers multiple patterns separated by commas. +*/ +const checkAllIndicesInPatternAreDeprecationLogs = (indexPattern: string | null): boolean => { + if (!indexPattern) { + return false; + } + const indexPatternArray = indexPattern.split(','); + const result = indexPatternArray.reduce( + (acc, val) => acc && val.startsWith(DEPRECATION_LOGS_PATTERN_PREFIX), + true + ); + return result; +}; 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 b0ee4318dde2..88c7628e9273 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 @@ -28,6 +28,7 @@ import { } from './profile_provider_services'; import type { DiscoverServices } from '../../build_services'; import { createObservabilityRootProfileProvider } from './observability/observability_root_profile'; +import { createDeprecationLogsDataSourceProfileProvider } from './common/deprecation_logs'; /** * Register profile providers for root, data source, and document contexts to the profile profile services @@ -133,6 +134,7 @@ const createRootProfileProviders = (providerServices: ProfileProviderServices) = */ const createDataSourceProfileProviders = (providerServices: ProfileProviderServices) => [ createExampleDataSourceProfileProvider(), + createDeprecationLogsDataSourceProfileProvider(), ...createObservabilityLogsDataSourceProfileProviders(providerServices), ]; diff --git a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx index c1b5cf9f7695..1f97e2de6639 100644 --- a/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx +++ b/src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx @@ -20,6 +20,7 @@ import { i18n } from '@kbn/i18n'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { FetchContext, + getUnchangingComparator, initializeTimeRange, initializeTitles, useBatchedPublishingSubjects, @@ -186,7 +187,7 @@ export const getSearchEmbeddableFactory = ({ defaultPanelTitle$.next(undefined); defaultPanelDescription$.next(undefined); }, - serializeState: async () => + serializeState: () => serializeState({ uuid, initialState, @@ -194,7 +195,6 @@ export const getSearchEmbeddableFactory = ({ serializeTitles, serializeTimeRange: timeRange.serialize, savedObjectId: savedObjectId$.getValue(), - discoverServices, }), getInspectorAdapters: () => searchEmbeddable.stateManager.inspectorAdapters.getValue(), }, @@ -202,6 +202,7 @@ export const getSearchEmbeddableFactory = ({ ...titleComparators, ...timeRange.comparators, ...searchEmbeddable.comparators, + rawSavedObjectAttributes: getUnchangingComparator(), savedObjectId: [savedObjectId$, (value) => savedObjectId$.next(value)], savedObjectTitle: [defaultPanelTitle$, (value) => defaultPanelTitle$.next(value)], savedObjectDescription: [ diff --git a/src/plugins/discover/public/embeddable/types.ts b/src/plugins/discover/public/embeddable/types.ts index 94d0b10cc3f6..0443801ec724 100644 --- a/src/plugins/discover/public/embeddable/types.ts +++ b/src/plugins/discover/public/embeddable/types.ts @@ -68,9 +68,13 @@ export interface NonPersistedDisplayOptions { enableFilters?: boolean; } +export type EditableSavedSearchAttributes = Partial< + Pick<SavedSearchAttributes, (typeof EDITABLE_SAVED_SEARCH_KEYS)[number]> +>; + export type SearchEmbeddableSerializedState = SerializedTitles & SerializedTimeRange & - Partial<Pick<SavedSearchAttributes, (typeof EDITABLE_SAVED_SEARCH_KEYS)[number]>> & { + EditableSavedSearchAttributes & { // by value attributes?: SavedSearchAttributes & { references: SavedSearch['references'] }; // by reference @@ -81,6 +85,7 @@ export type SearchEmbeddableSerializedState = SerializedTitles & export type SearchEmbeddableRuntimeState = SearchEmbeddableSerializedAttributes & SerializedTitles & SerializedTimeRange & { + rawSavedObjectAttributes?: EditableSavedSearchAttributes; savedObjectTitle?: string; savedObjectId?: string; savedObjectDescription?: string; diff --git a/src/plugins/discover/public/embeddable/utils/serialization_utils.test.ts b/src/plugins/discover/public/embeddable/utils/serialization_utils.test.ts index c91aacb89aff..2a7a23b3600a 100644 --- a/src/plugins/discover/public/embeddable/utils/serialization_utils.test.ts +++ b/src/plugins/discover/public/embeddable/utils/serialization_utils.test.ts @@ -121,7 +121,6 @@ describe('Serialization utils', () => { savedSearch, serializeTitles: jest.fn(), serializeTimeRange: jest.fn(), - discoverServices: discoverServiceMock, }); expect(serializedState).toEqual({ @@ -148,19 +147,16 @@ describe('Serialization utils', () => { searchSource, }; - beforeAll(() => { - discoverServiceMock.savedSearch.get = jest.fn().mockResolvedValue(savedSearch); - }); - - test('equal state', async () => { - const serializedState = await serializeState({ + test('equal state', () => { + const serializedState = serializeState({ uuid, - initialState: {}, + initialState: { + rawSavedObjectAttributes: savedSearch, + }, savedSearch, serializeTitles: jest.fn(), serializeTimeRange: jest.fn(), savedObjectId: 'test-id', - discoverServices: discoverServiceMock, }); expect(serializedState).toEqual({ @@ -171,15 +167,16 @@ describe('Serialization utils', () => { }); }); - test('overwrite state', async () => { - const serializedState = await serializeState({ + test('overwrite state', () => { + const serializedState = serializeState({ uuid, - initialState: {}, + initialState: { + rawSavedObjectAttributes: savedSearch, + }, savedSearch: { ...savedSearch, sampleSize: 500, sort: [['order_date', 'asc']] }, serializeTitles: jest.fn(), serializeTimeRange: jest.fn(), savedObjectId: 'test-id', - discoverServices: discoverServiceMock, }); expect(serializedState).toEqual({ diff --git a/src/plugins/discover/public/embeddable/utils/serialization_utils.ts b/src/plugins/discover/public/embeddable/utils/serialization_utils.ts index f193d52054a3..397d078dba3e 100644 --- a/src/plugins/discover/public/embeddable/utils/serialization_utils.ts +++ b/src/plugins/discover/public/embeddable/utils/serialization_utils.ts @@ -43,6 +43,7 @@ export const deserializeState = async ({ const { get } = discoverServices.savedSearch; const so = await get(savedObjectId, true); + const rawSavedObjectAttributes = pick(so, EDITABLE_SAVED_SEARCH_KEYS); const savedObjectOverride = pick(serializedState.rawState, EDITABLE_SAVED_SEARCH_KEYS); return { // ignore the time range from the saved object - only global time range + panel time range matter @@ -53,6 +54,9 @@ export const deserializeState = async ({ // Overwrite SO state with dashboard state for title, description, columns, sort, etc. ...panelState, ...savedObjectOverride, + + // back up the original saved object attributes for comparison + rawSavedObjectAttributes, }; } else { // by value @@ -72,14 +76,13 @@ export const deserializeState = async ({ } }; -export const serializeState = async ({ +export const serializeState = ({ uuid, initialState, savedSearch, serializeTitles, serializeTimeRange, savedObjectId, - discoverServices, }: { uuid: string; initialState: SearchEmbeddableRuntimeState; @@ -87,19 +90,17 @@ export const serializeState = async ({ serializeTitles: () => SerializedTitles; serializeTimeRange: () => SerializedTimeRange; savedObjectId?: string; - discoverServices: DiscoverServices; -}): Promise<SerializedPanelState<SearchEmbeddableSerializedState>> => { +}): SerializedPanelState<SearchEmbeddableSerializedState> => { const searchSource = savedSearch.searchSource; const { searchSourceJSON, references: originalReferences } = searchSource.serialize(); const savedSearchAttributes = toSavedSearchAttributes(savedSearch, searchSourceJSON); if (savedObjectId) { - const { get } = discoverServices.savedSearch; - const so = await get(savedObjectId); + const editableAttributesBackup = initialState.rawSavedObjectAttributes ?? {}; // only save the current state that is **different** than the saved object state const overwriteState = EDITABLE_SAVED_SEARCH_KEYS.reduce((prev, key) => { - if (deepEqual(savedSearchAttributes[key], so[key])) { + if (deepEqual(savedSearchAttributes[key], editableAttributesBackup[key])) { return prev; } return { ...prev, [key]: savedSearchAttributes[key] }; diff --git a/src/plugins/embeddable/.storybook/decorator.tsx b/src/plugins/embeddable/.storybook/decorator.tsx deleted file mode 100644 index 936050352d22..000000000000 --- a/src/plugins/embeddable/.storybook/decorator.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; - -import { DecoratorFn } from '@storybook/react'; -import { I18nProvider } from '@kbn/i18n-react'; -import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; - -export const servicesContextDecorator: DecoratorFn = (story, { globals }) => { - const darkMode = ['v8.dark', 'v7.dark'].includes(globals.euiTheme); - - return ( - <I18nProvider> - <EuiThemeProvider darkMode={darkMode}>{story()}</EuiThemeProvider> - </I18nProvider> - ); -}; diff --git a/src/plugins/embeddable/.storybook/main.ts b/src/plugins/embeddable/.storybook/main.ts deleted file mode 100644 index 02a7d1b2dd5e..000000000000 --- a/src/plugins/embeddable/.storybook/main.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -// eslint-disable-next-line import/no-default-export -export { defaultConfig as default } from '@kbn/storybook'; diff --git a/src/plugins/embeddable/.storybook/manager.ts b/src/plugins/embeddable/.storybook/manager.ts deleted file mode 100644 index b28080883ec1..000000000000 --- a/src/plugins/embeddable/.storybook/manager.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { addons } from '@storybook/addons'; -import { create } from '@storybook/theming'; -import { PANEL_ID } from '@storybook/addon-actions'; - -addons.setConfig({ - theme: create({ - base: 'light', - brandTitle: 'Kibana Embeddable Storybook', - brandUrl: 'https://github.com/elastic/kibana/tree/main/src/plugins/embeddable', - }), - showPanel: true.valueOf, - selectedPanel: PANEL_ID, -}); diff --git a/src/plugins/embeddable/.storybook/preview.tsx b/src/plugins/embeddable/.storybook/preview.tsx deleted file mode 100644 index 4ddf9e5080d2..000000000000 --- a/src/plugins/embeddable/.storybook/preview.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { addDecorator } from '@storybook/react'; -import { Title, Subtitle, Description, Primary, Stories } from '@storybook/addon-docs/blocks'; - -import { servicesContextDecorator } from './decorator'; - -addDecorator(servicesContextDecorator); - -export const parameters = { - docs: { - page: () => ( - <> - <Title /> - <Subtitle /> - <Description /> - <Primary /> - <Stories /> - </> - ), - }, -}; diff --git a/src/plugins/embeddable/kibana.jsonc b/src/plugins/embeddable/kibana.jsonc index b617114f9fa5..8a012aefbc30 100644 --- a/src/plugins/embeddable/kibana.jsonc +++ b/src/plugins/embeddable/kibana.jsonc @@ -1,9 +1,7 @@ { "type": "plugin", "id": "@kbn/embeddable-plugin", - "owner": [ - "@elastic/kibana-presentation" - ], + "owner": ["@elastic/kibana-presentation"], "group": "platform", "visibility": "shared", "description": "Adds embeddables service to Kibana", @@ -19,17 +17,8 @@ "savedObjectsManagement", "contentManagement" ], - "optionalPlugins": [ - "savedObjectsTaggingOss", - "usageCollection" - ], - "requiredBundles": [ - "savedObjects", - "kibanaUtils", - "presentationPanel" - ], - "extraPublicDirs": [ - "common" - ] + "optionalPlugins": ["savedObjectsTaggingOss", "usageCollection"], + "requiredBundles": ["kibanaUtils", "presentationPanel"], + "extraPublicDirs": ["common"] } -} \ No newline at end of file +} diff --git a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx b/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.tsx deleted file mode 100644 index bcb0af1cf906..000000000000 --- a/src/plugins/embeddable/public/__stories__/embeddable_panel.stories.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { - forwardRef, - useCallback, - useContext, - useEffect, - useImperativeHandle, - useMemo, - useRef, -} from 'react'; -import { ReplaySubject } from 'rxjs'; -import { ThemeContext } from '@emotion/react'; -import { DecoratorFn, Meta } from '@storybook/react'; -import { action } from '@storybook/addon-actions'; -import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import { CoreTheme } from '@kbn/core-theme-browser'; -import type { Action } from '@kbn/ui-actions-plugin/public'; - -import { CONTEXT_MENU_TRIGGER, EmbeddablePanel, PANEL_BADGE_TRIGGER, ViewMode } from '..'; -import { actions } from '../store'; -import { HelloWorldEmbeddable } from './hello_world_embeddable'; - -const layout: DecoratorFn = (story) => { - return ( - <EuiFlexGroup direction="row" justifyContent="center"> - <EuiFlexItem grow={false} style={{ height: 300, width: 500 }}> - {story()} - </EuiFlexItem> - </EuiFlexGroup> - ); -}; - -export default { - title: 'components/EmbeddablePanel', - argTypes: { - hideHeader: { - name: 'Hide Header', - control: { type: 'boolean' }, - }, - loading: { - name: 'Loading', - control: { type: 'boolean' }, - }, - showShadow: { - name: 'Show Shadow', - control: { type: 'boolean' }, - }, - title: { - name: 'Title', - control: { type: 'text' }, - }, - viewMode: { - name: 'View Mode', - control: { type: 'boolean' }, - }, - }, - decorators: [layout], -} as Meta; - -interface HelloWorldEmbeddablePanelProps { - getActions?(type: string): Promise<Action[]>; - hideHeader: boolean; - loading: boolean; - showShadow: boolean; - showBorder: boolean; - title: string; - viewMode: boolean; -} - -const HelloWorldEmbeddablePanel = forwardRef< - { embeddable: HelloWorldEmbeddable }, - HelloWorldEmbeddablePanelProps ->( - ( - { - getActions, - hideHeader, - loading, - showShadow, - showBorder, - title, - viewMode, - }: HelloWorldEmbeddablePanelProps, - ref - ) => { - const embeddable = useMemo(() => new HelloWorldEmbeddable({ id: `${Math.random()}` }, {}), []); - const theme$ = useMemo(() => new ReplaySubject<CoreTheme>(1), []); - const theme = useContext(ThemeContext) as CoreTheme; - - useEffect(() => theme$.next(theme), [theme$, theme]); - useEffect(() => { - embeddable.store.dispatch(actions.input.setTitle(title)); - }, [embeddable.store, title]); - useEffect(() => { - embeddable.store.dispatch( - actions.input.setViewMode(viewMode ? ViewMode.VIEW : ViewMode.EDIT) - ); - }, [embeddable.store, viewMode]); - useEffect( - () => void embeddable.store.dispatch(actions.output.setLoading(loading)), - [embeddable, loading] - ); - useImperativeHandle(ref, () => ({ embeddable })); - - return ( - <EmbeddablePanel - embeddable={embeddable} - getActions={getActions} - hideHeader={hideHeader} - showShadow={showShadow} - showBorder={showBorder} - /> - ); - } -); - -export const Default = HelloWorldEmbeddablePanel as Meta<HelloWorldEmbeddablePanelProps>; - -Default.args = { - hideHeader: false, - loading: false, - showShadow: false, - showBorder: false, - title: 'Hello World', - viewMode: true, -}; - -interface DefaultWithBadgesProps extends HelloWorldEmbeddablePanelProps { - badges: string[]; -} - -export function DefaultWithBadges({ badges, ...props }: DefaultWithBadgesProps) { - const getActions = useCallback( - async (type: string) => { - switch (type) { - case PANEL_BADGE_TRIGGER: - return ( - badges?.map<Action>((badge, id) => ({ - execute: async (...args) => action(`onClick(${badge})`)(...args), - getDisplayName: () => badge, - getIconType: () => ['help', 'search', undefined][id % 3], - id: `${id}`, - isCompatible: async () => true, - type: '', - })) ?? [] - ); - default: - return []; - } - }, - [badges] - ); - const ref = useRef<React.ComponentRef<typeof HelloWorldEmbeddablePanel>>(null); - - useEffect( - () => - void ref.current?.embeddable.store.dispatch( - actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) - ), - [getActions] - ); - - return <HelloWorldEmbeddablePanel ref={ref} {...props} getActions={getActions} />; -} - -DefaultWithBadges.args = { - ...Default.args, - badges: ['Help', 'Search', 'Something'], -}; - -DefaultWithBadges.argTypes = { - badges: { name: 'Badges' }, -}; - -interface DefaultWithContextMenuProps extends HelloWorldEmbeddablePanelProps { - items: string[]; -} - -export function DefaultWithContextMenu({ items, ...props }: DefaultWithContextMenuProps) { - const getActions = useCallback( - async (type: string) => { - switch (type) { - case CONTEXT_MENU_TRIGGER: - return ( - items?.map<Action>((item, id) => ({ - execute: async (...args) => action(`onClick(${item})`)(...args), - getDisplayName: () => item, - getIconType: () => ['help', 'search', undefined][id % 3], - id: `${id}`, - isCompatible: async () => true, - type: '', - })) ?? [] - ); - default: - return []; - } - }, - [items] - ); - const ref = useRef<React.ComponentRef<typeof HelloWorldEmbeddablePanel>>(null); - - useEffect( - () => - void ref.current?.embeddable.store.dispatch( - actions.input.setLastReloadRequestTime(new Date().getMilliseconds()) - ), - [getActions] - ); - - return <HelloWorldEmbeddablePanel ref={ref} {...props} getActions={getActions} />; -} - -DefaultWithContextMenu.args = { - ...Default.args, - items: ['Help', 'Search', 'Something'], -}; - -DefaultWithContextMenu.argTypes = { - items: { name: 'Context Menu Items' }, -}; - -interface DefaultWithErrorProps extends HelloWorldEmbeddablePanelProps { - message: string; -} - -export function DefaultWithError({ message, ...props }: DefaultWithErrorProps) { - const ref = useRef<React.ComponentRef<typeof HelloWorldEmbeddablePanel>>(null); - - useEffect( - () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), - [message] - ); - - return <HelloWorldEmbeddablePanel ref={ref} {...props} />; -} - -DefaultWithError.args = { - ...Default.args, - message: 'Something went wrong', -}; - -DefaultWithError.argTypes = { - message: { name: 'Message', control: { type: 'text' } }, -}; - -export function DefaultWithCustomError({ message, ...props }: DefaultWithErrorProps) { - const ref = useRef<React.ComponentRef<typeof HelloWorldEmbeddablePanel>>(null); - - useEffect(() => { - if (ref.current) { - ref.current.embeddable.catchError = (error) => { - return <EuiEmptyPrompt iconColor="warning" iconType="bug" body={error.message} />; - }; - } - }, []); - useEffect( - () => void ref.current?.embeddable.store.dispatch(actions.output.setError(new Error(message))), - [message] - ); - - return <HelloWorldEmbeddablePanel ref={ref} {...props} />; -} - -DefaultWithCustomError.args = { - ...Default.args, - message: 'Something went wrong', -}; - -DefaultWithCustomError.argTypes = { - message: { name: 'Message', control: { type: 'text' } }, -}; diff --git a/src/plugins/embeddable/public/__stories__/embeddable_root.stories.tsx b/src/plugins/embeddable/public/__stories__/embeddable_root.stories.tsx deleted file mode 100644 index 8a6addb0a368..000000000000 --- a/src/plugins/embeddable/public/__stories__/embeddable_root.stories.tsx +++ /dev/null @@ -1,78 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useMemo } from 'react'; -import { DecoratorFn, Meta } from '@storybook/react'; -import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; - -import { EmbeddableInput, EmbeddableRoot } from '..'; -import { HelloWorldEmbeddable } from './hello_world_embeddable'; - -const layout: DecoratorFn = (story) => { - return ( - <EuiFlexGroup direction="row" justifyContent="center"> - <EuiFlexItem grow={false} style={{ height: 300, width: 500 }}> - {story()} - </EuiFlexItem> - </EuiFlexGroup> - ); -}; - -export default { - title: 'components/EmbeddableRoot', - argTypes: { - loading: { - name: 'Loading', - control: { type: 'boolean' }, - }, - title: { - name: 'Title', - control: { type: 'text' }, - }, - }, - decorators: [layout], -} as Meta; - -interface DefaultProps { - error?: string; - loading?: boolean; - title: string; -} - -export function Default({ title, ...props }: DefaultProps) { - const id = useMemo(() => `${Math.random()}`, []); - const input = useMemo<EmbeddableInput>( - () => ({ - id, - title, - lastReloadRequestTime: new Date().getMilliseconds(), - }), - [id, title] - ); - // eslint-disable-next-line react-hooks/exhaustive-deps - const embeddable = useMemo(() => new HelloWorldEmbeddable(input, {}), []); - - return <EmbeddableRoot {...props} embeddable={embeddable} input={input} />; -} - -Default.args = { - title: 'Hello World', - loading: false, -}; - -export const DefaultWithError = Default.bind({}) as Meta<DefaultProps>; - -DefaultWithError.args = { - ...Default.args, - error: 'Something went wrong', -}; - -DefaultWithError.argTypes = { - error: { name: 'Error', control: { type: 'text' } }, -}; diff --git a/src/plugins/embeddable/public/__stories__/error_embeddable.stories.tsx b/src/plugins/embeddable/public/__stories__/error_embeddable.stories.tsx deleted file mode 100644 index ebd388e3d31c..000000000000 --- a/src/plugins/embeddable/public/__stories__/error_embeddable.stories.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { useEffect, useMemo } from 'react'; -import { Meta } from '@storybook/react'; - -import { ErrorEmbeddable } from '..'; - -export default { - title: 'components/ErrorEmbeddable', - argTypes: { - message: { - name: 'Message', - control: { type: 'text' }, - }, - }, -} as Meta; - -interface ErrorEmbeddableWrapperProps { - message: string; -} - -function ErrorEmbeddableWrapper({ message }: ErrorEmbeddableWrapperProps) { - const embeddable = useMemo( - () => new ErrorEmbeddable(message, { id: `${Math.random()}` }, undefined), - [message] - ); - useEffect(() => () => embeddable.destroy(), [embeddable]); - - return embeddable.render(); -} - -export const Default = ErrorEmbeddableWrapper as Meta<ErrorEmbeddableWrapperProps>; - -Default.args = { - message: 'Something went wrong', -}; diff --git a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx b/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx deleted file mode 100644 index ef19adedde94..000000000000 --- a/src/plugins/embeddable/public/__stories__/hello_world_embeddable.tsx +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { connect, Provider } from 'react-redux'; -import { EuiEmptyPrompt } from '@elastic/eui'; -import { Embeddable } from '..'; -import { createStore, State } from '../store'; - -export class HelloWorldEmbeddable extends Embeddable { - // eslint-disable-next-line @kbn/eslint/no_this_in_property_initializers - readonly store = createStore(this); - - readonly type = 'hello-world'; - - reload() {} - - render() { - const HelloWorld = connect((state: State) => ({ body: state.input.title }))(EuiEmptyPrompt); - - return ( - <Provider store={this.store}> - <HelloWorld /> - </Provider> - ); - } -} diff --git a/src/plugins/embeddable/public/index.ts b/src/plugins/embeddable/public/index.ts index 25a25b244714..22d845be9c93 100644 --- a/src/plugins/embeddable/public/index.ts +++ b/src/plugins/embeddable/public/index.ts @@ -22,8 +22,6 @@ export { defaultEmbeddableFactoryProvider, Embeddable, EmbeddableFactoryNotFoundError, - EmbeddableRenderer, - EmbeddableRoot, EmbeddableStateTransfer, ErrorEmbeddable, genericEmbeddableInputIsEqual, @@ -52,7 +50,6 @@ export { SELECT_RANGE_TRIGGER, shouldFetch$, shouldRefreshFilterCompareOptions, - useEmbeddableFactory, VALUE_CLICK_TRIGGER, ViewMode, withEmbeddableSubscription, @@ -72,7 +69,6 @@ export type { EmbeddableInstanceConfiguration, EmbeddableOutput, EmbeddablePackageState, - EmbeddableRendererProps, FilterableEmbeddable, IContainer, IEmbeddable, @@ -86,7 +82,6 @@ export type { SelfStyledEmbeddable, ValueClickContext, } from './lib'; -export { AttributeService, ATTRIBUTE_SERVICE_KEY } from './lib/attribute_service'; export type { EmbeddableSetup, EmbeddableSetupDependencies, diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.mock.tsx b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.mock.tsx deleted file mode 100644 index 0500ca563593..000000000000 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.mock.tsx +++ /dev/null @@ -1,35 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddableInput, SavedObjectEmbeddableInput } from '..'; -import { coreMock } from '@kbn/core/public/mocks'; -import { AttributeServiceOptions } from './attribute_service'; -import { CoreStart } from '@kbn/core/public'; -import { AttributeService, ATTRIBUTE_SERVICE_KEY } from '.'; - -export const mockAttributeService = < - A extends { title: string }, - V extends EmbeddableInput & { [ATTRIBUTE_SERVICE_KEY]: A } = EmbeddableInput & { - [ATTRIBUTE_SERVICE_KEY]: A; - }, - R extends SavedObjectEmbeddableInput = SavedObjectEmbeddableInput, - M extends unknown = unknown ->( - type: string, - options: AttributeServiceOptions<A, M>, - customCore?: jest.Mocked<CoreStart> -): AttributeService<A, V, R, M> => { - const core = customCore ? customCore : coreMock.createStart(); - return new AttributeService<A, V, R, M>( - type, - core.notifications.toasts, - options, - jest.fn().mockReturnValue(() => ({ getDisplayName: () => type })) - ); -}; diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.test.ts b/src/plugins/embeddable/public/lib/attribute_service/attribute_service.test.ts deleted file mode 100644 index 3b86bdfb7d66..000000000000 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.test.ts +++ /dev/null @@ -1,196 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ATTRIBUTE_SERVICE_KEY, AttributeServiceUnwrapResult } from './attribute_service'; -import { mockAttributeService } from './attribute_service.mock'; -import { coreMock } from '@kbn/core/public/mocks'; -import { OnSaveProps } from '@kbn/saved-objects-plugin/public/save_modal'; - -interface TestAttributes { - title: string; - testAttr1?: string; - testAttr2?: { array: unknown[]; testAttr3: string }; -} - -interface TestByValueInput { - id: string; - [ATTRIBUTE_SERVICE_KEY]: TestAttributes; -} - -describe('attributeService', () => { - const defaultTestType = 'defaultTestType'; - let attributes: TestAttributes; - let byValueInput: TestByValueInput; - let byReferenceInput: { id: string; savedObjectId: string }; - const defaultSaveMethod = ( - testAttributes: TestAttributes, - savedObjectId?: string - ): Promise<{ id: string }> => { - return new Promise(() => { - return { id: '123' }; - }); - }; - - const defaultUnwrapMethod = ( - savedObjectId: string - ): Promise<AttributeServiceUnwrapResult<TestAttributes>> => { - return new Promise(() => { - return { ...attributes }; - }); - }; - const defaultCheckForDuplicateTitle = (props: OnSaveProps): Promise<true> => { - return new Promise(() => { - return true; - }); - }; - const options = { - saveMethod: defaultSaveMethod, - unwrapMethod: defaultUnwrapMethod, - checkForDuplicateTitle: defaultCheckForDuplicateTitle, - }; - - beforeEach(() => { - attributes = { - title: 'ultra title', - testAttr1: 'neat first attribute', - testAttr2: { array: [1, 2, 3], testAttr3: 'super attribute' }, - }; - byValueInput = { - id: '456', - attributes, - }; - byReferenceInput = { - id: '456', - savedObjectId: '123', - }; - }); - - describe('determining input type', () => { - const defaultAttributeService = mockAttributeService<TestAttributes>(defaultTestType, options); - const customAttributeService = mockAttributeService<TestAttributes, TestByValueInput>( - defaultTestType, - options - ); - - it('can determine input type given default types', () => { - expect( - defaultAttributeService.inputIsRefType({ id: '456', savedObjectId: '123' }) - ).toBeTruthy(); - expect( - defaultAttributeService.inputIsRefType({ - id: '456', - attributes: { title: 'wow I am by value' }, - }) - ).toBeFalsy(); - }); - it('can determine input type given custom types', () => { - expect( - customAttributeService.inputIsRefType({ id: '456', savedObjectId: '123' }) - ).toBeTruthy(); - expect( - customAttributeService.inputIsRefType({ - id: '456', - [ATTRIBUTE_SERVICE_KEY]: { title: 'wow I am by value' }, - }) - ).toBeFalsy(); - }); - }); - - describe('unwrapping attributes', () => { - it('does not throw error when given reference type input with no unwrap method', async () => { - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, { - saveMethod: defaultSaveMethod, - checkForDuplicateTitle: jest.fn(), - }); - expect(await attributeService.unwrapAttributes(byReferenceInput)).toEqual({ - attributes: byReferenceInput, - }); - }); - - it('returns attributes when when given value type input', async () => { - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, options); - expect(await attributeService.unwrapAttributes(byValueInput)).toEqual({ attributes }); - }); - - it('runs attributes through a custom unwrap method', async () => { - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, { - saveMethod: defaultSaveMethod, - unwrapMethod: (savedObjectId) => { - return new Promise((resolve) => { - return resolve({ - attributes: { - ...attributes, - testAttr2: { array: [1, 2, 3, 4, 5], testAttr3: 'kibanana' }, - }, - }); - }); - }, - checkForDuplicateTitle: jest.fn(), - }); - expect(await attributeService.unwrapAttributes(byReferenceInput)).toEqual({ - attributes: { - ...attributes, - testAttr2: { array: [1, 2, 3, 4, 5], testAttr3: 'kibanana' }, - }, - }); - }); - }); - - describe('wrapping attributes', () => { - it('returns given attributes when use ref type is false', async () => { - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, options); - expect(await attributeService.wrapAttributes(attributes, false)).toEqual({ attributes }); - }); - - it('calls saveMethod with appropriate parameters', async () => { - const core = coreMock.createStart(); - const saveMethod = jest.fn(); - saveMethod.mockReturnValueOnce({}); - const attributeService = mockAttributeService<TestAttributes>( - defaultTestType, - { - saveMethod, - unwrapMethod: defaultUnwrapMethod, - checkForDuplicateTitle: defaultCheckForDuplicateTitle, - }, - core - ); - expect(await attributeService.wrapAttributes(attributes, true, byReferenceInput)).toEqual( - byReferenceInput - ); - expect(saveMethod).toHaveBeenCalledWith(attributes, '123'); - }); - - it('uses custom save method when given an id', async () => { - const saveMethod = jest.fn().mockReturnValue({ id: '123' }); - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, { - saveMethod, - unwrapMethod: defaultUnwrapMethod, - checkForDuplicateTitle: defaultCheckForDuplicateTitle, - }); - expect(await attributeService.wrapAttributes(attributes, true, byReferenceInput)).toEqual( - byReferenceInput - ); - expect(saveMethod).toHaveBeenCalledWith(attributes, byReferenceInput.savedObjectId); - }); - - it('uses custom save method given no id', async () => { - const saveMethod = jest.fn().mockReturnValue({ id: '678' }); - const attributeService = mockAttributeService<TestAttributes>(defaultTestType, { - saveMethod, - unwrapMethod: defaultUnwrapMethod, - checkForDuplicateTitle: defaultCheckForDuplicateTitle, - }); - expect(await attributeService.wrapAttributes(attributes, true)).toEqual({ - savedObjectId: '678', - }); - expect(saveMethod).toHaveBeenCalledWith(attributes, undefined); - }); - }); -}); diff --git a/src/plugins/embeddable/public/lib/attribute_service/index.ts b/src/plugins/embeddable/public/lib/attribute_service/index.ts deleted file mode 100644 index 7e41bfc6ceec..000000000000 --- a/src/plugins/embeddable/public/lib/attribute_service/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export { AttributeService, ATTRIBUTE_SERVICE_KEY } from './attribute_service'; diff --git a/src/plugins/embeddable/public/lib/containers/container.ts b/src/plugins/embeddable/public/lib/containers/container.ts index 8e7487323cf4..a160c469f05c 100644 --- a/src/plugins/embeddable/public/lib/containers/container.ts +++ b/src/plugins/embeddable/public/lib/containers/container.ts @@ -44,7 +44,6 @@ import { IContainer, PanelState, } from './i_container'; -import { reactEmbeddableRegistryHasKey } from '../../react_embeddable_system'; const getKeys = <T extends {}>(o: T): Array<keyof T> => Object.keys(o) as Array<keyof T>; @@ -548,17 +547,6 @@ export abstract class Container< } private async onPanelAdded(panel: PanelState) { - // do nothing if this panel's type is in the new Embeddable registry. - if (reactEmbeddableRegistryHasKey(panel.type)) { - this.updateOutput({ - embeddableLoaded: { - ...this.output.embeddableLoaded, - [panel.explicitInput.id]: true, - }, - } as Partial<TContainerOutput>); - return; - } - this.updateOutput({ embeddableLoaded: { ...this.output.embeddableLoaded, diff --git a/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts b/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts deleted file mode 100644 index de54efd2db6f..000000000000 --- a/src/plugins/embeddable/public/lib/embeddable_placement/embeddable_placement_registry.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -type GetPanelPlacementSettings<StateType> = (serializedState: StateType) => { - width?: number; - height?: number; - strategy?: string; -}; - -const registry: Map<string, GetPanelPlacementSettings<any>> = new Map(); - -export const registerEmbeddablePlacementStrategy = <StateType>( - panelType: string, - getPanelPlacementSettings: GetPanelPlacementSettings<StateType> -) => { - if (registry.has(panelType)) { - throw new Error(`Embeddable placement for embeddable type ${panelType} already exists`); - } - - registry.set(panelType, getPanelPlacementSettings); -}; - -export const getEmbeddablePlacementStrategy = (panelType: string) => { - return registry.get(panelType); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.test.tsx deleted file mode 100644 index 4def23c8801c..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.test.tsx +++ /dev/null @@ -1,125 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { of } from 'rxjs'; - -import { embeddablePluginMock } from '../../../mocks'; -import { applicationServiceMock } from '@kbn/core/public/mocks'; -import { Embeddable, EmbeddableInput, ViewMode } from '../..'; -import { canEditEmbeddable, editLegacyEmbeddable } from './edit_legacy_embeddable'; -import { ContactCardEmbeddable } from '../../test_samples'; -import { core, embeddableStart } from '../../../kibana_services'; - -const applicationMock = applicationServiceMock.createStartContract(); -const stateTransferMock = embeddablePluginMock.createStartContract().getStateTransfer(); - -// mock app id -core.application.currentAppId$ = of('superCoolCurrentApp'); - -class EditableEmbeddable extends Embeddable { - public readonly type = 'EDITABLE_EMBEDDABLE'; - - constructor(input: EmbeddableInput, editable: boolean) { - super(input, { - editUrl: 'www.google.com', - editable, - }); - } - - public reload() {} -} - -test('canEditEmbeddable returns true when edit url is available, in edit mode and editable', () => { - expect( - canEditEmbeddable(new EditableEmbeddable({ id: '123', viewMode: ViewMode.EDIT }, true)) - ).toBe(true); -}); - -test('canEditEmbeddable returns false when edit url is not available', async () => { - const embeddable = new ContactCardEmbeddable( - { - id: '123', - firstName: 'sue', - viewMode: ViewMode.EDIT, - }, - { - execAction: () => Promise.resolve(undefined), - } - ); - expect(canEditEmbeddable(embeddable)).toBe(false); -}); - -test('canEditEmbeddable returns false when edit url is available but in view mode', async () => { - expect( - canEditEmbeddable( - new EditableEmbeddable( - { - id: '123', - viewMode: ViewMode.VIEW, - }, - true - ) - ) - ).toBe(false); -}); - -test('canEditEmbeddable returns false when edit url is available, in edit mode, but not editable', async () => { - expect( - canEditEmbeddable( - new EditableEmbeddable( - { - id: '123', - viewMode: ViewMode.EDIT, - }, - false - ) - ) - ).toBe(false); -}); - -test('getEditHref returns the edit url', async () => { - const embeddable = new EditableEmbeddable({ id: '123', viewMode: ViewMode.EDIT }, true); - expect(await embeddable.getEditHref()).toBe(embeddable.getOutput().editUrl); -}); - -test('redirects to app using state transfer', async () => { - embeddableStart.getStateTransfer = jest.fn().mockReturnValue(stateTransferMock); - - applicationMock.currentAppId$ = of('superCoolCurrentApp'); - const testPath = '/test-path'; - const embeddable = new EditableEmbeddable( - { - id: '123', - viewMode: ViewMode.EDIT, - coolInput1: 1, - coolInput2: 2, - } as unknown as EmbeddableInput, - true - ); - embeddable.getOutput = jest.fn(() => ({ editApp: 'ultraVisualize', editPath: '/123' })); - embeddable.getAppContext = jest.fn().mockReturnValue({ - getCurrentPath: () => testPath, - }); - await editLegacyEmbeddable(embeddable); - expect(stateTransferMock.navigateToEditor).toHaveBeenCalledWith('ultraVisualize', { - path: '/123', - state: { - originatingApp: 'superCoolCurrentApp', - embeddableId: '123', - valueInput: { - id: '123', - viewMode: ViewMode.EDIT, - coolInput1: 1, - coolInput2: 2, - }, - originatingPath: testPath, - searchSessionId: undefined, - }, - }); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.tsx b/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.tsx deleted file mode 100644 index e99bbcfca22e..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/edit_legacy_embeddable.tsx +++ /dev/null @@ -1,99 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { firstValueFrom } from 'rxjs'; -import { LegacyCompatibleEmbeddable } from '../../../embeddable_panel/types'; -import { core, embeddableStart } from '../../../kibana_services'; -import { Container } from '../../containers'; -import { EmbeddableFactoryNotFoundError } from '../../errors'; -import { EmbeddableEditorState } from '../../state_transfer'; -import { isExplicitInputWithAttributes } from '../embeddable_factory'; -import { EmbeddableInput } from '../i_embeddable'; - -const getExplicitInput = (embeddable: LegacyCompatibleEmbeddable) => - (embeddable.getRoot() as Container)?.getInput()?.panels?.[embeddable.id]?.explicitInput ?? - embeddable.getInput(); - -const getAppTarget = async (embeddable: LegacyCompatibleEmbeddable) => { - const app = embeddable ? embeddable.getOutput().editApp : undefined; - const path = embeddable ? embeddable.getOutput().editPath : undefined; - if (!app || !path) return; - - const currentAppId = await firstValueFrom(core.application.currentAppId$); - if (!currentAppId) return { app, path }; - - const state: EmbeddableEditorState = { - originatingApp: currentAppId, - valueInput: getExplicitInput(embeddable), - embeddableId: embeddable.id, - searchSessionId: embeddable.getInput().searchSessionId, - originatingPath: embeddable.getAppContext()?.getCurrentPath?.(), - }; - return { app, path, state }; -}; - -export const editLegacyEmbeddable = async (embeddable: LegacyCompatibleEmbeddable) => { - const { editableWithExplicitInput } = embeddable.getOutput(); - - if (editableWithExplicitInput) { - const factory = embeddableStart.getEmbeddableFactory(embeddable.type); - if (!factory) { - throw new EmbeddableFactoryNotFoundError(embeddable.type); - } - - const oldExplicitInput = embeddable.getExplicitInput(); - let newExplicitInput: Partial<EmbeddableInput>; - try { - const explicitInputReturn = await factory.getExplicitInput( - oldExplicitInput, - embeddable.parent - ); - newExplicitInput = isExplicitInputWithAttributes(explicitInputReturn) - ? explicitInputReturn.newInput - : explicitInputReturn; - } catch (e) { - // error likely means user canceled editing - return; - } - embeddable.parent?.replaceEmbeddable(embeddable.id, newExplicitInput); - return; - } - - const appTarget = await getAppTarget(embeddable); - const stateTransfer = embeddableStart.getStateTransfer(); - if (appTarget) { - if (stateTransfer && appTarget.state) { - await stateTransfer.navigateToEditor(appTarget.app, { - path: appTarget.path, - state: appTarget.state, - }); - } else { - await core.application.navigateToApp(appTarget.app, { path: appTarget.path }); - } - return; - } - - const href = embeddable.getOutput().editUrl; - if (href) { - window.location.href = href; - return; - } -}; - -export const canEditEmbeddable = (embeddable: LegacyCompatibleEmbeddable) => { - return Boolean( - embeddable && - embeddable.getInput().viewMode === 'edit' && - embeddable.getOutput().editable && - !embeddable.getOutput().inlineEditable && - (embeddable.getOutput().editUrl || - (embeddable.getOutput().editApp && embeddable.getOutput().editPath) || - embeddable.getOutput().editableWithExplicitInput) - ); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts index daab774d7f35..63c1a6593478 100644 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts +++ b/src/plugins/embeddable/public/lib/embeddables/compatibility/legacy_embeddable_to_api.ts @@ -37,14 +37,11 @@ import { IEmbeddable, LegacyEmbeddableAPI, } from '../i_embeddable'; -import { canEditEmbeddable, editLegacyEmbeddable } from './edit_legacy_embeddable'; import { embeddableInputToSubject, embeddableOutputToSubject, viewModeToSubject, } from './embeddable_compatibility_utils'; -import { canLinkLegacyEmbeddable, linkLegacyEmbeddable } from './link_legacy_embeddable'; -import { canUnlinkLegacyEmbeddable, unlinkLegacyEmbeddable } from './unlink_legacy_embeddable'; export type CommonLegacyInput = EmbeddableInput & { savedObjectId?: string; timeRange: TimeRange }; export type CommonLegacyOutput = EmbeddableOutput & { indexPatterns: DataView[] }; @@ -93,13 +90,15 @@ export const legacyEmbeddableToApi = ( /** * Support editing of legacy embeddables */ - const onEdit = () => editLegacyEmbeddable(embeddable); + const onEdit = () => { + throw new Error('Edit legacy embeddable not supported'); + }; const getTypeDisplayName = () => embeddableStart.getEmbeddableFactory(embeddable.type)?.getDisplayName() ?? i18n.translate('embeddableApi.compatibility.defaultTypeDisplayName', { defaultMessage: 'chart', }); - const isEditingEnabled = () => canEditEmbeddable(embeddable); + const isEditingEnabled = () => false; /** * Performance tracking @@ -286,11 +285,15 @@ export const legacyEmbeddableToApi = ( panelDescription, defaultPanelDescription, - canLinkToLibrary: () => canLinkLegacyEmbeddable(embeddable), - linkToLibrary: () => linkLegacyEmbeddable(embeddable), + canLinkToLibrary: async () => false, + linkToLibrary: () => { + throw new Error('Link to library not supported for legacy embeddable'); + }, - canUnlinkFromLibrary: () => canUnlinkLegacyEmbeddable(embeddable), - unlinkFromLibrary: () => unlinkLegacyEmbeddable(embeddable), + canUnlinkFromLibrary: async () => false, + unlinkFromLibrary: () => { + throw new Error('Unlink from library not supported for legacy embeddable'); + }, savedObjectId, }, diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.test.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.test.ts deleted file mode 100644 index e0a546a18969..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.test.ts +++ /dev/null @@ -1,173 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddableInput, ErrorEmbeddable, IContainer, SavedObjectEmbeddableInput } from '../..'; -import { core } from '../../../kibana_services'; -import { embeddablePluginMock } from '../../../mocks'; -import { createHelloWorldContainerAndEmbeddable } from '../../../tests/helpers'; -import { ReferenceOrValueEmbeddable } from '../../reference_or_value_embeddable'; -import { - ContactCardEmbeddable, - ContactCardEmbeddableFactory, - ContactCardEmbeddableInput, -} from '../../test_samples'; -import { ViewMode } from '../../types'; -import { CommonLegacyEmbeddable } from './legacy_embeddable_to_api'; -import { canLinkLegacyEmbeddable, linkLegacyEmbeddable } from './link_legacy_embeddable'; - -let container: IContainer; -let embeddable: ContactCardEmbeddable & ReferenceOrValueEmbeddable; -const embeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); - -const defaultCapabilities = { - advancedSettings: {}, - visualize: { save: true }, - maps: { save: true }, - navLinks: {}, -}; - -beforeEach(async () => { - const result = await createHelloWorldContainerAndEmbeddable(); - container = result.container; - embeddable = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - ContactCardEmbeddableInput - >(result.embeddable, { - mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: result.embeddable.id }, - mockedByValueInput: { firstName: 'Kibanana', id: result.embeddable.id }, - }); - embeddable.updateInput({ viewMode: ViewMode.EDIT }); -}); - -const assignDefaultCapabilities = () => { - Object.defineProperty(core.application, 'capabilities', { - value: defaultCapabilities, - }); -}; - -test('Cannot link an Error Embeddable to the library', async () => { - assignDefaultCapabilities(); - const errorEmbeddable = new ErrorEmbeddable( - 'Wow what an awful error', - { id: ' 404' }, - embeddable.getRoot() as IContainer - ); - expect(await canLinkLegacyEmbeddable(errorEmbeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Cannot link an ES|QL Embeddable to the library', async () => { - assignDefaultCapabilities(); - const filterableEmbeddable = embeddablePluginMock.mockFilterableEmbeddable(embeddable, { - getFilters: () => [], - getQuery: () => ({ - esql: 'from logstash-* | limit 10', - }), - }); - expect( - await canLinkLegacyEmbeddable(filterableEmbeddable as unknown as CommonLegacyEmbeddable) - ).toBe(false); -}); - -test('Cannot link a visualize embeddable to the library without visualize save permissions', async () => { - Object.defineProperty(core.application, 'capabilities', { - value: { ...defaultCapabilities, visualize: { save: false } }, - }); - expect(await canLinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Can link an embeddable to the library when it has value type input', async () => { - assignDefaultCapabilities(); - embeddable.updateInput(await embeddable.getInputAsValueType()); - expect(await canLinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe(true); -}); - -test('Cannot link an embedable when its input is by reference', async () => { - assignDefaultCapabilities(); - embeddable.updateInput(await embeddable.getInputAsRefType()); - expect(await canLinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Cannot link an embedable when view mode is set to view', async () => { - assignDefaultCapabilities(); - embeddable.updateInput(await embeddable.getInputAsRefType()); - embeddable.updateInput({ viewMode: ViewMode.VIEW }); - expect(await canLinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Cannot link an embedable when it is not a child of a Dashboard container', async () => { - assignDefaultCapabilities(); - let orphanContactCard = await embeddableFactory.create({ - id: 'orphanContact', - firstName: 'Orphan', - }); - - orphanContactCard = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - ContactCardEmbeddableInput - >(orphanContactCard, { - mockedByReferenceInput: { savedObjectId: 'test', id: orphanContactCard.id }, - mockedByValueInput: { firstName: 'Kibanana', id: orphanContactCard.id }, - }); - expect( - await canLinkLegacyEmbeddable(orphanContactCard as unknown as CommonLegacyEmbeddable) - ).toBe(false); -}); - -test('Linking an embeddable replaces embeddableId and retains panel count', async () => { - assignDefaultCapabilities(); - const dashboard = embeddable.getRoot() as IContainer; - const originalPanelCount = Object.keys(dashboard.getInput().panels).length; - const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels)); - - await linkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable); - expect(Object.keys(container.getInput().panels).length).toEqual(originalPanelCount); - - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - expect(newPanelId).toBeDefined(); - const newPanel = container.getInput().panels[newPanelId!]; - expect(newPanel.type).toEqual(embeddable.type); -}); - -test('Link legacy embeddable returns reference type input', async () => { - assignDefaultCapabilities(); - const complicatedAttributes = { - attribute1: 'The best attribute', - attribute2: 22, - attribute3: ['array', 'of', 'strings'], - attribute4: { nestedattribute: 'hello from the nest' }, - }; - - embeddable = embeddablePluginMock.mockRefOrValEmbeddable<ContactCardEmbeddable>(embeddable, { - mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: embeddable.id }, - mockedByValueInput: { attributes: complicatedAttributes, id: embeddable.id } as EmbeddableInput, - }); - const dashboard = embeddable.getRoot() as IContainer; - const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels)); - await linkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable); - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - expect(newPanelId).toBeDefined(); - const newPanel = container.getInput().panels[newPanelId!]; - expect(newPanel.type).toEqual(embeddable.type); - expect((newPanel.explicitInput as unknown as { attributes: unknown }).attributes).toBeUndefined(); - expect((newPanel.explicitInput as SavedObjectEmbeddableInput).savedObjectId).toBe( - 'testSavedObjectId' - ); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.ts deleted file mode 100644 index 2126d1eff764..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/link_legacy_embeddable.ts +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { AggregateQuery } from '@kbn/es-query'; -import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; -import { apiIsPresentationContainer } from '@kbn/presentation-containers'; -import { core } from '../../../kibana_services'; -import { PanelNotFoundError } from '../../errors'; -import { isFilterableEmbeddable } from '../../filterable_embeddable'; -import { isReferenceOrValueEmbeddable } from '../../reference_or_value_embeddable'; -import { isErrorEmbeddable } from '../is_error_embeddable'; -import { CommonLegacyEmbeddable } from './legacy_embeddable_to_api'; -import { IContainer } from '../../containers'; - -export const canLinkLegacyEmbeddable = async (embeddable: CommonLegacyEmbeddable) => { - // linking and unlinking legacy embeddables is only supported on Dashboard - if ( - isErrorEmbeddable(embeddable) || - !(embeddable.getRoot() && embeddable.getRoot().isContainer) || - !isReferenceOrValueEmbeddable(embeddable) - ) { - return false; - } - - const { visualize } = core.application.capabilities; - const canSave = visualize.save; - - const { isOfAggregateQueryType } = await import('@kbn/es-query'); - const query = isFilterableEmbeddable(embeddable) && embeddable.getQuery(); - - // Textbased panels (i.e. ES|QL) should not save to library - const isTextBasedEmbeddable = isOfAggregateQueryType(query as AggregateQuery); - - return Boolean( - canSave && - isReferenceOrValueEmbeddable(embeddable) && - !embeddable.inputIsRefType(embeddable.getInput()) && - !isTextBasedEmbeddable - ); -}; - -export const linkLegacyEmbeddable = async (embeddable: CommonLegacyEmbeddable) => { - const root = embeddable.getRoot() as IContainer; - if (!isReferenceOrValueEmbeddable(embeddable) || !apiIsPresentationContainer(root)) { - throw new IncompatibleActionError(); - } - - // Link to library - const newInput = await embeddable.getInputAsRefType(); - embeddable.updateInput(newInput); - - // Replace panel in parent. - const panelToReplace = root.getInput().panels[embeddable.id]; - if (!panelToReplace) { - throw new PanelNotFoundError(); - } - await root.replacePanel(panelToReplace.explicitInput.id, { - panelType: embeddable.type, - initialState: { ...newInput }, - }); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.test.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.test.ts deleted file mode 100644 index 50c44f2c1b25..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.test.ts +++ /dev/null @@ -1,141 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ErrorEmbeddable, IContainer, PanelState, SavedObjectEmbeddableInput } from '../..'; -import { embeddablePluginMock } from '../../../mocks'; -import { createHelloWorldContainerAndEmbeddable } from '../../../tests/helpers'; -import { ReferenceOrValueEmbeddable } from '../../reference_or_value_embeddable'; -import { - ContactCardEmbeddable, - ContactCardEmbeddableFactory, - ContactCardEmbeddableInput, -} from '../../test_samples'; -import { ViewMode } from '../../types'; -import { CommonLegacyEmbeddable } from './legacy_embeddable_to_api'; -import { canLinkLegacyEmbeddable } from './link_legacy_embeddable'; -import { canUnlinkLegacyEmbeddable, unlinkLegacyEmbeddable } from './unlink_legacy_embeddable'; - -let container: IContainer; -let embeddable: ContactCardEmbeddable & ReferenceOrValueEmbeddable; - -const embeddableFactory = new ContactCardEmbeddableFactory((() => null) as any, {} as any); - -beforeEach(async () => { - const result = await createHelloWorldContainerAndEmbeddable(); - container = result.container; - embeddable = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - ContactCardEmbeddableInput - >(result.embeddable, { - mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: result.embeddable.id }, - mockedByValueInput: { firstName: 'Kibanana', id: result.embeddable.id }, - }); - embeddable.updateInput({ viewMode: ViewMode.EDIT }); -}); - -test('Can unlink returns false when given an Error Embeddable', async () => { - const errorEmbeddable = new ErrorEmbeddable( - 'Wow what an awful error', - { id: ' 404' }, - embeddable.getRoot() as IContainer - ); - expect( - await canUnlinkLegacyEmbeddable(errorEmbeddable as unknown as CommonLegacyEmbeddable) - ).toBe(false); -}); - -test('Can unlink returns true when embeddable on dashboard has reference type input', async () => { - embeddable.updateInput(await embeddable.getInputAsRefType()); - expect(await canUnlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - true - ); -}); - -test('Can unlink returns false when embeddable input is by value', async () => { - embeddable.updateInput(await embeddable.getInputAsValueType()); - expect(await canUnlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Can unlink returns false when view mode is set to view', async () => { - embeddable.updateInput(await embeddable.getInputAsRefType()); - embeddable.updateInput({ viewMode: ViewMode.VIEW }); - expect(await canUnlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Can unlink returns false when embeddable is not in a dashboard container', async () => { - let orphanContactCard = await embeddableFactory.create({ - id: 'orphanContact', - firstName: 'Orphan', - }); - - orphanContactCard = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - ContactCardEmbeddableInput - >(orphanContactCard, { - mockedByReferenceInput: { savedObjectId: 'test', id: orphanContactCard.id }, - mockedByValueInput: { firstName: 'Kibanana', id: orphanContactCard.id }, - }); - expect( - await canLinkLegacyEmbeddable(orphanContactCard as unknown as CommonLegacyEmbeddable) - ).toBe(false); - expect(await canUnlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable)).toBe( - false - ); -}); - -test('Unlink replaces embeddableId and retains panel count', async () => { - const dashboard = embeddable.getRoot() as IContainer; - const originalPanelCount = Object.keys(dashboard.getInput().panels).length; - const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels)); - await unlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable); - expect(Object.keys(container.getInput().panels).length).toEqual(originalPanelCount); - - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - expect(newPanelId).toBeDefined(); - const newPanel = container.getInput().panels[newPanelId!]; - expect(newPanel.type).toEqual(embeddable.type); -}); - -test('Unlink unwraps all attributes from savedObject', async () => { - const complicatedAttributes = { - attribute1: 'The best attribute', - attribute2: 22, - attribute3: ['array', 'of', 'strings'], - attribute4: { nestedattribute: 'hello from the nest' }, - }; - - embeddable = embeddablePluginMock.mockRefOrValEmbeddable< - ContactCardEmbeddable, - { attributes: unknown; id: string }, - SavedObjectEmbeddableInput - >(embeddable, { - mockedByReferenceInput: { savedObjectId: 'testSavedObjectId', id: embeddable.id }, - mockedByValueInput: { attributes: complicatedAttributes, id: embeddable.id }, - }); - const dashboard = embeddable.getRoot() as IContainer; - const originalPanelKeySet = new Set(Object.keys(dashboard.getInput().panels)); - await unlinkLegacyEmbeddable(embeddable as unknown as CommonLegacyEmbeddable); - const newPanelId = Object.keys(container.getInput().panels).find( - (key) => !originalPanelKeySet.has(key) - ); - expect(newPanelId).toBeDefined(); - const newPanel = container.getInput().panels[newPanelId!] as PanelState & { - explicitInput: { attributes: unknown }; - }; - expect(newPanel.type).toEqual(embeddable.type); - expect((newPanel.explicitInput as { attributes: unknown }).attributes).toEqual( - complicatedAttributes - ); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.ts b/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.ts deleted file mode 100644 index f4d0a3e0ac08..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/compatibility/unlink_legacy_embeddable.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { IncompatibleActionError } from '@kbn/ui-actions-plugin/public'; -import { apiIsPresentationContainer } from '@kbn/presentation-containers'; -import { IContainer, PanelState } from '../../containers'; -import { PanelNotFoundError } from '../../errors'; -import { isReferenceOrValueEmbeddable } from '../../reference_or_value_embeddable'; -import { ViewMode } from '../../types'; -import { isErrorEmbeddable } from '../is_error_embeddable'; -import { EmbeddableInput } from '../i_embeddable'; -import { CommonLegacyEmbeddable } from './legacy_embeddable_to_api'; - -export const canUnlinkLegacyEmbeddable = async (embeddable: CommonLegacyEmbeddable) => { - return Boolean( - isReferenceOrValueEmbeddable(embeddable) && - !isErrorEmbeddable(embeddable) && - embeddable.getInput()?.viewMode !== ViewMode.VIEW && - embeddable.getRoot() && - embeddable.getRoot().isContainer && - embeddable.inputIsRefType(embeddable.getInput()) - ); -}; - -export const unlinkLegacyEmbeddable = async (embeddable: CommonLegacyEmbeddable) => { - const root = embeddable.getRoot() as IContainer; - if (!isReferenceOrValueEmbeddable(embeddable) || !apiIsPresentationContainer(root)) { - throw new IncompatibleActionError(); - } - - // unlink and update input. - const newInput = await embeddable.getInputAsValueType(); - embeddable.updateInput(newInput); - - // replace panel in parent. - const panelToReplace = root.getInput().panels[embeddable.id] as PanelState<EmbeddableInput>; - if (!panelToReplace) { - throw new PanelNotFoundError(); - } - await root.replacePanel(panelToReplace.explicitInput.id, { - panelType: embeddable.type, - initialState: { ...newInput, title: embeddable.getTitle() }, - }); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable.test.tsx deleted file mode 100644 index 84160c9b391a..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -/* eslint-disable max-classes-per-file */ - -import { skip, take } from 'rxjs'; -import { Embeddable } from './embeddable'; -import { EmbeddableOutput, EmbeddableInput } from './i_embeddable'; -import { ViewMode } from '../types'; -import { ContactCardEmbeddable } from '../test_samples/embeddables/contact_card/contact_card_embeddable'; -import { - MockFilter, - FilterableEmbeddable, -} from '../test_samples/embeddables/filterable_embeddable'; - -class TestClass { - constructor() {} -} - -interface Output extends EmbeddableOutput { - testClass: TestClass; - inputUpdatedTimes: number; -} - -class OutputTestEmbeddable extends Embeddable<EmbeddableInput, Output> { - public readonly type = 'test'; - constructor() { - super( - { id: 'test', viewMode: ViewMode.VIEW }, - { testClass: new TestClass(), inputUpdatedTimes: 0 } - ); - - this.getInput$().subscribe(() => { - this.updateOutput({ inputUpdatedTimes: this.getOutput().inputUpdatedTimes + 1 }); - }); - } - - reload() {} -} - -class PhaseTestEmbeddable extends Embeddable<EmbeddableInput, EmbeddableOutput> { - public readonly type = 'phaseTest'; - constructor() { - super({ id: 'phaseTest', viewMode: ViewMode.VIEW }, {}); - } - public reportsEmbeddableLoad(): boolean { - return true; - } - reload() {} -} - -test('Embeddable calls input subscribers when changed', (done) => { - const hello = new ContactCardEmbeddable( - { id: '123', firstName: 'Brienne', lastName: 'Tarth' }, - { execAction: (() => null) as any } - ); - - const subscription = hello - .getInput$() - .pipe(skip(1)) - .subscribe((input) => { - expect(input.nameTitle).toEqual('Sir'); - done(); - subscription.unsubscribe(); - }); - - hello.updateInput({ nameTitle: 'Sir' }); -}); - -test('Embeddable reload is called if lastReloadRequest input time changes', async () => { - const hello = new FilterableEmbeddable({ id: '123', filters: [], lastReloadRequestTime: 0 }); - - hello.reload = jest.fn(); - - hello.updateInput({ lastReloadRequestTime: 1 }); - - expect(hello.reload).toBeCalledTimes(1); -}); - -test('Embeddable reload is called if lastReloadRequest input time changed and new input is used', async () => { - const hello = new FilterableEmbeddable({ id: '123', filters: [], lastReloadRequestTime: 0 }); - - const aFilter = {} as unknown as MockFilter; - hello.reload = jest.fn(() => { - // when reload is called embeddable already has new input - expect(hello.getInput().filters).toEqual([aFilter]); - }); - - hello.updateInput({ lastReloadRequestTime: 1, filters: [aFilter] }); - - expect(hello.reload).toBeCalledTimes(1); -}); - -test('Embeddable reload is not called if lastReloadRequest input time does not change', async () => { - const hello = new FilterableEmbeddable({ id: '123', filters: [], lastReloadRequestTime: 1 }); - - hello.reload = jest.fn(); - - hello.updateInput({ lastReloadRequestTime: 1 }); - - expect(hello.reload).toBeCalledTimes(0); -}); - -test('updating output state retains instance information', async () => { - const outputTest = new OutputTestEmbeddable(); - expect(outputTest.getOutput().testClass).toBeInstanceOf(TestClass); - expect(outputTest.getOutput().inputUpdatedTimes).toBe(1); - outputTest.updateInput({ viewMode: ViewMode.EDIT }); - expect(outputTest.getOutput().inputUpdatedTimes).toBe(2); - expect(outputTest.getOutput().testClass).toBeInstanceOf(TestClass); -}); - -test('fires phase events when output changes', async () => { - const phaseEventTest = new PhaseTestEmbeddable(); - let phaseEventCount = 0; - phaseEventTest.phase$.subscribe((event) => { - if (event) { - phaseEventCount++; - } - }); - expect(phaseEventCount).toBe(1); // loading is true by default which fires an event. - phaseEventTest.updateOutput({ loading: false }); - expect(phaseEventCount).toBe(2); - phaseEventTest.updateOutput({ rendered: true }); - expect(phaseEventCount).toBe(3); -}); - -test('updated$ called after reload and batches input/output changes', async () => { - const hello = new ContactCardEmbeddable( - { id: '123', firstName: 'Brienne', lastName: 'Tarth' }, - { execAction: (() => null) as any } - ); - - const reloadSpy = jest.spyOn(hello, 'reload'); - - const input$ = hello.getInput$().pipe(skip(1)); - let inputEmittedTimes = 0; - input$.subscribe(() => { - inputEmittedTimes++; - }); - - const updated$ = hello.getUpdated$(); - let updatedEmittedTimes = 0; - updated$.subscribe(() => { - updatedEmittedTimes++; - }); - const updatedPromise = updated$.pipe(take(1)).toPromise(); - - hello.updateInput({ nameTitle: 'Sir', lastReloadRequestTime: Date.now() }); - expect(reloadSpy).toHaveBeenCalledTimes(1); - expect(inputEmittedTimes).toBe(1); - expect(updatedEmittedTimes).toBe(0); - - await updatedPromise; - - expect(updatedEmittedTimes).toBe(1); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.test.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.test.tsx deleted file mode 100644 index a7a6fab89973..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.test.tsx +++ /dev/null @@ -1,67 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { waitFor } from '@testing-library/react'; -import { render, renderHook } from '@testing-library/react'; -import { - HelloWorldEmbeddable, - HelloWorldEmbeddableFactoryDefinition, - HELLO_WORLD_EMBEDDABLE, -} from '../../tests/fixtures'; -import { EmbeddableRenderer, useEmbeddableFactory } from './embeddable_renderer'; -import { embeddablePluginMock } from '../../mocks'; - -describe('useEmbeddableFactory', () => { - it('should update upstream value changes', async () => { - const { setup, doStart } = embeddablePluginMock.createInstance(); - const getFactory = setup.registerEmbeddableFactory( - HELLO_WORLD_EMBEDDABLE, - new HelloWorldEmbeddableFactoryDefinition() - ); - doStart(); - - const { result } = renderHook(() => - useEmbeddableFactory({ factory: getFactory(), input: { id: 'hello' } }) - ); - - const [, loading] = result.current; - - expect(loading).toBe(true); - - await waitFor(() => { - const [embeddable] = result.current; - expect(embeddable).toBeDefined(); - }); - }); -}); - -describe('<EmbeddableRenderer/>', () => { - test('Render embeddable', () => { - const embeddable = new HelloWorldEmbeddable({ id: 'hello' }); - const { getByTestId } = render(<EmbeddableRenderer embeddable={embeddable} />); - expect(getByTestId('helloWorldEmbeddable')).toBeInTheDocument(); - }); - - test('Render factory', async () => { - const { setup, doStart } = embeddablePluginMock.createInstance(); - const getFactory = setup.registerEmbeddableFactory( - HELLO_WORLD_EMBEDDABLE, - new HelloWorldEmbeddableFactoryDefinition() - ); - doStart(); - - const { getByTestId, queryByTestId } = render( - <EmbeddableRenderer factory={getFactory()} input={{ id: 'hello' }} /> - ); - expect(getByTestId('embedSpinner')).toBeInTheDocument(); - await waitFor(() => !queryByTestId('embedSpinner')); // wait until spinner disappears - expect(getByTestId('helloWorldEmbeddable')).toBeInTheDocument(); - }); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx deleted file mode 100644 index 14a064827e26..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_renderer.tsx +++ /dev/null @@ -1,165 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { useEffect, useState } from 'react'; -import { EmbeddableInput, IEmbeddable } from './i_embeddable'; -import { EmbeddableRoot } from './embeddable_root'; -import { EmbeddableFactory } from './embeddable_factory'; -import { ErrorEmbeddable } from './error_embeddable'; -import { isErrorEmbeddable } from './is_error_embeddable'; - -/** - * This type is a publicly exposed props of {@link EmbeddableRenderer} - * Union is used to validate that or factory or embeddable is passed in, but it can't be both simultaneously - * In case when embeddable is passed in, input is optional, because there is already an input inside of embeddable object - * In case when factory is used, then input is required, because it will be used as initial input to create an embeddable object - */ -export type EmbeddableRendererProps<I extends EmbeddableInput> = - | EmbeddableRendererPropsWithEmbeddable<I> - | EmbeddableRendererWithFactory<I>; - -interface EmbeddableRendererPropsWithEmbeddable<I extends EmbeddableInput> { - input?: I; - onInputUpdated?: (newInput: I) => void; - embeddable: IEmbeddable<I>; -} - -interface EmbeddableRendererWithFactory<I extends EmbeddableInput> { - input: I; - onInputUpdated?: (newInput: I) => void; - factory: EmbeddableFactory<I>; -} - -function isWithFactory<I extends EmbeddableInput>( - props: EmbeddableRendererProps<I> -): props is EmbeddableRendererWithFactory<I> { - return 'factory' in props; -} - -export function useEmbeddableFactory<I extends EmbeddableInput>({ - input, - factory, - onInputUpdated, -}: EmbeddableRendererWithFactory<I>) { - const [embeddable, setEmbeddable] = useState<IEmbeddable<I> | ErrorEmbeddable | undefined>( - undefined - ); - const [loading, setLoading] = useState<boolean>(false); - const [error, setError] = useState<string | undefined>(); - const latestInput = React.useRef(input); - useEffect(() => { - latestInput.current = input; - }, [input]); - - useEffect(() => { - let canceled = false; - - // keeping track of embeddables created by this component to be able to destroy them - let createdEmbeddableRef: IEmbeddable | ErrorEmbeddable | undefined; - setEmbeddable(undefined); - setLoading(true); - factory - .create(latestInput.current!) - .then((createdEmbeddable) => { - if (canceled) { - if (createdEmbeddable) { - createdEmbeddable.destroy(); - } - } else { - createdEmbeddableRef = createdEmbeddable; - setEmbeddable(createdEmbeddable); - } - }) - .catch((err) => { - if (canceled) return; - setError(err?.message); - }) - .finally(() => { - if (canceled) return; - setLoading(false); - }); - - return () => { - canceled = true; - if (createdEmbeddableRef) { - createdEmbeddableRef.destroy(); - } - }; - }, [factory]); - - useEffect(() => { - if (!embeddable) return; - if (isErrorEmbeddable(embeddable)) return; - if (!onInputUpdated) return; - const sub = embeddable.getInput$().subscribe((newInput) => { - onInputUpdated(newInput); - }); - return () => { - sub.unsubscribe(); - }; - }, [embeddable, onInputUpdated]); - - return [embeddable, loading, error] as const; -} - -/** - * Helper react component to render an embeddable - * Can be used if you have an embeddable object or an embeddable factory - * Supports updating input by passing `input` prop - * - * @remarks - * This component shouldn't be used inside an embeddable container to render embeddable children - * because children may lose inherited input, here is why: - * - * When passing `input` inside a prop, internally there is a call: - * - * ```ts - * embeddable.updateInput(input); - * ``` - * If you are simply rendering an embeddable, it's no problem. - * - * However when you are dealing with containers, - * you want to be sure to only pass into updateInput the actual state that changed. - * This is because calling child.updateInput({ foo }) will make foo explicit state. - * It cannot be inherited from it's parent. - * - * For example, on a dashboard, the time range is inherited by all children, - * unless they had their time range set explicitly. - * This is how "per panel time range" works. - * That action calls embeddable.updateInput({ timeRange }), - * and the time range will no longer be inherited from the container. - * - * see: https://github.com/elastic/kibana/pull/67783#discussion_r435447657 for more details. - * refer to: examples/embeddable_explorer for examples with correct usage of this component. - * - * @public - * @param props - {@link EmbeddableRendererProps} - */ -export const EmbeddableRenderer = <I extends EmbeddableInput>( - props: EmbeddableRendererProps<I> -) => { - if (isWithFactory(props)) { - return <EmbeddableByFactory {...props} />; - } - return <EmbeddableRoot embeddable={props.embeddable} input={props.input} />; -}; - -// -const EmbeddableByFactory = <I extends EmbeddableInput>({ - factory, - input, - onInputUpdated, -}: EmbeddableRendererWithFactory<I>) => { - const [embeddable, loading, error] = useEmbeddableFactory({ - factory, - input, - onInputUpdated, - }); - return <EmbeddableRoot embeddable={embeddable} loading={loading} error={error} input={input} />; -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.test.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_root.test.tsx deleted file mode 100644 index 65e23b01f0b8..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.test.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { HelloWorldEmbeddable, HelloWorldEmbeddableReact } from '../../tests/fixtures'; -import { EmbeddableRoot } from './embeddable_root'; -import { mount } from 'enzyme'; -import { findTestSubject } from '@elastic/eui/lib/test'; - -test('EmbeddableRoot renders an embeddable', async () => { - const embeddable = new HelloWorldEmbeddable({ id: 'hello' }); - const component = mount(<EmbeddableRoot embeddable={embeddable} />); - // Due to the way embeddables mount themselves on the dom node, they are not forced to be - // react components, and hence, we can't use the usual - // findTestSubject. - expect( - component.getDOMNode().querySelectorAll('[data-test-subj="helloWorldEmbeddable"]').length - ).toBe(1); - expect(findTestSubject(component, 'embedSpinner').length).toBe(0); - expect(findTestSubject(component, 'embedError').length).toBe(0); -}); - -test('EmbeddableRoot renders a React-based embeddable', async () => { - const embeddable = new HelloWorldEmbeddableReact({ id: 'hello' }); - const component = mount(<EmbeddableRoot embeddable={embeddable} />); - - expect(component.find('[data-test-subj="helloWorldEmbeddable"]')).toHaveLength(1); -}); - -test('EmbeddableRoot updates input', async () => { - const embeddable = new HelloWorldEmbeddable({ id: 'hello' }); - const component = mount(<EmbeddableRoot embeddable={embeddable} />); - const spy = jest.spyOn(embeddable, 'updateInput'); - const newInput = { id: 'hello', something: 'new' }; - component.setProps({ embeddable, input: newInput }); - expect(spy).toHaveBeenCalledWith(newInput); -}); - -test('EmbeddableRoot renders a spinner if loading an no embeddable given', async () => { - const component = mount(<EmbeddableRoot loading={true} />); - // Due to the way embeddables mount themselves on the dom node, they are not forced to be - // react components, and hence, we can't use the usual - // findTestSubject. - expect(findTestSubject(component, 'embedSpinner').length).toBe(1); - expect(findTestSubject(component, 'embedError').length).toBe(0); -}); - -test('EmbeddableRoot renders an error if given with no embeddable', async () => { - const component = mount(<EmbeddableRoot error="bad" />); - // Due to the way embeddables mount themselves on the dom node, they are not forced to be - // react components, and hence, we can't use the usual - // findTestSubject. - expect(findTestSubject(component, 'embedError').length).toBe(1); - expect(findTestSubject(component, 'embedSpinner').length).toBe(0); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx b/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx deleted file mode 100644 index 30d795aa8b42..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/embeddable_root.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { ReactNode, useCallback, useEffect, useRef, useState } from 'react'; -import { EuiLoadingSpinner } from '@elastic/eui'; -import { EuiText } from '@elastic/eui'; -import { isPromise } from '@kbn/std'; -import { MaybePromise } from '@kbn/utility-types'; -import { EmbeddableInput, EmbeddableOutput, IEmbeddable } from './i_embeddable'; -import { EmbeddableErrorHandler } from './embeddable_error_handler'; - -interface Props { - embeddable?: IEmbeddable<EmbeddableInput, EmbeddableOutput, MaybePromise<ReactNode>>; - loading?: boolean; - error?: string; - input?: EmbeddableInput; -} - -export const EmbeddableRoot: React.FC<Props> = ({ embeddable, loading, error, input }) => { - const [node, setNode] = useState<ReactNode | undefined>(); - const [embeddableHasMounted, setEmbeddableHasMounted] = useState(false); - const rootRef = useRef<HTMLDivElement | null>(null); - - const updateNode = useCallback((newNode: MaybePromise<ReactNode>) => { - if (isPromise(newNode)) { - newNode.then(updateNode); - return; - } - - setNode(newNode); - }, []); - - useEffect(() => { - if (!rootRef.current || !embeddable) { - return; - } - - setEmbeddableHasMounted(true); - updateNode(embeddable.render(rootRef.current) ?? undefined); - embeddable.render(rootRef.current); - }, [updateNode, embeddable]); - - useEffect(() => { - if (input && embeddable && embeddableHasMounted) { - embeddable.updateInput(input); - } - }, [input, embeddable, embeddableHasMounted]); - - return ( - <> - <div ref={rootRef}>{node}</div> - {loading && <EuiLoadingSpinner data-test-subj="embedSpinner" />} - {error && ( - <EmbeddableErrorHandler embeddable={embeddable} error={error}> - {({ message }) => <EuiText data-test-subj="embedError">{message}</EuiText>} - </EmbeddableErrorHandler> - )} - </> - ); -}; diff --git a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx b/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx deleted file mode 100644 index 77ed3a1bc2f1..000000000000 --- a/src/plugins/embeddable/public/lib/embeddables/error_embeddable.test.tsx +++ /dev/null @@ -1,54 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { setStubKibanaServices as setPresentationPanelMocks } from '@kbn/presentation-panel-plugin/public/mocks'; -import { waitFor, render } from '@testing-library/react'; -import { ErrorEmbeddable } from './error_embeddable'; -import { EmbeddableRoot } from './embeddable_root'; - -test('ErrorEmbeddable renders an embeddable', async () => { - setPresentationPanelMocks(); - const embeddable = new ErrorEmbeddable('some error occurred', { id: '123', title: 'Error' }); - const { getByTestId, getByText } = render(<EmbeddableRoot embeddable={embeddable} />); - - expect(getByTestId('embeddableStackError')).toBeVisible(); - await waitFor(() => getByTestId('errorMessageMarkdown')); // wait for lazy markdown component - expect(getByText(/some error occurred/i)).toBeVisible(); -}); - -test('ErrorEmbeddable renders an embeddable with markdown message', async () => { - setPresentationPanelMocks(); - const error = '[some link](http://localhost:5601/takeMeThere)'; - const embeddable = new ErrorEmbeddable(error, { id: '123', title: 'Error' }); - const { getByTestId, getByText } = render(<EmbeddableRoot embeddable={embeddable} />); - - expect(getByTestId('embeddableStackError')).toBeVisible(); - await waitFor(() => getByTestId('errorMessageMarkdown')); // wait for lazy markdown component - expect(getByText(/some link/i)).toMatchInlineSnapshot(` - <a - class="euiLink emotion-euiLink-primary" - href="http://localhost:5601/takeMeThere" - rel="noopener noreferrer" - target="_blank" - > - some link - <span - class="emotion-EuiExternalLinkIcon" - data-euiicon-type="popout" - role="presentation" - /> - <span - class="emotion-euiScreenReaderOnly" - > - (external, opens in a new tab or window) - </span> - </a> - `); -}); diff --git a/src/plugins/embeddable/public/lib/embeddables/index.ts b/src/plugins/embeddable/public/lib/embeddables/index.ts index 9e606efacaf1..92cd977d1f3d 100644 --- a/src/plugins/embeddable/public/lib/embeddables/index.ts +++ b/src/plugins/embeddable/public/lib/embeddables/index.ts @@ -14,9 +14,6 @@ export { Embeddable } from './embeddable'; export { EmbeddableErrorHandler } from './embeddable_error_handler'; export * from './embeddable_factory'; export * from './embeddable_factory_definition'; -export { EmbeddableRenderer, useEmbeddableFactory } from './embeddable_renderer'; -export type { EmbeddableRendererProps } from './embeddable_renderer'; -export { EmbeddableRoot } from './embeddable_root'; export { ErrorEmbeddable } from './error_embeddable'; export { isErrorEmbeddable } from './is_error_embeddable'; export { isEmbeddable } from './is_embeddable'; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx deleted file mode 100644 index 2f725881a6a4..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { EuiCard, EuiFlexItem, EuiFlexGroup, EuiFormRow } from '@elastic/eui'; - -import { Subscription } from 'rxjs'; -import { EuiButton } from '@elastic/eui'; -import * as Rx from 'rxjs'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { ContactCardEmbeddable, CONTACT_USER_TRIGGER } from './contact_card_embeddable'; - -interface Props { - embeddable: ContactCardEmbeddable; - execTrigger: UiActionsStart['executeTriggerActions']; -} - -interface State { - fullName: string; - firstName: string; -} - -export class ContactCardEmbeddableComponent extends React.Component<Props, State> { - private subscription?: Subscription; - private mounted: boolean = false; - - constructor(props: Props) { - super(props); - this.state = { - fullName: this.props.embeddable.getOutput().fullName, - firstName: this.props.embeddable.getInput().firstName, - }; - } - - componentDidMount() { - this.mounted = true; - this.subscription = Rx.merge( - this.props.embeddable.getOutput$(), - this.props.embeddable.getInput$() - ).subscribe(() => { - if (this.mounted) { - this.setState({ - fullName: this.props.embeddable.getOutput().fullName, - firstName: this.props.embeddable.getInput().firstName, - }); - } - }); - } - - componentWillUnmount() { - if (this.subscription) { - this.subscription.unsubscribe(); - } - this.mounted = false; - } - - emitContactTrigger = () => { - this.props.execTrigger(CONTACT_USER_TRIGGER, { - embeddable: this.props.embeddable, - }); - }; - - getCardFooterContent = () => ( - <EuiFlexGroup justifyContent="flexEnd"> - <EuiFlexItem grow={false}> - <EuiFormRow label=""> - <EuiButton - onClick={this.emitContactTrigger} - >{`Contact ${this.state.firstName}`}</EuiButton> - </EuiFormRow> - </EuiFlexItem> - </EuiFlexGroup> - ); - - render() { - return ( - <EuiCard - textAlign="left" - title={this.state.fullName} - footer={this.getCardFooterContent()} - description="" - /> - ); - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx deleted file mode 100644 index bb3dff9631fb..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable.tsx +++ /dev/null @@ -1,108 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import ReactDom from 'react-dom'; -import { Subscription } from 'rxjs'; -import type { ErrorLike } from '@kbn/expressions-plugin/common'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { Container } from '../../../containers'; -import { EmbeddableOutput, Embeddable, EmbeddableInput } from '../../../embeddables'; -import { CONTACT_CARD_EMBEDDABLE } from './contact_card_embeddable_factory'; -import { ContactCardEmbeddableComponent } from './contact_card'; - -export interface ContactCardEmbeddableInput extends EmbeddableInput { - firstName: string; - lastName?: string; - nameTitle?: string; -} - -export interface ContactCardEmbeddableOutput extends EmbeddableOutput { - fullName: string; - originalLastName?: string; -} - -export interface ContactCardEmbeddableOptions { - execAction: UiActionsStart['executeTriggerActions']; - outputOverrides?: Partial<ContactCardEmbeddableOutput>; -} - -function getFullName(input: ContactCardEmbeddableInput) { - const { nameTitle, firstName, lastName } = input; - const nameParts = [nameTitle, firstName, lastName].filter((name) => name !== undefined); - return nameParts.join(' '); -} - -export class ContactCardEmbeddable extends Embeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput -> { - private subscription: Subscription; - private node?: Element; - public readonly type: string = CONTACT_CARD_EMBEDDABLE; - - constructor( - initialInput: ContactCardEmbeddableInput, - protected readonly options: ContactCardEmbeddableOptions, - parent?: Container - ) { - super( - initialInput, - { - fullName: getFullName(initialInput), - originalLastName: initialInput.lastName, - defaultTitle: `Hello ${getFullName(initialInput)}`, - ...options.outputOverrides, - }, - parent - ); - - this.subscription = this.getInput$().subscribe(() => { - const fullName = getFullName(this.input); - this.updateOutput({ - fullName, - defaultTitle: `Hello ${fullName}`, - }); - }); - } - - public render(node: HTMLElement) { - this.node = node; - ReactDom.render( - <ContactCardEmbeddableComponent embeddable={this} execTrigger={this.options.execAction} />, - node - ); - } - - public catchError?(error: ErrorLike, node: HTMLElement) { - ReactDom.render(<div data-test-subj="error">{error.message}</div>, node); - - return () => ReactDom.unmountComponentAtNode(node); - } - - public destroy() { - super.destroy(); - this.subscription.unsubscribe(); - if (this.node) { - ReactDom.unmountComponentAtNode(this.node); - } - } - - public reload() {} - - public triggerError(error: ErrorLike, fatal = false) { - if (fatal) { - this.onFatalError(error); - } else { - this.updateOutput({ error }); - } - } -} - -export const CONTACT_USER_TRIGGER = 'CONTACT_USER_TRIGGER'; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.tsx deleted file mode 100644 index 79e0824b0275..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; - -import { CoreStart } from '@kbn/core/public'; -import { toMountPoint } from '@kbn/react-kibana-mount'; -import { EmbeddableFactoryDefinition } from '../../../embeddables'; -import { Container } from '../../../containers'; -import { ContactCardEmbeddable, ContactCardEmbeddableInput } from './contact_card_embeddable'; -import { ContactCardInitializer } from './contact_card_initializer'; - -export const CONTACT_CARD_EMBEDDABLE = 'CONTACT_CARD_EMBEDDABLE'; - -export class ContactCardEmbeddableFactory - implements EmbeddableFactoryDefinition<ContactCardEmbeddableInput> -{ - public readonly type = CONTACT_CARD_EMBEDDABLE; - savedObjectMetaData = { - name: 'Contact card', - type: CONTACT_CARD_EMBEDDABLE, - getIconForSavedObject: () => 'document', - }; - - constructor( - protected readonly execTrigger: UiActionsStart['executeTriggerActions'], - private readonly core: CoreStart - ) {} - - public async isEditable() { - return true; - } - - public getDisplayName() { - return i18n.translate('embeddableApi.samples.contactCard.displayName', { - defaultMessage: 'contact card', - }); - } - - public getDefaultInput() { - return {}; - } - - public getExplicitInput = (): Promise<Partial<ContactCardEmbeddableInput>> => { - return new Promise((resolve) => { - const modalSession = this.core.overlays.openModal( - toMountPoint( - <ContactCardInitializer - onCancel={() => { - modalSession.close(); - // @ts-expect-error - resolve(undefined); - }} - onCreate={(input: { firstName: string; lastName?: string }) => { - modalSession.close(); - resolve(input); - }} - />, - this.core - ), - { - 'data-test-subj': 'createContactCardEmbeddable', - } - ); - }); - }; - - public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { - return new ContactCardEmbeddable( - initialInput, - { - execAction: this.execTrigger, - }, - parent - ); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react.tsx deleted file mode 100644 index e2cc363b6ec3..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { ContactCardEmbeddableComponent } from './contact_card'; -import { ContactCardEmbeddable } from './contact_card_embeddable'; - -export class ContactCardEmbeddableReact extends ContactCardEmbeddable { - public render() { - return ( - <ContactCardEmbeddableComponent embeddable={this} execTrigger={this.options.execAction} /> - ); - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react_factory.ts deleted file mode 100644 index 28e651cd14d0..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_embeddable_react_factory.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Container } from '../../../containers'; -import { ContactCardEmbeddableInput } from './contact_card_embeddable'; -import { ContactCardEmbeddableFactory } from './contact_card_embeddable_factory'; -import { ContactCardEmbeddableReact } from './contact_card_embeddable_react'; - -export const CONTACT_CARD_EMBEDDABLE_REACT = 'CONTACT_CARD_EMBEDDABLE_REACT'; - -export class ContactCardEmbeddableReactFactory extends ContactCardEmbeddableFactory { - public readonly type = CONTACT_CARD_EMBEDDABLE_REACT as ContactCardEmbeddableFactory['type']; - - public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { - return new ContactCardEmbeddableReact( - initialInput, - { - execAction: this.execTrigger, - }, - parent - ); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable.tsx deleted file mode 100644 index eaeeb592d9eb..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable.tsx +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ContactCardEmbeddable } from './contact_card_embeddable'; - -export class ContactCardExportableEmbeddable extends ContactCardEmbeddable { - public getInspectorAdapters = () => { - return { - tables: { - allowCsvExport: true, - tables: { - layer1: { - type: 'datatable', - columns: [ - { id: 'firstName', name: 'First Name' }, - { id: 'originalLastName', name: 'Last Name' }, - ], - rows: [ - { - firstName: this.getInput().firstName, - orignialLastName: this.getInput().lastName, - }, - ], - }, - }, - }, - }; - }; -} - -export const CONTACT_EXPORTABLE_USER_TRIGGER = 'CONTACT_EXPORTABLE_USER_TRIGGER'; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable_factory.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable_factory.tsx deleted file mode 100644 index 7ddf5f1711b6..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_exportable_embeddable_factory.tsx +++ /dev/null @@ -1,81 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; - -import { CoreStart } from '@kbn/core/public'; -import { toMountPoint } from '@kbn/react-kibana-mount'; -import { EmbeddableFactoryDefinition } from '../../../embeddables'; -import { Container } from '../../../containers'; -import { ContactCardEmbeddableInput } from './contact_card_embeddable'; -import { ContactCardExportableEmbeddable } from './contact_card_exportable_embeddable'; -import { ContactCardInitializer } from './contact_card_initializer'; - -export const CONTACT_CARD_EXPORTABLE_EMBEDDABLE = 'CONTACT_CARD_EXPORTABLE_EMBEDDABLE'; - -export class ContactCardExportableEmbeddableFactory - implements EmbeddableFactoryDefinition<ContactCardEmbeddableInput> -{ - public readonly type = CONTACT_CARD_EXPORTABLE_EMBEDDABLE; - - constructor( - private readonly execTrigger: UiActionsStart['executeTriggerActions'], - private readonly core: CoreStart - ) {} - - public async isEditable() { - return true; - } - - public getDefaultInput() { - return {}; - } - - public getDisplayName() { - return i18n.translate('embeddableApi.samples.contactCard.displayName', { - defaultMessage: 'contact card', - }); - } - - public getExplicitInput = (): Promise<Partial<ContactCardEmbeddableInput>> => { - return new Promise((resolve) => { - const modalSession = this.core.overlays.openModal( - toMountPoint( - <ContactCardInitializer - onCancel={() => { - modalSession.close(); - // @ts-expect-error - resolve(undefined); - }} - onCreate={(input: { firstName: string; lastName?: string }) => { - modalSession.close(); - resolve(input); - }} - />, - this.core - ), - { - 'data-test-subj': 'createContactCardEmbeddable', - } - ); - }); - }; - - public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { - return new ContactCardExportableEmbeddable( - initialInput, - { - execAction: this.execTrigger, - }, - parent - ); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.tsx deleted file mode 100644 index 10c07ef5d5aa..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/contact_card_initializer.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - EuiForm, - EuiFormRow, - EuiFieldText, - EuiModalHeader, - EuiModalHeaderTitle, - EuiModalBody, - EuiButton, - EuiModalFooter, - EuiButtonEmpty, -} from '@elastic/eui'; -import React, { Component } from 'react'; - -export interface ContactCardInitializerProps { - onCreate: (name: { lastName?: string; firstName: string }) => void; - onCancel: () => void; -} - -interface State { - firstName?: string; - lastName?: string; -} - -export class ContactCardInitializer extends Component<ContactCardInitializerProps, State> { - constructor(props: ContactCardInitializerProps) { - super(props); - this.state = {}; - } - - render() { - return ( - <div> - <EuiModalHeader> - <EuiModalHeaderTitle>Create a new greeting card</EuiModalHeaderTitle> - </EuiModalHeader> - - <EuiModalBody> - <EuiForm> - <EuiFormRow label="First name"> - <EuiFieldText - name="popfirst" - value={this.state.firstName} - onChange={(e) => this.setState({ firstName: e.target.value })} - /> - </EuiFormRow> - - <EuiFormRow label="Last name"> - <EuiFieldText - name="popfirst" - value={this.state.lastName} - placeholder="optional" - onChange={(e) => this.setState({ lastName: e.target.value })} - /> - </EuiFormRow> - </EuiForm> - </EuiModalBody> - - <EuiModalFooter> - <EuiButtonEmpty onClick={this.props.onCancel}>Cancel</EuiButtonEmpty> - - <EuiButton - isDisabled={!this.state.firstName} - onClick={() => { - if (this.state.firstName) { - this.props.onCreate({ - firstName: this.state.firstName, - ...(this.state.lastName ? { lastName: this.state.lastName } : {}), - }); - } - }} - fill - > - Create - </EuiButton> - </EuiModalFooter> - </div> - ); - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/descriptive_contact_card_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/descriptive_contact_card_embeddable_factory.ts deleted file mode 100644 index fa251fc7cdb0..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/descriptive_contact_card_embeddable_factory.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; - -import { Container, EmbeddableFactoryDefinition } from '../../..'; -import { ContactCardEmbeddable, ContactCardEmbeddableInput } from './contact_card_embeddable'; - -export const DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE = 'DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE'; - -export class DescriptiveContactCardEmbeddableFactory - implements EmbeddableFactoryDefinition<ContactCardEmbeddableInput> -{ - public readonly type = DESCRIPTIVE_CONTACT_CARD_EMBEDDABLE; - - constructor(protected readonly execTrigger: UiActionsStart['executeTriggerActions']) {} - - public async isEditable() { - return true; - } - - public getDisplayName() { - return 'descriptive contact card'; - } - - public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { - return new ContactCardEmbeddable( - initialInput, - { - execAction: this.execTrigger, - outputOverrides: { - defaultDescription: 'This is a family friend', - }, - }, - parent - ); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/index.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/index.ts deleted file mode 100644 index 5344e74647c2..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/index.ts +++ /dev/null @@ -1,18 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './contact_card'; -export * from './contact_card_embeddable'; -export * from './contact_card_embeddable_factory'; -export * from './contact_card_exportable_embeddable'; -export * from './contact_card_exportable_embeddable_factory'; -export * from './contact_card_embeddable_react'; -export * from './contact_card_embeddable_react_factory'; -export * from './contact_card_initializer'; -export * from './slow_contact_card_embeddable_factory'; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts deleted file mode 100644 index aeb871433252..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import { Container, EmbeddableFactoryDefinition } from '../../..'; -import { ContactCardEmbeddable, ContactCardEmbeddableInput } from './contact_card_embeddable'; -import { CONTACT_CARD_EMBEDDABLE } from './contact_card_embeddable_factory'; - -interface SlowContactCardEmbeddableFactoryOptions { - execAction: UiActionsStart['executeTriggerActions']; - loadTickCount?: number; -} - -export class SlowContactCardEmbeddableFactory - implements EmbeddableFactoryDefinition<ContactCardEmbeddableInput> -{ - private loadTickCount = 0; - public readonly type = CONTACT_CARD_EMBEDDABLE; - - constructor(private readonly options: SlowContactCardEmbeddableFactoryOptions) { - if (options.loadTickCount) { - this.loadTickCount = options.loadTickCount; - } - } - - public async isEditable() { - return true; - } - - public getDisplayName() { - return 'slow to load contact card'; - } - - public create = async (initialInput: ContactCardEmbeddableInput, parent?: Container) => { - for (let i = 0; i < this.loadTickCount; i++) { - await Promise.resolve(); - } - return new ContactCardEmbeddable(initialInput, { execAction: this.options.execAction }, parent); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/empty_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/empty_embeddable.tsx deleted file mode 100644 index f05f4f8153e8..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/empty_embeddable.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Embeddable, EmbeddableInput, EmbeddableOutput } from '../..'; - -export const EMPTY_EMBEDDABLE = 'EMPTY_EMBEDDABLE'; - -export class EmptyEmbeddable extends Embeddable<EmbeddableInput, EmbeddableOutput> { - public readonly type = EMPTY_EMBEDDABLE; - constructor(initialInput: EmbeddableInput) { - super(initialInput, {}); - } - public render() {} - public reload() {} -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx deleted file mode 100644 index 3dc9952d6da4..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container.tsx +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Container, ContainerInput } from '../../containers'; -import { EmbeddableStart } from '../../../plugin'; -import { MockFilter } from './filterable_embeddable'; - -export const FILTERABLE_CONTAINER = 'FILTERABLE_CONTAINER'; - -export interface FilterableContainerInput extends ContainerInput { - filters: MockFilter[]; -} - -/** - * interfaces are not allowed to specify a sub-set of the required types until - * https://github.com/microsoft/TypeScript/issues/15300 is fixed so we use a type - * here instead - */ -type InheritedChildrenInput = { - filters: MockFilter[]; - id?: string; -}; - -export class FilterableContainer extends Container< - InheritedChildrenInput, - FilterableContainerInput -> { - public readonly type = FILTERABLE_CONTAINER; - - constructor( - initialInput: FilterableContainerInput, - getFactory: EmbeddableStart['getEmbeddableFactory'], - parent?: Container - ) { - super(initialInput, { embeddableLoaded: {} }, getFactory, parent); - } - - public getInheritedInput() { - return { - filters: this.input.filters, - viewMode: this.input.viewMode, - }; - } - - public render() {} -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container_factory.ts deleted file mode 100644 index b394f905d337..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_container_factory.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { Container, EmbeddableFactoryDefinition } from '../..'; -import { - FilterableContainer, - FilterableContainerInput, - FILTERABLE_CONTAINER, -} from './filterable_container'; -import { EmbeddableStart } from '../../../plugin'; - -export class FilterableContainerFactory - implements EmbeddableFactoryDefinition<FilterableContainerInput> -{ - public readonly type = FILTERABLE_CONTAINER; - - constructor( - private readonly getFactory: () => Promise<EmbeddableStart['getEmbeddableFactory']> - ) {} - - public getDisplayName() { - return i18n.translate('embeddableApi.samples.filterableContainer.displayName', { - defaultMessage: 'filterable dashboard', - }); - } - - public async isEditable() { - return true; - } - - public create = async (initialInput: FilterableContainerInput, parent?: Container) => { - const getEmbeddableFactory = await this.getFactory(); - return new FilterableContainer(initialInput, getEmbeddableFactory, parent); - }; -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable.tsx deleted file mode 100644 index ee32fa6e2642..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { IContainer } from '../../containers'; -import { EmbeddableOutput, EmbeddableInput, Embeddable } from '../../embeddables'; - -/** @internal */ -export interface MockFilter { - $state?: {}; - meta: {}; - query?: {}; -} - -export const FILTERABLE_EMBEDDABLE = 'FILTERABLE_EMBEDDABLE'; - -export interface FilterableEmbeddableInput extends EmbeddableInput { - filters: MockFilter[]; -} - -export class FilterableEmbeddable extends Embeddable<FilterableEmbeddableInput, EmbeddableOutput> { - public readonly type = FILTERABLE_EMBEDDABLE; - constructor(initialInput: FilterableEmbeddableInput, parent?: IContainer) { - super(initialInput, {}, parent); - } - - public getInspectorAdapters(): Record<string, string> { - const inspectorAdapters: Record<string, string> = { - filters: `My filters are ${JSON.stringify(this.input.filters)}`, - }; - return inspectorAdapters; - } - - public render() {} - - public reload() {} -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts deleted file mode 100644 index cba773effb9e..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/filterable_embeddable_factory.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { i18n } from '@kbn/i18n'; -import { - FilterableEmbeddable, - FilterableEmbeddableInput, - FILTERABLE_EMBEDDABLE, -} from './filterable_embeddable'; -import { EmbeddableFactoryDefinition } from '../../embeddables'; -import { IContainer } from '../../containers'; - -export class FilterableEmbeddableFactory - implements EmbeddableFactoryDefinition<FilterableEmbeddableInput> -{ - public readonly type = FILTERABLE_EMBEDDABLE; - - public async isEditable() { - return true; - } - - public getDisplayName() { - return i18n.translate('embeddableApi.samples.filterableEmbeddable.displayName', { - defaultMessage: 'filterable', - }); - } - - public async create(initialInput: FilterableEmbeddableInput, parent?: IContainer) { - return new FilterableEmbeddable(initialInput, parent); - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx deleted file mode 100644 index fe772a1f9a00..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container.tsx +++ /dev/null @@ -1,72 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import ReactDOM from 'react-dom'; -import { I18nProvider } from '@kbn/i18n-react'; -import { Container, ViewMode, ContainerInput } from '../..'; -import { HelloWorldContainerComponent } from './hello_world_container_component'; -import { EmbeddableStart } from '../../../plugin'; -import { EmbeddableContainerSettings } from '../../containers/i_container'; - -export const HELLO_WORLD_CONTAINER = 'HELLO_WORLD_CONTAINER'; - -/** - * interfaces are not allowed to specify a sub-set of the required types until - * https://github.com/microsoft/TypeScript/issues/15300 is fixed so we use a type - * here instead - */ -type InheritedInput = { - id: string; - viewMode: ViewMode; - lastName: string; -}; - -interface HelloWorldContainerInput extends ContainerInput { - lastName?: string; -} - -interface HelloWorldContainerOptions { - getEmbeddableFactory?: EmbeddableStart['getEmbeddableFactory']; -} - -export class HelloWorldContainer extends Container<InheritedInput, HelloWorldContainerInput> { - public readonly type = HELLO_WORLD_CONTAINER; - - constructor( - input: ContainerInput<{ firstName: string; lastName: string }>, - options: HelloWorldContainerOptions, - initializeSettings?: EmbeddableContainerSettings - ) { - super( - input, - { embeddableLoaded: {} }, - options.getEmbeddableFactory || (() => undefined), - undefined, - initializeSettings - ); - } - - public getInheritedInput(id: string) { - return { - id, - viewMode: this.input.viewMode || ViewMode.EDIT, - lastName: this.input.lastName || 'foo', - }; - } - - public render(node: HTMLElement) { - ReactDOM.render( - <I18nProvider> - <HelloWorldContainerComponent container={this} /> - </I18nProvider>, - node - ); - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx b/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx deleted file mode 100644 index 7bc322c3a1dd..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/hello_world_container_component.tsx +++ /dev/null @@ -1,100 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React, { Component, RefObject } from 'react'; -import { Subscription } from 'rxjs'; - -import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; - -import { IContainer, PanelState } from '../..'; -import { EmbeddablePanel } from '../../../embeddable_panel'; - -interface Props { - container: IContainer; -} - -interface State { - panels: { [key: string]: PanelState }; - loaded: { [key: string]: boolean }; -} - -export class HelloWorldContainerComponent extends Component<Props, State> { - private roots: { [key: string]: RefObject<HTMLDivElement> } = {}; - private mounted: boolean = false; - private inputSubscription?: Subscription; - private outputSubscription?: Subscription; - - constructor(props: Props) { - super(props); - - Object.values(this.props.container.getInput().panels).forEach((panelState) => { - this.roots[panelState.explicitInput.id] = React.createRef(); - }); - - this.state = { - loaded: this.props.container.getOutput().embeddableLoaded, - panels: this.props.container.getInput().panels, - }; - } - - public async componentDidMount() { - this.mounted = true; - - this.inputSubscription = this.props.container.getInput$().subscribe(() => { - if (this.mounted) { - this.setState({ panels: this.props.container.getInput().panels }); - } - }); - - this.outputSubscription = this.props.container.getOutput$().subscribe(() => { - if (this.mounted) { - this.setState({ loaded: this.props.container.getOutput().embeddableLoaded }); - } - }); - } - - public componentWillUnmount() { - this.mounted = false; - this.props.container.destroy(); - - if (this.inputSubscription) { - this.inputSubscription.unsubscribe(); - } - - if (this.outputSubscription) { - this.outputSubscription.unsubscribe(); - } - } - - public render() { - return ( - <div> - <h2>HELLO WORLD! These are my precious embeddable children:</h2> - <EuiSpacer size="l" /> - <EuiFlexGroup>{this.renderList()}</EuiFlexGroup> - </div> - ); - } - - private renderList() { - const list = Object.values(this.state.panels).map((panelState) => { - const item = ( - <EuiFlexItem key={panelState.explicitInput.id}> - <EmbeddablePanel - embeddable={() => - this.props.container.untilEmbeddableLoaded(panelState.explicitInput.id) - } - /> - </EuiFlexItem> - ); - return item; - }); - return list; - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/index.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/index.ts deleted file mode 100644 index 97f6d3162228..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/index.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './contact_card'; -export * from './empty_embeddable'; -export * from './filterable_container'; -export * from './filterable_container_factory'; -export * from './filterable_embeddable'; -export * from './filterable_embeddable_factory'; -export * from './hello_world_container'; -export * from './hello_world_container_component'; -export * from './time_range_container'; -export * from './time_range_embeddable_factory'; -export * from './time_range_embeddable'; diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_container.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_container.ts deleted file mode 100644 index a7d306c86ed8..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_container.ts +++ /dev/null @@ -1,54 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { TimeRange } from '@kbn/es-query'; -import { ContainerInput, Container, ContainerOutput, EmbeddableStart } from '../../..'; - -/** - * interfaces are not allowed to specify a sub-set of the required types until - * https://github.com/microsoft/TypeScript/issues/15300 is fixed so we use a type - * here instead - */ -type InheritedChildrenInput = { - timeRange: TimeRange; - id?: string; -}; - -interface ContainerTimeRangeInput extends ContainerInput<InheritedChildrenInput> { - timeRange: TimeRange; -} - -const TIME_RANGE_CONTAINER = 'TIME_RANGE_CONTAINER'; - -export class TimeRangeContainer extends Container< - InheritedChildrenInput, - ContainerTimeRangeInput, - ContainerOutput -> { - public readonly type = TIME_RANGE_CONTAINER; - constructor( - initialInput: ContainerTimeRangeInput, - getFactory: EmbeddableStart['getEmbeddableFactory'], - parent?: Container - ) { - super(initialInput, { embeddableLoaded: {} }, getFactory, parent); - } - - public getAllDataViews() { - return []; - } - - public getInheritedInput() { - return { timeRange: this.input.timeRange }; - } - - public render() {} - - public reload() {} -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable.ts deleted file mode 100644 index fa9dca4071bb..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable.ts +++ /dev/null @@ -1,37 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import type { TimeRange } from '@kbn/es-query'; -import { EmbeddableOutput, Embeddable, EmbeddableInput, IContainer } from '../../..'; - -export interface EmbeddableTimeRangeInput extends EmbeddableInput { - timeRange: TimeRange; -} - -export const TIME_RANGE_EMBEDDABLE = 'TIME_RANGE_EMBEDDABLE'; - -export class TimeRangeEmbeddable extends Embeddable<EmbeddableTimeRangeInput, EmbeddableOutput> { - public readonly type = TIME_RANGE_EMBEDDABLE; - - constructor(initialInput: EmbeddableTimeRangeInput, parent?: IContainer) { - const { title: defaultTitle, description: defaultDescription } = initialInput; - super( - initialInput, - { - defaultTitle, - defaultDescription, - }, - parent - ); - } - - public render() {} - - public reload() {} -} diff --git a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable_factory.ts b/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable_factory.ts deleted file mode 100644 index fefbfd5df95d..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/embeddables/time_range_embeddable_factory.ts +++ /dev/null @@ -1,33 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { IContainer, EmbeddableFactoryDefinition } from '../../..'; -import { - TIME_RANGE_EMBEDDABLE, - TimeRangeEmbeddable, - EmbeddableTimeRangeInput, -} from './time_range_embeddable'; - -export class TimeRangeEmbeddableFactory - implements EmbeddableFactoryDefinition<EmbeddableTimeRangeInput> -{ - public readonly type = TIME_RANGE_EMBEDDABLE; - - public async isEditable() { - return true; - } - - public async create(initialInput: EmbeddableTimeRangeInput, parent?: IContainer) { - return new TimeRangeEmbeddable(initialInput, parent); - } - - public getDisplayName() { - return 'time range'; - } -} diff --git a/src/plugins/embeddable/public/lib/test_samples/index.ts b/src/plugins/embeddable/public/lib/test_samples/index.ts deleted file mode 100644 index b27497d8d8d2..000000000000 --- a/src/plugins/embeddable/public/lib/test_samples/index.ts +++ /dev/null @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -export * from './embeddables'; diff --git a/src/plugins/embeddable/public/mocks.tsx b/src/plugins/embeddable/public/mocks.tsx index fcabaa7cdb6c..7db4efd34e48 100644 --- a/src/plugins/embeddable/public/mocks.tsx +++ b/src/plugins/embeddable/public/mocks.tsx @@ -35,13 +35,9 @@ import { import { setKibanaServices } from './kibana_services'; import { SelfStyledOptions } from './lib/self_styled_embeddable/types'; import { EmbeddablePublicPlugin } from './plugin'; -import { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_system'; +import { registerReactEmbeddableFactory } from './react_embeddable_system'; import { registerAddFromLibraryType } from './add_from_library/registry'; -export { mockAttributeService } from './lib/attribute_service/attribute_service.mock'; export type Setup = jest.Mocked<EmbeddableSetup>; export type Start = jest.Mocked<EmbeddableStart>; @@ -103,14 +99,12 @@ const createSetupContract = (): Setup => { registerReactEmbeddableFactory: jest.fn().mockImplementation(registerReactEmbeddableFactory), registerEmbeddableFactory: jest.fn(), registerEnhancement: jest.fn(), - setCustomEmbeddableFactoryProvider: jest.fn(), }; return setupContract; }; const createStartContract = (): Start => { const startContract: Start = { - reactEmbeddableRegistryHasKey: jest.fn().mockImplementation(reactEmbeddableRegistryHasKey), getEmbeddableFactories: jest.fn(), getEmbeddableFactory: jest.fn(), telemetry: jest.fn(), @@ -118,7 +112,6 @@ const createStartContract = (): Start => { inject: jest.fn(), getAllMigrations: jest.fn(), getStateTransfer: jest.fn(() => createEmbeddableStateTransferMock() as EmbeddableStateTransfer), - getAttributeService: jest.fn(), }; return startContract; }; diff --git a/src/plugins/embeddable/public/plugin.test.ts b/src/plugins/embeddable/public/plugin.test.ts index b51b7e7488a6..00a19f8e9f56 100644 --- a/src/plugins/embeddable/public/plugin.test.ts +++ b/src/plugins/embeddable/public/plugin.test.ts @@ -9,83 +9,6 @@ import { coreMock } from '@kbn/core/public/mocks'; import { testPlugin } from './tests/test_plugin'; -import { EmbeddableFactoryProvider } from './types'; -import { defaultEmbeddableFactoryProvider } from './lib'; -import { HelloWorldEmbeddable } from './tests/fixtures'; - -test('can set custom embeddable factory provider', async () => { - const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const { setup, doStart } = testPlugin(coreSetup, coreStart); - - const customProvider: EmbeddableFactoryProvider = (def) => ({ - ...defaultEmbeddableFactoryProvider(def), - getDisplayName: () => 'Intercepted!', - }); - - setup.setCustomEmbeddableFactoryProvider(customProvider); - setup.registerEmbeddableFactory('test', { - type: 'test', - latestVersion: '1.0.0', - create: () => Promise.resolve(undefined), - getDisplayName: () => 'Test', - isEditable: () => Promise.resolve(true), - }); - - const start = doStart(); - const factory = start.getEmbeddableFactory('test'); - expect(factory!.getDisplayName()).toEqual('Intercepted!'); -}); - -test('custom embeddable factory provider test for intercepting embeddable creation and destruction', async () => { - const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const { setup, doStart } = testPlugin(coreSetup, coreStart); - - let updateCount = 0; - const customProvider: EmbeddableFactoryProvider = (def) => { - return { - ...defaultEmbeddableFactoryProvider(def), - create: async (input, parent) => { - const embeddable = await defaultEmbeddableFactoryProvider(def).create(input, parent); - if (embeddable) { - const subscription = embeddable.getInput$().subscribe( - () => { - updateCount++; - }, - () => {}, - () => { - subscription.unsubscribe(); - updateCount = 0; - } - ); - } - return embeddable; - }, - }; - }; - - setup.setCustomEmbeddableFactoryProvider(customProvider); - setup.registerEmbeddableFactory('test', { - type: 'test', - latestVersion: '1.0.0', - create: (input, parent) => Promise.resolve(new HelloWorldEmbeddable(input, parent)), - getDisplayName: () => 'Test', - isEditable: () => Promise.resolve(true), - }); - - const start = doStart(); - const factory = start.getEmbeddableFactory('test'); - - const embeddable = await factory?.create({ id: '123' }); - embeddable!.updateInput({ title: 'boo' }); - // initial subscription, plus the second update. - expect(updateCount).toEqual(2); - - embeddable!.destroy(); - await new Promise((resolve) => process.nextTick(resolve)); - expect(updateCount).toEqual(0); -}); describe('embeddable factory', () => { const coreSetup = coreMock.createSetup(); diff --git a/src/plugins/embeddable/public/plugin.tsx b/src/plugins/embeddable/public/plugin.tsx index 801b518a0bd0..ef339e5bacc2 100644 --- a/src/plugins/embeddable/public/plugin.tsx +++ b/src/plugins/embeddable/public/plugin.tsx @@ -27,7 +27,6 @@ import type { ContentManagementPublicStart } from '@kbn/content-management-plugi import type { SavedObjectTaggingOssPluginStart } from '@kbn/saved-objects-tagging-oss-plugin/public'; import { EmbeddableFactoryRegistry, - EmbeddableFactoryProvider, EnhancementsRegistry, EnhancementRegistryDefinition, EnhancementRegistryItem, @@ -39,12 +38,9 @@ import { EmbeddableOutput, defaultEmbeddableFactoryProvider, IEmbeddable, - SavedObjectEmbeddableInput, } from './lib'; import { EmbeddableFactoryDefinition } from './lib/embeddables/embeddable_factory_definition'; import { EmbeddableStateTransfer } from './lib/state_transfer'; -import { ATTRIBUTE_SERVICE_KEY, AttributeService } from './lib/attribute_service'; -import { AttributeServiceOptions } from './lib/attribute_service/attribute_service'; import { EmbeddableStateWithType, CommonEmbeddableStartContract } from '../common/types'; import { getExtractFunction, @@ -54,10 +50,7 @@ import { } from '../common/lib'; import { getAllMigrations } from '../common/lib/get_all_migrations'; import { setKibanaServices } from './kibana_services'; -import { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_system'; +import { registerReactEmbeddableFactory } from './react_embeddable_system'; import { registerAddFromLibraryType } from './add_from_library/registry'; export interface EmbeddableSetupDependencies { @@ -114,18 +107,9 @@ export interface EmbeddableSetup { * @deprecated */ registerEnhancement: (enhancement: EnhancementRegistryDefinition) => void; - /** - * @deprecated - */ - setCustomEmbeddableFactoryProvider: (customProvider: EmbeddableFactoryProvider) => void; } export interface EmbeddableStart extends PersistableStateService<EmbeddableStateWithType> { - /** - * Checks if a {@link ReactEmbeddableFactory} has been registered using {@link registerReactEmbeddableFactory} - */ - reactEmbeddableRegistryHasKey: (type: string) => boolean; - /** * @deprecated use {@link registerReactEmbeddableFactory} instead. */ @@ -142,26 +126,12 @@ export interface EmbeddableStart extends PersistableStateService<EmbeddableState */ getEmbeddableFactories: () => IterableIterator<EmbeddableFactory>; getStateTransfer: (storage?: Storage) => EmbeddableStateTransfer; - getAttributeService: < - A extends { title: string }, - V extends EmbeddableInput & { - [ATTRIBUTE_SERVICE_KEY]: A; - } = EmbeddableInput & { - [ATTRIBUTE_SERVICE_KEY]: A; - }, - R extends SavedObjectEmbeddableInput = SavedObjectEmbeddableInput, - M extends unknown = unknown - >( - type: string, - options: AttributeServiceOptions<A, M> - ) => AttributeService<A, V, R, M>; } export class EmbeddablePublicPlugin implements Plugin<EmbeddableSetup, EmbeddableStart> { private readonly embeddableFactoryDefinitions: Map<string, EmbeddableFactoryDefinition> = new Map(); private readonly embeddableFactories: EmbeddableFactoryRegistry = new Map(); private readonly enhancements: EnhancementsRegistry = new Map(); - private customEmbeddableFactoryProvider?: EmbeddableFactoryProvider; private stateTransferService: EmbeddableStateTransfer = {} as EmbeddableStateTransfer; private isRegistryReady = false; private appList?: ReadonlyMap<string, PublicAppInfo>; @@ -178,25 +148,12 @@ export class EmbeddablePublicPlugin implements Plugin<EmbeddableSetup, Embeddabl registerEmbeddableFactory: this.registerEmbeddableFactory, registerEnhancement: this.registerEnhancement, - setCustomEmbeddableFactoryProvider: (provider: EmbeddableFactoryProvider) => { - if (this.customEmbeddableFactoryProvider) { - throw new Error( - 'Custom embeddable factory provider is already set, and can only be set once' - ); - } - this.customEmbeddableFactoryProvider = provider; - }, }; } public start(core: CoreStart, deps: EmbeddableStartDependencies): EmbeddableStart { this.embeddableFactoryDefinitions.forEach((def) => { - this.embeddableFactories.set( - def.type, - this.customEmbeddableFactoryProvider - ? this.customEmbeddableFactoryProvider(def) - : defaultEmbeddableFactoryProvider(def) - ); + this.embeddableFactories.set(def.type, defaultEmbeddableFactoryProvider(def)); }); this.appListSubscription = core.application.applications$.subscribe((appList) => { @@ -224,12 +181,8 @@ export class EmbeddablePublicPlugin implements Plugin<EmbeddableSetup, Embeddabl ); const embeddableStart: EmbeddableStart = { - reactEmbeddableRegistryHasKey, - getEmbeddableFactory: this.getEmbeddableFactory, getEmbeddableFactories: this.getEmbeddableFactories, - getAttributeService: (type: string, options) => - new AttributeService(type, core.notifications.toasts, options, this.getEmbeddableFactory), getStateTransfer: (storage?: Storage) => storage ? new EmbeddableStateTransfer( @@ -339,12 +292,7 @@ export class EmbeddablePublicPlugin implements Plugin<EmbeddableSetup, Embeddabl if (!this.embeddableFactories.get(type)) { const def = this.embeddableFactoryDefinitions.get(type); if (!def) return; - this.embeddableFactories.set( - type, - this.customEmbeddableFactoryProvider - ? this.customEmbeddableFactoryProvider(def) - : defaultEmbeddableFactoryProvider(def) - ); + this.embeddableFactories.set(type, defaultEmbeddableFactoryProvider(def)); } }; } diff --git a/src/plugins/embeddable/public/react_embeddable_system/index.ts b/src/plugins/embeddable/public/react_embeddable_system/index.ts index d0bd95e32e10..8b1b59da6767 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/index.ts +++ b/src/plugins/embeddable/public/react_embeddable_system/index.ts @@ -7,9 +7,6 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -export { - reactEmbeddableRegistryHasKey, - registerReactEmbeddableFactory, -} from './react_embeddable_registry'; +export { registerReactEmbeddableFactory } from './react_embeddable_registry'; export { ReactEmbeddableRenderer } from './react_embeddable_renderer'; export type { DefaultEmbeddableApi, ReactEmbeddableFactory } from './types'; diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx index aa3e9b0e9967..43f8541fbab7 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.test.tsx @@ -9,7 +9,6 @@ import { registerReactEmbeddableFactory, - reactEmbeddableRegistryHasKey, getReactEmbeddableFactory, } from './react_embeddable_registry'; import { ReactEmbeddableFactory } from './types'; @@ -33,9 +32,4 @@ describe('react embeddable registry', () => { registerReactEmbeddableFactory('test', getTestEmbeddableFactory); expect(getReactEmbeddableFactory('test')).toEqual(returnedFactory); }); - - it('can check if a factory is registered', () => { - expect(reactEmbeddableRegistryHasKey('test')).toBe(true); - expect(reactEmbeddableRegistryHasKey('notRegistered')).toBe(false); - }); }); diff --git a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts index 0d007f85f797..046b63d5531a 100644 --- a/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts +++ b/src/plugins/embeddable/public/react_embeddable_system/react_embeddable_registry.ts @@ -40,8 +40,6 @@ export const registerReactEmbeddableFactory = < registry[type] = getFactory; }; -export const reactEmbeddableRegistryHasKey = (key: string) => registry[key] !== undefined; - export const getReactEmbeddableFactory = async < SerializedState extends object = object, RuntimeState extends object = SerializedState, 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 edf52244c2d4..2119e6de03a8 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 @@ -18,7 +18,7 @@ import { import { PresentationPanel, PresentationPanelProps } from '@kbn/presentation-panel-plugin/public'; import { ComparatorDefinition, StateComparators } from '@kbn/presentation-publishing'; import React, { useEffect, useImperativeHandle, useMemo, useRef } from 'react'; -import { BehaviorSubject, combineLatest, debounceTime, skip, Subscription, switchMap } from 'rxjs'; +import { BehaviorSubject, combineLatest, debounceTime, map, skip, Subscription } from 'rxjs'; import { v4 as generateId } from 'uuid'; import { getReactEmbeddableFactory } from './react_embeddable_registry'; import { @@ -65,6 +65,7 @@ export const ReactEmbeddableRenderer = < | 'hideLoader' | 'hideHeader' | 'hideInspector' + | 'setDragHandles' | 'getActions' >; hidePanelChrome?: boolean; @@ -141,15 +142,7 @@ export const ReactEmbeddableRenderer = < .pipe( skip(1), debounceTime(ON_STATE_CHANGE_DEBOUNCE), - switchMap(() => { - const isAsync = - apiRegistration.serializeState.prototype?.name === 'AsyncFunction'; - return isAsync - ? (apiRegistration.serializeState() as Promise< - SerializedPanelState<SerializedState> - >) - : Promise.resolve(apiRegistration.serializeState()); - }) + map(() => apiRegistration.serializeState()) ) .subscribe((nextSerializedState) => { onAnyStateChange(nextSerializedState); diff --git a/src/plugins/embeddable/public/tests/container.test.ts b/src/plugins/embeddable/public/tests/container.test.ts deleted file mode 100644 index 1209f54fb886..000000000000 --- a/src/plugins/embeddable/public/tests/container.test.ts +++ /dev/null @@ -1,817 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { coreMock } from '@kbn/core/public/mocks'; -import * as Rx from 'rxjs'; -import { skip } from 'rxjs'; -import { EmbeddableOutput, isErrorEmbeddable, SavedObjectEmbeddableInput, ViewMode } from '../lib'; -import { ERROR_EMBEDDABLE_TYPE } from '../lib/embeddables/error_embeddable'; -import { - ContactCardEmbeddable, - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, -} from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable'; -import { CONTACT_CARD_EMBEDDABLE } from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { SlowContactCardEmbeddableFactory } from '../lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory'; -import { - FilterableContainer, - FilterableContainerInput, -} from '../lib/test_samples/embeddables/filterable_container'; -import { - FilterableEmbeddable, - FilterableEmbeddableInput, - FILTERABLE_EMBEDDABLE, - MockFilter, -} from '../lib/test_samples/embeddables/filterable_embeddable'; -import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; -import { HelloWorldEmbeddableFactoryDefinition, HELLO_WORLD_EMBEDDABLE } from './fixtures'; -import { createHelloWorldContainerAndEmbeddable, of } from './helpers'; -import { testPlugin } from './test_plugin'; - -describe('container initialization', () => { - const panels = { - '123': { - explicitInput: { id: '123' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - '456': { - explicitInput: { id: '456' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - '789': { - explicitInput: { id: '789' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }; - - const expectEmbeddableLoaded = (container: HelloWorldContainer, id: string) => { - expect(container.getOutput().embeddableLoaded['123']).toBe(true); - const embeddable = container.getChild<ContactCardEmbeddable>('123'); - expect(embeddable).toBeDefined(); - expect(embeddable.id).toBe('123'); - }; - - it('initializes embeddables', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels, - }); - - expectEmbeddableLoaded(container, '123'); - expectEmbeddableLoaded(container, '456'); - expectEmbeddableLoaded(container, '789'); - }); - - it('initializes embeddables once and only once with multiple input updates', async () => { - const { container, contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels, - }); - container.updateInput({ lastReloadRequestTime: 1 }); - container.updateInput({ lastReloadRequestTime: 2 }); - expect(contactCardCreateSpy).toHaveBeenCalledTimes(4); - }); - - it('initializes embeddables in order', async () => { - const childIdInitializeOrder = ['456', '123', '789']; - const { contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( - { - id: 'hello', - panels, - }, - {}, - { childIdInitializeOrder } - ); - - await new Promise((r) => setTimeout(r, 1)); - for (const [index, orderedId] of childIdInitializeOrder.entries()) { - expect(contactCardCreateSpy).toHaveBeenNthCalledWith( - index + 1, - expect.objectContaining({ id: orderedId }), - expect.anything() // parent passed into create method - ); - } - }); - - it('initializes embeddables in order with partial order arg', async () => { - const childIdInitializeOrder = ['789', 'idontexist']; - const { contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( - { - id: 'hello', - panels, - }, - {}, - { childIdInitializeOrder } - ); - const expectedInitializeOrder = ['789', '123', '456']; - - await new Promise((r) => setTimeout(r, 1)); - for (const [index, orderedId] of expectedInitializeOrder.entries()) { - expect(contactCardCreateSpy).toHaveBeenNthCalledWith( - index + 1, - expect.objectContaining({ id: orderedId }), - expect.anything() // parent passed into create method - ); - } - }); - - it('initializes embeddables in order, awaiting each', async () => { - const childIdInitializeOrder = ['456', '123', '789']; - const { container, contactCardCreateSpy } = await createHelloWorldContainerAndEmbeddable( - { - id: 'hello', - panels, - }, - {}, - { childIdInitializeOrder, initializeSequentially: true } - ); - - const untilEmbeddableLoadedMock = jest.spyOn(container, 'untilEmbeddableLoaded'); - - await new Promise((r) => setTimeout(r, 10)); - - for (const [index, orderedId] of childIdInitializeOrder.entries()) { - await container.untilEmbeddableLoaded(orderedId); - expect(contactCardCreateSpy).toHaveBeenNthCalledWith( - index + 1, - expect.objectContaining({ id: orderedId }), - expect.anything() // parent passed into create method - ); - expect(untilEmbeddableLoadedMock).toHaveBeenCalledWith(orderedId); - } - }); -}); - -test('Container.addNewEmbeddable', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {} }, - { - firstName: 'Susy', - } - ); - expect(embeddable).toBeDefined(); - - if (!isErrorEmbeddable(embeddable)) { - expect(embeddable.getInput().firstName).toBe('Susy'); - } else { - expect(false).toBe(true); - } - - const embeddableInContainer = container.getChild<ContactCardEmbeddable>(embeddable.id); - expect(embeddableInContainer).toBeDefined(); - expect(embeddableInContainer.id).toBe(embeddable.id); -}); - -test('Container.removeEmbeddable removes and cleans up', async () => { - const { start } = await createHelloWorldContainerAndEmbeddable(); - - const container = new HelloWorldContainer( - { - id: 'hello', - panels: { - '123': { - explicitInput: { id: '123', firstName: 'Sam', lastName: 'Tarley' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - const embeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, { - firstName: 'Susy', - lastName: 'Q', - }); - - if (isErrorEmbeddable(embeddable)) { - expect(false).toBe(true); - return; - } - - embeddable.updateInput({ lastName: 'Z' }); - - container - .getOutput$() - .pipe(skip(1)) - .subscribe(() => { - const noFind = container.getChild<ContactCardEmbeddable>(embeddable.id); - expect(noFind).toBeUndefined(); - - expect(container.getInput().panels[embeddable.id]).toBeUndefined(); - if (isErrorEmbeddable(embeddable)) { - expect(false).toBe(true); - } - - expect(() => embeddable.updateInput({ nameTitle: 'Sir' })).toThrowError(); - expect(container.getOutput().embeddableLoaded[embeddable.id]).toBeUndefined(); - }); - - container.removeEmbeddable(embeddable.id); -}); - -test('Container.input$ is notified when child embeddable input is updated', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {} }, - { - firstName: 'Susy', - lastName: 'Q', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const changes = jest.fn(); - - expect(changes).toHaveBeenCalledTimes(0); - - const subscription = container.getInput$().subscribe(changes); - - expect(changes).toHaveBeenCalledTimes(1); - - embeddable.updateInput({ lastName: 'Z' }); - - expect(changes).toHaveBeenCalledTimes(2); - - expect(embeddable.getInput().lastName === 'Z'); - - embeddable.updateInput({ lastName: embeddable.getOutput().originalLastName }); - - expect(embeddable.getInput().lastName === 'Q'); - - expect(changes).toBeCalledTimes(3); - - subscription.unsubscribe(); - - embeddable.updateInput({ nameTitle: 'Dr.' }); - - expect(changes).toBeCalledTimes(3); -}); - -test('Container.input$', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {} }, - { - firstName: 'Susy', - id: 'Susy', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const changes = jest.fn(); - const input = container.getInput(); - expect(input.panels[embeddable.id].explicitInput).toEqual({ firstName: 'Susy', id: 'Susy' }); - - const subscription = container.getInput$().subscribe(changes); - embeddable.updateInput({ nameTitle: 'Dr.' }); - expect(container.getInput().panels[embeddable.id].explicitInput).toEqual({ - nameTitle: 'Dr.', - firstName: 'Susy', - id: 'Susy', - }); - subscription.unsubscribe(); -}); - -test('Container.getInput$ not triggered if state is the same', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {} }, - { - firstName: 'Susy', - id: 'Susy', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const changes = jest.fn(); - const input = container.getInput(); - expect(input.panels[embeddable.id].explicitInput).toEqual({ - id: 'Susy', - firstName: 'Susy', - }); - const subscription = container.getInput$().subscribe(changes); - embeddable.updateInput({ nameTitle: 'Dr.' }); - expect(changes).toBeCalledTimes(2); - embeddable.updateInput({ nameTitle: 'Dr.' }); - expect(changes).toBeCalledTimes(2); - subscription.unsubscribe(); -}); - -test('Container view mode change propagates to children', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, - { - firstName: 'Susy', - id: 'Susy', - } - ); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); - - container.updateInput({ viewMode: ViewMode.EDIT }); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); -}); - -test(`Container updates its state when a child's input is updated`, async () => { - const { container, embeddable, start } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, - { - id: '123', - firstName: 'Susy', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const containerSubscription = Rx.merge(container.getInput$(), container.getOutput$()).subscribe( - () => { - const child = container.getChild<ContactCardEmbeddable>(embeddable.id); - if ( - container.getOutput().embeddableLoaded[embeddable.id] && - child.getInput().nameTitle === 'Dr.' - ) { - containerSubscription.unsubscribe(); - - // Make sure a brand new container built off the output of container also creates an embeddable - // with "Dr.", not the default the embeddable was first added with. Makes sure changed input - // is preserved with the container. - const containerClone = new HelloWorldContainer(container.getInput(), { - getEmbeddableFactory: start.getEmbeddableFactory, - }); - const cloneSubscription = Rx.merge( - containerClone.getOutput$(), - containerClone.getInput$() - ).subscribe(() => { - const childClone = containerClone.getChild<ContactCardEmbeddable>(embeddable.id); - - if ( - containerClone.getOutput().embeddableLoaded[embeddable.id] && - childClone.getInput().nameTitle === 'Dr.' - ) { - cloneSubscription.unsubscribe(); - } - }); - } - } - ); - - embeddable.updateInput({ nameTitle: 'Dr.' }); -}); - -test(`Derived container state passed to children`, async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, - { - firstName: 'Susy', - } - ); - - let subscription = embeddable - .getInput$() - .pipe(skip(1)) - .subscribe((changes: Partial<ContactCardEmbeddableInput>) => { - expect(changes.viewMode).toBe(ViewMode.EDIT); - }); - container.updateInput({ viewMode: ViewMode.EDIT }); - - subscription.unsubscribe(); - subscription = embeddable - .getInput$() - .pipe(skip(1)) - .subscribe((changes: Partial<ContactCardEmbeddableInput>) => { - expect(changes.viewMode).toBe(ViewMode.VIEW); - }); - container.updateInput({ viewMode: ViewMode.VIEW }); - subscription.unsubscribe(); -}); - -test(`Can subscribe to children embeddable updates`, async () => { - const { embeddable } = await createHelloWorldContainerAndEmbeddable( - { - id: 'hello container', - panels: {}, - viewMode: ViewMode.VIEW, - }, - { - firstName: 'Susy', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const subscription = embeddable.getInput$().subscribe((input: ContactCardEmbeddableInput) => { - if (input.nameTitle === 'Dr.') { - subscription.unsubscribe(); - } - }); - embeddable.updateInput({ nameTitle: 'Dr.' }); -}); - -test('Test nested reactions', async () => { - const { container, embeddable } = await createHelloWorldContainerAndEmbeddable( - { id: 'hello', panels: {}, viewMode: ViewMode.VIEW }, - { - firstName: 'Susy', - } - ); - - expect(isErrorEmbeddable(embeddable)).toBe(false); - - const containerSubscription = container.getInput$().subscribe((input: any) => { - const embeddableNameTitle = embeddable.getInput().nameTitle; - const viewMode = input.viewMode; - const nameTitleFromContainer = container.getInputForChild<ContactCardEmbeddableInput>( - embeddable.id - ).nameTitle; - if ( - embeddableNameTitle === 'Dr.' && - nameTitleFromContainer === 'Dr.' && - viewMode === ViewMode.EDIT - ) { - containerSubscription.unsubscribe(); - embeddableSubscription.unsubscribe(); - } - }); - - const embeddableSubscription = embeddable.getInput$().subscribe(() => { - if (embeddable.getInput().nameTitle === 'Dr.') { - container.updateInput({ viewMode: ViewMode.EDIT }); - } - }); - - embeddable.updateInput({ nameTitle: 'Dr.' }); -}); - -test('Explicit embeddable input mapped to undefined will default to inherited', async () => { - const { start } = await createHelloWorldContainerAndEmbeddable(); - const derivedFilter: MockFilter = { - $state: { store: 'appState' }, - meta: { disabled: false, alias: 'name', negate: false }, - query: { match: {} }, - }; - const container = new FilterableContainer( - { id: 'hello', panels: {}, filters: [derivedFilter] }, - start.getEmbeddableFactory - ); - const embeddable = await container.addNewEmbeddable< - FilterableEmbeddableInput, - EmbeddableOutput, - FilterableEmbeddable - >(FILTERABLE_EMBEDDABLE, {}); - - if (isErrorEmbeddable(embeddable)) { - throw new Error('Error adding embeddable'); - } - - embeddable.updateInput({ filters: [] }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([]); - - embeddable.updateInput({ filters: undefined }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([ - derivedFilter, - ]); -}); - -test('Explicit embeddable input mapped to undefined with no inherited value will get passed to embeddable', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ id: 'hello', panels: {} }); - - const embeddable = await container.addNewEmbeddable< - FilterableEmbeddableInput, - EmbeddableOutput, - FilterableEmbeddable - >(FILTERABLE_EMBEDDABLE, {}); - - if (isErrorEmbeddable(embeddable)) { - throw new Error('Error adding embeddable'); - } - - embeddable.updateInput({ filters: [] }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([]); - - const subscription = embeddable - .getInput$() - .pipe(skip(1)) - .subscribe(() => { - if (embeddable.getInput().filters === undefined) { - subscription.unsubscribe(); - } - }); - - embeddable.updateInput({ filters: undefined }); -}); - -test('Panel removed from input state', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: {}, - }); - - const embeddable = await container.addNewEmbeddable< - FilterableEmbeddableInput, - EmbeddableOutput, - FilterableEmbeddable - >(FILTERABLE_EMBEDDABLE, {}); - - const filteredPanels = { ...container.getInput().panels }; - delete filteredPanels[embeddable.id]; - const newInput: Partial<FilterableContainerInput> = { - ...container.getInput(), - panels: filteredPanels, - }; - - container.updateInput(newInput); - await new Promise((r) => setTimeout(r, 1)); - - expect(container.getChild(embeddable.id)).toBeUndefined(); - expect(container.getOutput().embeddableLoaded[embeddable.id]).toBeUndefined(); -}); - -test('Panel added to input state', async () => { - const { container, start } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: {}, - }); - - const embeddable = await container.addNewEmbeddable< - FilterableEmbeddableInput, - EmbeddableOutput, - FilterableEmbeddable - >(FILTERABLE_EMBEDDABLE, {}); - - const embeddable2 = await container.addNewEmbeddable< - FilterableEmbeddableInput, - EmbeddableOutput, - FilterableEmbeddable - >(FILTERABLE_EMBEDDABLE, {}); - - const container2 = new FilterableContainer( - { id: 'hello', panels: {}, filters: [] }, - start.getEmbeddableFactory - ); - - container2.updateInput(container.getInput()); - await new Promise((r) => setTimeout(r, 1)); - - expect(container.getChild(embeddable.id)).toBeDefined(); - expect(container.getOutput().embeddableLoaded[embeddable.id]).toBe(true); - expect(container.getChild(embeddable2.id)).toBeDefined(); - expect(container.getOutput().embeddableLoaded[embeddable2.id]).toBe(true); -}); - -test('Container changes made directly after adding a new embeddable are propagated', async () => { - const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const { setup, doStart, uiActions } = testPlugin(coreSetup, coreStart); - - const factory = new SlowContactCardEmbeddableFactory({ - loadTickCount: 3, - execAction: uiActions.executeTriggerActions, - }); - setup.registerEmbeddableFactory(factory.type, factory); - - const start = doStart(); - - const container = new HelloWorldContainer( - { - id: 'hello', - panels: {}, - viewMode: ViewMode.EDIT, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - const subscription = Rx.merge(container.getOutput$(), container.getInput$()) - .pipe(skip(2)) - .subscribe(() => { - expect(Object.keys(container.getOutput().embeddableLoaded).length).toBe(1); - if (Object.keys(container.getOutput().embeddableLoaded).length > 0) { - const embeddableId = Object.keys(container.getOutput().embeddableLoaded)[0]; - - if (container.getOutput().embeddableLoaded[embeddableId] === true) { - const embeddable = container.getChild(embeddableId); - if (embeddable.getInput().viewMode === ViewMode.VIEW) { - subscription.unsubscribe(); - } - } - } - }); - - container.addNewEmbeddable<ContactCardEmbeddableInput>(CONTACT_CARD_EMBEDDABLE, { - firstName: 'A girl', - lastName: 'has no name', - }); - - container.updateInput({ viewMode: ViewMode.VIEW }); -}); - -test('container stores ErrorEmbeddables when a factory for a child cannot be found (so the panel can be removed)', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: { - '123': { - type: 'IDontExist', - explicitInput: { id: '123' }, - }, - }, - viewMode: ViewMode.EDIT, - }); - - container.getOutput$().subscribe(() => { - if (container.getOutput().embeddableLoaded['123']) { - const child = container.getChild('123'); - expect(child.type).toBe(ERROR_EMBEDDABLE_TYPE); - } - }); -}); - -test('container stores ErrorEmbeddables when a saved object cannot be found', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: { - '123': { - type: 'vis', - explicitInput: { id: '123', savedObjectId: '456' } as SavedObjectEmbeddableInput, - }, - }, - viewMode: ViewMode.EDIT, - }); - - container.getOutput$().subscribe(() => { - if (container.getOutput().embeddableLoaded['123']) { - const child = container.getChild('123'); - expect(child.type).toBe(ERROR_EMBEDDABLE_TYPE); - } - }); -}); - -test('ErrorEmbeddables get updated when parent does', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: { - '123': { - type: 'vis', - explicitInput: { id: '123', savedObjectId: '456' } as SavedObjectEmbeddableInput, - }, - }, - viewMode: ViewMode.EDIT, - }); - - container.getOutput$().subscribe(() => { - if (container.getOutput().embeddableLoaded['123']) { - const embeddable = container.getChild('123'); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.EDIT); - - container.updateInput({ viewMode: ViewMode.VIEW }); - - expect(embeddable.getInput().viewMode).toBe(ViewMode.VIEW); - } - }); -}); - -test('untilEmbeddableLoaded() throws an error if there is no such child panel in the container', async () => { - const { container } = await createHelloWorldContainerAndEmbeddable({ - id: 'hello', - panels: {}, - }); - - expect(container.untilEmbeddableLoaded('idontexist')).rejects.toThrowError(); -}); - -test('untilEmbeddableLoaded() throws an error if there is no such child panel in the container - 2', async () => { - const { doStart } = testPlugin(coreMock.createSetup(), coreMock.createStart()); - const start = doStart(); - const container = new HelloWorldContainer( - { - id: 'hello', - panels: {}, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - const [, error] = await of(container.untilEmbeddableLoaded('123')); - expect(error).toBeInstanceOf(Error); - expect((error as Error).message).toMatchInlineSnapshot(`"Panel not found"`); -}); - -test('untilEmbeddableLoaded() resolves if child is loaded in the container', async () => { - const { setup, doStart } = testPlugin(coreMock.createSetup(), coreMock.createStart()); - const factory = new HelloWorldEmbeddableFactoryDefinition(); - setup.registerEmbeddableFactory(factory.type, factory); - const start = doStart(); - const container = new HelloWorldContainer( - { - id: 'hello', - panels: { - '123': { - type: HELLO_WORLD_EMBEDDABLE, - explicitInput: { id: '123' }, - }, - }, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - const child = await container.untilEmbeddableLoaded('123'); - expect(child).toBeDefined(); - expect(child.type).toBe(HELLO_WORLD_EMBEDDABLE); -}); - -test('untilEmbeddableLoaded resolves with undefined if child is subsequently removed', async () => { - const { doStart, setup, uiActions } = testPlugin(coreMock.createSetup(), coreMock.createStart()); - const factory = new SlowContactCardEmbeddableFactory({ - loadTickCount: 3, - execAction: uiActions.executeTriggerActions, - }); - setup.registerEmbeddableFactory(factory.type, factory); - - const start = doStart(); - const container = new HelloWorldContainer( - { - id: 'hello', - panels: { - '123': { - explicitInput: { id: '123', firstName: 'Sam', lastName: 'Tarley' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - container.untilEmbeddableLoaded('123').then((embed) => { - expect(embed).toBeUndefined(); - }); - - container.updateInput({ panels: {} }); -}); - -test('adding a panel then subsequently removing it before its loaded removes the panel', (done) => { - const { doStart, uiActions, setup } = testPlugin(coreMock.createSetup(), coreMock.createStart()); - const factory = new SlowContactCardEmbeddableFactory({ - loadTickCount: 1, - execAction: uiActions.executeTriggerActions, - }); - setup.registerEmbeddableFactory(factory.type, factory); - const start = doStart(); - const container = new HelloWorldContainer( - { - id: 'hello', - panels: { - '123': { - explicitInput: { id: '123', firstName: 'Sam', lastName: 'Tarley' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - // Final state should be that the panel is removed. - Rx.merge(container.getInput$(), container.getOutput$()).subscribe(() => { - if ( - container.getInput().panels['123'] === undefined && - container.getOutput().embeddableLoaded['123'] === undefined && - container.getInput().panels['456'] !== undefined && - container.getOutput().embeddableLoaded['456'] === true - ) { - done(); - } - }); - - container.updateInput({ panels: {} }); - - container.updateInput({ - panels: { - '456': { - explicitInput: { id: '456' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }, - }); -}); diff --git a/src/plugins/embeddable/public/tests/explicit_input.test.ts b/src/plugins/embeddable/public/tests/explicit_input.test.ts deleted file mode 100644 index 60ed8378b4f8..000000000000 --- a/src/plugins/embeddable/public/tests/explicit_input.test.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { skip } from 'rxjs'; -import { testPlugin } from './test_plugin'; -import { - MockFilter, - FILTERABLE_EMBEDDABLE, - FilterableEmbeddableInput, -} from '../lib/test_samples/embeddables/filterable_embeddable'; -import { FilterableEmbeddableFactory } from '../lib/test_samples/embeddables/filterable_embeddable_factory'; -import { CONTACT_CARD_EMBEDDABLE } from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; -import { SlowContactCardEmbeddableFactory } from '../lib/test_samples/embeddables/contact_card/slow_contact_card_embeddable_factory'; -import { HELLO_WORLD_EMBEDDABLE, HelloWorldEmbeddableFactoryDefinition } from './fixtures'; -import { FilterableContainer } from '../lib/test_samples/embeddables/filterable_container'; -import { isErrorEmbeddable } from '../lib'; -import { HelloWorldContainer } from '../lib/test_samples/embeddables/hello_world_container'; -import { coreMock } from '@kbn/core/public/mocks'; - -const { setup, doStart, uiActions } = testPlugin(coreMock.createSetup(), coreMock.createStart()); - -setup.registerEmbeddableFactory(FILTERABLE_EMBEDDABLE, new FilterableEmbeddableFactory()); -const factory = new SlowContactCardEmbeddableFactory({ - loadTickCount: 2, - execAction: uiActions.executeTriggerActions, -}); -setup.registerEmbeddableFactory(CONTACT_CARD_EMBEDDABLE, factory); -setup.registerEmbeddableFactory( - HELLO_WORLD_EMBEDDABLE, - new HelloWorldEmbeddableFactoryDefinition() -); - -const start = doStart(); - -test('Explicit embeddable input mapped to undefined will default to inherited', async () => { - const derivedFilter: MockFilter = { - $state: { store: 'appState' }, - meta: { disabled: false, alias: 'name', negate: false }, - query: { match: {} }, - }; - const container = new FilterableContainer( - { id: 'hello', panels: {}, filters: [derivedFilter] }, - start.getEmbeddableFactory - ); - const embeddable = await container.addNewEmbeddable<any, any, any>(FILTERABLE_EMBEDDABLE, {}); - - if (isErrorEmbeddable(embeddable)) { - throw new Error('Error adding embeddable'); - } - - embeddable.updateInput({ filters: [] }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([]); - - embeddable.updateInput({ filters: undefined }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([ - derivedFilter, - ]); -}); - -test('Explicit embeddable input mapped to undefined with no inherited value will get passed to embeddable', async () => { - const container = new HelloWorldContainer( - { id: 'hello', panels: {} }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - const embeddable = await container.addNewEmbeddable<any, any, any>(FILTERABLE_EMBEDDABLE, {}); - - if (isErrorEmbeddable(embeddable)) { - throw new Error('Error adding embeddable'); - } - - embeddable.updateInput({ filters: [] }); - - expect(container.getInputForChild<FilterableEmbeddableInput>(embeddable.id).filters).toEqual([]); - - const subscription = await embeddable - .getInput$() - .pipe(skip(1)) - .subscribe(() => { - if (embeddable.getInput().filters === undefined) { - subscription.unsubscribe(); - } - }); - - embeddable.updateInput({ filters: undefined }); -}); - -// The goal is to make sure that if the container input changes after `onPanelAdded` is called -// but before the embeddable factory returns the embeddable, that the `inheritedChildInput` and -// embeddable input comparisons won't cause explicit input to be set when it shouldn't. -test('Explicit input tests in async situations', (done: () => void) => { - const container = new HelloWorldContainer( - { - id: 'hello', - panels: { - '123': { - explicitInput: { firstName: 'Sam', id: '123' }, - type: CONTACT_CARD_EMBEDDABLE, - }, - }, - }, - { - getEmbeddableFactory: start.getEmbeddableFactory, - } - ); - - container.updateInput({ lastName: 'lolol' }); - - const subscription = container.getOutput$().subscribe(() => { - if (container.getOutput().embeddableLoaded['123']) { - const embeddable = container.getChild<any>('123'); - expect(embeddable).toBeDefined(); - expect(embeddable.getInput().lastName).toBe('lolol'); - subscription.unsubscribe(); - done(); - } - }); -}); diff --git a/src/plugins/embeddable/public/tests/get_embeddable_factories.test.ts b/src/plugins/embeddable/public/tests/get_embeddable_factories.test.ts deleted file mode 100644 index 6b7794958ad5..000000000000 --- a/src/plugins/embeddable/public/tests/get_embeddable_factories.test.ts +++ /dev/null @@ -1,40 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { testPlugin } from './test_plugin'; -import { FilterableContainerFactory } from '../lib/test_samples/embeddables/filterable_container_factory'; -import { ContactCardEmbeddableFactory } from '../lib/test_samples/embeddables/contact_card/contact_card_embeddable_factory'; - -test('exports getEmbeddableFactories() function', () => { - const { doStart } = testPlugin(); - expect(typeof doStart().getEmbeddableFactories).toBe('function'); -}); - -test('returns empty list if there are no embeddable factories', () => { - const { doStart } = testPlugin(); - const start = doStart(); - const list = [...start.getEmbeddableFactories()]; - expect(list).toEqual([]); -}); - -test('returns existing embeddable factories', () => { - const { setup, doStart } = testPlugin(); - - const factory1 = new FilterableContainerFactory(async () => await start.getEmbeddableFactory); - const factory2 = new ContactCardEmbeddableFactory((() => null) as any, {} as any); - setup.registerEmbeddableFactory(factory1.type, factory1); - setup.registerEmbeddableFactory(factory2.type, factory2); - - const start = doStart(); - - const list = [...start.getEmbeddableFactories()]; - expect(list.length).toBe(2); - expect(!!list.find(({ type }) => factory1.type === type)).toBe(true); - expect(!!list.find(({ type }) => factory2.type === type)).toBe(true); -}); diff --git a/src/plugins/embeddable/public/tests/helpers.ts b/src/plugins/embeddable/public/tests/helpers.ts deleted file mode 100644 index d7fee9d13dec..000000000000 --- a/src/plugins/embeddable/public/tests/helpers.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { coreMock } from '@kbn/core/public/mocks'; -import { ContainerInput, EmbeddableContainerSettings, isErrorEmbeddable } from '../lib'; -import { - ContactCardEmbeddable, - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - CONTACT_CARD_EMBEDDABLE, - FilterableEmbeddableFactory, - HelloWorldContainer, - SlowContactCardEmbeddableFactory, -} from '../lib/test_samples'; -import { HelloWorldEmbeddableFactoryDefinition } from './fixtures'; -import { testPlugin } from './test_plugin'; - -export async function createHelloWorldContainerAndEmbeddable( - containerInput: ContainerInput = { id: 'hello', panels: {} }, - embeddableInput = {}, - settings?: EmbeddableContainerSettings -) { - const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const { setup, doStart, uiActions } = testPlugin(coreSetup, coreStart); - const filterableFactory = new FilterableEmbeddableFactory(); - const slowContactCardFactory = new SlowContactCardEmbeddableFactory({ - execAction: uiActions.executeTriggerActions, - }); - const contactCardCreateSpy = jest.spyOn(slowContactCardFactory, 'create'); - - const helloWorldFactory = new HelloWorldEmbeddableFactoryDefinition(); - - setup.registerEmbeddableFactory(filterableFactory.type, filterableFactory); - setup.registerEmbeddableFactory(slowContactCardFactory.type, slowContactCardFactory); - setup.registerEmbeddableFactory(helloWorldFactory.type, helloWorldFactory); - - const start = doStart(); - - const container = new HelloWorldContainer( - containerInput, - { - getEmbeddableFactory: start.getEmbeddableFactory, - }, - settings - ); - - const embeddable = await container.addNewEmbeddable< - ContactCardEmbeddableInput, - ContactCardEmbeddableOutput, - ContactCardEmbeddable - >(CONTACT_CARD_EMBEDDABLE, embeddableInput); - - if (isErrorEmbeddable(embeddable)) { - throw new Error('Error adding embeddable'); - } - - return { - setup, - start, - coreSetup, - coreStart, - container, - uiActions, - embeddable, - contactCardCreateSpy, - }; -} - -export const expectErrorAsync = (fn: (...args: unknown[]) => Promise<unknown>): Promise<Error> => { - return fn() - .then(() => { - throw new Error('Expected an error throw.'); - }) - .catch((error) => { - if (error.message === 'Expected an error throw.') { - throw error; - } - return error; - }); -}; - -export const expectError = (fn: (...args: unknown[]) => unknown): Error => { - try { - fn(); - throw new Error('Expected an error throw.'); - } catch (error) { - if (error.message === 'Expected an error throw.') { - throw error; - } - return error; - } -}; - -export const of = async <T, P extends Promise<T>>( - promise: P -): Promise<[T | undefined, Error | unknown]> => { - try { - return [await promise, undefined]; - } catch (error) { - return [, error]; - } -}; diff --git a/src/plugins/embeddable/tsconfig.json b/src/plugins/embeddable/tsconfig.json index 161b35bc716e..bf97096d1484 100644 --- a/src/plugins/embeddable/tsconfig.json +++ b/src/plugins/embeddable/tsconfig.json @@ -3,19 +3,14 @@ "compilerOptions": { "outDir": "target/types" }, - "include": ["*.ts", ".storybook/**/*", "common/**/*", "public/**/*", "server/**/*"], + "include": ["*.ts", "common/**/*", "public/**/*", "server/**/*"], "kbn_references": [ "@kbn/core", "@kbn/inspector-plugin", - "@kbn/saved-objects-plugin", "@kbn/kibana-utils-plugin", - "@kbn/kibana-react-plugin", "@kbn/ui-actions-plugin", - "@kbn/i18n-react", - "@kbn/storybook", "@kbn/utility-types", "@kbn/es-query", - "@kbn/core-theme-browser", "@kbn/i18n", "@kbn/std", "@kbn/expressions-plugin", diff --git a/src/plugins/expression_error/public/expression_renderers/__stories__/error_renderer.stories.tsx b/src/plugins/expression_error/public/expression_renderers/__stories__/error_renderer.stories.tsx index b7f789f873de..ea28ff903582 100644 --- a/src/plugins/expression_error/public/expression_renderers/__stories__/error_renderer.stories.tsx +++ b/src/plugins/expression_error/public/expression_renderers/__stories__/error_renderer.stories.tsx @@ -19,7 +19,5 @@ storiesOf('renderers/error', module).add('default', () => { error: thrownError, }; - return ( - <Render renderer={getErrorRenderer(coreMock.createStart().theme.theme$)} config={config} /> - ); + return <Render renderer={getErrorRenderer(coreMock.createStart())} config={config} />; }); diff --git a/src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx b/src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx index 29fa69aa736b..e26aa7c4a516 100644 --- a/src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx +++ b/src/plugins/expression_error/public/expression_renderers/debug_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition } from '@kbn/expressions-plugin/common'; import { i18n } from '@kbn/i18n'; import { withSuspense } from '@kbn/presentation-util-plugin/public'; @@ -36,25 +35,24 @@ const strings = { }), }; -export const getDebugRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<any> => ({ - name: 'debug', - displayName: strings.getDisplayName(), - help: strings.getHelpDescription(), - reuseDomNode: true, - render(domNode, config, handlers) { - handlers.onDestroy(() => unmountComponentAtNode(domNode)); - render( - <KibanaErrorBoundaryProvider analytics={undefined}> - <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> - <Debug parentNode={domNode} payload={config} onLoaded={handlers.done} /> - </KibanaThemeProvider> - </KibanaErrorBoundary> - </KibanaErrorBoundaryProvider>, - domNode - ); - }, - }); +export const getDebugRenderer = (core: CoreStart) => (): ExpressionRenderDefinition<any> => ({ + name: 'debug', + displayName: strings.getDisplayName(), + help: strings.getHelpDescription(), + reuseDomNode: true, + render(domNode, config, handlers) { + handlers.onDestroy(() => unmountComponentAtNode(domNode)); + render( + <KibanaErrorBoundaryProvider analytics={undefined}> + <KibanaErrorBoundary> + <KibanaThemeProvider {...core}> + <Debug parentNode={domNode} payload={config} onLoaded={handlers.done} /> + </KibanaThemeProvider> + </KibanaErrorBoundary> + </KibanaErrorBoundaryProvider>, + domNode + ); + }, +}); -export const debugRendererFactory = (core: CoreSetup) => getDebugRenderer(core.theme.theme$); +export const debugRendererFactory = (core: CoreStart) => getDebugRenderer(core); diff --git a/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx b/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx index 4ba3daa15d08..9d352926bd9d 100644 --- a/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx +++ b/src/plugins/expression_error/public/expression_renderers/error_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { I18nProvider } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; import { @@ -38,7 +37,7 @@ const errorStrings = { const ErrorComponent = withSuspense(LazyErrorRenderComponent); export const getErrorRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<ErrorRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<ErrorRendererConfig> => ({ name: 'error', displayName: errorStrings.getDisplayName(), help: errorStrings.getHelpDescription(), @@ -55,7 +54,7 @@ export const getErrorRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <I18nProvider> <ErrorComponent onLoaded={handlers.done} {...config} parentNode={domNode} /> </I18nProvider> @@ -67,4 +66,4 @@ export const getErrorRenderer = }, }); -export const errorRendererFactory = (core: CoreSetup) => getErrorRenderer(core.theme.theme$); +export const errorRendererFactory = (core: CoreStart) => getErrorRenderer(core); diff --git a/src/plugins/expression_error/public/plugin.ts b/src/plugins/expression_error/public/plugin.ts index 66b520926759..180a6209f4da 100755 --- a/src/plugins/expression_error/public/plugin.ts +++ b/src/plugins/expression_error/public/plugin.ts @@ -26,8 +26,10 @@ export class ExpressionErrorPlugin implements Plugin<ExpressionErrorPluginSetup, ExpressionErrorPluginStart, SetupDeps, StartDeps> { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionErrorPluginSetup { - expressions.registerRenderer(errorRendererFactory(core)); - expressions.registerRenderer(debugRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerRenderer(errorRendererFactory(start)); + expressions.registerRenderer(debugRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionErrorPluginStart {} diff --git a/src/plugins/expression_image/public/expression_renderers/__stories__/image_renderer.stories.tsx b/src/plugins/expression_image/public/expression_renderers/__stories__/image_renderer.stories.tsx index 07fb4db558bd..1577ee8b7fab 100644 --- a/src/plugins/expression_image/public/expression_renderers/__stories__/image_renderer.stories.tsx +++ b/src/plugins/expression_image/public/expression_renderers/__stories__/image_renderer.stories.tsx @@ -23,7 +23,7 @@ const Renderer = ({ elasticLogo }: { elasticLogo: string }) => { return ( <Render - renderer={getImageRenderer(coreMock.createStart().theme.theme$)} + renderer={getImageRenderer(coreMock.createStart())} config={config} width="500px" height="500px" diff --git a/src/plugins/expression_image/public/expression_renderers/image_renderer.tsx b/src/plugins/expression_image/public/expression_renderers/image_renderer.tsx index e80281fc10f4..c5d1d201e1c9 100644 --- a/src/plugins/expression_image/public/expression_renderers/image_renderer.tsx +++ b/src/plugins/expression_image/public/expression_renderers/image_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -34,7 +33,7 @@ const strings = { }; export const getImageRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<ImageRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<ImageRendererConfig> => ({ name: 'image', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -62,7 +61,7 @@ export const getImageRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <div style={style} /> </KibanaThemeProvider> </KibanaErrorBoundary> @@ -73,4 +72,4 @@ export const getImageRenderer = }, }); -export const imageRendererFactory = (core: CoreSetup) => getImageRenderer(core.theme.theme$); +export const imageRendererFactory = (core: CoreStart) => getImageRenderer(core); diff --git a/src/plugins/expression_image/public/plugin.ts b/src/plugins/expression_image/public/plugin.ts index 4ee0b457b4f6..e9fac6f9215c 100755 --- a/src/plugins/expression_image/public/plugin.ts +++ b/src/plugins/expression_image/public/plugin.ts @@ -27,8 +27,10 @@ export class ExpressionImagePlugin implements Plugin<ExpressionImagePluginSetup, ExpressionImagePluginStart, SetupDeps, StartDeps> { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionImagePluginSetup { - expressions.registerFunction(imageFunction); - expressions.registerRenderer(imageRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerFunction(imageFunction); + expressions.registerRenderer(imageRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionImagePluginStart {} diff --git a/src/plugins/expression_metric/public/expression_renderers/__stories__/metric_renderer.stories.tsx b/src/plugins/expression_metric/public/expression_renderers/__stories__/metric_renderer.stories.tsx index 5438bb4b4287..9c8e5d17dc3b 100644 --- a/src/plugins/expression_metric/public/expression_renderers/__stories__/metric_renderer.stories.tsx +++ b/src/plugins/expression_metric/public/expression_renderers/__stories__/metric_renderer.stories.tsx @@ -38,7 +38,7 @@ const metricFontSpec: CSSProperties = { color: '#b83c6f', }; -const theme$ = coreMock.createStart().theme.theme$; +const core = coreMock.createStart(); storiesOf('renderers/Metric', module) .add('with null metric', () => { @@ -49,7 +49,7 @@ storiesOf('renderers/Metric', module) label: '', metricFormat: '', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with number metric', () => { const config: MetricRendererConfig = { @@ -59,7 +59,7 @@ storiesOf('renderers/Metric', module) label: '', metricFormat: '', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with string metric', () => { const config: MetricRendererConfig = { @@ -69,7 +69,7 @@ storiesOf('renderers/Metric', module) label: '', metricFormat: '', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with label', () => { const config: MetricRendererConfig = { @@ -79,7 +79,7 @@ storiesOf('renderers/Metric', module) label: 'Average price', metricFormat: '', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with number metric and a specified format', () => { const config: MetricRendererConfig = { @@ -89,7 +89,7 @@ storiesOf('renderers/Metric', module) label: 'Average price', metricFormat: '0.00%', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with formatted string metric and a specified format', () => { const config: MetricRendererConfig = { @@ -99,7 +99,7 @@ storiesOf('renderers/Metric', module) label: 'Total Revenue', metricFormat: '$0a', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }) .add('with invalid metricFont', () => { const config: MetricRendererConfig = { @@ -109,5 +109,5 @@ storiesOf('renderers/Metric', module) label: 'Total Revenue', metricFormat: '$0a', }; - return <Render renderer={getMetricRenderer(theme$)} config={config} />; + return <Render renderer={getMetricRenderer(core)} config={config} />; }); diff --git a/src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx b/src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx index db4b8575d5e2..315cf1fca32a 100644 --- a/src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx +++ b/src/plugins/expression_metric/public/expression_renderers/metric_renderer.tsx @@ -9,9 +9,8 @@ import React, { CSSProperties } from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -33,7 +32,7 @@ const strings = { }; export const getMetricRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<MetricRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<MetricRendererConfig> => ({ name: 'metric', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -51,7 +50,7 @@ export const getMetricRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <MetricComponent label={config.label} labelFont={config.labelFont ? (config.labelFont.spec as CSSProperties) : {}} @@ -68,4 +67,4 @@ export const getMetricRenderer = }, }); -export const metricRendererFactory = (core: CoreSetup) => getMetricRenderer(core.theme.theme$); +export const metricRendererFactory = (core: CoreStart) => getMetricRenderer(core); diff --git a/src/plugins/expression_metric/public/plugin.ts b/src/plugins/expression_metric/public/plugin.ts index ce5bd9069ca2..0bcf71a93b48 100755 --- a/src/plugins/expression_metric/public/plugin.ts +++ b/src/plugins/expression_metric/public/plugin.ts @@ -27,8 +27,10 @@ export class ExpressionMetricPlugin implements Plugin<ExpressionMetricPluginSetup, ExpressionMetricPluginStart, SetupDeps, StartDeps> { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionMetricPluginSetup { - expressions.registerFunction(metricFunction); - expressions.registerRenderer(metricRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerFunction(metricFunction); + expressions.registerRenderer(metricRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionMetricPluginStart {} diff --git a/src/plugins/expression_repeat_image/public/expression_renderers/__stories__/repeat_image_renderer.stories.tsx b/src/plugins/expression_repeat_image/public/expression_renderers/__stories__/repeat_image_renderer.stories.tsx index a5f58b97970c..31ae794d234a 100644 --- a/src/plugins/expression_repeat_image/public/expression_renderers/__stories__/repeat_image_renderer.stories.tsx +++ b/src/plugins/expression_repeat_image/public/expression_renderers/__stories__/repeat_image_renderer.stories.tsx @@ -32,7 +32,7 @@ const Renderer = ({ return ( <Render - renderer={getRepeatImageRenderer(coreMock.createStart().theme.theme$)} + renderer={getRepeatImageRenderer(coreMock.createStart())} config={config} width="400px" /> diff --git a/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx b/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx index 9a3545988088..9aed56e999c3 100644 --- a/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx +++ b/src/plugins/expression_repeat_image/public/expression_renderers/repeat_image_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -35,7 +34,7 @@ const strings = { }; export const getRepeatImageRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<RepeatImageRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<RepeatImageRendererConfig> => ({ name: 'repeatImage', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -60,7 +59,7 @@ export const getRepeatImageRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <I18nProvider> <RepeatImageComponent onLoaded={handlers.done} {...settings} parentNode={domNode} /> </I18nProvider> @@ -72,5 +71,4 @@ export const getRepeatImageRenderer = }, }); -export const repeatImageRendererFactory = (core: CoreSetup) => - getRepeatImageRenderer(core.theme.theme$); +export const repeatImageRendererFactory = (core: CoreStart) => getRepeatImageRenderer(core); diff --git a/src/plugins/expression_repeat_image/public/plugin.ts b/src/plugins/expression_repeat_image/public/plugin.ts index c9421c76895b..f66ae96a8b7c 100755 --- a/src/plugins/expression_repeat_image/public/plugin.ts +++ b/src/plugins/expression_repeat_image/public/plugin.ts @@ -33,8 +33,10 @@ export class ExpressionRepeatImagePlugin > { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionRepeatImagePluginSetup { - expressions.registerFunction(repeatImageFunction); - expressions.registerRenderer(repeatImageRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerFunction(repeatImageFunction); + expressions.registerRenderer(repeatImageRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionRepeatImagePluginStart {} diff --git a/src/plugins/expression_reveal_image/public/expression_renderers/__stories__/reveal_image_renderer.stories.tsx b/src/plugins/expression_reveal_image/public/expression_renderers/__stories__/reveal_image_renderer.stories.tsx index 664cc9711779..32ea7edd0476 100644 --- a/src/plugins/expression_reveal_image/public/expression_renderers/__stories__/reveal_image_renderer.stories.tsx +++ b/src/plugins/expression_reveal_image/public/expression_renderers/__stories__/reveal_image_renderer.stories.tsx @@ -29,12 +29,7 @@ const Renderer = ({ percent: 0.45, }; - return ( - <Render - renderer={getRevealImageRenderer(coreMock.createStart().theme.theme$)} - config={config} - /> - ); + return <Render renderer={getRevealImageRenderer(coreMock.createStart())} config={config} />; }; storiesOf('renderers/revealImage', module).add( diff --git a/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx b/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx index fbfe479225ec..3190a7c90c11 100644 --- a/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx +++ b/src/plugins/expression_reveal_image/public/expression_renderers/reveal_image_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -34,7 +33,7 @@ export const strings = { }; export const getRevealImageRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<RevealImageRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<RevealImageRendererConfig> => ({ name: 'revealImage', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -52,7 +51,7 @@ export const getRevealImageRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <I18nProvider> <RevealImageComponent onLoaded={handlers.done} {...config} parentNode={domNode} /> </I18nProvider> @@ -64,5 +63,4 @@ export const getRevealImageRenderer = }, }); -export const revealImageRendererFactory = (core: CoreSetup) => - getRevealImageRenderer(core.theme.theme$); +export const revealImageRendererFactory = (core: CoreStart) => getRevealImageRenderer(core); diff --git a/src/plugins/expression_reveal_image/public/plugin.ts b/src/plugins/expression_reveal_image/public/plugin.ts index e41fea42bf1e..66e802f4cf44 100755 --- a/src/plugins/expression_reveal_image/public/plugin.ts +++ b/src/plugins/expression_reveal_image/public/plugin.ts @@ -33,8 +33,10 @@ export class ExpressionRevealImagePlugin > { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionRevealImagePluginSetup { - expressions.registerFunction(revealImageFunction); - expressions.registerRenderer(revealImageRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerFunction(revealImageFunction); + expressions.registerRenderer(revealImageRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionRevealImagePluginStart {} diff --git a/src/plugins/expression_shape/public/expression_renderers/__stories__/progress_renderer.stories.tsx b/src/plugins/expression_shape/public/expression_renderers/__stories__/progress_renderer.stories.tsx index 0f93314ee081..79e975bf2d46 100644 --- a/src/plugins/expression_shape/public/expression_renderers/__stories__/progress_renderer.stories.tsx +++ b/src/plugins/expression_shape/public/expression_renderers/__stories__/progress_renderer.stories.tsx @@ -31,7 +31,5 @@ storiesOf('renderers/progress', module).add('default', () => { valueWeight: 15, }; - return ( - <Render renderer={getProgressRenderer(coreMock.createStart().theme.theme$)} config={config} /> - ); + return <Render renderer={getProgressRenderer(coreMock.createStart())} config={config} />; }); diff --git a/src/plugins/expression_shape/public/expression_renderers/__stories__/shape_renderer.stories.tsx b/src/plugins/expression_shape/public/expression_renderers/__stories__/shape_renderer.stories.tsx index d089174c6032..f69f5d765484 100644 --- a/src/plugins/expression_shape/public/expression_renderers/__stories__/shape_renderer.stories.tsx +++ b/src/plugins/expression_shape/public/expression_renderers/__stories__/shape_renderer.stories.tsx @@ -24,7 +24,5 @@ storiesOf('renderers/shape', module).add('default', () => { maintainAspect: true, }; - return ( - <Render renderer={getShapeRenderer(coreMock.createStart().theme.theme$)} config={config} /> - ); + return <Render renderer={getShapeRenderer(coreMock.createStart())} config={config} />; }); diff --git a/src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx b/src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx index ed7629a7d87a..17118625e915 100644 --- a/src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx +++ b/src/plugins/expression_shape/public/expression_renderers/progress_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -34,7 +33,7 @@ const strings = { }; export const getProgressRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<ProgressRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<ProgressRendererConfig> => ({ name: 'progress', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -52,7 +51,7 @@ export const getProgressRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <I18nProvider> <ProgressComponent {...config} parentNode={domNode} onLoaded={handlers.done} /> </I18nProvider> @@ -64,4 +63,4 @@ export const getProgressRenderer = }, }); -export const progressRendererFactory = (core: CoreSetup) => getProgressRenderer(core.theme.theme$); +export const progressRendererFactory = (core: CoreStart) => getProgressRenderer(core); diff --git a/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx b/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx index 650033aa4542..a41e359eec00 100644 --- a/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx +++ b/src/plugins/expression_shape/public/expression_renderers/shape_renderer.tsx @@ -9,9 +9,8 @@ import React from 'react'; import { render, unmountComponentAtNode } from 'react-dom'; -import { Observable } from 'rxjs'; -import { CoreSetup, CoreTheme } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { ExpressionRenderDefinition, IInterpreterRenderHandlers, @@ -34,7 +33,7 @@ const strings = { }; export const getShapeRenderer = - (theme$: Observable<CoreTheme>) => (): ExpressionRenderDefinition<ShapeRendererConfig> => ({ + (core: CoreStart) => (): ExpressionRenderDefinition<ShapeRendererConfig> => ({ name: 'shape', displayName: strings.getDisplayName(), help: strings.getHelpDescription(), @@ -52,7 +51,7 @@ export const getShapeRenderer = render( <KibanaErrorBoundaryProvider analytics={undefined}> <KibanaErrorBoundary> - <KibanaThemeProvider theme={{ theme$ }}> + <KibanaThemeProvider {...core}> <I18nProvider> <ShapeComponent onLoaded={handlers.done} {...config} parentNode={domNode} /> </I18nProvider> @@ -65,4 +64,4 @@ export const getShapeRenderer = }, }); -export const shapeRendererFactory = (core: CoreSetup) => getShapeRenderer(core.theme.theme$); +export const shapeRendererFactory = (core: CoreStart) => getShapeRenderer(core); diff --git a/src/plugins/expression_shape/public/plugin.ts b/src/plugins/expression_shape/public/plugin.ts index 0acb611d363d..4d4ea8d9b35c 100755 --- a/src/plugins/expression_shape/public/plugin.ts +++ b/src/plugins/expression_shape/public/plugin.ts @@ -27,10 +27,12 @@ export class ExpressionShapePlugin implements Plugin<ExpressionShapePluginSetup, ExpressionShapePluginStart, SetupDeps, StartDeps> { public setup(core: CoreSetup, { expressions }: SetupDeps): ExpressionShapePluginSetup { - expressions.registerFunction(shapeFunction); - expressions.registerFunction(progressFunction); - expressions.registerRenderer(shapeRendererFactory(core)); - expressions.registerRenderer(progressRendererFactory(core)); + core.getStartServices().then(([start]) => { + expressions.registerFunction(shapeFunction); + expressions.registerFunction(progressFunction); + expressions.registerRenderer(shapeRendererFactory(start)); + expressions.registerRenderer(progressRendererFactory(start)); + }); } public start(core: CoreStart): ExpressionShapePluginStart {} diff --git a/src/plugins/field_formats/common/constants/color_default.ts b/src/plugins/field_formats/common/constants/color_default.ts index 689791d3ae4c..8133d4611d1f 100644 --- a/src/plugins/field_formats/common/constants/color_default.ts +++ b/src/plugins/field_formats/common/constants/color_default.ts @@ -12,4 +12,5 @@ export const DEFAULT_CONVERTER_COLOR = { regex: '<insert regex>', text: '#000000', background: '#ffffff', + boolean: 'true', }; diff --git a/src/plugins/field_formats/common/converters/color.test.ts b/src/plugins/field_formats/common/converters/color.test.ts index 392e3d677e66..bf1afb24fe18 100644 --- a/src/plugins/field_formats/common/converters/color.test.ts +++ b/src/plugins/field_formats/common/converters/color.test.ts @@ -56,6 +56,29 @@ describe('Color Format', () => { }); }); + describe('field is a boolean', () => { + test('should add colors if the value is true or false', () => { + const colorer = new ColorFormat( + { + fieldType: 'boolean', + colors: [ + { + boolean: 'true', + text: 'blue', + background: 'yellow', + }, + ], + }, + jest.fn() + ); + + expect(colorer.convert(true, HTML_CONTEXT_TYPE)).toBe( + '<span style="color:blue;background-color:yellow">true</span>' + ); + expect(colorer.convert(false, HTML_CONTEXT_TYPE)).toBe('false'); + }); + }); + describe('field is a string', () => { test('should add colors if the regex matches', () => { const colorer = new ColorFormat( diff --git a/src/plugins/field_formats/common/converters/color.tsx b/src/plugins/field_formats/common/converters/color.tsx index c05003a01954..e8a1d2b69664 100644 --- a/src/plugins/field_formats/common/converters/color.tsx +++ b/src/plugins/field_formats/common/converters/color.tsx @@ -23,7 +23,7 @@ export class ColorFormat extends FieldFormat { static title = i18n.translate('fieldFormats.color.title', { defaultMessage: 'Color', }); - static fieldType = [KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.STRING]; + static fieldType = [KBN_FIELD_TYPES.NUMBER, KBN_FIELD_TYPES.STRING, KBN_FIELD_TYPES.BOOLEAN]; getParamDefaults() { return { @@ -32,7 +32,7 @@ export class ColorFormat extends FieldFormat { }; } - findColorRuleForVal(val: string | number) { + findColorRuleForVal(val: string | number | boolean) { switch (this.param('fieldType')) { case 'string': return findLast(this.param('colors'), (colorParam: typeof DEFAULT_CONVERTER_COLOR) => { @@ -50,6 +50,10 @@ export class ColorFormat extends FieldFormat { // @ts-expect-error upgrade typescript v5.1.6 return val >= Number(start) && val <= Number(end); }); + case 'boolean': + return findLast(this.param('colors'), ({ boolean }) => { + return boolean === val.toString(); + }); default: return null; diff --git a/src/plugins/guided_onboarding/README.md b/src/plugins/guided_onboarding/README.md index a7d1447d6da8..8190ee82c200 100755 --- a/src/plugins/guided_onboarding/README.md +++ b/src/plugins/guided_onboarding/README.md @@ -125,7 +125,7 @@ To use the API service, you need to know a guide ID (currently one of `appSearch The guided onboarding exposes a function `registerGuideConfig(guideId: GuideId, guideConfig: GuideConfig)` function in its setup contract. This function allows consumers to register a guide config for a specified guide ID. The function throws an error if a config already exists for the guide ID. See code examples in following plugins: - enterprise search: `x-pack/plugins/enterprise_search/server/plugin.ts` -- observability: `x-pack/plugins/observability_solution/observability/server/plugin.ts` +- observability: `x-pack/solutions/observability/plugins/observability/server/plugin.ts` - security solution: `x-pack/plugins/security_solution/server/plugin.ts` ## Adding a new guide diff --git a/src/plugins/guided_onboarding/public/components/guide_button.tsx b/src/plugins/guided_onboarding/public/components/guide_button.tsx index 7df5d03049f1..32d78c1af545 100644 --- a/src/plugins/guided_onboarding/public/components/guide_button.tsx +++ b/src/plugins/guided_onboarding/public/components/guide_button.tsx @@ -58,7 +58,7 @@ export const GuideButton = ({ <EuiButton isLoading={isLoading} onClick={toggleGuidePanel} - color="success" + color="accent" fill size="s" data-test-subj="guideButton" @@ -97,7 +97,7 @@ export const GuideButton = ({ return ( <EuiButton onClick={navigateToLandingPage} - color="success" + color="accent" fill size="s" data-test-subj="guideButtonRedirect" diff --git a/src/plugins/guided_onboarding/public/components/guide_panel_step.styles.ts b/src/plugins/guided_onboarding/public/components/guide_panel_step.styles.ts index 2fc0d8afb111..f8ca12a9fd1f 100644 --- a/src/plugins/guided_onboarding/public/components/guide_panel_step.styles.ts +++ b/src/plugins/guided_onboarding/public/components/guide_panel_step.styles.ts @@ -17,17 +17,21 @@ export const getGuidePanelStepStyles = (euiTheme: EuiThemeComputed, stepStatus: height: 24px; border-radius: 50%; border: 2px solid - ${stepStatus === 'inactive' ? euiTheme.colors.lightShade : euiTheme.colors.success}; + ${stepStatus === 'inactive' ? euiTheme.colors.borderBasePlain : euiTheme.colors.success}; font-weight: ${euiTheme.font.weight.medium}; text-align: center; line-height: 1.4; - color: ${stepStatus === 'inactive' ? euiTheme.colors.subduedText : euiTheme.colors.text}; + color: ${stepStatus === 'inactive' + ? euiTheme.colors.textSubdued + : euiTheme.colors.textParagraph}; `, stepTitle: css` font-weight: ${euiTheme.font.weight.semiBold}; - color: ${stepStatus === 'inactive' ? euiTheme.colors.subduedText : euiTheme.colors.text}; + color: ${stepStatus === 'inactive' + ? euiTheme.colors.textSubdued + : euiTheme.colors.textParagraph}; .euiAccordion-isOpen & { - color: ${euiTheme.colors.title}; + color: ${euiTheme.colors.textHeading}; } `, description: css` diff --git a/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx b/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx index bdaf8b710ac4..f29beaad2acf 100644 --- a/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx +++ b/src/plugins/guided_onboarding/public/components/quit_guide_modal.tsx @@ -94,7 +94,7 @@ export const QuitGuideModal = ({ onClick={deactivateGuide} isLoading={isLoading} fill - color="warning" + color="primary" > {i18n.translate('guidedOnboarding.quitGuideModal.quitButtonLabel', { defaultMessage: 'Quit guide', diff --git a/src/plugins/home/public/application/components/tutorial/instruction_set.js b/src/plugins/home/public/application/components/tutorial/instruction_set.js index a4c64894bea9..41104b626989 100644 --- a/src/plugins/home/public/application/components/tutorial/instruction_set.js +++ b/src/plugins/home/public/application/components/tutorial/instruction_set.js @@ -28,7 +28,7 @@ import { import * as StatusCheckStates from './status_check_states'; import { injectI18n, FormattedMessage } from '@kbn/i18n-react'; -import { euiThemeVars } from '@kbn/ui-theme'; +import { euiThemeVars } from '@kbn/ui-theme'; // FIXME: remove this, and access style variables from EUI context class InstructionSetUi extends React.Component { constructor(props) { 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 491664ef3fda..6c53f7479789 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 @@ -148,7 +148,7 @@ export const getSavedObjects = (): SavedObject[] => [ optionsJSON: '{"useMargins":true,"syncColors":false,"syncCursor":true,"syncTooltips":false,"hidePanelTitles":false}', panelsJSON: - '[{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":21,"w":24,"h":10,"i":"5"},"panelIndex":"5","embeddableConfig":{"attributes":{"title":"[eCommerce] Promotion Tracking (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-1d08a43c-8913-4692-a3e0-8d77902f6e46"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-9725cdbd-a9f3-479f-a349-0f11244e5239"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-2031d0f8-01fc-4009-b1ad-a7b7ca9266c0"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"xy-visualization-layer-192ad2e4-2bb7-44a9-b345-e96045fa6ccd"}],"state":{"visualization":{"legend":{"isVisible":true,"showSingleSeries":true,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0,"yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"line","layerType":"data","layerId":"e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e","accessors":["a69956c9-43cd-4756-a3c0-e93cb1502a0b"],"yConfig":[{"forAccessor":"a69956c9-43cd-4756-a3c0-e93cb1502a0b","color":"rgba(211,96,134,1)","axisMode":"left"}],"xAccessor":"f3cc8168-6360-4727-a410-a57f5a325091","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"1d08a43c-8913-4692-a3e0-8d77902f6e46","accessors":["9a3d8abd-81a5-40ae-9616-020d5a5b2ee2"],"yConfig":[{"forAccessor":"9a3d8abd-81a5-40ae-9616-020d5a5b2ee2","color":"rgba(84,179,153,1)","axisMode":"left"}],"xAccessor":"644b06ea-73a3-47b1-9b40-3035844c4621","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"9725cdbd-a9f3-479f-a349-0f11244e5239","accessors":["b5588228-9c46-4a4b-92ee-d140c327bca0"],"yConfig":[{"forAccessor":"b5588228-9c46-4a4b-92ee-d140c327bca0","color":"rgba(96,146,192,1)","axisMode":"left"}],"xAccessor":"6749b404-4784-4fd6-8bf6-5712e84c7310","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"2031d0f8-01fc-4009-b1ad-a7b7ca9266c0","accessors":["985e05c0-3a0b-4e55-84bb-1f02128388a9"],"yConfig":[{"forAccessor":"985e05c0-3a0b-4e55-84bb-1f02128388a9","color":"rgba(202,142,174,1)","axisMode":"left"}],"xAccessor":"1b199cb1-b47f-48e6-b209-74eb81b303f5","palette":{"name":"default","type":"palette"}},{"layerId":"192ad2e4-2bb7-44a9-b345-e96045fa6ccd","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"c8c30be0-b88f-11e8-a451-f37365e9f268","label":"Event","key":{"type":"point_in_time"},"color":"#194D33","timeField":"order_date","icon":"bell","filter":{"type":"kibana_query","query":"taxful_total_price:>250","language":"lucene"},"extraFields":["taxful_total_price"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e":{"columns":{"f3cc8168-6360-4727-a410-a57f5a325091":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"a69956c9-43cd-4756-a3c0-e93cb1502a0b":{"label":"Revenue Trousers","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*trouser*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["f3cc8168-6360-4727-a410-a57f5a325091","a69956c9-43cd-4756-a3c0-e93cb1502a0b"],"incompleteColumns":{}},"1d08a43c-8913-4692-a3e0-8d77902f6e46":{"columns":{"644b06ea-73a3-47b1-9b40-3035844c4621":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"9a3d8abd-81a5-40ae-9616-020d5a5b2ee2":{"label":"Revenue Watches","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*watch*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["644b06ea-73a3-47b1-9b40-3035844c4621","9a3d8abd-81a5-40ae-9616-020d5a5b2ee2"],"incompleteColumns":{}},"9725cdbd-a9f3-479f-a349-0f11244e5239":{"columns":{"6749b404-4784-4fd6-8bf6-5712e84c7310":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"b5588228-9c46-4a4b-92ee-d140c327bca0":{"label":"Revenue Bags","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*bag*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["6749b404-4784-4fd6-8bf6-5712e84c7310","b5588228-9c46-4a4b-92ee-d140c327bca0"],"incompleteColumns":{}},"2031d0f8-01fc-4009-b1ad-a7b7ca9266c0":{"columns":{"1b199cb1-b47f-48e6-b209-74eb81b303f5":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"985e05c0-3a0b-4e55-84bb-1f02128388a9":{"label":"Revenue Cocktail Dresses","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*cocktail dress*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["1b199cb1-b47f-48e6-b209-74eb81b303f5","985e05c0-3a0b-4e55-84bb-1f02128388a9"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":false,"enhancements":{}},"title":"[eCommerce] Promotion Tracking"},{"version":"8.11.0","type":"lens","gridData":{"x":36,"y":7,"w":12,"h":7,"i":"7"},"panelIndex":"7","embeddableConfig":{"attributes":{"title":"Sold Products per Day","description":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-037375ae-9e23-4dd5-a4f0-5f117bb7dac1"}],"state":{"visualization":{"layerId":"037375ae-9e23-4dd5-a4f0-5f117bb7dac1","layerType":"data","metricAccessor":"c27bd77c-68e2-4d75-8fda-41c45d22f8d4","maxAccessor":"ce816876-e92d-4b1a-bbb0-ed7637fc0eea","showBar":true,"color":"#68BC00"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"037375ae-9e23-4dd5-a4f0-5f117bb7dac1":{"ignoreGlobalFilters":false,"columns":{"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"time_range","isBucketed":false,"scale":"ratio","references":[],"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0",{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1",1000]},60]},60]},24],"location":{"min":11,"max":45},"text":"time_range() / 1000 / 60 / 60 / 24"}],"location":{"min":0,"max":46},"text":"count() / (time_range() / 1000 / 60 / 60 / 24)"}},"references":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1"],"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4":{"label":"Trxns / day","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"format":{"id":"number"},"formula":"count() / (time_range() / 1000 / 60 / 60 / 24)","isFormulaBroken":false},"references":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2"],"customLabel":true},"ce816876-e92d-4b1a-bbb0-ed7637fc0eea":{"label":"Static value: 300","dataType":"number","operationType":"static_value","isStaticValue":true,"isBucketed":false,"scale":"ratio","params":{"value":"300"},"references":[]}},"columnOrder":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2","c27bd77c-68e2-4d75-8fda-41c45d22f8d4","ce816876-e92d-4b1a-bbb0-ed7637fc0eea"],"incompleteColumns":{}}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"timeRange":{"from":"now-7d","to":"now"},"enhancements":{}}},{"version":"8.11.0","type":"search","gridData":{"x":0,"y":54,"w":48,"h":18,"i":"10"},"panelIndex":"10","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_10"},{"version":"8.11.0","type":"map","gridData":{"x":0,"y":31,"w":24,"h":14,"i":"11"},"panelIndex":"11","embeddableConfig":{"isLayerTOCOpen":false,"hiddenLayers":[],"mapCenter":{"lat":45.88578,"lon":-15.07605,"zoom":2.11},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_11"},{"version":"8.11.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":7,"i":"a71cf076-6895-491c-8878-63592e429ed5"},"panelIndex":"a71cf076-6895-491c-8878-63592e429ed5","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_a71cf076-6895-491c-8878-63592e429ed5"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":0,"w":12,"h":7,"i":"75283285-dffd-48a7-a0c2-2235184b5282"},"panelIndex":"75283285-dffd-48a7-a0c2-2235184b5282","embeddableConfig":{"enhancements":{},"attributes":{"visualizationType":"lnsMetric","state":{"visualization":{"layerId":"c7478794-6767-4286-9d65-1c0ecd909dd8","layerType":"data","metricAccessor":"041db33b-5c9c-47f3-a5d3-ef5e255d1663"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"c7478794-6767-4286-9d65-1c0ecd909dd8":{"columnOrder":["041db33b-5c9c-47f3-a5d3-ef5e255d1663"],"columns":{"041db33b-5c9c-47f3-a5d3-ef5e255d1663":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Sum of revenue","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","params":{}}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}},"references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-c7478794-6767-4286-9d65-1c0ecd909dd8"}]},"hidePanelTitles":true},"title":"Sum of revenue"},{"version":"8.11.0","type":"lens","gridData":{"x":36,"y":0,"w":12,"h":7,"i":"58774330-b1b3-42dd-a04c-fbce9cc4d288"},"panelIndex":"58774330-b1b3-42dd-a04c-fbce9cc4d288","embeddableConfig":{"enhancements":{},"attributes":{"title":"Median spending","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-4fb42a8e-b133-43c8-805c-a38472053938"}],"state":{"visualization":{"layerId":"4fb42a8e-b133-43c8-805c-a38472053938","layerType":"data","metricAccessor":"020bbfdf-9ef8-4802-aa9e-342d2ea0bebf"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"4fb42a8e-b133-43c8-805c-a38472053938":{"columnOrder":["020bbfdf-9ef8-4802-aa9e-342d2ea0bebf"],"columns":{"020bbfdf-9ef8-4802-aa9e-342d2ea0bebf":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Median spending","operationType":"median","scale":"ratio","sourceField":"taxful_total_price","params":{}}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true},"title":"Median spending"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":7,"w":12,"h":7,"i":"b63ec47d-aace-4980-b928-6be8adafa5a4"},"panelIndex":"b63ec47d-aace-4980-b928-6be8adafa5a4","embeddableConfig":{"enhancements":{},"attributes":{"visualizationType":"lnsMetric","state":{"visualization":{"layerId":"667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17","layerType":"data","metricAccessor":"c52c2003-ae58-4604-bae7-52ba0fb38a01"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17":{"columnOrder":["c52c2003-ae58-4604-bae7-52ba0fb38a01"],"columns":{"c52c2003-ae58-4604-bae7-52ba0fb38a01":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Avg. items sold","operationType":"average","params":{"format":{"id":"number","params":{"decimals":1,"compact":true}}},"scale":"ratio","sourceField":"total_quantity"}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}},"references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17"}]},"hidePanelTitles":true},"title":"Avg. items sold"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":14,"w":24,"h":7,"i":"d9495793-80ba-4a9a-b0e3-d1155ec99b09"},"panelIndex":"d9495793-80ba-4a9a-b0e3-d1155ec99b09","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"b6093a53-884f-42c2-9fcc-ba56cfb66c53":{"columnOrder":["15c45f89-a149-443a-a830-aa8c3a9317db","2b41b3d8-2f62-407a-a866-960f254c679d","eadae280-2da3-4d1d-a0e1-f9733f89c15b","ddc92e50-4d5c-413e-b91b-3e504889fa65","5e31e5d3-2aaa-4475-a130-3b69bf2f748a"],"columns":{"15c45f89-a149-443a-a830-aa8c3a9317db":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"},"2b41b3d8-2f62-407a-a866-960f254c679d":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Total items","operationType":"sum","scale":"ratio","sourceField":"products.quantity"},"5e31e5d3-2aaa-4475-a130-3b69bf2f748a":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Tx. last week","operationType":"count","scale":"ratio","sourceField":"___records___","timeShift":"1w"},"ddc92e50-4d5c-413e-b91b-3e504889fa65":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Transactions","operationType":"count","scale":"ratio","sourceField":"___records___"},"eadae280-2da3-4d1d-a0e1-f9733f89c15b":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Last week","operationType":"sum","scale":"ratio","sourceField":"products.quantity","timeShift":"1w"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"curveType":"LINEAR","fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["2b41b3d8-2f62-407a-a866-960f254c679d","eadae280-2da3-4d1d-a0e1-f9733f89c15b","5e31e5d3-2aaa-4475-a130-3b69bf2f748a","ddc92e50-4d5c-413e-b91b-3e504889fa65"],"layerId":"b6093a53-884f-42c2-9fcc-ba56cfb66c53","position":"top","seriesType":"line","showGridlines":false,"xAccessor":"15c45f89-a149-443a-a830-aa8c3a9317db","yConfig":[{"color":"#b6e0d5","forAccessor":"eadae280-2da3-4d1d-a0e1-f9733f89c15b"},{"color":"#edafc4","forAccessor":"5e31e5d3-2aaa-4475-a130-3b69bf2f748a"}],"layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-b6093a53-884f-42c2-9fcc-ba56cfb66c53","type":"index-pattern"}]}},"title":"Transactions per day"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":31,"w":24,"h":14,"i":"bda054f7-2d06-4936-b461-365d1be621fa"},"panelIndex":"bda054f7-2d06-4936-b461-365d1be621fa","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"0731ee8b-31c5-4be9-92d9-69ee760465d7":{"columnOrder":["7bf8f089-1542-40bd-b349-45fdfc309ac6","826b2f39-b616-40b2-a222-972fdc1d7596","cfd45c47-fc41-430c-9e7a-b71dc0c916b0","bf51c1af-443e-49f4-a21f-54c87bfc5677","bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1","bf51c1af-443e-49f4-a21f-54c87bfc5677X2"],"columns":{"7bf8f089-1542-40bd-b349-45fdfc309ac6":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"},"826b2f39-b616-40b2-a222-972fdc1d7596":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"This week","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"bf51c1af-443e-49f4-a21f-54c87bfc5677":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Difference","operationType":"formula","params":{"format":{"id":"number","params":{"decimals":2}},"formula":"sum(taxful_total_price) - sum(taxful_total_price, shift=\'1w\')","isFormulaBroken":false},"references":["bf51c1af-443e-49f4-a21f-54c87bfc5677X2"],"scale":"ratio"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X1":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","timeShift":"1w"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X2":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"math","params":{"tinymathAst":{"args":["bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1"],"location":{"max":61,"min":0},"name":"subtract","text":"sum(taxful_total_price) - sum(taxful_total_price, shift=\'1w\')","type":"function"}},"references":["bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1"],"scale":"ratio"},"cfd45c47-fc41-430c-9e7a-b71dc0c916b0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"1 week ago","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","timeShift":"1w"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"columns":[{"columnId":"7bf8f089-1542-40bd-b349-45fdfc309ac6"},{"alignment":"left","columnId":"826b2f39-b616-40b2-a222-972fdc1d7596"},{"columnId":"cfd45c47-fc41-430c-9e7a-b71dc0c916b0"},{"colorMode":"text","columnId":"bf51c1af-443e-49f4-a21f-54c87bfc5677","isTransposed":false,"palette":{"name":"custom","params":{"colorStops":[{"color":"#D36086","stop":-10000},{"color":"#209280","stop":0}],"continuity":"above","name":"custom","rangeMax":0,"rangeMin":-10000,"rangeType":"number","steps":5,"stops":[{"color":"#D36086","stop":0},{"color":"#209280","stop":2249.03125}]},"type":"palette"}}],"layerId":"0731ee8b-31c5-4be9-92d9-69ee760465d7","layerType":"data","rowHeight":"single","rowHeightLines":1}},"visualizationType":"lnsDatatable","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-0731ee8b-31c5-4be9-92d9-69ee760465d7","type":"index-pattern"}]}},"title":"Daily comparison"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":45,"w":24,"h":9,"i":"d68e91dd-1539-48b0-9279-b43bba2054fe"},"panelIndex":"d68e91dd-1539-48b0-9279-b43bba2054fe","embeddableConfig":{"hidePanelTitles":false,"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"5ed846c2-a70b-4d9c-a244-f254bef763b8":{"columnOrder":["d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","7ac31901-277a-46e2-8128-8d684b2c1127"],"columns":{"7ac31901-277a-46e2-8128-8d684b2c1127":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Items","operationType":"count","scale":"ratio","sourceField":"___records___"},"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Product name","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"7ac31901-277a-46e2-8128-8d684b2c1127","type":"column"},"orderDirection":"desc","otherBucket":false,"size":5,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"products.product_name.keyword"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["7ac31901-277a-46e2-8128-8d684b2c1127"],"layerId":"5ed846c2-a70b-4d9c-a244-f254bef763b8","position":"top","seriesType":"bar_horizontal","showGridlines":false,"xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_horizontal","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-5ed846c2-a70b-4d9c-a244-f254bef763b8","type":"index-pattern"}]}},"title":"Top products this week"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":45,"w":24,"h":9,"i":"39d96714-152f-414b-992c-ce2492fc69f3"},"panelIndex":"39d96714-152f-414b-992c-ce2492fc69f3","embeddableConfig":{"timeRange":{"from":"now-2w","to":"now-1w"},"hidePanelTitles":false,"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"5ed846c2-a70b-4d9c-a244-f254bef763b8":{"columnOrder":["d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","7ac31901-277a-46e2-8128-8d684b2c1127"],"columns":{"7ac31901-277a-46e2-8128-8d684b2c1127":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Items","operationType":"count","scale":"ratio","sourceField":"___records___"},"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Product name","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"7ac31901-277a-46e2-8128-8d684b2c1127","type":"column"},"orderDirection":"desc","otherBucket":false,"size":5,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"products.product_name.keyword"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["7ac31901-277a-46e2-8128-8d684b2c1127"],"layerId":"5ed846c2-a70b-4d9c-a244-f254bef763b8","position":"top","seriesType":"bar_horizontal","showGridlines":false,"xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_horizontal","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-5ed846c2-a70b-4d9c-a244-f254bef763b8","type":"index-pattern"}]}},"title":"Top products last week"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":14,"w":24,"h":17,"i":"cd47b7cb-0ac0-43e0-b8c6-53489648bdef"},"panelIndex":"cd47b7cb-0ac0-43e0-b8c6-53489648bdef","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"97c63ea6-9305-4755-97d1-0f26817c6f9a":{"columnOrder":["9f61a7df-198e-4754-b34c-81ed544136ba","ebcb19af-0900-4439-949f-d8cd9bccde19","5575214b-7f21-4b6c-8bc1-34433c6a0c58"],"columns":{"5575214b-7f21-4b6c-8bc1-34433c6a0c58":{"dataType":"number","isBucketed":false,"label":"Count of records","operationType":"count","scale":"ratio","sourceField":"___records___"},"9f61a7df-198e-4754-b34c-81ed544136ba":{"dataType":"string","isBucketed":true,"label":"Top values of category.keyword","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"5575214b-7f21-4b6c-8bc1-34433c6a0c58","type":"column"},"orderDirection":"desc","otherBucket":true,"size":10,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"category.keyword"},"ebcb19af-0900-4439-949f-d8cd9bccde19":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["5575214b-7f21-4b6c-8bc1-34433c6a0c58"],"layerId":"97c63ea6-9305-4755-97d1-0f26817c6f9a","position":"top","seriesType":"bar_percentage_stacked","showGridlines":false,"splitAccessor":"9f61a7df-198e-4754-b34c-81ed544136ba","xAccessor":"ebcb19af-0900-4439-949f-d8cd9bccde19","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_percentage_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-97c63ea6-9305-4755-97d1-0f26817c6f9a","type":"index-pattern"}]}},"title":"Breakdown by category"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":7,"w":24,"h":7,"i":"bdb525ab-270b-46f1-a847-dd29be19aadb"},"panelIndex":"bdb525ab-270b-46f1-a847-dd29be19aadb","embeddableConfig":{"enhancements":{},"hidePanelTitles":false,"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"c7478794-6767-4286-9d65-1c0ecd909dd8":{"columnOrder":["8289349e-6d1b-4abf-b164-0208183d2c34","041db33b-5c9c-47f3-a5d3-ef5e255d1663","041db33b-5c9c-47f3-a5d3-ef5e255d1663X0","041db33b-5c9c-47f3-a5d3-ef5e255d1663X1"],"columns":{"041db33b-5c9c-47f3-a5d3-ef5e255d1663":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"% of target ($10k)","operationType":"formula","params":{"format":{"id":"percent","params":{"decimals":0}},"formula":"sum(taxful_total_price) / 10000 - 1","isFormulaBroken":false},"references":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X1"],"scale":"ratio"},"041db33b-5c9c-47f3-a5d3-ef5e255d1663X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Weekly revenue","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"041db33b-5c9c-47f3-a5d3-ef5e255d1663X1":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Weekly revenue","operationType":"math","params":{"tinymathAst":{"args":[{"args":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X0",10000],"location":{"max":32,"min":0},"name":"divide","text":"sum(taxful_total_price) / 10000 ","type":"function"},1],"location":{"max":35,"min":0},"name":"subtract","text":"sum(taxful_total_price) / 10000 - 1","type":"function"}},"references":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X0"],"scale":"ratio"},"8289349e-6d1b-4abf-b164-0208183d2c34":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["041db33b-5c9c-47f3-a5d3-ef5e255d1663"],"layerId":"c7478794-6767-4286-9d65-1c0ecd909dd8","seriesType":"bar_stacked","xAccessor":"8289349e-6d1b-4abf-b164-0208183d2c34","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-c7478794-6767-4286-9d65-1c0ecd909dd8","type":"index-pattern"}]}},"title":"% of target revenue ($10k)"}]', + '[{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":21,"w":24,"h":10,"i":"5"},"panelIndex":"5","embeddableConfig":{"attributes":{"title":"[eCommerce] Promotion Tracking (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-1d08a43c-8913-4692-a3e0-8d77902f6e46"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-9725cdbd-a9f3-479f-a349-0f11244e5239"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-2031d0f8-01fc-4009-b1ad-a7b7ca9266c0"},{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"xy-visualization-layer-192ad2e4-2bb7-44a9-b345-e96045fa6ccd"}],"state":{"visualization":{"legend":{"isVisible":true,"showSingleSeries":true,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0,"yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"line","layerType":"data","layerId":"e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e","accessors":["a69956c9-43cd-4756-a3c0-e93cb1502a0b"],"yConfig":[{"forAccessor":"a69956c9-43cd-4756-a3c0-e93cb1502a0b","axisMode":"left"}],"xAccessor":"f3cc8168-6360-4727-a410-a57f5a325091","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"1d08a43c-8913-4692-a3e0-8d77902f6e46","accessors":["9a3d8abd-81a5-40ae-9616-020d5a5b2ee2"],"yConfig":[{"forAccessor":"9a3d8abd-81a5-40ae-9616-020d5a5b2ee2","axisMode":"left"}],"xAccessor":"644b06ea-73a3-47b1-9b40-3035844c4621","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"9725cdbd-a9f3-479f-a349-0f11244e5239","accessors":["b5588228-9c46-4a4b-92ee-d140c327bca0"],"yConfig":[{"forAccessor":"b5588228-9c46-4a4b-92ee-d140c327bca0","axisMode":"left"}],"xAccessor":"6749b404-4784-4fd6-8bf6-5712e84c7310","palette":{"name":"default","type":"palette"}},{"seriesType":"line","layerType":"data","layerId":"2031d0f8-01fc-4009-b1ad-a7b7ca9266c0","accessors":["985e05c0-3a0b-4e55-84bb-1f02128388a9"],"yConfig":[{"forAccessor":"985e05c0-3a0b-4e55-84bb-1f02128388a9","axisMode":"left"}],"xAccessor":"1b199cb1-b47f-48e6-b209-74eb81b303f5","palette":{"name":"default","type":"palette"}},{"layerId":"192ad2e4-2bb7-44a9-b345-e96045fa6ccd","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"c8c30be0-b88f-11e8-a451-f37365e9f268","label":"Event","key":{"type":"point_in_time"},"color":"#194D33","timeField":"order_date","icon":"bell","filter":{"type":"kibana_query","query":"taxful_total_price:>250","language":"lucene"},"extraFields":["taxful_total_price"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"e3b3cb5c-e3b1-497f-a5d5-fddb0dabc94e":{"columns":{"f3cc8168-6360-4727-a410-a57f5a325091":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"a69956c9-43cd-4756-a3c0-e93cb1502a0b":{"label":"Revenue Trousers","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*trouser*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["f3cc8168-6360-4727-a410-a57f5a325091","a69956c9-43cd-4756-a3c0-e93cb1502a0b"],"incompleteColumns":{}},"1d08a43c-8913-4692-a3e0-8d77902f6e46":{"columns":{"644b06ea-73a3-47b1-9b40-3035844c4621":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"9a3d8abd-81a5-40ae-9616-020d5a5b2ee2":{"label":"Revenue Watches","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*watch*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["644b06ea-73a3-47b1-9b40-3035844c4621","9a3d8abd-81a5-40ae-9616-020d5a5b2ee2"],"incompleteColumns":{}},"9725cdbd-a9f3-479f-a349-0f11244e5239":{"columns":{"6749b404-4784-4fd6-8bf6-5712e84c7310":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"b5588228-9c46-4a4b-92ee-d140c327bca0":{"label":"Revenue Bags","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*bag*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["6749b404-4784-4fd6-8bf6-5712e84c7310","b5588228-9c46-4a4b-92ee-d140c327bca0"],"incompleteColumns":{}},"2031d0f8-01fc-4009-b1ad-a7b7ca9266c0":{"columns":{"1b199cb1-b47f-48e6-b209-74eb81b303f5":{"label":"order_date","dataType":"date","operationType":"date_histogram","sourceField":"order_date","isBucketed":true,"scale":"interval","params":{"interval":"12h","includeEmptyRows":true,"dropPartials":false}},"985e05c0-3a0b-4e55-84bb-1f02128388a9":{"label":"Revenue Cocktail Dresses","dataType":"number","operationType":"sum","sourceField":"taxful_total_price","isBucketed":false,"scale":"ratio","filter":{"query":"products.product_name:*cocktail dress*","language":"lucene"},"params":{"format":{"id":"number"},"emptyAsNull":true},"customLabel":true}},"columnOrder":["1b199cb1-b47f-48e6-b209-74eb81b303f5","985e05c0-3a0b-4e55-84bb-1f02128388a9"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":false,"enhancements":{}},"title":"[eCommerce] Promotion Tracking"},{"version":"8.11.0","type":"lens","gridData":{"x":36,"y":7,"w":12,"h":7,"i":"7"},"panelIndex":"7","embeddableConfig":{"attributes":{"title":"Sold Products per Day","description":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-037375ae-9e23-4dd5-a4f0-5f117bb7dac1"}],"state":{"visualization":{"layerId":"037375ae-9e23-4dd5-a4f0-5f117bb7dac1","layerType":"data","metricAccessor":"c27bd77c-68e2-4d75-8fda-41c45d22f8d4","maxAccessor":"ce816876-e92d-4b1a-bbb0-ed7637fc0eea","showBar":true,"palette":{"type":"palette","name":"status","params":{"name":"status","reverse":true,"rangeType":"percent","rangeMin":0,"rangeMax":100,"progression":"fixed","stops":[{"color":"#23be8f","stop":33.33},{"color":"#fcd279","stop":66.66},{"color":"#f66d64","stop":100}],"steps":3,"colorStops":[],"continuity":"all","maxSteps":5}}},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"037375ae-9e23-4dd5-a4f0-5f117bb7dac1":{"ignoreGlobalFilters":false,"columns":{"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"time_range","isBucketed":false,"scale":"ratio","references":[],"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2":{"label":"Part of count() / (time_range() / 1000 / 60 / 60 / 24)","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0",{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":[{"type":"function","name":"divide","args":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1",1000]},60]},60]},24],"location":{"min":11,"max":45},"text":"time_range() / 1000 / 60 / 60 / 24"}],"location":{"min":0,"max":46},"text":"count() / (time_range() / 1000 / 60 / 60 / 24)"}},"references":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1"],"customLabel":true},"c27bd77c-68e2-4d75-8fda-41c45d22f8d4":{"label":"Trxns / day","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"format":{"id":"number"},"formula":"count() / (time_range() / 1000 / 60 / 60 / 24)","isFormulaBroken":false},"references":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2"],"customLabel":true},"ce816876-e92d-4b1a-bbb0-ed7637fc0eea":{"label":"Static value: 300","dataType":"number","operationType":"static_value","isStaticValue":true,"isBucketed":false,"scale":"ratio","params":{"value":"300"},"references":[]}},"columnOrder":["c27bd77c-68e2-4d75-8fda-41c45d22f8d4X0","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X1","c27bd77c-68e2-4d75-8fda-41c45d22f8d4X2","c27bd77c-68e2-4d75-8fda-41c45d22f8d4","ce816876-e92d-4b1a-bbb0-ed7637fc0eea"],"incompleteColumns":{}}}},"indexpattern":{"layers":{}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"timeRange":{"from":"now-7d","to":"now"},"enhancements":{}}},{"version":"8.11.0","type":"search","gridData":{"x":0,"y":54,"w":48,"h":18,"i":"10"},"panelIndex":"10","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_10"},{"version":"8.11.0","type":"map","gridData":{"x":0,"y":31,"w":24,"h":14,"i":"11"},"panelIndex":"11","embeddableConfig":{"isLayerTOCOpen":false,"hiddenLayers":[],"mapCenter":{"lat":45.88578,"lon":-15.07605,"zoom":2.11},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_11"},{"version":"8.11.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":7,"i":"a71cf076-6895-491c-8878-63592e429ed5"},"panelIndex":"a71cf076-6895-491c-8878-63592e429ed5","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_a71cf076-6895-491c-8878-63592e429ed5"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":0,"w":12,"h":7,"i":"75283285-dffd-48a7-a0c2-2235184b5282"},"panelIndex":"75283285-dffd-48a7-a0c2-2235184b5282","embeddableConfig":{"enhancements":{},"attributes":{"visualizationType":"lnsMetric","state":{"visualization":{"layerId":"c7478794-6767-4286-9d65-1c0ecd909dd8","layerType":"data","metricAccessor":"041db33b-5c9c-47f3-a5d3-ef5e255d1663"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"c7478794-6767-4286-9d65-1c0ecd909dd8":{"columnOrder":["041db33b-5c9c-47f3-a5d3-ef5e255d1663"],"columns":{"041db33b-5c9c-47f3-a5d3-ef5e255d1663":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Sum of revenue","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","params":{}}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}},"references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-c7478794-6767-4286-9d65-1c0ecd909dd8"}]},"hidePanelTitles":true},"title":"Sum of revenue"},{"version":"8.11.0","type":"lens","gridData":{"x":36,"y":0,"w":12,"h":7,"i":"58774330-b1b3-42dd-a04c-fbce9cc4d288"},"panelIndex":"58774330-b1b3-42dd-a04c-fbce9cc4d288","embeddableConfig":{"enhancements":{},"attributes":{"title":"Median spending","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-4fb42a8e-b133-43c8-805c-a38472053938"}],"state":{"visualization":{"layerId":"4fb42a8e-b133-43c8-805c-a38472053938","layerType":"data","metricAccessor":"020bbfdf-9ef8-4802-aa9e-342d2ea0bebf"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"4fb42a8e-b133-43c8-805c-a38472053938":{"columnOrder":["020bbfdf-9ef8-4802-aa9e-342d2ea0bebf"],"columns":{"020bbfdf-9ef8-4802-aa9e-342d2ea0bebf":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Median spending","operationType":"median","scale":"ratio","sourceField":"taxful_total_price","params":{}}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true},"title":"Median spending"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":7,"w":12,"h":7,"i":"b63ec47d-aace-4980-b928-6be8adafa5a4"},"panelIndex":"b63ec47d-aace-4980-b928-6be8adafa5a4","embeddableConfig":{"enhancements":{},"attributes":{"visualizationType":"lnsMetric","state":{"visualization":{"layerId":"667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17","layerType":"data","metricAccessor":"c52c2003-ae58-4604-bae7-52ba0fb38a01"},"query":{"language":"kuery","query":""},"filters":[],"datasourceStates":{"formBased":{"layers":{"667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17":{"columnOrder":["c52c2003-ae58-4604-bae7-52ba0fb38a01"],"columns":{"c52c2003-ae58-4604-bae7-52ba0fb38a01":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Avg. items sold","operationType":"average","params":{"format":{"id":"number","params":{"decimals":1,"compact":true}}},"scale":"ratio","sourceField":"total_quantity"}},"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}},"references":[{"type":"index-pattern","id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-667067a2-7cdf-4f0e-a9fe-eb4f4f1f2f17"}]},"hidePanelTitles":true},"title":"Avg. items sold"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":14,"w":24,"h":7,"i":"d9495793-80ba-4a9a-b0e3-d1155ec99b09"},"panelIndex":"d9495793-80ba-4a9a-b0e3-d1155ec99b09","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"b6093a53-884f-42c2-9fcc-ba56cfb66c53":{"columnOrder":["15c45f89-a149-443a-a830-aa8c3a9317db","2b41b3d8-2f62-407a-a866-960f254c679d","eadae280-2da3-4d1d-a0e1-f9733f89c15b","ddc92e50-4d5c-413e-b91b-3e504889fa65","5e31e5d3-2aaa-4475-a130-3b69bf2f748a"],"columns":{"15c45f89-a149-443a-a830-aa8c3a9317db":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"},"2b41b3d8-2f62-407a-a866-960f254c679d":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Total items","operationType":"sum","scale":"ratio","sourceField":"products.quantity"},"5e31e5d3-2aaa-4475-a130-3b69bf2f748a":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Tx. last week","operationType":"count","scale":"ratio","sourceField":"___records___","timeShift":"1w"},"ddc92e50-4d5c-413e-b91b-3e504889fa65":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Transactions","operationType":"count","scale":"ratio","sourceField":"___records___"},"eadae280-2da3-4d1d-a0e1-f9733f89c15b":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Last week","operationType":"sum","scale":"ratio","sourceField":"products.quantity","timeShift":"1w"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"curveType":"LINEAR","fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["2b41b3d8-2f62-407a-a866-960f254c679d","eadae280-2da3-4d1d-a0e1-f9733f89c15b","5e31e5d3-2aaa-4475-a130-3b69bf2f748a","ddc92e50-4d5c-413e-b91b-3e504889fa65"],"layerId":"b6093a53-884f-42c2-9fcc-ba56cfb66c53","position":"top","seriesType":"line","showGridlines":false,"xAccessor":"15c45f89-a149-443a-a830-aa8c3a9317db","yConfig":[],"layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"line","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-b6093a53-884f-42c2-9fcc-ba56cfb66c53","type":"index-pattern"}]}},"title":"Transactions per day"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":31,"w":24,"h":14,"i":"bda054f7-2d06-4936-b461-365d1be621fa"},"panelIndex":"bda054f7-2d06-4936-b461-365d1be621fa","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"0731ee8b-31c5-4be9-92d9-69ee760465d7":{"columnOrder":["7bf8f089-1542-40bd-b349-45fdfc309ac6","826b2f39-b616-40b2-a222-972fdc1d7596","cfd45c47-fc41-430c-9e7a-b71dc0c916b0","bf51c1af-443e-49f4-a21f-54c87bfc5677","bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1","bf51c1af-443e-49f4-a21f-54c87bfc5677X2"],"columns":{"7bf8f089-1542-40bd-b349-45fdfc309ac6":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"},"826b2f39-b616-40b2-a222-972fdc1d7596":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"This week","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"bf51c1af-443e-49f4-a21f-54c87bfc5677":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Difference","operationType":"formula","params":{"format":{"id":"number","params":{"decimals":2}},"formula":"sum(taxful_total_price) - sum(taxful_total_price, shift=\'1w\')","isFormulaBroken":false},"references":["bf51c1af-443e-49f4-a21f-54c87bfc5677X2"],"scale":"ratio"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X1":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","timeShift":"1w"},"bf51c1af-443e-49f4-a21f-54c87bfc5677X2":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Difference","operationType":"math","params":{"tinymathAst":{"args":["bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1"],"location":{"max":61,"min":0},"name":"subtract","text":"sum(taxful_total_price) - sum(taxful_total_price, shift=\'1w\')","type":"function"}},"references":["bf51c1af-443e-49f4-a21f-54c87bfc5677X0","bf51c1af-443e-49f4-a21f-54c87bfc5677X1"],"scale":"ratio"},"cfd45c47-fc41-430c-9e7a-b71dc0c916b0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"1 week ago","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price","timeShift":"1w"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"columns":[{"columnId":"7bf8f089-1542-40bd-b349-45fdfc309ac6"},{"alignment":"left","columnId":"826b2f39-b616-40b2-a222-972fdc1d7596"},{"columnId":"cfd45c47-fc41-430c-9e7a-b71dc0c916b0"},{"colorMode":"text","columnId":"bf51c1af-443e-49f4-a21f-54c87bfc5677","isTransposed":false,"palette":{"type":"palette","name":"status","params":{"continuity":"above","name":"status","rangeMax":null,"rangeMin":-2284.2265625,"rangeType":"percent","steps":5,"stops":[{"color":"#23be8f","stop":0},{"color":"#9dedce","stop":20},{"color":"#fcd279","stop":40},{"color":"#ffc0b8","stop":60},{"color":"#f66d64","stop":80}],"reverse":true}}}],"layerId":"0731ee8b-31c5-4be9-92d9-69ee760465d7","layerType":"data","rowHeight":"single","rowHeightLines":1}},"visualizationType":"lnsDatatable","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-0731ee8b-31c5-4be9-92d9-69ee760465d7","type":"index-pattern"}]}},"title":"Daily comparison"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":45,"w":24,"h":9,"i":"d68e91dd-1539-48b0-9279-b43bba2054fe"},"panelIndex":"d68e91dd-1539-48b0-9279-b43bba2054fe","embeddableConfig":{"hidePanelTitles":false,"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"5ed846c2-a70b-4d9c-a244-f254bef763b8":{"columnOrder":["d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","7ac31901-277a-46e2-8128-8d684b2c1127"],"columns":{"7ac31901-277a-46e2-8128-8d684b2c1127":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Items","operationType":"count","scale":"ratio","sourceField":"___records___"},"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Product name","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"7ac31901-277a-46e2-8128-8d684b2c1127","type":"column"},"orderDirection":"desc","otherBucket":false,"size":5,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"products.product_name.keyword"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["7ac31901-277a-46e2-8128-8d684b2c1127"],"layerId":"5ed846c2-a70b-4d9c-a244-f254bef763b8","position":"top","seriesType":"bar_horizontal","showGridlines":false,"xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_horizontal","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-5ed846c2-a70b-4d9c-a244-f254bef763b8","type":"index-pattern"}]}},"title":"Top products this week"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":45,"w":24,"h":9,"i":"39d96714-152f-414b-992c-ce2492fc69f3"},"panelIndex":"39d96714-152f-414b-992c-ce2492fc69f3","embeddableConfig":{"timeRange":{"from":"now-2w","to":"now-1w"},"hidePanelTitles":false,"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"5ed846c2-a70b-4d9c-a244-f254bef763b8":{"columnOrder":["d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","7ac31901-277a-46e2-8128-8d684b2c1127"],"columns":{"7ac31901-277a-46e2-8128-8d684b2c1127":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Items","operationType":"count","scale":"ratio","sourceField":"___records___"},"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46":{"customLabel":true,"dataType":"string","isBucketed":true,"label":"Product name","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"7ac31901-277a-46e2-8128-8d684b2c1127","type":"column"},"orderDirection":"desc","otherBucket":false,"size":5,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"products.product_name.keyword"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":true,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["7ac31901-277a-46e2-8128-8d684b2c1127"],"layerId":"5ed846c2-a70b-4d9c-a244-f254bef763b8","position":"top","seriesType":"bar_horizontal","showGridlines":false,"xAccessor":"d77cdd24-dedc-48dd-9a4b-d34c6f1a6c46","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_horizontal","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-5ed846c2-a70b-4d9c-a244-f254bef763b8","type":"index-pattern"}]}},"title":"Top products last week"},{"version":"8.11.0","type":"lens","gridData":{"x":24,"y":14,"w":24,"h":17,"i":"cd47b7cb-0ac0-43e0-b8c6-53489648bdef"},"panelIndex":"cd47b7cb-0ac0-43e0-b8c6-53489648bdef","embeddableConfig":{"enhancements":{},"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"97c63ea6-9305-4755-97d1-0f26817c6f9a":{"columnOrder":["9f61a7df-198e-4754-b34c-81ed544136ba","ebcb19af-0900-4439-949f-d8cd9bccde19","5575214b-7f21-4b6c-8bc1-34433c6a0c58"],"columns":{"5575214b-7f21-4b6c-8bc1-34433c6a0c58":{"dataType":"number","isBucketed":false,"label":"Count of records","operationType":"count","scale":"ratio","sourceField":"___records___"},"9f61a7df-198e-4754-b34c-81ed544136ba":{"dataType":"string","isBucketed":true,"label":"Top values of category.keyword","operationType":"terms","params":{"missingBucket":false,"orderBy":{"columnId":"5575214b-7f21-4b6c-8bc1-34433c6a0c58","type":"column"},"orderDirection":"desc","otherBucket":true,"size":10,"parentFormat":{"id":"terms"}},"scale":"ordinal","sourceField":"category.keyword"},"ebcb19af-0900-4439-949f-d8cd9bccde19":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["5575214b-7f21-4b6c-8bc1-34433c6a0c58"],"layerId":"97c63ea6-9305-4755-97d1-0f26817c6f9a","position":"top","seriesType":"bar_percentage_stacked","showGridlines":false,"splitAccessor":"9f61a7df-198e-4754-b34c-81ed544136ba","xAccessor":"ebcb19af-0900-4439-949f-d8cd9bccde19","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_percentage_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"show","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-97c63ea6-9305-4755-97d1-0f26817c6f9a","type":"index-pattern"}]}},"title":"Breakdown by category"},{"version":"8.11.0","type":"lens","gridData":{"x":0,"y":7,"w":24,"h":7,"i":"bdb525ab-270b-46f1-a847-dd29be19aadb"},"panelIndex":"bdb525ab-270b-46f1-a847-dd29be19aadb","embeddableConfig":{"enhancements":{},"hidePanelTitles":false,"attributes":{"state":{"datasourceStates":{"formBased":{"layers":{"c7478794-6767-4286-9d65-1c0ecd909dd8":{"columnOrder":["8289349e-6d1b-4abf-b164-0208183d2c34","041db33b-5c9c-47f3-a5d3-ef5e255d1663","041db33b-5c9c-47f3-a5d3-ef5e255d1663X0","041db33b-5c9c-47f3-a5d3-ef5e255d1663X1"],"columns":{"041db33b-5c9c-47f3-a5d3-ef5e255d1663":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"% of target ($10k)","operationType":"formula","params":{"format":{"id":"percent","params":{"decimals":0}},"formula":"sum(taxful_total_price) / 10000 - 1","isFormulaBroken":false},"references":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X1"],"scale":"ratio"},"041db33b-5c9c-47f3-a5d3-ef5e255d1663X0":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Weekly revenue","operationType":"sum","scale":"ratio","sourceField":"taxful_total_price"},"041db33b-5c9c-47f3-a5d3-ef5e255d1663X1":{"customLabel":true,"dataType":"number","isBucketed":false,"label":"Part of Weekly revenue","operationType":"math","params":{"tinymathAst":{"args":[{"args":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X0",10000],"location":{"max":32,"min":0},"name":"divide","text":"sum(taxful_total_price) / 10000 ","type":"function"},1],"location":{"max":35,"min":0},"name":"subtract","text":"sum(taxful_total_price) / 10000 - 1","type":"function"}},"references":["041db33b-5c9c-47f3-a5d3-ef5e255d1663X0"],"scale":"ratio"},"8289349e-6d1b-4abf-b164-0208183d2c34":{"dataType":"date","isBucketed":true,"label":"order_date","operationType":"date_histogram","params":{"interval":"1d","includeEmptyRows":true},"scale":"interval","sourceField":"order_date"}},"incompleteColumns":{}}}}},"filters":[],"query":{"language":"kuery","query":""},"visualization":{"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"fittingFunction":"None","gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"layers":[{"accessors":["041db33b-5c9c-47f3-a5d3-ef5e255d1663"],"layerId":"c7478794-6767-4286-9d65-1c0ecd909dd8","seriesType":"bar_stacked","xAccessor":"8289349e-6d1b-4abf-b164-0208183d2c34","layerType":"data"}],"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"preferredSeriesType":"bar_stacked","tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"valueLabels":"hide","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"}}},"visualizationType":"lnsXY","references":[{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"indexpattern-datasource-layer-c7478794-6767-4286-9d65-1c0ecd909dd8","type":"index-pattern"}]}},"title":"% of target revenue ($10k)"}]', timeFrom: 'now-7d', title: '[eCommerce] Revenue Dashboard', timeTo: 'now', 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 0b072bd1a438..3f4d7e2bc6ad 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 @@ -148,7 +148,7 @@ export const getSavedObjects = (): SavedObject[] => [ optionsJSON: '{"useMargins":true,"syncColors":false,"syncCursor":true,"syncTooltips":false,"hidePanelTitles":false}', panelsJSON: - '[{"version":"8.8.0","type":"search","gridData":{"x":0,"y":69,"w":48,"h":15,"i":"4"},"panelIndex":"4","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_4"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":16,"w":24,"h":9,"i":"7"},"panelIndex":"7","embeddableConfig":{"attributes":{"title":"[Flights] Delays & Cancellations (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce"},{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"xy-visualization-layer-10fed425-accd-411b-a773-ee825bc3945b"}],"state":{"visualization":{"legend":{"isVisible":false,"showSingleSeries":false,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0.5,"yLeftExtent":{"upperBound":1,"mode":"custom"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"area","layerType":"data","layerId":"dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce","accessors":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4a"],"yConfig":[{"forAccessor":"b9d6187b-8a7e-4c49-bffd-7a60cc075a4a","color":"rgba(0,156,224,1)","axisMode":"left"}],"xAccessor":"6944431b-f90a-4dab-a282-0961cb97edd1","palette":{"name":"default","type":"palette"}},{"layerId":"10fed425-accd-411b-a773-ee825bc3945b","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"53b7dff0-4c89-11e8-a66a-6989ad5a0a39","label":"Event","key":{"type":"point_in_time"},"timeField":"timestamp","color":"#0062B1","icon":"alert","filter":{"type":"kibana_query","query":"FlightDelay:true AND Cancelled:true","language":"lucene"},"extraFields":["FlightDelay","Cancelled","Carrier"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce":{"columns":{"6944431b-f90a-4dab-a282-0961cb97edd1":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true,"dropPartials":false}},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay:true","language":"lucene"},"params":{"emptyAsNull":false},"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"*","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1"],"location":{"min":0,"max":49},"text":"count(lucene=\'FlightDelay:true\') / count(kql=\'*\')"}},"references":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1"],"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4a":{"label":"Percent Delays","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"format":{"id":"percent"},"formula":"count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","isFormulaBroken":false},"references":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2"],"customLabel":true}},"columnOrder":["6944431b-f90a-4dab-a282-0961cb97edd1","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2","b9d6187b-8a7e-4c49-bffd-7a60cc075a4a"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delays & Cancellations"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":58,"w":24,"h":11,"i":"10"},"panelIndex":"10","embeddableConfig":{"attributes":{"title":"[Flights] Delay Buckets (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-247b176d-e81d-47dc-bbd1-4de85d098961"},{"type":"index-pattern","name":"c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"legend":{"isVisible":false,"position":"right","legendSize":"auto","shouldTruncate":true,"maxLines":1,"showSingleSeries":true},"valueLabels":"hide","curveType":"LINEAR","yTitle":"Count","yLeftExtent":{"mode":"full","enforce":true},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":-90},"gridlinesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"layerId":"247b176d-e81d-47dc-bbd1-4de85d098961","accessors":["c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da"],"layerType":"data","seriesType":"bar_stacked","xAccessor":"c7936be7-e59b-424e-a912-69ba820d8e24","simpleView":false,"palette":{"type":"palette","name":"default"},"yConfig":[{"forAccessor":"c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da","axisMode":"left","color":"#1F78C1"}],"xScaleType":"linear","isHistogram":true}]},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"negate":true,"disabled":false,"alias":null,"type":"phrase","key":"FlightDelayMin","value":"0","params":{"query":0,"type":"phrase"},"index":"c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a"},"query":{"match":{"FlightDelayMin":{"query":0,"type":"phrase"}}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"247b176d-e81d-47dc-bbd1-4de85d098961":{"columns":{"c7936be7-e59b-424e-a912-69ba820d8e24":{"label":"Flight Delay Minutes","dataType":"number","operationType":"range","sourceField":"FlightDelayMin","isBucketed":true,"scale":"interval","params":{"includeEmptyRows":false,"type":"histogram","ranges":[{"from":0,"to":1000,"label":""}],"maxBars":"auto"},"customLabel":true},"c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da":{"label":"Count","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["c7936be7-e59b-424e-a912-69ba820d8e24","c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delay Buckets"},{"version":"8.8.0","type":"map","gridData":{"x":0,"y":36,"w":24,"h":22,"i":"23"},"panelIndex":"23","embeddableConfig":{"isLayerTOCOpen":true,"hiddenLayers":[],"mapCenter":{"lat":48.72307,"lon":-115.18171,"zoom":4.28},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_23"},{"version":"8.8.0","type":"visualization","gridData":{"x":24,"y":36,"w":24,"h":22,"i":"31"},"panelIndex":"31","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_31"},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":8,"i":"6afc61f7-e2d5-45a3-9e7a-281160ad3eb9"},"panelIndex":"6afc61f7-e2d5-45a3-9e7a-281160ad3eb9","embeddableConfig":{"savedVis":{"title":"[Flights] Markdown Instructions","description":"","type":"markdown","params":{"fontSize":10,"openLinksInNewTab":true,"markdown":"## Sample Flight data\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)."},"uiState":{},"data":{"aggs":[],"searchSource":{}}},"hidePanelTitles":true,"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":0,"w":8,"h":8,"i":"392b4936-f753-47bc-a98d-a4e41a0a4cd4"},"panelIndex":"392b4936-f753-47bc-a98d-a4e41a0a4cd4","embeddableConfig":{"enhancements":{},"attributes":{"title":"[Flights] Total Flights","description":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-8fa993db-c147-4954-adf7-4ff264d42576"}],"state":{"visualization":{"layerId":"8fa993db-c147-4954-adf7-4ff264d42576","layerType":"data","metricAccessor":"81124c45-6ab6-42f4-8859-495d55eb8065"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"8fa993db-c147-4954-adf7-4ff264d42576":{"columns":{"81124c45-6ab6-42f4-8859-495d55eb8065":{"label":"Total flights","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true}},"columnOrder":["81124c45-6ab6-42f4-8859-495d55eb8065"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true}},{"version":"8.8.0","type":"lens","gridData":{"x":32,"y":0,"w":8,"h":4,"i":"9271deff-5a61-4665-83fc-f9fdc6bf0c0b"},"panelIndex":"9271deff-5a61-4665-83fc-f9fdc6bf0c0b","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"7e8fe9b1-f45c-4f3d-9561-30febcd357ec"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"7e8fe9b1-f45c-4f3d-9561-30febcd357ec":{"label":"Delayed","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'FlightDelay : true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay : true","language":"kuery"},"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"location":{"min":0,"max":41},"text":"count(kql=\'FlightDelay : true\') / count()"}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"customLabel":true}},"columnOrder":["7e8fe9b1-f45c-4f3d-9561-30febcd357ec","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":40,"y":0,"w":8,"h":4,"i":"aa591c29-1a31-4ee1-a71d-b829c06fd162"},"panelIndex":"aa591c29-1a31-4ee1-a71d-b829c06fd162","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"},{"type":"index-pattern","name":"c804c161-375f-4d52-a1cc-2e98b966957d","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"c7851241-5526-499a-960b-357af8c2ce5b"},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"alias":null,"negate":false,"disabled":false,"type":"phrase","key":"FlightDelay","params":{"query":true},"index":"c804c161-375f-4d52-a1cc-2e98b966957d"},"query":{"match_phrase":{"FlightDelay":true}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"c7851241-5526-499a-960b-357af8c2ce5b":{"label":"Delayed vs 1 week earlier","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count() / count(shift=\'1w\') - 1","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX2"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX2":{"label":"Part of Delayed","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"subtract","args":[{"type":"function","name":"divide","args":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"location":{"min":0,"max":28},"text":"count() / count(shift=\'1w\') "},1],"location":{"min":0,"max":31},"text":"count() / count(shift=\'1w\') - 1"}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX0":{"label":"Part of Delayed","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX1":{"label":"Part of Delayed","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","timeShift":"1w","customLabel":true}},"columnOrder":["c7851241-5526-499a-960b-357af8c2ce5b","c7851241-5526-499a-960b-357af8c2ce5bX2","c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":32,"y":4,"w":8,"h":4,"i":"b766e3b8-4544-46ed-99e6-9ecc4847e2a2"},"panelIndex":"b766e3b8-4544-46ed-99e6-9ecc4847e2a2","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"7e8fe9b1-f45c-4f3d-9561-30febcd357ec"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"7e8fe9b1-f45c-4f3d-9561-30febcd357ec":{"label":"Cancelled","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'Cancelled : true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0":{"label":"Part of Cancelled","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"Cancelled : true","language":"kuery"},"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1":{"label":"Part of Cancelled","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2":{"label":"Part of Cancelled","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"location":{"min":0,"max":39},"text":"count(kql=\'Cancelled : true\') / count()"}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"customLabel":true}},"columnOrder":["7e8fe9b1-f45c-4f3d-9561-30febcd357ec","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":40,"y":4,"w":8,"h":4,"i":"2e33ade5-96e5-40b4-b460-493e5d4fa834"},"panelIndex":"2e33ade5-96e5-40b4-b460-493e5d4fa834","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"},{"type":"index-pattern","name":"14cea722-a629-4c69-a06d-94a4a4c9a718","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"c7851241-5526-499a-960b-357af8c2ce5b"},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"alias":null,"negate":false,"disabled":false,"type":"phrase","key":"Cancelled","params":{"query":true},"index":"14cea722-a629-4c69-a06d-94a4a4c9a718"},"query":{"match_phrase":{"Cancelled":true}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"c7851241-5526-499a-960b-357af8c2ce5b":{"label":"Cancelled vs 1 week earlier","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count() / count(shift=\'1w\') - 1","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX2"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX2":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"subtract","args":[{"type":"function","name":"divide","args":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"location":{"min":0,"max":28},"text":"count() / count(shift=\'1w\') "},1],"location":{"min":0,"max":31},"text":"count() / count(shift=\'1w\') - 1"}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX0":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX1":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","timeShift":"1w","customLabel":true}},"columnOrder":["c7851241-5526-499a-960b-357af8c2ce5b","c7851241-5526-499a-960b-357af8c2ce5bX2","c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":8,"w":24,"h":8,"i":"086ac2e9-dd16-4b45-92b8-1e43ff7e3f65"},"panelIndex":"086ac2e9-dd16-4b45-92b8-1e43ff7e3f65","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsXY","state":{"datasourceStates":{"formBased":{"layers":{"03c34665-471c-49c7-acf1-5a11f517421c":{"columns":{"a5b94e30-4e77-4b0a-9187-1d8b13de1456":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true}},"3e267327-7317-4310-aee3-320e0f7c1e70":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["a5b94e30-4e77-4b0a-9187-1d8b13de1456","3e267327-7317-4310-aee3-320e0f7c1e70"],"incompleteColumns":{}}}}},"visualization":{"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"valueLabels":"hide","fittingFunction":"None","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"custom","lowerBound":0,"upperBound":1},"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"layerId":"03c34665-471c-49c7-acf1-5a11f517421c","accessors":["3e267327-7317-4310-aee3-320e0f7c1e70"],"position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"a5b94e30-4e77-4b0a-9187-1d8b13de1456","layerType":"data"}]},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-03c34665-471c-49c7-acf1-5a11f517421c","type":"index-pattern"}]},"hidePanelTitles":false,"enhancements":{}},"title":"[Flights] Flight count"},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":8,"w":24,"h":28,"i":"fb86b32f-fb7a-45cf-9511-f366fef51bbd"},"panelIndex":"fb86b32f-fb7a-45cf-9511-f366fef51bbd","embeddableConfig":{"attributes":{"title":"Cities by delay, cancellation","type":"lens","visualizationType":"lnsDatatable","state":{"datasourceStates":{"formBased":{"layers":{"f26e8f7a-4118-4227-bea0-5c02d8b270f7":{"columns":{"3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0":{"label":"Top values of OriginCityName","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"OriginCityName","isBucketed":true,"params":{"size":1000,"orderBy":{"type":"alphabetical","fallback":true},"orderDirection":"asc","otherBucket":true,"missingBucket":false}},"52f6f2e9-6242-4c44-be63-b799150e7e60X0":{"label":"Part of Delay %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay : true ","language":"kuery"},"customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60X1":{"label":"Part of Delay %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60X2":{"label":"Part of Delay %","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1"],"location":{"min":0,"max":42},"text":"count(kql=\'FlightDelay : true \') / count()"}},"references":["52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1"],"customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60":{"label":"Delay %","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'FlightDelay : true \') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":0}}},"references":["52f6f2e9-6242-4c44-be63-b799150e7e60X2"],"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0":{"label":"Part of Cancel %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"Cancelled: true","language":"kuery"},"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1":{"label":"Part of Cancel %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2":{"label":"Part of Cancel %","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1"],"location":{"min":0,"max":38},"text":"count(kql=\'Cancelled: true\') / count()"}},"references":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1"],"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6":{"label":"Cancel %","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'Cancelled: true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":0}}},"references":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2"],"customLabel":true}},"columnOrder":["3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0","52f6f2e9-6242-4c44-be63-b799150e7e60","52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1","52f6f2e9-6242-4c44-be63-b799150e7e60X2","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6"],"incompleteColumns":{}}}}},"visualization":{"columns":[{"isTransposed":false,"columnId":"3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0","width":262.75},{"columnId":"52f6f2e9-6242-4c44-be63-b799150e7e60","isTransposed":false,"width":302.5,"colorMode":"cell","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#f7e0b8","stop":0.6},{"color":"#e7664c","stop":1}],"name":"custom","colorStops":[{"color":"#f7e0b8","stop":0.2},{"color":"#e7664c","stop":0.6}],"rangeType":"number","rangeMin":0.2,"rangeMax":0.6}},"alignment":"center"},{"columnId":"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6","isTransposed":false,"alignment":"center","colorMode":"cell","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#f7e0b8","stop":0.6},{"color":"#e7664c","stop":0.6666666666666666}],"rangeType":"number","name":"custom","colorStops":[{"color":"#f7e0b8","stop":0.2},{"color":"#e7664c","stop":0.6}],"rangeMin":0.2,"rangeMax":0.6}}}],"layerId":"f26e8f7a-4118-4227-bea0-5c02d8b270f7","sorting":{"columnId":"52f6f2e9-6242-4c44-be63-b799150e7e60","direction":"desc"},"layerType":"data","rowHeight":"single","rowHeightLines":1},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-f26e8f7a-4118-4227-bea0-5c02d8b270f7","type":"index-pattern"}]},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Most delayed cities"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":25,"w":24,"h":11,"i":"0cc42484-16f7-42ec-b38c-9bf8be69cde7"},"panelIndex":"0cc42484-16f7-42ec-b38c-9bf8be69cde7","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsXY","state":{"datasourceStates":{"formBased":{"layers":{"e80cc05e-c52a-4e5f-ac71-4b37274867f5":{"columns":{"caf7421e-93a3-439e-ab0a-fbdead93c21c":{"label":"Top values of FlightDelayType","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"FlightDelayType","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"0233d302-ec81-4fbe-96cb-7fac84cf035c"},"orderDirection":"desc","otherBucket":true,"missingBucket":false}},"13ec79e3-9d73-4536-9056-3d92802bb30a":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true}},"0233d302-ec81-4fbe-96cb-7fac84cf035c":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["caf7421e-93a3-439e-ab0a-fbdead93c21c","13ec79e3-9d73-4536-9056-3d92802bb30a","0233d302-ec81-4fbe-96cb-7fac84cf035c"],"incompleteColumns":{}}}}},"visualization":{"legend":{"isVisible":true,"position":"bottom","legendSize":"auto"},"valueLabels":"hide","fittingFunction":"None","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"axisTitlesVisibilitySettings":{"x":true,"yLeft":false,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_percentage_stacked","layers":[{"layerId":"e80cc05e-c52a-4e5f-ac71-4b37274867f5","accessors":["0233d302-ec81-4fbe-96cb-7fac84cf035c"],"position":"top","seriesType":"bar_percentage_stacked","showGridlines":false,"palette":{"type":"palette","name":"cool"},"xAccessor":"13ec79e3-9d73-4536-9056-3d92802bb30a","splitAccessor":"caf7421e-93a3-439e-ab0a-fbdead93c21c","layerType":"data"}]},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-e80cc05e-c52a-4e5f-ac71-4b37274867f5","type":"index-pattern"}]},"hidePanelTitles":false,"enhancements":{}},"title":"[Flights] Delay Type"},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":58,"w":12,"h":11,"i":"5d53db36-2d5a-4adc-af7b-cec4c1a294e0"},"panelIndex":"5d53db36-2d5a-4adc-af7b-cec4c1a294e0","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsPie","state":{"datasourceStates":{"formBased":{"layers":{"0c8e136b-a822-4fb3-836d-e06cbea4eea4":{"columns":{"d1cee8bf-34cf-4141-99d7-ff043ee77b56":{"label":"Top values of FlightDelayType","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"FlightDelayType","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"aa152ace-ee2d-447b-b86d-459bef4d7880"},"orderDirection":"desc","otherBucket":true,"missingBucket":false}},"aa152ace-ee2d-447b-b86d-459bef4d7880":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["d1cee8bf-34cf-4141-99d7-ff043ee77b56","aa152ace-ee2d-447b-b86d-459bef4d7880"],"incompleteColumns":{}}}}},"visualization":{"shape":"pie","palette":{"type":"palette","name":"cool"},"layers":[{"layerId":"0c8e136b-a822-4fb3-836d-e06cbea4eea4","numberDisplay":"percent","categoryDisplay":"default","legendDisplay":"default","nestedLegend":false,"layerType":"data","legendSize":"auto","primaryGroups":["d1cee8bf-34cf-4141-99d7-ff043ee77b56"],"metrics":["aa152ace-ee2d-447b-b86d-459bef4d7880"]}]},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"type":"phrase","key":"FlightDelayType","params":{"query":"No Delay"},"disabled":false,"negate":true,"alias":null,"index":"filter-index-pattern-0"},"query":{"match_phrase":{"FlightDelayType":"No Delay"}},"$state":{"store":"appState"}}]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-0c8e136b-a822-4fb3-836d-e06cbea4eea4","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"filter-index-pattern-0","type":"index-pattern"}]},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delay Type"},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":58,"w":12,"h":11,"i":"ecd89a7c-9124-4472-bdc6-9bdbd70d45d5"},"panelIndex":"ecd89a7c-9124-4472-bdc6-9bdbd70d45d5","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-dffd86e7-01a9-4990-b974-3706608b5532"}],"state":{"visualization":{"title":"Empty XY chart","legend":{"isVisible":true,"position":"right"},"valueLabels":"hide","preferredSeriesType":"bar_horizontal","layers":[{"layerId":"dffd86e7-01a9-4990-b974-3706608b5532","accessors":["9d212159-afac-41f5-9303-5fb62ff04ba3"],"position":"top","seriesType":"bar_horizontal","showGridlines":false,"layerType":"data","splitAccessor":"d99ad4d7-26ff-4d65-a8ce-34656fdafa0a","palette":{"type":"palette","name":"temperature"}}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"dffd86e7-01a9-4990-b974-3706608b5532":{"columns":{"9d212159-afac-41f5-9303-5fb62ff04ba3":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true}},"d99ad4d7-26ff-4d65-a8ce-34656fdafa0a":{"label":"Top 10 values of DestWeather","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"DestWeather","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"9d212159-afac-41f5-9303-5fb62ff04ba3"},"orderDirection":"desc","otherBucket":true,"missingBucket":false,"parentFormat":{"id":"terms"},"include":[],"exclude":[],"includeIsRegex":false,"excludeIsRegex":false}}},"columnOrder":["d99ad4d7-26ff-4d65-a8ce-34656fdafa0a","9d212159-afac-41f5-9303-5fb62ff04ba3"],"sampling":1,"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}}]', + '[{"version":"8.8.0","type":"search","gridData":{"x":0,"y":69,"w":48,"h":15,"i":"4"},"panelIndex":"4","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_4"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":16,"w":24,"h":9,"i":"7"},"panelIndex":"7","embeddableConfig":{"attributes":{"title":"[Flights] Delays & Cancellations (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce"},{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"xy-visualization-layer-10fed425-accd-411b-a773-ee825bc3945b"}],"state":{"visualization":{"legend":{"isVisible":false,"showSingleSeries":false,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0.5,"yLeftExtent":{"upperBound":1,"mode":"custom"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"area","layerType":"data","layerId":"dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce","accessors":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4a"],"yConfig":[{"forAccessor":"b9d6187b-8a7e-4c49-bffd-7a60cc075a4a","axisMode":"left"}],"xAccessor":"6944431b-f90a-4dab-a282-0961cb97edd1","palette":{"name":"default","type":"palette"}},{"layerId":"10fed425-accd-411b-a773-ee825bc3945b","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"53b7dff0-4c89-11e8-a66a-6989ad5a0a39","label":"Event","key":{"type":"point_in_time"},"timeField":"timestamp","color":"#0062B1","icon":"alert","filter":{"type":"kibana_query","query":"FlightDelay:true AND Cancelled:true","language":"lucene"},"extraFields":["FlightDelay","Cancelled","Carrier"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"dc8cf715-b56b-4dd7-a624-7c3ef9e2f2ce":{"columns":{"6944431b-f90a-4dab-a282-0961cb97edd1":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true,"dropPartials":false}},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay:true","language":"lucene"},"params":{"emptyAsNull":false},"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"*","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2":{"label":"Part of count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1"],"location":{"min":0,"max":49},"text":"count(lucene=\'FlightDelay:true\') / count(kql=\'*\')"}},"references":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1"],"customLabel":true},"b9d6187b-8a7e-4c49-bffd-7a60cc075a4a":{"label":"Percent Delays","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"format":{"id":"percent"},"formula":"count(lucene=\'FlightDelay:true\') / count(kql=\'*\')","isFormulaBroken":false},"references":["b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2"],"customLabel":true}},"columnOrder":["6944431b-f90a-4dab-a282-0961cb97edd1","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX0","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX1","b9d6187b-8a7e-4c49-bffd-7a60cc075a4aX2","b9d6187b-8a7e-4c49-bffd-7a60cc075a4a"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delays & Cancellations"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":58,"w":24,"h":11,"i":"10"},"panelIndex":"10","embeddableConfig":{"attributes":{"title":"[Flights] Delay Buckets (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-247b176d-e81d-47dc-bbd1-4de85d098961"},{"type":"index-pattern","name":"c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"legend":{"isVisible":false,"position":"right","legendSize":"auto","shouldTruncate":true,"maxLines":1,"showSingleSeries":true},"valueLabels":"hide","curveType":"LINEAR","yTitle":"Count","yLeftExtent":{"mode":"full","enforce":true},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":-90},"gridlinesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"layerId":"247b176d-e81d-47dc-bbd1-4de85d098961","accessors":["c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da"],"layerType":"data","seriesType":"bar_stacked","xAccessor":"c7936be7-e59b-424e-a912-69ba820d8e24","simpleView":false,"palette":{"type":"palette","name":"default"},"yConfig":[{"forAccessor":"c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da","axisMode":"left","color":"#1F78C1"}],"xScaleType":"linear","isHistogram":true}]},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"negate":true,"disabled":false,"alias":null,"type":"phrase","key":"FlightDelayMin","value":"0","params":{"query":0,"type":"phrase"},"index":"c61f29fc-1ff3-4d46-a6c2-bde8a5b97f4a"},"query":{"match":{"FlightDelayMin":{"query":0,"type":"phrase"}}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"247b176d-e81d-47dc-bbd1-4de85d098961":{"columns":{"c7936be7-e59b-424e-a912-69ba820d8e24":{"label":"Flight Delay Minutes","dataType":"number","operationType":"range","sourceField":"FlightDelayMin","isBucketed":true,"scale":"interval","params":{"includeEmptyRows":false,"type":"histogram","ranges":[{"from":0,"to":1000,"label":""}],"maxBars":"auto"},"customLabel":true},"c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da":{"label":"Count","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["c7936be7-e59b-424e-a912-69ba820d8e24","c84f9fa9-e2a1-4845-8fcf-f5a34f5f92da"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delay Buckets"},{"version":"8.8.0","type":"map","gridData":{"x":0,"y":36,"w":24,"h":22,"i":"23"},"panelIndex":"23","embeddableConfig":{"isLayerTOCOpen":true,"hiddenLayers":[],"mapCenter":{"lat":48.72307,"lon":-115.18171,"zoom":4.28},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_23"},{"version":"8.8.0","type":"visualization","gridData":{"x":24,"y":36,"w":24,"h":22,"i":"31"},"panelIndex":"31","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_31"},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":8,"i":"6afc61f7-e2d5-45a3-9e7a-281160ad3eb9"},"panelIndex":"6afc61f7-e2d5-45a3-9e7a-281160ad3eb9","embeddableConfig":{"savedVis":{"title":"[Flights] Markdown Instructions","description":"","type":"markdown","params":{"fontSize":10,"openLinksInNewTab":true,"markdown":"## Sample Flight data\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)."},"uiState":{},"data":{"aggs":[],"searchSource":{}}},"hidePanelTitles":true,"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":0,"w":8,"h":8,"i":"392b4936-f753-47bc-a98d-a4e41a0a4cd4"},"panelIndex":"392b4936-f753-47bc-a98d-a4e41a0a4cd4","embeddableConfig":{"enhancements":{},"attributes":{"title":"[Flights] Total Flights","description":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-8fa993db-c147-4954-adf7-4ff264d42576"}],"state":{"visualization":{"layerId":"8fa993db-c147-4954-adf7-4ff264d42576","layerType":"data","metricAccessor":"81124c45-6ab6-42f4-8859-495d55eb8065"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"8fa993db-c147-4954-adf7-4ff264d42576":{"columns":{"81124c45-6ab6-42f4-8859-495d55eb8065":{"label":"Total flights","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true}},"columnOrder":["81124c45-6ab6-42f4-8859-495d55eb8065"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true}},{"version":"8.8.0","type":"lens","gridData":{"x":32,"y":0,"w":8,"h":4,"i":"9271deff-5a61-4665-83fc-f9fdc6bf0c0b"},"panelIndex":"9271deff-5a61-4665-83fc-f9fdc6bf0c0b","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"7e8fe9b1-f45c-4f3d-9561-30febcd357ec"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"7e8fe9b1-f45c-4f3d-9561-30febcd357ec":{"label":"Delayed","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'FlightDelay : true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay : true","language":"kuery"},"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2":{"label":"Part of count(kql=\'FlightDelay : true\') / count()","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"location":{"min":0,"max":41},"text":"count(kql=\'FlightDelay : true\') / count()"}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"customLabel":true}},"columnOrder":["7e8fe9b1-f45c-4f3d-9561-30febcd357ec","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":40,"y":0,"w":8,"h":4,"i":"aa591c29-1a31-4ee1-a71d-b829c06fd162"},"panelIndex":"aa591c29-1a31-4ee1-a71d-b829c06fd162","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"},{"type":"index-pattern","name":"c804c161-375f-4d52-a1cc-2e98b966957d","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"c7851241-5526-499a-960b-357af8c2ce5b"},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"alias":null,"negate":false,"disabled":false,"type":"phrase","key":"FlightDelay","params":{"query":true},"index":"c804c161-375f-4d52-a1cc-2e98b966957d"},"query":{"match_phrase":{"FlightDelay":true}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"c7851241-5526-499a-960b-357af8c2ce5b":{"label":"Delayed vs 1 week earlier","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count() / count(shift=\'1w\') - 1","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX2"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX2":{"label":"Part of Delayed","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"subtract","args":[{"type":"function","name":"divide","args":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"location":{"min":0,"max":28},"text":"count() / count(shift=\'1w\') "},1],"location":{"min":0,"max":31},"text":"count() / count(shift=\'1w\') - 1"}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX0":{"label":"Part of Delayed","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX1":{"label":"Part of Delayed","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","timeShift":"1w","customLabel":true}},"columnOrder":["c7851241-5526-499a-960b-357af8c2ce5b","c7851241-5526-499a-960b-357af8c2ce5bX2","c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":32,"y":4,"w":8,"h":4,"i":"b766e3b8-4544-46ed-99e6-9ecc4847e2a2"},"panelIndex":"b766e3b8-4544-46ed-99e6-9ecc4847e2a2","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"7e8fe9b1-f45c-4f3d-9561-30febcd357ec"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"7e8fe9b1-f45c-4f3d-9561-30febcd357ec":{"label":"Cancelled","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'Cancelled : true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0":{"label":"Part of Cancelled","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"Cancelled : true","language":"kuery"},"customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1":{"label":"Part of Cancelled","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2":{"label":"Part of Cancelled","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"location":{"min":0,"max":39},"text":"count(kql=\'Cancelled : true\') / count()"}},"references":["7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1"],"customLabel":true}},"columnOrder":["7e8fe9b1-f45c-4f3d-9561-30febcd357ec","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX0","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX1","7e8fe9b1-f45c-4f3d-9561-30febcd357ecX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":40,"y":4,"w":8,"h":4,"i":"2e33ade5-96e5-40b4-b460-493e5d4fa834"},"panelIndex":"2e33ade5-96e5-40b4-b460-493e5d4fa834","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-b4712d43-1e84-4f5b-878d-8e38ba748317"},{"type":"index-pattern","name":"14cea722-a629-4c69-a06d-94a4a4c9a718","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d"}],"state":{"visualization":{"layerId":"b4712d43-1e84-4f5b-878d-8e38ba748317","layerType":"data","metricAccessor":"c7851241-5526-499a-960b-357af8c2ce5b"},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"alias":null,"negate":false,"disabled":false,"type":"phrase","key":"Cancelled","params":{"query":true},"index":"14cea722-a629-4c69-a06d-94a4a4c9a718"},"query":{"match_phrase":{"Cancelled":true}},"$state":{"store":"appState"}}],"datasourceStates":{"formBased":{"layers":{"b4712d43-1e84-4f5b-878d-8e38ba748317":{"columns":{"c7851241-5526-499a-960b-357af8c2ce5b":{"label":"Cancelled vs 1 week earlier","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count() / count(shift=\'1w\') - 1","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX2"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX2":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"subtract","args":[{"type":"function","name":"divide","args":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"location":{"min":0,"max":28},"text":"count() / count(shift=\'1w\') "},1],"location":{"min":0,"max":31},"text":"count() / count(shift=\'1w\') - 1"}},"references":["c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX0":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"c7851241-5526-499a-960b-357af8c2ce5bX1":{"label":"Part of Delayed vs 1 week earlier","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","timeShift":"1w","customLabel":true}},"columnOrder":["c7851241-5526-499a-960b-357af8c2ce5b","c7851241-5526-499a-960b-357af8c2ce5bX2","c7851241-5526-499a-960b-357af8c2ce5bX0","c7851241-5526-499a-960b-357af8c2ce5bX1"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":8,"w":24,"h":8,"i":"086ac2e9-dd16-4b45-92b8-1e43ff7e3f65"},"panelIndex":"086ac2e9-dd16-4b45-92b8-1e43ff7e3f65","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsXY","state":{"datasourceStates":{"formBased":{"layers":{"03c34665-471c-49c7-acf1-5a11f517421c":{"columns":{"a5b94e30-4e77-4b0a-9187-1d8b13de1456":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true}},"3e267327-7317-4310-aee3-320e0f7c1e70":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["a5b94e30-4e77-4b0a-9187-1d8b13de1456","3e267327-7317-4310-aee3-320e0f7c1e70"],"incompleteColumns":{}}}}},"visualization":{"legend":{"isVisible":true,"position":"right","legendSize":"auto"},"valueLabels":"hide","fittingFunction":"None","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"custom","lowerBound":0,"upperBound":1},"axisTitlesVisibilitySettings":{"x":false,"yLeft":false,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"layerId":"03c34665-471c-49c7-acf1-5a11f517421c","accessors":["3e267327-7317-4310-aee3-320e0f7c1e70"],"position":"top","seriesType":"bar_stacked","showGridlines":false,"xAccessor":"a5b94e30-4e77-4b0a-9187-1d8b13de1456","layerType":"data"}]},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-03c34665-471c-49c7-acf1-5a11f517421c","type":"index-pattern"}]},"hidePanelTitles":false,"enhancements":{}},"title":"[Flights] Flight count"},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":8,"w":24,"h":28,"i":"fb86b32f-fb7a-45cf-9511-f366fef51bbd"},"panelIndex":"fb86b32f-fb7a-45cf-9511-f366fef51bbd","embeddableConfig":{"attributes":{"title":"Cities by delay, cancellation","type":"lens","visualizationType":"lnsDatatable","state":{"datasourceStates":{"formBased":{"layers":{"f26e8f7a-4118-4227-bea0-5c02d8b270f7":{"columns":{"3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0":{"label":"Top values of OriginCityName","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"OriginCityName","isBucketed":true,"params":{"size":1000,"orderBy":{"type":"alphabetical","fallback":true},"orderDirection":"asc","otherBucket":true,"missingBucket":false}},"52f6f2e9-6242-4c44-be63-b799150e7e60X0":{"label":"Part of Delay %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"FlightDelay : true ","language":"kuery"},"customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60X1":{"label":"Part of Delay %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60X2":{"label":"Part of Delay %","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1"],"location":{"min":0,"max":42},"text":"count(kql=\'FlightDelay : true \') / count()"}},"references":["52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1"],"customLabel":true},"52f6f2e9-6242-4c44-be63-b799150e7e60":{"label":"Delay %","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'FlightDelay : true \') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":0}}},"references":["52f6f2e9-6242-4c44-be63-b799150e7e60X2"],"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0":{"label":"Part of Cancel %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"Cancelled: true","language":"kuery"},"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1":{"label":"Part of Cancel %","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2":{"label":"Part of Cancel %","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1"],"location":{"min":0,"max":38},"text":"count(kql=\'Cancelled: true\') / count()"}},"references":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1"],"customLabel":true},"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6":{"label":"Cancel %","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'Cancelled: true\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":0}}},"references":["7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2"],"customLabel":true}},"columnOrder":["3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0","52f6f2e9-6242-4c44-be63-b799150e7e60","52f6f2e9-6242-4c44-be63-b799150e7e60X0","52f6f2e9-6242-4c44-be63-b799150e7e60X1","52f6f2e9-6242-4c44-be63-b799150e7e60X2","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X0","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X1","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6X2","7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6"],"incompleteColumns":{}}}}},"visualization":{"columns":[{"isTransposed":false,"columnId":"3dd24cb4-45ef-4dd8-b22a-d7b802cb6da0","width":262.75},{"columnId":"52f6f2e9-6242-4c44-be63-b799150e7e60","isTransposed":false,"width":302.5,"colorMode":"cell","palette":{"type":"palette","name":"negative","params":{"steps":5,"stops":[{"color":"#fcdedc","stop":0},{"color":"#fec3bd","stop":0.2},{"color":"#fea79e","stop":0.4},{"color":"#fb8b81","stop":0.6},{"color":"#f66d64","stop":0.8}],"name":"negative","rangeType":"number","rangeMin":0,"rangeMax":null,"continuity":"above","reverse":false}},"alignment":"center"},{"columnId":"7b9f3ece-9da3-4c27-b582-d3f8e8cc31d6","isTransposed":false,"alignment":"center","colorMode":"cell","palette":{"type":"palette","name":"negative","params":{"steps":5,"stops":[{"color":"#fcdedc","stop":0},{"color":"#fec3bd","stop":0.2},{"color":"#fea79e","stop":0.4},{"color":"#fb8b81","stop":0.6},{"color":"#f66d64","stop":0.8}],"name":"negative","rangeType":"number","rangeMin":0,"rangeMax":null,"continuity":"above","reverse":false}}}],"layerId":"f26e8f7a-4118-4227-bea0-5c02d8b270f7","sorting":{"columnId":"52f6f2e9-6242-4c44-be63-b799150e7e60","direction":"desc"},"layerType":"data","rowHeight":"single","rowHeightLines":1},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-f26e8f7a-4118-4227-bea0-5c02d8b270f7","type":"index-pattern"}]},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Most delayed cities"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":25,"w":24,"h":11,"i":"0cc42484-16f7-42ec-b38c-9bf8be69cde7"},"panelIndex":"0cc42484-16f7-42ec-b38c-9bf8be69cde7","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsXY","state":{"datasourceStates":{"formBased":{"layers":{"e80cc05e-c52a-4e5f-ac71-4b37274867f5":{"columns":{"caf7421e-93a3-439e-ab0a-fbdead93c21c":{"label":"Top values of FlightDelayType","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"FlightDelayType","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"0233d302-ec81-4fbe-96cb-7fac84cf035c"},"orderDirection":"desc","otherBucket":true,"missingBucket":false}},"13ec79e3-9d73-4536-9056-3d92802bb30a":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true}},"0233d302-ec81-4fbe-96cb-7fac84cf035c":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["caf7421e-93a3-439e-ab0a-fbdead93c21c","13ec79e3-9d73-4536-9056-3d92802bb30a","0233d302-ec81-4fbe-96cb-7fac84cf035c"],"incompleteColumns":{}}}}},"visualization":{"legend":{"isVisible":true,"position":"bottom","legendSize":"auto"},"valueLabels":"hide","fittingFunction":"None","yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"axisTitlesVisibilitySettings":{"x":true,"yLeft":false,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_percentage_stacked","layers":[{"layerId":"e80cc05e-c52a-4e5f-ac71-4b37274867f5","accessors":["0233d302-ec81-4fbe-96cb-7fac84cf035c"],"position":"top","seriesType":"bar_percentage_stacked","showGridlines":false,"palette":{"type":"palette","name":"cool"},"xAccessor":"13ec79e3-9d73-4536-9056-3d92802bb30a","splitAccessor":"caf7421e-93a3-439e-ab0a-fbdead93c21c","layerType":"data"}]},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-e80cc05e-c52a-4e5f-ac71-4b37274867f5","type":"index-pattern"}]},"hidePanelTitles":false,"enhancements":{}},"title":"[Flights] Delay Type"},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":58,"w":12,"h":11,"i":"5d53db36-2d5a-4adc-af7b-cec4c1a294e0"},"panelIndex":"5d53db36-2d5a-4adc-af7b-cec4c1a294e0","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsPie","state":{"datasourceStates":{"formBased":{"layers":{"0c8e136b-a822-4fb3-836d-e06cbea4eea4":{"columns":{"d1cee8bf-34cf-4141-99d7-ff043ee77b56":{"label":"Top values of FlightDelayType","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"FlightDelayType","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"aa152ace-ee2d-447b-b86d-459bef4d7880"},"orderDirection":"desc","otherBucket":true,"missingBucket":false}},"aa152ace-ee2d-447b-b86d-459bef4d7880":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___"}},"columnOrder":["d1cee8bf-34cf-4141-99d7-ff043ee77b56","aa152ace-ee2d-447b-b86d-459bef4d7880"],"incompleteColumns":{}}}}},"visualization":{"shape":"pie","palette":{"type":"palette","name":"cool"},"layers":[{"layerId":"0c8e136b-a822-4fb3-836d-e06cbea4eea4","numberDisplay":"percent","categoryDisplay":"default","legendDisplay":"default","nestedLegend":false,"layerType":"data","legendSize":"auto","primaryGroups":["d1cee8bf-34cf-4141-99d7-ff043ee77b56"],"metrics":["aa152ace-ee2d-447b-b86d-459bef4d7880"]}]},"query":{"query":"","language":"kuery"},"filters":[{"meta":{"type":"phrase","key":"FlightDelayType","params":{"query":"No Delay"},"disabled":false,"negate":true,"alias":null,"index":"filter-index-pattern-0"},"query":{"match_phrase":{"FlightDelayType":"No Delay"}},"$state":{"store":"appState"}}]},"references":[{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-0c8e136b-a822-4fb3-836d-e06cbea4eea4","type":"index-pattern"},{"id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"filter-index-pattern-0","type":"index-pattern"}]},"enhancements":{},"hidePanelTitles":false},"title":"[Flights] Delay Type"},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":58,"w":12,"h":11,"i":"ecd89a7c-9124-4472-bdc6-9bdbd70d45d5"},"panelIndex":"ecd89a7c-9124-4472-bdc6-9bdbd70d45d5","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"d3d7af60-4c81-11e8-b3d7-01146121b73d","name":"indexpattern-datasource-layer-dffd86e7-01a9-4990-b974-3706608b5532"}],"state":{"visualization":{"title":"Empty XY chart","legend":{"isVisible":true,"position":"right"},"valueLabels":"hide","preferredSeriesType":"bar_horizontal","layers":[{"layerId":"dffd86e7-01a9-4990-b974-3706608b5532","accessors":["9d212159-afac-41f5-9303-5fb62ff04ba3"],"position":"top","seriesType":"bar_horizontal","showGridlines":false,"layerType":"data","splitAccessor":"d99ad4d7-26ff-4d65-a8ce-34656fdafa0a","palette":{"type":"palette","name":"temperature"}}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"dffd86e7-01a9-4990-b974-3706608b5532":{"columns":{"9d212159-afac-41f5-9303-5fb62ff04ba3":{"label":"Count of records","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true}},"d99ad4d7-26ff-4d65-a8ce-34656fdafa0a":{"label":"Top 10 values of DestWeather","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"DestWeather","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"9d212159-afac-41f5-9303-5fb62ff04ba3"},"orderDirection":"desc","otherBucket":true,"missingBucket":false,"parentFormat":{"id":"terms"},"include":[],"exclude":[],"includeIsRegex":false,"excludeIsRegex":false}}},"columnOrder":["d99ad4d7-26ff-4d65-a8ce-34656fdafa0a","9d212159-afac-41f5-9303-5fb62ff04ba3"],"sampling":1,"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}}]', timeFrom: 'now-7d', title: '[Flights] Global Flight Dashboard', timeTo: 'now', 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 a73979c88cb2..19d59c35523f 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 @@ -313,7 +313,7 @@ export const getSavedObjects = (): SavedObject[] => [ optionsJSON: '{"useMargins":true,"syncColors":false,"syncCursor":true,"syncTooltips":false,"hidePanelTitles":false}', panelsJSON: - '[{"version":"8.8.0","type":"map","gridData":{"x":0,"y":14,"w":24,"h":18,"i":"4"},"panelIndex":"4","embeddableConfig":{"isLayerTOCOpen":false,"hiddenLayers":[],"mapCenter":{"lat":42.16337,"lon":-88.92107,"zoom":3.64},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_4"},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":0,"w":12,"h":7,"i":"11"},"panelIndex":"11","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-28b89898-3feb-415a-8dd9-74d755ac7c2a"}],"state":{"visualization":{"layerId":"28b89898-3feb-415a-8dd9-74d755ac7c2a","layerType":"data","metricAccessor":"f92c482e-1eee-4c2a-9338-64fb3eec286a","palette":{"name":"custom","type":"palette","params":{"steps":3,"name":"custom","reverse":false,"rangeType":"number","rangeMin":0,"rangeMax":null,"progression":"fixed","stops":[{"color":"#D23115","stop":500},{"color":"#FCC400","stop":1000},{"color":"#68BC00","stop":1658}],"colorStops":[{"color":"#D23115","stop":0},{"color":"#FCC400","stop":500},{"color":"#68BC00","stop":1000}],"continuity":"above","maxSteps":5}}},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"28b89898-3feb-415a-8dd9-74d755ac7c2a":{"columns":{"f92c482e-1eee-4c2a-9338-64fb3eec286a":{"label":"Unique Visitors","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["f92c482e-1eee-4c2a-9338-64fb3eec286a"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true,"enhancements":{}}},{"version":"8.8.0","type":"visualization","gridData":{"x":24,"y":14,"w":24,"h":33,"i":"14"},"panelIndex":"14","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_14"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":7,"w":24,"h":7,"i":"15"},"panelIndex":"15","embeddableConfig":{"attributes":{"title":"[Logs] Response Codes Over Time + Annotations (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-b38fe501-4b47-4de8-a423-6656d1162174"},{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"xy-visualization-layer-f265e722-ae38-495c-903c-48aa7931fa82"}],"state":{"visualization":{"legend":{"isVisible":true,"showSingleSeries":true,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0.5,"yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"area_percentage_stacked","layerType":"data","layerId":"b38fe501-4b47-4de8-a423-6656d1162174","accessors":["896c5eb2-81c5-44f1-a4a1-57344161ea62"],"yConfig":[{"forAccessor":"896c5eb2-81c5-44f1-a4a1-57344161ea62","color":"rgba(115,216,255,1)","axisMode":"left"}],"xAccessor":"8986e393-d24f-49b0-96ca-118fd66d75e5","splitAccessor":"43f5bb0f-c6da-43a0-8a0a-50e9838ed34b","palette":{"name":"default","type":"palette"}},{"layerId":"f265e722-ae38-495c-903c-48aa7931fa82","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"bd7548a0-2223-11e8-832f-d5027f3c8a47","label":"Event","key":{"type":"point_in_time"},"color":"#D33115","timeField":"timestamp","icon":"asterisk","filter":{"type":"kibana_query","query":"tags:error AND tags:security","language":"lucene"},"extraFields":["geo.src"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b38fe501-4b47-4de8-a423-6656d1162174":{"columns":{"8986e393-d24f-49b0-96ca-118fd66d75e5":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true,"dropPartials":false}},"43f5bb0f-c6da-43a0-8a0a-50e9838ed34b":{"label":"Filters","dataType":"string","operationType":"filters","scale":"ordinal","isBucketed":true,"params":{"filters":[{"input":{"query":"response.keyword >= 200 and response.keyword < 400","language":"kuery"},"label":"HTTP 2xx and 3xx"},{"input":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"label":"HTTP 4xx"},{"input":{"query":"response.keyword >= 500","language":"kuery"},"label":"HTTP 5xx"}]}},"896c5eb2-81c5-44f1-a4a1-57344161ea62":{"label":"Response Code Count","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["8986e393-d24f-49b0-96ca-118fd66d75e5","43f5bb0f-c6da-43a0-8a0a-50e9838ed34b","896c5eb2-81c5-44f1-a4a1-57344161ea62"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Logs] Response Codes Over Time + Annotations"},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":7,"i":"343f0bef-0b19-452e-b1c8-59beb18b6f0c"},"panelIndex":"343f0bef-0b19-452e-b1c8-59beb18b6f0c","embeddableConfig":{"savedVis":{"title":"[Logs] Markdown Instructions","description":"","type":"markdown","params":{"fontSize":12,"openLinksInNewTab":true,"markdown":"## Sample Logs Data\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)."},"uiState":{},"data":{"aggs":[],"searchSource":{"query":{"query":"","language":"kuery"},"filter":[]}}},"enhancements":{},"hidePanelTitles":true}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":0,"w":12,"h":7,"i":"bb94016e-f4a6-49ca-87a9-296a2869d570"},"panelIndex":"bb94016e-f4a6-49ca-87a9-296a2869d570","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-483defd2-775b-4a62-bdef-496c819bb8ed"}],"state":{"visualization":{"layerId":"483defd2-775b-4a62-bdef-496c819bb8ed","layerType":"data","metricAccessor":"37430d12-7452-4cc9-b035-5cfd4061edf0"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"483defd2-775b-4a62-bdef-496c819bb8ed":{"columns":{"37430d12-7452-4cc9-b035-5cfd4061edf0":{"label":"Visits","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true}},"columnOrder":["37430d12-7452-4cc9-b035-5cfd4061edf0"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":7,"w":12,"h":7,"i":"8c1456d4-1993-4ba2-b701-04aca02c9fef"},"panelIndex":"8c1456d4-1993-4ba2-b701-04aca02c9fef","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a"}],"state":{"visualization":{"layerId":"f3793bb7-3971-4753-866d-4008e77a9f9a","layerType":"data","metricAccessor":"71c076a6-e782-4866-b8df-5fd85a41f08b"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"f3793bb7-3971-4753-866d-4008e77a9f9a":{"columns":{"71c076a6-e782-4866-b8df-5fd85a41f08bX0":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 500","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX1":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX2":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"location":{"min":0,"max":46},"text":"count(kql=\'response.keyword >= 500\') / count()"}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08b":{"label":"HTTP 5xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"customLabel":true}},"columnOrder":["71c076a6-e782-4866-b8df-5fd85a41f08b","71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1","71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":7,"w":12,"h":7,"i":"01d8e435-91c0-484f-a11e-856747050b0a"},"panelIndex":"01d8e435-91c0-484f-a11e-856747050b0a","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a"}],"state":{"visualization":{"layerId":"f3793bb7-3971-4753-866d-4008e77a9f9a","layerType":"data","metricAccessor":"71c076a6-e782-4866-b8df-5fd85a41f08b"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"f3793bb7-3971-4753-866d-4008e77a9f9a":{"columns":{"71c076a6-e782-4866-b8df-5fd85a41f08bX0":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX1":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX2":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"location":{"min":0,"max":73},"text":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()"}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08b":{"label":"HTTP 4xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"customLabel":true}},"columnOrder":["71c076a6-e782-4866-b8df-5fd85a41f08b","71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1","71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":32,"w":24,"h":15,"i":"8e59c7cf-6e42-4343-a113-c4a255fcf2ce"},"panelIndex":"8e59c7cf-6e42-4343-a113-c4a255fcf2ce","embeddableConfig":{"savedVis":{"title":"","description":"","type":"vega","params":{"spec":"{\\n $schema: https://vega.github.io/schema/vega-lite/v5.json\\n data: {\\n url: {\\n %context%: true\\n %timefield%: @timestamp\\n index: kibana_sample_data_logs\\n body: {\\n aggs: {\\n countries: {\\n terms: {\\n field: geo.src\\n size: 25\\n }\\n aggs: {\\n hours: {\\n histogram: {\\n field: hour_of_day\\n interval: 1\\n }\\n aggs: {\\n unique: {\\n cardinality: {\\n field: clientip\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n size: 0\\n }\\n }\\n format: {property: \\"aggregations.countries.buckets\\"}\\n }\\n \\n transform: [\\n {\\n flatten: [\\"hours.buckets\\"],\\n as: [\\"buckets\\"]\\n }\\n ]\\n\\n mark: {\\n type: rect\\n tooltip: true\\n }\\n\\n encoding: {\\n x: {\\n field: buckets.key\\n type: ordinal\\n axis: {\\n title: false\\n labelAngle: 0\\n }\\n }\\n y: {\\n field: key\\n type: nominal\\n sort: {\\n field: -buckets.unique.value\\n }\\n axis: {title: false}\\n }\\n color: {\\n field: buckets.unique.value\\n type: quantitative\\n axis: {title: false}\\n scale: {\\n scheme: reds\\n }\\n }\\n }\\n}\\n"},"uiState":{},"data":{"aggs":[],"searchSource":{"query":{"query":"","language":"kuery"},"filter":[]}}},"enhancements":{}},"panelRefName":"panel_8e59c7cf-6e42-4343-a113-c4a255fcf2ce"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":47,"w":24,"h":13,"i":"21bb0939-ee09-4021-8848-6552b3a6a788"},"panelIndex":"21bb0939-ee09-4021-8848-6552b3a6a788","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsDatatable","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-c840e93e-2949-4723-ad35-6bdb2d724404"}],"state":{"visualization":{"columns":[{"columnId":"4e64d6d7-4f92-4d5e-abbb-13796604db30","isTransposed":false},{"columnId":"fb9a848d-76f3-4005-a067-4259a50b5621","isTransposed":false},{"columnId":"a2760bc2-9a6e-46a1-8595-86f61573c7cf","isTransposed":false},{"columnId":"2c8bd8d5-35ff-4386-8d27-3ba882b13e43","isTransposed":false,"colorMode":"text","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#d23115","stop":1000},{"color":"#fcc400","stop":1500},{"color":"#68bc00","stop":1501}],"rangeType":"number","rangeMin":0,"rangeMax":null,"continuity":"above","colorStops":[{"color":"#d23115","stop":0},{"color":"#fcc400","stop":1000},{"color":"#68bc00","stop":1500}],"name":"custom"}}},{"columnId":"defa6f97-b874-4556-8438-056fb437787b","isTransposed":false,"colorMode":"text","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#D23115","stop":10},{"color":"#FCC400","stop":25},{"color":"#68bc00","stop":26}],"rangeType":"number","rangeMin":0,"rangeMax":null,"continuity":"above","colorStops":[{"color":"#D23115","stop":0},{"color":"#FCC400","stop":10},{"color":"#68bc00","stop":25}],"name":"custom"}}}],"layerId":"c840e93e-2949-4723-ad35-6bdb2d724404","layerType":"data"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"c840e93e-2949-4723-ad35-6bdb2d724404":{"columns":{"4e64d6d7-4f92-4d5e-abbb-13796604db30":{"label":"Type","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"extension.keyword","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"fb9a848d-76f3-4005-a067-4259a50b5621"},"orderDirection":"desc","otherBucket":true,"missingBucket":false,"parentFormat":{"id":"terms"},"include":[],"exclude":[],"includeIsRegex":false,"excludeIsRegex":false},"customLabel":true},"fb9a848d-76f3-4005-a067-4259a50b5621":{"label":"Bytes (Total)","dataType":"number","operationType":"sum","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"customLabel":true},"a2760bc2-9a6e-46a1-8595-86f61573c7cf":{"label":"Bytes (Last Hour)","dataType":"number","operationType":"sum","sourceField":"bytes","isBucketed":false,"scale":"ratio","reducedTimeRange":"1h","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"customLabel":true},"2c8bd8d5-35ff-4386-8d27-3ba882b13e43":{"label":"Unique Visits (Total)","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"params":{"emptyAsNull":true},"customLabel":true},"defa6f97-b874-4556-8438-056fb437787b":{"label":"Unique count of clientip","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"reducedTimeRange":"1h","params":{"emptyAsNull":true}}},"columnOrder":["4e64d6d7-4f92-4d5e-abbb-13796604db30","fb9a848d-76f3-4005-a067-4259a50b5621","a2760bc2-9a6e-46a1-8595-86f61573c7cf","2c8bd8d5-35ff-4386-8d27-3ba882b13e43","defa6f97-b874-4556-8438-056fb437787b"],"sampling":1,"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":47,"w":24,"h":13,"i":"cbca842c-b9fa-4523-9ce0-14e350866e33"},"panelIndex":"cbca842c-b9fa-4523-9ce0-14e350866e33","embeddableConfig":{"hidePanelTitles":false,"enhancements":{}},"title":"[Logs] Bytes distribution","panelRefName":"panel_cbca842c-b9fa-4523-9ce0-14e350866e33"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":60,"w":48,"h":19,"i":"1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b"},"panelIndex":"1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsDatatable","state":{"datasourceStates":{"formBased":{"layers":{"c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0":{"columns":{"42783ad7-dbcf-4310-bc06-f21f4eaaac96":{"label":"URL","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"url.keyword","isBucketed":true,"params":{"size":1000,"orderBy":{"type":"column","columnId":"f7835375-4d5b-4839-95ea-41928192a319"},"orderDirection":"desc","otherBucket":true,"missingBucket":false},"customLabel":true},"f7835375-4d5b-4839-95ea-41928192a319":{"label":"Visits","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX0":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX1":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX2":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1"],"location":{"min":0,"max":73},"text":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()"}},"references":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1"],"customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1da":{"label":"HTTP 4xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX2"],"customLabel":true},"791d5a5b-a7ba-4e9e-b533-51b33c7d7747":{"label":"Unique","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"customLabel":true},"611e3509-e834-4fdd-b573-44e959e95d27":{"label":"95th percentile of bytes","dataType":"number","operationType":"percentile","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"percentile":95,"format":{"id":"bytes","params":{"decimals":0}}}},"9f79ecca-123f-4098-a658-6b0e998da003":{"label":"Median of bytes","dataType":"number","operationType":"median","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"format":{"id":"bytes","params":{"decimals":0}}}},"491285fd-0196-402c-9b7f-4660fdc1c22aX0":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 500","language":"kuery"},"customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22aX1":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22aX2":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1"],"location":{"min":0,"max":46},"text":"count(kql=\'response.keyword >= 500\') / count()"}},"references":["491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1"],"customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22a":{"label":"HTTP 5xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["491285fd-0196-402c-9b7f-4660fdc1c22aX2"],"customLabel":true}},"columnOrder":["42783ad7-dbcf-4310-bc06-f21f4eaaac96","f7835375-4d5b-4839-95ea-41928192a319","791d5a5b-a7ba-4e9e-b533-51b33c7d7747","07fc84ca-4147-4ba9-879e-d1b4e086e1da","491285fd-0196-402c-9b7f-4660fdc1c22a","491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1","491285fd-0196-402c-9b7f-4660fdc1c22aX2","07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1","07fc84ca-4147-4ba9-879e-d1b4e086e1daX2","611e3509-e834-4fdd-b573-44e959e95d27","9f79ecca-123f-4098-a658-6b0e998da003"],"incompleteColumns":{}}}}},"visualization":{"layerId":"c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0","columns":[{"columnId":"42783ad7-dbcf-4310-bc06-f21f4eaaac96","width":650.6666666666666},{"columnId":"f7835375-4d5b-4839-95ea-41928192a319"},{"columnId":"491285fd-0196-402c-9b7f-4660fdc1c22a","isTransposed":false,"width":81.66666666666669,"colorMode":"cell","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#fbddd6","stop":0.1},{"color":"#CC5642","stop":1}],"rangeType":"number","name":"custom","colorStops":[{"color":"#fbddd6","stop":0.05},{"color":"#CC5642","stop":0.1}],"rangeMin":0.05,"rangeMax":0.1}}},{"columnId":"07fc84ca-4147-4ba9-879e-d1b4e086e1da","isTransposed":false,"colorMode":"cell","palette":{"name":"custom","type":"palette","params":{"steps":5,"stops":[{"color":"#fbddd6","stop":0.1},{"color":"#cc5642","stop":1.1}],"name":"custom","colorStops":[{"color":"#fbddd6","stop":0.05},{"color":"#cc5642","stop":0.1}],"rangeType":"number","rangeMin":0.05,"rangeMax":0.1}}},{"columnId":"791d5a5b-a7ba-4e9e-b533-51b33c7d7747","isTransposed":false},{"columnId":"611e3509-e834-4fdd-b573-44e959e95d27","isTransposed":false},{"columnId":"9f79ecca-123f-4098-a658-6b0e998da003","isTransposed":false}],"sorting":{"columnId":"491285fd-0196-402c-9b7f-4660fdc1c22a","direction":"desc"},"layerType":"data","rowHeight":"single","rowHeightLines":1},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0","type":"index-pattern"}]},"enhancements":{"dynamicActions":{"events":[]}},"hidePanelTitles":false},"title":"[Logs] Errors by host"}]', + '[{"version":"8.8.0","type":"map","gridData":{"x":0,"y":14,"w":24,"h":18,"i":"4"},"panelIndex":"4","embeddableConfig":{"isLayerTOCOpen":false,"hiddenLayers":[],"mapCenter":{"lat":42.16337,"lon":-88.92107,"zoom":3.64},"openTOCDetails":[],"enhancements":{}},"panelRefName":"panel_4"},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":0,"w":12,"h":7,"i":"11"},"panelIndex":"11","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-28b89898-3feb-415a-8dd9-74d755ac7c2a"}],"state":{"visualization":{"layerId":"28b89898-3feb-415a-8dd9-74d755ac7c2a","layerType":"data","metricAccessor":"f92c482e-1eee-4c2a-9338-64fb3eec286a","palette":{"type":"palette","name":"status","params":{"steps":3,"rangeType":"number","rangeMin":0,"rangeMax":null,"progression":"fixed","stops":[{"color":"#23be8f","stop":0},{"color":"#fcd279","stop":608.66},{"color":"#f66d64","stop":1217.33}],"continuity":"above","maxSteps":5}}},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"28b89898-3feb-415a-8dd9-74d755ac7c2a":{"columns":{"f92c482e-1eee-4c2a-9338-64fb3eec286a":{"label":"Unique Visitors","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["f92c482e-1eee-4c2a-9338-64fb3eec286a"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"hidePanelTitles":true,"enhancements":{}}},{"version":"8.8.0","type":"visualization","gridData":{"x":24,"y":14,"w":24,"h":33,"i":"14"},"panelIndex":"14","embeddableConfig":{"enhancements":{}},"panelRefName":"panel_14"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":7,"w":24,"h":7,"i":"15"},"panelIndex":"15","embeddableConfig":{"attributes":{"title":"[Logs] Response Codes Over Time + Annotations (converted)","visualizationType":"lnsXY","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-b38fe501-4b47-4de8-a423-6656d1162174"},{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"xy-visualization-layer-f265e722-ae38-495c-903c-48aa7931fa82"}],"state":{"visualization":{"legend":{"isVisible":true,"showSingleSeries":true,"position":"bottom","shouldTruncate":true,"maxLines":1},"valueLabels":"hide","fittingFunction":"None","fillOpacity":0.5,"yLeftExtent":{"mode":"full"},"yRightExtent":{"mode":"full"},"yLeftScale":"linear","yRightScale":"linear","axisTitlesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"tickLabelsVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"labelsOrientation":{"x":0,"yLeft":0,"yRight":0},"gridlinesVisibilitySettings":{"x":true,"yLeft":true,"yRight":true},"preferredSeriesType":"bar_stacked","layers":[{"seriesType":"area_percentage_stacked","layerType":"data","layerId":"b38fe501-4b47-4de8-a423-6656d1162174","accessors":["896c5eb2-81c5-44f1-a4a1-57344161ea62"],"yConfig":[{"forAccessor":"896c5eb2-81c5-44f1-a4a1-57344161ea62","color":"rgba(115,216,255,1)","axisMode":"left"}],"xAccessor":"8986e393-d24f-49b0-96ca-118fd66d75e5","splitAccessor":"43f5bb0f-c6da-43a0-8a0a-50e9838ed34b","palette":{"name":"default","type":"palette"}},{"layerId":"f265e722-ae38-495c-903c-48aa7931fa82","layerType":"annotations","ignoreGlobalFilters":true,"annotations":[{"type":"query","id":"bd7548a0-2223-11e8-832f-d5027f3c8a47","label":"Event","key":{"type":"point_in_time"},"color":"#D33115","timeField":"timestamp","icon":"asterisk","filter":{"type":"kibana_query","query":"tags:error AND tags:security","language":"lucene"},"extraFields":["geo.src"]}]}]},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"b38fe501-4b47-4de8-a423-6656d1162174":{"columns":{"8986e393-d24f-49b0-96ca-118fd66d75e5":{"label":"timestamp","dataType":"date","operationType":"date_histogram","sourceField":"timestamp","isBucketed":true,"scale":"interval","params":{"interval":"auto","includeEmptyRows":true,"dropPartials":false}},"43f5bb0f-c6da-43a0-8a0a-50e9838ed34b":{"label":"Filters","dataType":"string","operationType":"filters","scale":"ordinal","isBucketed":true,"params":{"filters":[{"input":{"query":"response.keyword >= 200 and response.keyword < 400","language":"kuery"},"label":"HTTP 2xx and 3xx"},{"input":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"label":"HTTP 4xx"},{"input":{"query":"response.keyword >= 500","language":"kuery"},"label":"HTTP 5xx"}]}},"896c5eb2-81c5-44f1-a4a1-57344161ea62":{"label":"Response Code Count","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":true},"customLabel":true}},"columnOrder":["8986e393-d24f-49b0-96ca-118fd66d75e5","43f5bb0f-c6da-43a0-8a0a-50e9838ed34b","896c5eb2-81c5-44f1-a4a1-57344161ea62"],"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{},"hidePanelTitles":false},"title":"[Logs] Response Codes Over Time + Annotations"},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":0,"w":24,"h":7,"i":"343f0bef-0b19-452e-b1c8-59beb18b6f0c"},"panelIndex":"343f0bef-0b19-452e-b1c8-59beb18b6f0c","embeddableConfig":{"savedVis":{"title":"[Logs] Markdown Instructions","description":"","type":"markdown","params":{"fontSize":12,"openLinksInNewTab":true,"markdown":"## Sample Logs Data\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about Kibana, check our [docs](https://www.elastic.co/guide/en/kibana/current/index.html)."},"uiState":{},"data":{"aggs":[],"searchSource":{"query":{"query":"","language":"kuery"},"filter":[]}}},"enhancements":{},"hidePanelTitles":true}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":0,"w":12,"h":7,"i":"bb94016e-f4a6-49ca-87a9-296a2869d570"},"panelIndex":"bb94016e-f4a6-49ca-87a9-296a2869d570","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-483defd2-775b-4a62-bdef-496c819bb8ed"}],"state":{"visualization":{"layerId":"483defd2-775b-4a62-bdef-496c819bb8ed","layerType":"data","metricAccessor":"37430d12-7452-4cc9-b035-5cfd4061edf0"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"483defd2-775b-4a62-bdef-496c819bb8ed":{"columns":{"37430d12-7452-4cc9-b035-5cfd4061edf0":{"label":"Visits","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true}},"columnOrder":["37430d12-7452-4cc9-b035-5cfd4061edf0"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":36,"y":7,"w":12,"h":7,"i":"8c1456d4-1993-4ba2-b701-04aca02c9fef"},"panelIndex":"8c1456d4-1993-4ba2-b701-04aca02c9fef","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a"}],"state":{"visualization":{"layerId":"f3793bb7-3971-4753-866d-4008e77a9f9a","layerType":"data","metricAccessor":"71c076a6-e782-4866-b8df-5fd85a41f08b"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"f3793bb7-3971-4753-866d-4008e77a9f9a":{"columns":{"71c076a6-e782-4866-b8df-5fd85a41f08bX0":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 500","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX1":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX2":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"location":{"min":0,"max":46},"text":"count(kql=\'response.keyword >= 500\') / count()"}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08b":{"label":"HTTP 5xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"customLabel":true}},"columnOrder":["71c076a6-e782-4866-b8df-5fd85a41f08b","71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1","71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":7,"w":12,"h":7,"i":"01d8e435-91c0-484f-a11e-856747050b0a"},"panelIndex":"01d8e435-91c0-484f-a11e-856747050b0a","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsMetric","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-f3793bb7-3971-4753-866d-4008e77a9f9a"}],"state":{"visualization":{"layerId":"f3793bb7-3971-4753-866d-4008e77a9f9a","layerType":"data","metricAccessor":"71c076a6-e782-4866-b8df-5fd85a41f08b"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"f3793bb7-3971-4753-866d-4008e77a9f9a":{"columns":{"71c076a6-e782-4866-b8df-5fd85a41f08bX0":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX1":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","params":{"emptyAsNull":false},"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08bX2":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"location":{"min":0,"max":73},"text":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()"}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1"],"customLabel":true},"71c076a6-e782-4866-b8df-5fd85a41f08b":{"label":"HTTP 4xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"customLabel":true}},"columnOrder":["71c076a6-e782-4866-b8df-5fd85a41f08b","71c076a6-e782-4866-b8df-5fd85a41f08bX0","71c076a6-e782-4866-b8df-5fd85a41f08bX1","71c076a6-e782-4866-b8df-5fd85a41f08bX2"],"incompleteColumns":{}}}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"visualization","gridData":{"x":0,"y":32,"w":24,"h":15,"i":"8e59c7cf-6e42-4343-a113-c4a255fcf2ce"},"panelIndex":"8e59c7cf-6e42-4343-a113-c4a255fcf2ce","embeddableConfig":{"savedVis":{"title":"","description":"","type":"vega","params":{"spec":"{\\n $schema: https://vega.github.io/schema/vega-lite/v5.json\\n data: {\\n url: {\\n %context%: true\\n %timefield%: @timestamp\\n index: kibana_sample_data_logs\\n body: {\\n aggs: {\\n countries: {\\n terms: {\\n field: geo.src\\n size: 25\\n }\\n aggs: {\\n hours: {\\n histogram: {\\n field: hour_of_day\\n interval: 1\\n }\\n aggs: {\\n unique: {\\n cardinality: {\\n field: clientip\\n }\\n }\\n }\\n }\\n }\\n }\\n }\\n size: 0\\n }\\n }\\n format: {property: \\"aggregations.countries.buckets\\"}\\n }\\n \\n transform: [\\n {\\n flatten: [\\"hours.buckets\\"],\\n as: [\\"buckets\\"]\\n }\\n ]\\n\\n mark: {\\n type: rect\\n tooltip: true\\n }\\n\\n encoding: {\\n x: {\\n field: buckets.key\\n type: ordinal\\n axis: {\\n title: false\\n labelAngle: 0\\n }\\n }\\n y: {\\n field: key\\n type: nominal\\n sort: {\\n field: -buckets.unique.value\\n }\\n axis: {title: false}\\n }\\n color: {\\n field: buckets.unique.value\\n type: quantitative\\n axis: {title: false}\\n scale: {\\n scheme: reds\\n }\\n }\\n }\\n}\\n"},"uiState":{},"data":{"aggs":[],"searchSource":{"query":{"query":"","language":"kuery"},"filter":[]}}},"enhancements":{}},"panelRefName":"panel_8e59c7cf-6e42-4343-a113-c4a255fcf2ce"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":47,"w":24,"h":13,"i":"21bb0939-ee09-4021-8848-6552b3a6a788"},"panelIndex":"21bb0939-ee09-4021-8848-6552b3a6a788","embeddableConfig":{"attributes":{"title":"","visualizationType":"lnsDatatable","type":"lens","references":[{"type":"index-pattern","id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-c840e93e-2949-4723-ad35-6bdb2d724404"}],"state":{"visualization":{"columns":[{"columnId":"4e64d6d7-4f92-4d5e-abbb-13796604db30","isTransposed":false},{"columnId":"fb9a848d-76f3-4005-a067-4259a50b5621","isTransposed":false},{"columnId":"a2760bc2-9a6e-46a1-8595-86f61573c7cf","isTransposed":false},{"columnId":"2c8bd8d5-35ff-4386-8d27-3ba882b13e43","isTransposed":false,"colorMode":"text","palette":{"type":"palette","name":"status","params":{"steps":5,"stops":[{"color":"#23be8f","stop":20},{"color":"#9dedce","stop":40},{"color":"#fcd279","stop":60},{"color":"#ffc0b8","stop":80},{"color":"#f66d64","stop":100}],"rangeType":"percent","rangeMin":20,"rangeMax":null,"continuity":"above","reverse":false}}},{"columnId":"defa6f97-b874-4556-8438-056fb437787b","isTransposed":false,"colorMode":"text","palette":{"type":"palette","name":"status","params":{"steps":5,"stops":[{"color":"#23be8f","stop":20},{"color":"#9dedce","stop":40},{"color":"#fcd279","stop":60},{"color":"#ffc0b8","stop":80},{"color":"#f66d64","stop":100}],"rangeType":"percent","rangeMin":20,"rangeMax":null,"continuity":"above","reverse":false}}}],"layerId":"c840e93e-2949-4723-ad35-6bdb2d724404","layerType":"data"},"query":{"query":"","language":"kuery"},"filters":[],"datasourceStates":{"formBased":{"layers":{"c840e93e-2949-4723-ad35-6bdb2d724404":{"columns":{"4e64d6d7-4f92-4d5e-abbb-13796604db30":{"label":"Type","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"extension.keyword","isBucketed":true,"params":{"size":10,"orderBy":{"type":"column","columnId":"fb9a848d-76f3-4005-a067-4259a50b5621"},"orderDirection":"desc","otherBucket":true,"missingBucket":false,"parentFormat":{"id":"terms"},"include":[],"exclude":[],"includeIsRegex":false,"excludeIsRegex":false},"customLabel":true},"fb9a848d-76f3-4005-a067-4259a50b5621":{"label":"Bytes (Total)","dataType":"number","operationType":"sum","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"customLabel":true},"a2760bc2-9a6e-46a1-8595-86f61573c7cf":{"label":"Bytes (Last Hour)","dataType":"number","operationType":"sum","sourceField":"bytes","isBucketed":false,"scale":"ratio","reducedTimeRange":"1h","params":{"emptyAsNull":true,"format":{"id":"bytes","params":{"decimals":2}}},"customLabel":true},"2c8bd8d5-35ff-4386-8d27-3ba882b13e43":{"label":"Unique Visits (Total)","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"params":{"emptyAsNull":true},"customLabel":true},"defa6f97-b874-4556-8438-056fb437787b":{"label":"Unique count of clientip","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"reducedTimeRange":"1h","params":{"emptyAsNull":true}}},"columnOrder":["4e64d6d7-4f92-4d5e-abbb-13796604db30","fb9a848d-76f3-4005-a067-4259a50b5621","a2760bc2-9a6e-46a1-8595-86f61573c7cf","2c8bd8d5-35ff-4386-8d27-3ba882b13e43","defa6f97-b874-4556-8438-056fb437787b"],"sampling":1,"incompleteColumns":{}}}},"textBased":{"layers":{}}},"internalReferences":[],"adHocDataViews":{}}},"enhancements":{}}},{"version":"8.8.0","type":"lens","gridData":{"x":24,"y":47,"w":24,"h":13,"i":"cbca842c-b9fa-4523-9ce0-14e350866e33"},"panelIndex":"cbca842c-b9fa-4523-9ce0-14e350866e33","embeddableConfig":{"hidePanelTitles":false,"enhancements":{}},"title":"[Logs] Bytes distribution","panelRefName":"panel_cbca842c-b9fa-4523-9ce0-14e350866e33"},{"version":"8.8.0","type":"lens","gridData":{"x":0,"y":60,"w":48,"h":19,"i":"1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b"},"panelIndex":"1d5f0b3f-d9d2-4b26-997b-83bc5ca3090b","embeddableConfig":{"attributes":{"title":"","type":"lens","visualizationType":"lnsDatatable","state":{"datasourceStates":{"formBased":{"layers":{"c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0":{"columns":{"42783ad7-dbcf-4310-bc06-f21f4eaaac96":{"label":"URL","dataType":"string","operationType":"terms","scale":"ordinal","sourceField":"url.keyword","isBucketed":true,"params":{"size":1000,"orderBy":{"type":"column","columnId":"f7835375-4d5b-4839-95ea-41928192a319"},"orderDirection":"desc","otherBucket":true,"missingBucket":false},"customLabel":true},"f7835375-4d5b-4839-95ea-41928192a319":{"label":"Visits","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX0":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 400 and response.keyword < 500","language":"kuery"},"customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX1":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1daX2":{"label":"Part of HTTP 4xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1"],"location":{"min":0,"max":73},"text":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()"}},"references":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1"],"customLabel":true},"07fc84ca-4147-4ba9-879e-d1b4e086e1da":{"label":"HTTP 4xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 400 and response.keyword < 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["07fc84ca-4147-4ba9-879e-d1b4e086e1daX2"],"customLabel":true},"791d5a5b-a7ba-4e9e-b533-51b33c7d7747":{"label":"Unique","dataType":"number","operationType":"unique_count","scale":"ratio","sourceField":"clientip","isBucketed":false,"customLabel":true},"611e3509-e834-4fdd-b573-44e959e95d27":{"label":"95th percentile of bytes","dataType":"number","operationType":"percentile","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"percentile":95,"format":{"id":"bytes","params":{"decimals":0}}}},"9f79ecca-123f-4098-a658-6b0e998da003":{"label":"Median of bytes","dataType":"number","operationType":"median","sourceField":"bytes","isBucketed":false,"scale":"ratio","params":{"format":{"id":"bytes","params":{"decimals":0}}}},"491285fd-0196-402c-9b7f-4660fdc1c22aX0":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","filter":{"query":"response.keyword >= 500","language":"kuery"},"customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22aX1":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"count","isBucketed":false,"scale":"ratio","sourceField":"___records___","customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22aX2":{"label":"Part of HTTP 5xx","dataType":"number","operationType":"math","isBucketed":false,"scale":"ratio","params":{"tinymathAst":{"type":"function","name":"divide","args":["491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1"],"location":{"min":0,"max":46},"text":"count(kql=\'response.keyword >= 500\') / count()"}},"references":["491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1"],"customLabel":true},"491285fd-0196-402c-9b7f-4660fdc1c22a":{"label":"HTTP 5xx","dataType":"number","operationType":"formula","isBucketed":false,"scale":"ratio","params":{"formula":"count(kql=\'response.keyword >= 500\') / count()","isFormulaBroken":false,"format":{"id":"percent","params":{"decimals":1}}},"references":["491285fd-0196-402c-9b7f-4660fdc1c22aX2"],"customLabel":true}},"columnOrder":["42783ad7-dbcf-4310-bc06-f21f4eaaac96","f7835375-4d5b-4839-95ea-41928192a319","791d5a5b-a7ba-4e9e-b533-51b33c7d7747","07fc84ca-4147-4ba9-879e-d1b4e086e1da","491285fd-0196-402c-9b7f-4660fdc1c22a","491285fd-0196-402c-9b7f-4660fdc1c22aX0","491285fd-0196-402c-9b7f-4660fdc1c22aX1","491285fd-0196-402c-9b7f-4660fdc1c22aX2","07fc84ca-4147-4ba9-879e-d1b4e086e1daX0","07fc84ca-4147-4ba9-879e-d1b4e086e1daX1","07fc84ca-4147-4ba9-879e-d1b4e086e1daX2","611e3509-e834-4fdd-b573-44e959e95d27","9f79ecca-123f-4098-a658-6b0e998da003"],"incompleteColumns":{}}}}},"visualization":{"layerId":"c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0","columns":[{"columnId":"42783ad7-dbcf-4310-bc06-f21f4eaaac96","width":650.6666666666666},{"columnId":"f7835375-4d5b-4839-95ea-41928192a319"},{"columnId":"491285fd-0196-402c-9b7f-4660fdc1c22a","isTransposed":false,"width":81.66666666666669,"colorMode":"cell","palette":{"type":"palette","name":"negative","params":{"steps":5,"stops":[{"color":"#fcdedc","stop":20},{"color":"#fec3bd","stop":40},{"color":"#fea79e","stop":60},{"color":"#fb8b81","stop":80},{"color":"#f66d64","stop":100}],"rangeType":"percent","rangeMin":20,"rangeMax":null,"continuity":"above","reverse":false}}},{"columnId":"07fc84ca-4147-4ba9-879e-d1b4e086e1da","isTransposed":false,"colorMode":"cell","palette":{"type":"palette","name":"negative","params":{"steps":5,"stops":[{"color":"#fcdedc","stop":20},{"color":"#fec3bd","stop":40},{"color":"#fea79e","stop":60},{"color":"#fb8b81","stop":80},{"color":"#f66d64","stop":100}],"rangeType":"percent","rangeMin":20,"rangeMax":null,"continuity":"above","reverse":false}}},{"columnId":"791d5a5b-a7ba-4e9e-b533-51b33c7d7747","isTransposed":false},{"columnId":"611e3509-e834-4fdd-b573-44e959e95d27","isTransposed":false},{"columnId":"9f79ecca-123f-4098-a658-6b0e998da003","isTransposed":false}],"sorting":{"columnId":"491285fd-0196-402c-9b7f-4660fdc1c22a","direction":"desc"},"layerType":"data","rowHeight":"single","rowHeightLines":1},"query":{"query":"","language":"kuery"},"filters":[]},"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-current-indexpattern","type":"index-pattern"},{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"indexpattern-datasource-layer-c35dc8ee-50d1-4ef7-8b4b-9c21a7e7d3b0","type":"index-pattern"}]},"enhancements":{"dynamicActions":{"events":[]}},"hidePanelTitles":false},"title":"[Logs] Errors by host"}]', timeFrom: 'now-7d/d', title: '[Logs] Web Traffic', timeTo: 'now', diff --git a/src/plugins/image_embeddable/public/components/image_editor/open_image_editor.tsx b/src/plugins/image_embeddable/public/components/image_editor/open_image_editor.tsx index f730147cb0d2..9454dab4b923 100644 --- a/src/plugins/image_embeddable/public/components/image_editor/open_image_editor.tsx +++ b/src/plugins/image_embeddable/public/components/image_editor/open_image_editor.tsx @@ -28,7 +28,7 @@ export const openImageEditor = async ({ }): Promise<ImageConfig> => { const { ImageEditorFlyout } = await import('./image_editor_flyout'); - const { overlays, theme, i18n, http, security } = coreServices; + const { overlays, http, security, ...startServices } = coreServices; const user = await security.authc.getCurrentUser(); const filesClient = filesService.filesClientFactory.asUnscoped<FileImageMetadata>(); @@ -73,7 +73,7 @@ export const openImageEditor = async ({ /> </ImageViewerContext.Provider> </FilesContext>, - { theme, i18n } + startServices ), { onClose: () => { diff --git a/src/plugins/kibana_overview/public/components/_overview.scss b/src/plugins/kibana_overview/public/components/_overview.scss index 85eebd7da295..10b4b5a099da 100644 --- a/src/plugins/kibana_overview/public/components/_overview.scss +++ b/src/plugins/kibana_overview/public/components/_overview.scss @@ -48,7 +48,7 @@ } &.securitySolution { .euiCard__image { - background-color: $euiColorSuccess; + background-color: $euiColorAccentSecondary; } } } diff --git a/src/plugins/links/public/editor/open_editor_flyout.tsx b/src/plugins/links/public/editor/open_editor_flyout.tsx index 87b1ab4e21ff..32e9cc92be84 100644 --- a/src/plugins/links/public/editor/open_editor_flyout.tsx +++ b/src/plugins/links/public/editor/open_editor_flyout.tsx @@ -133,7 +133,7 @@ export async function openEditorFlyout({ parentDashboardId={parentDashboardId} isByReference={Boolean(initialState?.savedObjectId)} />, - { theme: coreServices.theme, i18n: coreServices.i18n } + coreServices ), { id: flyoutId, diff --git a/src/plugins/links/public/embeddable/links_embeddable.tsx b/src/plugins/links/public/embeddable/links_embeddable.tsx index 685f0a6c46a3..a1bff3702c6c 100644 --- a/src/plugins/links/public/embeddable/links_embeddable.tsx +++ b/src/plugins/links/public/embeddable/links_embeddable.tsx @@ -121,7 +121,7 @@ export const getLinksEmbeddableFactory = () => { delete snapshot.savedObjectId; return snapshot; }, - serializeState: async (): Promise<SerializedPanelState<LinksSerializedState>> => { + serializeState: (): SerializedPanelState<LinksSerializedState> => { if (savedObjectId$.value !== undefined) { const linksByReferenceState: LinksByReferenceSerializedState = { savedObjectId: savedObjectId$.value, diff --git a/src/plugins/navigation/common/constants.ts b/src/plugins/navigation/common/constants.ts index 0a054aff5dc2..0d527e3b4905 100644 --- a/src/plugins/navigation/common/constants.ts +++ b/src/plugins/navigation/common/constants.ts @@ -11,7 +11,7 @@ export const DEFAULT_ROUTE_UI_SETTING_ID = 'defaultRoute'; export const DEFAULT_ROUTES = { classic: '/app/home', - es: '/app/enterprise_search/overview', + es: '/app/elasticsearch/overview', oblt: '/app/observabilityOnboarding', security: '/app/security/get_started', }; diff --git a/src/plugins/navigation/public/side_navigation/index.tsx b/src/plugins/navigation/public/side_navigation/index.tsx index c6659ef1af6f..5d476b09d1da 100644 --- a/src/plugins/navigation/public/side_navigation/index.tsx +++ b/src/plugins/navigation/public/side_navigation/index.tsx @@ -8,34 +8,34 @@ */ import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import React, { Suspense, type FC } from 'react'; -import { EuiSkeletonRectangle } from '@elastic/eui'; +import { EuiSkeletonRectangle, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { Props as NavigationProps } from './side_navigation'; const SideNavComponentLazy = React.lazy(() => import('./side_navigation')); -export const SideNavComponent: FC<NavigationProps> = (props) => ( - <Suspense - fallback={ - <EuiSkeletonRectangle - css={css` - margin: ${euiThemeVars.euiSize}; - `} - width={16} - height={16} - borderRadius="s" - contentAriaLabel={i18n.translate( - 'navigation.sideNavigation.loadingSolutionNavigationLabel', - { - defaultMessage: 'Loading solution navigation', - } - )} - /> - } - > - <SideNavComponentLazy {...props} /> - </Suspense> -); +export const SideNavComponent: FC<NavigationProps> = (props) => { + const { euiTheme } = useEuiTheme(); + return ( + <Suspense + fallback={ + <EuiSkeletonRectangle + css={css` + margin: ${euiTheme.size.base}; + `} + width={16} + height={16} + borderRadius="s" + contentAriaLabel={i18n.translate( + 'navigation.sideNavigation.loadingSolutionNavigationLabel', + { defaultMessage: 'Loading solution navigation' } + )} + /> + } + > + <SideNavComponentLazy {...props} /> + </Suspense> + ); +}; diff --git a/src/plugins/navigation/tsconfig.json b/src/plugins/navigation/tsconfig.json index 00b5186670cf..1ee046233095 100644 --- a/src/plugins/navigation/tsconfig.json +++ b/src/plugins/navigation/tsconfig.json @@ -27,7 +27,6 @@ "@kbn/config-schema", "@kbn/i18n", "@kbn/std", - "@kbn/ui-theme", ], "exclude": [ "target/**/*", diff --git a/src/plugins/presentation_panel/public/panel_actions/customize_panel_action/open_customize_panel.tsx b/src/plugins/presentation_panel/public/panel_actions/customize_panel_action/open_customize_panel.tsx index 8fa2fd0658e5..b33a1f6014ea 100644 --- a/src/plugins/presentation_panel/public/panel_actions/customize_panel_action/open_customize_panel.tsx +++ b/src/plugins/presentation_panel/public/panel_actions/customize_panel_action/open_customize_panel.tsx @@ -42,7 +42,7 @@ export const openCustomizePanelFlyout = ({ }} /> </KibanaReactContextProvider>, - { theme: core.theme, i18n: core.i18n } + core ), { size: 's', diff --git a/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_header.tsx b/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_header.tsx index 0747e4a4f822..74b88cd369cf 100644 --- a/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_header.tsx +++ b/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_header.tsx @@ -10,7 +10,7 @@ import { EuiScreenReaderOnly } from '@elastic/eui'; import { ViewMode } from '@kbn/presentation-publishing'; import classNames from 'classnames'; -import React from 'react'; +import React, { useCallback } from 'react'; import { getAriaLabelForTitle } from '../presentation_panel_strings'; import { DefaultPresentationPanelApi, PresentationPanelInternalProps } from '../types'; import { PresentationPanelTitle } from './presentation_panel_title'; @@ -23,6 +23,7 @@ export type PresentationPanelHeaderProps<ApiType extends DefaultPresentationPane hideTitle?: boolean; panelTitle?: string; panelDescription?: string; + setDragHandle: (id: string, ref: HTMLDivElement | null) => void; } & Pick<PresentationPanelInternalProps, 'showBadges' | 'getActions' | 'showNotifications'>; export const PresentationPanelHeader = < @@ -35,6 +36,7 @@ export const PresentationPanelHeader = < hideTitle, panelTitle, panelDescription, + setDragHandle, showBadges = true, showNotifications = true, }: PresentationPanelHeaderProps<ApiType>) => { @@ -45,6 +47,14 @@ export const PresentationPanelHeader = < getActions ); + const memoizedSetDragHandle = useCallback( + // memoize the ref callback so that we don't call `setDragHandle` on every render + (ref: HTMLHeadingElement | null) => { + setDragHandle('panelHeader', ref); + }, + [setDragHandle] + ); + const showPanelBar = (!hideTitle && panelTitle) || badgeElements.length > 0 || notificationElements.length > 0; @@ -71,7 +81,7 @@ export const PresentationPanelHeader = < className={headerClasses} data-test-subj={`embeddablePanelHeading-${(panelTitle || '').replace(/\s/g, '')}`} > - <h2 data-test-subj="dashboardPanelTitle" className={titleClasses}> + <h2 ref={memoizedSetDragHandle} data-test-subj="dashboardPanelTitle" className={titleClasses}> {ariaLabelElement} <PresentationPanelTitle api={api} diff --git a/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_hover_actions.tsx b/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_hover_actions.tsx index 7954a7f7dfc6..f164af574c33 100644 --- a/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_hover_actions.tsx +++ b/src/plugins/presentation_panel/public/panel_component/panel_header/presentation_panel_hover_actions.tsx @@ -101,6 +101,7 @@ export const PresentationPanelHoverActions = ({ api, index, getActions, + setDragHandle, actionPredicate, children, className, @@ -111,6 +112,7 @@ export const PresentationPanelHoverActions = ({ index?: number; api: DefaultPresentationPanelApi | null; getActions: PresentationPanelInternalProps['getActions']; + setDragHandle: (id: string, ref: HTMLElement | null) => void; actionPredicate?: (actionId: string) => boolean; children: ReactElement; className?: string; @@ -124,9 +126,10 @@ export const PresentationPanelHoverActions = ({ const [isContextMenuOpen, setIsContextMenuOpen] = useState<boolean>(false); const [notifications, setNotifications] = useState<AnyApiAction[]>([]); const hoverActionsRef = useRef<HTMLDivElement | null>(null); + const dragHandleRef = useRef<HTMLButtonElement | null>(null); const anchorRef = useRef<HTMLDivElement | null>(null); - const leftHoverActionsRef = useRef<HTMLDivElement | null>(null); const rightHoverActionsRef = useRef<HTMLDivElement | null>(null); + const [combineHoverActions, setCombineHoverActions] = useState<boolean>(false); const [borderStyles, setBorderStyles] = useState<string>(TOP_ROUNDED_CORNERS); @@ -138,14 +141,14 @@ export const PresentationPanelHoverActions = ({ const anchorWidth = anchorRef.current.offsetWidth; const hoverActionsWidth = (rightHoverActionsRef.current?.offsetWidth ?? 0) + - (leftHoverActionsRef.current?.offsetWidth ?? 0) + + (dragHandleRef.current?.offsetWidth ?? 0) + parseInt(euiThemeVars.euiSize, 10) * 2; const hoverActionsHeight = rightHoverActionsRef.current?.offsetHeight ?? 0; // Left align hover actions when they would get cut off by the right edge of the window if (anchorLeft - (hoverActionsWidth - anchorWidth) <= parseInt(euiThemeVars.euiSize, 10)) { - hoverActionsRef.current.style.removeProperty('right'); - hoverActionsRef.current.style.setProperty('left', '0'); + dragHandleRef.current?.style.removeProperty('right'); + dragHandleRef.current?.style.setProperty('left', '0'); } else { hoverActionsRef.current.style.removeProperty('left'); hoverActionsRef.current.style.setProperty('right', '0'); @@ -442,19 +445,30 @@ export const PresentationPanelHoverActions = ({ /> ); - const dragHandle = ( - <EuiIcon - type="move" - color="text" - className={`${viewMode === 'edit' ? 'embPanel--dragHandle' : ''}`} - aria-label={i18n.translate('presentationPanel.dragHandle', { - defaultMessage: 'Move panel', - })} - data-test-subj="embeddablePanelDragHandle" - css={css` - margin: ${euiThemeVars.euiSizeXS}; - `} - /> + const dragHandle = useMemo( + // memoize the drag handle to avoid calling `setDragHandle` unnecessarily + () => ( + <button + ref={(ref) => { + dragHandleRef.current = ref; + setDragHandle('hoverActions', ref); + }} + > + <EuiIcon + type="move" + color="text" + className={`embPanel--dragHandle`} + aria-label={i18n.translate('presentationPanel.dragHandle', { + defaultMessage: 'Move panel', + })} + data-test-subj="embeddablePanelDragHandle" + css={css` + margin: ${euiThemeVars.euiSizeXS}; + `} + /> + </button> + ), + [setDragHandle] ); const hasHoverActions = quickActionElements.length || contextMenuPanels.lastIndexOf.length; @@ -535,7 +549,6 @@ export const PresentationPanelHoverActions = ({ > {viewMode === 'edit' && !combineHoverActions ? ( <div - ref={leftHoverActionsRef} data-test-subj="embPanel__hoverActions__left" className={classNames( 'embPanel__hoverActions', diff --git a/src/plugins/presentation_panel/public/panel_component/presentation_panel_internal.tsx b/src/plugins/presentation_panel/public/panel_component/presentation_panel_internal.tsx index d8c85350f380..c2a2e82406dd 100644 --- a/src/plugins/presentation_panel/public/panel_component/presentation_panel_internal.tsx +++ b/src/plugins/presentation_panel/public/panel_component/presentation_panel_internal.tsx @@ -15,9 +15,9 @@ import { useBatchedOptionalPublishingSubjects, } from '@kbn/presentation-publishing'; import classNames from 'classnames'; -import React, { useMemo, useState } from 'react'; -import { PresentationPanelHoverActions } from './panel_header/presentation_panel_hover_actions'; +import React, { useCallback, useMemo, useRef, useState } from 'react'; import { PresentationPanelHeader } from './panel_header/presentation_panel_header'; +import { PresentationPanelHoverActions } from './panel_header/presentation_panel_hover_actions'; import { PresentationPanelError } from './presentation_panel_error'; import { DefaultPresentationPanelApi, PresentationPanelInternalProps } from './types'; @@ -37,10 +37,14 @@ export const PresentationPanelInternal = < Component, componentProps, + + setDragHandles, }: PresentationPanelInternalProps<ApiType, ComponentPropsType>) => { const [api, setApi] = useState<ApiType | null>(null); const headerId = useMemo(() => htmlIdGenerator()(), []); + const dragHandles = useRef<{ [dragHandleKey: string]: HTMLElement | null }>({}); + const viewModeSubject = (() => { if (apiPublishesViewMode(api)) return api.viewMode; if (apiHasParentApi(api) && apiPublishesViewMode(api.parentApi)) return api.parentApi.viewMode; @@ -90,9 +94,26 @@ export const PresentationPanelInternal = < return attrs; }, [dataLoading, blockingError]); + const setDragHandle = useCallback( + (id: string, ref: HTMLElement | null) => { + dragHandles.current[id] = ref; + setDragHandles?.(Object.values(dragHandles.current)); + }, + [setDragHandles] + ); + return ( <PresentationPanelHoverActions - {...{ index, api, getActions, actionPredicate, viewMode, showNotifications, showBorder }} + {...{ + index, + api, + getActions, + actionPredicate, + viewMode, + showNotifications, + showBorder, + }} + setDragHandle={setDragHandle} > <EuiPanel role="figure" @@ -108,6 +129,7 @@ export const PresentationPanelInternal = < {!hideHeader && api && ( <PresentationPanelHeader api={api} + setDragHandle={setDragHandle} headerId={headerId} viewMode={viewMode} hideTitle={hideTitle} diff --git a/src/plugins/presentation_panel/public/panel_component/types.ts b/src/plugins/presentation_panel/public/panel_component/types.ts index fa60f134321a..d31914f8266a 100644 --- a/src/plugins/presentation_panel/public/panel_component/types.ts +++ b/src/plugins/presentation_panel/public/panel_component/types.ts @@ -58,6 +58,13 @@ export interface PresentationPanelInternalProps< * "title" when the panel has no title, i.e. "Panel {index}". */ index?: number; + + /** + * Set the drag handlers to be used by kbn-grid-layout + * Note: If we make kbn-grid-layout responsible for **all** panel placement + * logic, then this could be removed. + */ + setDragHandles?: (refs: Array<HTMLElement | null>) => void; } /** diff --git a/src/plugins/presentation_util/README.mdx b/src/plugins/presentation_util/README.mdx index 4a98d90b2de2..b83dc20a0254 100755 --- a/src/plugins/presentation_util/README.mdx +++ b/src/plugins/presentation_util/README.mdx @@ -8,51 +8,4 @@ tags: ['kibana', 'presentation', 'services'] related: [] --- -## Introduction - The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas). - -## Redux Embeddables - -The Redux Embeddables system allows embeddable authors to interact with their embeddables in a standardized way using Redux toolkit. This wrapper abstracts away store and slice creation, and embeddable input sync. To use this system, a developer can use CreateReduxEmbeddableTools in the constructor of their embeddable, supplying a collection of reducers. - -### Reducers - -The reducer object expected by the ReduxEmbeddableWrapper is the same type as the reducers expected by [Redux Toolkit's CreateSlice](https://redux-toolkit.js.org/api/createslice). - -<DocAccordion buttonContent="Reducers Example" initialIsOpen> -```ts -// my_embeddable_reducers.ts -import { MyEmbeddableInput } from './my_embeddable'; - -export const myEmbeddableReducers = { - setSpecialBoolean: ( - state: WritableDraft<MyEmbeddableInput>, - action: PayloadAction<MyEmbeddableInput['specialBoolean']> - ) => { - state.specialBoolean = action.payload; - } -} - -``` -</DocAccordion> - -### Accessing Actions and State - -From components under the embeddable, actions, containerActions, and the current state of the redux store are accessed via the embeddable instance. You can pass the embeddable instance down as a prop, or use a context. - -<DocAccordion buttonContent="Accessing Redux Embeddable Context" initialIsOpen> - ```ts - // my_embeddable_component.tsx - const MyEmbeddableComponent = ({ embeddableInstance }: { embeddableInstance: IEmbeddable }) => { - // current state - const specialBoolean = embeddableInstance.select((state) => state.specialBoolean); - - // change specialBoolean after 5 seconds - setTimeout(() => embeddableInstance.dispatch.setSpecialBoolean(false), 5000); - -} - -``` -</DocAccordion> -``` diff --git a/src/plugins/presentation_util/public/index.ts b/src/plugins/presentation_util/public/index.ts index 568a691482a7..76e7362c855e 100644 --- a/src/plugins/presentation_util/public/index.ts +++ b/src/plugins/presentation_util/public/index.ts @@ -30,15 +30,6 @@ export { DEFAULT_DASHBOARD_DRILLDOWN_OPTIONS, } from './components'; -export { - lazyLoadReduxToolsPackage, - cleanFiltersForSerialize, - type ReduxEmbeddableState, - type ReduxEmbeddableTools, - type ReduxTools, - type ReduxToolsPackage, -} from './redux_tools'; - export type { ExpressionInputEditorRef, ExpressionInputProps, diff --git a/src/plugins/presentation_util/public/mocks.ts b/src/plugins/presentation_util/public/mocks.ts index e9eea6790d3d..cfe4bcaee12f 100644 --- a/src/plugins/presentation_util/public/mocks.ts +++ b/src/plugins/presentation_util/public/mocks.ts @@ -8,9 +8,7 @@ */ import { PresentationUtilPluginStart } from './types'; -import { ReduxToolsPackage, registerExpressionsLanguage } from '.'; -import { createReduxEmbeddableTools } from './redux_tools/redux_embeddables/create_redux_embeddable_tools'; -import { createReduxTools } from './redux_tools/create_redux_tools'; +import { registerExpressionsLanguage } from '.'; import { setStubKibanaServices } from './services/mocks'; const createStartContract = (): PresentationUtilPluginStart => { @@ -31,14 +29,6 @@ export const presentationUtilPluginMock = { createStartContract, }; -/** - * A non async-imported version of the real redux embeddable tools package for mocking purposes. - */ -export const mockedReduxEmbeddablePackage: ReduxToolsPackage = { - createReduxEmbeddableTools, - createReduxTools, -}; - export * from './__stories__/fixtures/flights'; export const setMockedPresentationUtilServices = () => { setStubKibanaServices(); diff --git a/src/plugins/presentation_util/public/redux_tools/create_redux_tools.ts b/src/plugins/presentation_util/public/redux_tools/create_redux_tools.ts deleted file mode 100644 index b067df8daadd..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/create_redux_tools.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { - AnyAction, - Middleware, - createSlice, - configureStore, - SliceCaseReducers, - CaseReducerActions, -} from '@reduxjs/toolkit'; -import { v4 as uuidv4 } from 'uuid'; -import { createContext } from 'react'; -import { createSelectorHook } from 'react-redux'; - -import { ReduxTools, ReduxToolsReducers, ReduxToolsSetters } from './types'; - -export const createReduxTools = < - ReduxStateType extends unknown, - ReducerType extends ReduxToolsReducers<ReduxStateType> = ReduxToolsReducers<ReduxStateType> ->({ - reducers, - additionalMiddleware, - initialState, -}: { - additionalMiddleware?: Array<Middleware<AnyAction>>; - initialState: ReduxStateType; - reducers: ReducerType; -}): ReduxTools<ReduxStateType, ReducerType> => { - const id = uuidv4(); - - /** - * Create slice out of reducers and embeddable initial state. - */ - const slice = createSlice<ReduxStateType, SliceCaseReducers<ReduxStateType>>({ - initialState, - name: id, - reducers, - }); - - const store = configureStore({ - reducer: slice.reducer, - middleware: (getDefaultMiddleware) => - getDefaultMiddleware().concat(...(additionalMiddleware ?? [])), - }); - - /** - * Create an object of setter functions by looping through the reducers, and creating a method that dispatches the related - * action to the appropriate store. - */ - const dispatch: ReduxToolsSetters<ReduxStateType, ReducerType> = Object.keys(reducers).reduce( - (acc, key: keyof ReducerType) => { - const sliceAction = - slice.actions[key as keyof CaseReducerActions<SliceCaseReducers<ReduxStateType>, string>]; - acc[key] = (payload) => store.dispatch(sliceAction(payload)); - return acc; - }, - {} as ReduxToolsSetters<ReduxStateType, ReducerType> - ); - - /** - * Create a selector which can be used by react components to get the latest state values and to re-render when state changes. - */ - const select = createSelectorHook( - createContext({ - store, - storeState: store.getState(), - }) - ); - - return { - store, - select, - dispatch, - getState: store.getState, - onStateChange: store.subscribe, - }; -}; diff --git a/src/plugins/presentation_util/public/redux_tools/index.ts b/src/plugins/presentation_util/public/redux_tools/index.ts deleted file mode 100644 index 6c7f8c627bab..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { ReduxToolsPackage } from './types'; - -export type { ReduxEmbeddableState, ReduxEmbeddableTools } from './redux_embeddables/types'; -export { cleanFiltersForSerialize } from './redux_embeddables/clean_redux_embeddable_state'; -export type { ReduxToolsPackage, ReduxTools } from './types'; - -export const lazyLoadReduxToolsPackage = async (): Promise<ReduxToolsPackage> => { - const { createReduxTools } = await import('./create_redux_tools'); - const { createReduxEmbeddableTools } = await import( - './redux_embeddables/create_redux_embeddable_tools' - ); - return { - createReduxTools, - createReduxEmbeddableTools, - }; -}; diff --git a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.test.ts b/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.test.ts deleted file mode 100644 index 2ecaf9144831..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EmbeddableInput } from '@kbn/embeddable-plugin/public'; -import { Filter } from '@kbn/es-query'; -import { - cleanFiltersForSerialize, - cleanInputForRedux, - cleanStateForRedux, - stateContainsFilters, -} from './clean_redux_embeddable_state'; - -type InputWithFilters = Partial<EmbeddableInput> & { filters: Filter[] }; - -describe('stateContainsFilters', () => { - test('should return true if state contains filters', () => { - const explicitInput: InputWithFilters = { - id: 'wat', - filters: [{ query: {}, meta: {} }], - }; - - expect(stateContainsFilters(explicitInput)).toBe(true); - }); - - test('should return false if state does not contain filters', () => { - const explicitInput: EmbeddableInput = { - id: 'wat', - }; - - expect(stateContainsFilters(explicitInput)).toBe(false); - }); -}); - -describe('cleanFiltersForSerialize', () => { - test('should return an empty array if filters is not provided', () => { - expect(cleanFiltersForSerialize()).toEqual([]); - }); - - test('should remove "meta.value" property from each filter', () => { - const filters: Filter[] = [ - { query: { a: 'a' }, meta: { value: 'value1' } }, - { query: { b: 'b' }, meta: { value: 'value2' } }, - ]; - - const cleanedFilters = cleanFiltersForSerialize(filters); - - expect(cleanedFilters[0]).toEqual({ query: { a: 'a' }, meta: {} }); - expect(cleanedFilters[1]).toEqual({ query: { b: 'b' }, meta: {} }); - }); - - test('should not fail if meta is missing from filters', () => { - const filters: Filter[] = [{ query: { a: 'a' } }, { query: { b: 'b' } }] as unknown as Filter[]; - - const cleanedFilters = cleanFiltersForSerialize(filters as unknown as Filter[]); - - expect(cleanedFilters[0]).toEqual({ query: { a: 'a' } }); - expect(cleanedFilters[1]).toEqual({ query: { b: 'b' } }); - }); -}); - -describe('cleanInputForRedux', () => { - test('should clean filters to make explicit input serializable', () => { - const explicitInput = { - id: 'wat', - filters: [ - { query: { a: 'a' }, meta: { value: 'value1' } }, - { query: { b: 'b' }, meta: { value: 'value2' } }, - ], - }; - - const cleanedInput = cleanInputForRedux(explicitInput) as InputWithFilters; - - expect(cleanedInput.filters[0]).toEqual({ query: { a: 'a' }, meta: {} }); - expect(cleanedInput.filters[1]).toEqual({ query: { b: 'b' }, meta: {} }); - }); - - test('should not modify input if filters are not present', () => { - const explicitInput = { - id: 'wat', - otherProp: 'value', - }; - - const cleanedInput = cleanInputForRedux(explicitInput); - - expect(cleanedInput).toEqual(explicitInput); - }); -}); - -describe('cleanStateForRedux', () => { - test('should clean explicitInput for serializable state', () => { - const state = { - output: {}, - componentState: {}, - explicitInput: { - id: 'wat', - filters: [ - { query: { a: 'a' }, meta: { value: 'value1' } }, - { query: { b: 'b' }, meta: { value: 'value2' } }, - ], - }, - }; - - const cleanedState = cleanStateForRedux(state) as { explicitInput: InputWithFilters }; - - expect(cleanedState.explicitInput.filters[0]).toEqual({ query: { a: 'a' }, meta: {} }); - expect(cleanedState.explicitInput.filters[1]).toEqual({ query: { b: 'b' }, meta: {} }); - }); - - test('should not modify state if explicitInput filters are not present', () => { - const state = { - output: {}, - componentState: {}, - explicitInput: { - id: 'wat', - otherKey: 'value', - }, - }; - - const cleanedState = cleanStateForRedux(state); - - expect(cleanedState).toEqual(state); - }); -}); diff --git a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.ts b/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.ts deleted file mode 100644 index 17c97e7edecb..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/clean_redux_embeddable_state.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Filter } from '@kbn/es-query'; -import { EmbeddableInput } from '@kbn/embeddable-plugin/public'; - -import { ReduxEmbeddableState } from './types'; - -// TODO: Make filters serializable so we don't need special treatment for them. -type InputWithFilters = Partial<EmbeddableInput> & { filters: Filter[] }; -export const stateContainsFilters = ( - state: Partial<EmbeddableInput> -): state is InputWithFilters => { - if ((state as InputWithFilters).filters && (state as InputWithFilters).filters.length > 0) - return true; - return false; -}; - -export const cleanFiltersForSerialize = (filters?: Filter[]): Filter[] => { - if (!filters) return []; - return filters.map((filter) => { - if (filter.meta?.value) delete filter.meta.value; - return filter; - }); -}; - -export const cleanInputForRedux = < - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState ->( - explicitInput: ReduxEmbeddableStateType['explicitInput'] -) => { - if (stateContainsFilters(explicitInput)) { - explicitInput.filters = cleanFiltersForSerialize(explicitInput.filters); - } - return explicitInput; -}; - -export const cleanStateForRedux = < - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState ->( - state: ReduxEmbeddableStateType -) => { - // clean explicit input - state.explicitInput = cleanInputForRedux<ReduxEmbeddableStateType>(state.explicitInput); - return state; -}; diff --git a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/create_redux_embeddable_tools.ts b/src/plugins/presentation_util/public/redux_tools/redux_embeddables/create_redux_embeddable_tools.ts deleted file mode 100644 index 3cb0b2c24425..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/create_redux_embeddable_tools.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { Draft, AnyAction, Middleware, PayloadAction } from '@reduxjs/toolkit'; - -import { Embeddable } from '@kbn/embeddable-plugin/public'; - -import { ReduxToolsReducers } from '../types'; -import { createReduxTools } from '../create_redux_tools'; -import { syncReduxEmbeddable } from './sync_redux_embeddable'; -import { cleanStateForRedux } from './clean_redux_embeddable_state'; -import { ReduxEmbeddableTools, ReduxEmbeddableState, ReduxEmbeddableSyncSettings } from './types'; - -export const createReduxEmbeddableTools = < - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState, - ReducerType extends ReduxToolsReducers<ReduxEmbeddableStateType> = ReduxToolsReducers<ReduxEmbeddableStateType> ->({ - reducers, - embeddable, - syncSettings, - additionalMiddleware, - initialComponentState, -}: { - embeddable: Embeddable< - ReduxEmbeddableStateType['explicitInput'], - ReduxEmbeddableStateType['output'] - >; - additionalMiddleware?: Array<Middleware<AnyAction>>; - initialComponentState?: ReduxEmbeddableStateType['componentState']; - syncSettings?: ReduxEmbeddableSyncSettings; - reducers: ReducerType; -}): ReduxEmbeddableTools<ReduxEmbeddableStateType, ReducerType> => { - /** - * Build additional generic reducers to aid in embeddable syncing. - */ - const genericReducers = { - replaceEmbeddableReduxInput: ( - state: Draft<ReduxEmbeddableStateType>, - action: PayloadAction<ReduxEmbeddableStateType['explicitInput']> - ) => { - state.explicitInput = action.payload; - }, - replaceEmbeddableReduxOutput: ( - state: Draft<ReduxEmbeddableStateType>, - action: PayloadAction<ReduxEmbeddableStateType['output']> - ) => { - state.output = action.payload; - }, - }; - const allReducers = { ...reducers, ...genericReducers }; - - /** - * Create initial state from Embeddable. - */ - let initialState: ReduxEmbeddableStateType = { - output: embeddable.getOutput(), - componentState: initialComponentState ?? {}, - explicitInput: embeddable.getExplicitInput(), - } as ReduxEmbeddableStateType; - - initialState = cleanStateForRedux<ReduxEmbeddableStateType>(initialState); - - const { dispatch, store, select, getState, onStateChange } = createReduxTools< - ReduxEmbeddableStateType, - typeof allReducers - >({ - reducers: allReducers, - additionalMiddleware, - initialState, - }); - - /** - * Sync redux state with embeddable input and output observables. Eventually we can replace the input and output observables - * with redux and remove this sync. - */ - const stopReduxEmbeddableSync = syncReduxEmbeddable<ReduxEmbeddableStateType>({ - replaceEmbeddableReduxInput: dispatch.replaceEmbeddableReduxInput, - replaceEmbeddableReduxOutput: dispatch.replaceEmbeddableReduxOutput, - settings: syncSettings, - embeddable, - store, - }); - - return { - store, - select, - dispatch, - getState, - onStateChange, - cleanup: () => stopReduxEmbeddableSync?.(), - }; -}; diff --git a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/sync_redux_embeddable.ts b/src/plugins/presentation_util/public/redux_tools/redux_embeddables/sync_redux_embeddable.ts deleted file mode 100644 index 4a6a7f177c52..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/sync_redux_embeddable.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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import deepEqual from 'fast-deep-equal'; -import { EnhancedStore } from '@reduxjs/toolkit'; - -import { IEmbeddable } from '@kbn/embeddable-plugin/public'; - -import { cleanInputForRedux } from './clean_redux_embeddable_state'; -import { ReduxEmbeddableState, ReduxEmbeddableSyncSettings } from './types'; - -type Writeable<T> = { -readonly [P in keyof T]: T[P] }; - -export const syncReduxEmbeddable = < - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState ->({ - store, - settings, - embeddable, - replaceEmbeddableReduxInput, - replaceEmbeddableReduxOutput, -}: { - settings?: ReduxEmbeddableSyncSettings; - store: EnhancedStore<ReduxEmbeddableStateType>; - replaceEmbeddableReduxInput: (input: ReduxEmbeddableStateType['explicitInput']) => void; - replaceEmbeddableReduxOutput: (output: ReduxEmbeddableStateType['output']) => void; - embeddable: IEmbeddable< - ReduxEmbeddableStateType['explicitInput'], - ReduxEmbeddableStateType['output'] - >; -}) => { - if (settings?.disableSync) { - return; - } - - let embeddableToReduxInProgress = false; - let reduxToEmbeddableInProgress = false; - - const { isInputEqual: inputEqualityCheck, isOutputEqual: outputEqualityCheck } = settings ?? {}; - const inputEqual = ( - inputA: Partial<ReduxEmbeddableStateType['explicitInput']>, - inputB: Partial<ReduxEmbeddableStateType['explicitInput']> - ) => (inputEqualityCheck ? inputEqualityCheck(inputA, inputB) : deepEqual(inputA, inputB)); - const outputEqual = ( - outputA: ReduxEmbeddableStateType['output'], - outputB: ReduxEmbeddableStateType['output'] - ) => (outputEqualityCheck ? outputEqualityCheck(outputA, outputB) : deepEqual(outputA, outputB)); - - // when the redux store changes, diff, and push updates to the embeddable input or to the output. - const unsubscribeFromStore = store.subscribe(() => { - if (embeddableToReduxInProgress) return; - reduxToEmbeddableInProgress = true; - const reduxState = store.getState(); - if (!inputEqual(reduxState.explicitInput, embeddable.getExplicitInput())) { - embeddable.updateInput(reduxState.explicitInput); - } - if (!outputEqual(reduxState.output, embeddable.getOutput())) { - // updating output is usually not accessible from outside of the embeddable. - // This redux sync utility is meant to be used from inside the embeddable, so we need to workaround the typescript error via casting. - ( - embeddable as unknown as { - updateOutput: (newOutput: ReduxEmbeddableStateType['output']) => void; - } - ).updateOutput(reduxState.output); - } - reduxToEmbeddableInProgress = false; - }); - - // when the embeddable input changes, diff and dispatch to the redux store - const inputSubscription = embeddable.getInput$().subscribe(() => { - if (reduxToEmbeddableInProgress) return; - embeddableToReduxInProgress = true; - const { explicitInput: reduxExplicitInput } = store.getState(); - - // store only explicit input in the store - const embeddableExplictInput = embeddable.getExplicitInput() as Writeable< - ReduxEmbeddableStateType['explicitInput'] - >; - - if (!inputEqual(reduxExplicitInput, embeddableExplictInput)) { - replaceEmbeddableReduxInput(cleanInputForRedux(embeddableExplictInput)); - } - embeddableToReduxInProgress = false; - }); - - // when the embeddable output changes, diff and dispatch to the redux store - const outputSubscription = embeddable.getOutput$().subscribe((embeddableOutput) => { - if (reduxToEmbeddableInProgress) return; - embeddableToReduxInProgress = true; - const reduxState = store.getState(); - if (!outputEqual(reduxState.output, embeddableOutput)) { - replaceEmbeddableReduxOutput(embeddableOutput); - } - embeddableToReduxInProgress = false; - }); - return () => { - unsubscribeFromStore(); - inputSubscription.unsubscribe(); - outputSubscription.unsubscribe(); - }; -}; diff --git a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts b/src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts deleted file mode 100644 index 89408af55931..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/redux_embeddables/types.ts +++ /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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { EnhancedStore } from '@reduxjs/toolkit'; -import { EmbeddableInput, EmbeddableOutput } from '@kbn/embeddable-plugin/public'; -import { ReduxToolsReducers, ReduxToolsSelect, ReduxToolsSetters } from '../types'; - -export interface ReduxEmbeddableSyncSettings< - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState -> { - disableSync: boolean; - isInputEqual?: ( - a: Partial<ReduxEmbeddableStateType['explicitInput']>, - b: Partial<ReduxEmbeddableStateType['explicitInput']> - ) => boolean; - isOutputEqual?: ( - a: Partial<ReduxEmbeddableStateType['output']>, - b: Partial<ReduxEmbeddableStateType['output']> - ) => boolean; -} - -/** - * The return type from createReduxEmbeddableTools. Contains tools to get state, select state for react components, - * set state, and react to state changes. - */ -export interface ReduxEmbeddableTools< - ReduxEmbeddableStateType extends ReduxEmbeddableState = ReduxEmbeddableState, - ReducerType extends ReduxToolsReducers<ReduxEmbeddableStateType> = ReduxToolsReducers<ReduxEmbeddableStateType> -> { - cleanup: () => void; - store: EnhancedStore<ReduxEmbeddableStateType>; - select: ReduxToolsSelect<ReduxEmbeddableStateType>; - getState: EnhancedStore<ReduxEmbeddableStateType>['getState']; - dispatch: ReduxToolsSetters<ReduxEmbeddableStateType, ReducerType>; - onStateChange: EnhancedStore<ReduxEmbeddableStateType>['subscribe']; -} - -/** - * The Embeddable Redux store should contain Input, Output and State. Input is serialized and used to create the embeddable, - * Output is used as a communication layer for state that the Embeddable creates, and State is used to store ephemeral state which needs - * to be communicated between an embeddable and its inner React components. - */ -export interface ReduxEmbeddableState< - InputType extends EmbeddableInput = EmbeddableInput, - OutputType extends EmbeddableOutput = EmbeddableOutput, - StateType extends unknown = unknown -> { - explicitInput: InputType; - output: OutputType; - componentState: StateType; -} diff --git a/src/plugins/presentation_util/public/redux_tools/types.ts b/src/plugins/presentation_util/public/redux_tools/types.ts deleted file mode 100644 index 7b2edc157921..000000000000 --- a/src/plugins/presentation_util/public/redux_tools/types.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { CaseReducer, PayloadAction, EnhancedStore } from '@reduxjs/toolkit'; - -/** - * The Redux Tools Selector is a react redux selector function that can be used to grab values from the state, and to make a component - * re-render when those values change. - */ -export type ReduxToolsSelect<ReduxStateType extends unknown> = <Selected extends unknown>( - selector: (state: ReduxStateType) => Selected, - equalityFn?: ((previous: Selected, next: Selected) => boolean) | undefined -) => Selected; - -/** - * The Redux Embeddable Setters are a collection of functions which dispatch actions to the correct store. - */ -export type ReduxToolsSetters< - ReduxStateType extends unknown, - ReducerType extends ReduxToolsReducers<ReduxStateType> = ReduxToolsReducers<ReduxStateType> -> = { - [ReducerKey in keyof ReducerType]: ( - payload: Parameters<ReducerType[ReducerKey]>[1]['payload'] - ) => void; -}; - -/** - * The return type from createReduxTools. Contains tools to get state, select state for react components, - * set state, and react to state changes. - */ -export interface ReduxTools< - ReduxStateType extends unknown, - ReducerType extends ReduxToolsReducers<ReduxStateType> = ReduxToolsReducers<ReduxStateType> -> { - store: EnhancedStore<ReduxStateType>; - select: ReduxToolsSelect<ReduxStateType>; - getState: EnhancedStore<ReduxStateType>['getState']; - onStateChange: EnhancedStore<ReduxStateType>['subscribe']; - dispatch: ReduxToolsSetters<ReduxStateType, ReducerType>; -} - -/** - * The Redux Tools Reducers are the shape of the Raw reducers which will be passed into createSlice. These will be used to populate the actions - * object which the tools will return. - */ -export interface ReduxToolsReducers<ReduxStateType extends unknown> { - /** - * PayloadAction of type any is strategic here because we want to allow payloads of any shape in generic reducers. - * This type will be overridden to remove any and be type safe when returned by setupReduxEmbeddable. - */ - [key: string]: CaseReducer<ReduxStateType, PayloadAction<any>>; -} - -/** - * The package type is lazily exported from presentation_util and should contain all methods needed to use the redux embeddable tools. - */ -export interface ReduxToolsPackage { - createReduxTools: typeof import('./create_redux_tools')['createReduxTools']; - createReduxEmbeddableTools: typeof import('./redux_embeddables/create_redux_embeddable_tools')['createReduxEmbeddableTools']; -} diff --git a/src/plugins/presentation_util/tsconfig.json b/src/plugins/presentation_util/tsconfig.json index a794829d9ba5..45b258a2a373 100644 --- a/src/plugins/presentation_util/tsconfig.json +++ b/src/plugins/presentation_util/tsconfig.json @@ -22,7 +22,6 @@ "@kbn/data-views-plugin", "@kbn/i18n-react", "@kbn/monaco", - "@kbn/es-query", "@kbn/field-formats-plugin", "@kbn/interpreter", "@kbn/react-field", diff --git a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx index a3e6d1cc22b2..f56091a407fa 100644 --- a/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx +++ b/src/plugins/saved_objects/public/save_modal/saved_object_save_modal.tsx @@ -32,7 +32,6 @@ import { FormattedMessage } from '@kbn/i18n-react'; import React from 'react'; import { EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { euiThemeVars } from '@kbn/ui-theme'; export interface OnSaveProps { newTitle: string; @@ -405,7 +404,10 @@ export class SavedObjectSaveModal extends React.Component<Props, SaveModalState> /> </EuiFlexItem> {this.props.mustCopyOnSaveMessage && ( - <EuiFlexItem css={{ marginLeft: `-${euiThemeVars.euiSize}` }} grow={false}> + <EuiFlexItem + css={({ euiTheme }) => ({ marginLeft: `-${euiTheme.size.base}` })} + grow={false} + > <EuiIconTip type="iInCircle" content={this.props.mustCopyOnSaveMessage} /> </EuiFlexItem> )} diff --git a/src/plugins/saved_objects/tsconfig.json b/src/plugins/saved_objects/tsconfig.json index 83e113a7e4e1..167a6e1c7551 100644 --- a/src/plugins/saved_objects/tsconfig.json +++ b/src/plugins/saved_objects/tsconfig.json @@ -1,20 +1,25 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { - "outDir": "target/types", + "outDir": "target/types" }, - "include": ["common/**/*", "public/**/*", "server/**/*"], + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + // Emotion theme typing + "../../../typings/emotion.d.ts" + ], "kbn_references": [ "@kbn/core", "@kbn/data-plugin", "@kbn/i18n", "@kbn/data-views-plugin", "@kbn/i18n-react", - "@kbn/ui-theme", "@kbn/react-kibana-mount", - "@kbn/test-jest-helpers", + "@kbn/test-jest-helpers" ], "exclude": [ - "target/**/*", + "target/**/*" ] } 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 defb0e1a7998..b17eadf7e957 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 @@ -8,9 +8,7 @@ */ import { contentManagementMock } from '@kbn/content-management-plugin/public/mocks'; -import { coreMock } from '@kbn/core/public/mocks'; import { dataPluginMock } from '@kbn/data-plugin/public/mocks'; -import { AttributeService, type EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { spacesPluginMock } from '@kbn/spaces-plugin/public/mocks'; import { SavedSearchByValueAttributes, byValueToSavedSearch } from '.'; @@ -18,11 +16,6 @@ const mockServices = { contentManagement: contentManagementMock.createStartContract().client, search: dataPluginMock.createStartContract().search, spaces: spacesPluginMock.createStartContract(), - embeddable: { - getAttributeService: jest.fn( - (_, opts) => new AttributeService('search', coreMock.createStart().notifications.toasts, opts) - ), - } as unknown as EmbeddableStart, }; describe('toSavedSearch', () => { diff --git a/src/plugins/share/common/url_service/locators/locator.test.ts b/src/plugins/share/common/url_service/locators/locator.test.ts index 18bd21c0ed4f..648695f71f00 100644 --- a/src/plugins/share/common/url_service/locators/locator.test.ts +++ b/src/plugins/share/common/url_service/locators/locator.test.ts @@ -13,8 +13,9 @@ import { KibanaLocation } from '../../../public'; import { LocatorGetUrlParams } from '.'; import { decompressFromBase64 } from 'lz-string'; -const setup = () => { - const baseUrl = 'http://localhost:5601'; +const setup = ( + { baseUrl = 'http://localhost:5601' }: { baseUrl: string } = { baseUrl: 'http://localhost:5601' } +) => { const version = '1.2.3'; const deps: LocatorDependencies = { baseUrl, @@ -88,6 +89,48 @@ describe('Locator', () => { baz: 'b', }); }); + + test('returns URL of the redirect endpoint with custom spaceid', async () => { + const { locator } = setup(); + const url = await locator.getRedirectUrl( + { foo: 'a', baz: 'b' }, + { spaceId: 'custom-space-id' } + ); + + expect(url).toBe( + 'http://localhost:5601/s/custom-space-id/app/r?l=TEST_LOCATOR&v=1.2.3&lz=N4IgZg9hIFwghiANCARvAXrNIC%2BQ' + ); + }); + + test('returns URL of the redirect endpoint with replaced spaceid', async () => { + const { locator } = setup({ baseUrl: 'http://localhost:5601/s/space-id' }); + const url = await locator.getRedirectUrl( + { foo: 'a', baz: 'b' }, + { spaceId: 'custom-space-id' } + ); + + expect(url).toBe( + 'http://localhost:5601/s/custom-space-id/app/r?l=TEST_LOCATOR&v=1.2.3&lz=N4IgZg9hIFwghiANCARvAXrNIC%2BQ' + ); + }); + + test('returns URL of the redirect endpoint without spaceid', async () => { + const { locator } = setup({ baseUrl: 'http://localhost:5601/s/space-id' }); + const url = await locator.getRedirectUrl({ foo: 'a', baz: 'b' }, { spaceId: 'default' }); + + expect(url).toBe( + 'http://localhost:5601/app/r?l=TEST_LOCATOR&v=1.2.3&lz=N4IgZg9hIFwghiANCARvAXrNIC%2BQ' + ); + }); + + test('returns URL of the redirect endpoint with untouched spaceId', async () => { + const { locator } = setup({ baseUrl: 'http://localhost:5601/s/space-id' }); + const url = await locator.getRedirectUrl({ foo: 'a', baz: 'b' }); + + expect(url).toBe( + 'http://localhost:5601/s/space-id/app/r?l=TEST_LOCATOR&v=1.2.3&lz=N4IgZg9hIFwghiANCARvAXrNIC%2BQ' + ); + }); }); describe('.navigate()', () => { diff --git a/src/plugins/share/common/url_service/locators/locator.ts b/src/plugins/share/common/url_service/locators/locator.ts index ba532449463f..d479eac25c26 100644 --- a/src/plugins/share/common/url_service/locators/locator.ts +++ b/src/plugins/share/common/url_service/locators/locator.ts @@ -19,7 +19,13 @@ import type { LocatorNavigationParams, LocatorGetUrlParams, } from './types'; -import { formatSearchParams, FormatSearchParamsOptions, RedirectOptions } from './redirect'; +import { + formatSearchParams, + FormatSearchParamsOptions, + RedirectOptions, + GetRedirectUrlOptions, + addSpaceIdToPath, +} from './redirect'; export interface LocatorDependencies { /** @@ -92,7 +98,7 @@ export class Locator<P extends SerializableRecord> implements LocatorPublic<P> { return url; } - public getRedirectUrl(params: P, options: FormatSearchParamsOptions = {}): string { + public getRedirectUrl(params: P, options: GetRedirectUrlOptions = {}): string { const { baseUrl = '', version = '0.0.0' } = this.deps; const redirectOptions: RedirectOptions = { id: this.definition.id, @@ -100,12 +106,16 @@ export class Locator<P extends SerializableRecord> implements LocatorPublic<P> { params, }; const formatOptions: FormatSearchParamsOptions = { - ...options, lzCompress: options.lzCompress ?? true, }; const search = formatSearchParams(redirectOptions, formatOptions).toString(); + const path = '/app/r?' + search; - return baseUrl + '/app/r?' + search; + if (options.spaceId) { + return addSpaceIdToPath(baseUrl, options.spaceId, path); + } else { + return baseUrl + path; + } } public async navigate( diff --git a/src/plugins/share/common/url_service/locators/redirect/index.ts b/src/plugins/share/common/url_service/locators/redirect/index.ts index 9e2a9d8f433e..7e37c2b8b6d2 100644 --- a/src/plugins/share/common/url_service/locators/redirect/index.ts +++ b/src/plugins/share/common/url_service/locators/redirect/index.ts @@ -10,3 +10,4 @@ export * from './types'; export * from './format_search_params'; export * from './parse_search_params'; +export * from './space_url_parser'; diff --git a/src/plugins/share/common/url_service/locators/redirect/space_url_parser.test.ts b/src/plugins/share/common/url_service/locators/redirect/space_url_parser.test.ts new file mode 100644 index 000000000000..d6dc64c63b0f --- /dev/null +++ b/src/plugins/share/common/url_service/locators/redirect/space_url_parser.test.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +import { addSpaceIdToPath } from './space_url_parser'; + +describe('addSpaceIdToPath', () => { + test('handles no parameters', () => { + expect(addSpaceIdToPath()).toEqual(`/`); + }); + + test('it adds to the basePath correctly', () => { + expect(addSpaceIdToPath('/my/base/path', 'url-context')).toEqual('/my/base/path/s/url-context'); + }); + + test('it appends the requested path to the end of the url context', () => { + expect(addSpaceIdToPath('/base', 'context', '/final/destination')).toEqual( + '/base/s/context/final/destination' + ); + }); + + test('it replaces existing space identifiers', () => { + expect(addSpaceIdToPath('/my/base/path/s/old-space/', 'new-space')).toEqual( + '/my/base/path/s/new-space' + ); + + expect(addSpaceIdToPath('/my/base/path/s/old-space-no-trailing', 'new-space')).toEqual( + '/my/base/path/s/new-space' + ); + }); + + test('it removes existing space identifier when spaceId is default', () => { + expect(addSpaceIdToPath('/my/base/path/s/old-space', 'default')).toEqual('/my/base/path'); + expect(addSpaceIdToPath('/my/base/path/s/old-space')).toEqual('/my/base/path'); + }); + + test('it throws an error when the requested path does not start with a slash', () => { + expect(() => { + addSpaceIdToPath('', '', 'foo'); + }).toThrowErrorMatchingInlineSnapshot(`"path must start with a /"`); + }); +}); diff --git a/src/plugins/share/common/url_service/locators/redirect/space_url_parser.ts b/src/plugins/share/common/url_service/locators/redirect/space_url_parser.ts new file mode 100644 index 000000000000..9c9cb519d1c7 --- /dev/null +++ b/src/plugins/share/common/url_service/locators/redirect/space_url_parser.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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +export function addSpaceIdToPath( + basePath: string = '/', + spaceId: string = '', + requestedPath: string = '' +): string { + if (requestedPath && !requestedPath.startsWith('/')) { + throw new Error(`path must start with a /`); + } + + if (basePath.includes('/s/')) { + // If the base path already contains a space identifier, remove it + basePath = basePath.replace(/\/s\/[^/]+/, ''); + } + + const normalizedBasePath = basePath.endsWith('/') ? basePath.slice(0, -1) : basePath; + + if (spaceId && spaceId !== 'default') { + return `${normalizedBasePath}/s/${spaceId}${requestedPath}`; + } + + return `${normalizedBasePath}${requestedPath}` || '/'; +} diff --git a/src/plugins/share/common/url_service/locators/redirect/types.ts b/src/plugins/share/common/url_service/locators/redirect/types.ts index dfd6211c9743..bbc1b14f2e42 100644 --- a/src/plugins/share/common/url_service/locators/redirect/types.ts +++ b/src/plugins/share/common/url_service/locators/redirect/types.ts @@ -8,6 +8,7 @@ */ import type { SerializableRecord } from '@kbn/utility-types'; +import type { FormatSearchParamsOptions } from './format_search_params'; /** * @public @@ -27,3 +28,13 @@ export interface RedirectOptions<P extends SerializableRecord = unknown & Serial /** Locator params. */ params: P; } + +export interface GetRedirectUrlOptions extends FormatSearchParamsOptions { + /** + * Optional space ID to use when generating the URL. + * If not provided: + * - on the client the current space ID will be used. + * - on the server the URL will be generated without a space ID. + */ + spaceId?: string; +} diff --git a/src/plugins/share/common/url_service/locators/types.ts b/src/plugins/share/common/url_service/locators/types.ts index 5f9a37278a62..25f4fe8f1404 100644 --- a/src/plugins/share/common/url_service/locators/types.ts +++ b/src/plugins/share/common/url_service/locators/types.ts @@ -15,7 +15,7 @@ import { PersistableStateService, VersionedState, } from '@kbn/kibana-utils-plugin/common'; -import type { FormatSearchParamsOptions } from './redirect'; +import type { GetRedirectUrlOptions } from './redirect'; /** * URL locator registry. @@ -88,7 +88,7 @@ export interface LocatorPublic<P extends SerializableRecord> extends Persistable * @param params URL locator parameters. * @param options URL serialization options. */ - getRedirectUrl(params: P, options?: FormatSearchParamsOptions): string; + getRedirectUrl(params: P, options?: GetRedirectUrlOptions): string; /** * Navigate using the `core.application.navigateToApp()` method to a Kibana diff --git a/src/plugins/share/public/components/context/index.tsx b/src/plugins/share/public/components/context/index.tsx index 13d6138e42a6..0f18a46c8e39 100644 --- a/src/plugins/share/public/components/context/index.tsx +++ b/src/plugins/share/public/components/context/index.tsx @@ -19,7 +19,7 @@ import type { ShareContext, } from '../../types'; -export type { ShareMenuItemV2 } from '../../types'; +export type { ShareMenuItemV2, ShareContextObjectTypeConfig } from '../../types'; export interface IShareContext extends ShareContext { allowEmbed: boolean; diff --git a/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx b/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx index be3d8c941b8e..ee9fdf01588d 100644 --- a/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx +++ b/src/plugins/share/public/components/tabs/embed/embed_content.test.tsx @@ -19,6 +19,7 @@ describe('Share modal embed content tab', () => { beforeEach(() => { component = mountWithIntl( <EmbedContent + isDirty={false} objectType="dashboard" setIsNotSaved={() => jest.fn()} shareableUrl="/home#/" diff --git a/src/plugins/share/public/components/tabs/embed/embed_content.tsx b/src/plugins/share/public/components/tabs/embed/embed_content.tsx index 557a499a3802..5a9163097c8d 100644 --- a/src/plugins/share/public/components/tabs/embed/embed_content.tsx +++ b/src/plugins/share/public/components/tabs/embed/embed_content.tsx @@ -23,7 +23,7 @@ import useMountedState from 'react-use/lib/useMountedState'; import { format as formatUrl, parse as parseUrl } from 'url'; import { AnonymousAccessState } from '../../../../common'; -import { type IShareContext } from '../../context'; +import type { IShareContext, ShareContextObjectTypeConfig } from '../../context'; type EmbedProps = Pick< IShareContext, @@ -32,8 +32,10 @@ type EmbedProps = Pick< | 'shareableUrl' | 'embedUrlParamExtensions' | 'objectType' + | 'isDirty' > & { setIsNotSaved: () => void; + objectConfig?: ShareContextObjectTypeConfig; }; interface UrlParams { @@ -52,7 +54,9 @@ export const EmbedContent = ({ shareableUrlForSavedObject, shareableUrl, objectType, + objectConfig = {}, setIsNotSaved, + isDirty, }: EmbedProps) => { const isMounted = useMountedState(); const [urlParams, setUrlParams] = useState<UrlParams | undefined>(undefined); @@ -252,12 +256,20 @@ export const EmbedContent = ({ /> ); + const { draftModeCallOut: DraftModeCallout } = objectConfig; + return ( <> <EuiForm> <EuiText size="s">{helpText}</EuiText> <EuiSpacer /> {renderUrlParamExtensions()} + {isDirty && DraftModeCallout && ( + <> + <EuiSpacer size="m" /> + {DraftModeCallout} + </> + )} <EuiSpacer /> </EuiForm> <EuiFlexGroup justifyContent="flexEnd" responsive={false}> diff --git a/src/plugins/share/public/components/tabs/embed/index.tsx b/src/plugins/share/public/components/tabs/embed/index.tsx index 3c66b48f21c8..44d61833268c 100644 --- a/src/plugins/share/public/components/tabs/embed/index.tsx +++ b/src/plugins/share/public/components/tabs/embed/index.tsx @@ -38,8 +38,14 @@ const embedTabReducer: IEmbedTab['reducer'] = (state = { url: '', isNotSaved: fa }; const EmbedTabContent: NonNullable<IEmbedTab['content']> = ({ state, dispatch }) => { - const { embedUrlParamExtensions, shareableUrlForSavedObject, shareableUrl, objectType, isDirty } = - useShareTabsContext()!; + const { + embedUrlParamExtensions, + shareableUrlForSavedObject, + shareableUrl, + objectType, + objectTypeMeta, + isDirty, + } = useShareTabsContext()!; const setIsNotSaved = useCallback(() => { dispatch({ @@ -55,8 +61,10 @@ const EmbedTabContent: NonNullable<IEmbedTab['content']> = ({ state, dispatch }) shareableUrlForSavedObject, shareableUrl, objectType, + objectConfig: objectTypeMeta?.config?.embed, isNotSaved: state?.isNotSaved, setIsNotSaved, + isDirty, }} /> ); diff --git a/src/plugins/share/public/components/tabs/link/index.tsx b/src/plugins/share/public/components/tabs/link/index.tsx index c59ae74a62f3..3b602d43c1df 100644 --- a/src/plugins/share/public/components/tabs/link/index.tsx +++ b/src/plugins/share/public/components/tabs/link/index.tsx @@ -51,6 +51,7 @@ const linkTabReducer: ILinkTab['reducer'] = ( const LinkTabContent: ILinkTab['content'] = ({ state, dispatch }) => { const { objectType, + objectTypeMeta, objectId, isDirty, shareableUrl, @@ -86,6 +87,7 @@ const LinkTabContent: ILinkTab['content'] = ({ state, dispatch }) => { <LinkContent {...{ objectType, + objectConfig: objectTypeMeta?.config?.link, objectId, isDirty, shareableUrl, diff --git a/src/plugins/share/public/components/tabs/link/link_content.tsx b/src/plugins/share/public/components/tabs/link/link_content.tsx index 6c0d8e6e988e..10efd85d3bcd 100644 --- a/src/plugins/share/public/components/tabs/link/link_content.tsx +++ b/src/plugins/share/public/components/tabs/link/link_content.tsx @@ -10,7 +10,6 @@ import { copyToClipboard, EuiButton, - EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiForm, @@ -21,7 +20,7 @@ import { import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import React, { useCallback, useState, useRef, useEffect } from 'react'; -import type { IShareContext } from '../../context'; +import type { IShareContext, ShareContextObjectTypeConfig } from '../../context'; type LinkProps = Pick< IShareContext, @@ -33,7 +32,7 @@ type LinkProps = Pick< | 'delegatedShareUrlHandler' | 'shareableUrlLocatorParams' | 'allowShortUrl' ->; +> & { objectConfig?: ShareContextObjectTypeConfig }; interface UrlParams { [extensionName: string]: { @@ -44,6 +43,7 @@ interface UrlParams { export const LinkContent = ({ isDirty, objectType, + objectConfig = {}, shareableUrl, urlService, shareableUrlLocatorParams, @@ -116,6 +116,8 @@ export const LinkContent = ({ setIsLoading(false); }, [snapshotUrl, delegatedShareUrlHandler, allowShortUrl, createShortUrl]); + const { draftModeCallOut: DraftModeCallout } = objectConfig; + return ( <> <EuiForm> @@ -126,21 +128,10 @@ export const LinkContent = ({ values={{ objectType }} /> </EuiText> - {isDirty && objectType === 'lens' && ( + {isDirty && DraftModeCallout && ( <> <EuiSpacer size="m" /> - <EuiCallOut - color="warning" - iconType="warning" - title={ - <FormattedMessage id="share.link.warning.title" defaultMessage="Unsaved changes" /> - } - > - <FormattedMessage - id="share.link.warning.lens" - defaultMessage="Copy the link to get a temporary link. Save the lens visualization to create a permanent link." - /> - </EuiCallOut> + {DraftModeCallout} </> )} <EuiSpacer size="l" /> diff --git a/src/plugins/share/public/types.ts b/src/plugins/share/public/types.ts index 930b1b1d5f12..c9cb28e9660c 100644 --- a/src/plugins/share/public/types.ts +++ b/src/plugins/share/public/types.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import type { ComponentType, ReactElement } from 'react'; +import type { ComponentType, ReactElement, ReactNode } from 'react'; import type { InjectedIntl } from '@kbn/i18n-react'; import { EuiContextMenuPanelDescriptor } from '@elastic/eui'; import { EuiContextMenuPanelItemDescriptorEntry } from '@elastic/eui/src/components/context_menu/context_menu'; @@ -21,6 +21,10 @@ export type BrowserUrlService = UrlService< BrowserShortUrlClient >; +export interface ShareContextObjectTypeConfig { + draftModeCallOut?: ReactNode; +} + /** * @public * Properties of the current object to share. Registered share @@ -37,6 +41,7 @@ export interface ShareContext { */ objectTypeMeta: { title: string; + config?: Partial<Record<'link' | 'export' | 'embed', ShareContextObjectTypeConfig>>; }; objectId?: string; /** diff --git a/src/plugins/telemetry/server/telemetry_collection/get_cluster_stats.ts b/src/plugins/telemetry/server/telemetry_collection/get_cluster_stats.ts index 35afcacc3d0b..317066c46720 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_cluster_stats.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_cluster_stats.ts @@ -20,8 +20,6 @@ export async function getClusterStats(esClient: ElasticsearchClient) { return await esClient.cluster.stats( { timeout: CLUSTER_STAT_TIMEOUT, - - // @ts-expect-error include_remotes: true, }, { 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 3a244dcd5eb3..90e9b1bcb065 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 @@ -228,7 +228,7 @@ const getDegradedFieldsColumns = (): Array<EuiBasicTableColumn<DegradedField>> = sortable: true, field: 'values', render: (values: string[]) => { - return values.map((value, idx) => <EuiBadge key={idx}>{value}</EuiBadge>); + return values.map((value, idx) => <EuiBadge key={idx}>{JSON.stringify(value)}</EuiBadge>); }, }, ]; 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 348c8c9784ad..9775bf6b2ac5 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 @@ -3,7 +3,6 @@ word-wrap: break-word; white-space: pre-wrap; line-height: $euiLineHeight; - color: $euiColorFullShade; vertical-align: top; &--highlighted { diff --git a/src/plugins/unified_search/public/actions/apply_filter_action.ts b/src/plugins/unified_search/public/actions/apply_filter_action.ts index 9106e091ee50..96d760eb560d 100644 --- a/src/plugins/unified_search/public/actions/apply_filter_action.ts +++ b/src/plugins/unified_search/public/actions/apply_filter_action.ts @@ -14,7 +14,7 @@ import { IncompatibleActionError, UiActionsActionDefinition } from '@kbn/ui-acti // for cleanup esFilters need to fix the issue https://github.com/elastic/kibana/issues/131292 import { FilterManager, TimefilterContract } from '@kbn/data-plugin/public'; import type { Filter, RangeFilter } from '@kbn/es-query'; -import { getOverlays, getIndexPatterns } from '../services'; +import { getIndexPatterns } from '../services'; import { applyFiltersPopover } from '../apply_filters'; export const ACTION_GLOBAL_APPLY_FILTER = 'ACTION_GLOBAL_APPLY_FILTER'; @@ -74,7 +74,7 @@ export function createFilterAction( ); const filterSelectionPromise: Promise<Filter[]> = new Promise((resolve) => { - const overlay = getOverlays().openModal( + const overlay = coreStart.overlays.openModal( toMountPoint( applyFiltersPopover( filters, diff --git a/src/plugins/unified_search/public/plugin.ts b/src/plugins/unified_search/public/plugin.ts index 151b8f6d6fab..ae2813e790e5 100755 --- a/src/plugins/unified_search/public/plugin.ts +++ b/src/plugins/unified_search/public/plugin.ts @@ -14,7 +14,7 @@ import { APPLY_FILTER_TRIGGER } from '@kbn/data-plugin/public'; import { createQueryStringInput } from './query_string_input/get_query_string_input'; import { UPDATE_FILTER_REFERENCES_TRIGGER, updateFilterReferencesTrigger } from './triggers'; import type { ConfigSchema } from '../server/config'; -import { setIndexPatterns, setTheme, setOverlays, setAnalytics, setI18n } from './services'; +import { setCoreStart, setIndexPatterns } from './services'; import { AutocompleteService } from './autocomplete/autocomplete_service'; import { createSearchBar } from './search_bar/create_search_bar'; import { createIndexPatternSelect } from './index_pattern_select'; @@ -72,10 +72,7 @@ export class UnifiedSearchPublicPlugin core: CoreStart, { data, dataViews, uiActions, screenshotMode }: UnifiedSearchStartDependencies ): UnifiedSearchPublicPluginStart { - setAnalytics(core.analytics); - setI18n(core.i18n); - setTheme(core.theme); - setOverlays(core.overlays); + setCoreStart(core); setIndexPatterns(dataViews); const autocompleteStart = this.autocomplete.start(); diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.scss b/src/plugins/unified_search/public/query_string_input/query_string_input.scss index 46473af849c9..89af2e8e9911 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.scss +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.scss @@ -51,7 +51,7 @@ &.kbnQueryBar__textarea--autoHeight { overflow-x: auto; overflow-y: auto; - white-space: normal; + white-space: pre; max-height: calc(35vh - 100px); min-height: $euiFormControlHeight; } diff --git a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx index 2e76341ae607..2c5469ef306d 100644 --- a/src/plugins/unified_search/public/query_string_input/query_string_input.tsx +++ b/src/plugins/unified_search/public/query_string_input/query_string_input.tsx @@ -56,7 +56,7 @@ import { SuggestionsComponent } from '../typeahead'; import { onRaf } from '../utils'; import { FilterButtonGroup } from '../filter_bar/filter_button_group/filter_button_group'; import { AutocompleteService, QuerySuggestion, QuerySuggestionTypes } from '../autocomplete'; -import { getAnalytics, getI18n, getTheme } from '../services'; +import { getCoreStart } from '../services'; import './query_string_input.scss'; export const strings = { @@ -568,7 +568,7 @@ export default class QueryStringInputUI extends PureComponent<QueryStringInputPr </EuiFlexItem> </EuiFlexGroup> </div>, - { analytics: getAnalytics(), i18n: getI18n(), theme: getTheme() } + getCoreStart() ), }); } diff --git a/src/plugins/unified_search/public/services.ts b/src/plugins/unified_search/public/services.ts index 152c987d84e6..3b3636c66009 100644 --- a/src/plugins/unified_search/public/services.ts +++ b/src/plugins/unified_search/public/services.ts @@ -7,22 +7,11 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { - ThemeServiceStart, - OverlayStart, - AnalyticsServiceStart, - I18nStart, -} from '@kbn/core/public'; -import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; +import { CoreStart } from '@kbn/core/public'; import { DataViewsContract } from '@kbn/data-views-plugin/public'; +import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; + +export const [getCoreStart, setCoreStart] = createGetterSetter<CoreStart>('CoreStart'); export const [getIndexPatterns, setIndexPatterns] = createGetterSetter<DataViewsContract>('IndexPatterns'); - -export const [getAnalytics, setAnalytics] = createGetterSetter<AnalyticsServiceStart>('Analytics'); - -export const [getI18n, setI18n] = createGetterSetter<I18nStart>('I18n'); - -export const [getTheme, setTheme] = createGetterSetter<ThemeServiceStart>('Theme'); - -export const [getOverlays, setOverlays] = createGetterSetter<OverlayStart>('Overlays'); diff --git a/src/plugins/unified_search/public/types.ts b/src/plugins/unified_search/public/types.ts index 08c8b282d23b..f9d055644777 100755 --- a/src/plugins/unified_search/public/types.ts +++ b/src/plugins/unified_search/public/types.ts @@ -96,6 +96,7 @@ export interface IUnifiedSearchPluginServices extends Partial<CoreStart> { analytics: CoreStart['analytics']; i18n: CoreStart['i18n']; theme: CoreStart['theme']; + userProfile: CoreStart['userProfile']; storage: IStorageWrapper; docLinks: DocLinksStart; data: DataPublicPluginStart; diff --git a/src/plugins/vis_default_editor/public/default_editor_controller.tsx b/src/plugins/vis_default_editor/public/default_editor_controller.tsx index 5b141282b9a1..7f95da7e2c75 100644 --- a/src/plugins/vis_default_editor/public/default_editor_controller.tsx +++ b/src/plugins/vis_default_editor/public/default_editor_controller.tsx @@ -15,7 +15,7 @@ import { EuiErrorBoundary, EuiLoadingChart } from '@elastic/eui'; import { Vis, VisualizeEmbeddableContract } from '@kbn/visualizations-plugin/public'; import { IEditorController, EditorRenderProps } from '@kbn/visualizations-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { getAnalytics, getI18n, getTheme } from './services'; +import { getCoreStart } from './services'; // @ts-ignore const DefaultEditor = lazy(() => import('./default_editor')); @@ -30,7 +30,7 @@ class DefaultEditorController implements IEditorController { render(props: EditorRenderProps) { render( - <KibanaRenderContextProvider analytics={getAnalytics()} i18n={getI18n()} theme={getTheme()}> + <KibanaRenderContextProvider {...getCoreStart()}> <EuiErrorBoundary> <Suspense fallback={ diff --git a/src/plugins/vis_default_editor/public/plugin.ts b/src/plugins/vis_default_editor/public/plugin.ts index d3b6479189a6..192504864cf6 100644 --- a/src/plugins/vis_default_editor/public/plugin.ts +++ b/src/plugins/vis_default_editor/public/plugin.ts @@ -11,7 +11,7 @@ import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public'; import type { VisualizationsSetup } from '@kbn/visualizations-plugin/public'; import { DefaultEditorController } from './default_editor_controller'; -import { setAnalytics, setI18n, setTheme } from './services'; +import { setAnalytics, setCoreStart, setTheme } from './services'; export interface VisDefaultEditorSetupDependencies { visualizations: VisualizationsSetup; @@ -29,7 +29,7 @@ export class VisDefaultEditorPlugin } public start(core: CoreStart) { - setI18n(core.i18n); + setCoreStart(core); } stop() {} diff --git a/src/plugins/vis_default_editor/public/services.ts b/src/plugins/vis_default_editor/public/services.ts index 0652b8ba742e..23b4594174c5 100644 --- a/src/plugins/vis_default_editor/public/services.ts +++ b/src/plugins/vis_default_editor/public/services.ts @@ -7,10 +7,10 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AnalyticsServiceStart, I18nStart, ThemeServiceStart } from '@kbn/core/public'; +import { AnalyticsServiceStart, CoreStart, ThemeServiceStart } from '@kbn/core/public'; import { createGetterSetter } from '@kbn/kibana-utils-plugin/common'; export const [getAnalytics, setAnalytics] = createGetterSetter<AnalyticsServiceStart>('AnalyticsService'); -export const [getI18n, setI18n] = createGetterSetter<I18nStart>('I18nService'); export const [getTheme, setTheme] = createGetterSetter<ThemeServiceStart>('ThemeService'); +export const [getCoreStart, setCoreStart] = createGetterSetter<CoreStart>('CoreStart'); diff --git a/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.tsx.snap b/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.tsx.snap index dad12b304efd..f9afbdc89911 100644 --- a/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.tsx.snap +++ b/src/plugins/vis_types/vega/public/__snapshots__/vega_visualization.test.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`VegaVisualizations VegaVisualization - basics should show vega graph (may fail in dev env) 1`] = `"<div class=\\"vgaVis__view\\" role=\\"graphics-document\\" aria-roledescription=\\"visualization\\" aria-label=\\"Vega visualization\\" style=\\"cursor: default;\\"><svg xmlns=\\"http://www.w3.org/2000/svg\\" xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" version=\\"1.1\\" class=\\"marks\\" width=\\"512\\" height=\\"512\\" viewBox=\\"0 0 512 512\\" style=\\"background-color: transparent;\\"><g fill=\\"none\\" stroke-miterlimit=\\"10\\" transform=\\"translate(0,0)\\"><g class=\\"mark-group role-frame root\\" role=\\"graphics-object\\" aria-roledescription=\\"group mark container\\"><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h512v512h-512Z\\"></path><g><g class=\\"mark-group role-scope\\" role=\\"graphics-object\\" aria-roledescription=\\"group mark container\\"><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h0v0h0Z\\"></path><g><g class=\\"mark-area role-mark\\" role=\\"graphics-symbol\\" aria-roledescription=\\"area mark container\\"><path d=\\"M0,512C18.963,512,37.926,512,56.889,512C75.852,512,94.815,512,113.778,512C132.741,512,151.704,512,170.667,512C189.63,512,208.593,512,227.556,512C246.519,512,265.481,512,284.444,512C303.407,512,322.37,512,341.333,512C360.296,512,379.259,512,398.222,512C417.185,512,436.148,512,455.111,512C474.074,512,493.037,512,512,512L512,355.2C493.037,324.8,474.074,294.4,455.111,294.4C436.148,294.4,417.185,457.6,398.222,457.6C379.259,457.6,360.296,233.6,341.333,233.6C322.37,233.6,303.407,435.2,284.444,435.2C265.481,435.2,246.519,345.6,227.556,345.6C208.593,345.6,189.63,451.2,170.667,451.2C151.704,451.2,132.741,252.8,113.778,252.8C94.815,252.8,75.852,346.133,56.889,374.4C37.926,402.667,18.963,412.533,0,422.4Z\\" fill=\\"#54B399\\" fill-opacity=\\"1\\"></path></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h0v0h0Z\\"></path><g><g class=\\"mark-area role-mark\\" role=\\"graphics-symbol\\" aria-roledescription=\\"area mark container\\"><path d=\\"M0,422.4C18.963,412.533,37.926,402.667,56.889,374.4C75.852,346.133,94.815,252.8,113.778,252.8C132.741,252.8,151.704,451.2,170.667,451.2C189.63,451.2,208.593,345.6,227.556,345.6C246.519,345.6,265.481,435.2,284.444,435.2C303.407,435.2,322.37,233.6,341.333,233.6C360.296,233.6,379.259,457.6,398.222,457.6C417.185,457.6,436.148,294.4,455.111,294.4C474.074,294.4,493.037,324.8,512,355.2L512,307.2C493.037,275.2,474.074,243.2,455.111,243.2C436.148,243.2,417.185,371.2,398.222,371.2C379.259,371.2,360.296,22.4,341.333,22.4C322.37,22.4,303.407,278.4,284.444,278.4C265.481,278.4,246.519,204.8,227.556,192C208.593,179.2,189.63,185.6,170.667,172.8C151.704,160,132.741,83.2,113.778,83.2C94.815,83.2,75.852,83.2,56.889,83.2C37.926,83.2,18.963,164.8,0,246.4Z\\" fill=\\"#6092C0\\" fill-opacity=\\"1\\"></path></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g></g></g></svg></div><div class=\\"vgaVis__controls vgaVis__controls--column\\"></div>"`; +exports[`VegaVisualizations VegaVisualization - basics should show vega graph (may fail in dev env) 1`] = `"<div class=\\"vgaVis__view\\" role=\\"graphics-document\\" aria-roledescription=\\"visualization\\" aria-label=\\"Vega visualization\\" style=\\"cursor: default;\\"><svg xmlns=\\"http://www.w3.org/2000/svg\\" xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" version=\\"1.1\\" class=\\"marks\\" width=\\"512\\" height=\\"512\\" viewBox=\\"0 0 512 512\\" style=\\"background-color: transparent;\\"><g fill=\\"none\\" stroke-miterlimit=\\"10\\" transform=\\"translate(0,0)\\"><g class=\\"mark-group role-frame root\\" role=\\"graphics-object\\" aria-roledescription=\\"group mark container\\"><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h512v512h-512Z\\"></path><g><g class=\\"mark-group role-scope\\" role=\\"graphics-object\\" aria-roledescription=\\"group mark container\\"><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h0v0h0Z\\"></path><g><g class=\\"mark-area role-mark\\" role=\\"graphics-symbol\\" aria-roledescription=\\"area mark container\\"><path d=\\"M0,512C18.963,512,37.926,512,56.889,512C75.852,512,94.815,512,113.778,512C132.741,512,151.704,512,170.667,512C189.63,512,208.593,512,227.556,512C246.519,512,265.481,512,284.444,512C303.407,512,322.37,512,341.333,512C360.296,512,379.259,512,398.222,512C417.185,512,436.148,512,455.111,512C474.074,512,493.037,512,512,512L512,355.2C493.037,324.8,474.074,294.4,455.111,294.4C436.148,294.4,417.185,457.6,398.222,457.6C379.259,457.6,360.296,233.6,341.333,233.6C322.37,233.6,303.407,435.2,284.444,435.2C265.481,435.2,246.519,345.6,227.556,345.6C208.593,345.6,189.63,451.2,170.667,451.2C151.704,451.2,132.741,252.8,113.778,252.8C94.815,252.8,75.852,346.133,56.889,374.4C37.926,402.667,18.963,412.533,0,422.4Z\\" fill=\\"blue\\" fill-opacity=\\"1\\"></path></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0,0h0v0h0Z\\"></path><g><g class=\\"mark-area role-mark\\" role=\\"graphics-symbol\\" aria-roledescription=\\"area mark container\\"><path d=\\"M0,422.4C18.963,412.533,37.926,402.667,56.889,374.4C75.852,346.133,94.815,252.8,113.778,252.8C132.741,252.8,151.704,451.2,170.667,451.2C189.63,451.2,208.593,345.6,227.556,345.6C246.519,345.6,265.481,435.2,284.444,435.2C303.407,435.2,322.37,233.6,341.333,233.6C360.296,233.6,379.259,457.6,398.222,457.6C417.185,457.6,436.148,294.4,455.111,294.4C474.074,294.4,493.037,324.8,512,355.2L512,307.2C493.037,275.2,474.074,243.2,455.111,243.2C436.148,243.2,417.185,371.2,398.222,371.2C379.259,371.2,360.296,22.4,341.333,22.4C322.37,22.4,303.407,278.4,284.444,278.4C265.481,278.4,246.519,204.8,227.556,192C208.593,179.2,189.63,185.6,170.667,172.8C151.704,160,132.741,83.2,113.778,83.2C94.815,83.2,75.852,83.2,56.889,83.2C37.926,83.2,18.963,164.8,0,246.4Z\\" fill=\\"yellow\\" fill-opacity=\\"1\\"></path></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g></g></g></svg></div><div class=\\"vgaVis__controls vgaVis__controls--column\\"></div>"`; exports[`VegaVisualizations VegaVisualization - basics should show vegalite graph and update on resize (may fail in dev env) 1`] = `"<ul class=\\"vgaVis__messages\\"><li class=\\"vgaVis__message vgaVis__message--warn\\"><pre class=\\"vgaVis__messageCode\\">\\"width\\" and \\"height\\" params are ignored because \\"autosize\\" is enabled. Set \\"autosize\\": \\"none\\" to disable</pre></li></ul><div class=\\"vgaVis__view\\" role=\\"graphics-document\\" aria-roledescription=\\"visualization\\" aria-label=\\"Vega visualization\\" style=\\"cursor: default;\\"><svg xmlns=\\"http://www.w3.org/2000/svg\\" xmlns:xlink=\\"http://www.w3.org/1999/xlink\\" version=\\"1.1\\" class=\\"marks\\" width=\\"512\\" height=\\"512\\" viewBox=\\"0 0 512 512\\" style=\\"background-color: transparent;\\"><g fill=\\"none\\" stroke-miterlimit=\\"10\\" transform=\\"translate(7,5)\\"><g class=\\"mark-group role-frame root\\" role=\\"graphics-object\\" aria-roledescription=\\"group mark container\\"><g transform=\\"translate(0,0)\\"><path class=\\"background\\" aria-hidden=\\"true\\" d=\\"M0.5,0.5h498v500h-498Z\\" fill=\\"transparent\\" stroke=\\"#ddd\\"></path><g><g class=\\"mark-line role-mark marks\\" role=\\"graphics-object\\" aria-roledescription=\\"line mark container\\"><path aria-label=\\"key: Dec 11, 2017; doc_count: 0\\" role=\\"graphics-symbol\\" aria-roledescription=\\"line mark\\" d=\\"M0,500L55.333,500L110.667,500L166,45.5L221.333,33.3L276.667,34L332,486.7L387.333,500L442.667,500L498,500\\" stroke=\\"#54B399\\" stroke-width=\\"2\\"></path></g></g><path class=\\"foreground\\" aria-hidden=\\"true\\" d=\\"\\" display=\\"none\\"></path></g></g></g></svg></div><div class=\\"vgaVis__controls vgaVis__controls--column\\"></div>"`; diff --git a/src/plugins/vis_types/vega/public/plugin.ts b/src/plugins/vis_types/vega/public/plugin.ts index e3d92425281b..d36a547a9d6e 100644 --- a/src/plugins/vis_types/vega/public/plugin.ts +++ b/src/plugins/vis_types/vega/public/plugin.ts @@ -16,6 +16,7 @@ import { Setup as InspectorSetup } from '@kbn/inspector-plugin/public'; import type { MapsEmsPluginPublicStart } from '@kbn/maps-ems-plugin/public'; import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; +import { KbnPalette, getKbnPalettes } from '@kbn/palettes'; import { setNotifications, setData, @@ -98,6 +99,17 @@ export class VegaPlugin implements Plugin<void, void> { core: CoreStart, { data, mapsEms, dataViews, usageCollection }: VegaPluginStartDependencies ) { + core.theme.theme$ + .subscribe({ + async next(theme) { + const { scheme } = await import('vega'); + + const palettes = getKbnPalettes(theme); + scheme('elastic', palettes.get(KbnPalette.Default).colors()); + }, + }) + .unsubscribe(); + setNotifications(core.notifications); setData(data); setDataViews(dataViews); diff --git a/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js index d517e593e222..89c2fbe8848c 100644 --- a/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js +++ b/src/plugins/vis_types/vega/public/vega_view/vega_base_view.js @@ -9,11 +9,10 @@ import moment from 'moment'; import dateMath from '@kbn/datemath'; -import { scheme, loader, logger, Warn, version as vegaVersion, expressionFunction } from 'vega'; +import { loader, logger, Warn, version as vegaVersion, expressionFunction } from 'vega'; import { expressionInterpreter } from 'vega-interpreter'; import { version as vegaLiteVersion } from 'vega-lite'; import { Utils } from '../data_model/utils'; -import { euiPaletteColorBlind } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { buildQueryFilter, compareFilters } from '@kbn/es-query'; import { TooltipHandler } from './vega_tooltip'; @@ -22,8 +21,6 @@ import { getEnableExternalUrls, getDataViews } from '../services'; import { extractIndexPatternsFromSpec } from '../lib/extract_index_pattern'; import { normalizeDate, normalizeString, normalizeObject } from './utils'; -scheme('elastic', euiPaletteColorBlind()); - // Vega's extension functions are global. When called, // we forward execution to the instance-specific handler // This functions must be declared in the VegaBaseView class diff --git a/src/plugins/vis_types/vega/public/vega_visualization.test.tsx b/src/plugins/vis_types/vega/public/vega_visualization.test.tsx index ab51db562f4f..bd1e8d1b12b3 100644 --- a/src/plugins/vis_types/vega/public/vega_visualization.test.tsx +++ b/src/plugins/vis_types/vega/public/vega_visualization.test.tsx @@ -25,6 +25,7 @@ import { dataViewPluginMocks } from '@kbn/data-views-plugin/public/mocks'; import { VegaVisualizationDependencies } from './plugin'; import React from 'react'; import { TimeCache } from './data_model/time_cache'; +import { scheme } from 'vega'; jest.mock('./default_spec', () => ({ getDefaultSpec: () => jest.requireActual('./test_utils/default.spec.json'), @@ -122,6 +123,7 @@ describe('VegaVisualizations', () => { test('should show vega graph (may fail in dev env)', async () => { let vegaVis; try { + scheme('elastic', ['blue', 'yellow']); vegaVis = new VegaVisualization(domNode, jest.fn()); const vegaParser = new VegaParser( JSON.stringify(vegaGraph), diff --git a/src/plugins/vis_types/vega/tsconfig.json b/src/plugins/vis_types/vega/tsconfig.json index 172dd4c60fea..3c980d413b1c 100644 --- a/src/plugins/vis_types/vega/tsconfig.json +++ b/src/plugins/vis_types/vega/tsconfig.json @@ -41,6 +41,7 @@ "@kbn/code-editor", "@kbn/react-kibana-context-render", "@kbn/search-types", + "@kbn/palettes", ], "exclude": [ "target/**/*", diff --git a/src/plugins/vis_types/vislib/public/plugin.ts b/src/plugins/vis_types/vislib/public/plugin.ts index 47ba0306b539..5a9419e1721e 100644 --- a/src/plugins/vis_types/vislib/public/plugin.ts +++ b/src/plugins/vis_types/vislib/public/plugin.ts @@ -18,11 +18,15 @@ import type { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; import { LEGACY_HEATMAP_CHARTS_LIBRARY } from '@kbn/vis-type-heatmap-plugin/common'; import { LEGACY_GAUGE_CHARTS_LIBRARY } from '@kbn/vis-type-gauge-plugin/common'; import type { VislibPublicConfig } from '../server/config'; -import { setAnalytics, setI18n, setUsageCollectionStart } from './services'; +import { + setFormatService, + setDataActions, + setCoreStart, + setUsageCollectionStart, +} from './services'; import { heatmapVisTypeDefinition } from './heatmap'; import { createVisTypeVislibVisFn } from './vis_type_vislib_vis_fn'; -import { setFormatService, setDataActions, setTheme } from './services'; import { getVislibVisRenderer } from './vis_renderer'; import { gaugeVisTypeDefinition } from './gauge'; import { goalVisTypeDefinition } from './goal'; @@ -87,11 +91,9 @@ export class VisTypeVislibPlugin core: CoreStart, { data, usageCollection, fieldFormats }: VisTypeVislibPluginStartDependencies ) { + setCoreStart(core); setFormatService(fieldFormats); setDataActions(data.actions); - setAnalytics(core.analytics); - setI18n(core.i18n); - setTheme(core.theme); if (usageCollection) { setUsageCollectionStart(usageCollection); } diff --git a/src/plugins/vis_types/vislib/public/services.ts b/src/plugins/vis_types/vislib/public/services.ts index 4193af3329fc..37c971236de3 100644 --- a/src/plugins/vis_types/vislib/public/services.ts +++ b/src/plugins/vis_types/vislib/public/services.ts @@ -7,22 +7,19 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { AnalyticsServiceStart, I18nStart, ThemeServiceStart } from '@kbn/core/public'; +import { CoreStart } from '@kbn/core/public'; import { createGetterSetter } from '@kbn/kibana-utils-plugin/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; import { UsageCollectionStart } from '@kbn/usage-collection-plugin/public'; +export const [getCoreStart, setCoreStart] = createGetterSetter<CoreStart>('CoreStart'); + export const [getDataActions, setDataActions] = createGetterSetter<DataPublicPluginStart['actions']>('vislib data.actions'); export const [getFormatService, setFormatService] = createGetterSetter<FieldFormatsStart>('FieldFormats'); -export const [getAnalytics, setAnalytics] = - createGetterSetter<AnalyticsServiceStart>('vislib theme service'); -export const [getI18n, setI18n] = createGetterSetter<I18nStart>('vislib theme service'); -export const [getTheme, setTheme] = createGetterSetter<ThemeServiceStart>('vislib theme service'); - export const [getUsageCollectionStart, setUsageCollectionStart] = createGetterSetter<UsageCollectionStart>('UsageCollection', false); diff --git a/src/plugins/vis_types/vislib/public/vis_controller.tsx b/src/plugins/vis_types/vislib/public/vis_controller.tsx index 89a7a4125d3c..380d61713c25 100644 --- a/src/plugins/vis_types/vislib/public/vis_controller.tsx +++ b/src/plugins/vis_types/vislib/public/vis_controller.tsx @@ -136,7 +136,7 @@ export const createVislibVisController = ( } mountLegend( - startServices: Pick<CoreStart, 'analytics' | 'i18n' | 'theme'>, + startServices: Pick<CoreStart, 'analytics' | 'i18n' | 'theme' | 'userProfile'>, visData: unknown, visParams: BasicVislibParams, fireEvent: IInterpreterRenderHandlers['event'], diff --git a/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx b/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx index 0ceca90442e2..f71f192907e4 100644 --- a/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx +++ b/src/plugins/vis_types/vislib/public/vislib/partials/touchdown_template.tsx @@ -11,7 +11,7 @@ import React from 'react'; import ReactDOM from 'react-dom/server'; import { EuiIcon } from '@elastic/eui'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; -import { getAnalytics, getI18n, getTheme } from '../../services'; +import { getCoreStart } from '../../services'; interface Props { wholeBucket: boolean; @@ -19,7 +19,7 @@ interface Props { export const touchdownTemplate = ({ wholeBucket }: Props) => { return ReactDOM.renderToStaticMarkup( - <KibanaRenderContextProvider analytics={getAnalytics()} i18n={getI18n()} theme={getTheme()}> + <KibanaRenderContextProvider {...getCoreStart()}> <p className="visTooltip__header"> <EuiIcon type="iInCircle" className="visTooltip__headerIcon" /> <span className="visTooltip__headerText"> diff --git a/src/plugins/visualizations/public/actions/edit_in_lens_action.tsx b/src/plugins/visualizations/public/actions/edit_in_lens_action.tsx index 8995b2abf738..f8ed7a6294db 100644 --- a/src/plugins/visualizations/public/actions/edit_in_lens_action.tsx +++ b/src/plugins/visualizations/public/actions/edit_in_lens_action.tsx @@ -26,7 +26,10 @@ import { import { Action } from '@kbn/ui-actions-plugin/public'; import React from 'react'; import { take } from 'rxjs'; -import { apiHasVisualizeConfig, HasVisualizeConfig } from '../legacy/embeddable'; +import { + apiHasVisualizeConfig, + type HasVisualizeConfig, +} from '../embeddable/interfaces/has_visualize_config'; import { apiHasExpressionVariables, HasExpressionVariables, diff --git a/src/plugins/visualizations/public/embeddable/save_to_library.ts b/src/plugins/visualizations/public/embeddable/save_to_library.ts index ae92252565aa..416eda1f277a 100644 --- a/src/plugins/visualizations/public/embeddable/save_to_library.ts +++ b/src/plugins/visualizations/public/embeddable/save_to_library.ts @@ -9,7 +9,7 @@ import { Reference } from '../../common/content_management'; import { PersistedState } from '../persisted_state'; -import { getAnalytics, getI18n, getOverlays, getTheme } from '../services'; +import { getAnalytics, getI18n, getOverlays, getTheme, getUserProfile } from '../services'; import { saveVisualization } from '../utils/saved_visualize_utils'; import { VisualizeOutputState } from './types'; @@ -63,6 +63,7 @@ export const saveToLibrary = async ({ i18n: getI18n(), overlays: getOverlays(), theme: getTheme(), + userProfile: getUserProfile(), }, references ?? [] ); diff --git a/src/plugins/visualizations/public/embeddable/state.ts b/src/plugins/visualizations/public/embeddable/state.ts index 52641703e04b..79a3bc841a99 100644 --- a/src/plugins/visualizations/public/embeddable/state.ts +++ b/src/plugins/visualizations/public/embeddable/state.ts @@ -22,6 +22,7 @@ import { getSearch, getSpaces, getTheme, + getUserProfile, } from '../services'; import { deserializeReferences, @@ -137,6 +138,7 @@ export const deserializeSavedObjectState = async ({ overlays: getOverlays(), analytics: getAnalytics(), theme: getTheme(), + userProfile: getUserProfile(), }, savedObjectId ); diff --git a/src/plugins/visualizations/public/embeddable/types.ts b/src/plugins/visualizations/public/embeddable/types.ts index 80e7e2d9179e..767f911d5bd5 100644 --- a/src/plugins/visualizations/public/embeddable/types.ts +++ b/src/plugins/visualizations/public/embeddable/types.ts @@ -23,7 +23,7 @@ import { SerializedTitles, } from '@kbn/presentation-publishing'; import { DeepPartial } from '@kbn/utility-types'; -import { HasVisualizeConfig } from '../legacy/embeddable'; +import type { HasVisualizeConfig } from './interfaces/has_visualize_config'; import type { Vis, VisParams, VisSavedObject } from '../types'; import type { SerializedVis } from '../vis'; diff --git a/src/plugins/visualizations/public/index.ts b/src/plugins/visualizations/public/index.ts index 3de1bfc01f2e..54b37b0a237e 100644 --- a/src/plugins/visualizations/public/index.ts +++ b/src/plugins/visualizations/public/index.ts @@ -19,7 +19,8 @@ export function plugin(initializerContext: PluginInitializerContext) { /** @public static code */ export { TypesService } from './vis_types/types_service'; export { VIS_EVENT_TO_TRIGGER } from './embeddable'; -export { apiHasVisualizeConfig, COMMON_VISUALIZATION_GROUPING } from './legacy/embeddable'; +export { apiHasVisualizeConfig } from './embeddable/interfaces/has_visualize_config'; +export { COMMON_VISUALIZATION_GROUPING } from './legacy/embeddable/constants'; export { VisualizationContainer } from './components'; export { getVisSchemas } from './vis_schemas'; @@ -41,7 +42,8 @@ export type VisualizeEmbeddableFactoryContract = PublicContract<VisualizeEmbedda export type VisualizeEmbeddableContract = PublicContract<VisualizeEmbeddable>; export type { SchemaConfig } from '../common/types'; export { updateOldState } from './legacy/vis_update_state'; -export type { VisualizeInput, VisualizeEmbeddable, HasVisualizeConfig } from './legacy/embeddable'; +export type { VisualizeInput, VisualizeEmbeddable } from './legacy/embeddable'; +export type { HasVisualizeConfig } from './embeddable/interfaces/has_visualize_config'; export type { PersistedState } from './persisted_state'; export type { ISavedVis, diff --git a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx b/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx similarity index 90% rename from src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx rename to src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx index 05aa8a3d0059..49703371ac78 100644 --- a/src/plugins/embeddable/public/lib/attribute_service/attribute_service.tsx +++ b/src/plugins/visualizations/public/legacy/embeddable/attribute_service.tsx @@ -10,7 +10,6 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { get, omit } from 'lodash'; -import { NotificationsStart } from '@kbn/core/public'; import { SavedObjectSaveModal, OnSaveProps, @@ -21,8 +20,8 @@ import { EmbeddableInput, SavedObjectEmbeddableInput, isSavedObjectEmbeddableInput, - EmbeddableFactory, -} from '..'; +} from '@kbn/embeddable-plugin/public'; +import { getNotifications } from '../../services'; /** * The attribute service is a shared, generic service that embeddables can use to provide the functionality @@ -64,20 +63,10 @@ export class AttributeService< RefType extends SavedObjectEmbeddableInput = SavedObjectEmbeddableInput, MetaInfo extends unknown = unknown > { - private embeddableFactory; - constructor( private type: string, - private toasts: NotificationsStart['toasts'], - private options: AttributeServiceOptions<SavedObjectAttributes, MetaInfo>, - getEmbeddableFactory?: (embeddableFactoryId: string) => EmbeddableFactory - ) { - if (getEmbeddableFactory) { - const factory = getEmbeddableFactory(this.type); - - this.embeddableFactory = factory; - } - } + private options: AttributeServiceOptions<SavedObjectAttributes, MetaInfo> + ) {} private async defaultUnwrapMethod( input: RefType @@ -116,8 +105,8 @@ export class AttributeService< } return { ...originalInput } as RefType; } catch (error) { - this.toasts.addDanger({ - title: i18n.translate('embeddableApi.attributeService.saveToLibraryError', { + getNotifications().toasts.addDanger({ + title: i18n.translate('visualizations.attributeService.saveToLibraryError', { defaultMessage: `An error occurred while saving. Error: {errorMessage}`, values: { errorMessage: error.message, @@ -187,9 +176,7 @@ export class AttributeService< (input as ValType)[ATTRIBUTE_SERVICE_KEY].title )} showCopyOnSave={false} - objectType={ - this.embeddableFactory ? this.embeddableFactory.getDisplayName() : this.type - } + objectType={this.type} showDescription={false} /> ); diff --git a/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts b/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts index 69ed12302f4e..b684bd83402c 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts +++ b/src/plugins/visualizations/public/legacy/embeddable/create_vis_embeddable_from_object.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import { IContainer, ErrorEmbeddable, AttributeService } from '@kbn/embeddable-plugin/public'; +import { IContainer, ErrorEmbeddable } from '@kbn/embeddable-plugin/public'; import type { DataView } from '@kbn/data-views-plugin/public'; import { Vis } from '../../types'; import type { @@ -21,6 +21,7 @@ import { getHttp, getTimeFilter, getCapabilities } from '../../services'; import { urlFor } from '../../utils/saved_visualize_utils'; import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; import { createVisualizeEmbeddableAsync } from './visualize_embeddable_async'; +import { AttributeService } from './attribute_service'; /** @deprecated * VisualizeEmbeddable is no longer registered with the legacy embeddable system and is only diff --git a/src/plugins/visualizations/public/legacy/embeddable/index.ts b/src/plugins/visualizations/public/legacy/embeddable/index.ts index 6afee494e6f4..979a631f8c66 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/index.ts +++ b/src/plugins/visualizations/public/legacy/embeddable/index.ts @@ -12,7 +12,3 @@ export { VISUALIZE_EMBEDDABLE_TYPE, COMMON_VISUALIZATION_GROUPING } from './cons export { createVisEmbeddableFromObject } from './create_vis_embeddable_from_object'; export type { VisualizeEmbeddable, VisualizeInput } from './visualize_embeddable'; -export { - type HasVisualizeConfig, - apiHasVisualizeConfig, -} from '../../embeddable/interfaces/has_visualize_config'; diff --git a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx index 196753d73b28..bfd87435345e 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable.tsx @@ -23,7 +23,6 @@ import { Warnings } from '@kbn/charts-plugin/public'; import { hasUnsupportedDownsampledAggregationFailure } from '@kbn/search-response-warnings'; import { Adapters, - AttributeService, Embeddable, EmbeddableInput, EmbeddableOutput, @@ -53,6 +52,7 @@ import { VisualizeEmbeddableFactoryDeps } from './visualize_embeddable_factory'; import { getSavedVisualization } from '../../utils/saved_visualize_utils'; import { VisSavedObject } from '../../types'; import { toExpressionAst } from '../../embeddable/to_ast'; +import { AttributeService } from './attribute_service'; export interface VisualizeEmbeddableConfiguration { vis: Vis; diff --git a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx index 7594c8d42f2e..112a8d3b7fd8 100644 --- a/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx +++ b/src/plugins/visualizations/public/legacy/embeddable/visualize_embeddable_factory.tsx @@ -25,9 +25,9 @@ import { EmbeddableOutput, ErrorEmbeddable, IContainer, - AttributeService, } from '@kbn/embeddable-plugin/public'; import type { StartServicesGetter } from '@kbn/kibana-utils-plugin/public'; +import { AttributeService } from './attribute_service'; import { checkForDuplicateTitle } from '../../utils/saved_objects_utils/check_for_duplicate_title'; import type { VisualizeByReferenceInput, @@ -138,16 +138,10 @@ export class VisualizeEmbeddableFactory private async getAttributeService() { if (!this.attributeService) { - this.attributeService = this.deps - .start() - .plugins.embeddable.getAttributeService< - VisualizeSavedObjectAttributes, - VisualizeByValueInput, - VisualizeByReferenceInput - >(this.type, { - saveMethod: this.saveMethod.bind(this), - checkForDuplicateTitle: this.checkTitle.bind(this), - }); + this.attributeService = new AttributeService(this.type, { + saveMethod: this.saveMethod.bind(this), + checkForDuplicateTitle: this.checkTitle.bind(this), + }); } return this.attributeService!; } diff --git a/src/plugins/visualizations/public/plugin.ts b/src/plugins/visualizations/public/plugin.ts index 856c16104b6c..0dcbf78c399d 100644 --- a/src/plugins/visualizations/public/plugin.ts +++ b/src/plugins/visualizations/public/plugin.ts @@ -105,6 +105,7 @@ import { setAnalytics, setI18n, setTheme, + setUserProfile, setExecutionContext, setFieldFormats, setSavedObjectTagging, @@ -115,6 +116,7 @@ import { setDataViews, setInspector, getTypes, + setNotifications, } from './services'; import { VisualizeConstants, VISUALIZE_EMBEDDABLE_TYPE } from '../common/constants'; import { EditInLensAction } from './actions/edit_in_lens_action'; @@ -464,6 +466,7 @@ export class VisualizationsPlugin const types = this.types.start(); setTypes(types); setI18n(core.i18n); + setUserProfile(core.userProfile); setEmbeddable(embeddable); setApplication(core.application); setCapabilities(core.application.capabilities); @@ -485,6 +488,7 @@ export class VisualizationsPlugin setSavedSearch(savedSearch); setDataViews(dataViews); setInspector(inspector); + setNotifications(core.notifications); if (spaces) { setSpaces(spaces); diff --git a/src/plugins/visualizations/public/services.ts b/src/plugins/visualizations/public/services.ts index 3b383abe52a3..b517082b8a2b 100644 --- a/src/plugins/visualizations/public/services.ts +++ b/src/plugins/visualizations/public/services.ts @@ -21,6 +21,8 @@ import type { ExecutionContextSetup, AnalyticsServiceStart, I18nStart, + NotificationsStart, + UserProfileService, } from '@kbn/core/public'; import type { DataPublicPluginStart, TimefilterContract } from '@kbn/data-plugin/public'; import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; @@ -42,9 +44,14 @@ export const [getUISettings, setUISettings] = createGetterSetter<IUiSettingsClie export const [getAnalytics, setAnalytics] = createGetterSetter<AnalyticsServiceStart>('Analytics'); export const [getI18n, setI18n] = createGetterSetter<I18nStart>('I18n'); export const [getTheme, setTheme] = createGetterSetter<ThemeServiceStart>('Theme'); +export const [getNotifications, setNotifications] = + createGetterSetter<NotificationsStart>('Notifications'); export const [getCapabilities, setCapabilities] = createGetterSetter<Capabilities>('Capabilities'); +export const [getUserProfile, setUserProfile] = + createGetterSetter<UserProfileService>('UserProfile'); + export const [getHttp, setHttp] = createGetterSetter<HttpStart>('Http'); export const [getFieldsFormats, setFieldFormats] = diff --git a/src/plugins/visualizations/public/types.ts b/src/plugins/visualizations/public/types.ts index 2ccb5c648f79..5ff4d462426f 100644 --- a/src/plugins/visualizations/public/types.ts +++ b/src/plugins/visualizations/public/types.ts @@ -34,6 +34,7 @@ export type StartServices = Pick< | 'analytics' | 'i18n' | 'theme' + | 'userProfile' >; export type { Vis, SerializedVis, VisParams }; diff --git a/src/plugins/visualizations/public/visualize_app/utils/get_visualization_instance.ts b/src/plugins/visualizations/public/visualize_app/utils/get_visualization_instance.ts index 3a3898093a8e..df7c7b5dda52 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/get_visualization_instance.ts +++ b/src/plugins/visualizations/public/visualize_app/utils/get_visualization_instance.ts @@ -16,7 +16,7 @@ import { createVisAsync } from '../../vis_async'; import { convertToSerializedVis, getSavedVisualization } from '../../utils/saved_visualize_utils'; import { SerializedVis, Vis, VisSavedObject, VisualizeEmbeddableContract } from '../..'; import type { VisInstance, VisualizeServices } from '../types'; -import { VisualizeInput } from '../../legacy/embeddable'; +import type { VisualizeInput } from '../../legacy/embeddable'; function isErrorRelatedToRuntimeFields(error: ExpressionValueError['error']) { const originalError = error.original || error; diff --git a/src/plugins/visualizations/public/visualize_app/utils/utils.ts b/src/plugins/visualizations/public/visualize_app/utils/utils.ts index b12c24928437..0af00b444f1d 100644 --- a/src/plugins/visualizations/public/visualize_app/utils/utils.ts +++ b/src/plugins/visualizations/public/visualize_app/utils/utils.ts @@ -70,9 +70,7 @@ export const redirectToSavedObjectPage = ( savedVisualizationsId?: string ) => { const { - history, setActiveUrl, - toastNotifications, http: { basePath }, application: { navigateToApp }, } = services; @@ -81,9 +79,7 @@ export const redirectToSavedObjectPage = ( path: `kibana/objects/savedVisualizations/${savedVisualizationsId}`, }; redirectWhenMissing({ - history, navigateToApp, - toastNotifications, basePath, mapping: { visualization: VisualizeConstants.LANDING_PAGE_PATH, @@ -94,7 +90,7 @@ export const redirectToSavedObjectPage = ( onBeforeRedirect() { setActiveUrl(VisualizeConstants.LANDING_PAGE_PATH); }, - theme: services.theme, + ...services, })(error); }; diff --git a/src/plugins/visualizations/public/wizard/show_new_vis.tsx b/src/plugins/visualizations/public/wizard/show_new_vis.tsx index 64fe4cb07b9f..251101519ea5 100644 --- a/src/plugins/visualizations/public/wizard/show_new_vis.tsx +++ b/src/plugins/visualizations/public/wizard/show_new_vis.tsx @@ -21,6 +21,7 @@ import { getTheme, getContentManagement, getUISettings, + getUserProfile, } from '../services'; import type { BaseVisType } from '../vis_types'; @@ -94,7 +95,7 @@ export function showNewVisModal({ </Suspense> ); }), - { analytics: getAnalytics(), i18n: getI18n(), theme: getTheme() } + { analytics: getAnalytics(), i18n: getI18n(), theme: getTheme(), userProfile: getUserProfile() } ); unmount = mount(container); diff --git a/test/functional/apps/dashboard/group6/dashboard_esql_no_data.ts b/test/functional/apps/dashboard/group6/dashboard_esql_no_data.ts index 4298ccdfb588..58fe8aa36d95 100644 --- a/test/functional/apps/dashboard/group6/dashboard_esql_no_data.ts +++ b/test/functional/apps/dashboard/group6/dashboard_esql_no_data.ts @@ -15,7 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const panelActions = getService('dashboardPanelActions'); const monacoEditor = getService('monacoEditor'); - const PageObjects = getPageObjects(['dashboard']); + const PageObjects = getPageObjects(['common', 'dashboard']); describe('No Data Views: Try ES|QL', () => { before(async () => { @@ -26,7 +26,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.dashboard.navigateToApp(); await testSubjects.existOrFail('noDataViewsPrompt'); + await testSubjects.click('tryESQLLink'); + await PageObjects.dashboard.waitForRenderComplete(); await PageObjects.dashboard.expectOnDashboard('New Dashboard'); expect(await testSubjects.exists('lnsVisualizationContainer')).to.be(true); diff --git a/test/functional/apps/dashboard/group6/view_edit.ts b/test/functional/apps/dashboard/group6/view_edit.ts index 9304b51d302d..220611742d51 100644 --- a/test/functional/apps/dashboard/group6/view_edit.ts +++ b/test/functional/apps/dashboard/group6/view_edit.ts @@ -22,6 +22,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'timePicker', ]); const dashboardName = 'dashboard with filter'; + const copyOfDashboardName = `Copy of ${dashboardName}`; const filterBar = getService('filterBar'); const security = getService('security'); @@ -73,7 +74,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('save as new', () => { it('keeps duplicated dashboard in edit mode', async () => { await dashboard.gotoDashboardEditMode(dashboardName); - await dashboard.duplicateDashboard('edit'); + await dashboard.duplicateDashboard(copyOfDashboardName); const isViewMode = await dashboard.getIsInViewMode(); expect(isViewMode).to.equal(false); }); @@ -81,8 +82,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('save', function () { it('keeps dashboard in edit mode', async function () { - await dashboard.gotoDashboardEditMode(dashboardName); - await dashboard.saveDashboard(dashboardName, { + await dashboard.gotoDashboardEditMode(copyOfDashboardName); + // change dashboard time to cause unsaved change + await timePicker.setAbsoluteRange( + 'Sep 19, 2013 @ 00:00:00.000', + 'Sep 19, 2013 @ 07:00:00.000' + ); + await dashboard.saveDashboard(copyOfDashboardName, { storeTimeWithDashboard: true, saveAsNew: false, }); diff --git a/test/functional/apps/discover/esql/_esql_columns.ts b/test/functional/apps/discover/esql/_esql_columns.ts index 59c4b8b81666..3ee6c9e4a3f5 100644 --- a/test/functional/apps/discover/esql/_esql_columns.ts +++ b/test/functional/apps/discover/esql/_esql_columns.ts @@ -181,14 +181,16 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); it('should reset columns if available fields or index pattern are different in transformational query', async () => { - await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp'); + await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp | limit 500'); await testSubjects.click('querySubmitButton'); await header.waitUntilLoadingHasFinished(); await discover.waitUntilSearchingHasFinished(); expect(await dataGrid.getHeaderFields()).to.eql(['ip', '@timestamp']); // reset columns if available fields are different - await monacoEditor.setCodeEditorValue('from logstash-* | keep ip, @timestamp, bytes'); + await monacoEditor.setCodeEditorValue( + 'from logstash-* | keep ip, @timestamp, bytes | limit 500' + ); await testSubjects.click('querySubmitButton'); await header.waitUntilLoadingHasFinished(); await discover.waitUntilSearchingHasFinished(); diff --git a/test/functional/apps/management/data_views/_field_formatter.ts b/test/functional/apps/management/data_views/_field_formatter.ts index bd88d96f9700..94f0b671490f 100644 --- a/test/functional/apps/management/data_views/_field_formatter.ts +++ b/test/functional/apps/management/data_views/_field_formatter.ts @@ -315,6 +315,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { // check available formats for ES_FIELD_TYPES.BOOLEAN expectFormatterTypes: [ FIELD_FORMAT_IDS.BOOLEAN, + FIELD_FORMAT_IDS.COLOR, FIELD_FORMAT_IDS.STATIC_LOOKUP, FIELD_FORMAT_IDS.STRING, FIELD_FORMAT_IDS.URL, diff --git a/tsconfig.base.json b/tsconfig.base.json index bc77936f8d3b..d9531670631f 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -18,8 +18,8 @@ "@kbn/ai-assistant/*": ["x-pack/packages/kbn-ai-assistant/*"], "@kbn/ai-assistant-common": ["x-pack/packages/kbn-ai-assistant-common"], "@kbn/ai-assistant-common/*": ["x-pack/packages/kbn-ai-assistant-common/*"], - "@kbn/ai-assistant-management-plugin": ["src/plugins/ai_assistant_management/selection"], - "@kbn/ai-assistant-management-plugin/*": ["src/plugins/ai_assistant_management/selection/*"], + "@kbn/ai-assistant-management-plugin": ["src/platform/plugins/shared/ai_assistant_management/selection"], + "@kbn/ai-assistant-management-plugin/*": ["src/platform/plugins/shared/ai_assistant_management/selection/*"], "@kbn/aiops-change-point-detection": ["x-pack/platform/packages/private/ml/aiops_change_point_detection"], "@kbn/aiops-change-point-detection/*": ["x-pack/platform/packages/private/ml/aiops_change_point_detection/*"], "@kbn/aiops-common": ["x-pack/platform/packages/shared/ml/aiops_common"], @@ -700,8 +700,8 @@ "@kbn/dashboard-enhanced-plugin/*": ["x-pack/plugins/dashboard_enhanced/*"], "@kbn/dashboard-plugin": ["src/plugins/dashboard"], "@kbn/dashboard-plugin/*": ["src/plugins/dashboard/*"], - "@kbn/data-forge": ["x-pack/packages/kbn-data-forge"], - "@kbn/data-forge/*": ["x-pack/packages/kbn-data-forge/*"], + "@kbn/data-forge": ["x-pack/platform/packages/shared/kbn-data-forge"], + "@kbn/data-forge/*": ["x-pack/platform/packages/shared/kbn-data-forge/*"], "@kbn/data-plugin": ["src/plugins/data"], "@kbn/data-plugin/*": ["src/plugins/data/*"], "@kbn/data-quality-plugin": ["x-pack/plugins/data_quality"], @@ -710,10 +710,10 @@ "@kbn/data-search-plugin/*": ["test/plugin_functional/plugins/data_search/*"], "@kbn/data-service": ["packages/kbn-data-service"], "@kbn/data-service/*": ["packages/kbn-data-service/*"], - "@kbn/data-stream-adapter": ["packages/kbn-data-stream-adapter"], - "@kbn/data-stream-adapter/*": ["packages/kbn-data-stream-adapter/*"], - "@kbn/data-usage-plugin": ["x-pack/plugins/data_usage"], - "@kbn/data-usage-plugin/*": ["x-pack/plugins/data_usage/*"], + "@kbn/data-stream-adapter": ["x-pack/solutions/security/packages/data-stream-adapter"], + "@kbn/data-stream-adapter/*": ["x-pack/solutions/security/packages/data-stream-adapter/*"], + "@kbn/data-usage-plugin": ["x-pack/platform/plugins/private/data_usage"], + "@kbn/data-usage-plugin/*": ["x-pack/platform/plugins/private/data_usage/*"], "@kbn/data-view-editor-plugin": ["src/plugins/data_view_editor"], "@kbn/data-view-editor-plugin/*": ["src/plugins/data_view_editor/*"], "@kbn/data-view-field-editor-example-plugin": ["examples/data_view_field_editor_example"], @@ -742,8 +742,8 @@ "@kbn/deeplinks-management/*": ["packages/deeplinks/management/*"], "@kbn/deeplinks-ml": ["src/platform/packages/shared/deeplinks/ml"], "@kbn/deeplinks-ml/*": ["src/platform/packages/shared/deeplinks/ml/*"], - "@kbn/deeplinks-observability": ["packages/deeplinks/observability"], - "@kbn/deeplinks-observability/*": ["packages/deeplinks/observability/*"], + "@kbn/deeplinks-observability": ["src/platform/packages/shared/deeplinks/observability"], + "@kbn/deeplinks-observability/*": ["src/platform/packages/shared/deeplinks/observability/*"], "@kbn/deeplinks-search": ["packages/deeplinks/search"], "@kbn/deeplinks-search/*": ["packages/deeplinks/search/*"], "@kbn/deeplinks-security": ["packages/deeplinks/security"], @@ -794,8 +794,8 @@ "@kbn/dom-drag-drop/*": ["packages/kbn-dom-drag-drop/*"], "@kbn/ebt-tools": ["packages/kbn-ebt-tools"], "@kbn/ebt-tools/*": ["packages/kbn-ebt-tools/*"], - "@kbn/ecs-data-quality-dashboard": ["x-pack/packages/security-solution/ecs_data_quality_dashboard"], - "@kbn/ecs-data-quality-dashboard/*": ["x-pack/packages/security-solution/ecs_data_quality_dashboard/*"], + "@kbn/ecs-data-quality-dashboard": ["x-pack/solutions/security/packages/ecs_data_quality_dashboard"], + "@kbn/ecs-data-quality-dashboard/*": ["x-pack/solutions/security/packages/ecs_data_quality_dashboard/*"], "@kbn/ecs-data-quality-dashboard-plugin": ["x-pack/plugins/ecs_data_quality_dashboard"], "@kbn/ecs-data-quality-dashboard-plugin/*": ["x-pack/plugins/ecs_data_quality_dashboard/*"], "@kbn/elastic-agent-utils": ["packages/kbn-elastic-agent-utils"], @@ -892,14 +892,14 @@ "@kbn/event-log-fixture-plugin/*": ["x-pack/test/plugin_api_integration/plugins/event_log/*"], "@kbn/event-log-plugin": ["x-pack/plugins/event_log"], "@kbn/event-log-plugin/*": ["x-pack/plugins/event_log/*"], - "@kbn/expandable-flyout": ["packages/kbn-expandable-flyout"], - "@kbn/expandable-flyout/*": ["packages/kbn-expandable-flyout/*"], + "@kbn/expandable-flyout": ["x-pack/solutions/security/packages/expandable-flyout"], + "@kbn/expandable-flyout/*": ["x-pack/solutions/security/packages/expandable-flyout/*"], "@kbn/expect": ["packages/kbn-expect"], "@kbn/expect/*": ["packages/kbn-expect/*"], "@kbn/exploratory-view-example-plugin": ["x-pack/examples/exploratory_view_example"], "@kbn/exploratory-view-example-plugin/*": ["x-pack/examples/exploratory_view_example/*"], - "@kbn/exploratory-view-plugin": ["x-pack/plugins/observability_solution/exploratory_view"], - "@kbn/exploratory-view-plugin/*": ["x-pack/plugins/observability_solution/exploratory_view/*"], + "@kbn/exploratory-view-plugin": ["x-pack/solutions/observability/plugins/exploratory_view"], + "@kbn/exploratory-view-plugin/*": ["x-pack/solutions/observability/plugins/exploratory_view/*"], "@kbn/expression-error-plugin": ["src/plugins/expression_error"], "@kbn/expression-error-plugin/*": ["src/plugins/expression_error/*"], "@kbn/expression-gauge-plugin": ["src/plugins/chart_expressions/expression_gauge"], @@ -1048,8 +1048,8 @@ "@kbn/import-locator/*": ["packages/kbn-import-locator/*"], "@kbn/import-resolver": ["packages/kbn-import-resolver"], "@kbn/import-resolver/*": ["packages/kbn-import-resolver/*"], - "@kbn/index-adapter": ["packages/kbn-index-adapter"], - "@kbn/index-adapter/*": ["packages/kbn-index-adapter/*"], + "@kbn/index-adapter": ["x-pack/solutions/security/packages/index-adapter"], + "@kbn/index-adapter/*": ["x-pack/solutions/security/packages/index-adapter/*"], "@kbn/index-lifecycle-management-common-shared": ["x-pack/packages/index-lifecycle-management/index_lifecycle_management_common_shared"], "@kbn/index-lifecycle-management-common-shared/*": ["x-pack/packages/index-lifecycle-management/index_lifecycle_management_common_shared/*"], "@kbn/index-lifecycle-management-plugin": ["x-pack/plugins/index_lifecycle_management"], @@ -1066,8 +1066,8 @@ "@kbn/inference-common/*": ["x-pack/platform/packages/shared/ai-infra/inference-common/*"], "@kbn/inference-plugin": ["x-pack/platform/plugins/shared/inference"], "@kbn/inference-plugin/*": ["x-pack/platform/plugins/shared/inference/*"], - "@kbn/infra-forge": ["x-pack/packages/kbn-infra-forge"], - "@kbn/infra-forge/*": ["x-pack/packages/kbn-infra-forge/*"], + "@kbn/infra-forge": ["x-pack/platform/packages/private/kbn-infra-forge"], + "@kbn/infra-forge/*": ["x-pack/platform/packages/private/kbn-infra-forge/*"], "@kbn/infra-plugin": ["x-pack/plugins/observability_solution/infra"], "@kbn/infra-plugin/*": ["x-pack/plugins/observability_solution/infra/*"], "@kbn/ingest-pipelines-plugin": ["x-pack/plugins/ingest_pipelines"], @@ -1088,12 +1088,12 @@ "@kbn/inventory-e2e/*": ["x-pack/plugins/observability_solution/inventory/e2e/*"], "@kbn/inventory-plugin": ["x-pack/plugins/observability_solution/inventory"], "@kbn/inventory-plugin/*": ["x-pack/plugins/observability_solution/inventory/*"], - "@kbn/investigate-app-plugin": ["x-pack/plugins/observability_solution/investigate_app"], - "@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/investigate-app-plugin": ["x-pack/solutions/observability/plugins/investigate_app"], + "@kbn/investigate-app-plugin/*": ["x-pack/solutions/observability/plugins/investigate_app/*"], + "@kbn/investigate-plugin": ["x-pack/solutions/observability/plugins/investigate"], + "@kbn/investigate-plugin/*": ["x-pack/solutions/observability/plugins/investigate/*"], + "@kbn/investigation-shared": ["x-pack/solutions/observability/packages/kbn-investigation-shared"], + "@kbn/investigation-shared/*": ["x-pack/solutions/observability/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"], @@ -1316,22 +1316,26 @@ "@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"], - "@kbn/observability-ai-assistant-management-plugin/*": ["x-pack/plugins/observability_solution/observability_ai_assistant_management/*"], - "@kbn/observability-ai-assistant-plugin": ["x-pack/plugins/observability_solution/observability_ai_assistant"], - "@kbn/observability-ai-assistant-plugin/*": ["x-pack/plugins/observability_solution/observability_ai_assistant/*"], - "@kbn/observability-alert-details": ["x-pack/packages/observability/alert_details"], - "@kbn/observability-alert-details/*": ["x-pack/packages/observability/alert_details/*"], - "@kbn/observability-alerting-rule-utils": ["x-pack/packages/observability/alerting_rule_utils"], - "@kbn/observability-alerting-rule-utils/*": ["x-pack/packages/observability/alerting_rule_utils/*"], - "@kbn/observability-alerting-test-data": ["x-pack/packages/observability/alerting_test_data"], - "@kbn/observability-alerting-test-data/*": ["x-pack/packages/observability/alerting_test_data/*"], + "@kbn/observability-ai-assistant-app-plugin": ["x-pack/solutions/observability/plugins/observability_ai_assistant_app"], + "@kbn/observability-ai-assistant-app-plugin/*": ["x-pack/solutions/observability/plugins/observability_ai_assistant_app/*"], + "@kbn/observability-ai-assistant-management-plugin": ["x-pack/solutions/observability/plugins/observability_ai_assistant_management"], + "@kbn/observability-ai-assistant-management-plugin/*": ["x-pack/solutions/observability/plugins/observability_ai_assistant_management/*"], + "@kbn/observability-ai-assistant-plugin": ["x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant"], + "@kbn/observability-ai-assistant-plugin/*": ["x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/*"], + "@kbn/observability-ai-common": ["x-pack/solutions/observability/packages/observability_ai/observability_ai_common"], + "@kbn/observability-ai-common/*": ["x-pack/solutions/observability/packages/observability_ai/observability_ai_common/*"], + "@kbn/observability-ai-server": ["x-pack/solutions/observability/packages/observability_ai/observability_ai_server"], + "@kbn/observability-ai-server/*": ["x-pack/solutions/observability/packages/observability_ai/observability_ai_server/*"], + "@kbn/observability-alert-details": ["x-pack/solutions/observability/packages/alert_details"], + "@kbn/observability-alert-details/*": ["x-pack/solutions/observability/packages/alert_details/*"], + "@kbn/observability-alerting-rule-utils": ["x-pack/platform/packages/shared/observability/alerting_rule_utils"], + "@kbn/observability-alerting-rule-utils/*": ["x-pack/platform/packages/shared/observability/alerting_rule_utils/*"], + "@kbn/observability-alerting-test-data": ["x-pack/solutions/observability/packages/alerting_test_data"], + "@kbn/observability-alerting-test-data/*": ["x-pack/solutions/observability/packages/alerting_test_data/*"], "@kbn/observability-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/observability"], "@kbn/observability-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/observability/*"], - "@kbn/observability-get-padded-alert-time-range-util": ["x-pack/packages/observability/get_padded_alert_time_range_util"], - "@kbn/observability-get-padded-alert-time-range-util/*": ["x-pack/packages/observability/get_padded_alert_time_range_util/*"], + "@kbn/observability-get-padded-alert-time-range-util": ["x-pack/solutions/observability/packages/get_padded_alert_time_range_util"], + "@kbn/observability-get-padded-alert-time-range-util/*": ["x-pack/solutions/observability/packages/get_padded_alert_time_range_util/*"], "@kbn/observability-logs-explorer-plugin": ["x-pack/plugins/observability_solution/observability_logs_explorer"], "@kbn/observability-logs-explorer-plugin/*": ["x-pack/plugins/observability_solution/observability_logs_explorer/*"], "@kbn/observability-logs-overview": ["x-pack/packages/observability/logs_overview"], @@ -1340,12 +1344,12 @@ "@kbn/observability-onboarding-e2e/*": ["x-pack/plugins/observability_solution/observability_onboarding/e2e/*"], "@kbn/observability-onboarding-plugin": ["x-pack/plugins/observability_solution/observability_onboarding"], "@kbn/observability-onboarding-plugin/*": ["x-pack/plugins/observability_solution/observability_onboarding/*"], - "@kbn/observability-plugin": ["x-pack/plugins/observability_solution/observability"], - "@kbn/observability-plugin/*": ["x-pack/plugins/observability_solution/observability/*"], + "@kbn/observability-plugin": ["x-pack/solutions/observability/plugins/observability"], + "@kbn/observability-plugin/*": ["x-pack/solutions/observability/plugins/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-synthetics-test-data": ["x-pack/packages/observability/synthetics_test_data"], - "@kbn/observability-synthetics-test-data/*": ["x-pack/packages/observability/synthetics_test_data/*"], + "@kbn/observability-synthetics-test-data": ["x-pack/solutions/observability/packages/synthetics_test_data"], + "@kbn/observability-synthetics-test-data/*": ["x-pack/solutions/observability/packages/synthetics_test_data/*"], "@kbn/observability-utils-browser": ["x-pack/packages/observability/observability_utils/observability_utils_browser"], "@kbn/observability-utils-browser/*": ["x-pack/packages/observability/observability_utils/observability_utils_browser/*"], "@kbn/observability-utils-common": ["x-pack/packages/observability/observability_utils/observability_utils_common"], @@ -1374,6 +1378,8 @@ "@kbn/paertial-results-example-plugin/*": ["examples/partial_results_example/*"], "@kbn/painless-lab-plugin": ["x-pack/plugins/painless_lab"], "@kbn/painless-lab-plugin/*": ["x-pack/plugins/painless_lab/*"], + "@kbn/palettes": ["packages/kbn-palettes"], + "@kbn/palettes/*": ["packages/kbn-palettes/*"], "@kbn/panel-loader": ["packages/kbn-panel-loader"], "@kbn/panel-loader/*": ["packages/kbn-panel-loader/*"], "@kbn/peggy": ["packages/kbn-peggy"], @@ -1436,6 +1442,8 @@ "@kbn/react-mute-legacy-root-warning/*": ["packages/kbn-react-mute-legacy-root-warning/*"], "@kbn/recently-accessed": ["packages/kbn-recently-accessed"], "@kbn/recently-accessed/*": ["packages/kbn-recently-accessed/*"], + "@kbn/relocate": ["packages/kbn-relocate"], + "@kbn/relocate/*": ["packages/kbn-relocate/*"], "@kbn/remote-clusters-plugin": ["x-pack/plugins/remote_clusters"], "@kbn/remote-clusters-plugin/*": ["x-pack/plugins/remote_clusters/*"], "@kbn/rendering-plugin": ["test/plugin_functional/plugins/rendering_plugin"], @@ -1622,34 +1630,34 @@ "@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-distribution-bar": ["x-pack/packages/security-solution/distribution_bar"], - "@kbn/security-solution-distribution-bar/*": ["x-pack/packages/security-solution/distribution_bar/*"], + "@kbn/security-solution-distribution-bar": ["x-pack/solutions/security/packages/distribution_bar"], + "@kbn/security-solution-distribution-bar/*": ["x-pack/solutions/security/packages/distribution_bar/*"], "@kbn/security-solution-ess": ["x-pack/plugins/security_solution_ess"], "@kbn/security-solution-ess/*": ["x-pack/plugins/security_solution_ess/*"], - "@kbn/security-solution-features": ["x-pack/packages/security-solution/features"], - "@kbn/security-solution-features/*": ["x-pack/packages/security-solution/features/*"], + "@kbn/security-solution-features": ["x-pack/solutions/security/packages/features"], + "@kbn/security-solution-features/*": ["x-pack/solutions/security/packages/features/*"], "@kbn/security-solution-fixtures-plugin": ["x-pack/test/cases_api_integration/common/plugins/security_solution"], "@kbn/security-solution-fixtures-plugin/*": ["x-pack/test/cases_api_integration/common/plugins/security_solution/*"], - "@kbn/security-solution-navigation": ["x-pack/packages/security-solution/navigation"], - "@kbn/security-solution-navigation/*": ["x-pack/packages/security-solution/navigation/*"], + "@kbn/security-solution-navigation": ["x-pack/solutions/security/packages/navigation"], + "@kbn/security-solution-navigation/*": ["x-pack/solutions/security/packages/navigation/*"], "@kbn/security-solution-plugin": ["x-pack/plugins/security_solution"], "@kbn/security-solution-plugin/*": ["x-pack/plugins/security_solution/*"], "@kbn/security-solution-serverless": ["x-pack/plugins/security_solution_serverless"], "@kbn/security-solution-serverless/*": ["x-pack/plugins/security_solution_serverless/*"], - "@kbn/security-solution-side-nav": ["x-pack/packages/security-solution/side_nav"], - "@kbn/security-solution-side-nav/*": ["x-pack/packages/security-solution/side_nav/*"], - "@kbn/security-solution-storybook-config": ["x-pack/packages/security-solution/storybook/config"], - "@kbn/security-solution-storybook-config/*": ["x-pack/packages/security-solution/storybook/config/*"], - "@kbn/security-solution-upselling": ["x-pack/packages/security-solution/upselling"], - "@kbn/security-solution-upselling/*": ["x-pack/packages/security-solution/upselling/*"], + "@kbn/security-solution-side-nav": ["x-pack/solutions/security/packages/side_nav"], + "@kbn/security-solution-side-nav/*": ["x-pack/solutions/security/packages/side_nav/*"], + "@kbn/security-solution-storybook-config": ["x-pack/solutions/security/packages/storybook/config"], + "@kbn/security-solution-storybook-config/*": ["x-pack/solutions/security/packages/storybook/config/*"], + "@kbn/security-solution-upselling": ["x-pack/solutions/security/packages/upselling"], + "@kbn/security-solution-upselling/*": ["x-pack/solutions/security/packages/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"], - "@kbn/securitysolution-data-table/*": ["x-pack/packages/security-solution/data_table/*"], + "@kbn/securitysolution-data-table": ["x-pack/solutions/security/packages/data_table"], + "@kbn/securitysolution-data-table/*": ["x-pack/solutions/security/packages/data_table/*"], "@kbn/securitysolution-ecs": ["packages/kbn-securitysolution-ecs"], "@kbn/securitysolution-ecs/*": ["packages/kbn-securitysolution-ecs/*"], "@kbn/securitysolution-endpoint-exceptions-common": ["packages/kbn-securitysolution-endpoint-exceptions-common"], @@ -1698,8 +1706,8 @@ "@kbn/serverless/*": ["x-pack/plugins/serverless/*"], "@kbn/serverless-common-settings": ["packages/serverless/settings/common"], "@kbn/serverless-common-settings/*": ["packages/serverless/settings/common/*"], - "@kbn/serverless-observability": ["x-pack/plugins/serverless_observability"], - "@kbn/serverless-observability/*": ["x-pack/plugins/serverless_observability/*"], + "@kbn/serverless-observability": ["x-pack/solutions/observability/plugins/serverless_observability"], + "@kbn/serverless-observability/*": ["x-pack/solutions/observability/plugins/serverless_observability/*"], "@kbn/serverless-observability-settings": ["packages/serverless/settings/observability_project"], "@kbn/serverless-observability-settings/*": ["packages/serverless/settings/observability_project/*"], "@kbn/serverless-project-switcher": ["packages/serverless/project_switcher"], @@ -1828,8 +1836,8 @@ "@kbn/shared-ux-utility/*": ["packages/kbn-shared-ux-utility/*"], "@kbn/slo-plugin": ["x-pack/plugins/observability_solution/slo"], "@kbn/slo-plugin/*": ["x-pack/plugins/observability_solution/slo/*"], - "@kbn/slo-schema": ["x-pack/packages/kbn-slo-schema"], - "@kbn/slo-schema/*": ["x-pack/packages/kbn-slo-schema/*"], + "@kbn/slo-schema": ["x-pack/platform/packages/shared/kbn-slo-schema"], + "@kbn/slo-schema/*": ["x-pack/platform/packages/shared/kbn-slo-schema/*"], "@kbn/snapshot-restore-plugin": ["x-pack/plugins/snapshot_restore"], "@kbn/snapshot-restore-plugin/*": ["x-pack/plugins/snapshot_restore/*"], "@kbn/some-dev-log": ["packages/kbn-some-dev-log"], @@ -1866,14 +1874,14 @@ "@kbn/stdio-dev-helpers/*": ["packages/kbn-stdio-dev-helpers/*"], "@kbn/storybook": ["packages/kbn-storybook"], "@kbn/storybook/*": ["packages/kbn-storybook/*"], - "@kbn/streams-app-plugin": ["x-pack/plugins/streams_app"], - "@kbn/streams-app-plugin/*": ["x-pack/plugins/streams_app/*"], - "@kbn/streams-plugin": ["x-pack/plugins/streams"], - "@kbn/streams-plugin/*": ["x-pack/plugins/streams/*"], - "@kbn/synthetics-e2e": ["x-pack/plugins/observability_solution/synthetics/e2e"], - "@kbn/synthetics-e2e/*": ["x-pack/plugins/observability_solution/synthetics/e2e/*"], - "@kbn/synthetics-plugin": ["x-pack/plugins/observability_solution/synthetics"], - "@kbn/synthetics-plugin/*": ["x-pack/plugins/observability_solution/synthetics/*"], + "@kbn/streams-app-plugin": ["x-pack/solutions/observability/plugins/streams_app"], + "@kbn/streams-app-plugin/*": ["x-pack/solutions/observability/plugins/streams_app/*"], + "@kbn/streams-plugin": ["x-pack/solutions/observability/plugins/streams"], + "@kbn/streams-plugin/*": ["x-pack/solutions/observability/plugins/streams/*"], + "@kbn/synthetics-e2e": ["x-pack/solutions/observability/plugins/synthetics/e2e"], + "@kbn/synthetics-e2e/*": ["x-pack/solutions/observability/plugins/synthetics/e2e/*"], + "@kbn/synthetics-plugin": ["x-pack/solutions/observability/plugins/synthetics"], + "@kbn/synthetics-plugin/*": ["x-pack/solutions/observability/plugins/synthetics/*"], "@kbn/synthetics-private-location": ["x-pack/packages/kbn-synthetics-private-location"], "@kbn/synthetics-private-location/*": ["x-pack/packages/kbn-synthetics-private-location/*"], "@kbn/task-manager-fixture-plugin": ["x-pack/test/alerting_api_integration/common/plugins/task_manager_fixture"], @@ -1918,10 +1926,10 @@ "@kbn/third-party-lens-navigation-prompt-plugin/*": ["x-pack/examples/third_party_lens_navigation_prompt/*"], "@kbn/third-party-vis-lens-example-plugin": ["x-pack/examples/third_party_vis_lens_example"], "@kbn/third-party-vis-lens-example-plugin/*": ["x-pack/examples/third_party_vis_lens_example/*"], - "@kbn/threat-intelligence-plugin": ["x-pack/plugins/threat_intelligence"], - "@kbn/threat-intelligence-plugin/*": ["x-pack/plugins/threat_intelligence/*"], - "@kbn/timelines-plugin": ["x-pack/plugins/timelines"], - "@kbn/timelines-plugin/*": ["x-pack/plugins/timelines/*"], + "@kbn/threat-intelligence-plugin": ["x-pack/solutions/security/plugins/threat_intelligence"], + "@kbn/threat-intelligence-plugin/*": ["x-pack/solutions/security/plugins/threat_intelligence/*"], + "@kbn/timelines-plugin": ["x-pack/solutions/security/plugins/timelines"], + "@kbn/timelines-plugin/*": ["x-pack/solutions/security/plugins/timelines/*"], "@kbn/timelion-grammar": ["packages/kbn-timelion-grammar"], "@kbn/timelion-grammar/*": ["packages/kbn-timelion-grammar/*"], "@kbn/timerange": ["packages/kbn-timerange"], @@ -1992,8 +2000,8 @@ "@kbn/unsaved-changes-prompt/*": ["packages/kbn-unsaved-changes-prompt/*"], "@kbn/upgrade-assistant-plugin": ["x-pack/plugins/upgrade_assistant"], "@kbn/upgrade-assistant-plugin/*": ["x-pack/plugins/upgrade_assistant/*"], - "@kbn/uptime-plugin": ["x-pack/plugins/observability_solution/uptime"], - "@kbn/uptime-plugin/*": ["x-pack/plugins/observability_solution/uptime/*"], + "@kbn/uptime-plugin": ["x-pack/solutions/observability/plugins/uptime"], + "@kbn/uptime-plugin/*": ["x-pack/solutions/observability/plugins/uptime/*"], "@kbn/url-drilldown-plugin": ["x-pack/plugins/drilldowns/url_drilldown"], "@kbn/url-drilldown-plugin/*": ["x-pack/plugins/drilldowns/url_drilldown/*"], "@kbn/url-forwarding-plugin": ["src/plugins/url_forwarding"], @@ -2016,8 +2024,8 @@ "@kbn/utility-types-jest/*": ["packages/kbn-utility-types-jest/*"], "@kbn/utils": ["packages/kbn-utils"], "@kbn/utils/*": ["packages/kbn-utils/*"], - "@kbn/ux-plugin": ["x-pack/plugins/observability_solution/ux"], - "@kbn/ux-plugin/*": ["x-pack/plugins/observability_solution/ux/*"], + "@kbn/ux-plugin": ["x-pack/solutions/observability/plugins/ux"], + "@kbn/ux-plugin/*": ["x-pack/solutions/observability/plugins/ux/*"], "@kbn/v8-profiler-examples-plugin": ["examples/v8_profiler_examples"], "@kbn/v8-profiler-examples-plugin/*": ["examples/v8_profiler_examples/*"], "@kbn/validate-next-docs-cli": ["packages/kbn-validate-next-docs-cli"], diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index d16cbe9a627d..d6a96f745167 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -32,7 +32,7 @@ "xpack.dashboard": "plugins/dashboard_enhanced", "xpack.dataQuality": "plugins/data_quality", "xpack.datasetQuality": "plugins/observability_solution/dataset_quality", - "xpack.dataUsage": "plugins/data_usage", + "xpack.dataUsage": "platform/plugins/private/data_usage", "xpack.discover": "plugins/discover_enhanced", "xpack.crossClusterReplication": "plugins/cross_cluster_replication", "xpack.elasticAssistant": "packages/kbn-elastic-assistant", @@ -44,7 +44,7 @@ "xpack.enterpriseSearch": "plugins/enterprise_search", "xpack.features": "plugins/features", "xpack.dataVisualizer": "platform/plugins/private/data_visualizer", - "xpack.exploratoryView": "plugins/observability_solution/exploratory_view", + "xpack.exploratoryView": "solutions/observability/plugins/exploratory_view", "xpack.fileUpload": "plugins/file_upload", "xpack.globalSearch": [ "plugins/global_search" @@ -68,8 +68,8 @@ "xpack.integrationAssistant": "plugins/integration_assistant", "xpack.inference": "platform/plugins/shared/inference", "xpack.inventory": "plugins/observability_solution/inventory", - "xpack.investigate": "plugins/observability_solution/investigate", - "xpack.investigateApp": "plugins/observability_solution/investigate_app", + "xpack.investigate": "solutions/observability/plugins/investigate", + "xpack.investigateApp": "solutions/observability/plugins/investigate_app", "xpack.kubernetesSecurity": "plugins/kubernetes_security", "xpack.lens": "plugins/lens", "xpack.licenseApiGuard": "plugins/license_api_guard", @@ -100,12 +100,12 @@ "xpack.monitoring": [ "plugins/monitoring" ], - "xpack.observability": "plugins/observability_solution/observability", + "xpack.observability": "solutions/observability/plugins/observability", "xpack.observabilityAiAssistant": [ - "plugins/observability_solution/observability_ai_assistant", - "plugins/observability_solution/observability_ai_assistant_app" + "platform/plugins/shared/observability_solution/observability_ai_assistant", + "solutions/observability/plugins/observability_ai_assistant_app" ], - "xpack.observabilityAiAssistantManagement": "plugins/observability_solution/observability_ai_assistant_management", + "xpack.observabilityAiAssistantManagement": "solutions/observability/plugins/observability_ai_assistant_management", "xpack.observabilityLogsExplorer": "plugins/observability_solution/observability_logs_explorer", "xpack.observability_onboarding": "plugins/observability_solution/observability_onboarding", "xpack.observabilityShared": "plugins/observability_solution/observability_shared", @@ -145,13 +145,13 @@ "xpack.server": "legacy/server", "xpack.serverless": "plugins/serverless", "xpack.serverlessSearch": "plugins/serverless_search", - "xpack.serverlessObservability": "plugins/serverless_observability", + "xpack.serverlessObservability": "solutions/observability/plugins/serverless_observability", "xpack.securitySolution": "plugins/security_solution", "xpack.securitySolutionEss": "plugins/security_solution_ess", "xpack.securitySolutionServerless": "plugins/security_solution_serverless", "xpack.sessionView": "plugins/session_view", "xpack.streams": [ - "plugins/streams_app" + "solutions/observability/plugins/streams_app" ], "xpack.slo": "plugins/observability_solution/slo", "xpack.snapshotRestore": "plugins/snapshot_restore", @@ -160,19 +160,19 @@ "plugins/saved_objects_tagging" ], "xpack.taskManager": "legacy/plugins/task_manager", - "xpack.threatIntelligence": "plugins/threat_intelligence", - "xpack.timelines": "plugins/timelines", + "xpack.threatIntelligence": "solutions/security/plugins/threat_intelligence", + "xpack.timelines": "solutions/security/plugins/timelines", "xpack.transform": "platform/plugins/private/transform", "xpack.triggersActionsUI": "plugins/triggers_actions_ui", "xpack.upgradeAssistant": "plugins/upgrade_assistant", "xpack.uptime": [ - "plugins/observability_solution/uptime" + "solutions/observability/plugins/uptime" ], "xpack.synthetics": [ - "plugins/observability_solution/synthetics" + "solutions/observability/plugins/synthetics" ], "xpack.ux": [ - "plugins/observability_solution/ux" + "solutions/observability/plugins/ux" ], "xpack.urlDrilldown": "plugins/drilldowns/url_drilldown", "xpack.watcher": "plugins/watcher" diff --git a/x-pack/examples/embedded_lens_example/public/mount.tsx b/x-pack/examples/embedded_lens_example/public/mount.tsx index 6ff43709d3f8..f791c115be63 100644 --- a/x-pack/examples/embedded_lens_example/public/mount.tsx +++ b/x-pack/examples/embedded_lens_example/public/mount.tsx @@ -22,11 +22,8 @@ export const mount = const defaultDataView = await plugins.data.indexPatterns.getDefault(); const { formula } = await plugins.lens.stateHelperApi(); - const { analytics, i18n, theme } = core; - const startServices = { analytics, i18n, theme }; - const reactElement = ( - <KibanaRenderContextProvider {...startServices}> + <KibanaRenderContextProvider {...core}> {defaultDataView && defaultDataView.isTimeBased() ? ( <App core={core} plugins={plugins} defaultDataView={defaultDataView} formula={formula} /> ) : ( diff --git a/x-pack/examples/triggers_actions_ui_example/public/application.tsx b/x-pack/examples/triggers_actions_ui_example/public/application.tsx index 74b99fc2dece..638233dd47a8 100644 --- a/x-pack/examples/triggers_actions_ui_example/public/application.tsx +++ b/x-pack/examples/triggers_actions_ui_example/public/application.tsx @@ -45,6 +45,7 @@ export interface TriggersActionsUiExampleComponentParams { docLinks: CoreStart['docLinks']; i18n: CoreStart['i18n']; theme: CoreStart['theme']; + userProfile: CoreStart['userProfile']; settings: CoreStart['settings']; history: ScopedHistory; triggersActionsUi: TriggersAndActionsUIPublicPluginStart; @@ -63,12 +64,11 @@ const TriggersActionsUiExampleApp = ({ notifications, settings, docLinks, - i18n, - theme, data, charts, dataViews, unifiedSearch, + ...startServices }: TriggersActionsUiExampleComponentParams) => { return ( <Router history={history}> @@ -193,8 +193,6 @@ const TriggersActionsUiExampleApp = ({ application, notifications, docLinks, - i18n, - theme, charts, data, dataViews, @@ -202,6 +200,7 @@ const TriggersActionsUiExampleApp = ({ settings, ruleTypeRegistry: triggersActionsUi.ruleTypeRegistry, actionTypeRegistry: triggersActionsUi.actionTypeRegistry, + ...startServices, }} /> </Page> @@ -218,8 +217,6 @@ const TriggersActionsUiExampleApp = ({ application, notifications, docLinks, - theme, - i18n, charts, data, dataViews, @@ -227,6 +224,7 @@ const TriggersActionsUiExampleApp = ({ settings, ruleTypeRegistry: triggersActionsUi.ruleTypeRegistry, actionTypeRegistry: triggersActionsUi.actionTypeRegistry, + ...startServices, }} /> </Page> @@ -245,7 +243,6 @@ export const renderApp = ( deps: TriggersActionsUiExamplePublicStartDeps, { appBasePath, element, history }: AppMountParameters ) => { - const { http, notifications, docLinks, application, i18n, theme, settings } = core; const { triggersActionsUi } = deps; const { ruleTypeRegistry, actionTypeRegistry } = triggersActionsUi; @@ -263,19 +260,13 @@ export const renderApp = ( <IntlProvider locale="en"> <TriggersActionsUiExampleApp history={history} - http={http} - notifications={notifications} - application={application} - docLinks={docLinks} - i18n={i18n} - theme={theme} - settings={settings} triggersActionsUi={deps.triggersActionsUi} data={deps.data} charts={deps.charts} dataViews={deps.dataViews} dataViewsEditor={deps.dataViewsEditor} unifiedSearch={deps.unifiedSearch} + {...core} /> </IntlProvider> </QueryClientProvider> diff --git a/x-pack/examples/ui_actions_enhanced_examples/kibana.jsonc b/x-pack/examples/ui_actions_enhanced_examples/kibana.jsonc index 25211ae2063b..19e73f0204d6 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/kibana.jsonc +++ b/x-pack/examples/ui_actions_enhanced_examples/kibana.jsonc @@ -21,7 +21,8 @@ "dashboard", "dashboardEnhanced", "developerExamples", - "unifiedSearch" + "unifiedSearch", + "embeddable", ], "requiredBundles": [ "dashboardEnhanced", diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/containers/app/app.tsx b/x-pack/examples/ui_actions_enhanced_examples/public/containers/app/app.tsx index cbfda603c8ec..97d281d51fba 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/public/containers/app/app.tsx +++ b/x-pack/examples/ui_actions_enhanced_examples/public/containers/app/app.tsx @@ -7,15 +7,19 @@ import React from 'react'; import { EuiPage } from '@elastic/eui'; +import { CoreStart } from '@kbn/core/public'; +import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import { Page } from '../../components/page'; import { DrilldownsManager } from '../drilldowns_manager'; -export const App: React.FC = () => { +export const App = ({ core }: { core: CoreStart }) => { return ( - <EuiPage> - <Page title={'UI Actions Enhanced'}> - <DrilldownsManager /> - </Page> - </EuiPage> + <KibanaRenderContextProvider i18n={core.i18n} theme={core.theme}> + <EuiPage> + <Page title={'UI Actions Enhanced'}> + <DrilldownsManager /> + </Page> + </EuiPage> + </KibanaRenderContextProvider> ); }; diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/containers/drilldowns_with_embeddable_example/drilldowns_with_embeddable_example.tsx b/x-pack/examples/ui_actions_enhanced_examples/public/containers/drilldowns_with_embeddable_example/drilldowns_with_embeddable_example.tsx index 4ca214aa2cff..b7a437b3d69d 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/public/containers/drilldowns_with_embeddable_example/drilldowns_with_embeddable_example.tsx +++ b/x-pack/examples/ui_actions_enhanced_examples/public/containers/drilldowns_with_embeddable_example/drilldowns_with_embeddable_example.tsx @@ -18,29 +18,12 @@ import { EuiFlexItem, EuiFlexGroup, } from '@elastic/eui'; -import { EmbeddableRoot, VALUE_CLICK_TRIGGER } from '@kbn/embeddable-plugin/public'; -import { SampleMlJob, SampleApp1ClickContext } from '../../triggers'; -import { ButtonEmbeddable } from '../../embeddables/button_embeddable'; +import { ReactEmbeddableRenderer, VALUE_CLICK_TRIGGER } from '@kbn/embeddable-plugin/public'; import { useUiActions } from '../../context'; - -export const job: SampleMlJob = { - job_id: '123', - job_type: 'anomaly_detector', - description: 'This is some ML job.', -}; - -export const context: SampleApp1ClickContext = { job }; +import { BUTTON_EMBEDDABLE } from '../../embeddables/register_button_embeddable'; export const DrilldownsWithEmbeddableExample: React.FC = () => { const { plugins, managerWithEmbeddable } = useUiActions(); - const embeddable = React.useMemo( - () => - new ButtonEmbeddable( - { id: 'DrilldownsWithEmbeddableExample' }, - { uiActions: plugins.uiActionsEnhanced } - ), - [plugins.uiActionsEnhanced] - ); const [showManager, setShowManager] = React.useState(false); const [openPopup, setOpenPopup] = React.useState(false); const viewRef = React.useRef<'/create' | '/manage'>('/create'); @@ -112,7 +95,13 @@ export const DrilldownsWithEmbeddableExample: React.FC = () => { <EuiFlexItem grow={false}>{openManagerButton}</EuiFlexItem> <EuiFlexItem grow={false}> <div style={{ maxWidth: 200 }}> - <EmbeddableRoot embeddable={embeddable} /> + <ReactEmbeddableRenderer<{}, {}> + type={BUTTON_EMBEDDABLE} + getParentApi={() => ({ + getSerializedStateForChild: () => undefined, + })} + hidePanelChrome={true} + /> </div> </EuiFlexItem> </EuiFlexGroup> @@ -124,7 +113,6 @@ export const DrilldownsWithEmbeddableExample: React.FC = () => { initialRoute={viewRef.current} dynamicActionManager={managerWithEmbeddable} triggers={[VALUE_CLICK_TRIGGER]} - placeContext={{ embeddable }} onClose={() => setShowManager(false)} /> </EuiFlyout> diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable.tsx b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable.tsx new file mode 100644 index 000000000000..f19a21d98a08 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable.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 React, { useCallback } from 'react'; +import { + DefaultEmbeddableApi, + ReactEmbeddableFactory, + VALUE_CLICK_TRIGGER, +} from '@kbn/embeddable-plugin/public'; +import { EuiCard, EuiFlexItem, EuiIcon } from '@elastic/eui'; +import { AdvancedUiActionsStart } from '@kbn/ui-actions-enhanced-plugin/public'; +import { BUTTON_EMBEDDABLE } from './register_button_embeddable'; + +export const getButtonEmbeddableFactory = (uiActionsEnhanced: AdvancedUiActionsStart) => { + const factory: ReactEmbeddableFactory<{}, {}, DefaultEmbeddableApi<{}>> = { + type: BUTTON_EMBEDDABLE, + deserializeState: (state) => state.rawState, + buildEmbeddable: async (state, buildApi, uuid, parentApi) => { + const api = buildApi( + { + serializeState: () => { + return { + rawState: {}, + references: [], + }; + }, + }, + {} + ); + return { + api, + Component: () => { + const onClick = useCallback(() => { + uiActionsEnhanced.getTrigger(VALUE_CLICK_TRIGGER).exec({ + embeddable: api, + data: { + data: [], + }, + }); + }, []); + return ( + <EuiFlexItem> + <EuiCard + icon={<EuiIcon size="xxl" type={`logoKibana`} />} + title={`Click me!`} + description={'This embeddable fires "VALUE_CLICK" trigger on click'} + onClick={onClick} + /> + </EuiFlexItem> + ); + }, + }; + }, + }; + return factory; +}; diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable.ts b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable.ts deleted file mode 100644 index df44e9061fc0..000000000000 --- a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { createElement } from 'react'; -import { render, unmountComponentAtNode } from 'react-dom'; -import { AdvancedUiActionsStart } from '@kbn/ui-actions-enhanced-plugin/public'; -import { Embeddable, EmbeddableInput, VALUE_CLICK_TRIGGER } from '@kbn/embeddable-plugin/public'; -import { ButtonEmbeddableComponent } from './button_embeddable_component'; - -export const BUTTON_EMBEDDABLE = 'BUTTON_EMBEDDABLE'; - -export interface ButtonEmbeddableParams { - uiActions: AdvancedUiActionsStart; -} - -export class ButtonEmbeddable extends Embeddable { - type = BUTTON_EMBEDDABLE; - - constructor(input: EmbeddableInput, private readonly params: ButtonEmbeddableParams) { - super(input, {}); - } - - reload() {} - - private el?: HTMLElement; - - public render(el: HTMLElement): void { - super.render(el); - this.el = el; - render( - createElement(ButtonEmbeddableComponent, { - onClick: () => { - this.params.uiActions.getTrigger(VALUE_CLICK_TRIGGER).exec({ - embeddable: this, - data: { - data: [], - }, - }); - }, - }), - el - ); - } - - public destroy() { - super.destroy(); - if (this.el) unmountComponentAtNode(this.el); - } -} diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable_component.tsx b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable_component.tsx deleted file mode 100644 index 044ae3c21900..000000000000 --- a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/button_embeddable_component.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 * as React from 'react'; -import { EuiCard, EuiFlexItem, EuiIcon } from '@elastic/eui'; - -export interface ButtonEmbeddableComponentProps { - onClick: () => void; -} - -export const ButtonEmbeddableComponent: React.FC<ButtonEmbeddableComponentProps> = ({ - onClick, -}) => { - return ( - <EuiFlexItem> - <EuiCard - icon={<EuiIcon size="xxl" type={`logoKibana`} />} - title={`Click me!`} - description={'This embeddable fires "VALUE_CLICK" trigger on click'} - onClick={onClick} - /> - </EuiFlexItem> - ); -}; diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/index.ts b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/index.ts deleted file mode 100644 index fb21a78c24b4..000000000000 --- a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/button_embeddable/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './button_embeddable'; diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/register_button_embeddable.ts b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/register_button_embeddable.ts new file mode 100644 index 000000000000..11ab813a85f4 --- /dev/null +++ b/x-pack/examples/ui_actions_enhanced_examples/public/embeddables/register_button_embeddable.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 { EmbeddableSetup } from '@kbn/embeddable-plugin/public'; +import { StartDependencies } from '../plugin'; + +export const BUTTON_EMBEDDABLE = 'BUTTON_EMBEDDABLE'; + +export function registerButtonEmbeddable( + embeddable: EmbeddableSetup, + services: Promise<StartDependencies> +) { + embeddable.registerReactEmbeddableFactory(BUTTON_EMBEDDABLE, async () => { + const { getButtonEmbeddableFactory } = await import('./button_embeddable'); + const { uiActionsEnhanced } = await services; + return getButtonEmbeddableFactory(uiActionsEnhanced); + }); +} diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/mount.tsx b/x-pack/examples/ui_actions_enhanced_examples/public/mount.tsx index 76708ac558fc..636286b03efd 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/public/mount.tsx +++ b/x-pack/examples/ui_actions_enhanced_examples/public/mount.tsx @@ -31,7 +31,7 @@ export const mount = }; const reactElement = ( <context.Provider value={deps}> - <App /> + <App core={core} /> </context.Provider> ); render(reactElement, element); diff --git a/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts b/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts index fbd74fc58101..fbf06ca7c2fb 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts +++ b/x-pack/examples/ui_actions_enhanced_examples/public/plugin.ts @@ -21,6 +21,7 @@ import { UiActionsEnhancedMemoryActionStorage, UiActionsEnhancedDynamicActionManager, } from '@kbn/ui-actions-enhanced-plugin/public'; +import { EmbeddableSetup } from '@kbn/embeddable-plugin/public'; import { DashboardHelloWorldDrilldown } from './drilldowns/dashboard_hello_world_drilldown'; import { DashboardToDiscoverDrilldown } from './drilldowns/dashboard_to_discover_drilldown'; import { App1ToDashboardDrilldown } from './drilldowns/app1_to_dashboard_drilldown'; @@ -35,12 +36,14 @@ import { } from './triggers'; import { mount } from './mount'; import { App2ToDashboardDrilldown } from './drilldowns/app2_to_dashboard_drilldown'; +import { registerButtonEmbeddable } from './embeddables/register_button_embeddable'; export interface SetupDependencies { dashboard: DashboardSetup; data: DataPublicPluginSetup; developerExamples: DeveloperExamplesSetup; discover: DiscoverSetup; + embeddable: EmbeddableSetup; uiActionsEnhanced: AdvancedUiActionsSetup; } @@ -62,7 +65,7 @@ export class UiActionsEnhancedExamplesPlugin { public setup( core: CoreSetup<StartDependencies, UiActionsEnhancedExamplesStart>, - { uiActionsEnhanced: uiActions, developerExamples }: SetupDependencies + { embeddable, uiActionsEnhanced: uiActions, developerExamples }: SetupDependencies ) { const start = createStartServicesGetter(core.getStartServices); @@ -150,6 +153,12 @@ export class UiActionsEnhancedExamplesPlugin }, ], }); + + const startServicesPromise = core.getStartServices(); + registerButtonEmbeddable( + embeddable, + startServicesPromise.then(([_, startDeps]) => startDeps) + ); } public start(_core: CoreStart, plugins: StartDependencies): UiActionsEnhancedExamplesStart { diff --git a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json index 6010bece3bd1..666df7ab8d27 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json +++ b/x-pack/examples/ui_actions_enhanced_examples/tsconfig.json @@ -30,5 +30,6 @@ "@kbn/utility-types", "@kbn/presentation-publishing", "@kbn/react-kibana-mount", + "@kbn/react-kibana-context-render", ] } diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/index.ts b/x-pack/packages/kbn-cloud-security-posture/graph/index.ts index c50969cfd640..45575316b29d 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/index.ts +++ b/x-pack/packages/kbn-cloud-security-posture/graph/index.ts @@ -6,3 +6,4 @@ */ export * from './src/components'; +export { useFetchGraphData } from './src/hooks'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js b/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js index 3b8fbbd9384a..3f600bebb30f 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js +++ b/x-pack/packages/kbn-cloud-security-posture/graph/jest.config.js @@ -9,6 +9,10 @@ module.exports = { preset: '@kbn/test', roots: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/graph'], rootDir: '../../../..', + transform: { + '^.+\\.(js|tsx?)$': + '<rootDir>/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts', + }, setupFiles: ['jest-canvas-mock'], setupFilesAfterEnv: ['<rootDir>/x-pack/packages/kbn-cloud-security-posture/graph/setup_tests.ts'], }; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/common/constants.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/common/constants.ts new file mode 100644 index 000000000000..307cbd65123e --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/common/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 EVENT_GRAPH_VISUALIZATION_API = '/internal/cloud_security_posture/graph' as const; + +export const RELATED_ENTITY = 'related.entity' as const; +export const ACTOR_ENTITY_ID = 'actor.entity.id' as const; +export const TARGET_ENTITY_ID = 'target.entity.id' as const; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx index 0b956cb19e10..a97a1c74698c 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/graph.tsx @@ -174,7 +174,7 @@ export const Graph: React.FC<GraphProps> = ({ minZoom={0.1} > {interactive && <Controls onInteractiveChange={onInteractiveStateChange} />} - <Background id={backgroundId} />{' '} + <Background id={backgroundId} /> </ReactFlow> </div> ); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts index 868461f99cde..d0cf9f0f150c 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/layout_graph.ts @@ -50,6 +50,10 @@ export const layoutGraph = ( nodesById[node.id] = node; } + if (node.parentId) { + return; + } + g.setNode(node.id, { ...node, ...size, @@ -59,6 +63,14 @@ export const layoutGraph = ( Dagre.layout(g); const layoutedNodes = nodes.map((node) => { + // For grouped nodes, we want to keep the original position relative to the parent + if (node.data.shape === 'label' && node.data.parentId) { + return { + ...node, + position: nodesById[node.data.id].position, + }; + } + const dagreNode = g.node(node.data.id); // We are shifting the dagre node position (anchor=center center) to the top left @@ -66,13 +78,7 @@ export const layoutGraph = ( const x = dagreNode.x - (dagreNode.width ?? 0) / 2; const y = dagreNode.y - (dagreNode.height ?? 0) / 2; - // For grouped nodes, we want to keep the original position relative to the parent - if (node.data.shape === 'label' && node.data.parentId) { - return { - ...node, - position: nodesById[node.data.id].position, - }; - } else if (node.data.shape === 'group') { + if (node.data.shape === 'group') { return { ...node, position: { x, y }, @@ -130,7 +136,7 @@ const layoutGroupChildren = ( const childSize = calcLabelSize(child.data.label); child.position = { x: groupNodeWidth / 2 - childSize.width / 2, - y: index * (childSize.height * 2 + space), + y: index * (childSize.height + space), }; }); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx index f5bca30d1e5a..dd8a5f0c56a7 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph/use_graph_popover.tsx @@ -46,12 +46,9 @@ export const useGraphPopover = (id: string): GraphPopoverState => { const state: PopoverState = useMemo(() => ({ isOpen, anchorElement }), [isOpen, anchorElement]); - return useMemo( - () => ({ - id, - actions, - state, - }), - [id, actions, state] - ); + return { + id, + actions, + state, + }; }; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx new file mode 100644 index 000000000000..081b4ec28c6a --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_investigation.tsx @@ -0,0 +1,258 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, { memo, useCallback, useMemo, useState } from 'react'; +import { SearchBar } from '@kbn/unified-search-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import { + BooleanRelation, + buildEsQuery, + isCombinedFilter, + buildCombinedFilter, + isFilter, + FilterStateStore, +} from '@kbn/es-query'; +import type { Filter, Query, TimeRange, PhraseFilter } from '@kbn/es-query'; +import { css } from '@emotion/react'; +import { getEsQueryConfig } from '@kbn/data-service'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { Graph } from '../../..'; +import { useGraphNodeExpandPopover } from './use_graph_node_expand_popover'; +import { useFetchGraphData } from '../../hooks/use_fetch_graph_data'; +import { GRAPH_INVESTIGATION_TEST_ID } from '../test_ids'; +import { ACTOR_ENTITY_ID, RELATED_ENTITY, TARGET_ENTITY_ID } from '../../common/constants'; + +const CONTROLLED_BY_GRAPH_INVESTIGATION_FILTER = 'graph-investigation'; + +const buildPhraseFilter = (field: string, value: string, dataViewId?: string): PhraseFilter => ({ + meta: { + key: field, + index: dataViewId, + negate: false, + disabled: false, + type: 'phrase', + field, + controlledBy: CONTROLLED_BY_GRAPH_INVESTIGATION_FILTER, + params: { + query: value, + }, + }, + query: { + match_phrase: { + [field]: value, + }, + }, +}); + +/** + * Adds a filter to the existing list of filters based on the provided key and value. + * It will always use the first filter in the list to build a combined filter with the new filter. + * + * @param dataViewId - The ID of the data view to which the filter belongs. + * @param prev - The previous list of filters. + * @param key - The key for the filter. + * @param value - The value for the filter. + * @returns A new list of filters with the added filter. + */ +const addFilter = (dataViewId: string, prev: Filter[], key: string, value: string) => { + const [firstFilter, ...otherFilters] = prev; + + if (isCombinedFilter(firstFilter) && firstFilter?.meta?.relation === BooleanRelation.OR) { + return [ + { + ...firstFilter, + meta: { + ...firstFilter.meta, + params: [ + ...(Array.isArray(firstFilter.meta.params) ? firstFilter.meta.params : []), + buildPhraseFilter(key, value), + ], + }, + }, + ...otherFilters, + ]; + } else if (isFilter(firstFilter) && firstFilter.meta?.type !== 'custom') { + return [ + buildCombinedFilter(BooleanRelation.OR, [firstFilter, buildPhraseFilter(key, value)], { + id: dataViewId, + }), + ...otherFilters, + ]; + } else { + return [ + { + $state: { + store: FilterStateStore.APP_STATE, + }, + ...buildPhraseFilter(key, value, dataViewId), + }, + ...prev, + ]; + } +}; + +const useGraphPopovers = ( + dataViewId: string, + setSearchFilters: React.Dispatch<React.SetStateAction<Filter[]>> +) => { + const nodeExpandPopover = useGraphNodeExpandPopover({ + onExploreRelatedEntitiesClick: (node) => { + setSearchFilters((prev) => addFilter(dataViewId, prev, RELATED_ENTITY, node.id)); + }, + onShowActionsByEntityClick: (node) => { + setSearchFilters((prev) => addFilter(dataViewId, prev, ACTOR_ENTITY_ID, node.id)); + }, + onShowActionsOnEntityClick: (node) => { + setSearchFilters((prev) => addFilter(dataViewId, prev, TARGET_ENTITY_ID, node.id)); + }, + }); + + const openPopoverCallback = useCallback( + (cb: Function, ...args: unknown[]) => { + [nodeExpandPopover].forEach(({ actions: { closePopover } }) => { + closePopover(); + }); + cb(...args); + }, + [nodeExpandPopover] + ); + + return { nodeExpandPopover, openPopoverCallback }; +}; + +interface GraphInvestigationProps { + dataView: DataView; + eventIds: string[]; + timestamp: string | null; +} + +/** + * Graph investigation view allows the user to expand nodes and view related entities. + */ +export const GraphInvestigation: React.FC<GraphInvestigationProps> = memo( + ({ dataView, eventIds, timestamp = new Date().toISOString() }: GraphInvestigationProps) => { + const [searchFilters, setSearchFilters] = useState<Filter[]>(() => []); + const [timeRange, setTimeRange] = useState<TimeRange>({ + from: `${timestamp}||-30m`, + to: `${timestamp}||+30m`, + }); + + const { + services: { uiSettings }, + } = useKibana(); + const query = useMemo( + () => + buildEsQuery( + dataView, + [], + [...searchFilters], + getEsQueryConfig(uiSettings as Parameters<typeof getEsQueryConfig>[0]) + ), + [searchFilters, dataView, uiSettings] + ); + + const { nodeExpandPopover, openPopoverCallback } = useGraphPopovers( + dataView?.id ?? '', + setSearchFilters + ); + const expandButtonClickHandler = (...args: unknown[]) => + openPopoverCallback(nodeExpandPopover.onNodeExpandButtonClick, ...args); + const isPopoverOpen = [nodeExpandPopover].some(({ state: { isOpen } }) => isOpen); + const { data, refresh, isFetching } = useFetchGraphData({ + req: { + query: { + eventIds, + esQuery: query, + start: timeRange.from, + end: timeRange.to, + }, + }, + options: { + refetchOnWindowFocus: false, + keepPreviousData: true, + }, + }); + + const nodes = useMemo(() => { + return ( + data?.nodes.map((node) => { + const nodeHandlers = + node.shape !== 'label' && node.shape !== 'group' + ? { + expandButtonClick: expandButtonClickHandler, + } + : undefined; + return { ...node, ...nodeHandlers }; + }) ?? [] + ); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [data?.nodes]); + + return ( + <> + <EuiFlexGroup + data-test-subj={GRAPH_INVESTIGATION_TEST_ID} + direction="column" + gutterSize="none" + css={css` + height: 100%; + `} + > + {dataView && ( + <EuiFlexItem grow={false}> + <SearchBar<Query> + {...{ + appName: 'graph-investigation', + intl: null, + showFilterBar: true, + showDatePicker: true, + showAutoRefreshOnly: false, + showSaveQuery: false, + showQueryInput: false, + isLoading: isFetching, + isAutoRefreshDisabled: true, + dateRangeFrom: timeRange.from, + dateRangeTo: timeRange.to, + query: { query: '', language: 'kuery' }, + indexPatterns: [dataView], + filters: searchFilters, + submitButtonStyle: 'iconOnly', + onFiltersUpdated: (newFilters) => { + setSearchFilters(newFilters); + }, + onQuerySubmit: (payload, isUpdate) => { + if (isUpdate) { + setTimeRange({ ...payload.dateRange }); + } else { + refresh(); + } + }, + }} + /> + </EuiFlexItem> + )} + <EuiFlexItem> + <Graph + css={css` + height: 100%; + width: 100%; + `} + nodes={nodes} + edges={data?.edges ?? []} + interactive={true} + isLocked={isPopoverOpen} + /> + </EuiFlexItem> + </EuiFlexGroup> + <nodeExpandPopover.PopoverComponent /> + </> + ); + } +); + +GraphInvestigation.displayName = 'GraphInvestigation'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.tsx new file mode 100644 index 000000000000..c22f8dbe51ac --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/graph_node_expand_popover.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 React, { memo } from 'react'; +import { EuiListGroup } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { ExpandPopoverListItem } from '../styles'; +import { GraphPopover } from '../../..'; +import { + GRAPH_NODE_EXPAND_POPOVER_TEST_ID, + GRAPH_NODE_POPOVER_SHOW_RELATED_ITEM_ID, + GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_ITEM_ID, + GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_ITEM_ID, +} from '../test_ids'; + +interface GraphNodeExpandPopoverProps { + isOpen: boolean; + anchorElement: HTMLElement | null; + closePopover: () => void; + onShowRelatedEntitiesClick: () => void; + onShowActionsByEntityClick: () => void; + onShowActionsOnEntityClick: () => void; +} + +export const GraphNodeExpandPopover: React.FC<GraphNodeExpandPopoverProps> = memo( + ({ + isOpen, + anchorElement, + closePopover, + onShowRelatedEntitiesClick, + onShowActionsByEntityClick, + onShowActionsOnEntityClick, + }) => { + return ( + <GraphPopover + panelPaddingSize="s" + anchorPosition="rightCenter" + isOpen={isOpen} + anchorElement={anchorElement} + closePopover={closePopover} + data-test-subj={GRAPH_NODE_EXPAND_POPOVER_TEST_ID} + > + <EuiListGroup gutterSize="none" bordered={false} flush={true}> + <ExpandPopoverListItem + iconType="users" + label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showActionsByEntity', { + defaultMessage: 'Show actions by this entity', + })} + onClick={onShowActionsByEntityClick} + data-test-subj={GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_ITEM_ID} + /> + <ExpandPopoverListItem + iconType="storage" + label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showActionsOnEntity', { + defaultMessage: 'Show actions on this entity', + })} + onClick={onShowActionsOnEntityClick} + data-test-subj={GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_ITEM_ID} + /> + <ExpandPopoverListItem + iconType="visTagCloud" + label={i18n.translate('xpack.csp.graph.graphNodeExpandPopover.showRelatedEvents', { + defaultMessage: 'Show related events', + })} + onClick={onShowRelatedEntitiesClick} + data-test-subj={GRAPH_NODE_POPOVER_SHOW_RELATED_ITEM_ID} + /> + </EuiListGroup> + </GraphPopover> + ); + } +); + +GraphNodeExpandPopover.displayName = 'GraphNodeExpandPopover'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.tsx new file mode 100644 index 000000000000..90e8f66510cc --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_investigation/use_graph_node_expand_popover.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 React, { memo, useCallback, useRef, useState } from 'react'; +import { useGraphPopover } from '../../..'; +import type { ExpandButtonClickCallback, NodeProps } from '../types'; +import { GraphNodeExpandPopover } from './graph_node_expand_popover'; + +interface UseGraphNodeExpandPopoverArgs { + onExploreRelatedEntitiesClick: (node: NodeProps) => void; + onShowActionsByEntityClick: (node: NodeProps) => void; + onShowActionsOnEntityClick: (node: NodeProps) => void; +} + +export const useGraphNodeExpandPopover = ({ + onExploreRelatedEntitiesClick, + onShowActionsByEntityClick, + onShowActionsOnEntityClick, +}: UseGraphNodeExpandPopoverArgs) => { + const { id, state, actions } = useGraphPopover('node-expand-popover'); + const { openPopover, closePopover } = actions; + + const selectedNode = useRef<NodeProps | null>(null); + const unToggleCallbackRef = useRef<(() => void) | null>(null); + const [pendingOpen, setPendingOpen] = useState<{ + node: NodeProps; + el: HTMLElement; + unToggleCallback: () => void; + } | null>(null); + + // Handler to close the popover, reset selected node and unToggle callback + const closePopoverHandler = useCallback(() => { + selectedNode.current = null; + unToggleCallbackRef.current?.(); + unToggleCallbackRef.current = null; + closePopover(); + }, [closePopover]); + + /** + * Handles the click event on the node expand button. + * Closes the current popover if open and sets the pending open state + * if the clicked node is different from the currently selected node. + */ + const onNodeExpandButtonClick: ExpandButtonClickCallback = useCallback( + (e, node, unToggleCallback) => { + // Close the current popover if open + closePopoverHandler(); + + if (selectedNode.current?.id !== node.id) { + // Set the pending open state + setPendingOpen({ node, el: e.currentTarget, unToggleCallback }); + } + }, + [closePopoverHandler] + ); + + // PopoverComponent is a memoized component that renders the GraphNodeExpandPopover + // It handles the display of the popover and the actions that can be performed on the node + const PopoverComponent = memo(() => ( + <GraphNodeExpandPopover + isOpen={state.isOpen} + anchorElement={state.anchorElement} + closePopover={closePopoverHandler} + onShowRelatedEntitiesClick={() => { + onExploreRelatedEntitiesClick(selectedNode.current as NodeProps); + closePopoverHandler(); + }} + onShowActionsByEntityClick={() => { + onShowActionsByEntityClick(selectedNode.current as NodeProps); + closePopoverHandler(); + }} + onShowActionsOnEntityClick={() => { + onShowActionsOnEntityClick(selectedNode.current as NodeProps); + closePopoverHandler(); + }} + /> + )); + + // Open pending popover if the popover is not open + // This block checks if there is a pending popover to be opened. + // If the popover is not currently open and there is a pending popover, + // it sets the selected node, stores the unToggle callback, and opens the popover. + if (!state.isOpen && pendingOpen) { + const { node, el, unToggleCallback } = pendingOpen; + + selectedNode.current = node; + unToggleCallbackRef.current = unToggleCallback; + openPopover(el); + + setPendingOpen(null); + } + + return { + onNodeExpandButtonClick, + PopoverComponent, + id, + actions: { + ...actions, + closePopover: closePopoverHandler, + }, + state, + }; +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx new file mode 100644 index 000000000000..77da232f27bd --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.test.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { composeStories } from '@storybook/testing-react'; +import { render } from '@testing-library/react'; +import React from 'react'; +import * as stories from './graph_layout.stories'; + +const { GraphLargeStackedEdgeCases } = composeStories(stories); + +const TRANSLATE_XY_REGEX = + /translate\(\s*([+-]?\d+(\.\d+)?)(px|%)?\s*,\s*([+-]?\d+(\.\d+)?)(px|%)?\s*\)/; + +interface Rect { + left: number; + top: number; + right: number; + bottom: number; +} + +const getLabelRect = (el: HTMLElement): Rect | undefined => { + const match = el.style.transform.match(TRANSLATE_XY_REGEX); + + if (!match || match.length < 5) { + return; + } + + return { + left: Number(match[1]), + right: Number(match[1]) + 120, + top: Number(match[4]), + bottom: Number(match[4]) + 32, + }; +}; + +const rectIntersect = (rect1: Rect, rect2: Rect) => { + return !( + rect1.top > rect2.bottom || + rect1.right < rect2.left || + rect1.bottom < rect2.top || + rect1.left > rect2.right + ); +}; + +describe('GraphLargeStackedEdgeCases story', () => { + it('all labels should be visible', async () => { + const { getAllByText } = render(<GraphLargeStackedEdgeCases />); + + const labels = GraphLargeStackedEdgeCases.args?.nodes?.filter((node) => node.shape === 'label'); + + // With JSDOM toBeVisible can't check if elements are visually obscured by other overlapping elements + // This is a workaround which gives a rough estimation of a label's bounding rectangle and check for intersections + const labelsBoundingRect: Rect[] = []; + const labelElements: Set<string> = new Set(); + + for (const { label } of labels ?? []) { + // Get all label nodes that contains the label's text + const allLabelElements = getAllByText( + (_content, element) => element?.textContent === `${label!}`, + { + exact: true, + selector: 'div.react-flow__node-label', + } + ); + expect(allLabelElements.length).toBeGreaterThan(0); + + for (const labelElm of allLabelElements) { + const id = labelElm.getAttribute('data-id'); + + // Same label can appear more than once in the graph, so we skip them if already scanned + if (labelElements.has(id!)) { + continue; + } + labelElements.add(id!); + + expect(labelElm).toBeVisible(); + const labelRect = getLabelRect(labelElm); + expect(labelRect).not.toBeUndefined(); + + // Checks if current rect intersects with other labels + for (const currRect of labelsBoundingRect) { + expect(rectIntersect(currRect, labelRect!)).toBeFalsy(); + } + + labelsBoundingRect.push(labelRect!); + } + } + }); +}); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx index 140e81238d39..e576a5abf030 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/graph_layout.stories.tsx @@ -503,3 +503,31 @@ GraphStackedEdgeCases.args = { }, ]), }; + +export const GraphLargeStackedEdgeCases = Template.bind({}); + +GraphLargeStackedEdgeCases.args = { + ...extractEdges([ + ...baseGraph, + ...Array(10) + .fill(0) + .map<EnhancedNodeViewModel>((_v, idx) => ({ + id: 'a(oktauser)-b(hackeruser)', + source: 'oktauser', + target: 'hackeruser', + label: 'CreateUser' + idx, + color: 'primary', + shape: 'label', + })), + ...Array(10) + .fill(0) + .map<EnhancedNodeViewModel>((_v, idx) => ({ + id: 'a(siem-windows)-b(user)', + source: 'siem-windows', + target: 'user', + label: 'User login to OKTA' + idx, + color: 'danger', + shape: 'label', + })), + ]), +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts index 2b050aa55429..d3cd397764e6 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/index.ts @@ -6,6 +6,7 @@ */ export { Graph } from './graph/graph'; +export { GraphInvestigation } from './graph_investigation/graph_investigation'; export { GraphPopover } from './graph/graph_popover'; export { useGraphPopover } from './graph/use_graph_popover'; export type { GraphProps } from './graph/graph'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx index 522b7d1b5d45..07581c1e3d3d 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/node/node_expand_button.tsx @@ -35,6 +35,7 @@ export const NodeExpandButton = ({ x, y, onClick }: NodeExpandButtonProps) => { onClick={onClickHandler} iconSize="m" aria-label="Open or close node actions" + data-test-subj="nodeExpandButton" /> </StyledNodeExpandButton> ); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx index 0efff1c88456..be776d57be12 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/styles.tsx @@ -6,13 +6,16 @@ */ import React from 'react'; +import type { + EuiIconProps, + _EuiBackgroundColor, + CommonProps, + EuiListGroupItemProps, +} from '@elastic/eui'; import { - EuiIcon, useEuiBackgroundColor, useEuiTheme, - type EuiIconProps, - type _EuiBackgroundColor, - EuiListGroupItemProps, + EuiIcon, EuiListGroupItem, EuiText, } from '@elastic/eui'; @@ -59,22 +62,24 @@ const RoundedEuiIcon: React.FC<RoundedEuiIconProps> = ({ color, background, ...r ); export const ExpandPopoverListItem: React.FC< - Pick<EuiListGroupItemProps, 'iconType' | 'label' | 'onClick'> + CommonProps & Pick<EuiListGroupItemProps, 'iconType' | 'label' | 'onClick'> > = (props) => { + const { iconType, label, onClick, ...rest } = props; const { euiTheme } = useEuiTheme(); return ( <EuiListGroupItem + {...rest} icon={ - props.iconType ? ( - <RoundedEuiIcon color="primary" background="primary" type={props.iconType} size="s" /> + iconType ? ( + <RoundedEuiIcon color="primary" background="primary" type={iconType} size="s" /> ) : undefined } label={ <EuiText size="s" color={euiTheme.colors.primaryText}> - {props.label} + {label} </EuiText> } - onClick={props.onClick} + onClick={onClick} /> ); }; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts new file mode 100644 index 000000000000..96e399d67090 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/components/test_ids.ts @@ -0,0 +1,18 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const PREFIX = 'cloudSecurityGraph' as const; + +export const GRAPH_INVESTIGATION_TEST_ID = `${PREFIX}GraphInvestigation` as const; +export const GRAPH_NODE_EXPAND_POPOVER_TEST_ID = + `${GRAPH_INVESTIGATION_TEST_ID}GraphNodeExpandPopover` as const; +export const GRAPH_NODE_POPOVER_SHOW_RELATED_ITEM_ID = + `${GRAPH_INVESTIGATION_TEST_ID}ExploreRelatedEntities` as const; +export const GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_ITEM_ID = + `${GRAPH_INVESTIGATION_TEST_ID}ShowActionsByEntity` as const; +export const GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_ITEM_ID = + `${GRAPH_INVESTIGATION_TEST_ID}ShowActionsOnEntity` as const; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/index.ts new file mode 100644 index 000000000000..6d75dc8beefe --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/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 { useFetchGraphData } from './use_fetch_graph_data'; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx new file mode 100644 index 000000000000..e494ff0957ec --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.test.tsx @@ -0,0 +1,118 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { useFetchGraphData } from './use_fetch_graph_data'; + +const mockUseQuery = jest.fn(); + +jest.mock('@tanstack/react-query', () => { + return { + useQuery: (...args: unknown[]) => mockUseQuery(...args), + useQueryClient: jest.fn(), + }; +}); + +const defaultOptions = { + enabled: true, + refetchOnWindowFocus: true, + keepPreviousData: false, +}; + +describe('useFetchGraphData', () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('should pass default options when options are not provided', () => { + renderHook(() => { + return useFetchGraphData({ + req: { + query: { + eventIds: [], + start: '2021-09-01T00:00:00.000Z', + end: '2021-09-01T23:59:59.999Z', + }, + }, + }); + }); + + expect(mockUseQuery.mock.calls).toHaveLength(1); + expect(mockUseQuery.mock.calls[0][2]).toEqual({ + ...defaultOptions, + }); + }); + + it('should not be enabled when enabled set to false', () => { + renderHook(() => { + return useFetchGraphData({ + req: { + query: { + eventIds: [], + start: '2021-09-01T00:00:00.000Z', + end: '2021-09-01T23:59:59.999Z', + }, + }, + options: { + enabled: false, + }, + }); + }); + + expect(mockUseQuery.mock.calls).toHaveLength(1); + expect(mockUseQuery.mock.calls[0][2]).toEqual({ + ...defaultOptions, + enabled: false, + }); + }); + + it('should not be refetchOnWindowFocus when refetchOnWindowFocus set to false', () => { + renderHook(() => { + return useFetchGraphData({ + req: { + query: { + eventIds: [], + start: '2021-09-01T00:00:00.000Z', + end: '2021-09-01T23:59:59.999Z', + }, + }, + options: { + refetchOnWindowFocus: false, + }, + }); + }); + + expect(mockUseQuery.mock.calls).toHaveLength(1); + expect(mockUseQuery.mock.calls[0][2]).toEqual({ + ...defaultOptions, + refetchOnWindowFocus: false, + }); + }); + + it('should keepPreviousData when keepPreviousData set to true', () => { + renderHook(() => { + return useFetchGraphData({ + req: { + query: { + eventIds: [], + start: '2021-09-01T00:00:00.000Z', + end: '2021-09-01T23:59:59.999Z', + }, + }, + options: { + keepPreviousData: true, + }, + }); + }); + + expect(mockUseQuery.mock.calls).toHaveLength(1); + expect(mockUseQuery.mock.calls[0][2]).toEqual({ + ...defaultOptions, + keepPreviousData: true, + }); + }); +}); diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts new file mode 100644 index 000000000000..74cca4693e80 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/graph/src/hooks/use_fetch_graph_data.ts @@ -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 { useMemo } from 'react'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import type { + GraphRequest, + GraphResponse, +} from '@kbn/cloud-security-posture-common/types/graph/latest'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { EVENT_GRAPH_VISUALIZATION_API } from '../common/constants'; + +/** + * Interface for the input parameters of the useFetchGraphData hook. + */ +export interface UseFetchGraphDataParams { + /** + * The request object containing the query parameters for the graph data. + */ + req: GraphRequest; + /** + * Optional configuration options for the query. + */ + options?: { + /** + * If false, the query will not automatically run. + * Defaults to true. + */ + enabled?: boolean; + /** + * If true, the query will refetch on window focus. + * Defaults to true. + */ + refetchOnWindowFocus?: boolean; + /** + * If true, the query will keep previous data till new data received. + * Defaults to false. + */ + keepPreviousData?: boolean; + }; +} + +/** + * Interface for the result of the useFetchGraphData hook. + */ +export interface UseFetchGraphDataResult { + /** + * Indicates if the query is currently being fetched for the first time. + */ + isLoading: boolean; + /** + * Indicates if the query is currently being fetched. Regardless of whether it is the initial fetch or a refetch. + */ + isFetching: boolean; + /** + * Indicates if there was an error during the query. + */ + isError: boolean; + /** + * The data returned from the query. + */ + data?: GraphResponse; + /** + * Function to manually refresh the query. + */ + refresh: () => void; +} + +/** + * Hook to fetch event's graph visualization data. + * + * @param params - The input parameters for the hook. + * @returns The result of the hook. + */ +export const useFetchGraphData = ({ + req, + options, +}: UseFetchGraphDataParams): UseFetchGraphDataResult => { + const queryClient = useQueryClient(); + const { esQuery, eventIds, start, end } = req.query; + const { + services: { http }, + } = useKibana(); + const QUERY_KEY = useMemo( + () => ['useFetchGraphData', eventIds, start, end, esQuery], + [end, esQuery, eventIds, start] + ); + + const { isLoading, isError, data, isFetching } = useQuery<GraphResponse>( + QUERY_KEY, + () => { + if (!http) { + return Promise.reject(new Error('Http service is not available')); + } + + return http.post<GraphResponse>(EVENT_GRAPH_VISUALIZATION_API, { + version: '1', + body: JSON.stringify(req), + }); + }, + { + enabled: options?.enabled ?? true, + refetchOnWindowFocus: options?.refetchOnWindowFocus ?? true, + keepPreviousData: options?.keepPreviousData ?? false, + } + ); + + return { + isLoading, + isFetching, + isError, + data, + refresh: () => { + queryClient.invalidateQueries(QUERY_KEY); + }, + }; +}; diff --git a/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json b/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json index d0056e29e678..e56b9aabf16a 100644 --- a/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json +++ b/x-pack/packages/kbn-cloud-security-posture/graph/tsconfig.json @@ -12,7 +12,13 @@ ], "kbn_references": [ "@kbn/cloud-security-posture-common", - "@kbn/utility-types", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", "@kbn/ui-theme", + "@kbn/utility-types", + "@kbn/unified-search-plugin", + "@kbn/es-query", + "@kbn/data-service", + "@kbn/i18n", ] } diff --git a/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts b/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.ts new file mode 100644 index 000000000000..7512a5bba873 --- /dev/null +++ b/x-pack/packages/kbn-cloud-security-posture/storybook/config/babel_with_emotion.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 babelJest from 'babel-jest'; + +// eslint-disable-next-line import/no-default-export +export default babelJest.createTransformer({ + presets: [ + [ + require.resolve('@kbn/babel-preset/node_preset'), + { + '@babel/preset-env': { + // disable built-in filtering, which is more performant but strips the import of `regenerator-runtime` required by EUI + useBuiltIns: false, + corejs: false, + }, + }, + ], + ], + plugins: ['@emotion'], +}); diff --git a/x-pack/packages/kbn-data-forge/jest.config.js b/x-pack/packages/kbn-data-forge/jest.config.js deleted file mode 100644 index d1a6e79c73a6..000000000000 --- a/x-pack/packages/kbn-data-forge/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/packages/kbn-data-forge'], -}; diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh deleted file mode 100755 index 76221bba3ad3..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../ecs - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --include $ECS/fields/custom \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/index.ts b/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/index.ts deleted file mode 100644 index becee1697c0c..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/index.ts +++ /dev/null @@ -1,173 +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 { faker } from '@faker-js/faker'; -import { sample, range, memoize } from 'lodash'; -import { GeneratorFunction } from '../../types'; -import { replaceMetricsWithShapes } from '../../lib/replace_metrics_with_shapes'; - -export { indexTemplate } from './ecs'; - -const createGroupIndex = (index: number) => Math.floor(index / 1000) * 1000; - -const randomBetween = (start = 0, end = 1, step = 0.1) => sample(range(start, end, step)); - -let networkDataCount = 0; -const generateNetworkData = memoize((_timestamp: string) => { - networkDataCount += Math.floor(10000 * Math.random()); - return networkDataCount; -}); - -export const generateEvent: GeneratorFunction = (config, schedule, index, timestamp) => { - const groupIndex = createGroupIndex(index); - const interval = schedule.interval ?? config.indexing.interval; - const scenario = config.indexing.scenario || 'fake_hosts'; - const docs = [ - { - namespace: 'fake_hosts', - '@timestamp': timestamp.toISOString(), - tags: [`group-${groupIndex}`, `event-${index}`], - host: { - name: `host-${index}`, - mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], - network: { - name: `network-${index}`, - }, - }, - event: { - module: 'system', - dataset: 'system.cpu', - }, - labels: { - groupId: `group-${groupIndex}`, - eventId: `event-${index}`, - scenario, - }, - system: { - cpu: { - cores: 4, - total: { - norm: { - pct: randomBetween(), - }, - }, - user: { - pct: randomBetween(1, 4), - }, - system: { - pct: randomBetween(1, 4), - }, - }, - load: { - 1: randomBetween(1, 4), - }, - memory: { - actual: { - used: { - pct: randomBetween(1, 4), - }, - }, - }, - filesystem: { - used: { - pct: randomBetween(1, 4), - }, - }, - }, - metricset: { - period: interval, - }, - container: { - id: `container-${index}`, - name: 'container-name', - }, - }, - { - namespace: 'fake_hosts', - '@timestamp': timestamp.toISOString(), - host: { - name: `host-${index}`, - mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], - network: { - name: `network-${index}`, - ingress: { - bytes: parseInt(faker.string.numeric(3), 10), - }, - egress: { - bytes: parseInt(faker.string.numeric(3), 10), - }, - }, - }, - event: { - module: 'system', - dataset: 'system.network', - }, - labels: { - groupId: `group-${groupIndex}`, - eventId: `event-${index}`, - scenario, - }, - system: { - network: { - name: 'eth0', - in: { - bytes: generateNetworkData(timestamp.toISOString()), - }, - out: { - bytes: generateNetworkData(timestamp.toISOString()), - }, - }, - }, - metricset: { - period: interval, - }, - container: { - id: `container-${index}`, - name: 'container-name', - }, - }, - { - namespace: 'fake_hosts', - '@timestamp': timestamp.toISOString(), - host: { - name: `host-${index}`, - mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], - network: { - name: `network-${index}`, - }, - }, - event: { - module: 'system', - dataset: 'system.network', - }, - labels: { - groupId: `group-${groupIndex}`, - eventId: `event-${index}`, - scenario, - }, - system: { - network: { - name: 'eth1', - in: { - bytes: generateNetworkData(timestamp.toISOString()), - }, - out: { - bytes: generateNetworkData(timestamp.toISOString()), - }, - }, - }, - metricset: { - period: interval, - }, - container: { - id: `container-${index}`, - name: 'container-name', - }, - }, - ]; - return replaceMetricsWithShapes(timestamp, schedule, docs); -}; diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh deleted file mode 100755 index da992a32c79d..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../ecs - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --include $ECS/fields/custom \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh deleted file mode 100755 index 8cfa4b8956f2..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../../ecs -NAME=admin_console - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/$NAME -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh deleted file mode 100755 index dcbf7e9be9de..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../../ecs -NAME=heartbeat - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/$NAME -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json - diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh deleted file mode 100755 index 8e2778b740f0..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../../ecs -NAME=message_processor - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/$NAME -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --include $ECS/fields/custom \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json - diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh deleted file mode 100755 index af8cbb8ec625..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../../ecs -NAME=mongodb - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/$NAME -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --include $ECS/fields/custom \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json - diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh b/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh deleted file mode 100755 index 151e98b97fed..000000000000 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -cd ../../../../../../../../../ecs -NAME=nginx_proxy - -BASE=../kibana/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/$NAME -ECS=$BASE/ecs - -python3 ./scripts/generator.py --ref v8.0.0 \ - --subset $ECS/fields/subset.yml \ - --out $ECS/ \ - --template-settings-legacy $ECS/fields/template-settings-legacy.json \ - --template-settings $ECS/fields/template-settings.json \ - --mapping-settings $ECS/fields/mapping-settings.json - diff --git a/x-pack/packages/kbn-data-forge/tsconfig.json b/x-pack/packages/kbn-data-forge/tsconfig.json deleted file mode 100644 index ba7e50970091..000000000000 --- a/x-pack/packages/kbn-data-forge/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - "./src/**/*.json" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/tooling-log", - "@kbn/datemath", - "@kbn/safer-lodash-set", - "@kbn/dev-utils" - ] -} diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 8f80e61c0704..726f5faba2ed 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/ess/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -978,9 +978,9 @@ components: - assistant type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NormalizedAnonymizationFieldError: type: object diff --git a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml index 97c18a2f77b6..81112f147054 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/docs/openapi/serverless/elastic_assistant_api_2023_10_31.bundled.schema.yaml @@ -978,9 +978,9 @@ components: - assistant type: string NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NormalizedAnonymizationFieldError: type: object 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 1697011a0853..a49d6bc6e41b 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 @@ -15,15 +15,13 @@ */ import { z } from '@kbn/zod'; +import { isNonEmptyString } from '@kbn/zod-helpers'; /** - * A string that is not empty and does not contain only whitespace + * A string that does not contain only whitespace characters */ export type NonEmptyString = z.infer<typeof NonEmptyString>; -export const NonEmptyString = z - .string() - .min(1) - .regex(/^(?! *$).+$/); +export const NonEmptyString = z.string().min(1).superRefine(isNonEmptyString); /** * A universally unique identifier diff --git a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml index 348868746fb6..b400548631ed 100644 --- a/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml +++ b/x-pack/packages/kbn-elastic-assistant-common/impl/schemas/common_attributes.schema.yaml @@ -8,9 +8,9 @@ components: schemas: NonEmptyString: type: string - pattern: ^(?! *$).+$ + format: nonempty minLength: 1 - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters UUID: type: string @@ -33,4 +33,3 @@ components: enum: - 'asc' - 'desc' - diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx index 5352e60bcea4..35bf94bc1d1b 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; @@ -41,9 +41,7 @@ describe('useFetchAnonymizationFields', () => { wrapper: createWrapper(), }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useFetchAnonymizationFields()); - await waitForNextUpdate(); + await waitFor(() => { expect(http.fetch).toHaveBeenCalledWith( '/api/security_ai_assistant/anonymization_fields/_find', { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/capabilities/use_capabilities.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/capabilities/use_capabilities.test.tsx index 6101782ae43b..cc5df8d0a44b 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/capabilities/use_capabilities.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/capabilities/use_capabilities.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx index 7e87ca79e88a..50ae344a7867 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/conversations.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, waitFor, renderHook } from '@testing-library/react'; import { DeleteConversationParams, @@ -32,18 +32,18 @@ describe('conversations api', () => { await act(async () => { const deleteProps = { http, toasts, id: 'test' } as unknown as DeleteConversationParams; - const { waitForNextUpdate } = renderHook(() => deleteConversation(deleteProps)); - await waitForNextUpdate(); - - expect(deleteProps.http.fetch).toHaveBeenCalledWith( - '/api/security_ai_assistant/current_user/conversations/test', - { - method: 'DELETE', - signal: undefined, - version: '2023-10-31', - } - ); - expect(toasts.addError).not.toHaveBeenCalled(); + renderHook(() => deleteConversation(deleteProps)); + await waitFor(() => { + expect(deleteProps.http.fetch).toHaveBeenCalledWith( + '/api/security_ai_assistant/current_user/conversations/test', + { + method: 'DELETE', + signal: undefined, + version: '2023-10-31', + } + ); + expect(toasts.addError).not.toHaveBeenCalled(); + }); }); }); @@ -58,18 +58,18 @@ describe('conversations api', () => { it('should call api to get conversation', async () => { await act(async () => { const getProps = { http, toasts, id: 'test' } as unknown as GetConversationByIdParams; - const { waitForNextUpdate } = renderHook(() => getConversationById(getProps)); - await waitForNextUpdate(); - - expect(getProps.http.fetch).toHaveBeenCalledWith( - '/api/security_ai_assistant/current_user/conversations/test', - { - method: 'GET', - signal: undefined, - version: '2023-10-31', - } - ); - expect(toasts.addError).not.toHaveBeenCalled(); + renderHook(() => getConversationById(getProps)); + await waitFor(() => { + expect(getProps.http.fetch).toHaveBeenCalledWith( + '/api/security_ai_assistant/current_user/conversations/test', + { + method: 'GET', + signal: undefined, + version: '2023-10-31', + } + ); + expect(toasts.addError).not.toHaveBeenCalled(); + }); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx index f10c7d07a35d..cfe67c60324c 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/conversations/use_fetch_current_user_conversations.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; @@ -41,11 +41,7 @@ describe('useFetchCurrentUserConversations', () => { wrapper: createWrapper(), }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => - useFetchCurrentUserConversations(defaultProps) - ); - await waitForNextUpdate(); + await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/api/security_ai_assistant/current_user/conversations/_find', { 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 6d1296fc9aa6..913dbaed3263 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 @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { usePerformEvaluation, UsePerformEvaluationParams } from './use_perform_evaluation'; import { postEvaluation as _postEvaluation } from './evaluate'; import { useMutation as _useMutation } from '@tanstack/react-query'; @@ -50,10 +50,8 @@ describe('usePerformEvaluation', () => { jest.clearAllMocks(); }); it('should call api with undefined evalParams', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => usePerformEvaluation(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => usePerformEvaluation(defaultProps)); + await waitFor(() => { expect(defaultProps.http.post).toHaveBeenCalledWith('/internal/elastic_assistant/evaluate', { body: undefined, headers: { @@ -80,10 +78,9 @@ describe('usePerformEvaluation', () => { opts.onError(e); } }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => usePerformEvaluation(defaultProps)); - await waitForNextUpdate(); + renderHook(() => usePerformEvaluation(defaultProps)); + await waitFor(() => expect(defaultProps.http.post).toHaveBeenCalledWith('/internal/elastic_assistant/evaluate', { body: '{"graphs":["d","c"],"datasetName":"kewl","connectorIds":["h","g"],"runName":"test run"}', headers: { @@ -91,26 +88,19 @@ describe('usePerformEvaluation', () => { }, signal: undefined, version: API_VERSIONS.internal.v1, - }); - }); + }) + ); }); it('should return evaluation response', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => usePerformEvaluation(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual(statusResponse); - }); + const { result } = renderHook(() => usePerformEvaluation(defaultProps)); + await waitFor(() => expect(result.current).resolves.toStrictEqual(statusResponse)); }); it('should display error toast when api throws error', async () => { postEvaluationMock.mockRejectedValue(new Error('this is an error')); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => usePerformEvaluation(defaultProps)); - await waitForNextUpdate(); - expect(toasts.addError).toHaveBeenCalled(); - }); + renderHook(() => usePerformEvaluation(defaultProps)); + await waitFor(() => expect(toasts.addError).toHaveBeenCalled()); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_indices.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_indices.test.tsx index 4f258aa3c196..a77ab1d63aa6 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_indices.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_indices.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useKnowledgeBaseIndices, UseKnowledgeBaseIndicesParams, @@ -48,10 +48,8 @@ describe('useKnowledgeBaseIndices', () => { }); it('should call api to get knowledge base indices', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useKnowledgeBaseIndices(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => useKnowledgeBaseIndices(defaultProps)); + await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/knowledge_base/_indices', { @@ -65,20 +63,17 @@ describe('useKnowledgeBaseIndices', () => { }); it('should return indices response', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useKnowledgeBaseIndices(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual(indicesResponse); + const { result } = renderHook(() => useKnowledgeBaseIndices(defaultProps)); + await waitFor(() => { + expect(result.current).resolves.toStrictEqual(indicesResponse); }); }); it('should display error toast when api throws error', async () => { getKnowledgeBaseIndicesMock.mockRejectedValue(new Error('this is an error')); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useKnowledgeBaseIndices(defaultProps)); - await waitForNextUpdate(); + renderHook(() => useKnowledgeBaseIndices(defaultProps)); + await waitFor(() => { expect(toasts.addError).toHaveBeenCalled(); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx index 83073b5770ba..69fccba092ee 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_knowledge_base_status.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useKnowledgeBaseStatus, UseKnowledgeBaseStatusParams } from './use_knowledge_base_status'; import { getKnowledgeBaseStatus as _getKnowledgeBaseStatus } from './api'; @@ -49,10 +49,8 @@ describe('useKnowledgeBaseStatus', () => { jest.clearAllMocks(); }); it('should call api to get knowledge base status without resource arg', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useKnowledgeBaseStatus(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => useKnowledgeBaseStatus(defaultProps)); + await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/knowledge_base/', { @@ -65,12 +63,8 @@ describe('useKnowledgeBaseStatus', () => { }); }); it('should call api to get knowledge base status with resource arg', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => - useKnowledgeBaseStatus({ ...defaultProps, resource: 'something' }) - ); - await waitForNextUpdate(); - + renderHook(() => useKnowledgeBaseStatus({ ...defaultProps, resource: 'something' })); + await waitFor(() => expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/knowledge_base/something', { @@ -78,26 +72,18 @@ describe('useKnowledgeBaseStatus', () => { signal: undefined, version: '1', } - ); - }); + ) + ); }); it('should return status response', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useKnowledgeBaseStatus(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual(statusResponse); - }); + const { result } = renderHook(() => useKnowledgeBaseStatus(defaultProps)); + await waitFor(() => expect(result.current).resolves.toStrictEqual(statusResponse)); }); it('should display error toast when api throws error', async () => { getKnowledgeBaseStatusMock.mockRejectedValue(new Error('this is an error')); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useKnowledgeBaseStatus(defaultProps)); - await waitForNextUpdate(); - - expect(toasts.addError).toHaveBeenCalled(); - }); + renderHook(() => useKnowledgeBaseStatus(defaultProps)); + await waitFor(() => expect(toasts.addError).toHaveBeenCalled()); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx index c08f6f93617f..802ddf74bdf7 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/knowledge_base/use_setup_knowledge_base.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useSetupKnowledgeBase, UseSetupKnowledgeBaseParams } from './use_setup_knowledge_base'; import { postKnowledgeBase as _postKnowledgeBase } from './api'; import { useMutation as _useMutation } from '@tanstack/react-query'; @@ -50,10 +50,8 @@ describe('useSetupKnowledgeBase', () => { jest.clearAllMocks(); }); it('should call api to post knowledge base setup', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useSetupKnowledgeBase(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => useSetupKnowledgeBase(defaultProps)); + await waitFor(() => { expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/knowledge_base/', { @@ -73,36 +71,27 @@ describe('useSetupKnowledgeBase', () => { opts.onError(e); } }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useSetupKnowledgeBase(defaultProps)); - await waitForNextUpdate(); + renderHook(() => useSetupKnowledgeBase(defaultProps)); + await waitFor(() => expect(defaultProps.http.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/knowledge_base/something', { method: 'POST', version: '1', } - ); - }); + ) + ); }); it('should return setup response', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useSetupKnowledgeBase(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual(statusResponse); - }); + const { result } = renderHook(() => useSetupKnowledgeBase(defaultProps)); + await waitFor(() => expect(result.current).resolves.toStrictEqual(statusResponse)); }); it('should display error toast when api throws error', async () => { postKnowledgeBaseMock.mockRejectedValue(new Error('this is an error')); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useSetupKnowledgeBase(defaultProps)); - await waitForNextUpdate(); - - expect(toasts.addError).toHaveBeenCalled(); - }); + renderHook(() => useSetupKnowledgeBase(defaultProps)); + await waitFor(() => expect(toasts.addError).toHaveBeenCalled()); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx index 8e228d2787a3..8fb1f808f8df 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/api/prompts/use_fetch_prompts.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import type { ReactNode } from 'react'; @@ -41,9 +41,7 @@ describe('useFetchPrompts', () => { wrapper: createWrapper(), }); - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useFetchPrompts()); - await waitForNextUpdate(); + await waitFor(() => { expect(http.fetch).toHaveBeenCalledWith('/api/security_ai_assistant/prompts/_find', { method: 'GET', query: { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx index f72f85892d37..54fc610d405d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/chat_send/use_chat_send.test.tsx @@ -10,8 +10,7 @@ import { useSendMessage } from '../use_send_message'; import { useConversation } from '../use_conversation'; import { emptyWelcomeConvo, welcomeConvo } from '../../mock/conversation'; import { useChatSend, UseChatSendProps } from './use_chat_send'; -import { act, renderHook } from '@testing-library/react-hooks'; -import { waitFor } from '@testing-library/react'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { TestProviders } from '../../mock/test_providers/test_providers'; import { useAssistantContext } from '../../..'; @@ -64,10 +63,10 @@ describe('use chat send', () => { }); it('handleOnChatCleared clears the conversation', async () => { (clearConversation as jest.Mock).mockReturnValueOnce(testProps.currentConversation); - const { result, waitForNextUpdate } = renderHook(() => useChatSend(testProps), { + const { result } = renderHook(() => useChatSend(testProps), { wrapper: TestProviders, }); - await waitForNextUpdate(); + await waitFor(() => new Promise((resolve) => resolve(null))); act(() => { result.current.handleOnChatCleared(); }); @@ -99,7 +98,7 @@ describe('use chat send', () => { }); }); it('handleRegenerateResponse removes the last message of the conversation, resends the convo to GenAI, and appends the message received', async () => { - const { result, waitForNextUpdate } = renderHook( + const { result } = renderHook( () => useChatSend({ ...testProps, currentConversation: { ...welcomeConvo, id: 'welcome-id' } }), { @@ -107,7 +106,7 @@ describe('use chat send', () => { } ); - await waitForNextUpdate(); + await waitFor(() => new Promise((resolve) => resolve(null))); act(() => { result.current.handleRegenerateResponse(); }); @@ -121,10 +120,10 @@ describe('use chat send', () => { }); it('sends telemetry events for both user and assistant', async () => { const promptText = 'prompt text'; - const { result, waitForNextUpdate } = renderHook(() => useChatSend(testProps), { + const { result } = renderHook(() => useChatSend(testProps), { wrapper: TestProviders, }); - await waitForNextUpdate(); + await waitFor(() => new Promise((resolve) => resolve(null))); act(() => { result.current.handleChatSend(promptText); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conveersation_changed.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conveersation_changed.test.tsx index 091c691d8e32..0e088533ba1d 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conveersation_changed.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conveersation_changed.test.tsx @@ -4,7 +4,8 @@ * 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 { renderHook, act } from '@testing-library/react'; import { useConversationChanged } from './use_conversation_changed'; import { customConvo } from '../../../mock/conversation'; import { mockConnectors } from '../../../mock/connectors'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conversation_deletex.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conversation_deletex.test.tsx index f96de69b8ae7..5210d76d0579 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conversation_deletex.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/use_conversation_deletex.test.tsx @@ -4,7 +4,8 @@ * 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 { renderHook, act } from '@testing-library/react'; import { useConversationDeleted } from './use_conversation_deleted'; import { customConvo, alertConvo, welcomeConvo } from '../../../mock/conversation'; import { Conversation, ConversationsBulkActions } from '../../../..'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/use_conversations_table.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/use_conversations_table.test.tsx index 797bde346622..5a98d86b1b4a 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/use_conversations_table.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings_management/use_conversations_table.test.tsx @@ -4,7 +4,8 @@ * 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 { renderHook } from '@testing-library/react'; import { useConversationsTable, GetConversationsListParams, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/use_system_prompt_editor.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/use_system_prompt_editor.test.tsx index 009ee6c5a83c..507c6773dd39 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/use_system_prompt_editor.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/use_system_prompt_editor.test.tsx @@ -4,7 +4,8 @@ * 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 { renderHook, act } from '@testing-library/react'; import { useSystemPromptEditor } from './use_system_prompt_editor'; import { mockSystemPrompt, diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/use_system_prompt_table.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/use_system_prompt_table.test.tsx index 220e150ec864..4fa17c80e592 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/use_system_prompt_table.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/use_system_prompt_table.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useSystemPromptTable } from './use_system_prompt_table'; import { Conversation } from '../../../../assistant_context/types'; import { AIConnector } from '../../../../connectorland/connector_selector'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/use_quick_prompt_editor.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/use_quick_prompt_editor.test.tsx index 239b8a06293e..3626249c9fe3 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/use_quick_prompt_editor.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings/use_quick_prompt_editor.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook, act } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { useQuickPromptEditor } from './use_quick_prompt_editor'; import { mockAlertPromptContext } from '../../../mock/prompt_context'; import { MOCK_QUICK_PROMPTS } from '../../../mock/quick_prompt'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/use_quick_prompt_table.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/use_quick_prompt_table.test.tsx index ae91a8bb971c..9d957a77dd73 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/use_quick_prompt_table.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_settings_management/use_quick_prompt_table.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useQuickPromptTable } from './use_quick_prompt_table'; import { EuiTableActionsColumnType, EuiTableComputedColumnType } from '@elastic/eui'; import { MOCK_QUICK_PROMPTS } from '../../../mock/quick_prompt'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.test.tsx index e3a6ab1fc75b..8f68d99c3eaa 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/use_settings_updater/use_settings_updater.test.tsx @@ -4,7 +4,8 @@ * 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 { act, waitFor, renderHook } from '@testing-library/react'; import { DEFAULT_LATEST_ALERTS } from '../../../assistant_context/constants'; import { alertConvo, welcomeConvo } from '../../../mock/conversation'; @@ -98,96 +99,101 @@ describe('useSettingsUpdater', () => { jest.clearAllMocks(); }); it('should set all state variables to their initial values when resetSettings is called', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - useSettingsUpdater( - mockConversations, - { - data: [...mockSystemPrompts, ...mockQuickPrompts], - page: 1, - perPage: 100, - total: 10, - }, - conversationsLoaded, - promptsLoaded, - anonymizationFields - ) - ); - await waitForNextUpdate(); - const { - setConversationSettings, - setConversationsSettingsBulkActions, - setUpdatedKnowledgeBaseSettings, - setUpdatedAssistantStreamingEnabled, - resetSettings, - setPromptsBulkActions, - } = result.current; + const { result } = renderHook(() => + useSettingsUpdater( + mockConversations, + { + data: [...mockSystemPrompts, ...mockQuickPrompts], + page: 1, + perPage: 100, + total: 10, + }, + conversationsLoaded, + promptsLoaded, + anonymizationFields + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + const { + setConversationSettings, + setConversationsSettingsBulkActions, + setUpdatedKnowledgeBaseSettings, + setUpdatedAssistantStreamingEnabled, + resetSettings, + setPromptsBulkActions, + } = result.current; + act(() => { setConversationSettings(updatedValues.conversations); setConversationsSettingsBulkActions({}); setPromptsBulkActions({}); setUpdatedAnonymizationData(updatedValues.updatedAnonymizationData); setUpdatedKnowledgeBaseSettings(updatedValues.knowledgeBase); setUpdatedAssistantStreamingEnabled(updatedValues.assistantStreamingEnabled); + }); - expect(result.current.conversationSettings).toEqual(updatedValues.conversations); - expect(result.current.quickPromptSettings).toEqual(updatedValues.allQuickPrompts); - expect(result.current.systemPromptSettings).toEqual(updatedValues.allSystemPrompts); - expect(result.current.updatedAnonymizationData).toEqual(anonymizationFields); - expect(result.current.knowledgeBase).toEqual(updatedValues.knowledgeBase); - expect(result.current.assistantStreamingEnabled).toEqual( - updatedValues.assistantStreamingEnabled - ); + expect(result.current.conversationSettings).toEqual(updatedValues.conversations); + expect(result.current.quickPromptSettings).toEqual(updatedValues.allQuickPrompts); + expect(result.current.systemPromptSettings).toEqual(updatedValues.allSystemPrompts); + expect(result.current.updatedAnonymizationData).toEqual(anonymizationFields); + expect(result.current.knowledgeBase).toEqual(updatedValues.knowledgeBase); + expect(result.current.assistantStreamingEnabled).toEqual( + updatedValues.assistantStreamingEnabled + ); + act(() => { resetSettings(); - - expect(result.current.conversationSettings).toEqual(mockConversations); - expect(result.current.quickPromptSettings).toEqual(mockValues.allQuickPrompts); - expect(result.current.systemPromptSettings).toEqual(mockValues.allSystemPrompts); - expect(result.current.anonymizationFieldsBulkActions).toEqual( - mockValues.anonymizationFieldsBulkActions - ); - expect(result.current.knowledgeBase).toEqual(mockValues.knowledgeBase); - expect(result.current.assistantStreamingEnabled).toEqual( - mockValues.assistantStreamingEnabled - ); }); + + expect(result.current.conversationSettings).toEqual(mockConversations); + expect(result.current.quickPromptSettings).toEqual(mockValues.allQuickPrompts); + expect(result.current.systemPromptSettings).toEqual(mockValues.allSystemPrompts); + expect(result.current.anonymizationFieldsBulkActions).toEqual( + mockValues.anonymizationFieldsBulkActions + ); + expect(result.current.knowledgeBase).toEqual(mockValues.knowledgeBase); + expect(result.current.assistantStreamingEnabled).toEqual(mockValues.assistantStreamingEnabled); }); it('should update all state variables to their updated values when saveSettings is called', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - useSettingsUpdater( - mockConversations, - { - data: mockSystemPrompts, - page: 1, - perPage: 100, - total: 10, - }, - conversationsLoaded, - promptsLoaded, - anonymizationFields - ) - ); - await waitForNextUpdate(); - const { - setConversationSettings, - setConversationsSettingsBulkActions, - setAnonymizationFieldsBulkActions, - setUpdatedKnowledgeBaseSettings, - setPromptsBulkActions, - } = result.current; + const { result } = renderHook(() => + useSettingsUpdater( + mockConversations, + { + data: mockSystemPrompts, + page: 1, + perPage: 100, + total: 10, + }, + conversationsLoaded, + promptsLoaded, + anonymizationFields + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + + const { + setConversationSettings, + setConversationsSettingsBulkActions, + setAnonymizationFieldsBulkActions, + setUpdatedKnowledgeBaseSettings, + setPromptsBulkActions, + } = result.current; + act(() => { setConversationSettings(updatedValues.conversations); setConversationsSettingsBulkActions({ delete: { ids: ['1'] } }); setAnonymizationFieldsBulkActions({ delete: { ids: ['1'] } }); setPromptsBulkActions({}); setUpdatedAnonymizationData(updatedValues.updatedAnonymizationData); setUpdatedKnowledgeBaseSettings(updatedValues.knowledgeBase); + }); + await act(async () => { await result.current.saveSettings(); + }); + await waitFor(() => { expect(mockHttp.fetch).toHaveBeenCalledWith( '/internal/elastic_assistant/current_user/conversations/_bulk_action', { @@ -202,80 +208,99 @@ describe('useSettingsUpdater', () => { expect(setKnowledgeBaseMock).toHaveBeenCalledWith(updatedValues.knowledgeBase); }); }); + it('should track when alerts count is updated', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - useSettingsUpdater( - mockConversations, - { - data: mockSystemPrompts, - page: 1, - perPage: 100, - total: 10, - }, - conversationsLoaded, - promptsLoaded, - anonymizationFields - ) - ); - await waitForNextUpdate(); - const { setUpdatedKnowledgeBaseSettings } = result.current; + const { result } = renderHook(() => + useSettingsUpdater( + mockConversations, + { + data: mockSystemPrompts, + page: 1, + perPage: 100, + total: 10, + }, + conversationsLoaded, + promptsLoaded, + anonymizationFields + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + const { setUpdatedKnowledgeBaseSettings } = result.current; + act(() => { setUpdatedKnowledgeBaseSettings({ ...updatedValues.knowledgeBase, }); + }); + + await act(async () => { await result.current.saveSettings(); - expect(reportAssistantSettingToggled).toHaveBeenCalledWith({ alertsCountUpdated: true }); }); + + await waitFor(() => + expect(reportAssistantSettingToggled).toHaveBeenCalledWith({ alertsCountUpdated: true }) + ); }); + it('should track when streaming is updated', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - useSettingsUpdater( - mockConversations, - { - data: mockSystemPrompts, - page: 1, - perPage: 100, - total: 10, - }, - conversationsLoaded, - promptsLoaded, - anonymizationFields - ) - ); - await waitForNextUpdate(); - const { setUpdatedAssistantStreamingEnabled } = result.current; + const { result } = renderHook(() => + useSettingsUpdater( + mockConversations, + { + data: mockSystemPrompts, + page: 1, + perPage: 100, + total: 10, + }, + conversationsLoaded, + promptsLoaded, + anonymizationFields + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + + const { setUpdatedAssistantStreamingEnabled } = result.current; + + act(() => { setUpdatedAssistantStreamingEnabled(false); + }); + + await act(async () => { await result.current.saveSettings(); + }); + + await waitFor(() => expect(reportAssistantSettingToggled).toHaveBeenCalledWith({ assistantStreamingEnabled: false, - }); - }); + }) + ); }); + it('if no settings update, do not track anything', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => - useSettingsUpdater( - mockConversations, - { - data: mockSystemPrompts, - page: 1, - perPage: 100, - total: 10, - }, - conversationsLoaded, - promptsLoaded, - anonymizationFields - ) - ); - await waitForNextUpdate(); - const { setUpdatedKnowledgeBaseSettings } = result.current; + const { result } = renderHook(() => + useSettingsUpdater( + mockConversations, + { + data: mockSystemPrompts, + page: 1, + perPage: 100, + total: 10, + }, + conversationsLoaded, + promptsLoaded, + anonymizationFields + ) + ); + + await waitFor(() => new Promise((resolve) => resolve(null))); + const { setUpdatedKnowledgeBaseSettings } = result.current; + await act(async () => { setUpdatedKnowledgeBaseSettings(mockValues.knowledgeBase); await result.current.saveSettings(); - expect(reportAssistantSettingToggled).not.toHaveBeenCalledWith(); }); + + await waitFor(() => expect(reportAssistantSettingToggled).not.toHaveBeenCalledWith()); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.test.tsx index 780ffcbd9a32..7a142710d19e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_assistant_overlay/index.test.tsx @@ -5,11 +5,10 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; import { DefinedUseQueryResult } from '@tanstack/react-query'; import { useAssistantOverlay } from '.'; -import { waitFor } from '@testing-library/react'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { useFetchCurrentUserConversations } from '../api'; import { Conversation } from '../../assistant_context/types'; import { mockConnectors } from '../../mock/connectors'; diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.test.tsx index 696a2e41b37c..9e4fc2ab1a2c 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_conversation/index.test.tsx @@ -6,7 +6,7 @@ */ import { useConversation } from '.'; -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, waitFor, renderHook } from '@testing-library/react'; import { TestProviders } from '../../mock/test_providers/test_providers'; import React from 'react'; import { MessageRole } from '@kbn/elastic-assistant-common'; @@ -54,79 +54,86 @@ describe('useConversation', () => { }); it('should create a new conversation when called with valid conversationId and message', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConversation(), { - wrapper: ({ children }: React.PropsWithChildren<{}>) => ( - <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> - ), - }); - await waitForNextUpdate(); - createConversation.mockResolvedValue(mockConvo); + const { result } = renderHook(() => useConversation(), { + wrapper: ({ children }: React.PropsWithChildren<{}>) => ( + <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> + ), + }); + + await waitFor(() => new Promise((resolve) => resolve(null))); - const createResult = await result.current.createConversation({ + createConversation.mockResolvedValue(mockConvo); + + let createResult; + + await act(async () => { + createResult = await result.current.createConversation({ ...mockConvo, replacements: {}, title: mockConvo.title, category: 'assistant', }); - - expect(createResult).toEqual(mockConvo); }); + + expect(createResult).toEqual(mockConvo); }); it('should delete an existing conversation when called with valid conversationId', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConversation(), { - wrapper: ({ children }: React.PropsWithChildren<{}>) => ( - <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> - ), - }); - await waitForNextUpdate(); + const { result } = renderHook(() => useConversation(), { + wrapper: ({ children }: React.PropsWithChildren<{}>) => ( + <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> + ), + }); + + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.deleteConversation('new-convo'); + }); - expect(deleteConversation).toHaveBeenCalledWith({ - http: httpMock, - id: 'new-convo', - }); + expect(deleteConversation).toHaveBeenCalledWith({ + http: httpMock, + id: 'new-convo', }); }); it('should update the apiConfig for an existing conversation when called with a valid conversationId and apiConfig', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConversation(), { - wrapper: ({ children }: React.PropsWithChildren<{}>) => ( - <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> - ), - }); - await waitForNextUpdate(); + const { result } = renderHook(() => useConversation(), { + wrapper: ({ children }: React.PropsWithChildren<{}>) => ( + <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> + ), + }); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.setApiConfig({ conversation: WELCOME_CONVERSATION, apiConfig: mockConvo.apiConfig, }); + }); - expect(createConversation).toHaveBeenCalledWith({ - http: httpMock, - conversation: { ...WELCOME_CONVERSATION, apiConfig: mockConvo.apiConfig, id: '' }, - }); + expect(createConversation).toHaveBeenCalledWith({ + http: httpMock, + conversation: { ...WELCOME_CONVERSATION, apiConfig: mockConvo.apiConfig, id: '' }, }); }); it('should remove the last message from a conversation when called with valid conversationId', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useConversation(), { - wrapper: ({ children }: React.PropsWithChildren<{}>) => ( - <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> - ), - }); - await waitForNextUpdate(); + const { result } = renderHook(() => useConversation(), { + wrapper: ({ children }: React.PropsWithChildren<{}>) => ( + <TestProviders providerContext={{ http: httpMock }}>{children}</TestProviders> + ), + }); + await waitFor(() => new Promise((resolve) => resolve(null))); - getConversationById.mockResolvedValue(mockConvo); + getConversationById.mockResolvedValue(mockConvo); - const removeResult = await result.current.removeLastMessage('new-convo'); + let removeResult; - expect(removeResult).toEqual([message]); + await act(async () => { + removeResult = await result.current.removeLastMessage('new-convo'); }); + + expect(removeResult).toEqual([message]); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.test.tsx index 0f04068a89ca..f5ea35983dd8 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook, act } from '@testing-library/react-hooks'; +import { renderHook, act, waitFor } from '@testing-library/react'; import { useCurrentConversation, Props } from '.'; import { useConversation } from '../use_conversation'; import deepEqual from 'fast-deep-equal'; @@ -49,12 +49,15 @@ describe('useCurrentConversation', () => { }; beforeEach(() => { - jest.clearAllMocks(); (useConversation as jest.Mock).mockReturnValue(mockUseConversation); (deepEqual as jest.Mock).mockReturnValue(false); (find as jest.Mock).mockReturnValue(undefined); }); + afterEach(() => { + jest.clearAllMocks(); + }); + const defaultProps: Props = { // @ts-ignore not exact system prompt type, ok for test allSystemPrompts: [{ id: 'system-prompt-id' }, { id: 'something-crazy' }], @@ -321,16 +324,19 @@ describe('useCurrentConversation', () => { await act(async () => { await result.current.handleCreateConversation(); }); + const { defaultSystemPromptId: _, ...everythingExceptSystemPromptId } = mockData.welcome_id.apiConfig; - expect(mockUseConversation.createConversation).toHaveBeenCalledWith({ - apiConfig: { - ...everythingExceptSystemPromptId, - defaultSystemPromptId: 'LBOi3JEBy3uD9EGi1d_G', - }, - title: 'New chat', - }); + await waitFor(() => + expect(mockUseConversation.createConversation).toHaveBeenCalledWith({ + apiConfig: { + ...everythingExceptSystemPromptId, + defaultSystemPromptId: 'LBOi3JEBy3uD9EGi1d_G', + }, + title: 'New chat', + }) + ); }); it('should delete a conversation', async () => { diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.tsx index d599190ca562..267c39c402a1 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant/use_current_conversation/index.tsx @@ -207,6 +207,11 @@ export const useCurrentConversation = ({ // if no Welcome convo exists, create one getDefaultConversation({ cTitle: WELCOME_CONVERSATION_TITLE }); + // on the off chance that the conversation is not found, return + if (!nextConversation) { + return; + } + if (nextConversation && nextConversation.id === '') { // This is a default conversation that has not yet been initialized const conversation = await initializeDefaultConversationWithConnector(nextConversation); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.test.tsx index 4e877e1886fb..94e7800450c5 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/assistant_context/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useAssistantContext } from '.'; import useLocalStorage from 'react-use/lib/useLocalStorage'; @@ -18,10 +18,8 @@ describe('AssistantContext', () => { beforeEach(() => jest.clearAllMocks()); test('it throws an error when useAssistantContext hook is used without a SecurityAssistantContext', () => { - const { result } = renderHook(useAssistantContext); - - expect(result.error).toEqual( - new Error('useAssistantContext must be used within a AssistantProvider') + expect(() => renderHook(useAssistantContext)).toThrow( + /useAssistantContext must be used within a AssistantProvider/ ); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.test.tsx index 50d3a7379741..dd169c9e345e 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_action_types/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, waitFor, renderHook } from '@testing-library/react'; import { useLoadActionTypes, Props } from '.'; import { mockActionTypes } from '../../mock/connectors'; @@ -32,10 +32,8 @@ describe('useLoadActionTypes', () => { jest.clearAllMocks(); }); it('should call api to load action types', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useLoadActionTypes(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => useLoadActionTypes(defaultProps)); + await waitFor(() => { expect(defaultProps.http.get).toHaveBeenCalledWith('/api/actions/connector_types', { query: { feature_id: 'generativeAIForSecurity' }, }); @@ -44,26 +42,20 @@ describe('useLoadActionTypes', () => { }); it('should return sorted action types', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useLoadActionTypes(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual( + const { result } = renderHook(() => useLoadActionTypes(defaultProps)); + await waitFor(() => + expect(result.current).resolves.toStrictEqual( mockActionTypes.sort((a, b) => a.name.localeCompare(b.name)) - ); - }); + ) + ); }); it('should display error toast when api throws error', async () => { await act(async () => { const mockHttp = { get: jest.fn().mockRejectedValue(new Error('this is an error')), } as unknown as Props['http']; - const { waitForNextUpdate } = renderHook(() => - useLoadActionTypes({ ...defaultProps, http: mockHttp }) - ); - await waitForNextUpdate(); - - expect(toasts.addError).toHaveBeenCalled(); + renderHook(() => useLoadActionTypes({ ...defaultProps, http: mockHttp })); + await waitFor(() => expect(toasts.addError).toHaveBeenCalled()); }); }); }); diff --git a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_connectors/index.test.tsx b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_connectors/index.test.tsx index b29274efb19c..685d01c988e0 100644 --- a/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_connectors/index.test.tsx +++ b/x-pack/packages/kbn-elastic-assistant/impl/connectorland/use_load_connectors/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useLoadConnectors, Props } from '.'; import { mockConnectors } from '../../mock/connectors'; @@ -68,37 +68,27 @@ describe('useLoadConnectors', () => { jest.clearAllMocks(); }); it('should call api to load action types', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => useLoadConnectors(defaultProps)); - await waitForNextUpdate(); - + renderHook(() => useLoadConnectors(defaultProps)); + await waitFor(() => { expect(defaultProps.http.get).toHaveBeenCalledWith('/api/actions/connectors'); expect(toasts.addError).not.toHaveBeenCalled(); }); }); it('should return sorted action types, removing isMissingSecrets and wrong action type ids', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook(() => useLoadConnectors(defaultProps)); - await waitForNextUpdate(); - - await expect(result.current).resolves.toStrictEqual( + const { result } = renderHook(() => useLoadConnectors(defaultProps)); + await waitFor(() => { + expect(result.current).resolves.toStrictEqual( // @ts-ignore ts does not like config, but we define it in the mock data loadConnectorsResult.map((c) => ({ ...c, apiProvider: c.config.apiProvider })) ); }); }); it('should display error toast when api throws error', async () => { - await act(async () => { - const mockHttp = { - get: jest.fn().mockRejectedValue(new Error('this is an error')), - } as unknown as Props['http']; - const { waitForNextUpdate } = renderHook(() => - useLoadConnectors({ ...defaultProps, http: mockHttp }) - ); - await waitForNextUpdate(); - - expect(toasts.addError).toHaveBeenCalled(); - }); + const mockHttp = { + get: jest.fn().mockRejectedValue(new Error('this is an error')), + } as unknown as Props['http']; + renderHook(() => useLoadConnectors({ ...defaultProps, http: mockHttp })); + await waitFor(() => expect(toasts.addError).toHaveBeenCalled()); }); }); diff --git a/x-pack/packages/kbn-infra-forge/jest.config.js b/x-pack/packages/kbn-infra-forge/jest.config.js deleted file mode 100644 index d5bd842dee33..000000000000 --- a/x-pack/packages/kbn-infra-forge/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test/jest_node', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/packages/kbn-infra-forge'], -}; diff --git a/x-pack/packages/kbn-infra-forge/tsconfig.json b/x-pack/packages/kbn-infra-forge/tsconfig.json deleted file mode 100644 index 09420c85fcfd..000000000000 --- a/x-pack/packages/kbn-infra-forge/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - "./src/data_sources/composable/component/base.json", - "./src/data_sources/composable/component/event.json", - "./src/data_sources/composable/component/host.json", - "./src/data_sources/composable/component/metricset.json", - "./src/data_sources/composable/component/system.json", - "./src/data_sources/composable/template.json" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/tooling-log", - "@kbn/datemath" - ] -} diff --git a/x-pack/packages/kbn-slo-schema/jest.config.js b/x-pack/packages/kbn-slo-schema/jest.config.js deleted file mode 100644 index 915ccf489264..000000000000 --- a/x-pack/packages/kbn-slo-schema/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/packages/kbn-slo-schema'], -}; diff --git a/x-pack/packages/kbn-slo-schema/tsconfig.json b/x-pack/packages/kbn-slo-schema/tsconfig.json deleted file mode 100644 index cd411fff0db4..000000000000 --- a/x-pack/packages/kbn-slo-schema/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/std", - "@kbn/io-ts-utils", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/packages/observability/alert_details/jest.config.js b/x-pack/packages/observability/alert_details/jest.config.js deleted file mode 100644 index 746e2af6257c..000000000000 --- a/x-pack/packages/observability/alert_details/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/observability/alert_details'], -}; diff --git a/x-pack/packages/observability/alert_details/tsconfig.json b/x-pack/packages/observability/alert_details/tsconfig.json deleted file mode 100644 index d1b4c3fb2ce2..000000000000 --- a/x-pack/packages/observability/alert_details/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/rule-data-utils", - "@kbn/core", - "@kbn/rule-registry-plugin", - "@kbn/core-http-browser-mocks" - ] -} diff --git a/x-pack/packages/observability/alerting_rule_utils/jest.config.js b/x-pack/packages/observability/alerting_rule_utils/jest.config.js deleted file mode 100644 index 605fe2b4fcdc..000000000000 --- a/x-pack/packages/observability/alerting_rule_utils/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/observability/alerting_rule_utils'], -}; diff --git a/x-pack/packages/observability/alerting_rule_utils/tsconfig.json b/x-pack/packages/observability/alerting_rule_utils/tsconfig.json deleted file mode 100644 index baf441402ea8..000000000000 --- a/x-pack/packages/observability/alerting_rule_utils/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/alerts-as-data-utils" - ] -} diff --git a/x-pack/packages/observability/alerting_test_data/jest.config.js b/x-pack/packages/observability/alerting_test_data/jest.config.js deleted file mode 100644 index 05b0dbe61305..000000000000 --- a/x-pack/packages/observability/alerting_test_data/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/observability/alerting_test_data'], -}; diff --git a/x-pack/packages/observability/alerting_test_data/tsconfig.json b/x-pack/packages/observability/alerting_test_data/tsconfig.json deleted file mode 100644 index 109b0dfbcf1a..000000000000 --- a/x-pack/packages/observability/alerting_test_data/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/observability-plugin", - "@kbn/rule-data-utils", - "@kbn/alerting-comparators", - ] -} diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/jest.config.js b/x-pack/packages/observability/get_padded_alert_time_range_util/jest.config.js deleted file mode 100644 index 2e476b09b3c4..000000000000 --- a/x-pack/packages/observability/get_padded_alert_time_range_util/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/observability/get_padded_alert_time_range_util'], -}; diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/tsconfig.json b/x-pack/packages/observability/get_padded_alert_time_range_util/tsconfig.json deleted file mode 100644 index 0d78dace105e..000000000000 --- a/x-pack/packages/observability/get_padded_alert_time_range_util/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node" - ] - }, - "include": [ - "**/*.ts", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [] -} diff --git a/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_entities_by_fuzzy_search.ts b/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_entities_by_fuzzy_search.ts new file mode 100644 index 000000000000..aedf89b2ab97 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_entities_by_fuzzy_search.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { castArray, orderBy } from 'lodash'; +import Fuse from 'fuse.js'; +import { ObservabilityElasticsearchClient } from '../es/client/create_observability_es_client'; + +export async function getEntitiesByFuzzySearch({ + esClient, + entity, + start, + end, + index, +}: { + esClient: ObservabilityElasticsearchClient; + entity: Record<string, string>; + start: number; + end: number; + index: string | string[]; +}): Promise<string[]> { + if (Object.keys(entity).length > 1) { + return []; + } + + const [field, value] = Object.entries(entity)[0]; + + const { terms } = await esClient.client.termsEnum({ + index: castArray(index).join(','), + field, + index_filter: { + range: { + '@timestamp': { + gte: new Date(start).toISOString(), + lte: new Date(end).toISOString(), + }, + }, + }, + size: 10_000, + }); + + const results = new Fuse(terms, { includeScore: true, threshold: 0.75 }).search(value); + + return orderBy(results, (result) => result.score, 'asc') + .slice(0, 5) + .map((result) => result.item); +} diff --git a/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_log_patterns.ts b/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_log_patterns.ts new file mode 100644 index 000000000000..b4071d665f38 --- /dev/null +++ b/x-pack/packages/observability/observability_utils/observability_utils_server/entities/get_log_patterns.ts @@ -0,0 +1,405 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + AggregationsCategorizeTextAggregation, + AggregationsDateHistogramAggregation, + AggregationsMaxAggregation, + AggregationsMinAggregation, + AggregationsTopHitsAggregation, + QueryDslQueryContainer, +} from '@elastic/elasticsearch/lib/api/types'; +import { categorizationAnalyzer } from '@kbn/aiops-log-pattern-analysis/categorization_analyzer'; +import { ChangePointType } from '@kbn/es-types/src'; +import { pValueToLabel } from '@kbn/observability-utils-common/ml/p_value_to_label'; +import { calculateAuto } from '@kbn/calculate-auto'; +import { omit, orderBy, uniqBy } from 'lodash'; +import moment from 'moment'; +import { ObservabilityElasticsearchClient } from '../es/client/create_observability_es_client'; +import { kqlQuery } from '../es/queries/kql_query'; +import { rangeQuery } from '../es/queries/range_query'; + +interface FieldPatternResultBase { + field: string; + count: number; + pattern: string; + regex: string; + sample: string; + firstOccurrence: string; + lastOccurrence: string; + highlight: Record<string, string[]>; + metadata: Record<string, unknown[]>; +} + +interface FieldPatternResultChanges { + timeseries: Array<{ x: number; y: number }>; + change: { + timestamp?: string; + significance: 'high' | 'medium' | 'low' | null; + type: ChangePointType; + change_point?: number; + p_value?: number; + }; +} + +export type FieldPatternResult<TChanges extends boolean | undefined = undefined> = + FieldPatternResultBase & (TChanges extends true ? FieldPatternResultChanges : {}); + +export type FieldPatternResultWithChanges = FieldPatternResult<true>; + +interface CategorizeTextOptions { + query: QueryDslQueryContainer; + metadata: string[]; + esClient: ObservabilityElasticsearchClient; + samplingProbability: number; + fields: string[]; + index: string | string[]; + useMlStandardTokenizer: boolean; + size: number; + start: number; + end: number; +} +// eslint-disable-next-line @typescript-eslint/consistent-type-definitions +type CategorizeTextSubAggregations = { + sample: { top_hits: AggregationsTopHitsAggregation }; + minTimestamp: { min: AggregationsMinAggregation }; + maxTimestamp: { max: AggregationsMaxAggregation }; +}; + +interface CategorizeTextAggregationResult { + categorize_text: AggregationsCategorizeTextAggregation; + aggs: CategorizeTextSubAggregations & + ( + | {} + | { + timeseries: { date_histogram: AggregationsDateHistogramAggregation }; + changes: { change_point: { buckets_path: string } }; + } + ); +} + +export async function runCategorizeTextAggregation< + TChanges extends boolean | undefined = undefined +>( + options: CategorizeTextOptions & { includeChanges?: TChanges } +): Promise<Array<FieldPatternResult<TChanges>>>; + +export async function runCategorizeTextAggregation({ + esClient, + fields, + metadata, + index, + query, + samplingProbability, + useMlStandardTokenizer, + includeChanges, + size, + start, + end, +}: CategorizeTextOptions & { includeChanges?: boolean }): Promise< + Array<FieldPatternResult<boolean>> +> { + const aggs = Object.fromEntries( + fields.map((field): [string, CategorizeTextAggregationResult] => [ + field, + { + categorize_text: { + field, + min_doc_count: 1, + size, + categorization_analyzer: useMlStandardTokenizer + ? { + tokenizer: 'ml_standard', + char_filter: [ + { + type: 'pattern_replace', + pattern: '\\\\n', + replacement: '', + } as unknown as string, + ], + } + : categorizationAnalyzer, + }, + aggs: { + minTimestamp: { + min: { + field: '@timestamp', + }, + }, + maxTimestamp: { + max: { + field: '@timestamp', + }, + }, + ...(includeChanges + ? { + timeseries: { + date_histogram: { + field: '@timestamp', + min_doc_count: 0, + extended_bounds: { + min: start, + max: end, + }, + fixed_interval: `${calculateAuto + .atLeast(30, moment.duration(end - start, 'ms'))! + .asMilliseconds()}ms`, + }, + }, + changes: { + change_point: { + buckets_path: 'timeseries>_count', + }, + }, + } + : {}), + sample: { + top_hits: { + size: 1, + _source: false, + fields: [field, ...metadata], + sort: { + _score: { + order: 'desc', + }, + }, + highlight: { + fields: { + '*': {}, + }, + }, + }, + }, + }, + }, + ]) + ); + + const response = await esClient.search('get_log_patterns', { + index, + size: 0, + track_total_hits: false, + query: { + bool: { + filter: [query, ...rangeQuery(start, end)], + }, + }, + aggregations: { + sampler: { + random_sampler: { + probability: samplingProbability, + }, + aggs, + }, + }, + }); + + if (!response.aggregations) { + return []; + } + + const fieldAggregates = omit(response.aggregations.sampler, 'seed', 'doc_count', 'probability'); + + return Object.entries(fieldAggregates).flatMap(([fieldName, aggregate]) => { + const buckets = aggregate.buckets; + + return buckets.map((bucket) => { + return { + field: fieldName, + count: bucket.doc_count, + pattern: bucket.key, + regex: bucket.regex, + sample: bucket.sample.hits.hits[0].fields![fieldName][0] as string, + highlight: bucket.sample.hits.hits[0].highlight ?? {}, + metadata: bucket.sample.hits.hits[0].fields!, + firstOccurrence: new Date(bucket.minTimestamp.value!).toISOString(), + lastOccurrence: new Date(bucket.maxTimestamp.value!).toISOString(), + ...('timeseries' in bucket + ? { + timeseries: bucket.timeseries.buckets.map((dateBucket) => ({ + x: dateBucket.key, + y: dateBucket.doc_count, + })), + change: Object.entries(bucket.changes.type).map( + ([changePointType, change]): FieldPatternResultChanges['change'] => { + return { + type: changePointType as ChangePointType, + significance: + change.p_value !== undefined ? pValueToLabel(change.p_value) : null, + change_point: change.change_point, + p_value: change.p_value, + timestamp: + change.change_point !== undefined + ? bucket.timeseries.buckets[change.change_point].key_as_string + : undefined, + }; + } + )[0], + } + : {}), + }; + }); + }); +} + +interface LogPatternOptions { + esClient: ObservabilityElasticsearchClient; + start: number; + end: number; + index: string | string[]; + kuery: string; + metadata?: string[]; + fields: string[]; +} + +export async function getLogPatterns<TChanges extends boolean | undefined = undefined>( + options: LogPatternOptions & { includeChanges?: TChanges } +): Promise<Array<FieldPatternResult<TChanges>>>; + +export async function getLogPatterns({ + esClient, + start, + end, + index, + kuery, + includeChanges, + metadata = [], + fields, +}: LogPatternOptions & { includeChanges?: boolean }): Promise<Array<FieldPatternResult<boolean>>> { + const fieldCapsResponse = await esClient.fieldCaps('get_field_caps_for_log_pattern_analysis', { + fields, + index_filter: { + bool: { + filter: [...rangeQuery(start, end)], + }, + }, + index, + types: ['text', 'match_only_text'], + }); + + const fieldsInFieldCaps = Object.keys(fieldCapsResponse.fields); + + if (!fieldsInFieldCaps.length) { + return []; + } + + const totalDocsResponse = await esClient.search('get_total_docs_for_log_pattern_analysis', { + index, + size: 0, + track_total_hits: true, + query: { + bool: { + filter: [...kqlQuery(kuery), ...rangeQuery(start, end)], + }, + }, + }); + + const totalHits = totalDocsResponse.hits.total.value; + + if (totalHits === 0) { + return []; + } + + let samplingProbability = 100_000 / totalHits; + + if (samplingProbability >= 0.5) { + samplingProbability = 1; + } + + const fieldGroups = includeChanges + ? fieldsInFieldCaps.map((field) => [field]) + : [fieldsInFieldCaps]; + + const allPatterns = await Promise.all( + fieldGroups.map(async (fieldGroup) => { + const topMessagePatterns = await runCategorizeTextAggregation({ + esClient, + index, + fields: fieldGroup, + query: { + bool: { + filter: kqlQuery(kuery), + }, + }, + samplingProbability, + useMlStandardTokenizer: false, + size: 100, + start, + end, + includeChanges, + metadata, + }); + + if (topMessagePatterns.length === 0) { + return []; + } + + const patternsToExclude = topMessagePatterns.filter((pattern) => { + // elasticsearch will barf because the query is too complex. this measures + // the # of groups to capture for a measure of complexity. + const complexity = pattern.regex.match(/(\.\+\?)|(\.\*\?)/g)?.length ?? 0; + return ( + complexity <= 25 && + // anything less than 50 messages should be re-processed with the ml_standard tokenizer + pattern.count > 50 + ); + }); + + const rareMessagePatterns = await runCategorizeTextAggregation({ + esClient, + index, + fields: fieldGroup, + start, + end, + query: { + bool: { + filter: kqlQuery(kuery), + must_not: [ + ...patternsToExclude.map((pattern) => { + return { + bool: { + filter: [ + { + regexp: { + [pattern.field]: { + value: pattern.regex, + }, + }, + }, + { + match: { + [pattern.field]: { + query: pattern.pattern, + fuzziness: 0, + operator: 'and' as const, + auto_generate_synonyms_phrase_query: false, + }, + }, + }, + ], + }, + }; + }), + ], + }, + }, + size: 1000, + includeChanges, + samplingProbability: 1, + useMlStandardTokenizer: true, + metadata, + }); + + return [...patternsToExclude, ...rareMessagePatterns]; + }) + ); + + return uniqBy( + orderBy(allPatterns.flat(), (pattern) => pattern.count, 'desc'), + (pattern) => pattern.sample + ); +} diff --git a/x-pack/packages/observability/observability_utils/observability_utils_server/tsconfig.json b/x-pack/packages/observability/observability_utils/observability_utils_server/tsconfig.json index f6dd781184b8..33d7e75322f0 100644 --- a/x-pack/packages/observability/observability_utils/observability_utils_server/tsconfig.json +++ b/x-pack/packages/observability/observability_utils/observability_utils_server/tsconfig.json @@ -24,6 +24,8 @@ "@kbn/alerting-plugin", "@kbn/rule-registry-plugin", "@kbn/rule-data-utils", + "@kbn/aiops-log-pattern-analysis", + "@kbn/calculate-auto", "@kbn/utility-types", "@kbn/task-manager-plugin", ] diff --git a/x-pack/packages/observability/synthetics_test_data/index.ts b/x-pack/packages/observability/synthetics_test_data/index.ts deleted file mode 100644 index d1fe1034d7b1..000000000000 --- a/x-pack/packages/observability/synthetics_test_data/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { makeUpSummary, makeDownSummary } from './src/make_summaries'; diff --git a/x-pack/packages/observability/synthetics_test_data/jest.config.js b/x-pack/packages/observability/synthetics_test_data/jest.config.js deleted file mode 100644 index 62001f407224..000000000000 --- a/x-pack/packages/observability/synthetics_test_data/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/observability/synthetics_test_data'], -}; diff --git a/x-pack/packages/observability/synthetics_test_data/tsconfig.json b/x-pack/packages/observability/synthetics_test_data/tsconfig.json deleted file mode 100644 index 86d57b8d692f..000000000000 --- a/x-pack/packages/observability/synthetics_test_data/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - ] -} diff --git a/x-pack/packages/security-solution/README.mdx b/x-pack/packages/security-solution/README.mdx deleted file mode 100644 index 8f46e37529f9..000000000000 --- a/x-pack/packages/security-solution/README.mdx +++ /dev/null @@ -1,10 +0,0 @@ -## Security Solution package - -This package compiles components used by Security Solution - -### Lazy by default - -All components are exported to be lazily-loaded with a default `React.Suspense` default most appropriate to its nature. - -If a page needs to alter the `React.Suspense` behavior, (e.g. a different "loading" component), one can import the `Lazy[ComponentName]` version and surround it with a custom `React.Suspense` component. - diff --git a/x-pack/packages/security-solution/data_table/jest.config.js b/x-pack/packages/security-solution/data_table/jest.config.js deleted file mode 100644 index 38f769e20277..000000000000 --- a/x-pack/packages/security-solution/data_table/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - roots: ['<rootDir>/x-pack/packages/security-solution/data_table'], - rootDir: '../../../..', -}; diff --git a/x-pack/packages/security-solution/data_table/tsconfig.json b/x-pack/packages/security-solution/data_table/tsconfig.json deleted file mode 100644 index 9fab7f29b9aa..000000000000 --- a/x-pack/packages/security-solution/data_table/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": ["jest", "node", "react"] - }, - "include": ["**/*.ts", "**/*.tsx"], - "exclude": ["target/**/*"], - "kbn_references": [ - "@kbn/cell-actions", - "@kbn/timelines-plugin", - "@kbn/es-query", - "@kbn/triggers-actions-ui-plugin", - "@kbn/securitysolution-ecs", - "@kbn/safer-lodash-set", - "@kbn/i18n", - "@kbn/ui-theme", - "@kbn/kibana-react-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/i18n-react", - "@kbn/ui-actions-plugin", - "@kbn/data-views-plugin", - "@kbn/field-formats-plugin", - "@kbn/data-plugin" - ] -} diff --git a/x-pack/packages/security-solution/distribution_bar/jest.config.js b/x-pack/packages/security-solution/distribution_bar/jest.config.js deleted file mode 100644 index efe091d25afd..000000000000 --- a/x-pack/packages/security-solution/distribution_bar/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - roots: ['<rootDir>/x-pack/packages/security-solution/distribution_bar'], - rootDir: '../../../..', -}; diff --git a/x-pack/packages/security-solution/distribution_bar/tsconfig.json b/x-pack/packages/security-solution/distribution_bar/tsconfig.json deleted file mode 100644 index b87424ce1101..000000000000 --- a/x-pack/packages/security-solution/distribution_bar/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop", - "@testing-library/jest-dom", - "@testing-library/react", - ] - }, - "include": ["**/*.ts", "**/*.tsx"], - "kbn_references": [ - "@kbn/ui-theme", - ], - "exclude": ["target/**/*"] -} 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 deleted file mode 100644 index 5f6f7ab9bce1..000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/jest.config.js +++ /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. - */ - -module.exports = { - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/packages/security-solution/ecs_data_quality_dashboard_impl', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.{ts,tsx}', - '!<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/{__test__,__snapshots__,__examples__,*mock*,stub,tests,test_helpers,integration_tests,types}/**/*', - '!<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*mock*.{ts,tsx}', - '!<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.test.{ts,tsx}', - '!<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.d.ts', - '!<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/**/*.config.ts', - ], - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard'], - setupFilesAfterEnv: [ - '<rootDir>/x-pack/packages/security-solution/ecs_data_quality_dashboard/setup_tests.ts', - ], -}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/tsconfig.json b/x-pack/packages/security-solution/ecs_data_quality_dashboard/tsconfig.json deleted file mode 100644 index e42a91639697..000000000000 --- a/x-pack/packages/security-solution/ecs_data_quality_dashboard/tsconfig.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx", - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/i18n-react", - "@kbn/ui-theme", - "@kbn/core-http-browser", - "@kbn/core-http-browser-mocks", - "@kbn/elastic-assistant", - "@kbn/triggers-actions-ui-plugin", - "@kbn/core", - "@kbn/core-notifications-browser", - "@kbn/core-notifications-browser-mocks", - ] -} diff --git a/x-pack/packages/security-solution/features/jest.config.js b/x-pack/packages/security-solution/features/jest.config.js deleted file mode 100644 index 47da21e7adff..000000000000 --- a/x-pack/packages/security-solution/features/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/security-solution/features'], -}; diff --git a/x-pack/packages/security-solution/features/tsconfig.json b/x-pack/packages/security-solution/features/tsconfig.json deleted file mode 100644 index 2c153f831721..000000000000 --- a/x-pack/packages/security-solution/features/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - ] - }, - "include": ["**/*.ts", "**/*.tsx"], - "kbn_references": [ - "@kbn/features-plugin", - "@kbn/utility-types", - "@kbn/i18n", - "@kbn/core-application-common", - "@kbn/cases-plugin", - "@kbn/securitysolution-rules", - "@kbn/securitysolution-list-constants", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/packages/security-solution/navigation/jest.config.js b/x-pack/packages/security-solution/navigation/jest.config.js deleted file mode 100644 index a150e2a7b4c9..000000000000 --- a/x-pack/packages/security-solution/navigation/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/security-solution/navigation'], -}; diff --git a/x-pack/packages/security-solution/navigation/tsconfig.json b/x-pack/packages/security-solution/navigation/tsconfig.json deleted file mode 100644 index a0ba8fb180bf..000000000000 --- a/x-pack/packages/security-solution/navigation/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop", - "@testing-library/jest-dom", - "@testing-library/react" - ] - }, - "include": ["**/*.ts", "**/*.tsx"], - "kbn_references": [ - "@kbn/i18n", - "@kbn/core", - "@kbn/deeplinks-security" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/packages/security-solution/side_nav/jest.config.js b/x-pack/packages/security-solution/side_nav/jest.config.js deleted file mode 100644 index 89a16e7fff05..000000000000 --- a/x-pack/packages/security-solution/side_nav/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/security-solution/side_nav'], -}; diff --git a/x-pack/packages/security-solution/side_nav/tsconfig.json b/x-pack/packages/security-solution/side_nav/tsconfig.json deleted file mode 100644 index 4468c671f435..000000000000 --- a/x-pack/packages/security-solution/side_nav/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop", - "@testing-library/jest-dom", - "@testing-library/react", - "@kbn/ambient-ui-types" - ] - }, - "include": ["**/*.ts", "**/*.tsx"], - "kbn_references": [ - "@kbn/i18n", - "@kbn/analytics", - "@kbn/shared-ux-page-solution-nav", - "@kbn/security-solution-navigation", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/packages/security-solution/storybook/config/kibana.jsonc b/x-pack/packages/security-solution/storybook/config/kibana.jsonc deleted file mode 100644 index cc52a3074f25..000000000000 --- a/x-pack/packages/security-solution/storybook/config/kibana.jsonc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "type": "shared-common", - "id": "@kbn/security-solution-storybook-config", - "owner": "@elastic/security-threat-hunting-explore" -} diff --git a/x-pack/packages/security-solution/storybook/config/main.ts b/x-pack/packages/security-solution/storybook/config/main.ts deleted file mode 100644 index 4e7fca030c2f..000000000000 --- a/x-pack/packages/security-solution/storybook/config/main.ts +++ /dev/null @@ -1,16 +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 { defaultConfig } from '@kbn/storybook'; - -module.exports = { - ...defaultConfig, - stories: ['../../**/*.stories.+(tsx|mdx)'], - reactOptions: { - strictMode: true, - }, -}; diff --git a/x-pack/packages/security-solution/storybook/config/tsconfig.json b/x-pack/packages/security-solution/storybook/config/tsconfig.json deleted file mode 100644 index 1f8b2275f519..000000000000 --- a/x-pack/packages/security-solution/storybook/config/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "@kbn/ambient-storybook-types", - ] - }, - "include": [ - "**/*.ts" - ], - "kbn_references": [ - "@kbn/storybook", - ], - "exclude": [ - "target/**/*", - ] -} diff --git a/x-pack/packages/security-solution/upselling/jest.config.js b/x-pack/packages/security-solution/upselling/jest.config.js deleted file mode 100644 index 014db69e5a69..000000000000 --- a/x-pack/packages/security-solution/upselling/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/packages/security-solution/upselling'], -}; diff --git a/x-pack/packages/security-solution/upselling/tsconfig.json b/x-pack/packages/security-solution/upselling/tsconfig.json deleted file mode 100644 index 70b145ed91b7..000000000000 --- a/x-pack/packages/security-solution/upselling/tsconfig.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types", - "types": [ - "jest", - "node", - "react", - "@emotion/react/types/css-prop", - "@testing-library/jest-dom", - "@testing-library/react", - "@kbn/ambient-ui-types" - ] - }, - "include": [ - "**/*.ts", - "**/*.tsx" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/security-solution-navigation", - "@kbn/shared-ux-page-kibana-template", - ], - "exclude": [ - "target/**/*" - ] -} diff --git a/x-pack/packages/security/api_key_management/src/components/token_field.tsx b/x-pack/packages/security/api_key_management/src/components/token_field.tsx index ccda03a2315c..fa3454bfae0b 100644 --- a/x-pack/packages/security/api_key_management/src/components/token_field.tsx +++ b/x-pack/packages/security/api_key_management/src/components/token_field.tsx @@ -52,7 +52,7 @@ export const TokenField: FunctionComponent<TokenFieldProps> = ({ value, ...props defaultMessage: 'Copy to clipboard', })} iconType="copyClipboard" - color="success" + color="accentSecondary" style={{ backgroundColor: 'transparent' }} onClick={copyText} /> diff --git a/x-pack/packages/security/plugin_types_server/index.ts b/x-pack/packages/security/plugin_types_server/index.ts index 2b46fa0146a2..4f213fc6c992 100644 --- a/x-pack/packages/security/plugin_types_server/index.ts +++ b/x-pack/packages/security/plugin_types_server/index.ts @@ -50,6 +50,7 @@ export type { CheckUserProfilesPrivileges, AuthorizationMode, AuthorizationServiceSetup, + EsSecurityConfig, } from './src/authorization'; export type { SecurityPluginSetup, SecurityPluginStart } from './src/plugin'; export type { diff --git a/x-pack/packages/security/plugin_types_server/src/authorization/es_security_config.ts b/x-pack/packages/security/plugin_types_server/src/authorization/es_security_config.ts new file mode 100644 index 000000000000..3f4d244d5fb9 --- /dev/null +++ b/x-pack/packages/security/plugin_types_server/src/authorization/es_security_config.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. + */ + +import type { Client } from '@elastic/elasticsearch'; + +type XpackUsageResponse = Awaited<ReturnType<Client['xpack']['usage']>>; +type XpackUsageSecurity = XpackUsageResponse['security']; + +export type EsSecurityConfig = Pick<XpackUsageSecurity, 'operator_privileges'>; diff --git a/x-pack/packages/security/plugin_types_server/src/authorization/index.ts b/x-pack/packages/security/plugin_types_server/src/authorization/index.ts index c48e797dc1d1..0ffa0900fa2d 100644 --- a/x-pack/packages/security/plugin_types_server/src/authorization/index.ts +++ b/x-pack/packages/security/plugin_types_server/src/authorization/index.ts @@ -43,6 +43,7 @@ export type { PrivilegeDeprecationsRolesByFeatureIdResponse, } from './deprecations'; export type { AuthorizationMode } from './mode'; +export type { EsSecurityConfig } from './es_security_config'; export { GLOBAL_RESOURCE } from './constants'; export { elasticsearchRoleSchema, getKibanaRoleSchema } from './role_schema'; diff --git a/x-pack/packages/security/plugin_types_server/src/plugin.ts b/x-pack/packages/security/plugin_types_server/src/plugin.ts index 7d37935ab760..c834dc46225f 100644 --- a/x-pack/packages/security/plugin_types_server/src/plugin.ts +++ b/x-pack/packages/security/plugin_types_server/src/plugin.ts @@ -45,7 +45,7 @@ export interface SecurityPluginStart { /** * Authorization services to manage and access the permissions a particular user has. */ - authz: AuthorizationServiceSetup; + authz: Omit<AuthorizationServiceSetup, 'getCurrentUser' | 'getSecurityConfig'>; /** * User profiles services to retrieve user profiles. * diff --git a/x-pack/packages/kbn-infra-forge/README.md b/x-pack/platform/packages/private/kbn-infra-forge/README.md similarity index 100% rename from x-pack/packages/kbn-infra-forge/README.md rename to x-pack/platform/packages/private/kbn-infra-forge/README.md diff --git a/x-pack/packages/kbn-infra-forge/index.ts b/x-pack/platform/packages/private/kbn-infra-forge/index.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/index.ts rename to x-pack/platform/packages/private/kbn-infra-forge/index.ts diff --git a/x-pack/platform/packages/private/kbn-infra-forge/jest.config.js b/x-pack/platform/packages/private/kbn-infra-forge/jest.config.js new file mode 100644 index 000000000000..ca4dd781d58f --- /dev/null +++ b/x-pack/platform/packages/private/kbn-infra-forge/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/jest_node', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/platform/packages/private/kbn-infra-forge'], +}; diff --git a/x-pack/packages/kbn-infra-forge/kibana.jsonc b/x-pack/platform/packages/private/kbn-infra-forge/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-infra-forge/kibana.jsonc rename to x-pack/platform/packages/private/kbn-infra-forge/kibana.jsonc diff --git a/x-pack/packages/kbn-infra-forge/package.json b/x-pack/platform/packages/private/kbn-infra-forge/package.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/package.json rename to x-pack/platform/packages/private/kbn-infra-forge/package.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/event.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/event.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/event.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/event.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/metricset.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/metricset.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/metricset.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/metricset.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/system.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/system.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/system.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/component/system.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/template.json b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/template.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/template.json rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/composable/template.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/fake_hosts/index.ts b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/fake_hosts/index.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/fake_hosts/index.ts rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/fake_hosts/index.ts diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/fake_hosts/index_template_def.ts b/x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/fake_hosts/index_template_def.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/fake_hosts/index_template_def.ts rename to x-pack/platform/packages/private/kbn-infra-forge/src/data_sources/fake_hosts/index_template_def.ts diff --git a/x-pack/packages/kbn-infra-forge/src/lib/manage_template.ts b/x-pack/platform/packages/private/kbn-infra-forge/src/lib/manage_template.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/lib/manage_template.ts rename to x-pack/platform/packages/private/kbn-infra-forge/src/lib/manage_template.ts diff --git a/x-pack/packages/kbn-infra-forge/src/lib/queue.ts b/x-pack/platform/packages/private/kbn-infra-forge/src/lib/queue.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/lib/queue.ts rename to x-pack/platform/packages/private/kbn-infra-forge/src/lib/queue.ts diff --git a/x-pack/packages/kbn-infra-forge/src/run.ts b/x-pack/platform/packages/private/kbn-infra-forge/src/run.ts similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/run.ts rename to x-pack/platform/packages/private/kbn-infra-forge/src/run.ts diff --git a/x-pack/platform/packages/private/kbn-infra-forge/tsconfig.json b/x-pack/platform/packages/private/kbn-infra-forge/tsconfig.json new file mode 100644 index 000000000000..44527346cbd9 --- /dev/null +++ b/x-pack/platform/packages/private/kbn-infra-forge/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + "./src/data_sources/composable/component/base.json", + "./src/data_sources/composable/component/event.json", + "./src/data_sources/composable/component/host.json", + "./src/data_sources/composable/component/metricset.json", + "./src/data_sources/composable/component/system.json", + "./src/data_sources/composable/template.json" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/datemath" + ] +} diff --git a/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx b/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx index c8792ab3f9d9..3925b51b6c38 100644 --- a/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx +++ b/x-pack/platform/packages/private/ml/date_picker/src/components/date_picker_wrapper.tsx @@ -338,7 +338,7 @@ export const DatePickerWrapper: FC<DatePickerWrapperProps> = (props) => { <EuiToolTip content={tooltipMessage}> <EuiButton fill={false} - color={needsUpdate ? 'success' : 'primary'} + color={needsUpdate ? 'accentSecondary' : 'primary'} iconType={needsUpdate ? 'kqlFunction' : 'refresh'} onClick={handleRefresh} data-test-subj={`mlDatePickerRefreshPageButton${isLoading ? ' loading' : ' loaded'}`} diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts index 4b5ef3a5cfda..603192fb96db 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/index.ts @@ -13,6 +13,9 @@ export { type AssistantMessage, type ToolMessage, type UserMessage, + type MessageOf, + type AssistantMessageOf, + type ToolMessageOf, type ToolSchemaType, type FromToolSchema, type ToolSchema, diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/index.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/index.ts index 3daa898ab2e1..cedc8297d75b 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/index.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/index.ts @@ -33,6 +33,9 @@ export { type AssistantMessage, type UserMessage, type ToolMessage, + type AssistantMessageOf, + type MessageOf, + type ToolMessageOf, } from './messages'; export { type ToolSchema, type ToolSchemaType, type FromToolSchema } from './tool_schema'; export { diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts index ca74b094e0a3..43d03cf130c0 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/messages.ts @@ -5,7 +5,7 @@ * 2.0. */ -import type { ToolCall } from './tools'; +import type { ToolCall, ToolCallsOf, ToolNamesOf, ToolOptions, ToolResponsesOf } from './tools'; /** * Enum for all possible {@link Message} roles. @@ -52,17 +52,32 @@ export type AssistantMessage = MessageBase<MessageRole.Assistant> & { /** * Represents a tool invocation result, following a request from the LLM to execute a tool. */ -export type ToolMessage<TToolResponse extends Record<string, any> | unknown> = - MessageBase<MessageRole.Tool> & { - /** - * The call id matching the {@link ToolCall} this tool message is for. - */ - toolCallId: string; - /** - * The response from the tool invocation. - */ - response: TToolResponse; - }; +export type ToolMessage< + TName extends string = string, + TToolResponse extends Record<string, any> | unknown = Record<string, any> | unknown, + TToolData extends Record<string, any> | undefined = Record<string, any> | undefined +> = MessageBase<MessageRole.Tool> & { + /* + * The name of the tool called. Used for refining the type of the response. + */ + name: TName; + /** + * The call id matching the {@link ToolCall} this tool message is for. + */ + toolCallId: string; + /** + * The response from the tool invocation. + */ + response: TToolResponse; +} & (TToolData extends undefined + ? {} + : { + /** + * Additional data from the tool invocation, that is not sent to the LLM + * but can be used to attach baggage (such as timeseries or debug data) + */ + data: TToolData; + }); /** * Mixin composed of all the possible types of messages in a chatComplete discussion. @@ -72,4 +87,30 @@ export type ToolMessage<TToolResponse extends Record<string, any> | unknown> = * - {@link AssistantMessage} * - {@link ToolMessage} */ -export type Message = UserMessage | AssistantMessage | ToolMessage<unknown>; +export type Message = UserMessage | AssistantMessage | ToolMessage; + +/** + * Utility type to get the Assistant message type of a {@link ToolOptions} type. + */ +export type AssistantMessageOf<TToolOptions extends ToolOptions> = Omit< + AssistantMessage, + 'toolCalls' +> & + ToolCallsOf<TToolOptions>; + +/** + * Utility type to get the Tool message type of a {@link ToolOptions} type. + */ + +export type ToolMessageOf<TToolOptions extends ToolOptions> = ToolMessage< + ToolNamesOf<TToolOptions>, + ToolResponsesOf<TToolOptions['tools']> +>; + +/** + * Utility type to get the mixin Message type of a {@link ToolOptions} type. + */ +export type MessageOf<TToolOptions extends ToolOptions> = + | UserMessage + | AssistantMessageOf<TToolOptions> + | ToolMessageOf<TToolOptions>; diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts index 0c7d5c6755f3..5cd52d5f5888 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/chat_complete/tools.ts @@ -8,24 +8,24 @@ import type { ValuesType } from 'utility-types'; import { FromToolSchema, ToolSchema } from './tool_schema'; -type Assert<TValue, TType> = TValue extends TType ? TValue & TType : never; - type ToolsOfChoice<TToolOptions extends ToolOptions> = TToolOptions['toolChoice'] extends { function: infer TToolName; } ? TToolName extends keyof TToolOptions['tools'] - ? Pick<TToolOptions['tools'], TToolName> + ? TToolName extends string + ? Pick<TToolOptions['tools'], TToolName> + : TToolOptions['tools'] : TToolOptions['tools'] : TToolOptions['tools']; /** * Utility type to infer the tool calls response shape. */ -type ToolResponsesOf<TTools extends Record<string, ToolDefinition> | undefined> = +export type ToolResponsesOf<TTools extends Record<string, ToolDefinition> | undefined> = TTools extends Record<string, ToolDefinition> ? Array< ValuesType<{ - [TName in keyof TTools]: ToolResponseOf<Assert<TName, string>, TTools[TName]>; + [TName in keyof TTools & string]: ToolCall<TName, ToolResponseOf<TTools[TName]>>; }> > : never[]; @@ -33,10 +33,11 @@ type ToolResponsesOf<TTools extends Record<string, ToolDefinition> | undefined> /** * Utility type to infer the tool call response shape. */ -type ToolResponseOf<TName extends string, TToolDefinition extends ToolDefinition> = ToolCall< - TName, - TToolDefinition extends { schema: ToolSchema } ? FromToolSchema<TToolDefinition['schema']> : {} ->; +export type ToolResponseOf<TToolDefinition extends ToolDefinition> = TToolDefinition extends { + schema: ToolSchema; +} + ? FromToolSchema<TToolDefinition['schema']> + : {}; /** * Tool invocation choice type. @@ -129,6 +130,10 @@ export interface ToolCall< name: TName; } & (TArguments extends Record<string, any> ? { arguments: TArguments } : {}); } +/** + * Utility type to get the tool names of ToolOptions + */ +export type ToolNamesOf<TToolOptions extends ToolOptions> = keyof TToolOptions['tools'] & string; /** * Tool-related parameters of {@link ChatCompleteAPI} diff --git a/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts b/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts index 3355042910a6..cd90394cd67d 100644 --- a/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts +++ b/x-pack/platform/packages/shared/ai-infra/inference-common/src/output/api.ts @@ -96,6 +96,17 @@ export interface OutputOptions< * Defaults to false. */ stream?: TStream; + + /** + * Optional configuration for retrying the call if an error occurs. + */ + retry?: { + /** + * Whether to retry on validation errors. Can be a number or retries, + * or a boolean, which means one retry. + */ + onValidationError?: boolean | number; + }; } /** diff --git a/x-pack/platform/packages/shared/ai-infra/product-doc-common/package.json b/x-pack/platform/packages/shared/ai-infra/product-doc-common/package.json index 839d411a2efb..2d7c67f17728 100644 --- a/x-pack/platform/packages/shared/ai-infra/product-doc-common/package.json +++ b/x-pack/platform/packages/shared/ai-infra/product-doc-common/package.json @@ -3,4 +3,4 @@ "private": true, "version": "1.0.0", "license": "Elastic License 2.0" -} \ No newline at end of file +} diff --git a/x-pack/packages/kbn-data-forge/README.md b/x-pack/platform/packages/shared/kbn-data-forge/README.md similarity index 100% rename from x-pack/packages/kbn-data-forge/README.md rename to x-pack/platform/packages/shared/kbn-data-forge/README.md diff --git a/x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/change_point_detection.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/change_point_detection.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/change_point_detection.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/change_point_detection.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/concept_drift.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/concept_drift.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/concept_drift.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/concept_drift.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/contextual_anomaly.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/contextual_anomaly.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/contextual_anomaly.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/contextual_anomaly.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/point_anomaly.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/point_anomaly.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/anomalies_by_type/point_anomaly.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/anomalies_by_type/point_anomaly.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/changing_log_volume_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/changing_log_volume_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/changing_log_volume_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/changing_log_volume_example.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/fake_logs_sine.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/fake_logs_sine.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/fake_logs_sine.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/fake_logs_sine.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/fake_stack.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/fake_stack.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/fake_stack.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/fake_stack.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/full_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/full_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/full_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/full_example.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/future_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/future_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/future_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/future_example.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/good_to_bad_to_good.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/good_to_bad_to_good.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/good_to_bad_to_good.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/good_to_bad_to_good.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_drop.yml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_drop.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_drop.yml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_drop.yml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario0_logs.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario0_logs.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario0_logs.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario0_logs.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario1_spike_logs.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario1_spike_logs.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario1_spike_logs.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario1_spike_logs.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario2_spike_logs_host.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario2_spike_logs_host.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario2_spike_logs_host.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario2_spike_logs_host.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario3_spike_errors.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario3_spike_errors.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario3_spike_errors.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario3_spike_errors.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario4_spike_errors_with_recovery.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario4_spike_errors_with_recovery.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario4_spike_errors_with_recovery.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario4_spike_errors_with_recovery.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario5_spike_logs_linear.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario5_spike_logs_linear.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/log_spike_scenarios/scenario5_spike_logs_linear.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/log_spike_scenarios/scenario5_spike_logs_linear.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/metric_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/metric_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/metric_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/metric_example.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/ramp_up_then_down.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/ramp_up_then_down.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/ramp_up_then_down.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/ramp_up_then_down.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario0_paralell_metrics_drop_step_change.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario0_paralell_metrics_drop_step_change.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario0_paralell_metrics_drop_step_change.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario0_paralell_metrics_drop_step_change.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario1_paralell_metrics_increase_step_change.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario1_paralell_metrics_increase_step_change.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario1_paralell_metrics_increase_step_change.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario1_paralell_metrics_increase_step_change.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario2_divergent_metrics.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario2_divergent_metrics.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario2_divergent_metrics.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario2_divergent_metrics.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario3_chained_metrics_change.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario3_chained_metrics_change.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/related_events_metrics/scenario3_chained_metrics_change.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/related_events_metrics/scenario3_chained_metrics_change.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_groupby.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_groupby.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_groupby.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_groupby.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_nodata.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_nodata.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_nodata.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_log_count_nodata.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_groupby.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_groupby.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_groupby.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_groupby.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_nodata.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_nodata.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_nodata.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/custom_threshold_metric_avg_nodata.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/rule_tests/slo_burn_rate.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/slo_burn_rate.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/rule_tests/slo_burn_rate.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/rule_tests/slo_burn_rate.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/transition_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/transition_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/transition_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/transition_example.yaml diff --git a/x-pack/packages/kbn-data-forge/example_config/transitioning_templates_example.yaml b/x-pack/platform/packages/shared/kbn-data-forge/example_config/transitioning_templates_example.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/example_config/transitioning_templates_example.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/example_config/transitioning_templates_example.yaml diff --git a/x-pack/packages/kbn-data-forge/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/index.ts diff --git a/x-pack/platform/packages/shared/kbn-data-forge/jest.config.js b/x-pack/platform/packages/shared/kbn-data-forge/jest.config.js new file mode 100644 index 000000000000..2b75e2ad4d2b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/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: ['<rootDir>/x-pack/platform/packages/shared/kbn-data-forge'], +}; diff --git a/x-pack/packages/kbn-data-forge/kibana.jsonc b/x-pack/platform/packages/shared/kbn-data-forge/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-data-forge/kibana.jsonc rename to x-pack/platform/packages/shared/kbn-data-forge/kibana.jsonc diff --git a/x-pack/packages/kbn-data-forge/package.json b/x-pack/platform/packages/shared/kbn-data-forge/package.json similarity index 100% rename from x-pack/packages/kbn-data-forge/package.json rename to x-pack/platform/packages/shared/kbn-data-forge/package.json diff --git a/x-pack/packages/kbn-data-forge/src/cleanup.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/cleanup.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/cleanup.ts diff --git a/x-pack/packages/kbn-data-forge/src/cli.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/cli.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/cli.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/cli.ts diff --git a/x-pack/packages/kbn-data-forge/src/constants.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/constants.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/constants.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/metricset.yaml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/metricset.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/metricset.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/metricset.yaml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml similarity index 90% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml index 168a1028952f..656c410a18e0 100644 --- a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/custom/system.yml @@ -44,3 +44,7 @@ level: custom type: long description: "Number of outgoing bytes" + - name: core.system.ticks + level: custom + type: long + description: "The amount of CPU time spent in kernel space" diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh new file mode 100755 index 000000000000..f4e90c0d0510 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generate.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +cd ../../../../../../../../../../ecs + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --include $ECS/fields/custom \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/ecs/subset/fake_hosts/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/event.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/event.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/event.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/event.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/metricset.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/metricset.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/metricset.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/metricset.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/system.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/system.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/system.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/component/system.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/ecs/index.ts diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/index.ts new file mode 100644 index 000000000000..c46b3c3e95bf --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/index.ts @@ -0,0 +1,183 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { faker } from '@faker-js/faker'; +import { sample, range, memoize } from 'lodash'; +import { GeneratorFunction } from '../../types'; +import { replaceMetricsWithShapes } from '../../lib/replace_metrics_with_shapes'; + +export { indexTemplate } from './ecs'; + +const createGroupIndex = (index: number) => Math.floor(index / 1000) * 1000; + +const randomBetween = (start = 0, end = 1, step = 0.1) => sample(range(start, end, step)); + +let networkDataCount = 0; +const generateNetworkData = memoize((_timestamp: string) => { + networkDataCount += Math.floor(10000 * Math.random()); + return networkDataCount; +}); + +export const generateEvent: GeneratorFunction = (config, schedule, index, timestamp) => { + const groupIndex = createGroupIndex(index); + const interval = schedule.interval ?? config.indexing.interval; + const scenario = config.indexing.scenario || 'fake_hosts'; + const docs = [ + { + namespace: 'fake_hosts', + '@timestamp': timestamp.toISOString(), + tags: [`group-${groupIndex}`, `event-${index}`], + host: { + name: `host-${index}`, + mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], + network: { + name: `network-${index}`, + }, + }, + event: { + module: 'system', + dataset: 'system.cpu', + }, + labels: { + groupId: `group-${groupIndex}`, + eventId: `event-${index}`, + scenario, + }, + system: { + cpu: { + cores: 4, + total: { + norm: { + pct: randomBetween(), + }, + }, + user: { + pct: randomBetween(1, 4), + }, + system: { + pct: randomBetween(1, 4), + }, + }, + load: { + 1: randomBetween(1, 4), + }, + memory: { + actual: { + used: { + pct: randomBetween(1, 4), + }, + }, + }, + filesystem: { + used: { + pct: randomBetween(1, 4), + }, + }, + }, + metricset: { + period: interval, + }, + container: { + id: `container-${index}`, + name: 'container-name', + }, + }, + { + namespace: 'fake_hosts', + '@timestamp': timestamp.toISOString(), + host: { + name: `host-${index}`, + mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], + network: { + name: `network-${index}`, + ingress: { + bytes: parseInt(faker.string.numeric(3), 10), + }, + egress: { + bytes: parseInt(faker.string.numeric(3), 10), + }, + }, + }, + event: { + module: 'system', + dataset: 'system.network', + }, + labels: { + groupId: `group-${groupIndex}`, + eventId: `event-${index}`, + scenario, + }, + system: { + network: { + name: 'eth0', + in: { + bytes: generateNetworkData(timestamp.toISOString()), + }, + out: { + bytes: generateNetworkData(timestamp.toISOString()), + }, + }, + core: { + system: { + ticks: randomBetween(1_000_000, 1_500_100), + }, + }, + }, + metricset: { + period: interval, + }, + container: { + id: `container-${index}`, + name: 'container-name', + }, + }, + { + namespace: 'fake_hosts', + '@timestamp': timestamp.toISOString(), + host: { + name: `host-${index}`, + mac: ['00-00-5E-00-53-23', '00-00-5E-00-53-24'], + network: { + name: `network-${index}`, + }, + }, + event: { + module: 'system', + dataset: 'system.network', + }, + labels: { + groupId: `group-${groupIndex}`, + eventId: `event-${index}`, + scenario, + }, + system: { + network: { + name: 'eth1', + in: { + bytes: generateNetworkData(timestamp.toISOString()), + }, + out: { + bytes: generateNetworkData(timestamp.toISOString()), + }, + }, + core: { + system: { + ticks: randomBetween(1_000_000, 1_500_100), + }, + }, + }, + metricset: { + period: interval, + }, + container: { + id: `container-${index}`, + name: 'container-name', + }, + }, + ]; + return replaceMetricsWithShapes(timestamp, schedule, docs); +}; diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_hosts/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_hosts/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/custom/metricset.yaml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/custom/metricset.yaml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/custom/metricset.yaml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/custom/metricset.yaml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh new file mode 100755 index 000000000000..2862d2e9acfe --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generate.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +cd ../../../../../../../../../../ecs + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --include $ECS/fields/custom \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/ecs/subset/admin_console/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/event.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/event.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/event.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/event.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/metricset.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/metricset.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/metricset.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/component/metricset.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_logs/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_logs/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/assets/admin_console.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/assets/admin_console.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/assets/admin_console.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/assets/admin_console.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh new file mode 100755 index 000000000000..da33b88d992e --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generate.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +cd ../../../../../../../../../../../ecs +NAME=admin_console + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/$NAME +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/ecs/subset/admin_console/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/event.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/event.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/event.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/event.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/http.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/http.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/http.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/http.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/server.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/server.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/server.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/server.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/url.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/url.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/url.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/url.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user_agent.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user_agent.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user_agent.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/component/user_agent.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_base_event.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_base_event.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_base_event.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_base_event.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_user.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_user.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_user.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/create_user.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/delete_user.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/delete_user.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/delete_user.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/delete_user.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/edit_user.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/edit_user.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/edit_user.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/edit_user.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/internal_error.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/internal_error.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/internal_error.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/internal_error.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/list_customers.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/list_customers.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/list_customers.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/list_customers.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login_error.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login_error.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login_error.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/login_error.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_connection_error.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_connection_error.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_connection_error.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_connection_error.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_proxy_timeout.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_proxy_timeout.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_proxy_timeout.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/mongodb_proxy_timeout.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/qa_deployed_to_production.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/qa_deployed_to_production.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/qa_deployed_to_production.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/qa_deployed_to_production.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/startup.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/startup.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/startup.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/startup.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/view_user.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/view_user.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/view_user.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/events/view_user.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/login_cache.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/login_cache.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/login_cache.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/admin_console/lib/login_cache.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/assets/transaction_rates.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/assets/transaction_rates.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/assets/transaction_rates.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/assets/transaction_rates.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/common/constants.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/common/constants.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/common/constants.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/common/constants.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/common/weighted_sample.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/common/weighted_sample.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/common/weighted_sample.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/common/weighted_sample.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/assets/heartbeat.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/assets/heartbeat.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/assets/heartbeat.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/assets/heartbeat.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh new file mode 100755 index 000000000000..4d366a307a40 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generate.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +cd ../../../../../../../../../../../ecs +NAME=heartbeat + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/$NAME +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json + diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/heartbeat/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/event.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/event.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/event.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/event.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/bad.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/bad.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/bad.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/bad.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/create_event.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/create_event.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/create_event.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/create_event.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/good.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/good.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/good.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/heartbeat/lib/events/good.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/assets/message_processor.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/assets/message_processor.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/assets/message_processor.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/assets/message_processor.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/custom/processor.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/custom/processor.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/custom/processor.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/custom/processor.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh new file mode 100755 index 000000000000..642b35d36b06 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generate.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +cd ../../../../../../../../../../../ecs +NAME=message_processor + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/$NAME +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --include $ECS/fields/custom \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json + diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/ecs/subset/message_processor/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/processor.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/processor.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/processor.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/component/processor.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad_host.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad_host.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad_host.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/bad_host.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_base_event.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_base_event.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_base_event.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_base_event.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_latency_histogram.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_latency_histogram.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_latency_histogram.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/create_latency_histogram.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_bytes_processed.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_bytes_processed.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_bytes_processed.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_bytes_processed.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_time_spent.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_time_spent.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_time_spent.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/generate_time_spent.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/good.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/good.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/good.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/good.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/startup.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/startup.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/startup.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/message_processor/lib/events/startup.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/assets/mongodb.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/assets/mongodb.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/assets/mongodb.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/assets/mongodb.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/custom/mongodb.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/custom/mongodb.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/custom/mongodb.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/custom/mongodb.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh new file mode 100755 index 000000000000..50495c22bc22 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generate.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +cd ../../../../../../../../../../../ecs +NAME=mongodb + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/$NAME +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --include $ECS/fields/custom \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json + diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/ecs/subset/mongodb/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/mongodb.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/mongodb.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/mongodb.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/component/mongodb.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/create_base_event.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/create_base_event.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/create_base_event.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/create_base_event.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/mongo_actions.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/mongo_actions.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/mongo_actions.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/mongo_actions.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/startup.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/startup.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/startup.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/mongodb/lib/events/startup.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/assets/nginx_proxy.ndjson b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/assets/nginx_proxy.ndjson similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/assets/nginx_proxy.ndjson rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/assets/nginx_proxy.ndjson diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/mapping-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/mapping-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/mapping-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/mapping-settings.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/subset.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/subset.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/subset.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/subset.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings-legacy.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings-legacy.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings-legacy.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings-legacy.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/fields/template-settings.json diff --git a/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh new file mode 100755 index 000000000000..54a4230e3d9b --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generate.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +cd ../../../../../../../../../../../ecs +NAME=nginx_proxy + +BASE=../kibana/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/$NAME +ECS=$BASE/ecs + +python3 ./scripts/generator.py --ref v8.0.0 \ + --subset $ECS/fields/subset.yml \ + --out $ECS/ \ + --template-settings-legacy $ECS/fields/template-settings-legacy.json \ + --template-settings $ECS/fields/template-settings.json \ + --mapping-settings $ECS/fields/mapping-settings.json + diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/beats/fields.ecs.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/beats/fields.ecs.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/beats/fields.ecs.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/beats/fields.ecs.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/csv/fields.csv b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/csv/fields.csv similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/csv/fields.csv rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/csv/fields.csv diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/ecs_nested.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_flat.yml diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/ecs/subset/nginx_proxy/ecs_nested.yml diff --git a/x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/base.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/base.json similarity index 100% rename from x-pack/packages/kbn-infra-forge/src/data_sources/composable/component/base.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/base.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/host.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/host.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/host.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/host.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/http.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/http.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/http.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/http.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/log.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/log.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/log.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/log.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/url.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/url.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/url.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/component/url.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/composable/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/legacy/template.json b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/legacy/template.json similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/legacy/template.json rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/generated/elasticsearch/legacy/template.json diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/ecs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/create_nginx_timestamp.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/create_nginx_timestamp.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/create_nginx_timestamp.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/create_nginx_timestamp.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_nginx_log.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_nginx_log.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_nginx_log.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_nginx_log.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_upstream_timedout.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_upstream_timedout.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_upstream_timedout.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/create_upstream_timedout.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/startup.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/startup.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/startup.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/fake_stack/nginx_proxy/lib/events/startup.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/service_logs/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/service_logs/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_cloud.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_cloud.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_cloud.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_cloud.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_host.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_host.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_host.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_host.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_log_message.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_log_message.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_log_message.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_log_message.ts diff --git a/x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_service.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_service.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/data_sources/service_logs/lib/generate_service.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/data_sources/service_logs/lib/generate_service.ts diff --git a/x-pack/packages/kbn-data-forge/src/generate.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/generate.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/generate.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/add_ephemeral_project_id.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/add_ephemeral_project_id.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/add_ephemeral_project_id.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/add_ephemeral_project_id.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/cli_to_partial_config.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/cli_to_partial_config.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/cli_to_partial_config.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/cli_to_partial_config.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/create_config.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/create_config.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_config.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/create_events.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_events.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/create_events.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/create_events.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_exponetial_function.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_exponetial_function.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_exponetial_function.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_exponetial_function.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_linear_function.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_linear_function.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_linear_function.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_linear_function.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_sine_function.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_sine_function.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/data_shapes/create_sine_function.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/create_sine_function.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/data_shapes/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/data_shapes/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/data_shapes/index.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/delete_index_template.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/delete_index_template.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/delete_index_template.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/delete_index_template.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/elasticsearch_error_handler.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/elasticsearch_error_handler.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/elasticsearch_error_handler.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/elasticsearch_error_handler.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/generate_counter_data.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/generate_counter_data.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/generate_counter_data.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/generate_counter_data.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/get_es_client.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/get_es_client.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/get_es_client.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/get_es_client.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/index_schedule.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/index_schedule.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/index_schedule.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/index_schedule.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/indices.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/indices.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/indices.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/indices.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/install_assets.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_assets.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/install_assets.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_assets.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/install_default_component_template.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_default_component_template.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/install_default_component_template.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_default_component_template.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/install_default_ingest_pipeline.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_default_ingest_pipeline.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/install_default_ingest_pipeline.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_default_ingest_pipeline.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/install_index_template.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_index_template.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/install_index_template.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_index_template.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/install_kibana_assets.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_kibana_assets.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/install_kibana_assets.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/install_kibana_assets.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/is_weekend.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/is_weekend.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/is_weekend.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/is_weekend.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/parse_cli_options.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/parse_cli_options.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/parse_cli_options.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/parse_cli_options.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/queue.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/queue.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/queue.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/queue.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/replace_metrics_with_shapes.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/replace_metrics_with_shapes.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/replace_metrics_with_shapes.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/replace_metrics_with_shapes.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/setup_kibana_system_user.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/setup_kibana_system_user.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/setup_kibana_system_user.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/setup_kibana_system_user.ts diff --git a/x-pack/packages/kbn-data-forge/src/lib/wait.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/lib/wait.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/lib/wait.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/lib/wait.ts diff --git a/x-pack/packages/kbn-data-forge/src/run.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/run.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/run.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/run.ts diff --git a/x-pack/packages/kbn-data-forge/src/types/index.ts b/x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts similarity index 100% rename from x-pack/packages/kbn-data-forge/src/types/index.ts rename to x-pack/platform/packages/shared/kbn-data-forge/src/types/index.ts diff --git a/x-pack/platform/packages/shared/kbn-data-forge/tsconfig.json b/x-pack/platform/packages/shared/kbn-data-forge/tsconfig.json new file mode 100644 index 000000000000..3c3d54da2f20 --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-data-forge/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + "./src/**/*.json" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/tooling-log", + "@kbn/datemath", + "@kbn/safer-lodash-set", + "@kbn/dev-utils" + ] +} diff --git a/x-pack/packages/kbn-slo-schema/README.md b/x-pack/platform/packages/shared/kbn-slo-schema/README.md similarity index 100% rename from x-pack/packages/kbn-slo-schema/README.md rename to x-pack/platform/packages/shared/kbn-slo-schema/README.md diff --git a/x-pack/packages/kbn-slo-schema/index.ts b/x-pack/platform/packages/shared/kbn-slo-schema/index.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/index.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/index.ts diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/jest.config.js b/x-pack/platform/packages/shared/kbn-slo-schema/jest.config.js new file mode 100644 index 000000000000..caa876c76faf --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/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: ['<rootDir>/x-pack/platform/packages/shared/kbn-slo-schema'], +}; diff --git a/x-pack/packages/kbn-slo-schema/kibana.jsonc b/x-pack/platform/packages/shared/kbn-slo-schema/kibana.jsonc similarity index 100% rename from x-pack/packages/kbn-slo-schema/kibana.jsonc rename to x-pack/platform/packages/shared/kbn-slo-schema/kibana.jsonc diff --git a/x-pack/packages/kbn-slo-schema/package.json b/x-pack/platform/packages/shared/kbn-slo-schema/package.json similarity index 100% rename from x-pack/packages/kbn-slo-schema/package.json rename to x-pack/platform/packages/shared/kbn-slo-schema/package.json diff --git a/x-pack/packages/kbn-slo-schema/src/models/duration.test.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.test.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/models/duration.test.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.test.ts diff --git a/x-pack/packages/kbn-slo-schema/src/models/duration.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/models/duration.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/models/duration.ts diff --git a/x-pack/packages/kbn-slo-schema/src/models/index.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/models/index.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/models/index.ts diff --git a/x-pack/packages/kbn-slo-schema/src/models/pagination.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/models/pagination.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/models/pagination.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/common.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/common.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/index.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/index.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/index.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/indicators.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/indicators.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/create.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/create.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/delete_instance.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/fetch_historical_summary.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_definition.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_definition.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/find_group.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/find_group.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_burn_rates.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_overview.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_overview.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_overview.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_overview.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_preview_data.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_groupings.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_slo_health.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/get_suggestions.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/index.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/index.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/index.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/manage.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/manage.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/manage.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/put_settings.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/put_settings.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/reset.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/reset.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/routes/update.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/routes/update.ts diff --git a/x-pack/packages/kbn-slo-schema/src/rest_specs/slo.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/rest_specs/slo.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/rest_specs/slo.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/common.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/common.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/common.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/duration.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/duration.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/duration.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/health.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/health.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/health.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/index.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/index.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/index.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/indicators.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/indicators.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/indicators.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/schema.test.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/schema.test.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/schema.test.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/schema.test.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/settings.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/settings.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/settings.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/slo.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/slo.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/slo.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/time_window.test.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.test.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/time_window.test.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.test.ts diff --git a/x-pack/packages/kbn-slo-schema/src/schema/time_window.ts b/x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts similarity index 100% rename from x-pack/packages/kbn-slo-schema/src/schema/time_window.ts rename to x-pack/platform/packages/shared/kbn-slo-schema/src/schema/time_window.ts diff --git a/x-pack/platform/packages/shared/kbn-slo-schema/tsconfig.json b/x-pack/platform/packages/shared/kbn-slo-schema/tsconfig.json new file mode 100644 index 000000000000..47c1c65ecc3a --- /dev/null +++ b/x-pack/platform/packages/shared/kbn-slo-schema/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/std", + "@kbn/io-ts-utils", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/categorization_analyzer.ts b/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/categorization_analyzer.ts new file mode 100644 index 000000000000..3bdf8dea9ee6 --- /dev/null +++ b/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/categorization_analyzer.ts @@ -0,0 +1,72 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { AggregationsCustomCategorizeTextAnalyzer } from '@elastic/elasticsearch/lib/api/types'; + +// This is a copy of the default categorization analyzer but using the 'standard' tokenizer rather than the 'ml_standard' tokenizer. +// The 'ml_standard' tokenizer splits tokens in a way that was observed to give better categories in testing many years ago, however, +// the downside of these better categories is then a potential failure to match the original documents when creating a filter for Discover. +// A future enhancement would be to check which analyzer is specified in the mappings for the source field and to use +// that instead of unconditionally using 'standard'. +// However for an initial fix, using the standard analyzer will be more likely to match the results from the majority of searches. +export const categorizationAnalyzer: AggregationsCustomCategorizeTextAnalyzer = { + char_filter: ['first_line_with_letters'], + tokenizer: 'standard', + filter: [ + // @ts-expect-error filter type in AggregationsCustomCategorizeTextAnalyzer is incorrect + { + type: 'stop', + stopwords: [ + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', + 'Saturday', + 'Sunday', + 'Mon', + 'Tue', + 'Wed', + 'Thu', + 'Fri', + 'Sat', + 'Sun', + 'January', + 'February', + 'March', + 'April', + 'May', + 'June', + 'July', + 'August', + 'September', + 'October', + 'November', + 'December', + 'Jan', + 'Feb', + 'Mar', + 'Apr', + 'May', + 'Jun', + 'Jul', + 'Aug', + 'Sep', + 'Oct', + 'Nov', + 'Dec', + 'GMT', + 'UTC', + ], + }, + // @ts-expect-error filter type in AggregationsCustomCategorizeTextAnalyzer is incorrect + { + type: 'limit', + max_token_count: '100', + }, + ], +}; diff --git a/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/create_category_request.ts b/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/create_category_request.ts index c1d6f82c9e58..4e8e2268fed5 100644 --- a/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/create_category_request.ts +++ b/x-pack/platform/packages/shared/ml/aiops_log_pattern_analysis/create_category_request.ts @@ -5,16 +5,14 @@ * 2.0. */ -import type { - QueryDslQueryContainer, - AggregationsCustomCategorizeTextAnalyzer, -} from '@elastic/elasticsearch/lib/api/types'; +import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { isPopulatedObject } from '@kbn/ml-is-populated-object/src/is_populated_object'; import type { createRandomSamplerWrapper } from '@kbn/ml-random-sampler-utils'; import { createDefaultQuery } from '@kbn/aiops-common/create_default_query'; +import { categorizationAnalyzer } from './categorization_analyzer'; const CATEGORY_LIMIT = 1000; const EXAMPLE_LIMIT = 4; @@ -121,67 +119,3 @@ export function createCategoryRequest( }, }; } - -// This is a copy of the default categorization analyzer but using the 'standard' tokenizer rather than the 'ml_standard' tokenizer. -// The 'ml_standard' tokenizer splits tokens in a way that was observed to give better categories in testing many years ago, however, -// the downside of these better categories is then a potential failure to match the original documents when creating a filter for Discover. -// A future enhancement would be to check which analyzer is specified in the mappings for the source field and to use -// that instead of unconditionally using 'standard'. -// However for an initial fix, using the standard analyzer will be more likely to match the results from the majority of searches. -const categorizationAnalyzer: AggregationsCustomCategorizeTextAnalyzer = { - char_filter: ['first_line_with_letters'], - tokenizer: 'standard', - filter: [ - // @ts-expect-error filter type in AggregationsCustomCategorizeTextAnalyzer is incorrect - { - type: 'stop', - stopwords: [ - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday', - 'Sunday', - 'Mon', - 'Tue', - 'Wed', - 'Thu', - 'Fri', - 'Sat', - 'Sun', - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', - 'Jan', - 'Feb', - 'Mar', - 'Apr', - 'May', - 'Jun', - 'Jul', - 'Aug', - 'Sep', - 'Oct', - 'Nov', - 'Dec', - 'GMT', - 'UTC', - ], - }, - // @ts-expect-error filter type in AggregationsCustomCategorizeTextAnalyzer is incorrect - { - type: 'limit', - max_token_count: '100', - }, - ], -}; diff --git a/x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts b/x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts index 630fbe089cdc..e634cf37b27c 100644 --- a/x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts +++ b/x-pack/platform/packages/shared/ml/trained_models_utils/src/constants/trained_models.ts @@ -12,6 +12,7 @@ export const ELSER_MODEL_ID = '.elser_model_2'; export const ELSER_LINUX_OPTIMIZED_MODEL_ID = '.elser_model_2_linux-x86_64'; export const E5_MODEL_ID = '.multilingual-e5-small'; export const E5_LINUX_OPTIMIZED_MODEL_ID = '.multilingual-e5-small_linux-x86_64'; +export const RERANK_MODEL_ID = '.rerank-v1'; export const LANG_IDENT_MODEL_ID = 'lang_ident_model_1'; export const ELSER_ID_V1 = '.elser_model_1' as const; export const LATEST_ELSER_VERSION: ElserVersion = 2; @@ -148,9 +149,25 @@ export const ELASTIC_MODEL_DEFINITIONS: Record< 'This E5 model, as defined, hosted, integrated and used in conjunction with our other Elastic Software is covered by our standard warranty.', }), }, + [RERANK_MODEL_ID]: { + techPreview: true, + default: true, + hidden: true, + modelName: 'rerank', + version: 1, + config: { + input: { + field_names: ['input', 'query'], + }, + }, + description: i18n.translate('xpack.ml.trainedModels.modelsList.rerankDescription', { + defaultMessage: 'Elastic Rerank v1', + }), + type: ['pytorch', 'text_similarity'], + }, } as const); -export type ElasticCuratedModelName = 'elser' | 'e5'; +export type ElasticCuratedModelName = 'elser' | 'e5' | 'rerank'; export interface ModelDefinition { /** @@ -177,6 +194,8 @@ export interface ModelDefinition { licenseUrl?: string; type?: readonly string[]; disclaimer?: string; + /** Indicates if model is in tech preview */ + techPreview?: boolean; } export type ModelDefinitionResponse = ModelDefinition & { diff --git a/x-pack/packages/observability/alerting_rule_utils/README.md b/x-pack/platform/packages/shared/observability/alerting_rule_utils/README.md similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/README.md rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/README.md diff --git a/x-pack/packages/observability/alerting_rule_utils/index.ts b/x-pack/platform/packages/shared/observability/alerting_rule_utils/index.ts similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/index.ts rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/index.ts diff --git a/x-pack/platform/packages/shared/observability/alerting_rule_utils/jest.config.js b/x-pack/platform/packages/shared/observability/alerting_rule_utils/jest.config.js new file mode 100644 index 000000000000..159f3ea52391 --- /dev/null +++ b/x-pack/platform/packages/shared/observability/alerting_rule_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: ['<rootDir>/x-pack/platform/packages/shared/observability/alerting_rule_utils'], +}; diff --git a/x-pack/packages/observability/alerting_rule_utils/kibana.jsonc b/x-pack/platform/packages/shared/observability/alerting_rule_utils/kibana.jsonc similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/kibana.jsonc rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/kibana.jsonc diff --git a/x-pack/packages/observability/alerting_rule_utils/package.json b/x-pack/platform/packages/shared/observability/alerting_rule_utils/package.json similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/package.json rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/package.json diff --git a/x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.test.ts b/x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.test.ts similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.test.ts rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.test.ts diff --git a/x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts b/x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts similarity index 100% rename from x-pack/packages/observability/alerting_rule_utils/src/get_ecs_groups.ts rename to x-pack/platform/packages/shared/observability/alerting_rule_utils/src/get_ecs_groups.ts diff --git a/x-pack/platform/packages/shared/observability/alerting_rule_utils/tsconfig.json b/x-pack/platform/packages/shared/observability/alerting_rule_utils/tsconfig.json new file mode 100644 index 000000000000..04f886a74e0c --- /dev/null +++ b/x-pack/platform/packages/shared/observability/alerting_rule_utils/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/alerts-as-data-utils" + ] +} diff --git a/x-pack/plugins/data_usage/README.md b/x-pack/platform/plugins/private/data_usage/README.md similarity index 100% rename from x-pack/plugins/data_usage/README.md rename to x-pack/platform/plugins/private/data_usage/README.md diff --git a/x-pack/plugins/data_usage/common/constants.ts b/x-pack/platform/plugins/private/data_usage/common/constants.ts similarity index 100% rename from x-pack/plugins/data_usage/common/constants.ts rename to x-pack/platform/plugins/private/data_usage/common/constants.ts diff --git a/x-pack/plugins/data_usage/common/experimental_features.ts b/x-pack/platform/plugins/private/data_usage/common/experimental_features.ts similarity index 100% rename from x-pack/plugins/data_usage/common/experimental_features.ts rename to x-pack/platform/plugins/private/data_usage/common/experimental_features.ts diff --git a/x-pack/plugins/data_usage/common/index.ts b/x-pack/platform/plugins/private/data_usage/common/index.ts similarity index 100% rename from x-pack/plugins/data_usage/common/index.ts rename to x-pack/platform/plugins/private/data_usage/common/index.ts diff --git a/x-pack/plugins/data_usage/common/query_client.tsx b/x-pack/platform/plugins/private/data_usage/common/query_client.tsx similarity index 100% rename from x-pack/plugins/data_usage/common/query_client.tsx rename to x-pack/platform/plugins/private/data_usage/common/query_client.tsx diff --git a/x-pack/plugins/data_usage/common/rest_types/data_streams.ts b/x-pack/platform/plugins/private/data_usage/common/rest_types/data_streams.ts similarity index 100% rename from x-pack/plugins/data_usage/common/rest_types/data_streams.ts rename to x-pack/platform/plugins/private/data_usage/common/rest_types/data_streams.ts diff --git a/x-pack/plugins/data_usage/common/rest_types/index.ts b/x-pack/platform/plugins/private/data_usage/common/rest_types/index.ts similarity index 100% rename from x-pack/plugins/data_usage/common/rest_types/index.ts rename to x-pack/platform/plugins/private/data_usage/common/rest_types/index.ts diff --git a/x-pack/plugins/data_usage/common/rest_types/usage_metrics.test.ts b/x-pack/platform/plugins/private/data_usage/common/rest_types/usage_metrics.test.ts similarity index 100% rename from x-pack/plugins/data_usage/common/rest_types/usage_metrics.test.ts rename to x-pack/platform/plugins/private/data_usage/common/rest_types/usage_metrics.test.ts diff --git a/x-pack/plugins/data_usage/common/rest_types/usage_metrics.ts b/x-pack/platform/plugins/private/data_usage/common/rest_types/usage_metrics.ts similarity index 100% rename from x-pack/plugins/data_usage/common/rest_types/usage_metrics.ts rename to x-pack/platform/plugins/private/data_usage/common/rest_types/usage_metrics.ts index 07130c84b6fd..3a53a141caf9 100644 --- a/x-pack/plugins/data_usage/common/rest_types/usage_metrics.ts +++ b/x-pack/platform/plugins/private/data_usage/common/rest_types/usage_metrics.ts @@ -28,8 +28,8 @@ export const isDefaultMetricType = (metricType: string) => DEFAULT_METRIC_TYPES.includes(metricType); export const METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP = Object.freeze<Record<MetricTypes, string>>({ - storage_retained: 'Data Retained in Storage', ingest_rate: 'Data Ingested', + storage_retained: 'Data Retained in Storage', search_vcu: 'Search VCU', ingest_vcu: 'Ingest VCU', ml_vcu: 'ML VCU', @@ -40,8 +40,8 @@ export const METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP = Object.freeze<Record<Met }); export const METRIC_TYPE_UI_OPTIONS_VALUES_TO_API_MAP = Object.freeze<Record<string, MetricTypes>>({ - 'Data Retained in Storage': 'storage_retained', 'Data Ingested': 'ingest_rate', + 'Data Retained in Storage': 'storage_retained', 'Search VCU': 'search_vcu', 'Ingest VCU': 'ingest_vcu', 'ML VCU': 'ml_vcu', diff --git a/x-pack/plugins/data_usage/common/test_utils/index.ts b/x-pack/platform/plugins/private/data_usage/common/test_utils/index.ts similarity index 100% rename from x-pack/plugins/data_usage/common/test_utils/index.ts rename to x-pack/platform/plugins/private/data_usage/common/test_utils/index.ts diff --git a/x-pack/plugins/data_usage/common/test_utils/test_provider.tsx b/x-pack/platform/plugins/private/data_usage/common/test_utils/test_provider.tsx similarity index 100% rename from x-pack/plugins/data_usage/common/test_utils/test_provider.tsx rename to x-pack/platform/plugins/private/data_usage/common/test_utils/test_provider.tsx diff --git a/x-pack/plugins/data_usage/common/test_utils/test_query_client_options.ts b/x-pack/platform/plugins/private/data_usage/common/test_utils/test_query_client_options.ts similarity index 100% rename from x-pack/plugins/data_usage/common/test_utils/test_query_client_options.ts rename to x-pack/platform/plugins/private/data_usage/common/test_utils/test_query_client_options.ts diff --git a/x-pack/platform/plugins/private/data_usage/common/utils.test.ts b/x-pack/platform/plugins/private/data_usage/common/utils.test.ts new file mode 100644 index 000000000000..c7ff57069e44 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/common/utils.test.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { isDateRangeValid } from './utils'; + +describe('isDateRangeValid', () => { + describe('Valid ranges', () => { + it.each([ + ['start date is `now-10s` and end date is `now`', { start: 'now-10s', end: 'now' }], + ['bounded within the min and max date range', { start: 'now-8d', end: 'now-4s' }], + ])('should return true if %s', (_, { start, end }) => { + expect(isDateRangeValid({ start, end })).toBe(true); + }); + }); + + describe('Invalid ranges', () => { + it.each([ + ['both start and end date is `now`', { start: 'now', end: 'now' }], + ['starts before the min date', { start: 'now-11d', end: 'now-5s' }], + ['ends after the max date in seconds', { start: 'now-9d', end: 'now+2s' }], + ['ends after the max date in days', { start: 'now-6d', end: 'now+6d' }], + [ + 'end date is before the start date even when both are within min and max date range', + { start: 'now-3s', end: 'now-10s' }, + ], + ])('should return false if the date range %s', (_, { start, end }) => { + expect(isDateRangeValid({ start, end })).toBe(false); + }); + }); +}); diff --git a/x-pack/platform/plugins/private/data_usage/common/utils.ts b/x-pack/platform/plugins/private/data_usage/common/utils.ts new file mode 100644 index 000000000000..2fe683dc8310 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/common/utils.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 dateMath from '@kbn/datemath'; + +export const DEFAULT_DATE_RANGE_OPTIONS = Object.freeze({ + autoRefreshOptions: { + enabled: false, + duration: 10000, + }, + startDate: 'now-24h/h', + endDate: 'now', + maxDate: 'now+1s', + minDate: 'now-9d', + recentlyUsedDateRanges: [], +}); + +export type ParsedDate = ReturnType<typeof momentDateParser>; +export const momentDateParser = (date: string) => dateMath.parse(date); +export const transformToUTCtime = ({ + start, + end, + isISOString = false, +}: { + start: string; + end: string; + isISOString?: boolean; +}) => { + const utcOffset = momentDateParser(start)?.utcOffset() ?? 0; + const utcStart = momentDateParser(start)?.utc().add(utcOffset, 'm'); + const utcEnd = momentDateParser(end)?.utc().add(utcOffset, 'm'); + return { + start: isISOString ? utcStart?.toISOString() : momentDateParser(start), + end: isISOString ? utcEnd?.toISOString() : momentDateParser(end), + }; +}; + +export const isDateRangeValid = ({ start, end }: { start: string; end: string }): boolean => { + const startDate = momentDateParser(start); + const endDate = momentDateParser(end); + + if (!startDate || !endDate) { + return false; + } + const minDate = momentDateParser(DEFAULT_DATE_RANGE_OPTIONS.minDate); + const maxDate = momentDateParser(DEFAULT_DATE_RANGE_OPTIONS.maxDate); + return ( + startDate.isSameOrAfter(minDate, 's') && + endDate.isSameOrBefore(maxDate, 's') && + startDate.isBefore(endDate, 's') + ); +}; diff --git a/x-pack/platform/plugins/private/data_usage/jest.config.js b/x-pack/platform/plugins/private/data_usage/jest.config.js new file mode 100644 index 000000000000..cc8bf9953ade --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/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 = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['<rootDir>/x-pack/platform/plugins/private/data_usage'], + coverageDirectory: + '<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/private/data_usage', + coverageReporters: ['text', 'html'], + collectCoverageFrom: ['<rootDir>/x-pack/plugins/datas_usage/{common,public}/**/*.{ts,tsx}'], +}; diff --git a/x-pack/plugins/data_usage/kibana.jsonc b/x-pack/platform/plugins/private/data_usage/kibana.jsonc similarity index 100% rename from x-pack/plugins/data_usage/kibana.jsonc rename to x-pack/platform/plugins/private/data_usage/kibana.jsonc diff --git a/x-pack/plugins/data_usage/public/app/components/assets/illustration_product_no_results_magnifying_glass.svg b/x-pack/platform/plugins/private/data_usage/public/app/components/assets/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/data_usage/public/app/components/assets/illustration_product_no_results_magnifying_glass.svg rename to x-pack/platform/plugins/private/data_usage/public/app/components/assets/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/data_usage/public/app/components/chart_panel.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/chart_panel.tsx similarity index 97% rename from x-pack/plugins/data_usage/public/app/components/chart_panel.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/chart_panel.tsx index 208b1e576c0d..9a7700a5de82 100644 --- a/x-pack/plugins/data_usage/public/app/components/chart_panel.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/chart_panel.tsx @@ -91,7 +91,7 @@ export const ChartPanel: React.FC<ChartPanelProps> = ({ return ( <EuiFlexItem grow={false} key={metricType}> - <EuiPanel hasShadow={false} hasBorder={true}> + <EuiPanel hasShadow={false} hasBorder={true} data-test-subj={`${metricType}-chart`}> <EuiTitle size="xs"> <h5>{chartKeyToTitleMap[metricType as ChartKey] || metricType}</h5> </EuiTitle> diff --git a/x-pack/plugins/data_usage/public/app/components/charts.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/charts.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/components/charts.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/charts.tsx diff --git a/x-pack/plugins/data_usage/public/app/components/charts_loading.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/charts_loading.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/components/charts_loading.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/charts_loading.tsx diff --git a/x-pack/plugins/data_usage/public/app/components/data_usage_metrics.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.test.tsx similarity index 85% rename from x-pack/plugins/data_usage/public/app/components/data_usage_metrics.test.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.test.tsx index befae95393e1..90257e08ead0 100644 --- a/x-pack/plugins/data_usage/public/app/components/data_usage_metrics.test.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.test.tsx @@ -12,6 +12,7 @@ import { DataUsageMetrics } from './data_usage_metrics'; import { useGetDataUsageMetrics } from '../../hooks/use_get_usage_metrics'; import { useGetDataUsageDataStreams } from '../../hooks/use_get_data_streams'; import { coreMock as mockCore } from '@kbn/core/public/mocks'; +import { mockUseKibana, generateDataStreams } from '../mocks'; jest.mock('../../utils/use_breadcrumbs', () => { return { @@ -60,60 +61,10 @@ jest.mock('@kbn/kibana-react-plugin/public', () => { const original = jest.requireActual('@kbn/kibana-react-plugin/public'); return { ...original, - useKibana: () => ({ - services: { - uiSettings: { - get: jest.fn().mockImplementation((key) => { - const get = (k: 'dateFormat' | 'timepicker:quickRanges') => { - const x = { - dateFormat: 'MMM D, YYYY @ HH:mm:ss.SSS', - 'timepicker:quickRanges': [ - { - from: 'now/d', - to: 'now/d', - display: 'Today', - }, - { - from: 'now/w', - to: 'now/w', - display: 'This week', - }, - { - from: 'now-15m', - to: 'now', - display: 'Last 15 minutes', - }, - { - from: 'now-30m', - to: 'now', - display: 'Last 30 minutes', - }, - { - from: 'now-1h', - to: 'now', - display: 'Last 1 hour', - }, - { - from: 'now-24h', - to: 'now', - display: 'Last 24 hours', - }, - { - from: 'now-7d', - to: 'now', - display: 'Last 7 days', - }, - ], - }; - return x[k]; - }; - return get(key); - }), - }, - }, - }), + useKibana: () => mockUseKibana, }; }); + const mockUseGetDataUsageMetrics = useGetDataUsageMetrics as jest.Mock; const mockUseGetDataUsageDataStreams = useGetDataUsageDataStreams as jest.Mock; const mockServices = mockCore.createStart(); @@ -131,13 +82,6 @@ const getBaseMockedDataUsageMetrics = () => ({ refetch: jest.fn(), }); -const generateDataStreams = (count: number) => { - return Array.from({ length: count }, (_, i) => ({ - name: `.ds-${i}`, - storageSizeBytes: 1024 ** 2 * (22 / 7), - })); -}; - describe('DataUsageMetrics', () => { let user: UserEvent; const testId = 'test'; @@ -228,14 +172,14 @@ describe('DataUsageMetrics', () => { expect(toggleFilterButton).toHaveTextContent('Data streams10'); await user.click(toggleFilterButton); const allFilterOptions = getAllByTestId('dataStreams-filter-option'); - // deselect 9 options - for (let i = 0; i < allFilterOptions.length; i++) { + // deselect 3 options + for (let i = 0; i < 3; i++) { await user.click(allFilterOptions[i]); } - expect(toggleFilterButton).toHaveTextContent('Data streams1'); + expect(toggleFilterButton).toHaveTextContent('Data streams7'); expect(within(toggleFilterButton).getByRole('marquee').getAttribute('aria-label')).toEqual( - '1 active filters' + '7 active filters' ); }); diff --git a/x-pack/plugins/data_usage/public/app/components/data_usage_metrics.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.tsx similarity index 92% rename from x-pack/plugins/data_usage/public/app/components/data_usage_metrics.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.tsx index efaa779dfe3c..829b198e59ab 100644 --- a/x-pack/plugins/data_usage/public/app/components/data_usage_metrics.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/data_usage_metrics.tsx @@ -17,13 +17,9 @@ import { PLUGIN_NAME } from '../../translations'; import { useGetDataUsageMetrics } from '../../hooks/use_get_usage_metrics'; import { useGetDataUsageDataStreams } from '../../hooks/use_get_data_streams'; import { useDataUsageMetricsUrlParams } from '../hooks/use_charts_url_params'; -import { - DEFAULT_DATE_RANGE_OPTIONS, - transformToUTCtime, - isDateRangeValid, -} from '../../../common/utils'; +import { DEFAULT_DATE_RANGE_OPTIONS, transformToUTCtime } from '../../../common/utils'; import { useDateRangePicker } from '../hooks/use_date_picker'; -import { ChartFilters, ChartFiltersProps } from './filters/charts_filters'; +import { ChartsFilters, ChartsFiltersProps } from './filters/charts_filters'; import { ChartsLoading } from './charts_loading'; import { NoDataCallout } from './no_data_callout'; import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; @@ -114,16 +110,8 @@ export const DataUsageMetrics = memo( })); }, [metricTypesFromUrl, dataStreamsFromUrl, startDateFromUrl, endDateFromUrl]); - const { dateRangePickerState, onRefreshChange, onTimeChange } = useDateRangePicker(); - - const isValidDateRange = useMemo( - () => - isDateRangeValid({ - start: dateRangePickerState.startDate, - end: dateRangePickerState.endDate, - }), - [dateRangePickerState.endDate, dateRangePickerState.startDate] - ); + const { dateRangePickerState, isValidDateRange, onRefreshChange, onTimeChange } = + useDateRangePicker(); const enableFetchUsageMetricsData = useMemo( () => @@ -187,8 +175,10 @@ export const DataUsageMetrics = memo( [setMetricsFilters] ); - const filterOptions: ChartFiltersProps['filterOptions'] = useMemo(() => { - const dataStreamsOptions = dataStreams?.reduce<Record<string, number>>((acc, ds) => { + const filterOptions: ChartsFiltersProps['filterOptions'] = useMemo(() => { + const dataStreamsOptions = dataStreams?.reduce< + Required<ChartsFiltersProps['filterOptions']['dataStreams']>['appendOptions'] + >((acc, ds) => { acc[ds.name] = ds.storageSizeBytes; return acc; }, {}); @@ -239,10 +229,11 @@ export const DataUsageMetrics = memo( return ( <EuiFlexGroup alignItems="flexStart" direction="column" data-test-subj={getTestId()}> <FlexItemWithCss> - <ChartFilters + <ChartsFilters dateRangePickerState={dateRangePickerState} isDataLoading={isFetchingDataStreams} isUpdateDisabled={!enableFetchUsageMetricsData} + isValidDateRange={isValidDateRange} onClick={refetchDataUsageMetrics} onRefresh={onRefresh} onRefreshChange={onRefreshChange} diff --git a/x-pack/plugins/data_usage/public/app/components/dataset_quality_link.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/dataset_quality_link.tsx similarity index 90% rename from x-pack/plugins/data_usage/public/app/components/dataset_quality_link.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/dataset_quality_link.tsx index 8e81e6091156..3b481565ae27 100644 --- a/x-pack/plugins/data_usage/public/app/components/dataset_quality_link.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/dataset_quality_link.tsx @@ -41,7 +41,11 @@ export const DatasetQualityLink: React.FC<DatasetQualityLinkProps> = React.memo( } }; return ( - <LegendActionItem label={UX_LABELS.dataQualityPopup.view} onClick={onClickDataQuality} /> + <LegendActionItem + label={UX_LABELS.dataQualityPopup.view} + onClick={onClickDataQuality} + dataTestSubj="DatasetQualityAction" + /> ); } ); diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.test.tsx new file mode 100644 index 000000000000..4987654235d4 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.test.tsx @@ -0,0 +1,124 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { TestProvider } from '../../../../common/test_utils'; +import { render, type RenderResult } from '@testing-library/react'; +import userEvent, { type UserEvent } from '@testing-library/user-event'; +import { ChartsFilter, type ChartsFilterProps } from './charts_filter'; +import { FilterName } from '../../hooks'; +import { mockUseKibana, generateDataStreams } from '../../mocks'; + +const mockUseLocation = jest.fn(() => ({ pathname: '/' })); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: () => mockUseLocation(), + useHistory: jest.fn().mockReturnValue({ + push: jest.fn(), + listen: jest.fn(), + location: { + search: '', + }, + }), +})); + +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useKibana: () => mockUseKibana, + }; +}); + +describe('Charts Filters', () => { + let user: UserEvent; + const testId = 'test'; + const testIdFilter = `${testId}-filter`; + + const defaultProps = { + filterOptions: { + filterName: 'dataStreams' as FilterName, + isFilterLoading: false, + appendOptions: {}, + selectedOptions: [], + options: generateDataStreams(8).map((ds) => ds.name), + onChangeFilterOptions: jest.fn(), + }, + }; + + let renderComponent: (props: ChartsFilterProps) => RenderResult; + + beforeAll(() => { + jest.useFakeTimers(); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + + beforeEach(() => { + jest.clearAllMocks(); + renderComponent = (props: ChartsFilterProps) => + render( + <TestProvider> + <ChartsFilter data-test-subj={testIdFilter} {...props} /> + </TestProvider> + ); + user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime, pointerEventsCheck: 0 }); + }); + + it('renders data streams filter with all options selected', async () => { + const { getByTestId, getAllByTestId } = renderComponent(defaultProps); + expect(getByTestId(`${testIdFilter}-dataStreams-popoverButton`)).toBeTruthy(); + + const filterButton = getByTestId(`${testIdFilter}-dataStreams-popoverButton`); + expect(filterButton).toBeTruthy(); + await user.click(filterButton); + const allFilterOptions = getAllByTestId('dataStreams-filter-option'); + + // checked options + const checkedOptions = allFilterOptions.filter( + (option) => option.getAttribute('aria-checked') === 'true' + ); + expect(checkedOptions).toHaveLength(8); + }); + + it('renders data streams filter with 50 options selected when more than 50 items in the filter', async () => { + const { getByTestId } = renderComponent({ + ...defaultProps, + filterOptions: { + ...defaultProps.filterOptions, + options: generateDataStreams(55).map((ds) => ds.name), + }, + }); + expect(getByTestId(`${testIdFilter}-dataStreams-popoverButton`)).toBeTruthy(); + + const toggleFilterButton = getByTestId(`${testIdFilter}-dataStreams-popoverButton`); + expect(toggleFilterButton).toBeTruthy(); + expect(toggleFilterButton).toHaveTextContent('Data streams50'); + expect( + toggleFilterButton.querySelector('.euiNotificationBadge')?.getAttribute('aria-label') + ).toBe('50 active filters'); + }); + + it('renders data streams filter with no options selected and select all is disabled', async () => { + const { getByTestId, queryByTestId } = renderComponent({ + ...defaultProps, + filterOptions: { + ...defaultProps.filterOptions, + options: [], + }, + }); + expect(getByTestId(`${testIdFilter}-dataStreams-popoverButton`)).toBeTruthy(); + + const filterButton = getByTestId(`${testIdFilter}-dataStreams-popoverButton`); + expect(filterButton).toBeTruthy(); + await user.click(filterButton); + expect(queryByTestId('dataStreams-filter-option')).toBeFalsy(); + expect(getByTestId('dataStreams-group-label')).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-dataStreams-selectAllButton`)).toBeDisabled(); + }); +}); diff --git a/x-pack/plugins/data_usage/public/app/components/filters/charts_filter.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.tsx similarity index 90% rename from x-pack/plugins/data_usage/public/app/components/filters/charts_filter.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.tsx index 2e60561f3ed2..e041b262a7f4 100644 --- a/x-pack/plugins/data_usage/public/app/components/filters/charts_filter.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter.tsx @@ -81,6 +81,11 @@ export const ChartsFilter = memo<ChartsFilterProps>( }, }); + const isSelectAllDisabled = useMemo( + () => options.length === 0 || (hasActiveFilters && numFilters === 0), + [hasActiveFilters, numFilters, options.length] + ); + const addHeightToPopover = useMemo( () => isDataStreamsFilter && numFilters + numActiveFilters > 15, [isDataStreamsFilter, numFilters, numActiveFilters] @@ -107,7 +112,12 @@ export const ChartsFilter = memo<ChartsFilterProps>( const sortedDataStreamsFilterOptions = useMemo(() => { if (shouldPinSelectedDataStreams() || areDataStreamsSelectedOnMount) { // pin checked items to the top - return orderBy('checked', 'asc', items); + const sorted = orderBy( + 'checked', + 'asc', + items.filter((item) => !item.isGroupLabel) + ); + return [...items.filter((item) => item.isGroupLabel), ...sorted]; } // return options as are for other filters return items; @@ -155,14 +165,25 @@ export const ChartsFilter = memo<ChartsFilterProps>( ); const onSelectAll = useCallback(() => { - const allItems: FilterItems = items.map((item) => { - return { - ...item, - checked: 'on', - }; - }); + const allItems: FilterItems = items.reduce<FilterItems>((acc, item) => { + if (!item.isGroupLabel) { + acc.push({ + ...item, + checked: 'on', + }); + } else { + acc.push(item); + } + return acc; + }, []); + setItems(allItems); - const optionsToSelect = allItems.map((i) => i.label); + const optionsToSelect = allItems.reduce<string[]>((acc, i) => { + if (i.checked) { + acc.push(i.label); + } + return acc; + }, []); onChangeFilterOptions(optionsToSelect); if (isDataStreamsFilter) { @@ -260,7 +281,7 @@ export const ChartsFilter = memo<ChartsFilterProps>( data-test-subj={getTestId(`${filterName}-selectAllButton`)} icon="check" label={UX_LABELS.filterSelectAll} - isDisabled={hasActiveFilters && numFilters === 0} + isDisabled={isSelectAllDisabled} onClick={onSelectAll} /> </EuiFlexItem> diff --git a/x-pack/plugins/data_usage/public/app/components/filters/charts_filter_popover.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter_popover.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/components/filters/charts_filter_popover.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filter_popover.tsx diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.test.tsx new file mode 100644 index 000000000000..d4196abeaa26 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.test.tsx @@ -0,0 +1,180 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { TestProvider } from '../../../../common/test_utils'; +import { render, type RenderResult } from '@testing-library/react'; +import userEvent, { type UserEvent } from '@testing-library/user-event'; +import { ChartsFilters, type ChartsFiltersProps } from './charts_filters'; +import { FilterName } from '../../hooks'; +import { mockUseKibana } from '../../mocks'; +import { + METRIC_TYPE_VALUES, + METRIC_TYPE_UI_OPTIONS_VALUES_TO_API_MAP, +} from '../../../../common/rest_types/usage_metrics'; + +const mockUseLocation = jest.fn(() => ({ pathname: '/' })); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: () => mockUseLocation(), + useHistory: jest.fn().mockReturnValue({ + push: jest.fn(), + listen: jest.fn(), + location: { + search: '', + }, + }), +})); + +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useKibana: () => mockUseKibana, + }; +}); + +describe('Charts Filters', () => { + let user: UserEvent; + const testId = 'test'; + const testIdFilter = `${testId}-filter`; + const onClick = jest.fn(); + const dateRangePickerState = { + startDate: 'now-15m', + endDate: 'now', + recentlyUsedDateRanges: [], + autoRefreshOptions: { + enabled: false, + duration: 0, + }, + }; + const defaultProps = { + dateRangePickerState, + isDataLoading: false, + isUpdateDisabled: false, + isValidDateRange: true, + filterOptions: { + dataStreams: { + filterName: 'dataStreams' as FilterName, + isFilterLoading: false, + options: ['.ds-1', '.ds-2'], + onChangeFilterOptions: jest.fn(), + }, + metricTypes: { + filterName: 'metricTypes' as FilterName, + isFilterLoading: false, + options: METRIC_TYPE_VALUES.slice(), + onChangeFilterOptions: jest.fn(), + }, + }, + onClick, + onRefresh: jest.fn(), + onRefreshChange: jest.fn(), + onTimeChange: jest.fn(), + }; + + let renderComponent: (props: ChartsFiltersProps) => RenderResult; + + beforeAll(() => { + jest.useFakeTimers(); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + + beforeEach(() => { + jest.clearAllMocks(); + renderComponent = (props: ChartsFiltersProps) => + render( + <TestProvider> + <ChartsFilters data-test-subj={testIdFilter} {...props} /> + </TestProvider> + ); + user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime, pointerEventsCheck: 0 }); + }); + + it('renders data streams filter, date range filter and refresh button', () => { + const { getByTestId } = renderComponent(defaultProps); + expect(getByTestId(`${testIdFilter}-dataStreams-popoverButton`)).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-date-range`)).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-super-refresh-button`)).toBeTruthy(); + }); + + it('renders metric filter', () => { + const { getByTestId } = renderComponent({ ...defaultProps, showMetricsTypesFilter: true }); + expect(getByTestId(`${testIdFilter}-metricTypes-popoverButton`)).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-dataStreams-popoverButton`)).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-date-range`)).toBeTruthy(); + expect(getByTestId(`${testIdFilter}-super-refresh-button`)).toBeTruthy(); + }); + + it('has default metrics selected if showing metrics filter', async () => { + const { getByTestId, getAllByTestId } = renderComponent({ + ...defaultProps, + showMetricsTypesFilter: true, + }); + const metricsFilterButton = getByTestId(`${testIdFilter}-metricTypes-popoverButton`); + expect(metricsFilterButton).toBeTruthy(); + await user.click(metricsFilterButton); + const allFilterOptions = getAllByTestId('metricTypes-filter-option'); + + // checked options + const checkedOptions = allFilterOptions.filter( + (option) => option.getAttribute('aria-checked') === 'true' + ); + expect(checkedOptions).toHaveLength(2); + expect(checkedOptions.map((option) => option.title)).toEqual( + Object.keys(METRIC_TYPE_UI_OPTIONS_VALUES_TO_API_MAP).slice(0, 2) + ); + + // unchecked options + const unCheckedOptions = allFilterOptions.filter( + (option) => option.getAttribute('aria-checked') === 'false' + ); + expect(unCheckedOptions).toHaveLength(7); + expect(unCheckedOptions.map((option) => option.title)).toEqual( + Object.keys(METRIC_TYPE_UI_OPTIONS_VALUES_TO_API_MAP).slice(2) + ); + }); + + it('should show invalid date range info', () => { + const { getByTestId } = renderComponent({ + ...defaultProps, + // using this prop to set invalid date range + isValidDateRange: false, + }); + expect(getByTestId(`${testIdFilter}-invalid-date-range`)).toBeTruthy(); + }); + + it('should not show invalid date range info', () => { + const { queryByTestId } = renderComponent(defaultProps); + expect(queryByTestId(`${testIdFilter}-invalid-date-range`)).toBeNull(); + }); + + it('should disable refresh button', () => { + const { getByTestId } = renderComponent({ + ...defaultProps, + isUpdateDisabled: true, + }); + expect(getByTestId(`${testIdFilter}-super-refresh-button`)).toBeDisabled(); + }); + + it('should show `updating` on refresh button', () => { + const { getByTestId } = renderComponent({ + ...defaultProps, + isDataLoading: true, + }); + expect(getByTestId(`${testIdFilter}-super-refresh-button`)).toBeDisabled(); + expect(getByTestId(`${testIdFilter}-super-refresh-button`).textContent).toEqual('Updating'); + }); + + it('should call onClick on refresh button click', () => { + const { getByTestId } = renderComponent(defaultProps); + getByTestId(`${testIdFilter}-super-refresh-button`).click(); + expect(onClick).toHaveBeenCalled(); + }); +}); diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.tsx new file mode 100644 index 000000000000..8b8b3f864cd7 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/charts_filters.tsx @@ -0,0 +1,101 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo, useCallback, useMemo } from 'react'; +import { + EuiFilterGroup, + EuiFlexGroup, + EuiFlexItem, + EuiSuperUpdateButton, + EuiText, + EuiTextAlign, +} from '@elastic/eui'; + +import { UX_LABELS } from '../../../translations'; +import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; +import { useGetDataUsageMetrics } from '../../../hooks/use_get_usage_metrics'; +import { type UsageMetricsDateRangePickerProps, UsageMetricsDateRangePicker } from './date_picker'; +import { ChartsFilter, ChartsFilterProps } from './charts_filter'; +import { FilterName } from '../../hooks'; + +export interface ChartsFiltersProps extends UsageMetricsDateRangePickerProps { + isUpdateDisabled: boolean; + isValidDateRange: boolean; + filterOptions: Record<FilterName, ChartsFilterProps['filterOptions']>; + onClick: ReturnType<typeof useGetDataUsageMetrics>['refetch']; + showMetricsTypesFilter?: boolean; +} + +export const ChartsFilters = memo<ChartsFiltersProps>( + ({ + dateRangePickerState, + isDataLoading, + isUpdateDisabled, + isValidDateRange, + filterOptions, + onClick, + onRefresh, + onRefreshChange, + onTimeChange, + showMetricsTypesFilter = false, + 'data-test-subj': dataTestSubj, + }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + + const filters = useMemo(() => { + return ( + <> + {showMetricsTypesFilter && ( + <ChartsFilter filterOptions={filterOptions.metricTypes} data-test-subj={dataTestSubj} /> + )} + {!filterOptions.dataStreams.isFilterLoading && ( + <ChartsFilter filterOptions={filterOptions.dataStreams} data-test-subj={dataTestSubj} /> + )} + </> + ); + }, [dataTestSubj, filterOptions, showMetricsTypesFilter]); + + const onClickRefreshButton = useCallback(() => onClick(), [onClick]); + + return ( + <EuiFlexGroup responsive gutterSize="m" justifyContent="flexStart"> + <EuiFlexItem grow={1}> + <EuiFilterGroup>{filters}</EuiFilterGroup> + </EuiFlexItem> + <EuiFlexItem grow={1}> + <UsageMetricsDateRangePicker + dateRangePickerState={dateRangePickerState} + isDataLoading={isDataLoading} + onRefresh={onRefresh} + onRefreshChange={onRefreshChange} + onTimeChange={onTimeChange} + data-test-subj={dataTestSubj} + /> + {!isValidDateRange && ( + <EuiText color="danger" size="s" data-test-subj={getTestId('invalid-date-range')}> + <EuiTextAlign textAlign="center"> + <p>{UX_LABELS.filters.invalidDateRange}</p> + </EuiTextAlign> + </EuiText> + )} + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiSuperUpdateButton + data-test-subj={getTestId('super-refresh-button')} + fill={false} + isLoading={isDataLoading} + isDisabled={isUpdateDisabled} + onClick={onClickRefreshButton} + /> + </EuiFlexItem> + <EuiFlexItem grow={2} /> + </EuiFlexGroup> + ); + } +); + +ChartsFilters.displayName = 'ChartsFilters'; diff --git a/x-pack/plugins/data_usage/public/app/components/filters/date_picker.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/date_picker.tsx similarity index 98% rename from x-pack/plugins/data_usage/public/app/components/filters/date_picker.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/filters/date_picker.tsx index 1b04587b4245..10fbb2ab399c 100644 --- a/x-pack/plugins/data_usage/public/app/components/filters/date_picker.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/date_picker.tsx @@ -28,7 +28,7 @@ export interface DateRangePickerValues { recentlyUsedDateRanges: EuiSuperDatePickerRecentRange[]; } -interface UsageMetricsDateRangePickerProps { +export interface UsageMetricsDateRangePickerProps { dateRangePickerState: DateRangePickerValues; isDataLoading: boolean; onRefresh: () => void; diff --git a/x-pack/plugins/data_usage/public/app/components/filters/toggle_all_button.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/toggle_all_button.tsx similarity index 95% rename from x-pack/plugins/data_usage/public/app/components/filters/toggle_all_button.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/filters/toggle_all_button.tsx index 3d1c4080fcc9..e6d4f6cd3c72 100644 --- a/x-pack/plugins/data_usage/public/app/components/filters/toggle_all_button.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/filters/toggle_all_button.tsx @@ -26,7 +26,6 @@ interface ToggleAllButtonProps { export const ToggleAllButton = memo<ToggleAllButtonProps>( ({ color, 'data-test-subj': dataTestSubj, icon, isDisabled, label, onClick }) => { - // const getTestId = useTestIdGenerator(dataTestSubj); return ( <EuiButtonEmpty color={color} diff --git a/x-pack/plugins/data_usage/public/app/components/legend_action.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/legend_action.tsx similarity index 93% rename from x-pack/plugins/data_usage/public/app/components/legend_action.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/legend_action.tsx index b748b7716324..1282bd43e863 100644 --- a/x-pack/plugins/data_usage/public/app/components/legend_action.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/legend_action.tsx @@ -52,6 +52,7 @@ export const LegendAction: React.FC<LegendActionProps> = React.memo( return ( <EuiFlexGroup gutterSize="s" alignItems="center"> <EuiPopover + data-test-subj="legendActionPopover" button={ <EuiFlexGroup gutterSize="s" alignItems="center"> <EuiFlexItem grow={false}> @@ -59,6 +60,7 @@ export const LegendAction: React.FC<LegendActionProps> = React.memo( iconType="boxesHorizontal" aria-label={UX_LABELS.dataQualityPopup.open} onClick={() => togglePopover(uniqueStreamName)} + data-test-subj="legendActionButton" /> </EuiFlexItem> </EuiFlexGroup> @@ -71,11 +73,13 @@ export const LegendAction: React.FC<LegendActionProps> = React.memo( <LegendActionItem label={UX_LABELS.dataQualityPopup.copy} onClick={onCopyDataStreamName} + dataTestSubj="copyDataStreamNameAction" /> {hasIndexManagementFeature && ( <LegendActionItem label={UX_LABELS.dataQualityPopup.manage} onClick={onClickIndexManagement} + dataTestSubj="manageDataStreamAction" /> )} {hasDataSetQualityFeature && <DatasetQualityLink dataStreamName={label} />} diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/legend_action_item.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/legend_action_item.tsx new file mode 100644 index 000000000000..542fff6902fb --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/legend_action_item.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 React, { memo } from 'react'; +import { EuiListGroupItem } from '@elastic/eui'; + +export const LegendActionItem = memo( + ({ + label, + onClick, + dataTestSubj, + }: { + label: string; + onClick: () => Promise<void> | void; + dataTestSubj: string; + }) => <EuiListGroupItem label={label} onClick={onClick} data-test-subj={dataTestSubj} size="s" /> +); + +LegendActionItem.displayName = 'LegendActionItem'; diff --git a/x-pack/plugins/data_usage/public/app/components/no_data_callout.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/no_data_callout.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/components/no_data_callout.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/components/no_data_callout.tsx diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/page.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/page.test.tsx new file mode 100644 index 000000000000..debed5b12dde --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/page.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { TestProvider } from '../../../common/test_utils'; +import { render, type RenderResult } from '@testing-library/react'; +import { DataUsagePage, type DataUsagePageProps } from './page'; + +describe('Page Component', () => { + const testId = 'test'; + let renderComponent: (props: DataUsagePageProps) => RenderResult; + + beforeAll(() => { + jest.useFakeTimers(); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + + beforeEach(() => { + jest.clearAllMocks(); + renderComponent = (props: DataUsagePageProps) => + render( + <TestProvider> + <DataUsagePage data-test-subj={testId} {...props} /> + </TestProvider> + ); + }); + + it('renders', () => { + const { getByTestId } = renderComponent({ title: 'test' }); + expect(getByTestId(`${testId}-header`)).toBeTruthy(); + }); + + it('should show page title', () => { + const { getByTestId } = renderComponent({ title: 'test header' }); + expect(getByTestId(`${testId}-title`)).toBeTruthy(); + expect(getByTestId(`${testId}-title`)).toHaveTextContent('test header'); + }); + + it('should show page description', () => { + const { getByTestId } = renderComponent({ title: 'test', subtitle: 'test description' }); + expect(getByTestId(`${testId}-description`)).toBeTruthy(); + expect(getByTestId(`${testId}-description`)).toHaveTextContent('test description'); + }); +}); diff --git a/x-pack/platform/plugins/private/data_usage/public/app/components/page.tsx b/x-pack/platform/plugins/private/data_usage/public/app/components/page.tsx new file mode 100644 index 000000000000..0a8f363b0a25 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/components/page.tsx @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { PropsWithChildren } from 'react'; +import React, { memo, useMemo } from 'react'; +import type { CommonProps } from '@elastic/eui'; +import { + EuiPageHeader, + EuiPageSection, + EuiFlexGroup, + EuiFlexItem, + EuiTitle, + EuiSpacer, +} from '@elastic/eui'; +import { useTestIdGenerator } from '../../hooks/use_test_id_generator'; + +export interface DataUsagePageProps { + title: React.ReactNode; + subtitle?: React.ReactNode; + actions?: React.ReactNode; + restrictWidth?: boolean | number; + hasBottomBorder?: boolean; + hideHeader?: boolean; + 'data-test-subj'?: string; +} + +export const DataUsagePage = memo<PropsWithChildren<DataUsagePageProps & CommonProps>>( + ({ + title, + subtitle, + children, + restrictWidth = false, + hasBottomBorder = true, + 'data-test-subj': dataTestSubj, + ...otherProps + }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + + const header = useMemo(() => { + return ( + <EuiFlexGroup direction="column" gutterSize="none" alignItems="flexStart"> + <EuiFlexItem grow={false}> + <EuiTitle size="l"> + <span data-test-subj={getTestId(`title`)}>{title}</span> + </EuiTitle> + </EuiFlexItem> + </EuiFlexGroup> + ); + }, [getTestId, title]); + + const description = useMemo(() => { + return subtitle ? ( + <span data-test-subj={getTestId(`description`)}>{subtitle}</span> + ) : undefined; + }, [getTestId, subtitle]); + + return ( + <div {...otherProps} data-test-subj={dataTestSubj}> + <> + <EuiPageHeader + pageTitle={header} + description={description} + bottomBorder={hasBottomBorder} + restrictWidth={restrictWidth} + data-test-subj={getTestId('header')} + /> + <EuiSpacer size="l" /> + </> + <EuiPageSection paddingSize="none" color="transparent" restrictWidth={restrictWidth}> + {children} + </EuiPageSection> + </div> + ); + } +); + +DataUsagePage.displayName = 'DataUsagePage'; diff --git a/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.test.tsx new file mode 100644 index 000000000000..18f49d8042e7 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.test.tsx @@ -0,0 +1,111 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { TestProvider } from '../../common/test_utils'; +import { render, type RenderResult } from '@testing-library/react'; +import { DataUsageMetricsPage } from './data_usage_metrics_page'; +import { coreMock as mockCore } from '@kbn/core/public/mocks'; +import { useGetDataUsageMetrics } from '../hooks/use_get_usage_metrics'; +import { useGetDataUsageDataStreams } from '../hooks/use_get_data_streams'; +import { mockUseKibana } from './mocks'; + +jest.mock('../hooks/use_get_usage_metrics'); +jest.mock('../hooks/use_get_data_streams'); +const mockServices = mockCore.createStart(); +jest.mock('../utils/use_breadcrumbs', () => { + return { + useBreadcrumbs: jest.fn(), + }; +}); +jest.mock('../utils/use_kibana', () => { + return { + useKibanaContextForPlugin: () => ({ + services: mockServices, + }), + }; +}); + +const mockUseLocation = jest.fn(() => ({ pathname: '/' })); +jest.mock('react-router-dom', () => ({ + ...jest.requireActual('react-router-dom'), + useLocation: () => mockUseLocation(), + useHistory: jest.fn().mockReturnValue({ + push: jest.fn(), + listen: jest.fn(), + location: { + search: '', + }, + }), +})); + +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useKibana: () => mockUseKibana, + }; +}); + +const mockUseGetDataUsageMetrics = useGetDataUsageMetrics as jest.Mock; +const mockUseGetDataUsageDataStreams = useGetDataUsageDataStreams as jest.Mock; + +const getBaseMockedDataStreams = () => ({ + error: undefined, + data: undefined, + isFetching: false, + refetch: jest.fn(), +}); +const getBaseMockedDataUsageMetrics = () => ({ + error: undefined, + data: undefined, + isFetching: false, + refetch: jest.fn(), +}); + +describe('DataUsageMetrics Page', () => { + const testId = 'test'; + let renderComponent: () => RenderResult; + + beforeAll(() => { + jest.useFakeTimers(); + }); + + afterAll(() => { + jest.useRealTimers(); + }); + + beforeEach(() => { + jest.clearAllMocks(); + renderComponent = () => + render( + <TestProvider> + <DataUsageMetricsPage data-test-subj={testId} /> + </TestProvider> + ); + mockUseGetDataUsageMetrics.mockReturnValue(getBaseMockedDataUsageMetrics); + mockUseGetDataUsageDataStreams.mockReturnValue(getBaseMockedDataStreams); + }); + + it('renders', () => { + const { getByTestId } = renderComponent(); + expect(getByTestId(`${testId}-page-header`)).toBeTruthy(); + }); + + it('should show page title', () => { + const { getByTestId } = renderComponent(); + expect(getByTestId(`${testId}-page-title`)).toBeTruthy(); + expect(getByTestId(`${testId}-page-title`)).toHaveTextContent('Data Usage'); + }); + + it('should show page description', () => { + const { getByTestId } = renderComponent(); + expect(getByTestId(`${testId}-page-description`)).toBeTruthy(); + expect(getByTestId(`${testId}-page-description`)).toHaveTextContent( + 'Monitor data ingested and retained by data streams over the past 10 days.' + ); + }); +}); diff --git a/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.tsx b/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.tsx new file mode 100644 index 000000000000..7edc2b57e360 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/data_usage_metrics_page.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo } from 'react'; +import { DataUsagePage } from './components/page'; +import { DATA_USAGE_PAGE } from '../translations'; +import { DataUsageMetrics } from './components/data_usage_metrics'; +import { useTestIdGenerator } from '../hooks/use_test_id_generator'; + +export interface DataUsageMetricsPageProps { + 'data-test-subj'?: string; +} +export const DataUsageMetricsPage = memo<DataUsageMetricsPageProps>( + ({ 'data-test-subj': dataTestSubj = 'data-usage' }) => { + const getTestId = useTestIdGenerator(dataTestSubj); + + return ( + <DataUsagePage + data-test-subj={getTestId('page')} + title={DATA_USAGE_PAGE.title} + subtitle={DATA_USAGE_PAGE.subTitle} + > + <DataUsageMetrics data-test-subj={getTestId('metrics')} /> + </DataUsagePage> + ); + } +); + +DataUsageMetricsPage.displayName = 'DataUsageMetricsPage'; diff --git a/x-pack/plugins/data_usage/public/app/hooks/index.tsx b/x-pack/platform/plugins/private/data_usage/public/app/hooks/index.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/hooks/index.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/hooks/index.tsx diff --git a/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_filter.tsx b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_filter.tsx new file mode 100644 index 000000000000..429ffab06637 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_filter.tsx @@ -0,0 +1,164 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState, useEffect, useMemo } from 'react'; +import { EuiIconTip } from '@elastic/eui'; +import { DEFAULT_SELECTED_OPTIONS } from '../../../common'; +import { + METRIC_TYPE_VALUES, + METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP, + isDefaultMetricType, +} from '../../../common/rest_types'; +import { FILTER_NAMES, UX_LABELS } from '../../translations'; +import { useDataUsageMetricsUrlParams } from './use_charts_url_params'; +import { formatBytes } from '../../utils/format_bytes'; +import { ChartsFilterProps } from '../components/filters/charts_filter'; + +export type FilterName = keyof typeof FILTER_NAMES; + +export type FilterItems = Array<{ + key?: string; + label: string; + isGroupLabel?: boolean; + checked?: 'on' | undefined; + 'data-test-subj'?: string; +}>; + +export const useChartsFilter = ({ + filterOptions, +}: { + filterOptions: ChartsFilterProps['filterOptions']; +}): { + areDataStreamsSelectedOnMount: boolean; + items: FilterItems; + setItems: React.Dispatch<React.SetStateAction<FilterItems>>; + hasActiveFilters: boolean; + numActiveFilters: number; + numFilters: number; + setAreDataStreamsSelectedOnMount: (value: React.SetStateAction<boolean>) => void; + setUrlDataStreamsFilter: ReturnType< + typeof useDataUsageMetricsUrlParams + >['setUrlDataStreamsFilter']; + setUrlMetricTypesFilter: ReturnType< + typeof useDataUsageMetricsUrlParams + >['setUrlMetricTypesFilter']; +} => { + const { + dataStreams: selectedDataStreamsFromUrl, + metricTypes: selectedMetricTypesFromUrl, + setUrlMetricTypesFilter, + setUrlDataStreamsFilter, + } = useDataUsageMetricsUrlParams(); + const isMetricTypesFilter = filterOptions.filterName === 'metricTypes'; + const isDataStreamsFilter = filterOptions.filterName === 'dataStreams'; + + // track the state of selected data streams via URL + // when the page is loaded via selected data streams on URL + const [areDataStreamsSelectedOnMount, setAreDataStreamsSelectedOnMount] = + useState<boolean>(false); + + useEffect(() => { + if (selectedDataStreamsFromUrl && selectedDataStreamsFromUrl.length > 0) { + setAreDataStreamsSelectedOnMount(true); + } + // don't sync with changes to further selectedDataStreamsFromUrl + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const initialSelectedOptions = useMemo(() => { + if (isMetricTypesFilter) { + return METRIC_TYPE_VALUES.map((metricType) => ({ + key: metricType, + label: METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP[metricType], + checked: selectedMetricTypesFromUrl + ? selectedMetricTypesFromUrl.includes(metricType) + ? 'on' + : undefined + : isDefaultMetricType(metricType) // default metrics are selected by default + ? 'on' + : undefined, + 'data-test-subj': `${filterOptions.filterName}-filter-option`, + })) as FilterItems; + } + let dataStreamOptions: FilterItems = []; + + if (isDataStreamsFilter && !!filterOptions.options.length) { + dataStreamOptions = filterOptions.options?.map((filterOption, i) => ({ + key: filterOption, + label: filterOption, + append: formatBytes(filterOptions.appendOptions?.[filterOption] ?? 0), + checked: selectedDataStreamsFromUrl + ? selectedDataStreamsFromUrl.includes(filterOption) + ? 'on' + : undefined + : i < DEFAULT_SELECTED_OPTIONS + ? 'on' + : undefined, + 'data-test-subj': `${filterOptions.filterName}-filter-option`, + truncationProps: { + truncation: 'start', + truncationOffset: 15, + }, + })); + } + + return [ + { + label: UX_LABELS.filters.dataStreams.label, + append: ( + <span css={{ display: 'flex', alignItems: 'flex-end', marginLeft: 'auto' }}> + {UX_LABELS.filters.dataStreams.append} + <EuiIconTip + content={UX_LABELS.filters.dataStreams.appendTooltip} + type="iInCircle" + color="subdued" + css={{ alignContent: 'flex-start', justifyContent: 'flex-start' }} + /> + </span> + ), + isGroupLabel: true, + 'data-test-subj': `${filterOptions.filterName}-group-label`, + }, + ...dataStreamOptions, + ]; + }, [ + filterOptions.appendOptions, + filterOptions.filterName, + filterOptions.options, + isDataStreamsFilter, + isMetricTypesFilter, + selectedDataStreamsFromUrl, + selectedMetricTypesFromUrl, + ]); + // filter options + const [items, setItems] = useState<FilterItems>(initialSelectedOptions); + + const hasActiveFilters = useMemo( + () => !!items.find((item) => !item.isGroupLabel && item.checked === 'on'), + [items] + ); + const numActiveFilters = useMemo( + () => items.filter((item) => !item.isGroupLabel && item.checked === 'on').length, + [items] + ); + const numFilters = useMemo( + () => items.filter((item) => item.key && item.checked !== 'on').length, + [items] + ); + + return { + areDataStreamsSelectedOnMount, + items, + setItems, + hasActiveFilters, + numActiveFilters, + numFilters, + setAreDataStreamsSelectedOnMount, + setUrlMetricTypesFilter, + setUrlDataStreamsFilter, + }; +}; diff --git a/x-pack/plugins/data_usage/public/app/hooks/use_charts_url_params.test.tsx b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_url_params.test.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/hooks/use_charts_url_params.test.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_url_params.test.tsx diff --git a/x-pack/plugins/data_usage/public/app/hooks/use_charts_url_params.tsx b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_url_params.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/app/hooks/use_charts_url_params.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/hooks/use_charts_url_params.tsx diff --git a/x-pack/plugins/data_usage/public/app/hooks/use_date_picker.tsx b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_date_picker.tsx similarity index 85% rename from x-pack/plugins/data_usage/public/app/hooks/use_date_picker.tsx rename to x-pack/platform/plugins/private/data_usage/public/app/hooks/use_date_picker.tsx index 6b7e6f792b69..ce5c70584946 100644 --- a/x-pack/plugins/data_usage/public/app/hooks/use_date_picker.tsx +++ b/x-pack/platform/plugins/private/data_usage/public/app/hooks/use_date_picker.tsx @@ -5,14 +5,14 @@ * 2.0. */ -import { useCallback, useState } from 'react'; +import { useCallback, useMemo, useState } from 'react'; import type { DurationRange, OnRefreshChangeProps, } from '@elastic/eui/src/components/date_picker/types'; import { useDataUsageMetricsUrlParams } from './use_charts_url_params'; import { DateRangePickerValues } from '../components/filters/date_picker'; -import { DEFAULT_DATE_RANGE_OPTIONS } from '../../../common/utils'; +import { DEFAULT_DATE_RANGE_OPTIONS, isDateRangeValid } from '../../../common/utils'; export const useDateRangePicker = () => { const { @@ -85,5 +85,14 @@ export const useDateRangePicker = () => { ] ); - return { dateRangePickerState, onRefreshChange, onTimeChange }; + const isValidDateRange = useMemo( + () => + isDateRangeValid({ + start: dateRangePickerState.startDate, + end: dateRangePickerState.endDate, + }), + [dateRangePickerState.endDate, dateRangePickerState.startDate] + ); + + return { dateRangePickerState, isValidDateRange, onRefreshChange, onTimeChange }; }; diff --git a/x-pack/platform/plugins/private/data_usage/public/app/mocks.ts b/x-pack/platform/plugins/private/data_usage/public/app/mocks.ts new file mode 100644 index 000000000000..eed86c4bc6dc --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/app/mocks.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. + */ +export const mockUseKibana = { + services: { + uiSettings: { + get: jest.fn().mockImplementation((key) => { + const get = (k: 'dateFormat' | 'timepicker:quickRanges') => { + const x = { + dateFormat: 'MMM D, YYYY @ HH:mm:ss.SSS', + 'timepicker:quickRanges': [ + { + from: 'now/d', + to: 'now/d', + display: 'Today', + }, + { + from: 'now/w', + to: 'now/w', + display: 'This week', + }, + { + from: 'now-15m', + to: 'now', + display: 'Last 15 minutes', + }, + { + from: 'now-30m', + to: 'now', + display: 'Last 30 minutes', + }, + { + from: 'now-1h', + to: 'now', + display: 'Last 1 hour', + }, + { + from: 'now-24h', + to: 'now', + display: 'Last 24 hours', + }, + { + from: 'now-7d', + to: 'now', + display: 'Last 7 days', + }, + ], + }; + return x[k]; + }; + return get(key); + }), + }, + }, +}; + +export const generateDataStreams = (count: number) => { + return Array.from({ length: count }, (_, i) => ({ + name: `.ds-${i}`, + storageSizeBytes: 1024 ** 2 * (22 / 7), + })); +}; diff --git a/x-pack/plugins/data_usage/public/application.tsx b/x-pack/platform/plugins/private/data_usage/public/application.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/application.tsx rename to x-pack/platform/plugins/private/data_usage/public/application.tsx diff --git a/x-pack/plugins/data_usage/public/hooks/use_get_data_streams.test.tsx b/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_data_streams.test.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/hooks/use_get_data_streams.test.tsx rename to x-pack/platform/plugins/private/data_usage/public/hooks/use_get_data_streams.test.tsx diff --git a/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_data_streams.ts b/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_data_streams.ts new file mode 100644 index 000000000000..0dc9d7d535eb --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_data_streams.ts @@ -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 { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import { useQuery } from '@tanstack/react-query'; +import type { IHttpFetchError } from '@kbn/core-http-browser'; +import { DataStreamsResponseBodySchemaBody } from '../../common/rest_types'; +import { DATA_USAGE_DATA_STREAMS_API_ROUTE, DEFAULT_SELECTED_OPTIONS } from '../../common'; +import { useKibanaContextForPlugin } from '../utils/use_kibana'; + +type GetDataUsageDataStreamsResponse = Array< + DataStreamsResponseBodySchemaBody[number] & { + selected: boolean; + } +>; + +export const useGetDataUsageDataStreams = ({ + selectedDataStreams, + options = { + enabled: false, + }, +}: { + selectedDataStreams?: string[]; + options?: UseQueryOptions<GetDataUsageDataStreamsResponse, IHttpFetchError>; +}): UseQueryResult<GetDataUsageDataStreamsResponse, IHttpFetchError> => { + const { http } = useKibanaContextForPlugin().services; + + return useQuery<GetDataUsageDataStreamsResponse, IHttpFetchError>({ + queryKey: ['get-data-usage-data-streams'], + ...options, + keepPreviousData: true, + queryFn: async ({ signal }) => { + return http + .get<GetDataUsageDataStreamsResponse>(DATA_USAGE_DATA_STREAMS_API_ROUTE, { + signal, + version: '1', + }) + .then((response) => { + const augmentedDataStreamsBasedOnSelectedItems = response.reduce<{ + selected: GetDataUsageDataStreamsResponse; + rest: GetDataUsageDataStreamsResponse; + }>( + (acc, ds, i) => { + const item = { + name: ds.name, + storageSizeBytes: ds.storageSizeBytes, + selected: ds.selected, + }; + + if (selectedDataStreams?.includes(ds.name) && i < DEFAULT_SELECTED_OPTIONS) { + acc.selected.push({ ...item, selected: true }); + } else { + acc.rest.push({ ...item, selected: false }); + } + + return acc; + }, + { selected: [], rest: [] } + ); + + return [ + ...augmentedDataStreamsBasedOnSelectedItems.selected, + ...augmentedDataStreamsBasedOnSelectedItems.rest, + ]; + }) + .catch((error) => { + throw error.body; + }); + }, + }); +}; diff --git a/x-pack/plugins/data_usage/public/hooks/use_get_usage_metrics.test.tsx b/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_usage_metrics.test.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/hooks/use_get_usage_metrics.test.tsx rename to x-pack/platform/plugins/private/data_usage/public/hooks/use_get_usage_metrics.test.tsx diff --git a/x-pack/plugins/data_usage/public/hooks/use_get_usage_metrics.ts b/x-pack/platform/plugins/private/data_usage/public/hooks/use_get_usage_metrics.ts similarity index 100% rename from x-pack/plugins/data_usage/public/hooks/use_get_usage_metrics.ts rename to x-pack/platform/plugins/private/data_usage/public/hooks/use_get_usage_metrics.ts diff --git a/x-pack/plugins/data_usage/public/hooks/use_test_id_generator.ts b/x-pack/platform/plugins/private/data_usage/public/hooks/use_test_id_generator.ts similarity index 100% rename from x-pack/plugins/data_usage/public/hooks/use_test_id_generator.ts rename to x-pack/platform/plugins/private/data_usage/public/hooks/use_test_id_generator.ts diff --git a/x-pack/plugins/data_usage/public/hooks/use_url_params.ts b/x-pack/platform/plugins/private/data_usage/public/hooks/use_url_params.ts similarity index 100% rename from x-pack/plugins/data_usage/public/hooks/use_url_params.ts rename to x-pack/platform/plugins/private/data_usage/public/hooks/use_url_params.ts diff --git a/x-pack/plugins/data_usage/public/index.ts b/x-pack/platform/plugins/private/data_usage/public/index.ts similarity index 100% rename from x-pack/plugins/data_usage/public/index.ts rename to x-pack/platform/plugins/private/data_usage/public/index.ts diff --git a/x-pack/plugins/data_usage/public/plugin.ts b/x-pack/platform/plugins/private/data_usage/public/plugin.ts similarity index 100% rename from x-pack/plugins/data_usage/public/plugin.ts rename to x-pack/platform/plugins/private/data_usage/public/plugin.ts diff --git a/x-pack/platform/plugins/private/data_usage/public/translations.tsx b/x-pack/platform/plugins/private/data_usage/public/translations.tsx new file mode 100644 index 000000000000..ba70f0cdc178 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/public/translations.tsx @@ -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 { i18n } from '@kbn/i18n'; + +export const PLUGIN_NAME = i18n.translate('xpack.dataUsage.name', { + defaultMessage: 'Data Usage', +}); + +export const FILTER_NAMES = Object.freeze({ + metricTypes: i18n.translate('xpack.dataUsage.metrics.filter.metricTypes', { + defaultMessage: 'Metric types', + }), + dataStreams: i18n.translate('xpack.dataUsage.metrics.filter.dataStreams', { + defaultMessage: 'Data streams', + }), +}); + +export const CHART_TITLES = Object.freeze({ + ingest_rate: i18n.translate('xpack.dataUsage.charts.ingestedMax', { + defaultMessage: 'Data Ingested', + }), + storage_retained: i18n.translate('xpack.dataUsage.charts.retainedMax', { + defaultMessage: 'Data Retained in Storage', + }), +}); + +export const DATA_USAGE_PAGE = Object.freeze({ + title: i18n.translate('xpack.dataUsage.name', { + defaultMessage: 'Data Usage', + }), + subTitle: i18n.translate('xpack.dataUsage.pageSubtitle', { + defaultMessage: 'Monitor data ingested and retained by data streams over the past 10 days.', + }), +}); + +export const UX_LABELS = Object.freeze({ + filters: { + invalidDateRange: i18n.translate('xpack.dataUsage.metrics.filter.invalidDateRange', { + defaultMessage: 'The date range should be within 10 days from now.', + }), + dataStreams: { + label: i18n.translate('xpack.dataUsage.metrics.filter.dataStreams.label', { + defaultMessage: 'Name', + }), + append: i18n.translate('xpack.dataUsage.metrics.filter.dataStreams.append', { + defaultMessage: 'Size', + }), + appendTooltip: i18n.translate('xpack.dataUsage.metrics.filter.dataStreams.appendTooltip', { + defaultMessage: 'Storage size is not updated based on the selected date range.', + }), + }, + }, + filterSelectAll: i18n.translate('xpack.dataUsage.metrics.filter.selectAll', { + defaultMessage: 'Select all', + }), + filterClearAll: i18n.translate('xpack.dataUsage.metrics.filter.clearAll', { + defaultMessage: 'Clear all', + }), + filterSearchPlaceholder: (filterName: string) => + i18n.translate('xpack.dataUsage.metrics.filter.searchPlaceholder', { + defaultMessage: 'Search {filterName}', + values: { filterName }, + }), + filterEmptyMessage: (filterName: string) => + i18n.translate('xpack.dataUsage.metrics.filter.emptyMessage', { + defaultMessage: 'No {filterName} available', + values: { filterName }, + }), + dataQualityPopup: { + open: i18n.translate('xpack.dataUsage.metrics.dataQuality.open.actions', { + defaultMessage: 'Open data stream actions', + }), + copy: i18n.translate('xpack.dataUsage.metrics.dataQuality.copy.dataStream', { + defaultMessage: 'Copy data stream name', + }), + manage: i18n.translate('xpack.dataUsage.metrics.dataQuality.manage.dataStream', { + defaultMessage: 'Manage data stream', + }), + view: i18n.translate('xpack.dataUsage.metrics.dataQuality.view', { + defaultMessage: 'View data quality', + }), + }, +}); diff --git a/x-pack/plugins/data_usage/public/types.ts b/x-pack/platform/plugins/private/data_usage/public/types.ts similarity index 100% rename from x-pack/plugins/data_usage/public/types.ts rename to x-pack/platform/plugins/private/data_usage/public/types.ts diff --git a/x-pack/plugins/data_usage/public/utils/format_bytes.test.ts b/x-pack/platform/plugins/private/data_usage/public/utils/format_bytes.test.ts similarity index 100% rename from x-pack/plugins/data_usage/public/utils/format_bytes.test.ts rename to x-pack/platform/plugins/private/data_usage/public/utils/format_bytes.test.ts diff --git a/x-pack/plugins/data_usage/public/utils/format_bytes.ts b/x-pack/platform/plugins/private/data_usage/public/utils/format_bytes.ts similarity index 100% rename from x-pack/plugins/data_usage/public/utils/format_bytes.ts rename to x-pack/platform/plugins/private/data_usage/public/utils/format_bytes.ts diff --git a/x-pack/plugins/data_usage/public/utils/use_breadcrumbs.tsx b/x-pack/platform/plugins/private/data_usage/public/utils/use_breadcrumbs.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/utils/use_breadcrumbs.tsx rename to x-pack/platform/plugins/private/data_usage/public/utils/use_breadcrumbs.tsx diff --git a/x-pack/plugins/data_usage/public/utils/use_kibana.tsx b/x-pack/platform/plugins/private/data_usage/public/utils/use_kibana.tsx similarity index 100% rename from x-pack/plugins/data_usage/public/utils/use_kibana.tsx rename to x-pack/platform/plugins/private/data_usage/public/utils/use_kibana.tsx diff --git a/x-pack/plugins/data_usage/server/common/errors.ts b/x-pack/platform/plugins/private/data_usage/server/common/errors.ts similarity index 100% rename from x-pack/plugins/data_usage/server/common/errors.ts rename to x-pack/platform/plugins/private/data_usage/server/common/errors.ts diff --git a/x-pack/plugins/data_usage/server/config.ts b/x-pack/platform/plugins/private/data_usage/server/config.ts similarity index 100% rename from x-pack/plugins/data_usage/server/config.ts rename to x-pack/platform/plugins/private/data_usage/server/config.ts diff --git a/x-pack/plugins/data_usage/server/errors.ts b/x-pack/platform/plugins/private/data_usage/server/errors.ts similarity index 100% rename from x-pack/plugins/data_usage/server/errors.ts rename to x-pack/platform/plugins/private/data_usage/server/errors.ts diff --git a/x-pack/plugins/data_usage/server/index.ts b/x-pack/platform/plugins/private/data_usage/server/index.ts similarity index 100% rename from x-pack/plugins/data_usage/server/index.ts rename to x-pack/platform/plugins/private/data_usage/server/index.ts diff --git a/x-pack/plugins/data_usage/server/mocks/index.ts b/x-pack/platform/plugins/private/data_usage/server/mocks/index.ts similarity index 100% rename from x-pack/plugins/data_usage/server/mocks/index.ts rename to x-pack/platform/plugins/private/data_usage/server/mocks/index.ts diff --git a/x-pack/plugins/data_usage/server/plugin.ts b/x-pack/platform/plugins/private/data_usage/server/plugin.ts similarity index 100% rename from x-pack/plugins/data_usage/server/plugin.ts rename to x-pack/platform/plugins/private/data_usage/server/plugin.ts diff --git a/x-pack/plugins/data_usage/server/routes/error_handler.ts b/x-pack/platform/plugins/private/data_usage/server/routes/error_handler.ts similarity index 100% rename from x-pack/plugins/data_usage/server/routes/error_handler.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/error_handler.ts diff --git a/x-pack/plugins/data_usage/server/routes/index.tsx b/x-pack/platform/plugins/private/data_usage/server/routes/index.tsx similarity index 100% rename from x-pack/plugins/data_usage/server/routes/index.tsx rename to x-pack/platform/plugins/private/data_usage/server/routes/index.tsx diff --git a/x-pack/plugins/data_usage/server/routes/internal/data_streams.test.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts similarity index 80% rename from x-pack/plugins/data_usage/server/routes/internal/data_streams.test.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts index 9efe61bd7511..9316a64328c9 100644 --- a/x-pack/plugins/data_usage/server/routes/internal/data_streams.test.ts +++ b/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.test.ts @@ -127,6 +127,48 @@ describe('registerDataStreamsRoute', () => { }); }); + it('should not include `dot` indices/data streams that start with a `.`', async () => { + mockGetMeteringStats.mockResolvedValue({ + datastreams: [ + { + name: 'ds-1', + size_in_bytes: 100, + }, + { + name: '.ds-2', + size_in_bytes: 200, + }, + { + name: 'ds-3', + size_in_bytes: 500, + }, + { + name: '.ds-4', + size_in_bytes: 0, + }, + ], + }); + const mockRequest = httpServerMock.createKibanaRequest({ body: {} }); + const mockResponse = httpServerMock.createResponseFactory(); + const mockRouter = mockCore.http.createRouter.mock.results[0].value; + const [[, handler]] = mockRouter.versioned.get.mock.results[0].value.addVersion.mock.calls; + await handler(context, mockRequest, mockResponse); + + expect(mockResponse.ok).toHaveBeenCalledTimes(1); + expect(mockResponse.ok.mock.calls[0][0]).toEqual({ + body: [ + { + name: 'ds-3', + storageSizeBytes: 500, + }, + { + name: 'ds-1', + storageSizeBytes: 100, + }, + ], + }); + }); + it('should return correct error if metering stats request fails with an unknown error', async () => { // using custom error for test here to avoid having to import the actual error class mockGetMeteringStats.mockRejectedValue( @@ -178,9 +220,9 @@ describe('registerDataStreamsRoute', () => { }); it.each([ - ['no datastreams', {}, []], - ['empty array', { datastreams: [] }, []], - ['an empty element', { datastreams: [{}] }, []], + ['no datastreams key in response', { indices: [] }, []], + ['empty datastreams array', { indices: [], datastreams: [] }, []], + ['an empty element', { indices: [], datastreams: [{}] }, []], ])('should return empty array when no stats data with %s', async (_, stats, res) => { mockGetMeteringStats.mockResolvedValue(stats); const mockRequest = httpServerMock.createKibanaRequest({ body: {} }); @@ -189,9 +231,18 @@ describe('registerDataStreamsRoute', () => { const [[, handler]] = mockRouter.versioned.get.mock.results[0].value.addVersion.mock.calls; await handler(context, mockRequest, mockResponse); - expect(mockResponse.ok).toHaveBeenCalledTimes(1); - expect(mockResponse.ok.mock.calls[0][0]).toEqual({ - body: res, - }); + // @ts-expect-error + if (stats && stats.datastreams && stats.datastreams.length) { + expect(mockResponse.ok).toHaveBeenCalledTimes(1); + expect(mockResponse.ok.mock.calls[0][0]).toEqual({ + body: res, + }); + } else { + expect(mockResponse.customError).toHaveBeenCalledTimes(1); + expect(mockResponse.customError).toHaveBeenCalledWith({ + body: new CustomHttpRequestError('No user defined data streams found', 404), + statusCode: 404, + }); + } }); }); diff --git a/x-pack/plugins/data_usage/server/routes/internal/data_streams.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts similarity index 100% rename from x-pack/plugins/data_usage/server/routes/internal/data_streams.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams.ts diff --git a/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams_handler.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams_handler.ts new file mode 100644 index 000000000000..0f472ca98065 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/server/routes/internal/data_streams_handler.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RequestHandler } from '@kbn/core/server'; +import { DataUsageContext, DataUsageRequestHandlerContext } from '../../types'; +import { errorHandler } from '../error_handler'; +import { getMeteringStats } from '../../utils/get_metering_stats'; +import type { + DataStreamsRequestQuery, + DataStreamsResponseBodySchemaBody, +} from '../../../common/rest_types/data_streams'; +import { NoIndicesMeteringError, NoPrivilegeMeteringError } from '../../errors'; +import { CustomHttpRequestError } from '../../utils'; + +export const getDataStreamsHandler = ( + dataUsageContext: DataUsageContext +): RequestHandler<never, DataStreamsRequestQuery, unknown, DataUsageRequestHandlerContext> => { + const logger = dataUsageContext.logFactory.get('dataStreamsRoute'); + return async (context, request, response) => { + const { includeZeroStorage } = request.query; + + logger.debug('Retrieving user data streams'); + + try { + const core = await context.core; + const { datastreams: meteringStatsDataStreams } = await getMeteringStats( + core.elasticsearch.client.asSecondaryAuthUser + ); + + const nonSystemDataStreams = meteringStatsDataStreams?.filter((dataStream) => { + return !dataStream.name?.startsWith('.'); + }); + + if (!nonSystemDataStreams || !nonSystemDataStreams.length) { + return errorHandler( + logger, + response, + new CustomHttpRequestError('No user defined data streams found', 404) + ); + } + + const body = nonSystemDataStreams + .reduce<DataStreamsResponseBodySchemaBody>((acc, stat) => { + if (includeZeroStorage || stat.size_in_bytes > 0) { + acc.push({ + name: stat.name, + storageSizeBytes: stat.size_in_bytes, + }); + } + return acc; + }, []) + .sort((a, b) => b.storageSizeBytes - a.storageSizeBytes); + + return response.ok({ + body, + }); + } catch (error) { + if (error.message.includes('security_exception')) { + return errorHandler(logger, response, new NoPrivilegeMeteringError()); + } else if (error.message.includes('index_not_found_exception')) { + return errorHandler(logger, response, new NoIndicesMeteringError()); + } + + return errorHandler(logger, response, error); + } + }; +}; diff --git a/x-pack/plugins/data_usage/server/routes/internal/index.tsx b/x-pack/platform/plugins/private/data_usage/server/routes/internal/index.tsx similarity index 100% rename from x-pack/plugins/data_usage/server/routes/internal/index.tsx rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/index.tsx diff --git a/x-pack/plugins/data_usage/server/routes/internal/usage_metrics.test.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.test.ts similarity index 100% rename from x-pack/plugins/data_usage/server/routes/internal/usage_metrics.test.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.test.ts diff --git a/x-pack/plugins/data_usage/server/routes/internal/usage_metrics.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts similarity index 100% rename from x-pack/plugins/data_usage/server/routes/internal/usage_metrics.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics.ts diff --git a/x-pack/plugins/data_usage/server/routes/internal/usage_metrics_handler.ts b/x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics_handler.ts similarity index 100% rename from x-pack/plugins/data_usage/server/routes/internal/usage_metrics_handler.ts rename to x-pack/platform/plugins/private/data_usage/server/routes/internal/usage_metrics_handler.ts diff --git a/x-pack/plugins/data_usage/server/services/app_context.ts b/x-pack/platform/plugins/private/data_usage/server/services/app_context.ts similarity index 100% rename from x-pack/plugins/data_usage/server/services/app_context.ts rename to x-pack/platform/plugins/private/data_usage/server/services/app_context.ts diff --git a/x-pack/plugins/data_usage/server/services/autoops_api.ts b/x-pack/platform/plugins/private/data_usage/server/services/autoops_api.ts similarity index 100% rename from x-pack/plugins/data_usage/server/services/autoops_api.ts rename to x-pack/platform/plugins/private/data_usage/server/services/autoops_api.ts diff --git a/x-pack/plugins/data_usage/server/services/index.ts b/x-pack/platform/plugins/private/data_usage/server/services/index.ts similarity index 100% rename from x-pack/plugins/data_usage/server/services/index.ts rename to x-pack/platform/plugins/private/data_usage/server/services/index.ts diff --git a/x-pack/plugins/data_usage/server/types/index.ts b/x-pack/platform/plugins/private/data_usage/server/types/index.ts similarity index 100% rename from x-pack/plugins/data_usage/server/types/index.ts rename to x-pack/platform/plugins/private/data_usage/server/types/index.ts diff --git a/x-pack/plugins/data_usage/server/types/types.ts b/x-pack/platform/plugins/private/data_usage/server/types/types.ts similarity index 100% rename from x-pack/plugins/data_usage/server/types/types.ts rename to x-pack/platform/plugins/private/data_usage/server/types/types.ts diff --git a/x-pack/plugins/data_usage/server/utils/custom_http_request_error.ts b/x-pack/platform/plugins/private/data_usage/server/utils/custom_http_request_error.ts similarity index 100% rename from x-pack/plugins/data_usage/server/utils/custom_http_request_error.ts rename to x-pack/platform/plugins/private/data_usage/server/utils/custom_http_request_error.ts diff --git a/x-pack/plugins/data_usage/server/utils/get_metering_stats.ts b/x-pack/platform/plugins/private/data_usage/server/utils/get_metering_stats.ts similarity index 100% rename from x-pack/plugins/data_usage/server/utils/get_metering_stats.ts rename to x-pack/platform/plugins/private/data_usage/server/utils/get_metering_stats.ts diff --git a/x-pack/plugins/data_usage/server/utils/index.ts b/x-pack/platform/plugins/private/data_usage/server/utils/index.ts similarity index 100% rename from x-pack/plugins/data_usage/server/utils/index.ts rename to x-pack/platform/plugins/private/data_usage/server/utils/index.ts diff --git a/x-pack/platform/plugins/private/data_usage/tsconfig.json b/x-pack/platform/plugins/private/data_usage/tsconfig.json new file mode 100644 index 000000000000..6ebec73506c6 --- /dev/null +++ b/x-pack/platform/plugins/private/data_usage/tsconfig.json @@ -0,0 +1,40 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "common/**/*", + "public/**/*", + "server/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/i18n", + "@kbn/data-plugin", + "@kbn/kibana-react-plugin", + "@kbn/management-plugin", + "@kbn/react-kibana-context-render", + "@kbn/shared-ux-router", + "@kbn/ebt-tools", + "@kbn/share-plugin", + "@kbn/config-schema", + "@kbn/logging", + "@kbn/deeplinks-observability", + "@kbn/unified-search-plugin", + "@kbn/core-http-browser", + "@kbn/core-chrome-browser", + "@kbn/features-plugin", + "@kbn/index-management-shared-types", + "@kbn/repo-info", + "@kbn/cloud-plugin", + "@kbn/server-http-tools", + "@kbn/utility-types-jest", + "@kbn/datemath", + "@kbn/ui-theme", + "@kbn/i18n-react", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx index 365f868a63bc..669c48b1db8b 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/boolean_content.tsx @@ -54,7 +54,7 @@ export const BooleanContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) = <TopValues stats={config.stats} fieldFormat={fieldFormat} - barColor="success" + barColor="accentSecondary" onAddFilter={onAddFilter} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx index d16922075517..6baaf8e065d1 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/ip_content.tsx @@ -26,7 +26,7 @@ export const IpContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => { <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="success" + barColor="accentSecondary" onAddFilter={onAddFilter} /> )} diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx index 44be869c9af9..ddca9193db2b 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/keyword_content.tsx @@ -62,14 +62,14 @@ export const KeywordContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) = <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="success" + barColor="accentSecondary" onAddFilter={onAddFilter} /> {config.stats?.sampledValues && fieldName !== undefined ? ( <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="success" + barColor="accentSecondary" onAddFilter={onAddFilter} showSampledValues={true} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx index a1ff19482621..8b121660e342 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/stats_table/components/field_data_expanded_row/number_content.tsx @@ -119,7 +119,7 @@ export const NumberContent: FC<FieldDataRowProps> = ({ config, onAddFilter }) => <TopValues stats={stats} fieldFormat={fieldFormat} - barColor="success" + barColor="accentSecondary" compressed={true} onAddFilter={onAddFilter} /> diff --git a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx index 5d263135389e..35c648e7135b 100644 --- a/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx +++ b/x-pack/platform/plugins/private/data_visualizer/public/application/common/components/top_values/top_values.tsx @@ -11,6 +11,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiProgress, + type EuiProgressProps, EuiText, EuiButtonIcon, EuiSpacer, @@ -36,7 +37,7 @@ import { EMPTY_EXAMPLE } from '../examples_list/examples_list'; interface Props { stats: FieldVisStats | undefined; fieldFormat?: any; - barColor?: 'primary' | 'success' | 'danger' | 'subdued' | 'accent'; + barColor?: EuiProgressProps['color']; compressed?: boolean; onAddFilter?: (field: DataViewField | string, value: string, type: '+' | '-') => void; showSampledValues?: boolean; diff --git a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx index efd4fb1d500a..18a3f5c63daf 100644 --- a/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx +++ b/x-pack/platform/plugins/private/transform/public/app/sections/transform_management/components/refresh_transform_list_button/refresh_transform_list_button.tsx @@ -19,7 +19,7 @@ export const RefreshTransformListButton: FC<RefreshTransformListButton> = ({ isLoading, }) => ( <EuiButton - color="success" + color="accentSecondary" iconType="refresh" data-test-subj={`transformRefreshTransformListButton${isLoading ? ' loading' : ' loaded'}`} onClick={onClick} diff --git a/x-pack/platform/plugins/private/translations/translations/fr-FR.json b/x-pack/platform/plugins/private/translations/translations/fr-FR.json index 81298783701e..503e24e6b954 100644 --- a/x-pack/platform/plugins/private/translations/translations/fr-FR.json +++ b/x-pack/platform/plugins/private/translations/translations/fr-FR.json @@ -215,17 +215,8 @@ "charts.legend.toggleLegendButtonAriaLabel": "Afficher/Masquer la légende", "charts.legend.toggleLegendButtonTitle": "Afficher/Masquer la légende", "charts.noDataLabel": "Résultat introuvable", - "charts.palettes.complementaryLabel": "Complémentaire", - "charts.palettes.coolLabel": "Froide", "charts.palettes.customLabel": "Personnalisée", - "charts.palettes.defaultPaletteLabel": "Par défaut", - "charts.palettes.grayLabel": "Gris", "charts.palettes.kibanaPaletteLabel": "Compatibilité", - "charts.palettes.negativeLabel": "Négative", - "charts.palettes.positiveLabel": "Positive", - "charts.palettes.statusLabel": "Statut", - "charts.palettes.temperatureLabel": "Température", - "charts.palettes.warmLabel": "Chaude", "charts.partialData.bucketTooltipText": "La plage temporelle sélectionnée n'inclut pas ce compartiment en entier. Il se peut qu'elle contienne des données partielles.", "charts.warning.warningLabel": "{numberWarnings, number} {numberWarnings, plural, one {avertissement} other {avertissements}}", "cloud.connectionDetails.apiKeyFormat.beats.description": "Utilisé pour la configuration de Beats", @@ -1463,13 +1454,9 @@ "dashboard.emptyScreen.noPermissionsTitle": "Ce tableau de bord est vide.", "dashboard.emptyScreen.viewModeSubtitle": "Accédez au mode de modification, puis commencez à ajouter vos visualisations.", "dashboard.emptyScreen.viewModeTitle": "Ajouter des visualisations à votre tableau de bord", - "dashboard.factory.displayName": "Dashboard", - "dashboard.factory.displayNameLowercase": "tableau de bord", "dashboard.featureCatalogue.dashboardDescription": "Affichez et partagez une collection de visualisations et de recherches enregistrées.", "dashboard.featureCatalogue.dashboardSubtitle": "Analysez des données à l’aide de tableaux de bord.", "dashboard.featureCatalogue.dashboardTitle": "Dashboard", - "dashboard.hasRunMigrationsBadge": "Enregistrement recommandé", - "dashboard.hasRunMigrationsBadgeToolTipContent": "Un ou plusieurs panneaux de ce tableau de bord ont été mis à jour vers une nouvelle version. Enregistrez le tableau de bord pour qu'il charge plus rapidement la prochaine fois.", "dashboard.labs.enableLabsDescription": "Cet indicateur détermine si l'utilisateur a accès au bouton Ateliers, moyen rapide d'activer et de désactiver les fonctionnalités de la version d'évaluation technique dans le tableau de bord.", "dashboard.labs.enableUI": "Activer le bouton Ateliers dans le tableau de bord", "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "Analysez toutes vos données Elastic en un seul endroit, en créant un tableau de bord et en ajoutant des visualisations.", @@ -2807,7 +2794,6 @@ "embeddableApi.addPanel.managedPanelTooltip": "Elastic gère ce panneau. Le fait de l'ajouter à un tableau de bord le dissocie de la bibliothèque.", "embeddableApi.addPanel.noMatchingObjectsMessage": "Aucun objet correspondant trouvé.", "embeddableApi.addPanel.Title": "Ajouter depuis la bibliothèque", - "embeddableApi.attributeService.saveToLibraryError": "Une erreur s'est produite lors de l'enregistrement. Erreur : {errorMessage}.", "embeddableApi.cellValueTrigger.description": "Les actions apparaissent dans les options de valeur de cellule dans la visualisation", "embeddableApi.cellValueTrigger.title": "Valeur de cellule", "embeddableApi.common.constants.grouping.annotations": "Annotations et Navigation", @@ -2830,9 +2816,6 @@ "embeddableApi.panelNotificationTrigger.title": "Notifications du panneau", "embeddableApi.reactEmbeddable.factoryAlreadyExistsError": "Une usine incorporable pour le type : {key} est déjà enregistrée.", "embeddableApi.reactEmbeddable.factoryNotFoundError": "Aucune usine incorporable n'a été trouvée pour le type : {key}", - "embeddableApi.samples.contactCard.displayName": "carte de visite", - "embeddableApi.samples.filterableContainer.displayName": "tableau de bord filtrable", - "embeddableApi.samples.filterableEmbeddable.displayName": "filtrable", "embeddableApi.selectRangeTrigger.description": "Une plage de valeurs sur la visualisation", "embeddableApi.selectRangeTrigger.title": "Sélection de la plage", "embeddableApi.valueClickTrigger.description": "Un point de données cliquable sur la visualisation", @@ -3139,17 +3122,6 @@ "exceptionList-components.wildcardWithWrongOperatorCallout.changeTheOperator": "Changer d'opérateur", "exceptionList-components.wildcardWithWrongOperatorCallout.matches": "correspond à", "exceptionList-components.wildcardWithWrongOperatorCallout.title": "Veuillez examiner vos entrées", - "expandableFlyout.previewSection.backButton": "Retour", - "expandableFlyout.previewSection.closeButton": "Fermer", - "expandableFlyout.renderMenu.flyoutResizeButton": "Réinitialiser la taille", - "expandableFlyout.renderMenu.flyoutResizeTitle": "Taille du menu volant", - "expandableFlyout.settingsMenu.flyoutTypeTitle": "Type de menu volant", - "expandableFlyout.settingsMenu.overlayMode": "Superposer", - "expandableFlyout.settingsMenu.overlayTooltip": "Affiche le menu volant sur la page", - "expandableFlyout.settingsMenu.popoverButton": "Paramètres du menu volant", - "expandableFlyout.settingsMenu.popoverTitle": "Paramètres du menu volant", - "expandableFlyout.settingsMenu.pushMode": "Déploiement", - "expandableFlyout.settingsMenu.pushTooltip": "Affiche le menu volant à côté de la page", "expressionError.errorComponent.description": "Échec de l'expression avec le message :", "expressionError.errorComponent.title": "Oups ! Échec de l'expression", "expressionError.renderer.debug.displayName": "Déboguer", @@ -7621,8 +7593,6 @@ "share.link.copyEmbedCodeButton": "Copier le code intégré", "share.link.copyLinkButton": "Copier le lien", "share.link.helpText": "Partager un lien direct vers ce {objectType}.", - "share.link.warning.lens": "Copiez le lien afin d’obtenir un lien temporaire. Enregistrez la visualisation Lens pour créer un lien permanent.", - "share.link.warning.title": "Modifications non enregistrées", "share.modalContent.copyUrlButtonLabel": "Copier l'URL Post", "share.postURLWatcherMessage": "Copiez cette URL POST pour appeler la génération depuis l'extérieur de Kibana ou à partir de Watcher.", "share.postURLWatcherMessage.unsavedChanges": "L'URL peut changer si vous mettez Kibana à niveau.", @@ -15961,7 +15931,6 @@ "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxGenerationAttemptsErrorMessage": "Nombre maximum de tentatives de génération ({generationAttempts}) atteint. Essayez d'envoyer un nombre d'alertes moins élevé à ce modèle.", "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxHallucinationFailuresErrorMessage": "Nombre maximum d'échecs d'hallucinations ({hallucinationFailures}) atteint. Essayez d'envoyer un nombre d'alertes moins élevé à ce modèle.", "xpack.elasticAssistantPlugin.server.newChat": "Nouveau chat", - "xpack.embeddableEnhanced.Drilldowns": "Explorations", "xpack.enterpriseSearch.accessControlIndexSelector.p.accessControlSyncsAreLabel": "Les synchronisations de contrôle d'accès maintiennent les informations d'autorisation à jour pour assurer la sécurité au niveau du document (DLS)", "xpack.enterpriseSearch.actions.backButtonLabel": "Retour", "xpack.enterpriseSearch.actions.cancelButtonLabel": "Annuler", @@ -18332,7 +18301,6 @@ "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.pipelinesLabel": "Pipelines", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.schedulingTitle": "Planification", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.syncRulesLabel": "Règles de synchronisation", - "xpack.enterpriseSearch.nav.title": "Enterprise Search", "xpack.enterpriseSearch.navigation.applicationsSearchApplicationsLinkLabel": "Applications de recherche", "xpack.enterpriseSearch.navigation.appSearchEnginesLinkLabel": "Moteurs", "xpack.enterpriseSearch.navigation.contentConnectorsLinkLabel": "Connecteurs", @@ -18682,8 +18650,6 @@ "xpack.enterpriseSearch.searchNav.build.searchApplications": "Applications de recherche", "xpack.enterpriseSearch.searchNav.content": "Contenu", "xpack.enterpriseSearch.searchNav.devTools": "Outils de développement", - "xpack.enterpriseSearch.searchNav.entsearch": "Enterprise Search", - "xpack.enterpriseSearch.searchNav.entsearch.appSearch": "App Search", "xpack.enterpriseSearch.searchNav.headerSolutionSwitcher.searchSolutionTitle": "Recherche", "xpack.enterpriseSearch.searchNav.kibana": "Kibana", "xpack.enterpriseSearch.searchNav.management": "Gestion", @@ -25996,7 +25962,6 @@ "xpack.investigateApp.addObservationUI.h2.addAnObservationChartLabel": "Ajouter un graphique d'observation", "xpack.investigateApp.addObservationUI.p.selectADataSourceLabel": "Sélectionnez une source de données pour générer un graphique d'aperçu", "xpack.investigateApp.appTitle": "Investigations", - "xpack.investigateApp.assistantHypothesis.observabilityAIAssistantContextualInsight.helpMeInvestigateThisLabel": "Aidez-moi à résoudre la cause de cet échec", "xpack.investigateApp.defaultChart.error_equation.description": "Vérifiez l'équation.", "xpack.investigateApp.defaultChart.error_equation.title": "Une erreur s'est produite lors de l'affichage du graphique", "xpack.investigateApp.defaultChart.noData.title": "Aucune donnée graphique disponible", @@ -26160,6 +26125,8 @@ "xpack.lens.app.settingsAriaLabel": "Ouvrir le menu de paramètres Lens", "xpack.lens.app.share.defaultDashboardTitle": "Visualisation Lens [{date}]", "xpack.lens.app.shareButtonDisabledWarning": "La visualisation ne comprend aucune donnée à partager.", + "xpack.lens.app.shareModal.draftModeCallout.link.warning": "Copiez le lien afin d’obtenir un lien temporaire. Enregistrez la visualisation Lens pour créer un lien permanent.", + "xpack.lens.app.shareModal.draftModeCallout.title": "Modifications non enregistrées", "xpack.lens.app.shareModal.title": "Partager cette visualisation Lens", "xpack.lens.app.shareTitle": "Partager", "xpack.lens.app.shareTitleAria": "Partager la visualisation", @@ -39084,43 +39051,26 @@ "xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.title": "Affichage différé", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionDescriptionLabel": "Affiche la règle actuellement installée", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionLabel": "Règle actuelle", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.fieldsWithUpdates": "La mise à niveau contient {count} {count, plural, one {champ} other {champs}}", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfConflicts": "{count} {count, plural, one {conflit} other {conflits}}", "xpack.securitySolution.detectionEngine.rules.upgradeRules.editButtonLabel": "Modifier", "xpack.securitySolution.detectionEngine.rules.upgradeRules.elasticUpdateVersionLabel": "Mise à jour Elastic", "xpack.securitySolution.detectionEngine.rules.upgradeRules.expandHiddenDiffLinesLabel": "Développer {linesCount}{linesCount, plural, one {ligne} other {lignes}}", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldReadOnly.noteLabel": "Guide d'investigation", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflict": "Conflit résolu", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflictDescription": "Nous avons suggéré une mise à jour pour ce champ modifié, veuillez la consulter avant d'accepter.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflicts": "{count} des champs {count, plural, one {a} other {ont}} un conflit non résolu. Veuillez en prendre connaissance et apporter les modifications appropriées.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflictsDescription": "Veuillez apporter une contribution au conflit non résolu. Vous pouvez également conserver la version actuelle sans les mises à jour, ou accepter la mise à jour Elastic tout en perdant vos modifications.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflicts": "{count} des champs {count, plural, one {a} other {ont}} un conflit de mise à jour. Veuillez examiner la mise à jour en cours suggérée.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflictsDescription": "Veuillez consulter la version mise à jour recommandée avant de l'accepter. Vous pouvez modifier le champ, puis l'enregistrer, si nécessaire.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgrade": "La mise à jour est prête à être appliquée.", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgradeDescription": "Tous les conflits ont maintenant été examinés et résolus, veuillez mettre à jour la règle.", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.separator": "-", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflict": "Conflit résolu", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflictDescription": "Nous avons suggéré une mise à jour pour ce champ modifié, veuillez la consulter avant d'accepter.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAccepted": "Mise à jour acceptée", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAcceptedDescription": "Vous pouvez toujours apporter des modifications, veuillez consulter/accepter tous les autres conflits avant de mettre à jour la règle.", "xpack.securitySolution.detectionEngine.rules.upgradeRules.finalUpdate": "Mise à jour finale", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesBodyTitle": "Il n’y a actuellement aucune mise à jour disponible pour vos règles Elastic installées.", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesTitle": "Toutes les règles Elastic sont à jour", "xpack.securitySolution.detectionEngine.rules.upgradeRules.ruleUpgradeHelper": "Découvrez comment {docsLink}.", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.saveButtonLabel": "Enregistrer", "xpack.securitySolution.detectionEngine.rules.upgradeRules.searchBarPlaceholder": "Rechercher par nom de règle", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updatedVersionDescriptionLabel": "Affiche la règle qui sera installée", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updateYourRulesDocsLink": "mettre à jour vos règles", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeAll": "Tout mettre à jour", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText": "Choisissez les valeurs de champ utilisées dans la règle mise à niveau.", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeSelected": "Mettre à jour {numberOfSelectedRules} règle(s) sélectionnée(s)", "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.ariaLabel": "Sélectionnez les versions à comparer", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsCurrentLabel": "Base - Actuel", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsFinalLabel": "Base - Final", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsTargetLabel": "Base - Cible", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsFinalLabel": "Actuel - Final", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsTargetLabel": "Actuel - Cible", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.targetVsFinalLabel": "Actuel - Final", "xpack.securitySolution.detectionEngine.rulesSnoozeBadge.error.unableToFetch": "Impossible de récupérer les paramètres de répétition", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistant": "Demander à l'assistant", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistantDesc": "Message d'erreur de l'exécution de la règle", @@ -40781,9 +40731,6 @@ "xpack.securitySolution.flyout.right.response.responseButtonLabel": "Réponse", "xpack.securitySolution.flyout.right.response.sectionTitle": "Réponse", "xpack.securitySolution.flyout.right.rule.rulePreviewTitle": "Afficher les détails de la règle", - "xpack.securitySolution.flyout.right.title.alertEventTitle": "Détails d'alerte externe", - "xpack.securitySolution.flyout.right.title.eventTitle": "Détails de l'événement", - "xpack.securitySolution.flyout.right.title.otherEventTitle": "Détails de {eventKind}", "xpack.securitySolution.flyout.right.user.userPreviewTitle": "Aperçu des détails de l'utilisateur", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewInvestigateTooltip": "Investiguer dans la chronologie", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewOpenAnalyzerTooltip": "Ouvrir l'analyseur de graphe", @@ -48441,8 +48388,6 @@ "xpack.upgradeAssistant.checkupTab.reindexing.flyout.flyoutHeader": "Réindexer {index}", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.learnMoreLinkLabel": "En savoir plus", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.acceptChangesTitle": "Accepter les modifications", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "Les types de mapping ne sont plus pris en charge dans Elastic 8.x. Assurez-vous qu'aucun code d'application ou script n'utilise {mappingType}.", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "Remplacer le type de mapping {mappingType} par {defaultType}", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningDetail": "Les paramètres d'index déclassés ont été détectés :", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningTitle": "Retirer les paramètres d'index déclassés", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "Sauvegardez l'index avant de continuer. Pour poursuivre avec la réindexation, acceptez chaque modification.", @@ -48637,7 +48582,6 @@ "xpack.upgradeAssistant.overview.logsStep.title": "Traiter les déclassements d'API", "xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "Afficher les logs", "xpack.upgradeAssistant.overview.observe.discoveryDescription": "Recherchez et filtrez les logs de déclassement pour comprendre les types de modifications que vous devez effectuer.", - "xpack.upgradeAssistant.overview.observe.observabilityDescription": "Obtenez des informations sur les API déclassées qui sont utilisées et les applications que vous devez mettre à jour.", "xpack.upgradeAssistant.overview.pageDescription": "Préparez-vous pour la prochaine version de la Suite Elastic !", "xpack.upgradeAssistant.overview.pageTitle": "Assistant de mise à niveau", "xpack.upgradeAssistant.overview.snapshotRestoreLink": "Créer un snapshot", @@ -48674,7 +48618,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "Réinitialiser le compteur", "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "Réessayer", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Analyser les logs dans Discover", - "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Afficher les logs d'obsolescence dans Logs Explorer", "xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "Vous ne disposez pas des privilèges appropriés pour réindexer \"{indexName}\".", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "Tous les avertissements de déclassement ont été résolus.", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "Les problèmes suivants doivent être résolus avant la mise à niveau : {upgradeIssues}.", diff --git a/x-pack/platform/plugins/private/translations/translations/ja-JP.json b/x-pack/platform/plugins/private/translations/translations/ja-JP.json index ca80aaa127e3..25f2016d8830 100644 --- a/x-pack/platform/plugins/private/translations/translations/ja-JP.json +++ b/x-pack/platform/plugins/private/translations/translations/ja-JP.json @@ -215,17 +215,8 @@ "charts.legend.toggleLegendButtonAriaLabel": "凡例を切り替える", "charts.legend.toggleLegendButtonTitle": "凡例を切り替える", "charts.noDataLabel": "結果が見つかりませんでした", - "charts.palettes.complementaryLabel": "補完", - "charts.palettes.coolLabel": "Cool", "charts.palettes.customLabel": "カスタム", - "charts.palettes.defaultPaletteLabel": "デフォルト", - "charts.palettes.grayLabel": "グレー", "charts.palettes.kibanaPaletteLabel": "互換性", - "charts.palettes.negativeLabel": "負", - "charts.palettes.positiveLabel": "正", - "charts.palettes.statusLabel": "ステータス", - "charts.palettes.temperatureLabel": "温度", - "charts.palettes.warmLabel": "ウォーム", "charts.partialData.bucketTooltipText": "選択された時間範囲にはこのバケット全体は含まれていません。一部データが含まれている可能性があります。", "charts.warning.warningLabel": "{numberWarnings, number} {numberWarnings, plural, other {件の警告}}", "cloud.connectionDetails.apiKeyFormat.beats.description": "Beatsを構成するために使用", @@ -1463,13 +1454,9 @@ "dashboard.emptyScreen.noPermissionsTitle": "このダッシュボードは空です。", "dashboard.emptyScreen.viewModeSubtitle": "編集モードに切り替えて、ビジュアライゼーションの追加を開始します。", "dashboard.emptyScreen.viewModeTitle": "ダッシュボードにビジュアライゼーションを追加", - "dashboard.factory.displayName": "ダッシュボード", - "dashboard.factory.displayNameLowercase": "ダッシュボード", "dashboard.featureCatalogue.dashboardDescription": "ビジュアライゼーションと保存された検索のコレクションの表示と共有を行います。", "dashboard.featureCatalogue.dashboardSubtitle": "ダッシュボードでデータを分析します。", "dashboard.featureCatalogue.dashboardTitle": "ダッシュボード", - "dashboard.hasRunMigrationsBadge": "推奨を保存", - "dashboard.hasRunMigrationsBadgeToolTipContent": "このダッシュボードの1つ以上のパネルが新しいバージョンに更新されました。ダッシュボードを保存すると、次回の読み込みが速くなります。", "dashboard.labs.enableLabsDescription": "このフラグはビューアーで[ラボ]ボタンを使用できるかどうかを決定します。ダッシュボードで実験的機能を有効および無効にするための簡単な方法です。", "dashboard.labs.enableUI": "ダッシュボードで[ラボ]ボタンを有効にする", "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "ダッシュボードを作成し、ビジュアライゼーションを追加して、すべてのElasticデータを1つの場所で分析します。", @@ -2802,7 +2789,6 @@ "embeddableApi.addPanel.managedPanelTooltip": "Elasticはこのパネルを管理します。ダッシュボードに追加すると、ライブラリからリンクが解除されます。", "embeddableApi.addPanel.noMatchingObjectsMessage": "一致するオブジェクトが見つかりませんでした。", "embeddableApi.addPanel.Title": "ライブラリから追加", - "embeddableApi.attributeService.saveToLibraryError": "保存中にエラーが発生しました。エラー:{errorMessage}", "embeddableApi.cellValueTrigger.description": "アクションはビジュアライゼーションのセル値オプションに表示されます", "embeddableApi.cellValueTrigger.title": "セル値", "embeddableApi.common.constants.grouping.annotations": "注釈とナビゲーション", @@ -2825,9 +2811,6 @@ "embeddableApi.panelNotificationTrigger.title": "パネル通知", "embeddableApi.reactEmbeddable.factoryAlreadyExistsError": "タイプ\"{key}\"の埋め込み可能ファクトリはすでに登録されています。", "embeddableApi.reactEmbeddable.factoryNotFoundError": "タイプ\"{key}\"の埋め込み可能ファクトリが見つかりません", - "embeddableApi.samples.contactCard.displayName": "連絡先カード", - "embeddableApi.samples.filterableContainer.displayName": "フィルター可能なダッシュボード", - "embeddableApi.samples.filterableEmbeddable.displayName": "フィルター可能", "embeddableApi.selectRangeTrigger.description": "ビジュアライゼーションでの値の範囲", "embeddableApi.selectRangeTrigger.title": "範囲選択", "embeddableApi.valueClickTrigger.description": "ビジュアライゼーションでデータポイントをクリック", @@ -3133,17 +3116,6 @@ "exceptionList-components.wildcardWithWrongOperatorCallout.changeTheOperator": "演算子を変更", "exceptionList-components.wildcardWithWrongOperatorCallout.matches": "一致", "exceptionList-components.wildcardWithWrongOperatorCallout.title": "エントリを確認してください", - "expandableFlyout.previewSection.backButton": "戻る", - "expandableFlyout.previewSection.closeButton": "閉じる", - "expandableFlyout.renderMenu.flyoutResizeButton": "サイズをリセット", - "expandableFlyout.renderMenu.flyoutResizeTitle": "フライアウトサイズ", - "expandableFlyout.settingsMenu.flyoutTypeTitle": "フライアウトタイプ", - "expandableFlyout.settingsMenu.overlayMode": "オーバーレイ", - "expandableFlyout.settingsMenu.overlayTooltip": "ページ上にフライアウトを表示します", - "expandableFlyout.settingsMenu.popoverButton": "フライアウト設定", - "expandableFlyout.settingsMenu.popoverTitle": "フライアウト設定", - "expandableFlyout.settingsMenu.pushMode": "プッシュ", - "expandableFlyout.settingsMenu.pushTooltip": "ページの横にフライアウトを表示します", "expressionError.errorComponent.description": "表現が失敗し次のメッセージが返されました:", "expressionError.errorComponent.title": "おっと!表現が失敗しました", "expressionError.renderer.debug.displayName": "デバッグ", @@ -7498,8 +7470,6 @@ "share.link.copyEmbedCodeButton": "埋め込みコードをコピー", "share.link.copyLinkButton": "リンクをコピー", "share.link.helpText": "この{objectType}への直接リンクを共有します。", - "share.link.warning.lens": "リンクをコピーして、一時リンクを取得します。Lensビジュアライゼーションを保存して、永続リンクを作成します。", - "share.link.warning.title": "保存されていない変更", "share.modalContent.copyUrlButtonLabel": "POST URLをコピー", "share.postURLWatcherMessage": "POST URLをコピーしてKibana外または旧Watcherから生成を呼び出します。", "share.postURLWatcherMessage.unsavedChanges": "Kibanaをアップグレードした場合、URLが変更されることがあります。", @@ -15824,7 +15794,6 @@ "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxGenerationAttemptsErrorMessage": "最大生成試行回数({generationAttempts})に達しました。このモデルに送信するアラートの数を減らしてください。", "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxHallucinationFailuresErrorMessage": "最大ハルシネーション失敗回数({hallucinationFailures})に達しました。このモデルに送信するアラートの数を減らしてください。", "xpack.elasticAssistantPlugin.server.newChat": "新しいチャット", - "xpack.embeddableEnhanced.Drilldowns": "ドリルダウン", "xpack.enterpriseSearch.accessControlIndexSelector.p.accessControlSyncsAreLabel": "アクセス制御の同期により、ドキュメントレベルセキュリティ(DLS)の権限情報が最新の状態に保たれます。", "xpack.enterpriseSearch.actions.backButtonLabel": "戻る", "xpack.enterpriseSearch.actions.cancelButtonLabel": "キャンセル", @@ -18191,7 +18160,6 @@ "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.pipelinesLabel": "パイプライン", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.schedulingTitle": "スケジュール", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.syncRulesLabel": "同期ルール", - "xpack.enterpriseSearch.nav.title": "エンタープライズ サーチ", "xpack.enterpriseSearch.navigation.applicationsSearchApplicationsLinkLabel": "検索アプリケーション", "xpack.enterpriseSearch.navigation.appSearchEnginesLinkLabel": "エンジン", "xpack.enterpriseSearch.navigation.contentConnectorsLinkLabel": "コネクター", @@ -18540,8 +18508,6 @@ "xpack.enterpriseSearch.searchNav.build.searchApplications": "検索アプリケーション", "xpack.enterpriseSearch.searchNav.content": "コンテンツ", "xpack.enterpriseSearch.searchNav.devTools": "開発ツール", - "xpack.enterpriseSearch.searchNav.entsearch": "エンタープライズ サーチ", - "xpack.enterpriseSearch.searchNav.entsearch.appSearch": "App Search", "xpack.enterpriseSearch.searchNav.headerSolutionSwitcher.searchSolutionTitle": "検索", "xpack.enterpriseSearch.searchNav.kibana": "Kibana", "xpack.enterpriseSearch.searchNav.management": "管理", @@ -25855,7 +25821,6 @@ "xpack.investigateApp.addObservationUI.h2.addAnObservationChartLabel": "観測グラフを追加", "xpack.investigateApp.addObservationUI.p.selectADataSourceLabel": "データソースを選択して、プレビューグラフを生成", "xpack.investigateApp.appTitle": "調査", - "xpack.investigateApp.assistantHypothesis.observabilityAIAssistantContextualInsight.helpMeInvestigateThisLabel": "このエラーの調査を支援", "xpack.investigateApp.defaultChart.error_equation.description": "式を確認してください。", "xpack.investigateApp.defaultChart.error_equation.title": "グラフの表示中にエラーが発生しました", "xpack.investigateApp.defaultChart.noData.title": "グラフデータがありません", @@ -26019,6 +25984,8 @@ "xpack.lens.app.settingsAriaLabel": "Lens設定メニューを開く", "xpack.lens.app.share.defaultDashboardTitle": "Lensビジュアライゼーション[{date}]", "xpack.lens.app.shareButtonDisabledWarning": "ビジュアライゼーションには共有するデータがありません。", + "xpack.lens.app.shareModal.draftModeCallout.link.warning": "リンクをコピーして、一時リンクを取得します。Lensビジュアライゼーションを保存して、永続リンクを作成します。", + "xpack.lens.app.shareModal.draftModeCallout.title": "保存されていない変更", "xpack.lens.app.shareModal.title": "このLensビジュアライゼーションを共有", "xpack.lens.app.shareTitle": "共有", "xpack.lens.app.shareTitleAria": "ビジュアライゼーションを共有", @@ -38941,43 +38908,26 @@ "xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.title": "差異ビュー", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionDescriptionLabel": "現在インストールされているルールを表示します", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionLabel": "現在のルール", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.fieldsWithUpdates": "アップグレードには{count} {count, plural, other {個のフィールド}}があります", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfConflicts": "{count} {count, plural, other {件の競合}}", "xpack.securitySolution.detectionEngine.rules.upgradeRules.editButtonLabel": "編集", "xpack.securitySolution.detectionEngine.rules.upgradeRules.elasticUpdateVersionLabel": "Elastic更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.expandHiddenDiffLinesLabel": "変更されていない{linesCount} {linesCount, plural, other {行}}を展開", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldReadOnly.noteLabel": "調査ガイド", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflict": "解決された競合", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflictDescription": "この修正されたフィールドの更新を提案しました。承認する前に確認してください。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflicts": "{count}個のフィールド{count, plural, other {には}}未解決の競合があります。確認し、必要に応じて修正してください。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflictsDescription": "未解決の競合の情報を入力してください。更新を適用せずに現在の状態を維持することもできます。Elasticの更新を承認すると、修正内容は失われます。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflicts": "{count}個のフィールド{count, plural, other {には}}更新の競合があります。更新中の候補の更新を確認してください。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflictsDescription": "更新を承認する前に、提案された更新バージョンを確認してください。変更する場合は、編集してフィールドを保存できます。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgrade": "更新を適用できます。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgradeDescription": "すべての競合が確認され、解決されました。ルールを更新してください。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.separator": "-", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflict": "解決された競合", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflictDescription": "この修正されたフィールドの更新を提案しました。承認する前に確認してください。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAccepted": "更新が承認されました", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAcceptedDescription": "変更を行うことができます。ルールを更新する前に、他のすべての競合を確認/承認してください。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.finalUpdate": "最終更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesBodyTitle": "現在、インストールされているElasticルールに利用可能な更新はありません。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesTitle": "すべてのElasticルールが最新です", "xpack.securitySolution.detectionEngine.rules.upgradeRules.ruleUpgradeHelper": "{docsLink}方法を確認してください。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.saveButtonLabel": "保存", "xpack.securitySolution.detectionEngine.rules.upgradeRules.searchBarPlaceholder": "ルール名で検索", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updatedVersionDescriptionLabel": "インストールされるルールを表示します", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updateYourRulesDocsLink": "ルールを更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeAll": "すべて更新", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText": "アップグレードされたルールで使用されるフィールド値を選択してください。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeSelected": "{numberOfSelectedRules}個の選択したルールを更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.ariaLabel": "比較するバージョンを選択", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsCurrentLabel": "基本と現在", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsFinalLabel": "基本と最終", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsTargetLabel": "基本とターゲット", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsFinalLabel": "現在と最終", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsTargetLabel": "現在とターゲット", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.targetVsFinalLabel": "ターゲットと最終", "xpack.securitySolution.detectionEngine.rulesSnoozeBadge.error.unableToFetch": "スヌーズ設定を取得できません", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistant": "アシスタントに聞く", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistantDesc": "ルールの実行失敗メッセージ", @@ -40638,9 +40588,6 @@ "xpack.securitySolution.flyout.right.response.responseButtonLabel": "応答", "xpack.securitySolution.flyout.right.response.sectionTitle": "応答", "xpack.securitySolution.flyout.right.rule.rulePreviewTitle": "ルール詳細をプレビュー", - "xpack.securitySolution.flyout.right.title.alertEventTitle": "外部アラート詳細", - "xpack.securitySolution.flyout.right.title.eventTitle": "イベントの詳細", - "xpack.securitySolution.flyout.right.title.otherEventTitle": "{eventKind}詳細", "xpack.securitySolution.flyout.right.user.userPreviewTitle": "ユーザー詳細をプレビュー", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewInvestigateTooltip": "タイムラインで調査", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewOpenAnalyzerTooltip": "アナライザーグラフを開く", @@ -48288,8 +48235,6 @@ "xpack.upgradeAssistant.checkupTab.reindexing.flyout.flyoutHeader": "再インデックス{index}", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.learnMoreLinkLabel": "詳細", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.acceptChangesTitle": "変更を承諾", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "マッピングタイプはElastic 8.xではサポートされていません。アプリケーションコードまたはスクリプトが{mappingType}に依存していないことを確認してください。", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "マッピングタイプ{mappingType}を{defaultType}で置き換えます", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningDetail": "次の廃止予定のインデックス設定が検出されました。", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningTitle": "廃止予定のインデックス設定を削除", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "続行する前に、インデックスをバックアップしてください。再インデックスを続行するには、各変更を承諾してください。", @@ -48485,7 +48430,6 @@ "xpack.upgradeAssistant.overview.logsStep.title": "API廃止予定に対処", "xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "ログを表示", "xpack.upgradeAssistant.overview.observe.discoveryDescription": "廃止予定ログを検索およびフィルターし、必要な変更のタイプを把握します。", - "xpack.upgradeAssistant.overview.observe.observabilityDescription": "使用中のAPIのうち廃止予定のAPIと、更新が必要なアプリケーションを特定できます。", "xpack.upgradeAssistant.overview.pageDescription": "次のバージョンのElastic Stackをお待ちください。", "xpack.upgradeAssistant.overview.pageTitle": "アップグレードアシスタント", "xpack.upgradeAssistant.overview.snapshotRestoreLink": "スナップショットの作成", @@ -48522,7 +48466,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "カウンターのリセット", "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "再試行", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "Discoverでログを分析", - "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "Logs Explorerで廃止予定ログを表示", "xpack.upgradeAssistant.reindex.reindexPrivilegesErrorBatch": "「{indexName}」に再インデックスするための権限が不十分です。", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "すべての廃止予定の警告が解決されました。", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "アップグレード前に次の問題を解決する必要があります:{upgradeIssues}。", diff --git a/x-pack/platform/plugins/private/translations/translations/zh-CN.json b/x-pack/platform/plugins/private/translations/translations/zh-CN.json index 31eb102ba678..ef52b9d34598 100644 --- a/x-pack/platform/plugins/private/translations/translations/zh-CN.json +++ b/x-pack/platform/plugins/private/translations/translations/zh-CN.json @@ -241,17 +241,8 @@ "charts.legend.toggleLegendButtonAriaLabel": "切换图例", "charts.legend.toggleLegendButtonTitle": "切换图例", "charts.noDataLabel": "找不到结果", - "charts.palettes.complementaryLabel": "互补性", - "charts.palettes.coolLabel": "冷", "charts.palettes.customLabel": "定制", - "charts.palettes.defaultPaletteLabel": "默认", - "charts.palettes.grayLabel": "灰", "charts.palettes.kibanaPaletteLabel": "兼容性", - "charts.palettes.negativeLabel": "负", - "charts.palettes.positiveLabel": "正", - "charts.palettes.statusLabel": "状态", - "charts.palettes.temperatureLabel": "温度", - "charts.palettes.warmLabel": "暖", "charts.partialData.bucketTooltipText": "选定的时间范围不包括此整个存储桶。其可能包含部分数据。", "charts.warning.warningLabel": "{numberWarnings, number} 个{numberWarnings, plural, other {警告}}", "cloud.connectionDetails.apiKeyFormat.beats.description": "用于配置 Beats", @@ -1476,13 +1467,9 @@ "dashboard.emptyScreen.noPermissionsTitle": "此仪表板是空的。", "dashboard.emptyScreen.viewModeSubtitle": "进入编辑模式,然后开始添加可视化。", "dashboard.emptyScreen.viewModeTitle": "将可视化添加到仪表板", - "dashboard.factory.displayName": "仪表板", - "dashboard.factory.displayNameLowercase": "仪表板", "dashboard.featureCatalogue.dashboardDescription": "显示和共享可视化和已保存搜索的集合。", "dashboard.featureCatalogue.dashboardSubtitle": "在仪表板中分析数据。", "dashboard.featureCatalogue.dashboardTitle": "仪表板", - "dashboard.hasRunMigrationsBadge": "保存推荐项", - "dashboard.hasRunMigrationsBadgeToolTipContent": "此仪表板上的一个或多个面板已更新到新版本。保存该仪表板以便下次更快加载。", "dashboard.labs.enableLabsDescription": "此标志决定查看者是否有权访问用于在仪表板中快速启用和禁用技术预览功能的'实验'按钮。", "dashboard.labs.enableUI": "在仪表板中启用实验按钮", "dashboard.listing.createNewDashboard.combineDataViewFromKibanaAppDescription": "通过创建仪表板并添加可视化,在一个位置分析所有 Elastic 数据。", @@ -2792,7 +2779,6 @@ "embeddableApi.addPanel.managedPanelTooltip": "Elastic 将管理此面板。将其添加到仪表板会取消其与库的链接。", "embeddableApi.addPanel.noMatchingObjectsMessage": "未找到任何匹配对象。", "embeddableApi.addPanel.Title": "从库中添加", - "embeddableApi.attributeService.saveToLibraryError": "保存时出错。错误:{errorMessage}", "embeddableApi.cellValueTrigger.description": "操作在可视化上的单元格值选项中显示", "embeddableApi.cellValueTrigger.title": "单元格值", "embeddableApi.common.constants.grouping.annotations": "标注和导航", @@ -2815,9 +2801,6 @@ "embeddableApi.panelNotificationTrigger.title": "面板通知", "embeddableApi.reactEmbeddable.factoryAlreadyExistsError": "已注册类型为 {key} 的可嵌入工厂。", "embeddableApi.reactEmbeddable.factoryNotFoundError": "未找到类型为 {key} 的可嵌入工厂", - "embeddableApi.samples.contactCard.displayName": "联系卡片", - "embeddableApi.samples.filterableContainer.displayName": "可筛选仪表板", - "embeddableApi.samples.filterableEmbeddable.displayName": "可筛选", "embeddableApi.selectRangeTrigger.description": "可视化上的值范围", "embeddableApi.selectRangeTrigger.title": "范围选择", "embeddableApi.valueClickTrigger.description": "可视化上的数据点单击", @@ -3123,17 +3106,6 @@ "exceptionList-components.wildcardWithWrongOperatorCallout.changeTheOperator": "更改运算符", "exceptionList-components.wildcardWithWrongOperatorCallout.matches": "匹配", "exceptionList-components.wildcardWithWrongOperatorCallout.title": "请复查您的条目", - "expandableFlyout.previewSection.backButton": "返回", - "expandableFlyout.previewSection.closeButton": "关闭", - "expandableFlyout.renderMenu.flyoutResizeButton": "重置大小", - "expandableFlyout.renderMenu.flyoutResizeTitle": "浮出控件大小", - "expandableFlyout.settingsMenu.flyoutTypeTitle": "浮出控件类型", - "expandableFlyout.settingsMenu.overlayMode": "覆盖", - "expandableFlyout.settingsMenu.overlayTooltip": "在页面上显示浮出控件", - "expandableFlyout.settingsMenu.popoverButton": "浮出控件设置", - "expandableFlyout.settingsMenu.popoverTitle": "浮出控件设置", - "expandableFlyout.settingsMenu.pushMode": "推送", - "expandableFlyout.settingsMenu.pushTooltip": "在页面旁显示浮出控件", "expressionError.errorComponent.description": "表达式失败,并显示消息:", "expressionError.errorComponent.title": "哎哟!表达式失败", "expressionError.renderer.debug.displayName": "故障排查", @@ -7381,8 +7353,6 @@ "share.link.copyEmbedCodeButton": "复制嵌入代码", "share.link.copyLinkButton": "复制链接", "share.link.helpText": "共享指向此 {objectType} 的直接链接。", - "share.link.warning.lens": "复制链接以获取临时链接。保存 Lens 可视化以创建永久链接。", - "share.link.warning.title": "未保存的更改", "share.modalContent.copyUrlButtonLabel": "复制 Post URL", "share.postURLWatcherMessage": "复制此 POST URL 以从 Kibana 外部或从 Watcher 调用生成。", "share.postURLWatcherMessage.unsavedChanges": "如果升级 Kibana,URL 可能会发生更改。", @@ -15544,7 +15514,6 @@ "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxGenerationAttemptsErrorMessage": "已达到最大生成尝试次数 ({generationAttempts})。尝试向此模型发送更少的告警。", "xpack.elasticAssistantPlugin.attackDiscovery.defaultAttackDiscoveryGraph.nodes.retriever.helpers.throwIfErrorCountsExceeded.maxHallucinationFailuresErrorMessage": "已达到最大幻觉失败次数 ({hallucinationFailures})。尝试向此模型发送更少的告警。", "xpack.elasticAssistantPlugin.server.newChat": "新聊天", - "xpack.embeddableEnhanced.Drilldowns": "向下钻取", "xpack.enterpriseSearch.accessControlIndexSelector.p.accessControlSyncsAreLabel": "访问控制同步会使权限信息保持最新以实现文档级别安全性 (DLS)", "xpack.enterpriseSearch.actions.backButtonLabel": "返回", "xpack.enterpriseSearch.actions.cancelButtonLabel": "取消", @@ -17888,7 +17857,6 @@ "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.pipelinesLabel": "管道", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.schedulingTitle": "正在计划", "xpack.enterpriseSearch.nav.searchIndicesTitle.nav.syncRulesLabel": "同步规则", - "xpack.enterpriseSearch.nav.title": "Enterprise Search", "xpack.enterpriseSearch.navigation.applicationsSearchApplicationsLinkLabel": "搜索应用程序", "xpack.enterpriseSearch.navigation.appSearchEnginesLinkLabel": "引擎", "xpack.enterpriseSearch.navigation.contentConnectorsLinkLabel": "连接器", @@ -18238,8 +18206,6 @@ "xpack.enterpriseSearch.searchNav.build.searchApplications": "搜索应用程序", "xpack.enterpriseSearch.searchNav.content": "内容", "xpack.enterpriseSearch.searchNav.devTools": "开发工具", - "xpack.enterpriseSearch.searchNav.entsearch": "Enterprise Search", - "xpack.enterpriseSearch.searchNav.entsearch.appSearch": "App Search", "xpack.enterpriseSearch.searchNav.headerSolutionSwitcher.searchSolutionTitle": "搜索", "xpack.enterpriseSearch.searchNav.kibana": "Kibana", "xpack.enterpriseSearch.searchNav.management": "管理", @@ -25418,7 +25384,6 @@ "xpack.investigateApp.addObservationUI.h2.addAnObservationChartLabel": "添加观察图表", "xpack.investigateApp.addObservationUI.p.selectADataSourceLabel": "选择数据源以生成预览图表", "xpack.investigateApp.appTitle": "调查", - "xpack.investigateApp.assistantHypothesis.observabilityAIAssistantContextualInsight.helpMeInvestigateThisLabel": "帮助我调查此故障", "xpack.investigateApp.defaultChart.error_equation.description": "检查方程。", "xpack.investigateApp.defaultChart.error_equation.title": "渲染图表时出错", "xpack.investigateApp.defaultChart.noData.title": "没有可用图表数据", @@ -25581,6 +25546,8 @@ "xpack.lens.app.settingsAriaLabel": "打开 Lens 设置菜单", "xpack.lens.app.share.defaultDashboardTitle": "Lens 可视化 [{date}]", "xpack.lens.app.shareButtonDisabledWarning": "此可视化没有可共享的数据。", + "xpack.lens.app.shareModal.draftModeCallout.link.warning": "复制链接以获取临时链接。保存 Lens 可视化以创建永久链接。", + "xpack.lens.app.shareModal.draftModeCallout.title": "未保存的更改", "xpack.lens.app.shareModal.title": "共享此 Lens 可视化", "xpack.lens.app.shareTitle": "共享", "xpack.lens.app.shareTitleAria": "共享可视化", @@ -38365,43 +38332,26 @@ "xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.title": "差异视图", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionDescriptionLabel": "显示当前安装的规则", "xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionLabel": "当前规则", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.fieldsWithUpdates": "升级包含 {count} 个{count, plural, other {字段}}", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfConflicts": "{count} 个{count, plural, other {冲突}}", "xpack.securitySolution.detectionEngine.rules.upgradeRules.editButtonLabel": "编辑", "xpack.securitySolution.detectionEngine.rules.upgradeRules.elasticUpdateVersionLabel": "Elastic 更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.expandHiddenDiffLinesLabel": "展开 {linesCount} 个未更改的{linesCount, plural, other {行}}", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldReadOnly.noteLabel": "调查指南", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflict": "已解决冲突", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflictDescription": "我们已为这个已修改字段推荐了更新,请在接受前进行复查。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflicts": "{count} 个字段{count, plural, other {存在}}未解决的冲突。请复查并做出相应更改。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflictsDescription": "请为未解决的冲突提供输入。您还可以保持现状而不进行更新,也可以接受 Elastic 更新但丢失修改。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflicts": "{count} 个字段{count, plural, other {存在}}更新冲突,请复查正在更新的建议更新。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflictsDescription": "在接受更新之前,请复查建议的已更新版本。如果希望更改字段,您可以编辑然后保存字段。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgrade": "更新已准备就绪,可以应用。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgradeDescription": "现已复查并解决所有冲突,请更新规则。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.separator": "-", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflict": "已解决冲突", "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflictDescription": "我们已为这个已修改字段推荐了更新,请在接受前进行复查。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAccepted": "已接受更新", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAcceptedDescription": "您仍然可以做出更改,在更新规则之前,请复查/接受所有其他冲突。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.finalUpdate": "最后更新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesBodyTitle": "您已安装的 Elastic 规则当前没有可用更新。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.noRulesTitle": "所有 Elastic 规则均保持最新", "xpack.securitySolution.detectionEngine.rules.upgradeRules.ruleUpgradeHelper": "了解如何 {docsLink}。", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.saveButtonLabel": "保存", "xpack.securitySolution.detectionEngine.rules.upgradeRules.searchBarPlaceholder": "按规则名称搜索", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updatedVersionDescriptionLabel": "显示将安装的规则", "xpack.securitySolution.detectionEngine.rules.upgradeRules.updateYourRulesDocsLink": "更新您的规则", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeAll": "全部更新", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText": "选择用在已升级规则中的字段值。", "xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeSelected": "更新 {numberOfSelectedRules} 个选定规则", "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.ariaLabel": "选择要比较的版本", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsCurrentLabel": "基础与当前", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsFinalLabel": "基础与最终", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsTargetLabel": "基础与目标", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsFinalLabel": "当前与最终", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsTargetLabel": "当前与目标", - "xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.targetVsFinalLabel": "目标与最终", "xpack.securitySolution.detectionEngine.rulesSnoozeBadge.error.unableToFetch": "无法提取暂停设置", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistant": "询问助手", "xpack.securitySolution.detectionEngine.ruleStatus.askAssistantDesc": "规则的执行失败消息", @@ -40036,9 +39986,6 @@ "xpack.securitySolution.flyout.right.response.responseButtonLabel": "响应", "xpack.securitySolution.flyout.right.response.sectionTitle": "响应", "xpack.securitySolution.flyout.right.rule.rulePreviewTitle": "预览规则详情", - "xpack.securitySolution.flyout.right.title.alertEventTitle": "外部告警详情", - "xpack.securitySolution.flyout.right.title.eventTitle": "事件详情", - "xpack.securitySolution.flyout.right.title.otherEventTitle": "{eventKind} 详情", "xpack.securitySolution.flyout.right.user.userPreviewTitle": "预览用户详情", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewInvestigateTooltip": "在时间线中调查", "xpack.securitySolution.flyout.right.visualizations.analyzerPreview.analyzerPreviewOpenAnalyzerTooltip": "打开分析器图表", @@ -47577,8 +47524,6 @@ "xpack.upgradeAssistant.checkupTab.reindexing.flyout.flyoutHeader": "重新索引 {index}", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.learnMoreLinkLabel": "了解详情", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.acceptChangesTitle": "接受更改", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "映射类型在 Elastic 8.x 中不再受支持。确保没有应用程序代码或脚本依赖 {mappingType}。", - "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "将映射类型 {mappingType} 替换为 {defaultType}", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningDetail": "检测到以下弃用的索引设置:", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.deprecatedIndexSettingsWarningTitle": "移除弃用的索引设置", "xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "继续前备份索引。要继续重新索引,请接受每个更改。", @@ -47774,7 +47719,6 @@ "xpack.upgradeAssistant.overview.logsStep.title": "解决 API 弃用", "xpack.upgradeAssistant.overview.logsStep.viewLogsButtonLabel": "查看日志", "xpack.upgradeAssistant.overview.observe.discoveryDescription": "搜索并筛选弃用日志以了解需要进行的更改类型。", - "xpack.upgradeAssistant.overview.observe.observabilityDescription": "深入了解正在使用哪些已弃用 API 以及需要更新哪些应用程序。", "xpack.upgradeAssistant.overview.pageDescription": "准备使用下一版 Elastic Stack!", "xpack.upgradeAssistant.overview.pageTitle": "升级助手", "xpack.upgradeAssistant.overview.snapshotRestoreLink": "创建快照", @@ -47811,7 +47755,6 @@ "xpack.upgradeAssistant.overview.verifyChanges.resetCounterButton": "重置计数器", "xpack.upgradeAssistant.overview.verifyChanges.retryButton": "重试", "xpack.upgradeAssistant.overview.viewDiscoverResultsAction": "在 Discover 中分析日志", - "xpack.upgradeAssistant.overview.viewObservabilityResultsAction": "在日志浏览器中查看弃用日志", "xpack.upgradeAssistant.status.allDeprecationsResolvedMessage": "所有弃用警告均已解决。", "xpack.upgradeAssistant.status.deprecationsUnresolvedMessage": "在升级之前必须解决以下问题:{upgradeIssues}。", "xpack.upgradeAssistant.status.esTotalCriticalDepsMessage": "{esTotalCriticalDeps} 个 Elasticsearch 弃用{esTotalCriticalDeps, plural, other {问题}}", diff --git a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx index febbce519b50..afa1fd27ac99 100644 --- a/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx +++ b/x-pack/platform/plugins/shared/aiops/public/components/log_rate_analysis/log_rate_analysis_info_popover.tsx @@ -23,7 +23,7 @@ export const LogRateAnalysisInfoPopoverButton: FC<{ <EuiBadge iconType="help" iconSide="right" - color="success" + color="hollow" // Defining both iconOnClick and onClick so the mouse cursor changes for cases. iconOnClick={onClick} iconOnClickAriaLabel='Click to open "Log rate analysis info" popover' diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/constants.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/constants.ts index 71d936931822..9c0ea6bb3023 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/constants.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/constants.ts @@ -7,7 +7,7 @@ // Definitions index -export const DEFINITIONS_ALIAS = '.kibana-entities-definitions'; +export const DEFINITIONS_ALIAS = '.kibana_entities-definitions'; export const TEMPLATE_VERSION = 1; // Privileges diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/constants.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/constants.ts new file mode 100644 index 000000000000..3982a91b8f67 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/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 BUILT_IN_ID_PREFIX = 'built_in_'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/containers_from_ecs_data.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/containers_from_ecs_data.ts new file mode 100644 index 000000000000..244cfb82fc6d --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/containers_from_ecs_data.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 { BuiltInDefinition } from '../../types'; +import { BUILT_IN_ID_PREFIX } from './constants'; + +export const builtInContainersFromEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}containers_from_ecs_data`, + display_name: 'Containers', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}containers_from_ecs_data_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}containers_from_ecs_data`, + index_patterns: ['filebeat-*', 'logs-*', 'metrics-*', 'metricbeat-*'], + identity_fields: ['container.id'], + display_name: 'container.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: [], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/hosts_from_ecs_data.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/hosts_from_ecs_data.ts new file mode 100644 index 000000000000..a6aa14991c0d --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/hosts_from_ecs_data.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 { BUILT_IN_ID_PREFIX } from './constants'; +import { BuiltInDefinition } from '../../types'; + +export const builtInHostsFromEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}hosts_from_ecs_data`, + display_name: 'Hosts', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}hosts_from_ecs_data_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}hosts_from_ecs_data`, + index_patterns: ['filebeat-*', 'logs-*', 'metrics-*', 'metricbeat-*'], + identity_fields: ['host.name'], + display_name: 'host.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: [], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/index.ts new file mode 100644 index 000000000000..9f7b67469b6a --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { builtInServicesFromEcsEntityDefinition } from './services_from_ecs_data'; +import { builtInHostsFromEcsEntityDefinition } from './hosts_from_ecs_data'; +import { builtInContainersFromEcsEntityDefinition } from './containers_from_ecs_data'; +import { BuiltInDefinition } from '../../types'; + +import * as kubernetes from './kubernetes'; + +export const builtInDefinitions: BuiltInDefinition[] = [ + builtInServicesFromEcsEntityDefinition, + builtInHostsFromEcsEntityDefinition, + builtInContainersFromEcsEntityDefinition, + ...Object.values(kubernetes), +]; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cluster.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cluster.ts new file mode 100644 index 000000000000..11d9059aeb02 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cluster.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesClusterEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_ecs`, + display_name: 'Kubernetes Clusters (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['orchestrator.cluster.name'], + display_name: 'orchestrator.cluster.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['orchestrator.cluster.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cron_job.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cron_job.ts new file mode 100644 index 000000000000..597ee54cd7b9 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/cron_job.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesCronJobEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_ecs`, + display_name: 'Kubernetes CronJobs (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.cronjob.name'], + display_name: 'kubernetes.cronjob.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.cronjob.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/daemon_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/daemon_set.ts new file mode 100644 index 000000000000..efe49291c7a8 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/daemon_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesDaemonSetEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_ecs`, + display_name: 'Kubernetes DaemonSets (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.daemonset.name'], + display_name: 'kubernetes.daemonset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.daemonset.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/deployment.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/deployment.ts new file mode 100644 index 000000000000..e68ff1e0b047 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/deployment.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesDeploymentEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_ecs`, + display_name: 'Kubernetes Deployments (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.deployment.name'], + display_name: 'kubernetes.deployment.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.deployment.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/ecs_index_patterns.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/ecs_index_patterns.ts new file mode 100644 index 000000000000..14e2766cac2b --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/ecs_index_patterns.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 commonEcsIndexPatterns = ['metrics-kubernetes*', 'logs-*']; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/index.ts new file mode 100644 index 000000000000..ecfa67ff893b --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { builtInKubernetesClusterEcsEntityDefinition } from './cluster'; +export { builtInKubernetesNodeEcsEntityDefinition } from './node'; +export { builtInKubernetesPodEcsEntityDefinition } from './pod'; +export { builtInKubernetesReplicaSetEcsEntityDefinition } from './replica_set'; +export { builtInKubernetesDeploymentEcsEntityDefinition } from './deployment'; +export { builtInKubernetesStatefulSetEcsEntityDefinition } from './stateful_set'; +export { builtInKubernetesDaemonSetEcsEntityDefinition } from './daemon_set'; +export { builtInKubernetesJobEcsEntityDefinition } from './job'; +export { builtInKubernetesCronJobEcsEntityDefinition } from './cron_job'; +export { builtInKubernetesServiceEcsEntityDefinition } from './service'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/job.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/job.ts new file mode 100644 index 000000000000..17f7a6d6ea5f --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/job.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesJobEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_job_ecs`, + display_name: 'Kubernetes Jobs (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_job_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_job_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.job.name'], + display_name: 'kubernetes.job.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.job.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/node.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/node.ts new file mode 100644 index 000000000000..eaaf5e10d45b --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/node.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesNodeEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_node_ecs`, + display_name: 'Kubernetes Nodes (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_node_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_node_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.node.name'], + display_name: 'kubernetes.node.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.node.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/pod.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/pod.ts new file mode 100644 index 000000000000..d18c5d87fd53 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/pod.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesPodEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_ecs`, + display_name: 'Kubernetes Pods (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.pod.uid'], + display_name: 'kubernetes.pod.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.pod.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/replica_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/replica_set.ts new file mode 100644 index 000000000000..c44514440dee --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/replica_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesReplicaSetEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_ecs`, + display_name: 'Kubernetes ReplicaSets (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.replicaset.name'], + display_name: 'kubernetes.replicaset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.replicaset.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/service.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/service.ts new file mode 100644 index 000000000000..4336cad1b0ea --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/service.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesServiceEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_service_ecs`, + display_name: 'Kubernetes Services (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_service_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_service_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.service.name'], + display_name: 'kubernetes.service.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.service.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/stateful_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/stateful_set.ts new file mode 100644 index 000000000000..5c3fc0df6070 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/ecs/stateful_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonEcsIndexPatterns } from './ecs_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesStatefulSetEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_ecs`, + display_name: 'Kubernetes StatefulSets (ECS)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_ecs_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_ecs`, + index_patterns: commonEcsIndexPatterns, + identity_fields: ['kubernetes.statefulset.name'], + display_name: 'kubernetes.statefulset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['kubernetes.statefulset.name: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/index.ts new file mode 100644 index 000000000000..fa559fb86d9d --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/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 './ecs'; +export * from './semconv'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cluster.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cluster.ts new file mode 100644 index 000000000000..14371c4fe187 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cluster.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesClusterSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_semconv`, + display_name: 'Kubernetes Clusters (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_cluster_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.cluster.uid'], + display_name: 'k8s.cluster.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.cluster.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cron_job.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cron_job.ts new file mode 100644 index 000000000000..35db4649b24d --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/cron_job.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesCronJobSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_semconv`, + display_name: 'Kubernetes CronJobs (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_cron_job_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.cronjob.uid'], + display_name: 'k8s.cronjob.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.cronjob.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/daemon_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/daemon_set.ts new file mode 100644 index 000000000000..fa233fbeec4f --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/daemon_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesDaemonSetSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_semconv`, + display_name: 'Kubernetes DaemonSets (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_daemon_set_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.daemonset.uid'], + display_name: 'k8s.daemonset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.daemonset.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/deployment.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/deployment.ts new file mode 100644 index 000000000000..13e29cf8b4e5 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/deployment.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesDeploymentSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_semconv`, + display_name: 'Kubernetes Deployments (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_deployment_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.deployment.uid'], + display_name: 'k8s.deployment.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.deployment.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/index.ts new file mode 100644 index 000000000000..fbfcd9c5f902 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/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 { builtInKubernetesClusterSemConvEntityDefinition } from './cluster'; +export { builtInKubernetesNodeSemConvEntityDefinition } from './node'; +export { builtInKubernetesPodSemConvEntityDefinition } from './pod'; +export { builtInKubernetesReplicaSetSemConvEntityDefinition } from './replica_set'; +export { builtInKubernetesDeploymentSemConvEntityDefinition } from './deployment'; +export { builtInKubernetesStatefulSetSemConvEntityDefinition } from './stateful_set'; +export { builtInKubernetesDaemonSetSemConvEntityDefinition } from './daemon_set'; +export { builtInKubernetesJobSemConvEntityDefinition } from './job'; +export { builtInKubernetesCronJobSemConvEntityDefinition } from './cron_job'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/job.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/job.ts new file mode 100644 index 000000000000..d830b33fae0e --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/job.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesJobSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_job_semconv`, + display_name: 'Kubernetes Jobs (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_job_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_job_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.job.uid'], + display_name: 'k8s.job.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.job.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/node.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/node.ts new file mode 100644 index 000000000000..a99e2fa88d8f --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/node.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesNodeSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_node_semconv`, + display_name: 'Kubernetes Nodes (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_node_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_node_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.node.uid'], + display_name: 'k8s.node.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.node.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/otel_index_patterns.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/otel_index_patterns.ts new file mode 100644 index 000000000000..9978f61efafa --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/otel_index_patterns.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 commonOtelIndexPatterns = ['metrics-*otel*', 'logs-*']; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/pod.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/pod.ts new file mode 100644 index 000000000000..cb983201beed --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/pod.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesPodSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_semconv`, + display_name: 'Kubernetes Pods (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_pod_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.pod.uid'], + display_name: 'k8s.pod.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.pod.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/replica_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/replica_set.ts new file mode 100644 index 000000000000..feba9f02383b --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/replica_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesReplicaSetSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_semconv`, + display_name: 'Kubernetes ReplicaSets (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_replica_set_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.replicaset.uid'], + display_name: 'k8s.replicaset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.replicaset.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/stateful_set.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/stateful_set.ts new file mode 100644 index 000000000000..0776be72c4d1 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/kubernetes/semconv/stateful_set.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 { BUILT_IN_ID_PREFIX } from '../../constants'; +import { commonOtelIndexPatterns } from './otel_index_patterns'; +import { BuiltInDefinition } from '../../../../types'; + +export const builtInKubernetesStatefulSetSemConvEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_semconv`, + display_name: 'Kubernetes StatefulSets (OTEL)', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_semconv_semconv`, + type_id: `${BUILT_IN_ID_PREFIX}kubernetes_stateful_set_semconv`, + index_patterns: commonOtelIndexPatterns, + identity_fields: ['k8s.statefulset.uid'], + display_name: 'k8s.statefulset.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: ['k8s.statefulset.uid: *'], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/services_from_ecs_data.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/services_from_ecs_data.ts new file mode 100644 index 000000000000..cc4b665666bb --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/built_in/services_from_ecs_data.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 { BuiltInDefinition } from '../../types'; +import { BUILT_IN_ID_PREFIX } from './constants'; + +export const builtInServicesFromEcsEntityDefinition: BuiltInDefinition = { + type: { + id: `${BUILT_IN_ID_PREFIX}services_from_ecs_data`, + display_name: 'Services', + }, + sources: [ + { + id: `${BUILT_IN_ID_PREFIX}services_from_ecs_data_ecs`, + type_id: `${BUILT_IN_ID_PREFIX}services_from_ecs_data`, + index_patterns: ['logs-*', 'filebeat*', 'traces-*'], + identity_fields: ['service.name'], + display_name: 'service.name', + timestamp_field: '@timestamp', + metadata_fields: [], + filters: [], + }, + ], +}; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/install_built_in_definitions.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/install_built_in_definitions.ts new file mode 100644 index 000000000000..e5535d6e35f1 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/install_built_in_definitions.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 { IClusterClient, Logger } from '@kbn/core/server'; +import { storeTypeDefinition } from './type_definition'; +import { storeSourceDefinition } from './source_definition'; +import { builtInDefinitions } from './built_in'; +import { EntitySourceDefinition, EntityTypeDefinition } from '../types'; + +export async function installBuiltInDefinitions(clusterClient: IClusterClient, logger: Logger) { + logger.info('Installing built in entity definitions'); + + const types: EntityTypeDefinition[] = []; + const sources: EntitySourceDefinition[] = []; + for (const definition of builtInDefinitions) { + types.push(definition.type); + sources.push(...definition.sources); + } + + const typeInstallations = await Promise.allSettled( + types.map((type) => storeTypeDefinition({ type, clusterClient, logger, replace: true })) + ); + + typeInstallations.forEach((installation) => { + if (installation.status === 'rejected') { + logger.error(installation.reason); + } + }); + + const sourceInstallations = await Promise.allSettled( + sources.map((source) => + storeSourceDefinition({ + source, + clusterClient, + logger, + replace: true, + }) + ) + ); + + // This may fail because the type installation failed and storeSourceDefinition verifies that the type exists first + // It may also fail for other reasons but we continue in case there are more sources for the same type that might succeed + sourceInstallations.forEach((installation) => { + if (installation.status === 'rejected') { + logger.error(installation.reason); + } + }); +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/setup_entity_definitions_index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/setup_entity_definitions_index.ts index b9e3f39a3dd6..05d7b2de7cb9 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/setup_entity_definitions_index.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/setup_entity_definitions_index.ts @@ -6,8 +6,9 @@ */ import { errors } from '@elastic/elasticsearch'; -import { IClusterClient, Logger } from '@kbn/core/server'; +import { Logger } from '@kbn/core/server'; import { DEFINITIONS_ALIAS, TEMPLATE_VERSION } from '../constants'; +import { InternalClusterClient } from '../types'; const definitionsIndexTemplate = { name: `${DEFINITIONS_ALIAS}-template`, @@ -21,6 +22,8 @@ const definitionsIndexTemplate = { template: { settings: { hidden: true, + number_of_shards: 1, + auto_expand_replicas: '0-1', }, aliases: { [DEFINITIONS_ALIAS]: { @@ -51,7 +54,10 @@ const definitionsIndexTemplate = { const CURRENT_INDEX = `${DEFINITIONS_ALIAS}-${TEMPLATE_VERSION}` as const; -export async function setupEntityDefinitionsIndex(clusterClient: IClusterClient, logger: Logger) { +export async function setupEntityDefinitionsIndex( + clusterClient: InternalClusterClient, + logger: Logger +) { const esClient = clusterClient.asInternalUser; try { logger.debug(`Installing entity definitions index template for version ${TEMPLATE_VERSION}`); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/source_definition.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/source_definition.ts index 7ed1779708e5..eab219792295 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/source_definition.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/source_definition.ts @@ -5,26 +5,53 @@ * 2.0. */ -import { IScopedClusterClient, Logger } from '@kbn/core/server'; +import { Logger } from '@kbn/core/server'; import { DEFINITIONS_ALIAS, TEMPLATE_VERSION } from '../constants'; -import { EntitySourceDefinition, StoredEntitySourceDefinition } from '../types'; +import { + EntitySourceDefinition, + InternalClusterClient, + StoredEntitySourceDefinition, +} from '../types'; import { SourceAs, runESQLQuery } from '../run_esql_query'; import { EntityDefinitionConflict } from '../errors/entity_definition_conflict'; +import { readTypeDefinitionById } from './type_definition'; +import { UnknownEntityType } from '../errors/unknown_entity_type'; -export async function storeSourceDefinition( - source: EntitySourceDefinition, - clusterClient: IScopedClusterClient, - logger: Logger -): Promise<EntitySourceDefinition> { +interface StoreSourceDefinitionOptions { + source: EntitySourceDefinition; + clusterClient: InternalClusterClient; + logger: Logger; + replace?: boolean; +} + +export async function storeSourceDefinition({ + source, + clusterClient, + logger, + replace = false, +}: StoreSourceDefinitionOptions): Promise<EntitySourceDefinition> { const esClient = clusterClient.asInternalUser; + try { + await readTypeDefinitionById(source.type_id, clusterClient, logger); + } catch (error) { + if (error instanceof UnknownEntityType) { + throw new UnknownEntityType( + `Type with ID ${source.type_id} not found, cannot attach source with ID ${source.id}` + ); + } + + throw error; + } + const sources = await runESQLQuery('fetch source definition for conflict check', { esClient, - query: `FROM ${DEFINITIONS_ALIAS} METADATA _id | WHERE definition_type == "source" AND _id == "source:${source.id}" | KEEP _id`, + query: `FROM ${DEFINITIONS_ALIAS} METADATA _id | WHERE definition_type == "source" AND _id == "${source.type_id}:${source.id}" | KEEP _id`, logger, }); - if (sources.length !== 0) { + if (sources.length !== 0 && replace === false) { + logger.debug(`Entity source definition with ID ${source.id} already exists`); throw new EntityDefinitionConflict('source', source.id); } @@ -34,10 +61,12 @@ export async function storeSourceDefinition( source, }; + logger.debug(`Installing entity source definition ${source.id} for type ${source.type_id}`); await esClient.index({ index: DEFINITIONS_ALIAS, - id: `source:${definition.source.id}`, + id: `${source.type_id}:${definition.source.id}`, document: definition, + refresh: 'wait_for', }); return definition.source; @@ -48,7 +77,7 @@ export interface ReadSourceDefinitionOptions { } export async function readSourceDefinitions( - clusterClient: IScopedClusterClient, + clusterClient: InternalClusterClient, logger: Logger, options?: ReadSourceDefinitionOptions ): Promise<EntitySourceDefinition[]> { diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/type_definition.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/type_definition.ts index 710e176a4a12..9b362a8df2b3 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/type_definition.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/definitions/type_definition.ts @@ -5,26 +5,36 @@ * 2.0. */ -import { IScopedClusterClient, Logger } from '@kbn/core/server'; +import { Logger } from '@kbn/core/server'; import { DEFINITIONS_ALIAS, TEMPLATE_VERSION } from '../constants'; -import { EntityTypeDefinition, StoredEntityTypeDefinition } from '../types'; +import { EntityTypeDefinition, InternalClusterClient, StoredEntityTypeDefinition } from '../types'; import { SourceAs, runESQLQuery } from '../run_esql_query'; import { EntityDefinitionConflict } from '../errors/entity_definition_conflict'; +import { UnknownEntityType } from '../errors/unknown_entity_type'; -export async function storeTypeDefinition( - type: EntityTypeDefinition, - clusterClient: IScopedClusterClient, - logger: Logger -): Promise<EntityTypeDefinition> { +interface StoreTypeDefinitionOptions { + type: EntityTypeDefinition; + clusterClient: InternalClusterClient; + logger: Logger; + replace?: boolean; +} + +export async function storeTypeDefinition({ + type, + clusterClient, + logger, + replace = false, +}: StoreTypeDefinitionOptions): Promise<EntityTypeDefinition> { const esClient = clusterClient.asInternalUser; const types = await runESQLQuery('fetch type definition for conflict check', { esClient, - query: `FROM ${DEFINITIONS_ALIAS} METADATA _id | WHERE definition_type == "type" AND _id == "type:${type.id}" | KEEP _id`, + query: `FROM ${DEFINITIONS_ALIAS} METADATA _id | WHERE definition_type == "type" AND _id == "${type.id}" | KEEP _id`, logger, }); - if (types.length !== 0) { + if (types.length !== 0 && replace === false) { + logger.debug(`Entity type definition with ID ${type.id} already exists`); throw new EntityDefinitionConflict('type', type.id); } @@ -34,17 +44,19 @@ export async function storeTypeDefinition( type, }; + logger.debug(`Installing entity type definition ${type.id}`); await esClient.index({ index: DEFINITIONS_ALIAS, - id: `type:${definition.type.id}`, + id: `${definition.type.id}`, document: definition, + refresh: 'wait_for', }); return definition.type; } export async function readTypeDefinitions( - clusterClient: IScopedClusterClient, + clusterClient: InternalClusterClient, logger: Logger ): Promise<EntityTypeDefinition[]> { const esClient = clusterClient.asInternalUser; @@ -60,3 +72,26 @@ export async function readTypeDefinitions( return types.map((storedTypeDefinition) => storedTypeDefinition._source.type); } + +export async function readTypeDefinitionById( + id: string, + clusterClient: InternalClusterClient, + logger: Logger +): Promise<EntityTypeDefinition> { + const esClient = clusterClient.asInternalUser; + + const types = await runESQLQuery<SourceAs<StoredEntityTypeDefinition>>( + 'fetch type definition by ID', + { + esClient, + query: `FROM ${DEFINITIONS_ALIAS} METADATA _id,_source | WHERE definition_type == "type" AND _id == "${id}" | KEEP _source`, + logger, + } + ); + + if (types.length === 0) { + throw new UnknownEntityType(`Type with ID ${id} not found`); + } + + return types[0]._source.type; +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/entity_client.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/entity_client.ts index bb40fc2849a4..818a9b9b02df 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/entity_client.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/entity_client.ts @@ -8,23 +8,29 @@ import { SavedObjectsClientContract } from '@kbn/core-saved-objects-api-server'; import { IScopedClusterClient, Logger } from '@kbn/core/server'; import { EntityV2 } from '@kbn/entities-schema'; -import { without } from 'lodash'; import { ReadSourceDefinitionOptions, readSourceDefinitions, storeSourceDefinition, } from './definitions/source_definition'; import { readTypeDefinitions, storeTypeDefinition } from './definitions/type_definition'; -import { getEntityInstancesQuery } from './queries'; -import { mergeEntitiesList } from './queries/utils'; +import { getEntityInstancesQuery, getEntityCountQuery } from './queries'; +import { + isFulfilledResult, + isRejectedResult, + mergeEntitiesList, + sortEntitiesList, +} from './queries/utils'; import { EntitySourceDefinition, EntityTypeDefinition, SearchByType, SearchBySources, + CountByTypes, } from './types'; import { UnknownEntityType } from './errors/unknown_entity_type'; import { runESQLQuery } from './run_esql_query'; +import { validateFields } from './validate_fields'; export class EntityClient { constructor( @@ -59,76 +65,123 @@ export class EntityClient { sort, limit, }: SearchBySources) { - const entities = await Promise.all( - sources.map(async (source) => { - const mandatoryFields = [ - ...source.identity_fields, - ...(source.timestamp_field ? [source.timestamp_field] : []), - ...(source.display_name ? [source.display_name] : []), - ]; - const metaFields = [...metadataFields, ...source.metadata_fields]; - - // operations on an unmapped field result in a failing query so we verify - // field capabilities beforehand - const { fields } = await this.options.clusterClient.asCurrentUser.fieldCaps({ - index: source.index_patterns, - fields: [...mandatoryFields, ...metaFields], - }); + const searches = sources.map(async (source) => { + const availableMetadataFields = await validateFields({ + source, + metadataFields, + esClient: this.options.clusterClient.asCurrentUser, + logger: this.options.logger, + }); + + const { query, filter } = getEntityInstancesQuery({ + source: { + ...source, + metadata_fields: availableMetadataFields, + filters: [...source.filters, ...filters], + }, + start, + end, + sort, + limit, + }); + this.options.logger.debug( + () => `Entity instances query: ${query}\nfilter: ${JSON.stringify(filter, null, 2)}` + ); + + const rawEntities = await runESQLQuery<EntityV2>('resolve entities', { + query, + filter, + esClient: this.options.clusterClient.asCurrentUser, + logger: this.options.logger, + }); + + return rawEntities; + }); - const sourceHasMandatoryFields = mandatoryFields.every((field) => !!fields[field]); - if (!sourceHasMandatoryFields) { - // we can't build entities without id fields so we ignore the source. - // TODO filters should likely behave similarly. we should also throw - const missingFields = mandatoryFields.filter((field) => !fields[field]); - this.options.logger.info( - `Ignoring source for type [${source.type_id}] with index_patterns [${ - source.index_patterns - }] because some mandatory fields [${missingFields.join(', ')}] are not mapped` - ); - return []; - } + const { entities, errors } = await Promise.allSettled(searches).then((results) => ({ + entities: results.filter(isFulfilledResult).flatMap((result) => result.value), + errors: results.filter(isRejectedResult).map((result) => result.reason.message as string), + })); + + if (sources.length === 1) { + return { entities, errors }; + } + + // we have to manually merge, sort and limit entities since we run + // independant queries for each source + return { + errors, + entities: sortEntitiesList({ + sources, + sort, + entities: mergeEntitiesList({ entities, sources, metadataFields }), + }).slice(0, limit), + }; + } + + async countEntities({ start, end, types = [], filters = [] }: CountByTypes) { + if (types.length === 0) { + types = (await this.readTypeDefinitions()).map((definition) => definition.id); + } - // but metadata field not being available is fine - const availableMetadataFields = metaFields.filter((field) => fields[field]); - if (availableMetadataFields.length < metaFields.length) { - this.options.logger.info( - `Ignoring unmapped fields [${without(metaFields, ...availableMetadataFields).join( - ', ' - )}]` - ); + const counts = await Promise.all( + types.map(async (type) => { + const sources = await this.readSourceDefinitions({ type }); + if (sources.length === 0) { + return { type, value: 0, errors: [] }; } - const { query, filter } = getEntityInstancesQuery({ - source: { - ...source, - metadata_fields: availableMetadataFields, - filters: [...source.filters, ...filters], - }, + const { sources: validSources, errors } = await Promise.allSettled( + sources.map((source) => + validateFields({ + source, + esClient: this.options.clusterClient.asCurrentUser, + logger: this.options.logger, + }).then(() => source) + ) + ).then((results) => ({ + sources: results.filter(isFulfilledResult).flatMap((result) => result.value), + errors: results.filter(isRejectedResult).map((result) => result.reason.message as string), + })); + + const { query, filter } = getEntityCountQuery({ + sources: validSources, + filters, start, end, - sort, - limit, }); - this.options.logger.debug( - () => `Entity query: ${query}\nfilter: ${JSON.stringify(filter, null, 2)}` + this.options.logger.info( + `Entity count query: ${query}\nfilter: ${JSON.stringify(filter, null, 2)}` ); - const rawEntities = await runESQLQuery<EntityV2>('resolve entities', { + const [{ count }] = await runESQLQuery<{ count: number }>('count entities', { query, filter, esClient: this.options.clusterClient.asCurrentUser, logger: this.options.logger, }); - return rawEntities; + return { type, value: count, errors }; }) - ).then((results) => results.flat()); - - return mergeEntitiesList(sources, entities).slice(0, limit); + ); + + return counts.reduce( + (result, count) => { + result.types[count.type] = count.value; + result.total += count.value; + result.errors.push(...count.errors); + return result; + }, + { total: 0, types: {} as Record<string, number>, errors: [] as string[] } + ); } async storeTypeDefinition(type: EntityTypeDefinition) { - return storeTypeDefinition(type, this.options.clusterClient, this.options.logger); + return storeTypeDefinition({ + type, + clusterClient: this.options.clusterClient, + logger: this.options.logger, + }); } async readTypeDefinitions() { @@ -136,7 +189,11 @@ export class EntityClient { } async storeSourceDefinition(source: EntitySourceDefinition) { - return storeSourceDefinition(source, this.options.clusterClient, this.options.logger); + return storeSourceDefinition({ + source, + clusterClient: this.options.clusterClient, + logger: this.options.logger, + }); } async readSourceDefinitions(options?: ReadSourceDefinitionOptions) { diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.test.ts new file mode 100644 index 000000000000..04a391ef0026 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.test.ts @@ -0,0 +1,327 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getEntityCountQuery } from './entity_count'; + +describe('getEntityCountQuery', () => { + it('generates a valid esql query for a single source', () => { + const { query, filter } = getEntityCountQuery({ + sources: [ + { + id: 'service_source', + type_id: 'service', + index_patterns: ['logs-*'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + ], + filters: [], + start: '2024-11-20T19:00:00.000Z', + end: '2024-11-20T20:00:00.000Z', + }); + + expect(query).toEqual('FROM logs-* | STATS BY service.name::keyword | STATS count = COUNT()'); + + expect(filter).toEqual({ + bool: { + filter: [ + { + bool: { + should: [ + { + exists: { + field: 'service.name', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + filter: [ + { + bool: { + should: [ + { + range: { + '@timestamp': { + gte: '2024-11-20T19:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + range: { + '@timestamp': { + lte: '2024-11-20T20:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + { + bool: { + should: [ + { + bool: { + should: [ + { + match_phrase: { + _index: 'logs-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + match_phrase: { + _index: '.ds-logs-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }); + }); + + it('generates a valid esql query for multiple sources', () => { + const { query, filter } = getEntityCountQuery({ + sources: [ + { + id: 'service_source_1', + type_id: 'service', + index_patterns: ['metrics-*'], + identity_fields: ['service_name'], + metadata_fields: [], + filters: [], + timestamp_field: 'timestamp_field', + }, + { + id: 'service_source_2', + type_id: 'service', + index_patterns: ['logs-*'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + ], + filters: [], + start: '2024-11-20T19:00:00.000Z', + end: '2024-11-20T20:00:00.000Z', + }); + + expect(query).toEqual( + 'FROM metrics-*, logs-* METADATA _index | ' + + 'EVAL is_source_0 = _index LIKE "metrics-**" OR _index LIKE ".ds-metrics-**" | ' + + 'EVAL is_source_1 = _index LIKE "logs-**" OR _index LIKE ".ds-logs-**" | ' + + 'EVAL entity.id = CASE(is_source_0, service_name::keyword, is_source_1, service.name::keyword) | ' + + 'WHERE entity.id IS NOT NULL | ' + + 'STATS BY entity.id | ' + + 'STATS count = COUNT()' + ); + + expect(filter).toEqual({ + bool: { + should: [ + { + bool: { + filter: [ + { + bool: { + should: [ + { + exists: { + field: 'service_name', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + filter: [ + { + bool: { + should: [ + { + range: { + timestamp_field: { + gte: '2024-11-20T19:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + range: { + timestamp_field: { + lte: '2024-11-20T20:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + { + bool: { + should: [ + { + bool: { + should: [ + { + match_phrase: { + _index: 'metrics-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + match_phrase: { + _index: '.ds-metrics-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + { + bool: { + filter: [ + { + bool: { + should: [ + { + exists: { + field: 'service.name', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + filter: [ + { + bool: { + should: [ + { + range: { + '@timestamp': { + gte: '2024-11-20T19:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + range: { + '@timestamp': { + lte: '2024-11-20T20:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + { + bool: { + should: [ + { + bool: { + should: [ + { + match_phrase: { + _index: 'logs-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + match_phrase: { + _index: '.ds-logs-**', + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + ], + minimum_should_match: 1, + }, + }); + }); +}); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.ts new file mode 100644 index 000000000000..930ee15be61b --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_count.ts @@ -0,0 +1,136 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { compact, last } from 'lodash'; +import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; +import { EntitySourceDefinition } from '../types'; +import { asKeyword } from './utils'; + +const fromCommand = ({ sources }: { sources: EntitySourceDefinition[] }) => { + let command = `FROM ${sources.flatMap((source) => source.index_patterns).join(', ')}`; + if (sources.length > 1) { + command += ' METADATA _index'; + } + + return command; +}; + +const dslFilter = ({ + sources, + filters, + start, + end, +}: { + sources: EntitySourceDefinition[]; + filters: string[]; + start: string; + end: string; +}) => { + const sourcesFilters = sources + .map((source) => { + const sourceFilters = [ + ...source.filters, + ...source.identity_fields.map((field) => `${field}: *`), + ]; + + if (source.timestamp_field) { + sourceFilters.push( + `${source.timestamp_field} >= "${start}" AND ${source.timestamp_field} <= "${end}"` + ); + } + + sourceFilters.push( + source.index_patterns + .map((pattern) => `_index: "${pattern}*" OR _index: ".ds-${last(pattern.split(':'))}*"`) + .join(' OR ') + ); + + return '(' + sourceFilters.map((filter) => '(' + filter + ')').join(' AND ') + ')'; + }) + .join(' OR '); + + const additionalFilters = filters.map((filter) => '(' + filter + ')').join(' AND '); + + return toElasticsearchQuery( + fromKueryExpression(compact([`(${sourcesFilters})`, additionalFilters]).join(' AND ')) + ); +}; + +const statsCommand = ({ sources }: { sources: EntitySourceDefinition[] }) => { + const commands = [ + sources.length === 1 + ? `STATS BY ${sources[0].identity_fields.map(asKeyword).join(', ')}` + : `STATS BY entity.id`, + 'STATS count = COUNT()', + ]; + return commands.join(' | '); +}; + +const sourcesEvalCommand = ({ sources }: { sources: EntitySourceDefinition[] }) => { + if (sources.length === 1) { + return; + } + + const evals = sources.map((source, index) => { + const condition = source.index_patterns + .map( + (pattern) => `_index LIKE "${pattern}*" OR _index LIKE ".ds-${last(pattern.split(':'))}*"` + ) + .join(' OR '); + + return `EVAL is_source_${index} = ${condition}`; + }); + + return evals.join(' | '); +}; + +const idEvalCommand = ({ sources }: { sources: EntitySourceDefinition[] }) => { + if (sources.length === 1) { + return; + } + + const conditions = sources.flatMap((source, index) => { + return [ + `is_source_${index}`, + source.identity_fields.length === 1 + ? asKeyword(source.identity_fields[0]) + : `CONCAT(${source.identity_fields.map(asKeyword).join(', ":", ')})`, + ]; + }); + return `EVAL entity.id = CASE(${conditions.join(', ')})`; +}; + +const whereCommand = ({ sources }: { sources: EntitySourceDefinition[] }) => { + if (sources.length === 1) { + return; + } + + return 'WHERE entity.id IS NOT NULL'; +}; + +export function getEntityCountQuery({ + sources, + filters, + start, + end, +}: { + sources: EntitySourceDefinition[]; + filters: string[]; + start: string; + end: string; +}) { + const commands = compact([ + fromCommand({ sources }), + sourcesEvalCommand({ sources }), + idEvalCommand({ sources }), + whereCommand({ sources }), + statsCommand({ sources }), + ]); + + const filter = dslFilter({ sources, filters, start, end }); + return { query: commands.join(' | '), filter }; +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.ts new file mode 100644 index 000000000000..8836b7635ff3 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.test.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. + */ + +import { getEntityInstancesQuery } from './entity_instances'; + +describe('getEntityInstancesQuery', () => { + it('generates a valid esql query', () => { + const { query, filter } = getEntityInstancesQuery({ + source: { + id: 'service_source', + type_id: 'service', + index_patterns: ['logs-*', 'metrics-*'], + identity_fields: ['service.name'], + metadata_fields: ['host.name'], + filters: [], + timestamp_field: 'custom_timestamp_field', + display_name: 'service.id', + }, + limit: 5, + start: '2024-11-20T19:00:00.000Z', + end: '2024-11-20T20:00:00.000Z', + sort: { field: 'entity.id', direction: 'DESC' }, + }); + + expect(query).toEqual( + 'FROM logs-*, metrics-* | ' + + 'STATS host.name = VALUES(host.name::keyword), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id::keyword) BY service.name::keyword | ' + + 'RENAME `service.name::keyword` AS service.name | ' + + 'EVAL entity.type = "service", entity.id = service.name, entity.display_name = COALESCE(service.id, entity.id) | ' + + 'SORT entity.id DESC | ' + + 'LIMIT 5' + ); + + expect(filter).toEqual({ + bool: { + filter: [ + { + bool: { + should: [ + { + exists: { + field: 'service.name', + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + filter: [ + { + bool: { + should: [ + { + range: { + custom_timestamp_field: { + gte: '2024-11-20T19:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + { + bool: { + should: [ + { + range: { + custom_timestamp_field: { + lte: '2024-11-20T20:00:00.000Z', + }, + }, + }, + ], + minimum_should_match: 1, + }, + }, + ], + }, + }, + ], + }, + }); + }); +}); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.ts new file mode 100644 index 000000000000..c9a5948b55dc --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/entity_instances.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 { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; +import { asKeyword } from './utils'; +import { EntitySourceDefinition, SortBy } from '../types'; + +const fromCommand = ({ source }: { source: EntitySourceDefinition }) => { + let query = `FROM ${source.index_patterns.join(', ')}`; + + const esMetadataFields = source.metadata_fields.filter((field) => + ['_index', '_id'].includes(field) + ); + if (esMetadataFields.length) { + query += ` METADATA ${esMetadataFields.join(', ')}`; + } + + return query; +}; + +const dslFilter = ({ + source, + start, + end, +}: { + source: EntitySourceDefinition; + start: string; + end: string; +}) => { + const filters = [...source.filters, ...source.identity_fields.map((field) => `${field}: *`)]; + + if (source.timestamp_field) { + filters.push( + `${source.timestamp_field} >= "${start}" AND ${source.timestamp_field} <= "${end}"` + ); + } + + const kuery = filters.map((filter) => '(' + filter + ')').join(' AND '); + return toElasticsearchQuery(fromKueryExpression(kuery)); +}; + +const statsCommand = ({ source }: { source: EntitySourceDefinition }) => { + const aggs = source.metadata_fields + .filter((field) => !source.identity_fields.some((idField) => idField === field)) + .map((field) => `${field} = VALUES(${asKeyword(field)})`); + + if (source.timestamp_field) { + aggs.push(`entity.last_seen_timestamp = MAX(${source.timestamp_field})`); + } + + if (source.display_name) { + // ideally we want the latest value but there's no command yet + // so we use MAX for now + aggs.push(`${source.display_name} = MAX(${asKeyword(source.display_name)})`); + } + + return `STATS ${aggs.join(', ')} BY ${source.identity_fields.map(asKeyword).join(', ')}`; +}; + +const renameCommand = ({ source }: { source: EntitySourceDefinition }) => { + const operations = source.identity_fields.map((field) => `\`${asKeyword(field)}\` AS ${field}`); + return `RENAME ${operations.join(', ')}`; +}; + +const evalCommand = ({ source }: { source: EntitySourceDefinition }) => { + const id = + source.identity_fields.length === 1 + ? source.identity_fields[0] + : `CONCAT(${source.identity_fields.join(', ":", ')})`; + + const displayName = source.display_name + ? `COALESCE(${source.display_name}, entity.id)` + : 'entity.id'; + + return `EVAL ${[ + `entity.type = "${source.type_id}"`, + `entity.id = ${id}`, + `entity.display_name = ${displayName}`, + ].join(', ')}`; +}; + +const sortCommand = ({ source, sort }: { source: EntitySourceDefinition; sort?: SortBy }) => { + if (sort) { + return `SORT ${sort.field} ${sort.direction}`; + } + + if (source.timestamp_field) { + return `SORT entity.last_seen_timestamp DESC`; + } + + return `SORT entity.id ASC`; +}; + +export function getEntityInstancesQuery({ + source, + limit, + start, + end, + sort, +}: { + source: EntitySourceDefinition; + limit: number; + start: string; + end: string; + sort?: SortBy; +}) { + const commands = [ + fromCommand({ source }), + statsCommand({ source }), + renameCommand({ source }), + evalCommand({ source }), + sortCommand({ source, sort }), + `LIMIT ${limit}`, + ]; + const filter = dslFilter({ source, start, end }); + + return { query: commands.join(' | '), filter }; +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.test.ts deleted file mode 100644 index 9bc475d03192..000000000000 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.test.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { getEntityInstancesQuery } from '.'; - -describe('getEntityInstancesQuery', () => { - describe('getEntityInstancesQuery', () => { - it('generates a valid esql query', () => { - const { query, filter } = getEntityInstancesQuery({ - source: { - id: 'service_source', - type_id: 'service', - index_patterns: ['logs-*', 'metrics-*'], - identity_fields: ['service.name'], - metadata_fields: ['host.name'], - filters: [], - timestamp_field: 'custom_timestamp_field', - display_name: 'service.id', - }, - limit: 5, - start: '2024-11-20T19:00:00.000Z', - end: '2024-11-20T20:00:00.000Z', - sort: { field: 'entity.id', direction: 'DESC' }, - }); - - expect(query).toEqual( - 'FROM logs-*, metrics-* | ' + - 'STATS host.name = VALUES(host.name::keyword), entity.last_seen_timestamp = MAX(custom_timestamp_field), service.id = MAX(service.id::keyword) BY service.name::keyword | ' + - 'RENAME `service.name::keyword` AS service.name | ' + - 'EVAL entity.type = "service", entity.id = service.name, entity.display_name = COALESCE(service.id, entity.id) | ' + - 'SORT entity.id DESC | ' + - 'LIMIT 5' - ); - - expect(filter).toEqual({ - bool: { - filter: [ - { - bool: { - should: [ - { - exists: { - field: 'service.name', - }, - }, - ], - minimum_should_match: 1, - }, - }, - { - bool: { - filter: [ - { - bool: { - should: [ - { - range: { - custom_timestamp_field: { - gte: '2024-11-20T19:00:00.000Z', - }, - }, - }, - ], - minimum_should_match: 1, - }, - }, - { - bool: { - should: [ - { - range: { - custom_timestamp_field: { - lte: '2024-11-20T20:00:00.000Z', - }, - }, - }, - ], - minimum_should_match: 1, - }, - }, - ], - }, - }, - ], - }, - }); - }); - }); -}); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.ts index 5ce7a54eb1d1..21e7d16be344 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/index.ts @@ -5,118 +5,5 @@ * 2.0. */ -import { fromKueryExpression, toElasticsearchQuery } from '@kbn/es-query'; -import { asKeyword } from './utils'; -import { EntitySourceDefinition, SortBy } from '../types'; - -const sourceCommand = ({ source }: { source: EntitySourceDefinition }) => { - let query = `FROM ${source.index_patterns.join(', ')}`; - - const esMetadataFields = source.metadata_fields.filter((field) => - ['_index', '_id'].includes(field) - ); - if (esMetadataFields.length) { - query += ` METADATA ${esMetadataFields.join(', ')}`; - } - - return query; -}; - -const dslFilter = ({ - source, - start, - end, -}: { - source: EntitySourceDefinition; - start: string; - end: string; -}) => { - const filters = [...source.filters, ...source.identity_fields.map((field) => `${field}: *`)]; - - if (source.timestamp_field) { - filters.push( - `${source.timestamp_field} >= "${start}" AND ${source.timestamp_field} <= "${end}"` - ); - } - - const kuery = filters.map((filter) => '(' + filter + ')').join(' AND '); - return toElasticsearchQuery(fromKueryExpression(kuery)); -}; - -const statsCommand = ({ source }: { source: EntitySourceDefinition }) => { - const aggs = source.metadata_fields - .filter((field) => !source.identity_fields.some((idField) => idField === field)) - .map((field) => `${field} = VALUES(${asKeyword(field)})`); - - if (source.timestamp_field) { - aggs.push(`entity.last_seen_timestamp = MAX(${source.timestamp_field})`); - } - - if (source.display_name) { - // ideally we want the latest value but there's no command yet - // so we use MAX for now - aggs.push(`${source.display_name} = MAX(${asKeyword(source.display_name)})`); - } - - return `STATS ${aggs.join(', ')} BY ${source.identity_fields.map(asKeyword).join(', ')}`; -}; - -const renameCommand = ({ source }: { source: EntitySourceDefinition }) => { - const operations = source.identity_fields.map((field) => `\`${asKeyword(field)}\` AS ${field}`); - return `RENAME ${operations.join(', ')}`; -}; - -const evalCommand = ({ source }: { source: EntitySourceDefinition }) => { - const id = - source.identity_fields.length === 1 - ? source.identity_fields[0] - : `CONCAT(${source.identity_fields.join(', ":", ')})`; - - const displayName = source.display_name - ? `COALESCE(${source.display_name}, entity.id)` - : 'entity.id'; - - return `EVAL ${[ - `entity.type = "${source.type_id}"`, - `entity.id = ${id}`, - `entity.display_name = ${displayName}`, - ].join(', ')}`; -}; - -const sortCommand = ({ source, sort }: { source: EntitySourceDefinition; sort?: SortBy }) => { - if (sort) { - return `SORT ${sort.field} ${sort.direction}`; - } - - if (source.timestamp_field) { - return `SORT entity.last_seen_timestamp DESC`; - } - - return `SORT entity.id ASC`; -}; - -export function getEntityInstancesQuery({ - source, - limit, - start, - end, - sort, -}: { - source: EntitySourceDefinition; - limit: number; - start: string; - end: string; - sort?: SortBy; -}) { - const commands = [ - sourceCommand({ source }), - statsCommand({ source }), - renameCommand({ source }), - evalCommand({ source }), - sortCommand({ source, sort }), - `LIMIT ${limit}`, - ]; - const filter = dslFilter({ source, start, end }); - - return { query: commands.join(' | '), filter }; -} +export { getEntityInstancesQuery } from './entity_instances'; +export { getEntityCountQuery } from './entity_count'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.test.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.test.ts index 295ab7796585..2aee58828def 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.test.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.test.ts @@ -17,22 +17,32 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', }, { 'entity.id': 'foo', 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', }, ]; - const mergedEntities = mergeEntitiesList([], entities); + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: [], + sources: [ + { identity_fields: ['service.name'], metadata_fields: ['only_in_record_1'] }, + { identity_fields: ['service.name'], metadata_fields: ['only_in_record_2'] }, + ] as EntitySourceDefinition[], + }); expect(mergedEntities.length).toEqual(1); expect(mergedEntities[0]).toEqual({ 'entity.id': 'foo', 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', }); }); @@ -43,6 +53,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-1', 'agent.name': 'agent-1', 'service.environment': ['dev', 'staging'], @@ -53,6 +64,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-2', 'host-3'], 'agent.name': 'agent-2', 'service.environment': 'prod', @@ -60,23 +72,21 @@ describe('mergeEntitiesList', () => { }, ]; - const mergedEntities = mergeEntitiesList( - [ - { - metadata_fields: ['host.name', 'agent.name', 'service.environment', 'only_in_record_1'], - }, - { - metadata_fields: ['host.name', 'agent.name', 'service.environment', 'only_in_record_2'], - }, + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: ['host.name', 'agent.name', 'service.environment'], + sources: [ + { identity_fields: ['service.name'], metadata_fields: ['only_in_record_1'] }, + { identity_fields: ['service.name'], metadata_fields: ['only_in_record_2'] }, ] as EntitySourceDefinition[], - entities - ); + }); expect(mergedEntities.length).toEqual(1); expect(mergedEntities[0]).toEqual({ 'entity.id': 'foo', 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-1', 'host-2', 'host-3'], 'agent.name': ['agent-1', 'agent-2'], 'service.environment': ['dev', 'staging', 'prod'], @@ -92,6 +102,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-1', }, { @@ -99,6 +110,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-2', }, { @@ -106,33 +118,33 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T16:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-3', }, { 'entity.id': 'foo', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-3', }, ]; - const mergedEntities = mergeEntitiesList( - [ - { - metadata_fields: ['host.name'], - }, - { - metadata_fields: ['host.name'], - }, + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: ['host.name'], + sources: [ + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, ] as EntitySourceDefinition[], - entities - ); + }); expect(mergedEntities.length).toEqual(1); expect(mergedEntities[0]).toEqual({ 'entity.id': 'foo', 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-1', 'host-2', 'host-3'], }); }); @@ -143,28 +155,32 @@ describe('mergeEntitiesList', () => { 'entity.id': 'foo', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-1', }, { 'entity.id': 'foo', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-2', }, ]; - const mergedEntities = mergeEntitiesList( - [ - { metadata_fields: ['host.name'] }, - { metadata_fields: ['host.name'] }, + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: ['host.name'], + sources: [ + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, ] as EntitySourceDefinition[], - entities - ); + }); expect(mergedEntities.length).toEqual(1); expect(mergedEntities[0]).toEqual({ 'entity.id': 'foo', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-1', 'host-2'], }); }); @@ -176,6 +192,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-1', }, { @@ -183,6 +200,7 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': 'host-2', }, { @@ -190,29 +208,74 @@ describe('mergeEntitiesList', () => { 'entity.last_seen_timestamp': '2024-11-20T16:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-1', 'host-2'], }, ]; - const mergedEntities = mergeEntitiesList( - [ - { - metadata_fields: ['host.name'], - }, - { - metadata_fields: ['host.name'], - }, + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: ['host.name'], + sources: [ + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, ] as EntitySourceDefinition[], - entities - ); + }); expect(mergedEntities.length).toEqual(1); expect(mergedEntities[0]).toEqual({ 'entity.id': 'foo', 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', 'entity.type': 'service', 'entity.display_name': 'foo', + 'service.name': 'foo', 'host.name': ['host-1', 'host-2'], }); }); + + it('assigns all identity fields to the merged entity', () => { + const entities = [ + { + 'entity.id': 'foo', + 'entity.last_seen_timestamp': '2024-11-20T18:00:00.000Z', + 'entity.type': 'service', + 'entity.display_name': 'foo', + 'service.name': 'foo', + }, + { + 'entity.id': 'foo', + 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', + 'entity.type': 'service', + 'entity.display_name': 'foo', + servicename_field: 'foo', + }, + { + 'entity.id': 'foo', + 'entity.last_seen_timestamp': '2024-11-20T16:00:00.000Z', + 'entity.type': 'service', + 'entity.display_name': 'foo', + service_name: 'foo', + }, + ]; + + const mergedEntities = mergeEntitiesList({ + entities, + metadataFields: [], + sources: [ + { identity_fields: ['service.name'], metadata_fields: [] as string[] }, + { identity_fields: ['servicename_field'], metadata_fields: [] as string[] }, + { identity_fields: ['service_name'], metadata_fields: [] as string[] }, + ] as EntitySourceDefinition[], + }); + expect(mergedEntities.length).toEqual(1); + expect(mergedEntities[0]).toEqual({ + 'entity.id': 'foo', + 'entity.last_seen_timestamp': '2024-11-20T20:00:00.000Z', + 'entity.type': 'service', + 'entity.display_name': 'foo', + 'service.name': 'foo', + servicename_field: 'foo', + service_name: 'foo', + }); + }); }); }); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.ts index 5d1ebf300143..71bf85632a44 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/queries/utils.ts @@ -6,8 +6,8 @@ */ import { EntityV2 } from '@kbn/entities-schema'; -import { compact, uniq } from 'lodash'; -import { EntitySourceDefinition } from '../types'; +import { orderBy, uniq } from 'lodash'; +import { EntitySourceDefinition, SortBy } from '../types'; function getLatestDate(date1?: string, date2?: string) { if (!date1 && !date2) return; @@ -17,7 +17,12 @@ function getLatestDate(date1?: string, date2?: string) { ).toISOString(); } -function mergeEntities(metadataFields: string[], entity1: EntityV2, entity2: EntityV2): EntityV2 { +function mergeEntities( + identityFields: string[], + mergeableFields: string[], + entity1: EntityV2, + entity2: EntityV2 +): EntityV2 { const merged: EntityV2 = { ...entity1 }; const latestTimestamp = getLatestDate( @@ -29,13 +34,17 @@ function mergeEntities(metadataFields: string[], entity1: EntityV2, entity2: Ent } for (const [key, value] of Object.entries(entity2).filter(([_key]) => - metadataFields.includes(_key) + mergeableFields.includes(_key) )) { if (merged[key]) { - merged[key] = uniq([ - ...(Array.isArray(merged[key]) ? merged[key] : [merged[key]]), - ...(Array.isArray(value) ? value : [value]), - ]); + // we want to keep identity fields as single-value properties. + // this can happen if two sources group by the same identity + if (!identityFields.includes(key)) { + merged[key] = uniq([ + ...(Array.isArray(merged[key]) ? merged[key] : [merged[key]]), + ...(Array.isArray(value) ? value : [value]), + ]); + } } else { merged[key] = value; } @@ -43,13 +52,21 @@ function mergeEntities(metadataFields: string[], entity1: EntityV2, entity2: Ent return merged; } -export function mergeEntitiesList( - sources: EntitySourceDefinition[], - entities: EntityV2[] -): EntityV2[] { - const metadataFields = uniq( - sources.flatMap((source) => compact([source.timestamp_field, ...source.metadata_fields])) - ); +export function mergeEntitiesList({ + entities, + sources, + metadataFields, +}: { + entities: EntityV2[]; + sources: EntitySourceDefinition[]; + metadataFields: string[]; +}): EntityV2[] { + const identityFields = uniq([...sources.flatMap((source) => source.identity_fields)]); + const mergeableFields = uniq([ + ...identityFields, + ...metadataFields, + ...sources.flatMap((source) => source.metadata_fields), + ]); const instances: { [key: string]: EntityV2 } = {}; for (let i = 0; i < entities.length; i++) { @@ -57,7 +74,7 @@ export function mergeEntitiesList( const id = entity['entity.id']; if (instances[id]) { - instances[id] = mergeEntities(metadataFields, instances[id], entity); + instances[id] = mergeEntities(identityFields, mergeableFields, instances[id], entity); } else { instances[id] = entity; } @@ -66,6 +83,38 @@ export function mergeEntitiesList( return Object.values(instances); } +export function sortEntitiesList({ + entities, + sources, + sort, +}: { + entities: EntityV2[]; + sources: EntitySourceDefinition[]; + sort?: SortBy; +}) { + if (!sort) { + sort = defaultSort(sources); + } + + return orderBy(entities, sort.field, sort.direction.toLowerCase() as 'asc' | 'desc'); +} + export function asKeyword(field: string) { return `${field}::keyword`; } + +export function defaultSort(sources: EntitySourceDefinition[]): SortBy { + if (sources.some((source) => source.timestamp_field)) { + return { field: 'entity.last_seen_timestamp', direction: 'DESC' }; + } + + return { field: 'entity.id', direction: 'ASC' }; +} + +export const isRejectedResult = ( + input: PromiseSettledResult<unknown> +): input is PromiseRejectedResult => input.status === 'rejected'; + +export const isFulfilledResult = <T>( + input: PromiseSettledResult<T> +): input is PromiseFulfilledResult<T> => input.status === 'fulfilled'; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/types.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/types.ts index e9815942592d..9515a60d7eec 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/types.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/types.ts @@ -5,13 +5,17 @@ * 2.0. */ +import { IClusterClient } from '@kbn/core/server'; import { z } from '@kbn/zod'; import moment from 'moment'; +export type InternalClusterClient = Pick<IClusterClient, 'asInternalUser'>; + // Definitions export const entityTypeDefinitionRt = z.object({ id: z.string(), + display_name: z.string(), }); export type EntityTypeDefinition = z.TypeOf<typeof entityTypeDefinitionRt>; @@ -29,6 +33,11 @@ export const entitySourceDefinitionRt = z.object({ export type EntitySourceDefinition = z.TypeOf<typeof entitySourceDefinitionRt>; +export interface BuiltInDefinition { + type: EntityTypeDefinition; + sources: EntitySourceDefinition[]; +} + // Stored definitions export type DefinitionType = 'type' | 'source'; @@ -74,6 +83,8 @@ const searchCommonRt = z.object({ filters: z.optional(z.array(z.string())).default([]), }); +export type SearchCommon = z.output<typeof searchCommonRt>; + export const searchByTypeRt = z.intersection( searchCommonRt, z.object({ @@ -91,3 +102,22 @@ export const searchBySourcesRt = z.intersection( ); export type SearchBySources = z.output<typeof searchBySourcesRt>; + +export const countByTypesRt = z.object({ + types: z.optional(z.array(z.string())), + filters: z.optional(z.array(z.string())), + start: z + .optional(z.string()) + .default(() => moment().subtract(5, 'minutes').toISOString()) + .refine((val) => moment(val).isValid(), { + message: '[start] should be a date in ISO format', + }), + end: z + .optional(z.string()) + .default(() => moment().toISOString()) + .refine((val) => moment(val).isValid(), { + message: '[end] should be a date in ISO format', + }), +}); + +export type CountByTypes = z.output<typeof countByTypesRt>; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/validate_fields.ts b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/validate_fields.ts new file mode 100644 index 000000000000..ef5ae1bf783a --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/lib/v2/validate_fields.ts @@ -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 { without } from 'lodash'; +import { Logger } from '@kbn/logging'; +import { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { EntitySourceDefinition } from './types'; + +// verifies field capabilities of the provided source. +// we map source fields in two categories: +// - mandatory: those are necessary for building entities according to the +// source definition (identity_fields, timestamp_field and display_name). +// unmapped mandatory field throws an error +// - optional: the requested metadata fields. unmapped metadata field is not +// fatal, we simply ignore it +// returns the available metadata fields. +export async function validateFields({ + esClient, + source, + logger, + metadataFields = [], +}: { + esClient: ElasticsearchClient; + source: EntitySourceDefinition; + logger: Logger; + metadataFields?: string[]; +}) { + const mandatoryFields = [ + ...source.identity_fields, + ...(source.timestamp_field ? [source.timestamp_field] : []), + ...(source.display_name ? [source.display_name] : []), + ]; + const metaFields = [...metadataFields, ...source.metadata_fields]; + + const { fields } = await esClient + .fieldCaps({ + index: source.index_patterns, + fields: [...mandatoryFields, ...metaFields], + }) + .catch((err) => { + if (err.meta?.statusCode === 404) { + throw new Error( + `No index found for source [source: ${source.id}, type: ${ + source.type_id + }] with index patterns [${source.index_patterns.join(', ')}]` + ); + } + throw err; + }); + + const sourceHasMandatoryFields = mandatoryFields.every((field) => !!fields[field]); + if (!sourceHasMandatoryFields) { + const missingFields = mandatoryFields.filter((field) => !fields[field]); + throw new Error( + `Mandatory fields [${missingFields.join(', ')}] are not mapped for source [source: ${ + source.id + }, type: ${source.type_id}] with index patterns [${source.index_patterns.join(', ')}]` + ); + } + + // operations on an unmapped field result in a failing query + const availableMetadataFields = metaFields.filter((field) => fields[field]); + if (availableMetadataFields.length < metaFields.length) { + logger.info( + `Ignoring unmapped metadata fields [${without(metaFields, ...availableMetadataFields).join( + ', ' + )}] for source [source: ${source.id}, type: ${source.type_id}]` + ); + } + return availableMetadataFields; +} diff --git a/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts b/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts index d2e9d12a3379..fed5b1c4df45 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/plugin.ts @@ -39,6 +39,7 @@ import { READ_ENTITY_SOURCE_DEFINITION_PRIVILEGE, READ_ENTITIES_PRIVILEGE, } from './lib/v2/constants'; +import { installBuiltInDefinitions } from './lib/v2/definitions/install_built_in_definitions'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface EntityManagerServerPluginSetup {} @@ -165,10 +166,11 @@ export class EntityManagerServerPlugin this.server.encryptedSavedObjects = plugins.encryptedSavedObjects; } - const esClient = core.elasticsearch.client.asInternalUser; - // Setup v1 definitions index - installEntityManagerTemplates({ esClient, logger: this.logger }) + installEntityManagerTemplates({ + esClient: core.elasticsearch.client.asInternalUser, + logger: this.logger, + }) .then(async () => { // the api key validation requires a check against the cluster license // which is lazily loaded. we ensure it gets loaded before the update @@ -185,9 +187,11 @@ export class EntityManagerServerPlugin .catch((err) => this.logger.error(err)); // Setup v2 definitions index - setupEntityDefinitionsIndex(core.elasticsearch.client, this.logger).catch((error) => { - this.logger.error(error); - }); + setupEntityDefinitionsIndex(core.elasticsearch.client, this.logger) + .then(() => installBuiltInDefinitions(core.elasticsearch.client, this.logger)) + .catch((error) => { + this.logger.error(error); + }); return { getScopedClient: async ({ request }: { request: KibanaRequest }) => { diff --git a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/count.ts b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/count.ts new file mode 100644 index 000000000000..46ae3da330f2 --- /dev/null +++ b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/count.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 { z } from '@kbn/zod'; +import { createEntityManagerServerRoute } from '../create_entity_manager_server_route'; +import { READ_ENTITIES_PRIVILEGE } from '../../lib/v2/constants'; +import { countByTypesRt } from '../../lib/v2/types'; + +export const countEntitiesRoute = createEntityManagerServerRoute({ + endpoint: 'POST /internal/entities/v2/_count', + security: { + authz: { + requiredPrivileges: [READ_ENTITIES_PRIVILEGE], + }, + }, + params: z.object({ + body: countByTypesRt, + }), + handler: async ({ request, response, params, getScopedClient }) => { + const client = await getScopedClient({ request }); + const result = await client.v2.countEntities(params.body); + + return response.ok({ body: result }); + }, +}); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/index.ts b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/index.ts index c601ebe988a2..009393d44b63 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/index.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/index.ts @@ -8,9 +8,11 @@ import { searchRoutes } from './search'; import { typeDefinitionRoutes } from './type_definition_routes'; import { sourceDefinitionRoutes } from './source_definition_routes'; +import { countEntitiesRoute } from './count'; export const v2Routes = { ...searchRoutes, ...typeDefinitionRoutes, ...sourceDefinitionRoutes, + ...countEntitiesRoute, }; diff --git a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/search.ts b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/search.ts index 82d0e5e84f2d..a2ebb26da715 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/search.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/search.ts @@ -24,9 +24,9 @@ export const searchEntitiesRoute = createEntityManagerServerRoute({ handler: async ({ request, response, params, logger, getScopedClient }) => { try { const client = await getScopedClient({ request }); - const entities = await client.v2.searchEntities(params.body); + const result = await client.v2.searchEntities(params.body); - return response.ok({ body: { entities } }); + return response.ok({ body: result }); } catch (e) { logger.error(e); @@ -51,9 +51,9 @@ export const searchEntitiesPreviewRoute = createEntityManagerServerRoute({ }), handler: async ({ request, response, params, getScopedClient }) => { const client = await getScopedClient({ request }); - const entities = await client.v2.searchEntitiesBySources(params.body); + const result = await client.v2.searchEntitiesBySources(params.body); - return response.ok({ body: { entities } }); + return response.ok({ body: result }); }, }); diff --git a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/source_definition_routes.ts b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/source_definition_routes.ts index 4fdfa281cfd7..c02627f88993 100644 --- a/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/source_definition_routes.ts +++ b/x-pack/platform/plugins/shared/entity_manager/server/routes/v2/source_definition_routes.ts @@ -13,6 +13,7 @@ import { import { entitySourceDefinitionRt } from '../../lib/v2/types'; import { createEntityManagerServerRoute } from '../create_entity_manager_server_route'; import { EntityDefinitionConflict } from '../../lib/v2/errors/entity_definition_conflict'; +import { UnknownEntityType } from '../../lib/v2/errors/unknown_entity_type'; const createSourceDefinitionRoute = createEntityManagerServerRoute({ endpoint: 'POST /internal/entities/v2/definitions/sources', @@ -40,8 +41,16 @@ const createSourceDefinitionRoute = createEntityManagerServerRoute({ }, }); } catch (error) { + if (error instanceof UnknownEntityType) { + return response.notFound({ + body: { + message: error.message, + }, + }); + } + if (error instanceof EntityDefinitionConflict) { - response.conflict({ + return response.conflict({ body: { message: error.message, }, diff --git a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts index b5d380fa9aac..c65720aae2e4 100644 --- a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts +++ b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.test.ts @@ -12,6 +12,7 @@ import { ChatCompletionEventType, } from '@kbn/inference-common'; import { createOutputApi } from './create_output_api'; +import { createToolValidationError } from '../../server/chat_complete/errors'; describe('createOutputApi', () => { let chatComplete: jest.Mock; @@ -119,4 +120,80 @@ describe('createOutputApi', () => { }, ]); }); + + describe('when using retry', () => { + const unvalidatedFailedToolCall = { + function: { + name: 'myFunction', + arguments: JSON.stringify({ foo: 'bar' }), + }, + toolCallId: 'foo', + }; + + const validationError = createToolValidationError('Validation failed', { + toolCalls: [unvalidatedFailedToolCall], + }); + + it('retries once when onValidationError is a boolean', async () => { + chatComplete.mockRejectedValueOnce(validationError); + chatComplete.mockResolvedValueOnce( + Promise.resolve({ content: 'retried content', toolCalls: [unvalidatedFailedToolCall] }) + ); + + const output = createOutputApi(chatComplete); + + const response = await output({ + id: 'retry-id', + stream: false, + connectorId: '.retry-connector', + input: 'input message', + retry: { + onValidationError: true, + }, + }); + + expect(chatComplete).toHaveBeenCalledTimes(2); + expect(response).toEqual({ + id: 'retry-id', + content: 'retried content', + output: unvalidatedFailedToolCall.function.arguments, + }); + }); + + it('retries the number of specified attempts', async () => { + chatComplete.mockRejectedValue(validationError); + + const output = createOutputApi(chatComplete); + + await expect( + output({ + id: 'retry-id', + stream: false, + connectorId: '.retry-connector', + input: 'input message', + retry: { + onValidationError: 2, + }, + }) + ).rejects.toThrow('Validation failed'); + + expect(chatComplete).toHaveBeenCalledTimes(3); + }); + + it('throws an error if retry is provided in streaming mode', () => { + const output = createOutputApi(chatComplete); + + expect(() => + output({ + id: 'stream-retry-id', + stream: true, + connectorId: '.stream-retry-connector', + input: 'input message', + retry: { + onValidationError: 1, + }, + }) + ).toThrowError('Retry options are not supported in streaming mode'); + }); + }); }); diff --git a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts index d263f733bf4e..3e65cb283dd4 100644 --- a/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts +++ b/x-pack/platform/plugins/shared/inference/common/output/create_output_api.ts @@ -10,17 +10,22 @@ import { ChatCompletionEventType, MessageRole, OutputAPI, + OutputCompositeResponse, OutputEventType, OutputOptions, ToolSchema, + isToolValidationError, withoutTokenCountEvents, } from '@kbn/inference-common'; import { isObservable, map } from 'rxjs'; import { ensureMultiTurn } from '../utils/ensure_multi_turn'; +type DefaultOutputOptions = OutputOptions<string, ToolSchema | undefined, boolean>; + export function createOutputApi(chatCompleteApi: ChatCompleteAPI): OutputAPI; + export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { - return ({ + return function callOutputApi({ id, connectorId, input, @@ -29,19 +34,26 @@ export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { previousMessages, functionCalling, stream, - }: OutputOptions<string, ToolSchema | undefined, boolean>) => { + retry, + }: DefaultOutputOptions): OutputCompositeResponse<string, ToolSchema | undefined, boolean> { + if (stream && retry !== undefined) { + throw new Error(`Retry options are not supported in streaming mode`); + } + + const messages = ensureMultiTurn([ + ...(previousMessages || []), + { + role: MessageRole.User, + content: input, + }, + ]); + const response = chatCompleteApi({ connectorId, stream, functionCalling, system, - messages: ensureMultiTurn([ - ...(previousMessages || []), - { - role: MessageRole.User, - content: input, - }, - ]), + messages, ...(schema ? { tools: { @@ -79,16 +91,55 @@ export function createOutputApi(chatCompleteApi: ChatCompleteAPI) { }) ); } else { - return response.then((chatResponse) => { - return { - id, - content: chatResponse.content, - output: - chatResponse.toolCalls.length && 'arguments' in chatResponse.toolCalls[0].function - ? chatResponse.toolCalls[0].function.arguments - : undefined, - }; - }); + return response.then( + (chatResponse) => { + return { + id, + content: chatResponse.content, + output: + chatResponse.toolCalls.length && 'arguments' in chatResponse.toolCalls[0].function + ? chatResponse.toolCalls[0].function.arguments + : undefined, + }; + }, + (error: Error) => { + if (isToolValidationError(error) && retry?.onValidationError) { + const retriesLeft = + typeof retry.onValidationError === 'number' ? retry.onValidationError : 1; + + return callOutputApi({ + id, + connectorId, + input, + schema, + system, + previousMessages: messages.concat( + { + role: MessageRole.Assistant as const, + content: '', + toolCalls: error.meta.toolCalls!, + }, + ...(error.meta.toolCalls?.map((toolCall) => { + return { + name: toolCall.function.name, + role: MessageRole.Tool as const, + toolCallId: toolCall.toolCallId, + response: { + error: error.meta, + }, + }; + }) ?? []) + ), + functionCalling, + stream: false, + retry: { + onValidationError: retriesLeft - 1, + }, + }) as OutputCompositeResponse<string, ToolSchema | undefined, false>; + } + throw error; + } + ); } }; } diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts index ca6f60dd45a5..565727b7f57f 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/bedrock/bedrock_claude_adapter.test.ts @@ -170,6 +170,7 @@ describe('bedrockClaudeAdapter', () => { ], }, { + name: 'my_function', role: MessageRole.Tool, toolCallId: '0', response: { diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts index c3410b2af362..95a46f73d5d1 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/gemini/gemini_adapter.test.ts @@ -172,6 +172,7 @@ describe('geminiAdapter', () => { ], }, { + name: 'my_function', role: MessageRole.Tool, toolCallId: '0', response: { diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts index 2d0154313b63..48544f1bb0fb 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.test.ts @@ -142,6 +142,7 @@ describe('openAIAdapter', () => { ], }, { + name: 'my_function', role: MessageRole.Tool, toolCallId: '0', response: { diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts index fa412f335800..49b6bb514202 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/adapters/openai/openai_adapter.ts @@ -58,7 +58,6 @@ export const openAIAdapter: InferenceConnectorAdapter = { request = { stream, messages: messagesToOpenAI({ system: wrapped.system, messages: wrapped.messages }), - temperature: 0, }; } else { request = { @@ -66,7 +65,6 @@ export const openAIAdapter: InferenceConnectorAdapter = { messages: messagesToOpenAI({ system, messages }), tool_choice: toolChoiceToOpenAI(toolChoice), tools: toolsToOpenAI(tools), - temperature: 0, }; } diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts index 13b1c8d87270..e58c94759e16 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/api.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { last } from 'lodash'; +import { last, omit } from 'lodash'; import { defer, switchMap, throwError } from 'rxjs'; import type { Logger } from '@kbn/logging'; import type { KibanaRequest } from '@kbn/core-http-server'; @@ -51,14 +51,26 @@ export function createChatCompleteApi({ request, actions, logger }: CreateChatCo const connectorType = connector.type; const inferenceAdapter = getInferenceAdapter(connectorType); + const messagesWithoutData = messages.map((message) => omit(message, 'data')); + if (!inferenceAdapter) { return throwError(() => createInferenceRequestError(`Adapter for type ${connectorType} not implemented`, 400) ); } - logger.debug(() => `Sending request: ${JSON.stringify(last(messages))}`); - logger.trace(() => JSON.stringify({ messages, toolChoice, tools, system })); + logger.debug( + () => `Sending request, last message is: ${JSON.stringify(last(messagesWithoutData))}` + ); + + logger.trace(() => + JSON.stringify({ + messages: messagesWithoutData, + toolChoice, + tools, + system, + }) + ); return inferenceAdapter.chatComplete({ system, diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/errors.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/errors.ts index a830f57fec55..00ef2d90ca1f 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/errors.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/errors.ts @@ -44,7 +44,7 @@ export function createToolValidationError( name?: string; arguments?: string; errorsText?: string; - toolCalls?: UnvalidatedToolCall[]; + toolCalls: UnvalidatedToolCall[]; } ): ChatCompletionToolValidationError { return new InferenceTaskError(ChatCompletionErrorCode.ToolValidationError, message, meta); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/simulated_function_calling/wrap_with_simulated_function_calling.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/simulated_function_calling/wrap_with_simulated_function_calling.ts index 4eb6cfd8d50e..d2cb0bfae499 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/simulated_function_calling/wrap_with_simulated_function_calling.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/simulated_function_calling/wrap_with_simulated_function_calling.ts @@ -79,7 +79,7 @@ export function wrapWithSimulatedFunctionCalling({ }; } -const convertToolResponseMessage = (message: ToolMessage<unknown>): UserMessage => { +const convertToolResponseMessage = (message: ToolMessage): UserMessage => { return { role: MessageRole.User, content: JSON.stringify({ diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.test.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.test.ts index c6e5b032120a..f7c1115305f5 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.test.ts @@ -183,7 +183,7 @@ describe('chunksIntoMessage', () => { } await expect(async () => getMessage()).rejects.toThrowErrorMatchingInlineSnapshot( - `"Tool call arguments for myFunction were invalid"` + `"Tool call arguments for myFunction (001) were invalid"` ); }); diff --git a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.ts b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.ts index fe9b745f442f..77c4164348cc 100644 --- a/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.ts +++ b/x-pack/platform/plugins/shared/inference/server/chat_complete/utils/chunks_into_message.ts @@ -5,17 +5,17 @@ * 2.0. */ -import { last, map, merge, OperatorFunction, scan, share } from 'rxjs'; -import type { Logger } from '@kbn/logging'; import { - UnvalidatedToolCall, - ToolOptions, ChatCompletionChunkEvent, ChatCompletionEventType, ChatCompletionMessageEvent, ChatCompletionTokenCountEvent, + ToolOptions, + UnvalidatedToolCall, withoutTokenCountEvents, } from '@kbn/inference-common'; +import type { Logger } from '@kbn/logging'; +import { OperatorFunction, map, merge, share, toArray } from 'rxjs'; import { validateToolCalls } from '../../util/validate_tool_calls'; export function chunksIntoMessage<TToolOptions extends ToolOptions>({ @@ -37,38 +37,36 @@ export function chunksIntoMessage<TToolOptions extends ToolOptions>({ shared$, shared$.pipe( withoutTokenCountEvents(), - scan( - (prev, chunk) => { - prev.content += chunk.content ?? ''; + toArray(), + map((chunks): ChatCompletionMessageEvent<TToolOptions> => { + const concatenatedChunk = chunks.reduce( + (prev, chunk) => { + prev.content += chunk.content ?? ''; + + chunk.tool_calls?.forEach((toolCall) => { + let prevToolCall = prev.tool_calls[toolCall.index]; + if (!prevToolCall) { + prev.tool_calls[toolCall.index] = { + function: { + name: '', + arguments: '', + }, + toolCallId: '', + }; - chunk.tool_calls?.forEach((toolCall) => { - let prevToolCall = prev.tool_calls[toolCall.index]; - if (!prevToolCall) { - prev.tool_calls[toolCall.index] = { - function: { - name: '', - arguments: '', - }, - toolCallId: '', - }; + prevToolCall = prev.tool_calls[toolCall.index]; + } - prevToolCall = prev.tool_calls[toolCall.index]; - } + prevToolCall.function.name += toolCall.function.name; + prevToolCall.function.arguments += toolCall.function.arguments; + prevToolCall.toolCallId += toolCall.toolCallId; + }); - prevToolCall.function.name += toolCall.function.name; - prevToolCall.function.arguments += toolCall.function.arguments; - prevToolCall.toolCallId += toolCall.toolCallId; - }); + return prev; + }, + { content: '', tool_calls: [] as UnvalidatedToolCall[] } + ); - return prev; - }, - { - content: '', - tool_calls: [] as UnvalidatedToolCall[], - } - ), - last(), - map((concatenatedChunk): ChatCompletionMessageEvent<TToolOptions> => { logger.debug(() => `Received completed message: ${JSON.stringify(concatenatedChunk)}`); const validatedToolCalls = validateToolCalls<TToolOptions>({ diff --git a/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts b/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts index 8b4cc49dfaa4..84e3dd57cded 100644 --- a/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts +++ b/x-pack/platform/plugins/shared/inference/server/routes/chat_complete.ts @@ -76,9 +76,11 @@ const chatCompleteBodySchema: Type<ChatCompleteRequestBody> = schema.object({ name: schema.maybe(schema.string()), }), schema.object({ + name: schema.string(), role: schema.literal(MessageRole.Tool), toolCallId: schema.string(), response: schema.recordOf(schema.string(), schema.any()), + data: schema.maybe(schema.recordOf(schema.string(), schema.any())), }), ]) ), diff --git a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/actions/generate_esql.ts b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/actions/generate_esql.ts index 3d8701eba72d..5c2612aa0a4d 100644 --- a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/actions/generate_esql.ts +++ b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/actions/generate_esql.ts @@ -34,6 +34,7 @@ export const generateEsqlTask = <TToolOptions extends ToolOptions>({ docBase, functionCalling, logger, + system, }: { connectorId: string; systemMessage: string; @@ -43,6 +44,7 @@ export const generateEsqlTask = <TToolOptions extends ToolOptions>({ docBase: EsqlDocumentBase; functionCalling?: FunctionCallingMode; logger: Pick<Logger, 'debug'>; + system?: string; }) => { return function askLlmToRespond({ documentationRequest: { commands, functions }, @@ -97,7 +99,7 @@ export const generateEsqlTask = <TToolOptions extends ToolOptions>({ When converting queries from one language to ES|QL, make sure that the functions are available and documented in ES|QL. E.g., for SPL's LEN, use LENGTH. For IF, use CASE. - `, + ${system ? `## Additional instructions\n\n${system}` : ''}`, messages: [ ...messages, { @@ -106,6 +108,7 @@ export const generateEsqlTask = <TToolOptions extends ToolOptions>({ toolCalls: [fakeRequestDocsToolCall], }, { + name: fakeRequestDocsToolCall.function.name, role: MessageRole.Tool, response: { documentation: requestedDocumentation, diff --git a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts index 56c48b73f499..801d80a30174 100644 --- a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts +++ b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/task.ts @@ -21,6 +21,7 @@ export function naturalLanguageToEsql<TToolOptions extends ToolOptions>({ toolChoice, logger, functionCalling, + system, ...rest }: NlToEsqlTaskParams<TToolOptions>): Observable<NlToEsqlTaskEvent<TToolOptions>> { return from(loadDocBase()).pipe( @@ -41,6 +42,7 @@ export function naturalLanguageToEsql<TToolOptions extends ToolOptions>({ tools, toolChoice, }, + system, }); return requestDocumentation({ diff --git a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/types.ts b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/types.ts index db3ac3b49348..5a1477524dbd 100644 --- a/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/types.ts +++ b/x-pack/platform/plugins/shared/inference/server/tasks/nl_to_esql/types.ts @@ -29,5 +29,6 @@ export type NlToEsqlTaskParams<TToolOptions extends ToolOptions> = { connectorId: string; logger: Pick<Logger, 'debug'>; functionCalling?: FunctionCallingMode; + system?: string; } & TToolOptions & ({ input: string } | { messages: Message[] }); diff --git a/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.test.ts b/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.test.ts index 57b030771c6c..8691a50cda20 100644 --- a/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.test.ts +++ b/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.test.ts @@ -108,7 +108,7 @@ describe('validateToolCalls', () => { }); } expect(() => validate()).toThrowErrorMatchingInlineSnapshot( - `"Tool call arguments for my_function were invalid"` + `"Tool call arguments for my_function (1) were invalid"` ); try { @@ -119,6 +119,15 @@ describe('validateToolCalls', () => { arguments: JSON.stringify({ foo: 'bar' }), errorsText: `data must have required property 'bar'`, name: 'my_function', + toolCalls: [ + { + function: { + arguments: JSON.stringify({ foo: 'bar' }), + name: 'my_function', + }, + toolCallId: '1', + }, + ], }); } else { fail('Expected toolValidationError'); diff --git a/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.ts b/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.ts index ffc2482774b2..3698a93206c0 100644 --- a/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.ts +++ b/x-pack/platform/plugins/shared/inference/server/util/validate_tool_calls.ts @@ -54,11 +54,12 @@ export function validateToolCalls<TToolOptions extends ToolOptions>({ if (!valid) { throw createToolValidationError( - `Tool call arguments for ${toolCall.function.name} were invalid`, + `Tool call arguments for ${toolCall.function.name} (${toolCall.toolCallId}) were invalid`, { name: toolCall.function.name, errorsText: validator.errorsText(), arguments: toolCall.function.arguments, + toolCalls, } ); } diff --git a/x-pack/platform/plugins/shared/ml/common/types/management.ts b/x-pack/platform/plugins/shared/ml/common/types/management.ts index 51685435296d..98d1fe166534 100644 --- a/x-pack/platform/plugins/shared/ml/common/types/management.ts +++ b/x-pack/platform/plugins/shared/ml/common/types/management.ts @@ -29,7 +29,7 @@ export interface AnalyticsManagementItems { export interface TrainedModelsManagementItems { id: string; description: string; - state: estypes.MlDeploymentState | ''; + state: estypes.MlDeploymentAssignmentState | ''; type: Array<string | undefined>; spaces: string[]; } diff --git a/x-pack/platform/plugins/shared/ml/common/types/trained_models.ts b/x-pack/platform/plugins/shared/ml/common/types/trained_models.ts index 25d7e231bf16..00c6259cc40b 100644 --- a/x-pack/platform/plugins/shared/ml/common/types/trained_models.ts +++ b/x-pack/platform/plugins/shared/ml/common/types/trained_models.ts @@ -333,6 +333,7 @@ interface BaseNLPModelItem extends BaseModelItem { supported?: boolean; state: ModelState | undefined; downloadState?: ModelDownloadState; + techPreview?: boolean; } /** Model available for download */ diff --git a/x-pack/platform/plugins/shared/ml/public/application/components/technical_preview_badge/technical_preview_badge.tsx b/x-pack/platform/plugins/shared/ml/public/application/components/technical_preview_badge/technical_preview_badge.tsx index fd0bd16f075b..5847a15be6de 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/components/technical_preview_badge/technical_preview_badge.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/components/technical_preview_badge/technical_preview_badge.tsx @@ -25,6 +25,7 @@ export const TechnicalPreviewBadge: FC<{ compressed?: boolean }> = ({ compressed 'This functionality is in technical preview and may be changed or removed completely 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.', })} tooltipPosition={'right'} + css={{ verticalAlign: 'middle' }} /> ); }; diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx index 63503df45721..2ca4409c3a98 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/analytics_management/components/analytics_list/expanded_row.tsx @@ -140,7 +140,7 @@ export const ExpandedRow: FC<Props> = ({ item }) => { valueText={true} value={s.progress_percent} max={100} - color="success" + color="primary" size="s" /> ), diff --git a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx index 61cbf816d5a9..687776790759 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/data_frame_analytics/pages/job_map/components/cytoscape_options.tsx @@ -12,8 +12,6 @@ import classificationJobIcon from './icons/ml_classification_job.svg'; import outlierDetectionJobIcon from './icons/ml_outlier_detection_job.svg'; import regressionJobIcon from './icons/ml_regression_job.svg'; -const lineColor = '#C5CCD7'; - const MAP_SHAPES = { ELLIPSE: 'ellipse', RECTANGLE: 'rectangle', @@ -23,7 +21,7 @@ const MAP_SHAPES = { } as const; type MapShapes = (typeof MAP_SHAPES)[keyof typeof MAP_SHAPES]; -function shapeForNode(el: cytoscape.NodeSingular, theme: EuiThemeType): MapShapes { +function shapeForNode(el: cytoscape.NodeSingular): MapShapes { const type = el.data('type'); switch (type) { case JOB_MAP_NODE_TYPES.ANALYTICS: @@ -70,7 +68,7 @@ function borderColorForNode(el: cytoscape.NodeSingular, theme: EuiThemeType) { case JOB_MAP_NODE_TYPES.ANALYTICS_JOB_MISSING: return theme.euiColorFullShade; case JOB_MAP_NODE_TYPES.ANALYTICS: - return theme.euiColorSuccess; + return theme.euiColorVis0; case JOB_MAP_NODE_TYPES.TRANSFORM: return theme.euiColorVis1; case JOB_MAP_NODE_TYPES.INDEX: @@ -85,55 +83,59 @@ function borderColorForNode(el: cytoscape.NodeSingular, theme: EuiThemeType) { } } -export const getCytoscapeOptions = (theme: EuiThemeType): cytoscape.CytoscapeOptions => ({ - autoungrabify: true, - boxSelectionEnabled: false, - maxZoom: 3, - minZoom: 0.2, - style: [ - { - selector: 'node', - style: { - 'background-color': (el: cytoscape.NodeSingular) => - el.data('isRoot') ? theme.euiColorWarning : theme.euiColorGhost, - 'background-height': '60%', - 'background-width': '60%', - 'border-color': (el: cytoscape.NodeSingular) => borderColorForNode(el, theme), - 'border-style': 'solid', - // @ts-ignore - 'background-image': (el: cytoscape.NodeSingular) => iconForNode(el), - 'border-width': (el: cytoscape.NodeSingular) => (el.selected() ? 4 : 3), - color: theme.euiTextColor, - 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', - 'font-size': theme.euiFontSizeXS, - 'min-zoomed-font-size': parseInt(theme.euiSizeL, 10), - label: 'data(label)', - shape: (el: cytoscape.NodeSingular) => shapeForNode(el, theme), - 'text-background-color': theme.euiColorLightestShade, - 'text-background-opacity': 0, - 'text-background-padding': theme.euiSizeXS, - 'text-background-shape': 'roundrectangle', - 'text-margin-y': parseInt(theme.euiSizeS, 10), - 'text-max-width': '200px', - 'text-valign': 'bottom', - 'text-wrap': 'wrap', +export const getCytoscapeOptions = (theme: EuiThemeType): cytoscape.CytoscapeOptions => { + const lineColor = theme.euiColorLightShade; + + return { + autoungrabify: true, + boxSelectionEnabled: false, + maxZoom: 3, + minZoom: 0.2, + style: [ + { + selector: 'node', + style: { + 'background-color': (el: cytoscape.NodeSingular) => + el.data('isRoot') ? theme.euiColorWarning : theme.euiColorGhost, + 'background-height': '60%', + 'background-width': '60%', + 'border-color': (el: cytoscape.NodeSingular) => borderColorForNode(el, theme), + 'border-style': 'solid', + // @ts-ignore + 'background-image': (el: cytoscape.NodeSingular) => iconForNode(el), + 'border-width': (el: cytoscape.NodeSingular) => (el.selected() ? 4 : 3), + color: theme.euiTextColor, + 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', + 'font-size': theme.euiFontSizeXS, + 'min-zoomed-font-size': parseInt(theme.euiSizeL, 10), + label: 'data(label)', + shape: (el: cytoscape.NodeSingular) => shapeForNode(el), + 'text-background-color': theme.euiColorLightestShade, + 'text-background-opacity': 0, + 'text-background-padding': theme.euiSizeXS, + 'text-background-shape': 'roundrectangle', + 'text-margin-y': parseInt(theme.euiSizeS, 10), + 'text-max-width': '200px', + 'text-valign': 'bottom', + 'text-wrap': 'wrap', + }, }, - }, - { - selector: 'edge', - style: { - 'curve-style': 'taxi', - // @ts-ignore - 'taxi-direction': 'rightward', - 'line-color': lineColor, - 'overlay-opacity': 0, - 'target-arrow-color': lineColor, - 'target-arrow-shape': 'triangle', - // @ts-ignore - 'target-distance-from-node': theme.euiSizeXS, - width: 1, - 'source-arrow-shape': 'none', + { + selector: 'edge', + style: { + 'curve-style': 'taxi', + // @ts-ignore + 'taxi-direction': 'rightward', + 'line-color': lineColor, + 'overlay-opacity': 0, + 'target-arrow-color': lineColor, + 'target-arrow-shape': 'triangle', + // @ts-ignore + 'target-distance-from-node': theme.euiSizeXS, + width: 1, + 'source-arrow-shape': 'none', + }, }, - }, - ], -}); + ], + }; +}; diff --git a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx index 9d0692d540f1..a60fa07fdee8 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/jobs/new_job/recognize/components/job_item.tsx @@ -54,7 +54,7 @@ export const JobItem: FC<JobItemProps> = memo( <EuiFlexItem> <EuiFlexGroup gutterSize="s"> <EuiFlexItem grow={false}> - <EuiText size="s" color="success"> + <EuiText size="s" color="accentSecondary"> {jobPrefix} {id} </EuiText> diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx b/x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx index 9547e7c6473b..7d47b83c8009 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/models_list.tsx @@ -427,7 +427,8 @@ export const ModelsList: FC<Props> = ({ render: (item: TrainedModelUIItem) => { const { description, model_id: modelId, type } = item; - const isTechPreview = description?.includes('(Tech Preview)'); + const isTechPreview = + description?.includes('(Tech Preview)') || (isNLPModelItem(item) && item.techPreview); let descriptionText = description?.replace('(Tech Preview)', ''); diff --git a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/inference_base.ts b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/inference_base.ts index b7ac57a5750a..eee0a38e0731 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/inference_base.ts +++ b/x-pack/platform/plugins/shared/ml/public/application/model_management/test_models/models/inference_base.ts @@ -376,10 +376,10 @@ export abstract class InferenceBase<TInferResponse> { }; } - // @ts-expect-error error does not exist in type protected getDocFromResponse({ doc, error }: estypes.IngestSimulatePipelineSimulation) { if (doc === undefined) { if (error) { + // @ts-expect-error Error is now typed in estypes. However, I doubt that it doesn't get the HTTP wrapper expected. this.setFinishedWithErrors(error); throw Error(error.reason); } diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer.js b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer.js index 57ded98fc837..9fce79d3d1fa 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer.js +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer.js @@ -1130,19 +1130,20 @@ export class TimeSeriesExplorer extends React.Component { )} </span>   - {chartDetails.entityData.count === 1 && ( - <EuiTextColor color={'success'} size={'s'} component={'span'}> - {chartDetails.entityData.entities.length > 0 && '('} - {chartDetails.entityData.entities - .map((entity) => { - return `${entity.fieldName}: ${entity.fieldValue}`; - }) - .join(', ')} - {chartDetails.entityData.entities.length > 0 && ')'} - </EuiTextColor> - )} - {chartDetails.entityData.count !== 1 && ( - <EuiTextColor color={'success'} size={'s'} component={'span'}> + {chartDetails.entityData.count === 1 && + chartDetails.entityData.entities.length > 0 && ( + <EuiTextColor color="accentSecondary" size="s" component="span"> + ( + {chartDetails.entityData.entities + .map((entity) => { + return `${entity.fieldName}: ${entity.fieldValue}`; + }) + .join(', ')} + ) + </EuiTextColor> + )} + {chartDetails.entityData.count > 1 && ( + <EuiTextColor color="accentSecondary" size="s" component="span"> {chartDetails.entityData.entities.map((countData, i) => { return ( <Fragment key={countData.fieldName}> diff --git a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_title.tsx b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_title.tsx index 720acfd1704e..7f874961121a 100644 --- a/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_title.tsx +++ b/x-pack/platform/plugins/shared/ml/public/application/timeseriesexplorer/timeseriesexplorer_embeddable_chart/timeseriesexplorer_title.tsx @@ -122,7 +122,7 @@ export const SingleMetricViewerTitle: FC<SingleMetricViewerTitleProps> = ({ <EuiFlexItem grow={false} key={`${entity.fieldName}.${entity.fieldValue}`}> <EuiFlexGroup gutterSize="none" alignItems="center"> <EuiFlexItem grow={false}> - <EuiTextColor color={'success'} component={'span'}> + <EuiTextColor color="accentSecondary" component="span"> {`${entity.fieldName}: ${entity.fieldValue}`} </EuiTextColor> </EuiFlexItem> diff --git a/x-pack/platform/plugins/shared/ml/server/models/model_management/model_provider.test.ts b/x-pack/platform/plugins/shared/ml/server/models/model_management/model_provider.test.ts index 0a73dfa3053d..53cc37d33cdc 100644 --- a/x-pack/platform/plugins/shared/ml/server/models/model_management/model_provider.test.ts +++ b/x-pack/platform/plugins/shared/ml/server/models/model_management/model_provider.test.ts @@ -126,6 +126,22 @@ describe('modelsProvider', () => { licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64', type: ['pytorch', 'text_embedding'], }, + { + model_id: '.rerank-v1', + techPreview: true, + recommended: true, + supported: true, + hidden: true, + modelName: 'rerank', + version: 1, + config: { + input: { + field_names: ['input', 'query'], + }, + }, + description: 'Elastic Rerank v1', + type: ['pytorch', 'text_similarity'], + }, ]); }); @@ -215,6 +231,22 @@ describe('modelsProvider', () => { license: 'MIT', licenseUrl: 'https://huggingface.co/elastic/multilingual-e5-small_linux-x86_64', }, + { + model_id: '.rerank-v1', + techPreview: true, + recommended: true, + supported: true, + hidden: true, + modelName: 'rerank', + version: 1, + config: { + input: { + field_names: ['input', 'query'], + }, + }, + description: 'Elastic Rerank v1', + type: ['pytorch', 'text_similarity'], + }, ]); }); }); diff --git a/x-pack/platform/plugins/shared/ml/server/models/model_management/models_provider.ts b/x-pack/platform/plugins/shared/ml/server/models/model_management/models_provider.ts index 0f302363f66e..9f45b8483bf2 100644 --- a/x-pack/platform/plugins/shared/ml/server/models/model_management/models_provider.ts +++ b/x-pack/platform/plugins/shared/ml/server/models/model_management/models_provider.ts @@ -237,12 +237,15 @@ export class ModelsProvider { const forDownload = await this.getModelDownloads(); const notDownloaded: TrainedModelUIItem[] = forDownload - .filter(({ model_id: modelId, hidden, recommended, supported, disclaimer }) => { + .filter(({ model_id: modelId, hidden, recommended, supported, disclaimer, techPreview }) => { if (idMap.has(modelId)) { const model = idMap.get(modelId)! as NLPModelItem; if (recommended) { model.recommended = true; } + if (techPreview) { + model.techPreview = true; + } model.supported = supported; model.disclaimer = disclaimer; } diff --git a/x-pack/plugins/observability_solution/exploratory_view/.storybook/jest_setup.js b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/.storybook/jest_setup.js rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/exploratory_view/.storybook/main.js b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/.storybook/main.js rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/exploratory_view/.storybook/preview.js b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/.storybook/preview.js rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/preview.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/README.md b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/README.md similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/README.md rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/README.md diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/TRACING.md b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/TRACING.md similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/TRACING.md rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/TRACING.md diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/capabilities.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/capabilities.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/capabilities.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/connectors.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/connectors.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/conversation_complete.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/conversation_complete.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts similarity index 98% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts index 974b002ea93c..229183ed142a 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/convert_messages_for_inference.ts @@ -52,6 +52,7 @@ export function convertMessagesForInference(messages: Message[]): InferenceMessa } inferenceMessages.push({ + name: message.message.name!, role: InferenceMessageRole.Tool, response: JSON.parse(message.message.content ?? '{}'), toolCallId: toolCallRequest.toolCalls![0].toolCallId, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/feature.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/feature.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/feature.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/feature.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/function_visibility.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/functions/visualize_esql.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/rule_connector.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/rule_connector.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/rule_connector.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/rule_connector.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/ui_settings/settings_keys.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/concatenate_chat_completion_chunks.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_request_message.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/create_function_response_message.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/emit_with_concatenated_message.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/emit_with_concatenated_message.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/emit_with_concatenated_message.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/emit_with_concatenated_message.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/filter_function_definitions.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/filter_function_definitions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/filter_function_definitions.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/filter_function_definitions.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/calculate_auto.js b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/calculate_auto.js similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/calculate_auto.js rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/calculate_auto.js diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/index.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/index.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/unit_to_seconds.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/unit_to_seconds.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_bucket_size/unit_to_seconds.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/unit_to_seconds.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/short_id_table.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/throw_serialized_chat_completion_errors.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/until_aborted.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/until_aborted.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/until_aborted.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/until_aborted.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/with_token_budget.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/with_token_budget.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/with_token_budget.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/with_token_budget.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/with_token_budget.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/with_token_budget.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/with_token_budget.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/with_token_budget.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/without_token_count_events.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/without_token_count_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/without_token_count_events.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common/utils/without_token_count_events.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/jest.config.js b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/jest.config.js new file mode 100644 index 000000000000..4ff20cb91d53 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: [ + '<rootDir>/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public', + '<rootDir>/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/common', + '<rootDir>/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server', + ], + setupFiles: [ + '<rootDir>/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/.storybook/jest_setup.js', + ], + collectCoverage: true, + collectCoverageFrom: [ + '<rootDir>/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/{common,public,server}/**/*.{js,ts,tsx}', + ], + + coverageReporters: ['html'], +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/kibana.jsonc b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/kibana.jsonc rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/chat_feedback.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/common.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/common.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/common.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_feedback.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_response.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_response.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_response.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/insight_response.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/schemas/user_sent_prompt.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/analytics/telemetry_event_type.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/api/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/api/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/api/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/api/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/elastic_ai_assistant.png b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/elastic_ai_assistant.png similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/elastic_ai_assistant.png rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/elastic_ai_assistant.png diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/illustration.png b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/illustration.png similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/illustration.png rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/illustration.png diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/illustration.svg b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/illustration.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/assets/illustration.svg rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/assets/illustration.svg diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/assistant_avatar.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/feedback_buttons.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/regenerate_response_button.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/start_chat_button.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/buttons/stop_generating_button.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/chat_item_controls.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/chat/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/chat/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/connector_selector/connector_selector_base.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/actions_menu.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/actions_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/actions_menu.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/actions_menu.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_base.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_error.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/insight/insight_error.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/insight/insight_error.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/esql_code_block.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/failed_to_load_response.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.stories.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.stories.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_panel.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx similarity index 96% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx index 85fa0f460990..a473e34ba2a0 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/message_panel/message_text.tsx @@ -156,7 +156,14 @@ export function MessageText({ loading, content, onActionClick }: Props) { }, table: (props) => ( <> - <EuiTable {...props} /> + <EuiTable + {...props} + className={css` + .euiTableCellContent__text { + white-space: normal; + } + `} + /> <EuiSpacer size="m" /> </> ), diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/components/missing_credentials_callout.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/missing_credentials_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/components/missing_credentials_callout.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/components/missing_credentials_callout.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_chat_service_context.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_chat_service_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_chat_service_context.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_chat_service_context.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_multipane_flyout_context.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_multipane_flyout_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_multipane_flyout_context.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_multipane_flyout_context.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_provider.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_provider.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_provider.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/context/observability_ai_assistant_provider.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_abortable_async.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_chat.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_flyout_state.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_flyout_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_flyout_state.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_flyout_state.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_genai_connectors.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_kibana.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_kibana.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant_chat_service.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant_chat_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant_chat_service.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_observability_ai_assistant_chat_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_once.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_once.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/hooks/use_once.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/hooks/use_once.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/mock.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/mock.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/mock.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/plugin.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/plugin.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/plugin.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/complete.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/complete.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/complete.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/complete.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/complete.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_chat_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_mock_chat_service.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_mock_chat_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_mock_chat_service.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_mock_chat_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_service.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/create_service.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/create_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/service/default_starter_prompts.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/default_starter_prompts.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/service/default_starter_prompts.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/service/default_starter_prompts.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/storybook_mock.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/storybook_mock.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/storybook_mock.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/storybook_mock.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/builders.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/builders.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/builders.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/builders.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_function_response_error.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_function_response_error.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_function_response_error.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_function_response_error.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/create_screen_context_action.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_connectors_management_href.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_connectors_management_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_connectors_management_href.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_connectors_management_href.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_contextual_insight_messages.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_contextual_insight_messages.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_contextual_insight_messages.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_contextual_insight_messages.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_models_management_href.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_models_management_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/get_models_management_href.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/get_models_management_href.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/readable_stream_reader_into_observable.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/readable_stream_reader_into_observable.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/readable_stream_reader_into_observable.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/readable_stream_reader_into_observable.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/storybook_decorator.tsx b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/storybook_decorator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/public/utils/storybook_decorator.tsx rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/public/utils/storybook_decorator.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/analytics/recall_ranking.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/analytics/recall_ranking.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/analytics/recall_ranking.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/analytics/recall_ranking.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/config.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/config.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/context.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/context.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/context.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/context.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/elasticsearch.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/execute_connector.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/execute_connector.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/execute_connector.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/execute_connector.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/get_relevant_field_names.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/get_dataset_info/index.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/index.ts new file mode 100644 index 000000000000..244c867e7f64 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/index.ts @@ -0,0 +1,153 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import dedent from 'dedent'; +import { CONTEXT_FUNCTION_NAME, registerContextFunction } from './context'; +import { registerSummarizationFunction, SUMMARIZE_FUNCTION_NAME } from './summarize'; +import type { RegistrationCallback } from '../service/types'; +import { registerElasticsearchFunction } from './elasticsearch'; +import { GET_DATASET_INFO_FUNCTION_NAME, registerGetDatasetInfoFunction } from './get_dataset_info'; +import { registerKibanaFunction } from './kibana'; +import { registerExecuteConnectorFunction } from './execute_connector'; +import { GET_DATA_ON_SCREEN_FUNCTION_NAME } from '../service/chat_function_client'; + +// cannot be imported from x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts due to circular dependency +export const QUERY_FUNCTION_NAME = 'query'; + +export type FunctionRegistrationParameters = Omit< + Parameters<RegistrationCallback>[0], + 'registerContext' | 'hasFunction' +>; + +export const registerFunctions: RegistrationCallback = async ({ + client, + functions, + resources, + signal, + scopes, +}) => { + const registrationParameters: FunctionRegistrationParameters = { + client, + functions, + resources, + signal, + scopes, + }; + + const isServerless = !!resources.plugins.serverless; + if (scopes.includes('observability')) { + functions.registerInstruction(`You are a helpful assistant for Elastic Observability. Your goal is to help the Elastic Observability users to quickly assess what is happening in their observed systems. You can help them visualise and analyze data, investigate their systems, perform root cause analysis or identify optimisation opportunities. + + It's very important to not assume what the user is meaning. Ask them for clarification if needed. + + If you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation. + + In KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: ':()\\\ + /\". Always put a field value in double quotes. Best: service.name:\"opbeans-go\". Wrong: service.name:opbeans-go. This is very important! + + You can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response. + + Note that ES|QL (the Elasticsearch Query Language which is a new piped language) is the preferred query language. + + If you want to call a function or tool, only call it a single time per message. Wait until the function has been executed and its results + returned to you, before executing the same tool or another tool again if needed. + + DO NOT UNDER ANY CIRCUMSTANCES USE ES|QL syntax (\`service.name == "foo"\`) with "kqlFilter" (\`service.name:"foo"\`). + + The user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability and Search, which can be found in the ${ + isServerless ? `Project settings.` : `Stack Management app under the option AI Assistants` + }. + If the user asks how to change the language, reply in the same language the user asked in.`); + } + + if (scopes.length === 0 || (scopes.length === 1 && scopes[0] === 'all')) { + functions.registerInstruction( + `You are a helpful assistant for Elasticsearch. Your goal is to help Elasticsearch users accomplish tasks using Kibana and Elasticsearch. You can help them construct queries, index data, search data, use Elasticsearch APIs, generate sample data, visualise and analyze data. + + It's very important to not assume what the user means. Ask them for clarification if needed. + + If you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation. + + In KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: ':()\\\ + /\". Always put a field value in double quotes. Best: service.name:\"opbeans-go\". Wrong: service.name:opbeans-go. This is very important! + + You can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response. + + If you want to call a function or tool, only call it a single time per message. Wait until the function has been executed and its results + returned to you, before executing the same tool or another tool again if needed. + + The user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability and Search, which can be found in the ${ + isServerless ? `Project settings.` : `Stack Management app under the option AI Assistants` + }. + If the user asks how to change the language, reply in the same language the user asked in.` + ); + } + + const { ready: isKnowledgeBaseReady } = await client.getKnowledgeBaseStatus(); + + functions.registerInstruction(({ availableFunctionNames }) => { + const instructions: string[] = []; + + if ( + availableFunctionNames.includes(QUERY_FUNCTION_NAME) && + availableFunctionNames.includes(GET_DATASET_INFO_FUNCTION_NAME) + ) { + instructions.push(`You MUST use the "${GET_DATASET_INFO_FUNCTION_NAME}" ${ + functions.hasFunction('get_apm_dataset_info') ? 'or the get_apm_dataset_info' : '' + } function before calling the "${QUERY_FUNCTION_NAME}" or the "changes" functions. + + If a function requires an index, you MUST use the results from the dataset info functions.`); + } + + if (availableFunctionNames.includes(GET_DATA_ON_SCREEN_FUNCTION_NAME)) { + instructions.push(`You have access to data on the screen by calling the "${GET_DATA_ON_SCREEN_FUNCTION_NAME}" function. + Use it to help the user understand what they are looking at. A short summary of what they are looking at is available in the return of the "${CONTEXT_FUNCTION_NAME}" function. + Data that is compact enough automatically gets included in the response for the "${CONTEXT_FUNCTION_NAME}" function.`); + } + + if (isKnowledgeBaseReady) { + if (availableFunctionNames.includes(SUMMARIZE_FUNCTION_NAME)) { + instructions.push(`You can use the "${SUMMARIZE_FUNCTION_NAME}" function to store new information you have learned in a knowledge database. + Only use this function when the user asks for it. + All summaries MUST be created in English, even if the conversation was carried out in a different language.`); + } + + if (availableFunctionNames.includes(CONTEXT_FUNCTION_NAME)) { + instructions.push( + `Additionally, you can use the "${CONTEXT_FUNCTION_NAME}" function to retrieve relevant information from the knowledge database.` + ); + } + } else { + instructions.push( + `You do not have a working memory. If the user expects you to remember the previous conversations, tell them they can set up the knowledge base.` + ); + } + return instructions.map((instruction) => dedent(instruction)); + }); + + if (isKnowledgeBaseReady) { + registerSummarizationFunction(registrationParameters); + } + + registerContextFunction({ ...registrationParameters, isKnowledgeBaseReady }); + + registerElasticsearchFunction(registrationParameters); + const request = registrationParameters.resources.request; + + if ('id' in request) { + registerKibanaFunction({ + ...registrationParameters, + resources: { + ...registrationParameters.resources, + request, + }, + }); + } + registerGetDatasetInfoFunction(registrationParameters); + + registerExecuteConnectorFunction(registrationParameters); +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/kibana.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/kibana.ts similarity index 98% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/kibana.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/kibana.ts index f939e3a79799..d228927cdedf 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/kibana.ts +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/kibana.ts @@ -77,6 +77,7 @@ export function registerKibanaFunction({ 'referer', 'user-agent', 'x-elastic-internal-origin', + 'x-elastic-product-origin', 'x-kbn-context', ]; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/summarize.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/summarize.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/summarize.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/functions/summarize.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/index.ts new file mode 100644 index 000000000000..b84234164f8c --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/index.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 { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; + +import type { ObservabilityAIAssistantConfig } from './config'; + +export type { ObservabilityAIAssistantServerRouteRepository } from './routes/get_global_observability_ai_assistant_route_repository'; + +import { config as configSchema } from './config'; +export type { RegistrationCallback } from './service/types'; +export type { + ObservabilityAIAssistantServerStart, + ObservabilityAIAssistantServerSetup, +} from './types'; + +export type { ObservabilityAIAssistantClient } from './service/client'; + +export { + aiAssistantLogsIndexPattern, + aiAssistantSimulatedFunctionCalling, + aiAssistantSearchConnectorIndexPattern, +} from '../common'; + +export { streamIntoObservable } from './service/util/stream_into_observable'; + +export { createFunctionRequestMessage } from '../common/utils/create_function_request_message'; +export { createFunctionResponseMessage } from '../common/utils/create_function_response_message'; + +export const config: PluginConfigDescriptor<ObservabilityAIAssistantConfig> = { + deprecations: ({ unusedFromRoot }) => [ + unusedFromRoot('xpack.observability.aiAssistant.enabled', { + level: 'warning', + }), + unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.deploymentId', { + level: 'warning', + }), + unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.resourceName', { + level: 'warning', + }), + unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.apiKey', { + level: 'warning', + }), + unusedFromRoot('xpack.observability.aiAssistant.provider.openAI.apiKey', { + level: 'warning', + }), + unusedFromRoot('xpack.observability.aiAssistant.provider.openAI.model', { + level: 'warning', + }), + ], + exposeToBrowser: { scope: true }, + schema: configSchema, +}; + +export const plugin = async (ctx: PluginInitializerContext<ObservabilityAIAssistantConfig>) => { + const { ObservabilityAIAssistantPlugin } = await import('./plugin'); + return new ObservabilityAIAssistantPlugin(ctx); +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/plugin.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/chat/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/chat/route.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/chat/route.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/connectors/route.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/conversations/route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/conversations/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/conversations/route.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/conversations/route.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/create_observability_ai_assistant_server_route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/create_observability_ai_assistant_server_route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/create_observability_ai_assistant_server_route.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/create_observability_ai_assistant_server_route.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/functions/route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/functions/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/functions/route.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/functions/route.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/get_global_observability_ai_assistant_route_repository.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts new file mode 100644 index 000000000000..6aa63c177c74 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts @@ -0,0 +1,331 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import pLimit from 'p-limit'; +import { notImplemented } from '@hapi/boom'; +import { nonEmptyStringRt, toBooleanRt } from '@kbn/io-ts-utils'; +import * as t from 'io-ts'; +import { + InferenceInferenceEndpointInfo, + MlDeploymentAllocationState, + MlDeploymentAssignmentState, +} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import moment from 'moment'; +import { createObservabilityAIAssistantServerRoute } from '../create_observability_ai_assistant_server_route'; +import { Instruction, KnowledgeBaseEntry, KnowledgeBaseEntryRole } from '../../../common/types'; + +const getKnowledgeBaseStatus = createObservabilityAIAssistantServerRoute({ + endpoint: 'GET /internal/observability_ai_assistant/kb/status', + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async ({ + service, + request, + }): Promise<{ + errorMessage?: string; + ready: boolean; + enabled: boolean; + endpoint?: Partial<InferenceInferenceEndpointInfo>; + model_stats?: { + deployment_state: MlDeploymentAssignmentState | undefined; + allocation_state: MlDeploymentAllocationState | undefined; + }; + }> => { + const client = await service.getClient({ request }); + + if (!client) { + throw notImplemented(); + } + + return client.getKnowledgeBaseStatus(); + }, +}); + +const setupKnowledgeBase = createObservabilityAIAssistantServerRoute({ + endpoint: 'POST /internal/observability_ai_assistant/kb/setup', + params: t.partial({ + query: t.partial({ + model_id: t.string, + }), + }), + options: { + timeout: { + idleSocket: moment.duration(20, 'minutes').asMilliseconds(), + }, + }, + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<InferenceInferenceEndpointInfo> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + const { model_id: modelId } = resources.params?.query ?? {}; + + return await client.setupKnowledgeBase(modelId); + }, +}); + +const resetKnowledgeBase = createObservabilityAIAssistantServerRoute({ + endpoint: 'POST /internal/observability_ai_assistant/kb/reset', + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<{ result: string }> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + await client.resetKnowledgeBase(); + + return { result: 'success' }; + }, +}); + +const semanticTextMigrationKnowledgeBase = createObservabilityAIAssistantServerRoute({ + endpoint: 'POST /internal/observability_ai_assistant/kb/semantic_text_migration', + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<void> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + return client.migrateKnowledgeBaseToSemanticText(); + }, +}); + +const getKnowledgeBaseUserInstructions = createObservabilityAIAssistantServerRoute({ + endpoint: 'GET /internal/observability_ai_assistant/kb/user_instructions', + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async ( + resources + ): Promise<{ + userInstructions: Array<Instruction & { public?: boolean }>; + }> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + return { + userInstructions: await client.getKnowledgeBaseUserInstructions(), + }; + }, +}); + +const saveKnowledgeBaseUserInstruction = createObservabilityAIAssistantServerRoute({ + endpoint: 'PUT /internal/observability_ai_assistant/kb/user_instructions', + params: t.type({ + body: t.type({ + id: t.string, + text: t.string, + public: toBooleanRt, + }), + }), + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<void> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + const { id, text, public: isPublic } = resources.params.body; + return client.addUserInstruction({ + entry: { id, text, public: isPublic }, + }); + }, +}); + +const getKnowledgeBaseEntries = createObservabilityAIAssistantServerRoute({ + endpoint: 'GET /internal/observability_ai_assistant/kb/entries', + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + params: t.type({ + query: t.type({ + query: t.string, + sortBy: t.string, + sortDirection: t.union([t.literal('asc'), t.literal('desc')]), + }), + }), + handler: async ( + resources + ): Promise<{ + entries: KnowledgeBaseEntry[]; + }> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + const { query, sortBy, sortDirection } = resources.params.query; + + return await client.getKnowledgeBaseEntries({ query, sortBy, sortDirection }); + }, +}); + +const knowledgeBaseEntryRt = t.intersection([ + t.type({ + id: t.string, + title: t.string, + text: nonEmptyStringRt, + }), + t.partial({ + confidence: t.union([t.literal('low'), t.literal('medium'), t.literal('high')]), + is_correction: toBooleanRt, + public: toBooleanRt, + labels: t.record(t.string, t.string), + role: t.union([ + t.literal(KnowledgeBaseEntryRole.AssistantSummarization), + t.literal(KnowledgeBaseEntryRole.UserEntry), + t.literal(KnowledgeBaseEntryRole.Elastic), + ]), + }), +]); + +const saveKnowledgeBaseEntry = createObservabilityAIAssistantServerRoute({ + endpoint: 'POST /internal/observability_ai_assistant/kb/entries/save', + params: t.type({ + body: knowledgeBaseEntryRt, + }), + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<void> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + const entry = resources.params.body; + return client.addKnowledgeBaseEntry({ + entry: { + confidence: 'high', + is_correction: false, + public: true, + labels: {}, + role: KnowledgeBaseEntryRole.UserEntry, + ...entry, + }, + }); + }, +}); + +const deleteKnowledgeBaseEntry = createObservabilityAIAssistantServerRoute({ + endpoint: 'DELETE /internal/observability_ai_assistant/kb/entries/{entryId}', + params: t.type({ + path: t.type({ + entryId: t.string, + }), + }), + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<void> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + return client.deleteKnowledgeBaseEntry(resources.params.path.entryId); + }, +}); + +const importKnowledgeBaseEntries = createObservabilityAIAssistantServerRoute({ + endpoint: 'POST /internal/observability_ai_assistant/kb/entries/import', + params: t.type({ + body: t.type({ + entries: t.array(knowledgeBaseEntryRt), + }), + }), + security: { + authz: { + requiredPrivileges: ['ai_assistant'], + }, + }, + handler: async (resources): Promise<void> => { + const client = await resources.service.getClient({ request: resources.request }); + + if (!client) { + throw notImplemented(); + } + + const { ready } = await client.getKnowledgeBaseStatus(); + if (!ready) { + throw new Error('Knowledge base is not ready'); + } + + const limiter = pLimit(5); + + const promises = resources.params.body.entries.map(async (entry) => { + return limiter(async () => { + return client.addKnowledgeBaseEntry({ + entry: { + confidence: 'high', + is_correction: false, + public: true, + labels: {}, + role: KnowledgeBaseEntryRole.UserEntry, + ...entry, + }, + }); + }); + }); + + await Promise.all(promises); + }, +}); + +export const knowledgeBaseRoutes = { + ...semanticTextMigrationKnowledgeBase, + ...setupKnowledgeBase, + ...resetKnowledgeBase, + ...getKnowledgeBaseStatus, + ...getKnowledgeBaseEntries, + ...saveKnowledgeBaseUserInstruction, + ...importKnowledgeBaseEntries, + ...getKnowledgeBaseUserInstructions, + ...saveKnowledgeBaseEntry, + ...deleteKnowledgeBaseEntry, +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/register_routes.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/register_routes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/register_routes.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/register_routes.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/runtime_types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/routes/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/chat_function_client/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/get_context_function_request_if_needed.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/get_context_function_request_if_needed.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/get_context_function_request_if_needed.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/get_context_function_request_if_needed.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.test.ts new file mode 100644 index 000000000000..199a6d8f1cbc --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.test.ts @@ -0,0 +1,1685 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; +import type { CoreSetup, ElasticsearchClient, IUiSettingsClient, Logger } from '@kbn/core/server'; +import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; +import { waitFor } from '@testing-library/react'; +import { last, merge, repeat } from 'lodash'; +import { Subject, Observable } from 'rxjs'; +import { EventEmitter, type Readable } from 'stream'; +import { finished } from 'stream/promises'; +import { ObservabilityAIAssistantClient } from '.'; +import { MessageRole, type Message } from '../../../common'; +import { + ChatCompletionChunkEvent, + MessageAddEvent, + StreamingChatResponseEventType, +} from '../../../common/conversation_complete'; +import { ChatCompletionEventType as InferenceChatCompletionEventType } from '@kbn/inference-common'; +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { createFunctionResponseMessage } from '../../../common/utils/create_function_response_message'; +import { CONTEXT_FUNCTION_NAME } from '../../functions/context'; +import { ChatFunctionClient } from '../chat_function_client'; +import type { KnowledgeBaseService } from '../knowledge_base_service'; +import { observableIntoStream } from '../util/observable_into_stream'; +import type { ObservabilityAIAssistantConfig } from '../../config'; +import type { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; + +interface ChunkDelta { + content?: string | undefined; + function_call?: + | { + name?: string | undefined; + arguments?: string | undefined; + } + | undefined; +} + +type LlmSimulator = ReturnType<typeof createLlmSimulator>; + +const EXPECTED_STORED_SYSTEM_MESSAGE = `system`; + +const nextTick = () => { + return new Promise(process.nextTick); +}; + +const waitForNextWrite = async (stream: Readable): Promise<any> => { + // this will fire before the client's internal write() promise is + // resolved + const response = await new Promise((resolve) => stream.once('data', resolve)); + // so we wait another tick to let the client move to the next step + await nextTick(); + + return response; +}; + +function createLlmSimulator(subscriber: any) { + return { + next: async (msg: ChunkDelta) => { + subscriber.next({ + type: InferenceChatCompletionEventType.ChatCompletionMessage, + content: msg.content, + toolCalls: msg.function_call ? [{ function: msg.function_call }] : [], + }); + }, + tokenCount: async ({ + completion, + prompt, + total, + }: { + completion: number; + prompt: number; + total: number; + }) => { + subscriber.next({ + type: InferenceChatCompletionEventType.ChatCompletionTokenCount, + tokens: { completion, prompt, total }, + }); + subscriber.complete(); + }, + chunk: async (msg: ChunkDelta) => { + subscriber.next({ + type: InferenceChatCompletionEventType.ChatCompletionChunk, + content: msg.content, + tool_calls: msg.function_call ? [{ function: msg.function_call }] : [], + }); + }, + complete: async () => { + subscriber.complete(); + }, + error: (error: Error) => { + subscriber.error(error); + }, + }; +} + +describe('Observability AI Assistant client', () => { + let client: ObservabilityAIAssistantClient; + + const actionsClientMock: DeeplyMockedKeys<ActionsClient> = { + execute: jest.fn(), + get: jest.fn(), + } as any; + + const inferenceClientMock: DeeplyMockedKeys<InferenceClient> = { + chatComplete: jest.fn(), + } as any; + + const uiSettingsClientMock: DeeplyMockedKeys<IUiSettingsClient> = { + get: jest.fn(), + } as any; + + const internalUserEsClientMock: DeeplyMockedKeys<ElasticsearchClient> = { + search: jest.fn(), + index: jest.fn(), + update: jest.fn(), + } as any; + + const currentUserEsClientMock: DeeplyMockedKeys<ElasticsearchClient> = { + search: jest.fn(), + fieldCaps: jest.fn(), + } as any; + + const knowledgeBaseServiceMock: DeeplyMockedKeys<KnowledgeBaseService> = { + recall: jest.fn(), + getUserInstructions: jest.fn(), + } as any; + + let loggerMock: DeeplyMockedKeys<Logger> = {} as any; + + const functionClientMock: DeeplyMockedKeys<ChatFunctionClient> = { + executeFunction: jest.fn(), + getFunctions: jest.fn(), + hasFunction: jest.fn(), + hasAction: jest.fn(), + getActions: jest.fn(), + validate: jest.fn(), + getInstructions: jest.fn(), + getAdhocInstructions: jest.fn(), + } as any; + + let llmSimulator: LlmSimulator; + + function createClient() { + jest.resetAllMocks(); + + // uncomment this line for debugging + // const consoleOrPassThrough = console.log.bind(console); + const consoleOrPassThrough = () => {}; + + loggerMock = { + log: jest.fn().mockImplementation(consoleOrPassThrough), + error: jest.fn().mockImplementation(consoleOrPassThrough), + debug: jest.fn().mockImplementation(consoleOrPassThrough), + trace: jest.fn().mockImplementation(consoleOrPassThrough), + isLevelEnabled: jest.fn().mockReturnValue(true), + } as any; + + functionClientMock.getFunctions.mockReturnValue([]); + functionClientMock.hasFunction.mockImplementation((name) => { + return name !== CONTEXT_FUNCTION_NAME; + }); + + functionClientMock.hasAction.mockReturnValue(false); + functionClientMock.getActions.mockReturnValue([]); + + currentUserEsClientMock.search.mockResolvedValue({ + hits: { + hits: [], + }, + } as any); + + currentUserEsClientMock.fieldCaps.mockResolvedValue({ + fields: [], + } as any); + + knowledgeBaseServiceMock.getUserInstructions.mockResolvedValue([]); + + functionClientMock.getInstructions.mockReturnValue(['system']); + functionClientMock.getAdhocInstructions.mockReturnValue([]); + + return new ObservabilityAIAssistantClient({ + config: {} as ObservabilityAIAssistantConfig, + core: {} as CoreSetup<ObservabilityAIAssistantPluginStartDependencies>, + actionsClient: actionsClientMock, + uiSettingsClient: uiSettingsClientMock, + esClient: { + asInternalUser: internalUserEsClientMock, + asCurrentUser: currentUserEsClientMock, + }, + inferenceClient: inferenceClientMock, + knowledgeBaseService: knowledgeBaseServiceMock, + logger: loggerMock, + namespace: 'default', + user: { + name: 'johndoe', + }, + scopes: ['all'], + }); + } + + function system(content: string | Omit<Message['message'], 'role'>): Message { + return merge( + { + '@timestamp': new Date().toString(), + message: { + role: MessageRole.System, + }, + }, + typeof content === 'string' ? { message: { content } } : content + ); + } + + function user(content: string | Omit<Message['message'], 'role'>): Message { + return merge( + { + '@timestamp': new Date().toString(), + message: { + role: MessageRole.User, + }, + }, + typeof content === 'string' ? { message: { content } } : content + ); + } + + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe('when completing a conversation without an initial conversation id', () => { + let stream: Readable; + + let titleLlmPromiseResolve: (title: string) => void; + let titleLlmPromiseReject: Function; + + beforeEach(async () => { + client = createClient(); + + inferenceClientMock.chatComplete + .mockImplementationOnce(() => { + return new Observable((subscriber) => { + titleLlmPromiseResolve = (title: string) => { + const titleLlmSimulator = createLlmSimulator(subscriber); + titleLlmSimulator + .chunk({ content: title }) + .then(() => titleLlmSimulator.next({ content: title })) + .then(() => titleLlmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 })) + .then(() => titleLlmSimulator.complete()) + .catch((error) => titleLlmSimulator.error(error)); + }; + titleLlmPromiseReject = (error: Error) => { + subscriber.error(error); + }; + }); + }) + .mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + stream = observableIntoStream( + client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + persist: true, + }) + ); + }); + + describe('when streaming the response from the LLM', () => { + let dataHandler: jest.Mock; + + beforeEach(async () => { + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await llmSimulator.chunk({ content: 'Hello' }); + await llmSimulator.next({ content: 'Hello' }); + + await nextTick(); + }); + + it('calls the llm to generate a new title', () => { + expect(inferenceClientMock.chatComplete.mock.calls[0]).toEqual([ + expect.objectContaining({ + connectorId: 'foo', + stream: true, + functionCalling: 'native', + toolChoice: expect.objectContaining({ + function: 'title_conversation', + }), + tools: expect.objectContaining({ + title_conversation: { + description: + 'Use this function to title the conversation. Do not wrap the title in quotes', + schema: { + type: 'object', + properties: { + title: { type: 'string' }, + }, + required: ['title'], + }, + }, + }), + messages: expect.arrayContaining([ + { + role: 'user', + content: + 'Generate a title, using the title_conversation_function, based on the following conversation:\n\n user: How many alerts do I have?', + }, + ]), + }), + ]); + }); + + it('calls the llm again with the messages', () => { + expect(inferenceClientMock.chatComplete.mock.calls[1]).toEqual([ + { + connectorId: 'foo', + stream: true, + messages: expect.arrayContaining([ + { role: 'user', content: 'How many alerts do I have?' }, + ]), + functionCalling: 'native', + toolChoice: undefined, + tools: undefined, + }, + ]); + }); + + it('incrementally streams the response to the client', async () => { + expect(dataHandler).toHaveBeenCalledTimes(2); + + await new Promise((resolve) => setTimeout(resolve, 1000)); + + expect(JSON.parse(dataHandler.mock.calls[0])).toEqual({ + id: expect.any(String), + message: { + content: 'Hello', + }, + type: StreamingChatResponseEventType.ChatCompletionChunk, + }); + }); + + describe('after the LLM errors out', () => { + beforeEach(async () => { + await llmSimulator.next({ content: ' again' }); + + llmSimulator.error(new Error('Unexpected error')); + + await finished(stream); + }); + + it('adds an error to the stream and closes it', () => { + expect(dataHandler).toHaveBeenCalledTimes(4); + + expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ + error: { + message: 'Unexpected error', + stack: expect.any(String), + }, + type: StreamingChatResponseEventType.ChatCompletionError, + }); + }); + }); + + describe('when generating a title fails', () => { + beforeEach(async () => { + titleLlmPromiseReject(new Error('Failed generating title')); + + await nextTick(); + await llmSimulator.tokenCount({ completion: 1, prompt: 33, total: 34 }); + await llmSimulator.complete(); + + await finished(stream); + }); + + it('falls back to the default title', () => { + expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ + conversation: { + title: 'New conversation', + id: expect.any(String), + last_updated: expect.any(String), + token_count: { + completion: 1, + prompt: 33, + total: 34, + }, + }, + type: StreamingChatResponseEventType.ConversationCreate, + }); + + expect(loggerMock.error).toHaveBeenCalled(); + }); + }); + + describe('after completing the response from the LLM', () => { + beforeEach(async () => { + await llmSimulator.chunk({ content: ' again' }); + + titleLlmPromiseResolve('An auto-generated title'); + await llmSimulator.tokenCount({ completion: 6, prompt: 210, total: 216 }); + await llmSimulator.complete(); + + await finished(stream); + }); + + it('adds the completed message to the stream', () => { + expect(JSON.parse(dataHandler.mock.calls[2])).toEqual({ + id: expect.any(String), + message: { + content: ' again', + }, + type: StreamingChatResponseEventType.ChatCompletionChunk, + }); + + expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: 'Hello again', + role: MessageRole.Assistant, + function_call: { + arguments: '', + name: '', + trigger: MessageRole.Assistant, + }, + }, + }, + type: StreamingChatResponseEventType.MessageAdd, + }); + }); + + it('creates a new conversation with the automatically generated title', () => { + expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ + conversation: { + title: 'An auto-generated title', + id: expect.any(String), + last_updated: expect.any(String), + token_count: { + completion: 6, + prompt: 210, + total: 216, + }, + }, + type: StreamingChatResponseEventType.ConversationCreate, + }); + + expect(internalUserEsClientMock.index).toHaveBeenCalledWith({ + index: '.kibana-observability-ai-assistant-conversations', + refresh: true, + document: { + '@timestamp': expect.any(String), + conversation: { + id: expect.any(String), + last_updated: expect.any(String), + title: 'An auto-generated title', + token_count: { + completion: 6, + prompt: 210, + total: 216, + }, + }, + labels: {}, + numeric_labels: {}, + public: false, + namespace: 'default', + user: { + name: 'johndoe', + }, + messages: [ + { + '@timestamp': expect.any(String), + message: { + content: EXPECTED_STORED_SYSTEM_MESSAGE, + role: MessageRole.System, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'How many alerts do I have?', + role: MessageRole.User, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'Hello again', + role: MessageRole.Assistant, + function_call: { + name: '', + arguments: '', + trigger: MessageRole.Assistant, + }, + }, + }, + ], + }, + }); + }); + }); + }); + }); + + describe('when completing a conversation with an initial conversation id', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + + beforeEach(async () => { + client = createClient(); + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + internalUserEsClientMock.search.mockImplementation(async () => { + return { + hits: { + hits: [ + { + _id: 'my-es-document-id', + _index: '.kibana-observability-ai-assistant-conversations', + _source: { + '@timestamp': new Date().toISOString(), + conversation: { + id: 'my-conversation-id', + title: 'My stored conversation', + last_updated: new Date().toISOString(), + token_count: { + completion: 1, + prompt: 78, + total: 79, + }, + }, + labels: {}, + numeric_labels: {}, + public: false, + messages: [ + system('This is a system message'), + user('How many alerts do I have?'), + ], + }, + }, + ], + }, + } as any; + }); + + internalUserEsClientMock.update.mockImplementationOnce(async () => { + return {} as any; + }); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + conversationId: 'my-conversation-id', + persist: true, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await nextTick(); + + await llmSimulator.chunk({ content: 'Hello' }); + await llmSimulator.next({ content: 'Hello' }); + await llmSimulator.tokenCount({ completion: 1, prompt: 33, total: 34 }); + await llmSimulator.complete(); + + await finished(stream); + }); + + it('updates the conversation', () => { + expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ + conversation: { + title: 'My stored conversation', + id: expect.any(String), + last_updated: expect.any(String), + token_count: { + completion: 2, + prompt: 111, + total: 113, + }, + }, + type: StreamingChatResponseEventType.ConversationUpdate, + }); + + expect(internalUserEsClientMock.update).toHaveBeenCalledWith({ + refresh: true, + index: '.kibana-observability-ai-assistant-conversations', + id: 'my-es-document-id', + doc: { + '@timestamp': expect.any(String), + conversation: { + id: expect.any(String), + last_updated: expect.any(String), + title: 'My stored conversation', + token_count: { + completion: 2, + prompt: 111, + total: 113, + }, + }, + labels: {}, + numeric_labels: {}, + public: false, + namespace: 'default', + user: { + name: 'johndoe', + }, + messages: [ + { + '@timestamp': expect.any(String), + message: { + content: EXPECTED_STORED_SYSTEM_MESSAGE, + role: MessageRole.System, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'How many alerts do I have?', + role: MessageRole.User, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'Hello', + role: MessageRole.Assistant, + function_call: { + name: '', + arguments: '', + trigger: MessageRole.Assistant, + }, + }, + }, + ], + }, + }); + }); + }); + + describe('when the LLM response fails', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + + beforeEach(async () => { + client = createClient(); + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + title: 'My predefined title', + persist: true, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await nextTick(); + + await llmSimulator.chunk({ content: 'Hello' }); + await llmSimulator.error(new Error('Connection unexpectedly closed')); + await llmSimulator.complete(); + + await finished(stream); + }); + + it('ends the stream and writes an error', async () => { + expect(JSON.parse(dataHandler.mock.calls[1])).toEqual({ + error: { + message: 'Connection unexpectedly closed', + stack: expect.any(String), + }, + type: StreamingChatResponseEventType.ChatCompletionError, + }); + }); + + it('does not create or update the conversation', async () => { + expect(internalUserEsClientMock.index).not.toHaveBeenCalled(); + expect(internalUserEsClientMock.update).not.toHaveBeenCalled(); + }); + }); + + describe('when the assistant answers with a function request', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + + let respondFn: jest.Mock; + + let fnResponseResolve: (data: unknown) => void; + + let fnResponseReject: (error: Error) => void; + + beforeEach(async () => { + client = createClient(); + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + respondFn = jest.fn(); + + functionClientMock.getFunctions.mockImplementation(() => [ + { + definition: { + name: 'myFunction', + contexts: ['core'], + description: 'my-description', + descriptionForUser: '', + parameters: { + type: 'object', + properties: { + foo: { + type: 'string', + enum: ['bar'], + }, + }, + required: ['foo'], + }, + }, + respond: respondFn, + }, + ]); + + functionClientMock.executeFunction.mockImplementationOnce(() => { + return new Promise<any>((resolve, reject) => { + fnResponseResolve = resolve; + fnResponseReject = reject; + }); + }); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + title: 'My predefined title', + persist: true, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await nextTick(); + + await llmSimulator.next({ content: 'Hello' }); + await llmSimulator.chunk({ + content: 'Hello', + function_call: { name: 'myFunction', arguments: JSON.stringify({ foo: 'bar' }) }, + }); + + const prevLlmSimulator = llmSimulator; + + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + await prevLlmSimulator.complete(); + + await waitForNextWrite(stream); + }); + + describe('while the function call is pending', () => { + it('appends the request message', async () => { + expect(JSON.parse(dataHandler.mock.calls[2])).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: 'Hello', + role: MessageRole.Assistant, + function_call: { + name: 'myFunction', + arguments: JSON.stringify({ foo: 'bar' }), + trigger: MessageRole.Assistant, + }, + }, + }, + }); + }); + + it('executes the function', () => { + expect(functionClientMock.executeFunction).toHaveBeenCalledWith({ + name: 'myFunction', + chat: expect.any(Function), + args: JSON.stringify({ foo: 'bar' }), + signal: expect.any(AbortSignal), + connectorId: 'foo', + messages: [ + { + '@timestamp': expect.any(String), + message: { + role: MessageRole.System, + content: EXPECTED_STORED_SYSTEM_MESSAGE, + }, + }, + { + '@timestamp': expect.any(String), + message: { + role: MessageRole.User, + content: 'How many alerts do I have?', + }, + }, + { + '@timestamp': expect.any(String), + message: { + role: MessageRole.Assistant, + content: 'Hello', + function_call: { + name: 'myFunction', + arguments: JSON.stringify({ foo: 'bar' }), + trigger: MessageRole.Assistant, + }, + }, + }, + ], + useSimulatedFunctionCalling: false, + }); + }); + + afterEach(async () => { + fnResponseResolve({ content: { my: 'content' } }); + + await waitForNextWrite(stream); + + await llmSimulator.complete(); + await finished(stream); + }); + }); + + describe('and the function succeeds', () => { + beforeEach(async () => { + fnResponseResolve({ content: { my: 'content' } }); + // await waitForNextWrite(stream); + }); + + it('appends the function response', () => { + expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + role: MessageRole.User, + name: 'myFunction', + content: JSON.stringify({ + my: 'content', + }), + }, + }, + }); + }); + + it('sends the function response back to the llm', () => { + expect(inferenceClientMock.chatComplete).toHaveBeenCalledTimes(2); + + expect(inferenceClientMock.chatComplete.mock.lastCall!).toEqual([ + { + connectorId: 'foo', + stream: true, + messages: expect.arrayContaining([ + { role: 'user', content: 'How many alerts do I have?' }, + ]), + functionCalling: 'native', + toolChoice: 'auto', + tools: expect.any(Object), + }, + ]); + }); + + describe('and the assistant replies without a function request', () => { + beforeEach(async () => { + await llmSimulator.chunk({ content: 'I am done here' }); + await llmSimulator.next({ content: 'I am done here' }); + await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); + await llmSimulator.complete(); + await waitForNextWrite(stream); + + await finished(stream); + }); + + it('appends the assistant reply', () => { + expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ + type: StreamingChatResponseEventType.ChatCompletionChunk, + id: expect.any(String), + message: { + content: 'I am done here', + }, + }); + expect(JSON.parse(dataHandler.mock.calls[6])).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + role: MessageRole.Assistant, + content: 'I am done here', + function_call: { + name: '', + arguments: '', + trigger: MessageRole.Assistant, + }, + }, + }, + }); + }); + + it('stores the conversation', () => { + expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ + type: StreamingChatResponseEventType.ConversationCreate, + conversation: { + id: expect.any(String), + last_updated: expect.any(String), + title: 'My predefined title', + token_count: { + completion: expect.any(Number), + prompt: expect.any(Number), + total: expect.any(Number), + }, + }, + }); + + expect(internalUserEsClientMock.index).toHaveBeenCalled(); + + expect( + (internalUserEsClientMock.index.mock.lastCall![0] as any).document.messages + ).toEqual([ + { + '@timestamp': expect.any(String), + message: { + content: EXPECTED_STORED_SYSTEM_MESSAGE, + role: MessageRole.System, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'How many alerts do I have?', + role: MessageRole.User, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'Hello', + role: MessageRole.Assistant, + function_call: { + name: 'myFunction', + arguments: JSON.stringify({ foo: 'bar' }), + trigger: MessageRole.Assistant, + }, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: JSON.stringify({ + my: 'content', + }), + name: 'myFunction', + role: MessageRole.User, + }, + }, + { + '@timestamp': expect.any(String), + message: { + content: 'I am done here', + role: MessageRole.Assistant, + function_call: { + name: '', + arguments: '', + trigger: MessageRole.Assistant, + }, + }, + }, + ]); + }); + }); + }); + + describe('and the function fails', () => { + beforeEach(async () => { + fnResponseReject(new Error('Function failed')); + await waitForNextWrite(stream); + }); + + it('appends the function response', () => { + const parsed = JSON.parse(dataHandler.mock.lastCall!); + + parsed.message.message.content = JSON.parse(parsed.message.message.content); + parsed.message.message.data = JSON.parse(parsed.message.message.data); + + expect(parsed).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + role: MessageRole.User, + name: 'myFunction', + content: { + message: 'Function failed', + error: { + name: 'Error', + message: 'Function failed', + }, + }, + data: { + stack: expect.any(String), + }, + }, + }, + }); + }); + + it('sends the function response back to the llm', () => { + expect(inferenceClientMock.chatComplete).toHaveBeenCalledTimes(2); + expect(inferenceClientMock.chatComplete.mock.lastCall!).toEqual([ + { + connectorId: 'foo', + stream: true, + messages: expect.arrayContaining([ + { role: 'user', content: 'How many alerts do I have?' }, + ]), + functionCalling: 'native', + toolChoice: 'auto', + tools: expect.any(Object), + }, + ]); + }); + }); + + describe('and the function responds with an observable', () => { + let response$: Subject<ChatCompletionChunkEvent | MessageAddEvent>; + beforeEach(async () => { + response$ = new Subject(); + fnResponseResolve(response$); + + await nextTick(); + + response$.next(createFunctionResponseMessage({ name: 'myFunction', content: {} })); + }); + + it('appends the function response', async () => { + expect(JSON.parse(dataHandler.mock.calls[3]!)).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + role: MessageRole.User, + name: 'myFunction', + content: '{}', + }, + }, + }); + }); + + describe('if the observable completes', () => { + beforeEach(async () => { + response$.next({ + type: StreamingChatResponseEventType.ChatCompletionChunk, + message: { + content: 'Hello', + }, + id: 'my-id', + }); + + response$.next({ + type: StreamingChatResponseEventType.MessageAdd, + message: { + '@timestamp': new Date().toString(), + message: { + role: MessageRole.Assistant, + content: 'Hello', + }, + }, + id: 'my-id', + }); + + response$.complete(); + + await finished(stream); + }); + + it('emits a completion chunk', () => { + expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ + type: StreamingChatResponseEventType.ChatCompletionChunk, + id: expect.any(String), + message: { + content: 'Hello', + }, + }); + }); + + it('appends the observable response', () => { + expect(JSON.parse(dataHandler.mock.calls[5])).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + role: MessageRole.Assistant, + content: 'Hello', + }, + }, + }); + }); + }); + + describe('if the observable errors out', () => { + beforeEach(async () => { + response$.next({ + type: StreamingChatResponseEventType.ChatCompletionChunk, + message: { + content: 'Hello', + }, + id: 'my-id', + }); + response$.error(new Error('Unexpected error')); + + await finished(stream); + }); + + it('appends an error', () => { + expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ + type: StreamingChatResponseEventType.ChatCompletionError, + error: { + message: 'Unexpected error', + stack: expect.any(String), + }, + }); + }); + }); + }); + }); + + describe('when context is available', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + beforeEach(async () => { + client = createClient(); + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + functionClientMock.hasFunction.mockReturnValue(true); + + functionClientMock.executeFunction.mockImplementationOnce(async (body) => { + return { + content: [ + { + id: 'my_document', + text: 'My document', + }, + ], + }; + }); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + persist: false, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await waitForNextWrite(stream); + + await llmSimulator.chunk({ content: 'Hello' }); + await llmSimulator.next({ content: 'Hello' }); + await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); + await llmSimulator.complete(); + + await finished(stream); + }); + + it('appends the context request message', () => { + expect(JSON.parse(dataHandler.mock.calls[0]!)).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: '', + role: MessageRole.Assistant, + function_call: { + name: CONTEXT_FUNCTION_NAME, + trigger: MessageRole.Assistant, + }, + }, + }, + }); + }); + + it('appends the context response', () => { + expect(JSON.parse(dataHandler.mock.calls[1]!)).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: JSON.stringify([{ id: 'my_document', text: 'My document' }]), + role: MessageRole.User, + name: CONTEXT_FUNCTION_NAME, + }, + }, + }); + }); + + it('appends the response from the LLM', () => { + expect(JSON.parse(dataHandler.mock.calls[2]!)).toEqual({ + type: StreamingChatResponseEventType.ChatCompletionChunk, + id: expect.any(String), + message: { + content: 'Hello', + }, + }); + + expect(JSON.parse(dataHandler.mock.calls[4]!)).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: 'Hello', + function_call: { + name: '', + arguments: '', + trigger: MessageRole.Assistant, + }, + role: MessageRole.Assistant, + }, + }, + }); + }); + }); + + describe('when the LLM keeps on calling a function and the limit has been exceeded', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + const maxFunctionCalls = 8; + + beforeEach(async () => { + client = createClient(); + + const onLlmCall = new EventEmitter(); + + function waitForNextLlmCall() { + return new Promise<void>((resolve) => onLlmCall.addListener('next', resolve)); + } + + inferenceClientMock.chatComplete.mockImplementation(() => { + return new Observable((subscriber) => { + onLlmCall.emit('next'); + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + functionClientMock.getFunctions.mockImplementation(() => [ + { + definition: { + name: 'get_top_alerts', + contexts: ['core'], + description: '', + }, + respond: async () => { + return { content: 'Call this function again' }; + }, + }, + ]); + + functionClientMock.hasFunction.mockImplementation((name) => name === 'get_top_alerts'); + functionClientMock.executeFunction.mockImplementation(async () => ({ + content: 'Call this function again', + })); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + title: 'My predefined title', + persist: true, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + async function requestAlertsFunctionCall() { + const body = inferenceClientMock.chatComplete.mock.lastCall![0]; + let nextLlmCallPromise: Promise<void>; + + if (Object.keys(body.tools ?? {}).length) { + nextLlmCallPromise = waitForNextLlmCall(); + await llmSimulator.chunk({ function_call: { name: 'get_top_alerts', arguments: '{}' } }); + } else { + nextLlmCallPromise = Promise.resolve(); + await llmSimulator.chunk({ content: 'Looks like we are done here' }); + } + + await llmSimulator.complete(); + await nextLlmCallPromise; + } + + await nextTick(); + + for (let i = 0; i <= maxFunctionCalls; i++) { + await requestAlertsFunctionCall(); + } + + await llmSimulator.complete(); + await finished(stream); + }); + + it(`executed the function no more than ${maxFunctionCalls} times`, () => { + expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(maxFunctionCalls); + }); + + it('asks the LLM to suggest next steps', () => { + const firstBody = inferenceClientMock.chatComplete.mock.calls[0][0] as any; + const body = inferenceClientMock.chatComplete.mock.lastCall![0] as any; + + expect(Object.keys(firstBody.tools ?? {}).length).toEqual(1); + + expect(body.tools).toEqual(undefined); + }); + }); + + describe('when context has not been injected since last user message', () => { + let dataHandler: jest.Mock; + + beforeEach(async () => { + client = createClient(); + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + functionClientMock.hasFunction.mockReturnValue(true); + functionClientMock.executeFunction.mockImplementationOnce(async () => { + return { + content: [ + { + id: 'my_document', + text: 'My document', + }, + ], + }; + }); + + const stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + persist: false, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await waitForNextWrite(stream); + + await llmSimulator.next({ + content: 'Hello', + }); + + await llmSimulator.complete(); + + await finished(stream); + }); + + it('executes the context function', async () => { + expect(functionClientMock.executeFunction).toHaveBeenCalledWith( + expect.objectContaining({ name: CONTEXT_FUNCTION_NAME }) + ); + }); + + it('appends the context request message', async () => { + expect(JSON.parse(dataHandler.mock.calls[0])).toEqual({ + type: StreamingChatResponseEventType.MessageAdd, + id: expect.any(String), + message: { + '@timestamp': expect.any(String), + message: { + content: '', + role: MessageRole.Assistant, + function_call: { + name: CONTEXT_FUNCTION_NAME, + trigger: MessageRole.Assistant, + }, + }, + }, + }); + }); + }); + + describe('when the function response exceeds the max no of tokens for one', () => { + let stream: Readable; + + let dataHandler: jest.Mock; + + beforeEach(async () => { + client = createClient(); + + let functionResponsePromiseResolve: Function | undefined; + + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + functionClientMock.getFunctions.mockImplementation(() => [ + { + definition: { + name: 'get_top_alerts', + contexts: ['core'], + description: '', + parameters: {}, + }, + respond: async () => { + return { content: '' }; + }, + }, + ]); + + functionClientMock.hasFunction.mockImplementation((name) => name === 'get_top_alerts'); + + functionClientMock.executeFunction.mockImplementation(() => { + return new Promise((resolve) => { + functionResponsePromiseResolve = resolve; + }); + }); + + stream = observableIntoStream( + await client.complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('How many alerts do I have?')], + functionClient: functionClientMock, + signal: new AbortController().signal, + title: 'My predefined title', + persist: true, + }) + ); + + dataHandler = jest.fn(); + + stream.on('data', dataHandler); + + await nextTick(); + + await llmSimulator.chunk({ function_call: { name: 'get_top_alerts' } }); + await llmSimulator.next({ content: 'done' }); + await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); + await llmSimulator.complete(); + + await waitFor(() => functionResponsePromiseResolve !== undefined); + + functionResponsePromiseResolve!({ + content: repeat('word ', 10000), + }); + + await waitFor(() => inferenceClientMock.chatComplete.mock.calls.length > 1); + + await llmSimulator.next({ content: 'Looks like this was truncated' }); + + await llmSimulator.complete(); + + await finished(stream); + }); + + it('truncates the message', () => { + const body = inferenceClientMock.chatComplete.mock.lastCall![0]; + const parsed = last(body.messages); + + expect(parsed).toEqual({ + name: 'get_top_alerts', + role: 'tool', + response: { + message: 'Function response exceeded the maximum length allowed and was truncated', + truncated: expect.any(String), + }, + toolCallId: expect.any(String), + }); + + expect((parsed as any).response.truncated.includes('word ')).toBe(true); + }); + }); + + it('Adds the default language to the system prompt', async () => { + client = createClient(); + const chatSpy = jest.spyOn(client, 'chat'); + + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + client + .complete({ + connectorId: 'foo', + messages: [system('This is a system message'), user('A user message to cause completion')], + functionClient: functionClientMock, + signal: new AbortController().signal, + title: 'My predefined title', + persist: false, + }) + .subscribe(() => {}); // To trigger call to chat + await nextTick(); + + expect(chatSpy.mock.calls[0][1].messages[0].message.content).toEqual( + EXPECTED_STORED_SYSTEM_MESSAGE + ); + }); + + describe('when executing an action', () => { + let completePromise: Promise<Message[]>; + + beforeEach(async () => { + client = createClient(); + + inferenceClientMock.chatComplete.mockImplementationOnce(() => { + return new Observable((subscriber) => { + llmSimulator = createLlmSimulator(subscriber); + }); + }); + + const complete$ = await client.complete({ + connectorId: 'foo', + messages: [ + system('This is a system message'), + user('Can you call the my_action function?'), + ], + functionClient: new ChatFunctionClient([ + { + actions: [ + { + name: 'my_action', + description: 'My action description', + parameters: { + type: 'object', + properties: { + foo: { + type: 'string', + }, + }, + required: ['foo'], + }, + }, + ], + }, + ]), + signal: new AbortController().signal, + title: 'My predefined title', + persist: false, + }); + + const messages: Message[] = []; + + completePromise = new Promise<Message[]>((resolve, reject) => { + complete$.subscribe({ + next: (event) => { + if (event.type === StreamingChatResponseEventType.MessageAdd) { + messages.push(event.message); + } + }, + complete: () => resolve(messages), + }); + }); + }); + + describe('and validation succeeds', () => { + beforeEach(async () => { + await llmSimulator.chunk({ + function_call: { name: 'my_action', arguments: JSON.stringify({ foo: 'bar' }) }, + }); + await llmSimulator.next({ content: 'content' }); + await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); + await llmSimulator.complete(); + }); + + it('completes the observable function request being the last event', async () => { + const messages = await completePromise; + expect(messages.length).toBe(1); + + expect(messages[0].message.function_call).toEqual({ + name: 'my_action', + arguments: JSON.stringify({ foo: 'bar' }), + trigger: MessageRole.Assistant, + }); + }); + }); + + describe.skip('and validation fails', () => { + beforeEach(async () => { + await llmSimulator.chunk({ + function_call: { name: 'my_action', arguments: JSON.stringify({ bar: 'foo' }) }, + }); + + await waitFor(() => + inferenceClientMock.chatComplete.mock.calls.length === 3 + ? Promise.resolve() + : llmSimulator.error(new Error('Waiting until execute is called again')) + ); + + await llmSimulator.next({ + content: 'Looks like the function call failed', + }); + await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); + + await llmSimulator.complete(); + }); + + it('appends a function response error and sends it back to the LLM', async () => { + const messages = await completePromise; + expect(messages.length).toBe(2); + + expect(messages[0].message.function_call?.name).toBe('my_action'); + + expect(messages[1].message.name).toBe('my_action'); + + expect(JSON.parse(messages[1].message.content ?? '{}')).toHaveProperty('error'); + + expect(messages[2].message.content).toBe('Looks like the function call failed'); + }); + }); + }); +}); diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts new file mode 100644 index 000000000000..8d1ee6138e54 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/index.ts @@ -0,0 +1,765 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { SearchHit } from '@elastic/elasticsearch/lib/api/types'; +import { notFound } from '@hapi/boom'; +import type { ActionsClient } from '@kbn/actions-plugin/server'; +import type { CoreSetup, ElasticsearchClient, IUiSettingsClient } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import type { PublicMethodsOf } from '@kbn/utility-types'; +import { context } from '@opentelemetry/api'; +import { last, merge, omit } from 'lodash'; +import { + catchError, + combineLatest, + defer, + filter, + forkJoin, + from, + map, + merge as mergeOperator, + Observable, + of, + shareReplay, + switchMap, + tap, + throwError, +} from 'rxjs'; +import { v4 } from 'uuid'; +import type { AssistantScope } from '@kbn/ai-assistant-common'; +import type { InferenceClient } from '@kbn/inference-plugin/server'; +import { ToolChoiceType } from '@kbn/inference-common'; + +import { resourceNames } from '..'; +import { + ChatCompletionChunkEvent, + ChatCompletionMessageEvent, + ChatCompletionErrorEvent, + ConversationCreateEvent, + ConversationUpdateEvent, + createConversationNotFoundError, + StreamingChatResponseEventType, + TokenCountEvent, + type StreamingChatResponseEvent, +} from '../../../common/conversation_complete'; +import { convertMessagesForInference } from '../../../common/convert_messages_for_inference'; +import { CompatibleJSONSchema } from '../../../common/functions/types'; +import { + type AdHocInstruction, + type Conversation, + type ConversationCreateRequest, + type ConversationUpdateRequest, + type KnowledgeBaseEntry, + type Message, + KnowledgeBaseType, + KnowledgeBaseEntryRole, + MessageRole, +} from '../../../common/types'; +import { withoutTokenCountEvents } from '../../../common/utils/without_token_count_events'; +import { CONTEXT_FUNCTION_NAME } from '../../functions/context'; +import type { ChatFunctionClient } from '../chat_function_client'; +import { KnowledgeBaseService, RecalledEntry } from '../knowledge_base_service'; +import { getAccessQuery } from '../util/get_access_query'; +import { getSystemMessageFromInstructions } from '../util/get_system_message_from_instructions'; +import { replaceSystemMessage } from '../util/replace_system_message'; +import { failOnNonExistingFunctionCall } from './operators/fail_on_non_existing_function_call'; +import { getContextFunctionRequestIfNeeded } from './get_context_function_request_if_needed'; +import { LangTracer } from './instrumentation/lang_tracer'; +import { continueConversation } from './operators/continue_conversation'; +import { convertInferenceEventsToStreamingEvents } from './operators/convert_inference_events_to_streaming_events'; +import { extractMessages } from './operators/extract_messages'; +import { extractTokenCount } from './operators/extract_token_count'; +import { getGeneratedTitle } from './operators/get_generated_title'; +import { instrumentAndCountTokens } from './operators/instrument_and_count_tokens'; +import { + runSemanticTextKnowledgeBaseMigration, + scheduleSemanticTextMigration, +} from '../task_manager_definitions/register_migrate_knowledge_base_entries_task'; +import { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; +import { ObservabilityAIAssistantConfig } from '../../config'; + +const MAX_FUNCTION_CALLS = 8; + +export class ObservabilityAIAssistantClient { + constructor( + private readonly dependencies: { + config: ObservabilityAIAssistantConfig; + core: CoreSetup<ObservabilityAIAssistantPluginStartDependencies>; + actionsClient: PublicMethodsOf<ActionsClient>; + uiSettingsClient: IUiSettingsClient; + namespace: string; + esClient: { + asInternalUser: ElasticsearchClient; + asCurrentUser: ElasticsearchClient; + }; + inferenceClient: InferenceClient; + logger: Logger; + user?: { + id?: string; + name: string; + }; + knowledgeBaseService: KnowledgeBaseService; + scopes: AssistantScope[]; + } + ) {} + + private getConversationWithMetaFields = async ( + conversationId: string + ): Promise<SearchHit<Conversation> | undefined> => { + const response = await this.dependencies.esClient.asInternalUser.search<Conversation>({ + index: resourceNames.aliases.conversations, + query: { + bool: { + filter: [ + ...getAccessQuery({ + user: this.dependencies.user, + namespace: this.dependencies.namespace, + }), + { term: { 'conversation.id': conversationId } }, + ], + }, + }, + size: 1, + terminate_after: 1, + }); + + return response.hits.hits[0]; + }; + + private getConversationUpdateValues = (lastUpdated: string) => { + return { + conversation: { + last_updated: lastUpdated, + }, + user: this.dependencies.user, + namespace: this.dependencies.namespace, + }; + }; + + get = async (conversationId: string): Promise<Conversation> => { + const conversation = await this.getConversationWithMetaFields(conversationId); + + if (!conversation) { + throw notFound(); + } + return conversation._source!; + }; + + delete = async (conversationId: string): Promise<void> => { + const conversation = await this.getConversationWithMetaFields(conversationId); + + if (!conversation) { + throw notFound(); + } + + await this.dependencies.esClient.asInternalUser.delete({ + id: conversation._id!, + index: conversation._index, + refresh: true, + }); + }; + + complete = ({ + functionClient, + connectorId, + simulateFunctionCalling = false, + instructions: adHocInstructions = [], + messages: initialMessages, + signal, + persist, + kibanaPublicUrl, + isPublic, + title: predefinedTitle, + conversationId: predefinedConversationId, + disableFunctions = false, + }: { + messages: Message[]; + connectorId: string; + signal: AbortSignal; + functionClient: ChatFunctionClient; + persist: boolean; + conversationId?: string; + title?: string; + isPublic?: boolean; + kibanaPublicUrl?: string; + instructions?: AdHocInstruction[]; + simulateFunctionCalling?: boolean; + disableFunctions?: + | boolean + | { + except: string[]; + }; + }): Observable<Exclude<StreamingChatResponseEvent, ChatCompletionErrorEvent>> => { + return new LangTracer(context.active()).startActiveSpan( + 'complete', + ({ tracer: completeTracer }) => { + const isConversationUpdate = persist && !!predefinedConversationId; + + const conversationId = persist ? predefinedConversationId || v4() : ''; + + if (persist && !isConversationUpdate && kibanaPublicUrl) { + adHocInstructions.push({ + instruction_type: 'application_instruction', + text: `This conversation will be persisted in Kibana and available at this url: ${ + kibanaPublicUrl + `/app/observabilityAIAssistant/conversations/${conversationId}` + }.`, + }); + } + + const userInstructions$ = from(this.getKnowledgeBaseUserInstructions()).pipe(shareReplay()); + + const registeredAdhocInstructions = functionClient.getAdhocInstructions(); + const allAdHocInstructions = adHocInstructions.concat(registeredAdhocInstructions); + + // from the initial messages, override any system message with + // the one that is based on the instructions (registered, request, kb) + const messagesWithUpdatedSystemMessage$ = userInstructions$.pipe( + map((userInstructions) => { + // this is what we eventually store in the conversation + const messagesWithUpdatedSystemMessage = replaceSystemMessage( + getSystemMessageFromInstructions({ + applicationInstructions: functionClient.getInstructions(), + userInstructions, + adHocInstructions: allAdHocInstructions, + availableFunctionNames: functionClient + .getFunctions() + .map((fn) => fn.definition.name), + }), + initialMessages + ); + + return messagesWithUpdatedSystemMessage; + }), + shareReplay() + ); + + // if it is: + // - a new conversation + // - no predefined title is given + // - we need to store the conversation + // we generate a title + // if not, we complete with an empty string + const title$ = + predefinedTitle || isConversationUpdate || !persist + ? of(predefinedTitle || '').pipe(shareReplay()) + : messagesWithUpdatedSystemMessage$.pipe( + switchMap((messages) => + getGeneratedTitle({ + messages, + logger: this.dependencies.logger, + chat: (name, chatParams) => { + return this.chat(name, { + ...chatParams, + simulateFunctionCalling, + connectorId, + signal, + }); + }, + tracer: completeTracer, + }) + ), + shareReplay() + ); + + // we continue the conversation here, after resolving both the materialized + // messages and the knowledge base instructions + const nextEvents$ = combineLatest([ + messagesWithUpdatedSystemMessage$, + userInstructions$, + ]).pipe( + switchMap(([messagesWithUpdatedSystemMessage, userInstructions]) => { + // if needed, inject a context function request here + const contextRequest = functionClient.hasFunction(CONTEXT_FUNCTION_NAME) + ? getContextFunctionRequestIfNeeded(messagesWithUpdatedSystemMessage) + : undefined; + + return mergeOperator( + // if we have added a context function request, also emit + // the messageAdd event for it, so we can notify the consumer + // and add it to the conversation + ...(contextRequest ? [of(contextRequest)] : []), + continueConversation({ + messages: [ + ...messagesWithUpdatedSystemMessage, + ...(contextRequest ? [contextRequest.message] : []), + ], + chat: (name, chatParams) => { + // inject a chat function with predefined parameters + return this.chat(name, { + ...chatParams, + signal, + simulateFunctionCalling, + connectorId, + }); + }, + // start out with the max number of function calls + functionCallsLeft: MAX_FUNCTION_CALLS, + functionClient, + userInstructions, + adHocInstructions, + signal, + logger: this.dependencies.logger, + disableFunctions, + tracer: completeTracer, + connectorId, + useSimulatedFunctionCalling: simulateFunctionCalling === true, + }) + ); + }), + shareReplay() + ); + + const output$ = mergeOperator( + // get all the events from continuing the conversation + nextEvents$, + // wait until all dependencies have completed + forkJoin([ + messagesWithUpdatedSystemMessage$, + // get just the new messages + nextEvents$.pipe(withoutTokenCountEvents(), extractMessages()), + // count all the token count events emitted during completion + mergeOperator( + nextEvents$, + title$.pipe(filter((value): value is TokenCountEvent => typeof value !== 'string')) + ).pipe(extractTokenCount()), + // get just the title, and drop the token count events + title$.pipe(filter((value): value is string => typeof value === 'string')), + ]).pipe( + switchMap( + ([messagesWithUpdatedSystemMessage, addedMessages, tokenCountResult, title]) => { + const initialMessagesWithAddedMessages = + messagesWithUpdatedSystemMessage.concat(addedMessages); + + const lastMessage = last(initialMessagesWithAddedMessages); + + // if a function request is at the very end, close the stream to consumer + // without persisting or updating the conversation. we need to wait + // on the function response to have a valid conversation + const isFunctionRequest = !!lastMessage?.message.function_call?.name; + + if (!persist || isFunctionRequest) { + return of(); + } + + if (isConversationUpdate) { + return from(this.getConversationWithMetaFields(conversationId)) + .pipe( + switchMap((conversation) => { + if (!conversation) { + return throwError(() => createConversationNotFoundError()); + } + + const persistedTokenCount = conversation._source?.conversation + .token_count ?? { + prompt: 0, + completion: 0, + total: 0, + }; + + return from( + this.update( + conversationId, + + merge( + {}, + + // base conversation without messages + omit(conversation._source, 'messages'), + + // update messages + { messages: initialMessagesWithAddedMessages }, + + // update token count + { + conversation: { + title: title || conversation._source?.conversation.title, + token_count: { + prompt: persistedTokenCount.prompt + tokenCountResult.prompt, + completion: + persistedTokenCount.completion + tokenCountResult.completion, + total: persistedTokenCount.total + tokenCountResult.total, + }, + }, + } + ) + ) + ); + }) + ) + .pipe( + map((conversation): ConversationUpdateEvent => { + return { + conversation: conversation.conversation, + type: StreamingChatResponseEventType.ConversationUpdate, + }; + }) + ); + } + + return from( + this.create({ + '@timestamp': new Date().toISOString(), + conversation: { + title, + id: conversationId, + token_count: tokenCountResult, + }, + public: !!isPublic, + labels: {}, + numeric_labels: {}, + messages: initialMessagesWithAddedMessages, + }) + ).pipe( + map((conversation): ConversationCreateEvent => { + return { + conversation: conversation.conversation, + type: StreamingChatResponseEventType.ConversationCreate, + }; + }) + ); + } + ) + ) + ); + + return output$.pipe( + instrumentAndCountTokens('complete'), + withoutTokenCountEvents(), + catchError((error) => { + this.dependencies.logger.error(error); + return throwError(() => error); + }), + tap((event) => { + if (this.dependencies.logger.isLevelEnabled('debug')) { + switch (event.type) { + case StreamingChatResponseEventType.MessageAdd: + this.dependencies.logger.debug( + () => `Added message: ${JSON.stringify(event.message)}` + ); + break; + + case StreamingChatResponseEventType.ConversationCreate: + this.dependencies.logger.debug( + () => `Created conversation: ${JSON.stringify(event.conversation)}` + ); + break; + + case StreamingChatResponseEventType.ConversationUpdate: + this.dependencies.logger.debug( + () => `Updated conversation: ${JSON.stringify(event.conversation)}` + ); + break; + } + } + }), + shareReplay() + ); + } + ); + }; + + chat = ( + name: string, + { + messages, + connectorId, + functions, + functionCall, + signal, + simulateFunctionCalling, + tracer, + }: { + messages: Message[]; + connectorId: string; + functions?: Array<{ name: string; description: string; parameters?: CompatibleJSONSchema }>; + functionCall?: string; + signal: AbortSignal; + simulateFunctionCalling?: boolean; + tracer: LangTracer; + } + ): Observable<ChatCompletionChunkEvent | TokenCountEvent | ChatCompletionMessageEvent> => { + let tools: Record<string, { description: string; schema: any }> | undefined; + let toolChoice: ToolChoiceType | { function: string } | undefined; + + if (functions?.length) { + tools = functions.reduce((acc, fn) => { + acc[fn.name] = { + description: fn.description, + schema: fn.parameters, + }; + return acc; + }, {} as Record<string, { description: string; schema: any }>); + + toolChoice = functionCall + ? { + function: functionCall, + } + : ToolChoiceType.auto; + } + + const chatComplete$ = defer(() => + this.dependencies.inferenceClient.chatComplete({ + connectorId, + stream: true, + messages: convertMessagesForInference( + messages.filter((message) => message.message.role !== MessageRole.System) + ), + functionCalling: simulateFunctionCalling ? 'simulated' : 'native', + toolChoice, + tools, + }) + ).pipe( + convertInferenceEventsToStreamingEvents(), + instrumentAndCountTokens(name), + failOnNonExistingFunctionCall({ functions }), + tap((event) => { + if ( + event.type === StreamingChatResponseEventType.ChatCompletionChunk && + this.dependencies.logger.isLevelEnabled('trace') + ) { + this.dependencies.logger.trace(`Received chunk: ${JSON.stringify(event.message)}`); + } + }), + shareReplay() + ); + + return chatComplete$; + }; + + find = async (options?: { query?: string }): Promise<{ conversations: Conversation[] }> => { + const response = await this.dependencies.esClient.asInternalUser.search<Conversation>({ + index: resourceNames.aliases.conversations, + allow_no_indices: true, + query: { + bool: { + filter: [ + ...getAccessQuery({ + user: this.dependencies.user, + namespace: this.dependencies.namespace, + }), + ], + }, + }, + sort: { + '@timestamp': 'desc', + }, + size: 100, + }); + + return { + conversations: response.hits.hits.map((hit) => hit._source!), + }; + }; + + update = async ( + conversationId: string, + conversation: ConversationUpdateRequest + ): Promise<Conversation> => { + const persistedConversation = await this.getConversationWithMetaFields(conversationId); + + if (!persistedConversation) { + throw notFound(); + } + + const updatedConversation: Conversation = merge( + {}, + conversation, + this.getConversationUpdateValues(new Date().toISOString()) + ); + + await this.dependencies.esClient.asInternalUser.update({ + id: persistedConversation._id!, + index: persistedConversation._index, + doc: updatedConversation, + refresh: true, + }); + + return updatedConversation; + }; + + setTitle = async ({ conversationId, title }: { conversationId: string; title: string }) => { + const document = await this.getConversationWithMetaFields(conversationId); + if (!document) { + throw notFound(); + } + + const conversation = await this.get(conversationId); + + if (!conversation) { + throw notFound(); + } + + const updatedConversation: Conversation = merge( + {}, + conversation, + { conversation: { title } }, + this.getConversationUpdateValues(new Date().toISOString()) + ); + + await this.dependencies.esClient.asInternalUser.update({ + id: document._id!, + index: document._index, + doc: { conversation: { title } }, + refresh: true, + }); + + return updatedConversation; + }; + + create = async (conversation: ConversationCreateRequest): Promise<Conversation> => { + const now = new Date().toISOString(); + + const createdConversation: Conversation = merge( + {}, + conversation, + { + '@timestamp': now, + conversation: { id: conversation.conversation.id || v4() }, + }, + this.getConversationUpdateValues(now) + ); + + await this.dependencies.esClient.asInternalUser.index({ + index: resourceNames.aliases.conversations, + document: createdConversation, + refresh: true, + }); + + return createdConversation; + }; + + recall = async ({ + queries, + categories, + limit, + }: { + queries: Array<{ text: string; boost?: number }>; + categories?: string[]; + limit?: { size?: number; tokenCount?: number }; + }): Promise<RecalledEntry[]> => { + return ( + this.dependencies.knowledgeBaseService?.recall({ + namespace: this.dependencies.namespace, + user: this.dependencies.user, + queries, + categories, + esClient: this.dependencies.esClient, + uiSettingsClient: this.dependencies.uiSettingsClient, + limit, + }) || [] + ); + }; + + getKnowledgeBaseStatus = () => { + return this.dependencies.knowledgeBaseService.getStatus(); + }; + + setupKnowledgeBase = async (modelId: string | undefined) => { + const { esClient, core, logger, knowledgeBaseService } = this.dependencies; + + // setup the knowledge base + const res = await knowledgeBaseService.setup(esClient, modelId); + + core + .getStartServices() + .then(([_, pluginsStart]) => { + logger.debug('Schedule semantic text migration task'); + return scheduleSemanticTextMigration(pluginsStart); + }) + .catch((error) => { + logger.error(`Failed to run semantic text migration task: ${error}`); + }); + + return res; + }; + + resetKnowledgeBase = () => { + const { esClient } = this.dependencies; + return this.dependencies.knowledgeBaseService.reset(esClient); + }; + + migrateKnowledgeBaseToSemanticText = () => { + return runSemanticTextKnowledgeBaseMigration({ + esClient: this.dependencies.esClient, + logger: this.dependencies.logger, + config: this.dependencies.config, + }); + }; + + addUserInstruction = async ({ + entry, + }: { + entry: Omit< + KnowledgeBaseEntry, + '@timestamp' | 'confidence' | 'is_correction' | 'type' | 'role' + >; + }): Promise<void> => { + // for now we want to limit the number of user instructions to 1 per user + // if a user instruction already exists for the user, we get the id and update it + this.dependencies.logger.debug('Adding user instruction entry'); + const existingId = await this.dependencies.knowledgeBaseService.getPersonalUserInstructionId({ + isPublic: entry.public, + namespace: this.dependencies.namespace, + user: this.dependencies.user, + }); + + if (existingId) { + entry.id = existingId; + this.dependencies.logger.debug(`Updating user instruction with id "${existingId}"`); + } + + return this.dependencies.knowledgeBaseService.addEntry({ + namespace: this.dependencies.namespace, + user: this.dependencies.user, + entry: { + ...entry, + confidence: 'high', + is_correction: false, + type: KnowledgeBaseType.UserInstruction, + labels: {}, + role: KnowledgeBaseEntryRole.UserEntry, + }, + }); + }; + + addKnowledgeBaseEntry = async ({ + entry, + }: { + entry: Omit<KnowledgeBaseEntry, '@timestamp' | 'type'>; + }): Promise<void> => { + return this.dependencies.knowledgeBaseService.addEntry({ + namespace: this.dependencies.namespace, + user: this.dependencies.user, + entry: { + ...entry, + type: KnowledgeBaseType.Contextual, + }, + }); + }; + + getKnowledgeBaseEntries = async ({ + query, + sortBy, + sortDirection, + }: { + query: string; + sortBy: string; + sortDirection: 'asc' | 'desc'; + }) => { + return this.dependencies.knowledgeBaseService.getEntries({ query, sortBy, sortDirection }); + }; + + deleteKnowledgeBaseEntry = async (id: string) => { + return this.dependencies.knowledgeBaseService.deleteEntry({ id }); + }; + + getKnowledgeBaseUserInstructions = async () => { + return this.dependencies.knowledgeBaseService.getUserInstructions( + this.dependencies.namespace, + this.dependencies.user + ); + }; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_span_attributes.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_span_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_span_attributes.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_span_attributes.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_tracer.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_tracer.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_tracer.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/get_langtrace_tracer.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/init_langtrace.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/init_langtrace.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/init_langtrace.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/init_langtrace.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/instrumentation/lang_tracer.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/catch_function_not_found_error.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/catch_function_not_found_error.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/catch_function_not_found_error.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/catch_function_not_found_error.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/continue_conversation.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/continue_conversation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/continue_conversation.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/continue_conversation.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/convert_inference_events_to_streaming_events.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/convert_inference_events_to_streaming_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/convert_inference_events_to_streaming_events.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/convert_inference_events_to_streaming_events.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/debug.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/debug.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/debug.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/debug.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/extract_messages.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/extract_messages.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/extract_messages.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/extract_messages.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/extract_token_count.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/extract_token_count.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/extract_token_count.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/extract_token_count.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/fail_on_non_existing_function_call.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/fail_on_non_existing_function_call.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/fail_on_non_existing_function_call.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/fail_on_non_existing_function_call.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/get_generated_title.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/hide_token_count_events.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/hide_token_count_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/hide_token_count_events.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/hide_token_count_events.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/instrument_and_count_tokens.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/instrument_and_count_tokens.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/operators/instrument_and_count_tokens.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/client/operators/instrument_and_count_tokens.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/conversation_component_template.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/conversation_component_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/conversation_component_template.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/conversation_component_template.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/index.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/inference_endpoint.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/kb_component_template.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/kb_component_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/kb_component_template.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/kb_component_template.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts new file mode 100644 index 000000000000..bb77dfc768d9 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts @@ -0,0 +1,447 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { serverUnavailable } from '@hapi/boom'; +import type { CoreSetup, ElasticsearchClient, IUiSettingsClient } from '@kbn/core/server'; +import type { Logger } from '@kbn/logging'; +import { orderBy } from 'lodash'; +import { encode } from 'gpt-tokenizer'; +import { resourceNames } from '..'; +import { + Instruction, + KnowledgeBaseEntry, + KnowledgeBaseEntryRole, + KnowledgeBaseType, +} from '../../../common/types'; +import { getAccessQuery } from '../util/get_access_query'; +import { getCategoryQuery } from '../util/get_category_query'; +import { + createInferenceEndpoint, + deleteInferenceEndpoint, + getElserModelStatus, + isInferenceEndpointMissingOrUnavailable, +} from '../inference_endpoint'; +import { recallFromSearchConnectors } from './recall_from_search_connectors'; +import { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; +import { ObservabilityAIAssistantConfig } from '../../config'; + +interface Dependencies { + core: CoreSetup<ObservabilityAIAssistantPluginStartDependencies>; + esClient: { + asInternalUser: ElasticsearchClient; + }; + logger: Logger; + config: ObservabilityAIAssistantConfig; +} + +export interface RecalledEntry { + id: string; + text: string; + score: number | null; + is_correction?: boolean; + labels?: Record<string, string>; +} + +function throwKnowledgeBaseNotReady(body: any) { + throw serverUnavailable(`Knowledge base is not ready yet`, body); +} + +export class KnowledgeBaseService { + constructor(private readonly dependencies: Dependencies) {} + + async setup( + esClient: { + asCurrentUser: ElasticsearchClient; + asInternalUser: ElasticsearchClient; + }, + modelId: string | undefined + ) { + await deleteInferenceEndpoint({ esClient }).catch((e) => {}); // ensure existing inference endpoint is deleted + return createInferenceEndpoint({ esClient, logger: this.dependencies.logger, modelId }); + } + + async reset(esClient: { asCurrentUser: ElasticsearchClient }) { + try { + await deleteInferenceEndpoint({ esClient }); + } catch (error) { + if (isInferenceEndpointMissingOrUnavailable(error)) { + return; + } + throw error; + } + } + + private async recallFromKnowledgeBase({ + queries, + categories, + namespace, + user, + }: { + queries: Array<{ text: string; boost?: number }>; + categories?: string[]; + namespace: string; + user?: { name: string }; + }): Promise<RecalledEntry[]> { + const response = await this.dependencies.esClient.asInternalUser.search< + Pick<KnowledgeBaseEntry, 'text' | 'is_correction' | 'labels' | 'title'> & { doc_id?: string } + >({ + index: [resourceNames.aliases.kb], + query: { + bool: { + should: queries.map(({ text, boost = 1 }) => ({ + semantic: { + field: 'semantic_text', + query: text, + boost, + }, + })), + filter: [ + ...getAccessQuery({ + user, + namespace, + }), + ...getCategoryQuery({ categories }), + + // exclude user instructions + { bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } } }, + ], + }, + }, + size: 20, + _source: { + includes: ['text', 'is_correction', 'labels', 'doc_id', 'title'], + }, + }); + + return response.hits.hits.map((hit) => ({ + text: hit._source?.text!, + is_correction: hit._source?.is_correction, + labels: hit._source?.labels, + title: hit._source?.title ?? hit._source?.doc_id, // use `doc_id` as fallback title for backwards compatibility + score: hit._score!, + id: hit._id!, + })); + } + + recall = async ({ + user, + queries, + categories, + namespace, + esClient, + uiSettingsClient, + limit = {}, + }: { + queries: Array<{ text: string; boost?: number }>; + categories?: string[]; + user?: { name: string }; + namespace: string; + esClient: { asCurrentUser: ElasticsearchClient; asInternalUser: ElasticsearchClient }; + uiSettingsClient: IUiSettingsClient; + limit?: { tokens?: number; size?: number }; + }): Promise<RecalledEntry[]> => { + if (!this.dependencies.config.enableKnowledgeBase) { + return []; + } + + this.dependencies.logger.debug( + () => `Recalling entries from KB for queries: "${JSON.stringify(queries)}"` + ); + + const [documentsFromKb, documentsFromConnectors] = await Promise.all([ + this.recallFromKnowledgeBase({ + user, + queries, + categories, + namespace, + }).catch((error) => { + if (isInferenceEndpointMissingOrUnavailable(error)) { + throwKnowledgeBaseNotReady(error.body); + } + throw error; + }), + recallFromSearchConnectors({ + esClient, + uiSettingsClient, + queries, + core: this.dependencies.core, + logger: this.dependencies.logger, + }).catch((error) => { + this.dependencies.logger.debug('Error getting data from search indices'); + this.dependencies.logger.debug(error); + return []; + }), + ]); + + this.dependencies.logger.debug( + `documentsFromKb: ${JSON.stringify(documentsFromKb.slice(0, 5), null, 2)}` + ); + this.dependencies.logger.debug( + `documentsFromConnectors: ${JSON.stringify(documentsFromConnectors.slice(0, 5), null, 2)}` + ); + + const sortedEntries = orderBy( + documentsFromKb.concat(documentsFromConnectors), + 'score', + 'desc' + ).slice(0, limit.size ?? 20); + + const maxTokens = limit.tokens ?? 4_000; + + let tokenCount = 0; + + const returnedEntries: RecalledEntry[] = []; + + for (const entry of sortedEntries) { + returnedEntries.push(entry); + tokenCount += encode(entry.text).length; + if (tokenCount >= maxTokens) { + break; + } + } + + const droppedEntries = sortedEntries.length - returnedEntries.length; + if (droppedEntries > 0) { + this.dependencies.logger.info(`Dropped ${droppedEntries} entries because of token limit`); + } + + return returnedEntries; + }; + + getUserInstructions = async ( + namespace: string, + user?: { name: string } + ): Promise<Array<Instruction & { public?: boolean }>> => { + if (!this.dependencies.config.enableKnowledgeBase) { + return []; + } + try { + const response = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ + index: resourceNames.aliases.kb, + query: { + bool: { + filter: [ + { + term: { + type: KnowledgeBaseType.UserInstruction, + }, + }, + ...getAccessQuery({ user, namespace }), + ], + }, + }, + size: 500, + _source: ['id', 'text', 'public'], + }); + + return response.hits.hits.map((hit) => ({ + id: hit._id!, + text: hit._source?.text ?? '', + public: hit._source?.public, + })); + } catch (error) { + this.dependencies.logger.error('Failed to load instructions from knowledge base'); + this.dependencies.logger.error(error); + return []; + } + }; + + getEntries = async ({ + query, + sortBy, + sortDirection, + }: { + query?: string; + sortBy?: string; + sortDirection?: 'asc' | 'desc'; + }): Promise<{ entries: KnowledgeBaseEntry[] }> => { + if (!this.dependencies.config.enableKnowledgeBase) { + return { entries: [] }; + } + try { + const response = await this.dependencies.esClient.asInternalUser.search< + KnowledgeBaseEntry & { doc_id?: string } + >({ + index: resourceNames.aliases.kb, + query: { + bool: { + filter: [ + // filter by search query + ...(query + ? [{ query_string: { query: `${query}*`, fields: ['doc_id', 'title'] } }] + : []), + { + // exclude user instructions + bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } }, + }, + ], + }, + }, + sort: + sortBy === 'title' + ? [ + { ['title.keyword']: { order: sortDirection } }, + { doc_id: { order: sortDirection } }, // sort by doc_id for backwards compatibility + ] + : [{ [String(sortBy)]: { order: sortDirection } }], + size: 500, + _source: { + includes: [ + 'title', + 'doc_id', + 'text', + 'is_correction', + 'labels', + 'confidence', + 'public', + '@timestamp', + 'role', + 'user.name', + 'type', + ], + }, + }); + + return { + entries: response.hits.hits.map((hit) => ({ + ...hit._source!, + title: hit._source!.title ?? hit._source!.doc_id, // use `doc_id` as fallback title for backwards compatibility + role: hit._source!.role ?? KnowledgeBaseEntryRole.UserEntry, + score: hit._score, + id: hit._id!, + })), + }; + } catch (error) { + if (isInferenceEndpointMissingOrUnavailable(error)) { + throwKnowledgeBaseNotReady(error.body); + } + throw error; + } + }; + + getPersonalUserInstructionId = async ({ + isPublic, + user, + namespace, + }: { + isPublic: boolean; + user?: { name: string; id?: string }; + namespace?: string; + }) => { + if (!this.dependencies.config.enableKnowledgeBase) { + return null; + } + const res = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ + index: resourceNames.aliases.kb, + query: { + bool: { + filter: [ + { term: { type: KnowledgeBaseType.UserInstruction } }, + { term: { public: isPublic } }, + ...getAccessQuery({ user, namespace }), + ], + }, + }, + size: 1, + _source: false, + }); + + return res.hits.hits[0]?._id; + }; + + getUuidFromDocId = async ({ + docId, + user, + namespace, + }: { + docId: string; + user?: { name: string; id?: string }; + namespace?: string; + }) => { + const query = { + bool: { + filter: [ + { term: { doc_id: docId } }, + + // exclude user instructions + { bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } } }, + + // restrict access to user's own entries + ...getAccessQuery({ user, namespace }), + ], + }, + }; + + const response = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ + size: 1, + index: resourceNames.aliases.kb, + query, + _source: false, + }); + + return response.hits.hits[0]?._id; + }; + + addEntry = async ({ + entry: { id, ...doc }, + user, + namespace, + }: { + entry: Omit<KnowledgeBaseEntry, '@timestamp'>; + user?: { name: string; id?: string }; + namespace?: string; + }): Promise<void> => { + if (!this.dependencies.config.enableKnowledgeBase) { + return; + } + + try { + await this.dependencies.esClient.asInternalUser.index({ + index: resourceNames.aliases.kb, + id, + document: { + '@timestamp': new Date().toISOString(), + ...doc, + ...(doc.text ? { semantic_text: doc.text } : {}), + user, + namespace, + }, + refresh: 'wait_for', + }); + } catch (error) { + if (isInferenceEndpointMissingOrUnavailable(error)) { + throwKnowledgeBaseNotReady(error.body); + } + throw error; + } + }; + + deleteEntry = async ({ id }: { id: string }): Promise<void> => { + try { + await this.dependencies.esClient.asInternalUser.delete({ + index: resourceNames.aliases.kb, + id, + refresh: 'wait_for', + }); + + return Promise.resolve(); + } catch (error) { + if (isInferenceEndpointMissingOrUnavailable(error)) { + throwKnowledgeBaseNotReady(error.body); + } + throw error; + } + }; + + getStatus = async () => { + return getElserModelStatus({ + esClient: this.dependencies.esClient, + logger: this.dependencies.logger, + config: this.dependencies.config, + }); + }; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/recall_from_search_connectors.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/setup_conversation_and_kb_index_assets.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/task_manager_definitions/register_migrate_knowledge_base_entries_task.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/types.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/types.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/catch_function_limit_exceeded_error.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/catch_function_limit_exceeded_error.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/catch_function_limit_exceeded_error.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/catch_function_limit_exceeded_error.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/create_server_side_function_response_error.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/create_server_side_function_response_error.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/create_server_side_function_response_error.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/create_server_side_function_response_error.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/flush_buffer.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/flush_buffer.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/flush_buffer.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/flush_buffer.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_access_query.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_access_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_access_query.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_access_query.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_category_query.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_category_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_category_query.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_category_query.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/get_system_message_from_instructions.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/observable_into_openai_stream.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/observable_into_openai_stream.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/observable_into_openai_stream.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/observable_into_openai_stream.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/observable_into_stream.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/observable_into_stream.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/observable_into_stream.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/observable_into_stream.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/replace_system_message.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/replace_system_message.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/replace_system_message.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/replace_system_message.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/stream_into_observable.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/with_assistant_span.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/with_assistant_span.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/service/util/with_assistant_span.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/service/util/with_assistant_span.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.ts new file mode 100644 index 000000000000..3ee66bfaed66 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/types.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; +import type { + PluginSetupContract as ActionsPluginSetup, + PluginStartContract as ActionsPluginStart, +} from '@kbn/actions-plugin/server'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { + DataViewsServerPluginSetup, + DataViewsServerPluginStart, +} from '@kbn/data-views-plugin/server'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; +import type { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/server'; +import type { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/server'; +import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; +import type { InferenceServerSetup, InferenceServerStart } from '@kbn/inference-plugin/server'; +import type { ObservabilityAIAssistantService } from './service'; + +export interface ObservabilityAIAssistantServerSetup { + /** + * Returns a Observability AI Assistant service instance + */ + service: ObservabilityAIAssistantService; +} + +export interface ObservabilityAIAssistantServerStart { + /** + * Returns a Observability AI Assistant service instance + */ + service: ObservabilityAIAssistantService; +} + +export interface ObservabilityAIAssistantPluginSetupDependencies { + actions: ActionsPluginSetup; + security: SecurityPluginSetup; + features: FeaturesPluginSetup; + taskManager: TaskManagerSetupContract; + dataViews: DataViewsServerPluginSetup; + licensing: LicensingPluginSetup; + cloud?: CloudSetup; + serverless?: ServerlessPluginSetup; + alerting: AlertingServerSetup; + inference: InferenceServerSetup; +} + +export interface ObservabilityAIAssistantPluginStartDependencies { + actions: ActionsPluginStart; + security: SecurityPluginStart; + features: FeaturesPluginStart; + taskManager: TaskManagerStartContract; + dataViews: DataViewsServerPluginStart; + licensing: LicensingPluginStart; + ruleRegistry: RuleRegistryPluginStartContract; + cloud?: CloudStart; + serverless?: ServerlessPluginStart; + alerting: AlertingServerStart; + inference: InferenceServerStart; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.test.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.test.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/parse_suggestion_scores.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/recall_and_score.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts rename to x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/server/utils/recall/score_suggestions.ts diff --git a/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json new file mode 100644 index 000000000000..db9c1cddae90 --- /dev/null +++ b/x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant/tsconfig.json @@ -0,0 +1,55 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../../typings/**/*", + "common/**/*", + "public/**/*", + "scripts/**/*", + "typings/**/*", + "public/**/*.json", + "server/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/logging", + "@kbn/kibana-utils-plugin", + "@kbn/core-analytics-browser", + "@kbn/core", + "@kbn/server-route-repository", + "@kbn/server-route-repository-client", + "@kbn/actions-plugin", + "@kbn/licensing-plugin", + "@kbn/std", + "@kbn/utility-types-jest", + "@kbn/kibana-react-plugin", + "@kbn/shared-ux-utility", + "@kbn/security-plugin", + "@kbn/config-schema", + "@kbn/utility-types", + "@kbn/data-views-plugin", + "@kbn/io-ts-utils", + "@kbn/rule-registry-plugin", + "@kbn/alerting-plugin", + "@kbn/spaces-plugin", + "@kbn/task-manager-plugin", + "@kbn/core-elasticsearch-server", + "@kbn/core-ui-settings-server", + "@kbn/apm-utils", + "@kbn/features-plugin", + "@kbn/cloud-plugin", + "@kbn/serverless", + "@kbn/core-elasticsearch-server", + "@kbn/core-ui-settings-server", + "@kbn/management-settings-ids", + "@kbn/ai-assistant-common", + "@kbn/inference-common", + "@kbn/inference-plugin", + "@kbn/core-lifecycle-server", + "@kbn/server-route-repository-utils", + "@kbn/inference-plugin" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/actions/server/saved_objects/mappings.ts b/x-pack/plugins/actions/server/saved_objects/mappings.ts index 70e3e7447a6a..856431198c73 100644 --- a/x-pack/plugins/actions/server/saved_objects/mappings.ts +++ b/x-pack/plugins/actions/server/saved_objects/mappings.ts @@ -40,6 +40,9 @@ export const actionMappings: SavedObjectsTypeMappingDefinition = { export const actionTaskParamsMappings: SavedObjectsTypeMappingDefinition = { dynamic: false, properties: { + apiKeyId: { + type: 'keyword', + }, // NO NEED TO BE INDEXED // actionId: { // type: 'keyword', diff --git a/x-pack/plugins/actions/server/saved_objects/model_versions/action_task_params_model_versions.ts b/x-pack/plugins/actions/server/saved_objects/model_versions/action_task_params_model_versions.ts index 570ebff743c1..ebd87cdcb091 100644 --- a/x-pack/plugins/actions/server/saved_objects/model_versions/action_task_params_model_versions.ts +++ b/x-pack/plugins/actions/server/saved_objects/model_versions/action_task_params_model_versions.ts @@ -6,13 +6,28 @@ */ import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -import { actionTaskParamsSchemaV1 } from '../schemas/action_task_params'; +import { actionTaskParamsSchemaV1, actionTaskParamsSchemaV2 } from '../schemas/action_task_params'; export const actionTaskParamsModelVersions: SavedObjectsModelVersionMap = { '1': { changes: [], schemas: { + forwardCompatibility: actionTaskParamsSchemaV1.extends({}, { unknowns: 'ignore' }), create: actionTaskParamsSchemaV1, }, }, + '2': { + changes: [ + { + type: 'mappings_addition', + addedMappings: { + apiKeyId: { type: 'keyword' }, + }, + }, + ], + schemas: { + forwardCompatibility: actionTaskParamsSchemaV2.extends({}, { unknowns: 'ignore' }), + create: actionTaskParamsSchemaV2, + }, + }, }; diff --git a/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/index.ts b/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/index.ts index 4ce0e679adf5..cd49049abdfb 100644 --- a/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/index.ts +++ b/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/index.ts @@ -6,3 +6,4 @@ */ export { actionTaskParamsSchema as actionTaskParamsSchemaV1 } from './v1'; +export { actionTaskParamsSchema as actionTaskParamsSchemaV2 } from './v2'; diff --git a/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/v2.ts b/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/v2.ts new file mode 100644 index 000000000000..b0fd0c3b9f3b --- /dev/null +++ b/x-pack/plugins/actions/server/saved_objects/schemas/action_task_params/v2.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. + */ + +import { schema } from '@kbn/config-schema'; +import { actionTaskParamsSchema as actionTaskParamsSchemaV1 } from './v1'; + +export const actionTaskParamsSchema = actionTaskParamsSchemaV1.extends({ + apiKeyId: schema.maybe(schema.string()), +}); diff --git a/x-pack/plugins/alerting/common/routes/backfill/apis/schedule/schemas/v1.ts b/x-pack/plugins/alerting/common/routes/backfill/apis/schedule/schemas/v1.ts index 527134a2b513..527de165db99 100644 --- a/x-pack/plugins/alerting/common/routes/backfill/apis/schedule/schemas/v1.ts +++ b/x-pack/plugins/alerting/common/routes/backfill/apis/schedule/schemas/v1.ts @@ -15,6 +15,7 @@ export const scheduleBodySchema = schema.arrayOf( rule_id: schema.string(), start: schema.string(), end: schema.maybe(schema.string()), + run_actions: schema.maybe(schema.boolean()), }, { validate({ start, end }) { diff --git a/x-pack/plugins/alerting/kibana.jsonc b/x-pack/plugins/alerting/kibana.jsonc index b99c0a26c901..097ed2e5b464 100644 --- a/x-pack/plugins/alerting/kibana.jsonc +++ b/x-pack/plugins/alerting/kibana.jsonc @@ -1,19 +1,14 @@ { "type": "plugin", "id": "@kbn/alerting-plugin", - "owner": [ - "@elastic/response-ops" - ], + "owner": ["@elastic/response-ops"], "group": "platform", "visibility": "shared", "plugin": { "id": "alerting", "browser": true, "server": true, - "configPath": [ - "xpack", - "alerting" - ], + "configPath": ["xpack", "alerting"], "requiredPlugins": [ "actions", "data", @@ -35,11 +30,9 @@ "usageCollection", "security", "monitoringCollection", - "spaces" + "spaces", + "serverless" ], - "extraPublicDirs": [ - "common", - "common/parse_duration" - ] + "extraPublicDirs": ["common", "common/parse_duration"] } } diff --git a/x-pack/plugins/alerting/public/application/maintenance_windows.tsx b/x-pack/plugins/alerting/public/application/maintenance_windows.tsx index 5f4b81bb716f..9ac8245cd828 100644 --- a/x-pack/plugins/alerting/public/application/maintenance_windows.tsx +++ b/x-pack/plugins/alerting/public/application/maintenance_windows.tsx @@ -78,12 +78,11 @@ export const renderApp = ({ kibanaVersion: string; }) => { const { element, history } = mountParams; - const { i18n, theme } = core; const queryClient = new QueryClient(); ReactDOM.render( - <KibanaRenderContextProvider i18n={i18n} theme={theme}> + <KibanaRenderContextProvider {...core}> <KibanaContextProvider services={{ ...core, diff --git a/x-pack/plugins/alerting/public/hooks/use_breadcrumbs.ts b/x-pack/plugins/alerting/public/hooks/use_breadcrumbs.ts index 45d849be4d60..d68e6f581678 100644 --- a/x-pack/plugins/alerting/public/hooks/use_breadcrumbs.ts +++ b/x-pack/plugins/alerting/public/hooks/use_breadcrumbs.ts @@ -72,19 +72,25 @@ export const useBreadcrumbs = (pageDeepLink: MaintenanceWindowDeepLinkIds) => { services: { chrome: { docTitle, setBreadcrumbs }, application: { navigateToUrl }, + serverless, }, } = useKibana(); + const setTitle = docTitle.change; const { getAppUrl } = useNavigation(MANAGEMENT_APP_ID); useEffect(() => { const breadcrumbs = [ - { - text: i18n.translate('xpack.alerting.breadcrumbs.stackManagementLinkText', { - defaultMessage: 'Stack Management', - }), - href: getAppUrl(), - }, + ...(!serverless + ? [ + { + text: i18n.translate('xpack.alerting.breadcrumbs.stackManagementLinkText', { + defaultMessage: 'Stack Management', + }), + href: getAppUrl(), + }, + ] + : []), ...(topLevelBreadcrumb[pageDeepLink] ? [ { @@ -98,11 +104,14 @@ export const useBreadcrumbs = (pageDeepLink: MaintenanceWindowDeepLinkIds) => { }, ]; - if (setBreadcrumbs) { + if (serverless?.setBreadcrumbs) { + serverless.setBreadcrumbs(breadcrumbs); + } else { setBreadcrumbs(addClickHandlers(breadcrumbs, navigateToUrl)); } + if (setTitle) { setTitle(getTitleFromBreadCrumbs(breadcrumbs)); } - }, [pageDeepLink, getAppUrl, navigateToUrl, setBreadcrumbs, setTitle]); + }, [pageDeepLink, getAppUrl, navigateToUrl, setBreadcrumbs, setTitle, serverless]); }; diff --git a/x-pack/plugins/alerting/public/plugin.ts b/x-pack/plugins/alerting/public/plugin.ts index 71bae6b28c94..66f93cfe124a 100644 --- a/x-pack/plugins/alerting/public/plugin.ts +++ b/x-pack/plugins/alerting/public/plugin.ts @@ -12,6 +12,7 @@ import { SpacesPluginStart } from '@kbn/spaces-plugin/public'; import { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; +import type { ServerlessPluginStart } from '@kbn/serverless/public'; import { AlertNavigationRegistry, AlertNavigationHandler } from './alert_navigation_registry'; import { loadRule, loadRuleType } from './services/rule_api'; @@ -68,6 +69,7 @@ export interface AlertingPluginStart { spaces: SpacesPluginStart; unifiedSearch: UnifiedSearchPublicPluginStart; data: DataPublicPluginStart; + serverless?: ServerlessPluginStart; } export interface AlertingUIConfig { 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 5b32cf507c81..ec78cb5ea9cd 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 @@ -102,6 +102,7 @@ const GetDataStreamResponse: IndicesGetDataStreamResponse = { template: 'ignored', next_generation_managed_by: 'Index Lifecycle Management', prefer_ilm: false, + rollover_on_write: false, }, ], }; diff --git a/x-pack/plugins/alerting/server/integration_tests/__snapshots__/serverless_upgrade_and_rollback_checks.test.ts.snap b/x-pack/plugins/alerting/server/integration_tests/__snapshots__/serverless_upgrade_and_rollback_checks.test.ts.snap index c283cc108768..0f5a4143a5c9 100644 --- a/x-pack/plugins/alerting/server/integration_tests/__snapshots__/serverless_upgrade_and_rollback_checks.test.ts.snap +++ b/x-pack/plugins/alerting/server/integration_tests/__snapshots__/serverless_upgrade_and_rollback_checks.test.ts.snap @@ -5737,7 +5737,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -6405,7 +6404,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -7136,7 +7134,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -7785,7 +7782,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -8489,7 +8485,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -9195,7 +9190,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, @@ -9901,7 +9895,6 @@ Object { "field_names": Object { "items": Object { "minLength": 1, - "pattern": "^(?! *$).+$", "type": "string", }, "minItems": 1, diff --git a/x-pack/plugins/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts b/x-pack/plugins/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts index 95f544be5c8e..91a8418a42a3 100644 --- a/x-pack/plugins/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts +++ b/x-pack/plugins/alerting/server/saved_objects/model_versions/ad_hoc_run_params_model_versions.ts @@ -6,7 +6,10 @@ */ import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -import { rawAdHocRunParamsSchemaV1 } from '../schemas/raw_ad_hoc_run_params'; +import { + rawAdHocRunParamsSchemaV1, + rawAdHocRunParamsSchemaV2, +} from '../schemas/raw_ad_hoc_run_params'; export const adHocRunParamsModelVersions: SavedObjectsModelVersionMap = { '1': { @@ -16,4 +19,11 @@ export const adHocRunParamsModelVersions: SavedObjectsModelVersionMap = { create: rawAdHocRunParamsSchemaV1, }, }, + '2': { + changes: [], + schemas: { + forwardCompatibility: rawAdHocRunParamsSchemaV2.extends({}, { unknowns: 'ignore' }), + create: rawAdHocRunParamsSchemaV2, + }, + }, }; diff --git a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/index.ts b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/index.ts index 977a13f3a7e4..17907c640583 100644 --- a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/index.ts +++ b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/index.ts @@ -6,3 +6,4 @@ */ export { rawAdHocRunParamsSchema as rawAdHocRunParamsSchemaV1 } from './v1'; +export { rawAdHocRunParamsSchema as rawAdHocRunParamsSchemaV2 } from './v2'; diff --git a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.ts new file mode 100644 index 000000000000..03c55b706231 --- /dev/null +++ b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/latest.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. + */ + +import { TypeOf } from '@kbn/config-schema'; +import { rawAdHocRunParamsSchema } from './v2'; + +export type RawAdHocRunParams = TypeOf<typeof rawAdHocRunParamsSchema>; diff --git a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v1.ts b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v1.ts index 8676c2c60691..597059949242 100644 --- a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v1.ts +++ b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v1.ts @@ -21,7 +21,7 @@ const rawAdHocRunSchedule = schema.object({ runAt: schema.string(), }); -const rawAdHocRunParamsRuleSchema = schema.object({ +export const rawAdHocRunParamsRuleSchema = schema.object({ name: schema.string(), tags: schema.arrayOf(schema.string()), alertTypeId: schema.string(), diff --git a/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v2.ts b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v2.ts new file mode 100644 index 000000000000..f8505d1f5f4b --- /dev/null +++ b/x-pack/plugins/alerting/server/saved_objects/schemas/raw_ad_hoc_run_params/v2.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 { schema } from '@kbn/config-schema'; +import { FilterStateStore } from '@kbn/es-query'; +import { + rawAdHocRunParamsSchema as rawAdHocRunParamsSchemaV1, + rawAdHocRunParamsRuleSchema as rawAdHocRunParamsRuleSchemaV1, +} from './v1'; + +const ISOWeekdaysSchema = schema.oneOf([ + schema.literal(1), + schema.literal(2), + schema.literal(3), + schema.literal(4), + schema.literal(5), + schema.literal(6), + schema.literal(7), +]); + +const rawRuleAlertsFilterSchema = schema.object({ + query: schema.maybe( + schema.object({ + kql: schema.string(), + filters: schema.arrayOf( + schema.object({ + query: schema.maybe(schema.recordOf(schema.string(), schema.any())), + meta: schema.object({ + alias: schema.maybe(schema.nullable(schema.string())), + disabled: schema.maybe(schema.boolean()), + negate: schema.maybe(schema.boolean()), + controlledBy: schema.maybe(schema.string()), + group: schema.maybe(schema.string()), + index: schema.maybe(schema.string()), + isMultiIndex: schema.maybe(schema.boolean()), + type: schema.maybe(schema.string()), + key: schema.maybe(schema.string()), + params: schema.maybe(schema.any()), + value: schema.maybe(schema.string()), + field: schema.maybe(schema.string()), + relation: schema.maybe(schema.oneOf([schema.literal('OR'), schema.literal('AND')])), + }), + $state: schema.maybe( + schema.object({ + store: schema.oneOf([ + schema.literal(FilterStateStore.APP_STATE), // change + schema.literal(FilterStateStore.GLOBAL_STATE), // change + ]), + }) + ), + }) + ), + dsl: schema.string(), // change + }) + ), + timeframe: schema.maybe( + schema.object({ + days: schema.arrayOf(ISOWeekdaysSchema), + hours: schema.object({ + start: schema.string(), + end: schema.string(), + }), + timezone: schema.string(), + }) + ), +}); + +const rawAdHocRunParamsRuleActionSchema = schema.object({ + uuid: schema.string(), + group: schema.maybe(schema.string()), + actionRef: schema.string(), + actionTypeId: schema.string(), + params: schema.recordOf(schema.string(), schema.any()), + frequency: schema.maybe( + schema.object({ + summary: schema.boolean(), + notifyWhen: schema.oneOf([ + schema.literal('onActionGroupChange'), + schema.literal('onActiveAlert'), + schema.literal('onThrottleInterval'), + ]), + throttle: schema.nullable(schema.string()), + }) + ), + alertsFilter: schema.maybe(rawRuleAlertsFilterSchema), + useAlertDataForTemplate: schema.maybe(schema.boolean()), +}); + +const rawAdHocRunParamsRuleSchema = rawAdHocRunParamsRuleSchemaV1.extends({ + actions: schema.maybe(schema.arrayOf(rawAdHocRunParamsRuleActionSchema)), +}); + +export const rawAdHocRunParamsSchema = rawAdHocRunParamsSchemaV1.extends({ + rule: rawAdHocRunParamsRuleSchema, +}); diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx index a21528fb970f..a01d35fec52d 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/embeddable/embeddable.tsx @@ -6,14 +6,7 @@ */ import { CoreStart } from '@kbn/core/public'; -import { - EmbeddableFactory, - EmbeddableFactoryNotFoundError, - EmbeddablePanel, - IEmbeddable, - isErrorEmbeddable, - ReactEmbeddableRenderer, -} from '@kbn/embeddable-plugin/public'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import React, { FC } from 'react'; import ReactDOM from 'react-dom'; @@ -31,15 +24,9 @@ import { EmbeddableExpression } from '../../expression_types/embeddable'; import { StartDeps } from '../../plugin'; import { embeddableInputToExpression } from './embeddable_input_to_expression'; import { useGetAppContext } from './use_get_app_context'; -import { embeddableService } from '../../../public/services/kibana_services'; const { embeddable: strings } = RendererStrings; -// registry of references to embeddables on the workpad -const embeddablesRegistry: { - [key: string]: IEmbeddable | Promise<IEmbeddable>; -} = {}; - const renderReactEmbeddable = ({ type, uuid, @@ -98,34 +85,10 @@ const renderReactEmbeddable = ({ ); }; -const renderEmbeddableFactory = (core: CoreStart, _plugins: StartDeps) => { - const EmbeddableRenderer: FC<{ embeddable: IEmbeddable }> = ({ embeddable }) => { - const getAppContext = useGetAppContext(core); - - embeddable.getAppContext = getAppContext; - - return <EmbeddablePanel embeddable={embeddable} />; - }; - - return (embeddableObject: IEmbeddable) => { - return ( - <KibanaRenderContextProvider {...core}> - <div - className={CANVAS_EMBEDDABLE_CLASSNAME} - style={{ width: '100%', height: '100%', cursor: 'auto' }} - > - <EmbeddableRenderer embeddable={embeddableObject} /> - </div> - </KibanaRenderContextProvider> - ); - }; -}; - export const embeddableRendererFactory = ( core: CoreStart, plugins: StartDeps ): RendererFactory<EmbeddableExpression<EmbeddableInput> & { canvasApi: CanvasContainerApi }> => { - const renderEmbeddable = renderEmbeddableFactory(core, plugins); return () => ({ name: 'embeddable', displayName: strings.getDisplayName(), @@ -133,112 +96,23 @@ export const embeddableRendererFactory = ( reuseDomNode: true, render: async (domNode, { input, embeddableType, canvasApi }, handlers) => { const uniqueId = handlers.getElementId(); - const isByValueEnabled = plugins.presentationUtil.labsService.isProjectEnabled( - 'labs:canvas:byValueEmbeddable' + ReactDOM.render( + renderReactEmbeddable({ + input, + handlers, + uuid: uniqueId, + type: embeddableType, + container: canvasApi, + core, + }), + domNode, + () => handlers.done() ); - if (embeddableService.reactEmbeddableRegistryHasKey(embeddableType)) { - /** - * Prioritize React embeddables - */ - ReactDOM.render( - renderReactEmbeddable({ - input, - handlers, - uuid: uniqueId, - type: embeddableType, - container: canvasApi, - core, - }), - domNode, - () => handlers.done() - ); - - handlers.onDestroy(() => { - handlers.onEmbeddableDestroyed(); - return ReactDOM.unmountComponentAtNode(domNode); - }); - } else if (!embeddablesRegistry[uniqueId]) { - /** - * Handle legacy embeddables - embeddable does not exist in registry - */ - const factory = Array.from(plugins.embeddable.getEmbeddableFactories()).find( - (embeddableFactory) => embeddableFactory.type === embeddableType - ) as EmbeddableFactory<EmbeddableInput>; - - if (!factory) { - handlers.done(); - throw new EmbeddableFactoryNotFoundError(embeddableType); - } - - const embeddableInput = { - ...input, - id: uniqueId, - executionContext: { - type: 'canvas', - }, - }; - - const embeddablePromise = input.savedObjectId - ? factory - .createFromSavedObject(input.savedObjectId, embeddableInput) - .then((embeddable) => { - // stores embeddable in registrey - embeddablesRegistry[uniqueId] = embeddable; - return embeddable; - }) - : factory.create(embeddableInput).then((embeddable) => { - if (!embeddable || isErrorEmbeddable(embeddable)) { - return; - } - // stores embeddable in registry - embeddablesRegistry[uniqueId] = embeddable as IEmbeddable; - return embeddable; - }); - embeddablesRegistry[uniqueId] = embeddablePromise as Promise<IEmbeddable>; - - const embeddableObject = (await (async () => embeddablePromise)()) as IEmbeddable; - - const palettes = await plugins.charts.palettes.getPalettes(); - - embeddablesRegistry[uniqueId] = embeddableObject; - ReactDOM.unmountComponentAtNode(domNode); - - const subscription = embeddableObject.getInput$().subscribe(function (updatedInput) { - const updatedExpression = embeddableInputToExpression( - updatedInput, - embeddableType, - palettes, - isByValueEnabled - ); - - if (updatedExpression) { - handlers.onEmbeddableInputChange(updatedExpression); - } - }); - - ReactDOM.render(renderEmbeddable(embeddableObject), domNode, () => handlers.done()); - - handlers.onDestroy(() => { - subscription.unsubscribe(); - handlers.onEmbeddableDestroyed(); - - delete embeddablesRegistry[uniqueId]; - - return ReactDOM.unmountComponentAtNode(domNode); - }); - } else { - /** - * Handle legacy embeddables - embeddable already exists in registry - */ - const embeddable = embeddablesRegistry[uniqueId]; - - // updating embeddable input with changes made to expression or filters - if ('updateInput' in embeddable) { - embeddable.updateInput(input); - embeddable.reload(); - } - } + handlers.onDestroy(() => { + handlers.onEmbeddableDestroyed(); + return ReactDOM.unmountComponentAtNode(domNode); + }); }, }); }; diff --git a/x-pack/plugins/cases/public/common/lib/kibana/services.ts b/x-pack/plugins/cases/public/common/lib/kibana/services.ts index 1d2149bae811..d10f8a83cd59 100644 --- a/x-pack/plugins/cases/public/common/lib/kibana/services.ts +++ b/x-pack/plugins/cases/public/common/lib/kibana/services.ts @@ -9,7 +9,7 @@ import type { CoreStart } from '@kbn/core/public'; import type { CasesUiConfigType } from '../../../../common/ui/types'; import type { CasesPublicStartDependencies } from '../../../types'; -type GlobalServices = Pick<CoreStart, 'application' | 'http' | 'theme'> & +type GlobalServices = Pick<CoreStart, 'application' | 'http' | 'theme' | 'userProfile'> & Pick<CasesPublicStartDependencies, 'serverless'>; export class KibanaServices { @@ -23,12 +23,12 @@ export class KibanaServices { http, serverless, kibanaVersion, - theme, + ...startServices }: GlobalServices & { kibanaVersion: string; config: CasesUiConfigType; }) { - this.services = { application, http, theme, serverless }; + this.services = { application, http, serverless, ...startServices }; this.kibanaVersion = kibanaVersion; this.config = config; } diff --git a/x-pack/plugins/cases/public/common/mock/test_providers.tsx b/x-pack/plugins/cases/public/common/mock/test_providers.tsx index 257ac4b1f829..2e96f1e3633c 100644 --- a/x-pack/plugins/cases/public/common/mock/test_providers.tsx +++ b/x-pack/plugins/cases/public/common/mock/test_providers.tsx @@ -99,7 +99,7 @@ const TestProvidersComponent: React.FC<TestProviderProps> = ({ }; return ( - <KibanaRenderContextProvider i18n={coreStart.i18n} theme={coreStart.theme}> + <KibanaRenderContextProvider {...coreStart}> <KibanaContextProvider services={services}> <MemoryRouter> <CasesProvider value={casesProviderValue} queryClient={queryClient}> @@ -178,7 +178,7 @@ export const createAppMockRenderer = ({ getFilesClient, }; const AppWrapper: React.FC<{ children: React.ReactNode }> = ({ children }) => ( - <KibanaRenderContextProvider i18n={coreStart.i18n} theme={coreStart.theme}> + <KibanaRenderContextProvider {...coreStart}> <KibanaContextProvider services={services}> <MemoryRouter> <CasesProvider value={casesProviderValue} queryClient={queryClient}> diff --git a/x-pack/plugins/cases/public/common/use_cases_toast.tsx b/x-pack/plugins/cases/public/common/use_cases_toast.tsx index 71a9e3add1ae..05c8e2f186a8 100644 --- a/x-pack/plugins/cases/public/common/use_cases_toast.tsx +++ b/x-pack/plugins/cases/public/common/use_cases_toast.tsx @@ -106,7 +106,7 @@ const getErrorMessage = (error: Error | ServerError): string => { export const useCasesToast = () => { const { appId } = useApplication(); - const { application, i18n, theme } = useKibana().services; + const { application, i18n, theme, userProfile } = useKibana().services; const { getUrlForApp, navigateToUrl } = application; const toasts = useToasts(); @@ -148,13 +148,13 @@ export const useCasesToast = () => { return toasts.addSuccess({ color: 'success', iconType: 'check', - title: toMountPoint(<TruncatedText text={renderTitle} />, { i18n, theme }), + title: toMountPoint(<TruncatedText text={renderTitle} />, { i18n, theme, userProfile }), text: toMountPoint( <CaseToastSuccessContent content={renderContent} onViewCaseClick={url != null ? onViewCaseClick : undefined} />, - { i18n, theme } + { i18n, theme, userProfile } ), }); }, @@ -177,7 +177,7 @@ export const useCasesToast = () => { }); }, }), - [i18n, theme, appId, getUrlForApp, navigateToUrl, toasts] + [i18n, theme, userProfile, appId, getUrlForApp, navigateToUrl, toasts] ); }; diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx index add06a7badb2..e5f931492dab 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/action_wrapper.tsx @@ -29,7 +29,7 @@ const ActionWrapperWithContext: React.FC<PropsWithChildren<Props>> = ({ casesActionContextProps, currentAppId, }) => { - const { application, i18n, theme } = useKibana().services; + const { application, ...startServices } = useKibana().services; const owner = getCaseOwnerByAppId(currentAppId); const casePermissions = canUseCases(application.capabilities)(owner ? [owner] : undefined); @@ -37,7 +37,7 @@ const ActionWrapperWithContext: React.FC<PropsWithChildren<Props>> = ({ const syncAlerts = owner === SECURITY_SOLUTION_OWNER; return ( - <KibanaRenderContextProvider i18n={i18n} theme={theme}> + <KibanaRenderContextProvider {...startServices}> <CasesProvider value={{ ...casesActionContextProps, diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx index e8fc0b6f1695..d701635cbbbe 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.test.tsx @@ -113,7 +113,7 @@ describe('openModal', () => { }); }); - it('should have correct onClose handler - when close modal clicked', () => { + it('should have correct onClose handler - when close modal clicked', async () => { openModal( getMockLensApi(), 'myAppId', @@ -121,12 +121,14 @@ describe('openModal', () => { getMockServices() ); - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose(); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + await waitFor(() => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose(); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); }); - it('should have correct onClose handler - when case selected', () => { + it('should have correct onClose handler - when case selected', async () => { openModal( getMockLensApi(), 'myAppId', @@ -134,12 +136,14 @@ describe('openModal', () => { getMockServices() ); - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose({ id: 'case-id', title: 'case-title' }); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + await waitFor(() => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose({ id: 'case-id', title: 'case-title' }); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); }); - it('should have correct onClose handler - when case created', () => { + it('should have correct onClose handler - when case created', async () => { openModal( getMockLensApi(), 'myAppId', @@ -147,12 +151,14 @@ describe('openModal', () => { getMockServices() ); - const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; - onClose(null, true); - expect(unmountComponentAtNode as jest.Mock).not.toHaveBeenCalled(); + await waitFor(() => { + const onClose = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onClose; + onClose(null, true); + expect(unmountComponentAtNode as jest.Mock).not.toHaveBeenCalled(); + }); }); - it('should have correct onSuccess handler', () => { + it('should have correct onSuccess handler', async () => { openModal( getMockLensApi(), 'myAppId', @@ -160,9 +166,11 @@ describe('openModal', () => { getMockServices() ); - const onSuccess = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onSuccess; - onSuccess(); - expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + await waitFor(() => { + const onSuccess = mockUseCasesAddToExistingCaseModal.mock.calls[0][0].onSuccess; + onSuccess(); + expect(unmountComponentAtNode as jest.Mock).toHaveBeenCalled(); + }); }); it('should open modal with an attachment with the time range in absolute values', async () => { diff --git a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx index c781098b44b5..13ccbd28333e 100644 --- a/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx +++ b/x-pack/plugins/cases/public/components/visualizations/actions/open_modal.tsx @@ -88,7 +88,7 @@ export function openModal( > <AddExistingCaseModalWrapper lensApi={lensApi} onClose={onClose} onSuccess={onSuccess} /> </ActionWrapper>, - { i18n: services.core.i18n, theme: services.core.theme } + services.core ); mount(targetDomElement); diff --git a/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts index 9ff212f3d477..d5064e3b311f 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/alerts/get_cases.ts @@ -10,10 +10,12 @@ import type { caseApiV1 } from '../../../../../common/types/api'; import { CASE_ALERTS_URL } from '../../../../../common/constants'; import { createCaseError } from '../../../../common/error'; import { createCasesRoute } from '../../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../../constants'; export const getCasesByAlertIdRoute = createCasesRoute({ method: 'get', path: CASE_ALERTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ alert_id: schema.string({ minLength: 1 }), diff --git a/x-pack/plugins/cases/server/routes/api/cases/categories/get_categories.ts b/x-pack/plugins/cases/server/routes/api/cases/categories/get_categories.ts index 3cf1550e10f8..c2c3c86faa6f 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/categories/get_categories.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/categories/get_categories.ts @@ -9,10 +9,12 @@ import { INTERNAL_GET_CASE_CATEGORIES_URL } from '../../../../../common/constant import { createCaseError } from '../../../../common/error'; import { createCasesRoute } from '../../create_cases_route'; import type { caseApiV1 } from '../../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../../constants'; export const getCategoriesRoute = createCasesRoute({ method: 'get', path: INTERNAL_GET_CASE_CATEGORIES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'internal', }, diff --git a/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts index 65016de1758a..f09e9abeb4cb 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/delete_cases.ts @@ -10,10 +10,12 @@ import { schema } from '@kbn/config-schema'; import { CASES_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const deleteCaseRoute = createCasesRoute({ method: 'delete', path: CASES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Delete cases`, diff --git a/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts index 3e9233361599..14b25ca92613 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/find_cases.ts @@ -9,10 +9,12 @@ import { CASES_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const findCaseRoute = createCasesRoute({ method: 'get', path: `${CASES_URL}/_find`, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Search cases`, diff --git a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts index 158360ff7b23..fa986660d99b 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/get_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/get_case.ts @@ -14,6 +14,7 @@ import { getWarningHeader, logDeprecatedEndpoint } from '../utils'; import { CASE_DETAILS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; const params = { params: schema.object({ @@ -31,6 +32,7 @@ export const getCaseRoute = ({ isServerless }: { isServerless?: boolean }) => createCasesRoute({ method: 'get', path: CASE_DETAILS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params, routerOptions: { access: 'public', diff --git a/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts b/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts index 1e0c1b398422..3f508214515c 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/patch_cases.ts @@ -10,10 +10,12 @@ import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseApiV1 } from '../../../../common/types/api'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const patchCaseRoute = createCasesRoute({ method: 'patch', path: CASES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: 'Update cases', diff --git a/x-pack/plugins/cases/server/routes/api/cases/post_case.ts b/x-pack/plugins/cases/server/routes/api/cases/post_case.ts index f9440e428af4..792e41017f24 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/post_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/post_case.ts @@ -10,10 +10,12 @@ import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseApiV1 } from '../../../../common/types/api'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const postCaseRoute = createCasesRoute({ method: 'post', path: CASES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Create a case`, diff --git a/x-pack/plugins/cases/server/routes/api/cases/push_case.ts b/x-pack/plugins/cases/server/routes/api/cases/push_case.ts index 4e46034c7d8f..609a4aed2c80 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/push_case.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/push_case.ts @@ -12,10 +12,12 @@ import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import { caseApiV1 } from '../../../../common/types/api'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const pushCaseRoute: CaseRoute = createCasesRoute({ method: 'post', path: CASE_PUSH_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Push a case to an external service`, diff --git a/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts b/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts index c196cc01e841..26555f6ce147 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/reporters/get_reporters.ts @@ -9,10 +9,12 @@ import { CASE_REPORTERS_URL } from '../../../../../common/constants'; import { createCaseError } from '../../../../common/error'; import { createCasesRoute } from '../../create_cases_route'; import type { caseApiV1 } from '../../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../../constants'; export const getReportersRoute = createCasesRoute({ method: 'get', path: CASE_REPORTERS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Get case creators`, diff --git a/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts b/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts index 11a9aa006e77..f2d1df584a42 100644 --- a/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts +++ b/x-pack/plugins/cases/server/routes/api/cases/tags/get_tags.ts @@ -9,10 +9,12 @@ import { CASE_TAGS_URL } from '../../../../../common/constants'; import { createCaseError } from '../../../../common/error'; import { createCasesRoute } from '../../create_cases_route'; import type { caseApiV1 } from '../../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../../constants'; export const getTagsRoute = createCasesRoute({ method: 'get', path: CASE_TAGS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Get case tags`, diff --git a/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts b/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts index 26c440021233..709fb024b64c 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/delete_all_comments.ts @@ -9,10 +9,12 @@ import { schema } from '@kbn/config-schema'; import { CASE_COMMENTS_URL } from '../../../../common/constants'; import { createCasesRoute } from '../create_cases_route'; import { createCaseError } from '../../../common/error'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const deleteAllCommentsRoute = createCasesRoute({ method: 'delete', path: CASE_COMMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: `Delete all case comments and alerts`, diff --git a/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts index 40fe590d8e2f..5f9400ef606a 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/delete_comment.ts @@ -10,10 +10,12 @@ import { schema } from '@kbn/config-schema'; import { CASE_COMMENT_DETAILS_URL } from '../../../../common/constants'; import { createCasesRoute } from '../create_cases_route'; import { createCaseError } from '../../../common/error'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const deleteCommentRoute = createCasesRoute({ method: 'delete', path: CASE_COMMENT_DETAILS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts b/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts index 933d0bb1b0fd..c2e208cc4495 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/find_comments.ts @@ -11,10 +11,12 @@ import type { attachmentApiV1 } from '../../../../common/types/api'; import { CASE_FIND_ATTACHMENTS_URL } from '../../../../common/constants'; import { createCasesRoute } from '../create_cases_route'; import { createCaseError } from '../../../common/error'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const findCommentsRoute = createCasesRoute({ method: 'get', path: CASE_FIND_ATTACHMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts b/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts index 988cee1f854d..d00a003a42a7 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_alerts.ts @@ -11,10 +11,12 @@ import type { alertApiV1 } from '../../../../common/types/api'; import { CASE_DETAILS_ALERTS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getAllAlertsAttachedToCaseRoute = createCasesRoute({ method: 'get', path: CASE_DETAILS_ALERTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string({ minLength: 1 }), diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts index f62a11caae77..59cbc1870f22 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_all_comment.ts @@ -12,6 +12,7 @@ import { CASE_COMMENTS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { attachmentDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; /** * @deprecated since version 8.1.0 @@ -26,6 +27,7 @@ export const getAllCommentsRoute = ({ createCasesRoute({ method: 'get', path: CASE_COMMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts index 6a1a56b4d635..a45c93a1c082 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/get_comment.ts @@ -11,10 +11,12 @@ import { CASE_COMMENT_DETAILS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { attachmentDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCommentRoute = createCasesRoute({ method: 'get', path: CASE_COMMENT_DETAILS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts index ce00c566321d..3a619a1f767c 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/patch_comment.ts @@ -12,10 +12,12 @@ import { CASE_COMMENTS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const patchCommentRoute = createCasesRoute({ method: 'patch', path: CASE_COMMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts b/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts index a44c93f9a787..31baa7b7daf0 100644 --- a/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts +++ b/x-pack/plugins/cases/server/routes/api/comments/post_comment.ts @@ -11,10 +11,12 @@ import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseDomainV1 } from '../../../../common/types/domain'; import type { attachmentApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const postCommentRoute = createCasesRoute({ method: 'post', path: CASE_COMMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts index 881fc71833a6..3af1ecc44eb1 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_configure.ts @@ -9,10 +9,12 @@ import { CASE_CONFIGURE_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { configureApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCaseConfigureRoute = createCasesRoute({ method: 'get', path: CASE_CONFIGURE_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: 'Get case settings', diff --git a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts index a11af001480e..41484a60a4f5 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/get_connectors.ts @@ -5,7 +5,10 @@ * 2.0. */ -import { CASE_CONFIGURE_CONNECTORS_URL } from '../../../../common/constants'; +import { + CASE_CONFIGURE_CONNECTORS_URL, + GET_CONNECTORS_CONFIGURE_API_TAG, +} from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; @@ -15,8 +18,13 @@ import { createCasesRoute } from '../create_cases_route'; export const getConnectorsRoute = createCasesRoute({ method: 'get', path: `${CASE_CONFIGURE_CONNECTORS_URL}/_find`, + security: { + authz: { + requiredPrivileges: [GET_CONNECTORS_CONFIGURE_API_TAG], + }, + }, routerOptions: { - tags: ['access:casesGetConnectorsConfigure', 'oas-tag:cases'], + tags: ['oas-tag:cases'], access: 'public', summary: 'Get case connectors', description: 'Retrieves information about connectors that are supported for use in cases.', diff --git a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts index 9deb650fa91e..f5f5fd5fbe59 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/patch_configure.ts @@ -11,10 +11,12 @@ import { CASE_CONFIGURE_DETAILS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { configureApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const patchCaseConfigureRoute = createCasesRoute({ method: 'patch', path: CASE_CONFIGURE_DETAILS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: 'Update case settings', diff --git a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts index fa42207ac211..32ecc4899ff6 100644 --- a/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts +++ b/x-pack/plugins/cases/server/routes/api/configure/post_configure.ts @@ -11,10 +11,12 @@ import { CASE_CONFIGURE_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { configureApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const postCaseConfigureRoute = createCasesRoute({ method: 'post', path: CASE_CONFIGURE_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'public', summary: 'Add case settings', diff --git a/x-pack/plugins/cases/server/routes/api/constants.ts b/x-pack/plugins/cases/server/routes/api/constants.ts new file mode 100644 index 000000000000..d8b425bad9ed --- /dev/null +++ b/x-pack/plugins/cases/server/routes/api/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. + */ + +import type { RouteSecurity } from '@kbn/core-http-server'; + +/** + * This constant is used as the default value for the security object in routes + * where a reason for opting out needs to be provided. + */ +export const DEFAULT_CASES_ROUTE_SECURITY: RouteSecurity = { + authz: { + enabled: false, + reason: + "This route is opted out from authorization because cases uses it's own authorization model inside the cases client.", + }, +}; diff --git a/x-pack/plugins/cases/server/routes/api/files/post_file.ts b/x-pack/plugins/cases/server/routes/api/files/post_file.ts index 2d7b5b6318a4..4b29ff69a157 100644 --- a/x-pack/plugins/cases/server/routes/api/files/post_file.ts +++ b/x-pack/plugins/cases/server/routes/api/files/post_file.ts @@ -20,10 +20,12 @@ import { CASE_FILES_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const postFileRoute = createCasesRoute({ method: 'post', path: CASE_FILES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/index.ts b/x-pack/plugins/cases/server/routes/api/index.ts index 31eafe0f29d2..0f316a9b6ca9 100644 --- a/x-pack/plugins/cases/server/routes/api/index.ts +++ b/x-pack/plugins/cases/server/routes/api/index.ts @@ -9,6 +9,7 @@ * Default page number when interacting with the saved objects API. */ export const DEFAULT_PAGE = 1; + /** * Default number of results when interacting with the saved objects API. */ diff --git a/x-pack/plugins/cases/server/routes/api/internal/bulk_create_attachments.ts b/x-pack/plugins/cases/server/routes/api/internal/bulk_create_attachments.ts index 18ae3d1cf74e..d585eee08016 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/bulk_create_attachments.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/bulk_create_attachments.ts @@ -12,10 +12,12 @@ import { createCasesRoute } from '../create_cases_route'; import { escapeHatch } from '../utils'; import type { attachmentApiV1 } from '../../../../common/types/api'; import type { caseDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const bulkCreateAttachmentsRoute = createCasesRoute({ method: 'post', path: INTERNAL_BULK_CREATE_ATTACHMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/bulk_delete_file_attachments.ts b/x-pack/plugins/cases/server/routes/api/internal/bulk_delete_file_attachments.ts index 3e92c11766cd..6ff2ef9848cd 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/bulk_delete_file_attachments.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/bulk_delete_file_attachments.ts @@ -14,10 +14,12 @@ import { createCaseError } from '../../../common/error'; import { escapeHatch } from '../utils'; import type { attachmentApiV1 } from '../../../../common/types/api'; import { BulkDeleteFileAttachmentsRequestRt } from '../../../../common/types/api/attachment/v1'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const bulkDeleteFileAttachments = createCasesRoute({ method: 'post', path: INTERNAL_DELETE_FILE_ATTACHMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/bulk_get_attachments.ts b/x-pack/plugins/cases/server/routes/api/internal/bulk_get_attachments.ts index f1e42a3cc877..d132b80ae0d2 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/bulk_get_attachments.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/bulk_get_attachments.ts @@ -14,10 +14,12 @@ import { INTERNAL_BULK_GET_ATTACHMENTS_URL } from '../../../../common/constants' import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import { escapeHatch } from '../utils'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const bulkGetAttachmentsRoute = createCasesRoute({ method: 'post', path: INTERNAL_BULK_GET_ATTACHMENTS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/bulk_get_cases.ts b/x-pack/plugins/cases/server/routes/api/internal/bulk_get_cases.ts index 1ea9ae8a2977..e5b6e78b4e45 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/bulk_get_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/bulk_get_cases.ts @@ -10,10 +10,12 @@ import { INTERNAL_BULK_GET_CASES_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import { escapeHatch } from '../utils'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const bulkGetCasesRoute = createCasesRoute({ method: 'post', path: INTERNAL_BULK_GET_CASES_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { body: escapeHatch, }, diff --git a/x-pack/plugins/cases/server/routes/api/internal/get_case_metrics.ts b/x-pack/plugins/cases/server/routes/api/internal/get_case_metrics.ts index 61215828be0b..c23763fb77b2 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/get_case_metrics.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/get_case_metrics.ts @@ -12,10 +12,12 @@ import type { metricsApiV1 } from '../../../../common/types/api'; import { INTERNAL_CASE_METRICS_DETAILS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCaseMetricRoute = createCasesRoute({ method: 'get', path: INTERNAL_CASE_METRICS_DETAILS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string({ minLength: 1 }), diff --git a/x-pack/plugins/cases/server/routes/api/internal/get_case_user_actions_stats.ts b/x-pack/plugins/cases/server/routes/api/internal/get_case_user_actions_stats.ts index 07393c9f1880..ca975d87ba13 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/get_case_user_actions_stats.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/get_case_user_actions_stats.ts @@ -9,10 +9,12 @@ import type { userActionApiV1 } from '../../../../common/types/api'; import { INTERNAL_GET_CASE_USER_ACTIONS_STATS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCaseUserActionStatsRoute = createCasesRoute({ method: 'get', path: INTERNAL_GET_CASE_USER_ACTIONS_STATS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/get_case_users.ts b/x-pack/plugins/cases/server/routes/api/internal/get_case_users.ts index eec44b5c9260..f081d792a772 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/get_case_users.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/get_case_users.ts @@ -10,10 +10,12 @@ import { INTERNAL_CASE_USERS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { userApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCaseUsersRoute = createCasesRoute({ method: 'get', path: INTERNAL_CASE_USERS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/get_cases_metrics.ts b/x-pack/plugins/cases/server/routes/api/internal/get_cases_metrics.ts index 68a9489323aa..33432f59847c 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/get_cases_metrics.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/get_cases_metrics.ts @@ -12,10 +12,12 @@ import type { metricsApiV1 } from '../../../../common/types/api'; import { INTERNAL_CASE_METRICS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getCasesMetricRoute = createCasesRoute({ method: 'get', path: INTERNAL_CASE_METRICS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'internal', }, diff --git a/x-pack/plugins/cases/server/routes/api/internal/get_connectors.ts b/x-pack/plugins/cases/server/routes/api/internal/get_connectors.ts index a88d6ee9b5c1..b725c606384b 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/get_connectors.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/get_connectors.ts @@ -10,10 +10,12 @@ import { INTERNAL_CONNECTORS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { connectorApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const getConnectorsRoute = createCasesRoute({ method: 'get', path: INTERNAL_CONNECTORS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/replace_custom_field.ts b/x-pack/plugins/cases/server/routes/api/internal/replace_custom_field.ts index 4e60982f02c5..dff69fa771c5 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/replace_custom_field.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/replace_custom_field.ts @@ -11,10 +11,12 @@ import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { customFieldsApiV1 } from '../../../../common/types/api'; import type { customFieldDomainV1 } from '../../../../common/types/domain'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const replaceCustomFieldRoute = createCasesRoute({ method: 'put', path: INTERNAL_PUT_CUSTOM_FIELDS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/internal/search_cases.ts b/x-pack/plugins/cases/server/routes/api/internal/search_cases.ts index c7881868a4b2..53bb7ddf64e2 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/search_cases.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/search_cases.ts @@ -10,10 +10,12 @@ import { CASES_INTERNAL_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { caseApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const searchCasesRoute = createCasesRoute({ method: 'post', path: `${CASES_INTERNAL_URL}/_search`, + security: DEFAULT_CASES_ROUTE_SECURITY, routerOptions: { access: 'internal', }, diff --git a/x-pack/plugins/cases/server/routes/api/internal/suggest_user_profiles.ts b/x-pack/plugins/cases/server/routes/api/internal/suggest_user_profiles.ts index 79a3b4588d6a..36e533274de3 100644 --- a/x-pack/plugins/cases/server/routes/api/internal/suggest_user_profiles.ts +++ b/x-pack/plugins/cases/server/routes/api/internal/suggest_user_profiles.ts @@ -7,7 +7,10 @@ import type { KibanaRequest } from '@kbn/core-http-server'; import type { UserProfileService } from '../../../services'; -import { INTERNAL_SUGGEST_USER_PROFILES_URL } from '../../../../common/constants'; +import { + INTERNAL_SUGGEST_USER_PROFILES_URL, + SUGGEST_USER_PROFILES_API_TAG, +} from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import { escapeHatch } from '../utils'; @@ -17,8 +20,12 @@ export const suggestUserProfilesRoute = (userProfileService: UserProfileService) createCasesRoute({ method: 'post', path: INTERNAL_SUGGEST_USER_PROFILES_URL, + security: { + authz: { + requiredPrivileges: [SUGGEST_USER_PROFILES_API_TAG], + }, + }, routerOptions: { - tags: ['access:casesSuggestUserProfiles'], access: 'internal', }, params: { diff --git a/x-pack/plugins/cases/server/routes/api/register_routes.ts b/x-pack/plugins/cases/server/routes/api/register_routes.ts index 4a02e43fdae6..3202891e1867 100644 --- a/x-pack/plugins/cases/server/routes/api/register_routes.ts +++ b/x-pack/plugins/cases/server/routes/api/register_routes.ts @@ -74,7 +74,7 @@ export const registerRoutes = (deps: RegisterRoutesDeps) => { const { router, routes, logger, kibanaVersion, telemetryUsageCounter } = deps; routes.forEach((route) => { - const { method, path, params, options, routerOptions, handler } = route; + const { method, path, params, options, routerOptions, handler, security } = route; (router[method] as RouteRegistrar<typeof method, CasesRequestHandlerContext>)( { @@ -85,6 +85,7 @@ export const registerRoutes = (deps: RegisterRoutesDeps) => { query: params?.query ?? escapeHatch, body: params?.body ?? schema.nullable(escapeHatch), }, + security, }, async (context, request, response) => { let responseHeaders = {}; diff --git a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts index da8eb5750713..2d4fe5a1ca01 100644 --- a/x-pack/plugins/cases/server/routes/api/stats/get_status.ts +++ b/x-pack/plugins/cases/server/routes/api/stats/get_status.ts @@ -12,6 +12,7 @@ import { CASE_STATUS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; import type { statsApiV1 } from '../../../../common/types/api'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; /** * @deprecated since version 8.1.0 @@ -26,6 +27,7 @@ export const getStatusRoute = ({ createCasesRoute({ method: 'get', path: CASE_STATUS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, options: { deprecated: true }, routerOptions: { access: isServerless ? 'internal' : 'public', diff --git a/x-pack/plugins/cases/server/routes/api/types.ts b/x-pack/plugins/cases/server/routes/api/types.ts index 93d11980ca65..4c15da16490e 100644 --- a/x-pack/plugins/cases/server/routes/api/types.ts +++ b/x-pack/plugins/cases/server/routes/api/types.ts @@ -14,6 +14,7 @@ import type { RouteValidatorConfig, RouteConfigOptions, RouteMethod, + RouteSecurity, } from '@kbn/core/server'; import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; @@ -55,4 +56,9 @@ export interface CaseRoute<P = unknown, Q = unknown, B = unknown> { */ routerOptions?: RouteConfigOptions<RouteMethod>; handler: (args: CaseRouteHandlerArguments<P, Q, B>) => Promise<IKibanaResponse>; + /** + * Defines the security requirements for a route, including authorization and authentication. + * By default cases does not use this. + */ + security?: RouteSecurity; } diff --git a/x-pack/plugins/cases/server/routes/api/user_actions/find_user_actions.ts b/x-pack/plugins/cases/server/routes/api/user_actions/find_user_actions.ts index 3002a4c67305..5458e3ff4aac 100644 --- a/x-pack/plugins/cases/server/routes/api/user_actions/find_user_actions.ts +++ b/x-pack/plugins/cases/server/routes/api/user_actions/find_user_actions.ts @@ -11,10 +11,12 @@ import type { userActionApiV1 } from '../../../../common/types/api'; import { CASE_FIND_USER_ACTIONS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; export const findUserActionsRoute = createCasesRoute({ method: 'get', path: CASE_FIND_USER_ACTIONS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), diff --git a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts index c926a608868e..427d5ffc18ee 100644 --- a/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts +++ b/x-pack/plugins/cases/server/routes/api/user_actions/get_all_user_actions.ts @@ -12,6 +12,7 @@ import type { userActionApiV1 } from '../../../../common/types/api'; import { CASE_USER_ACTIONS_URL } from '../../../../common/constants'; import { createCaseError } from '../../../common/error'; import { createCasesRoute } from '../create_cases_route'; +import { DEFAULT_CASES_ROUTE_SECURITY } from '../constants'; /** * @deprecated since version 8.1.0 @@ -26,6 +27,7 @@ export const getUserActionsRoute = ({ createCasesRoute({ method: 'get', path: CASE_USER_ACTIONS_URL, + security: DEFAULT_CASES_ROUTE_SECURITY, params: { params: schema.object({ case_id: schema.string(), 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 1c782973dd0e..9511d11aa4f7 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 @@ -286,7 +286,7 @@ export const ControlGeneralViewResponse = ({ <b>{i18n.actions}: </b> {response.actions?.map((action, i) => ( <span key={action}> - <b style={{ color: action === 'block' ? colors.danger : colors.ink }}> + <b css={{ color: action === 'block' ? colors.danger : colors.ink }}> {action[0].toUpperCase() + action.slice(1)} </b> {i !== (response.actions?.length || 0) - 1 && ', '} diff --git a/x-pack/plugins/cloud_defend/public/pages/policies/index.tsx b/x-pack/plugins/cloud_defend/public/pages/policies/index.tsx index c732be5421a1..d9890830ffcd 100644 --- a/x-pack/plugins/cloud_defend/public/pages/policies/index.tsx +++ b/x-pack/plugins/cloud_defend/public/pages/policies/index.tsx @@ -87,7 +87,7 @@ const TotalIntegrationsCount = ({ pageCount, totalCount, }: Record<'pageCount' | 'totalCount', number>) => ( - <EuiText size="xs" style={{ marginLeft: 8 }}> + <EuiText size="xs" css={{ marginLeft: 8 }}> <EuiTextColor color="subdued"> <FormattedMessage id="xpack.cloudDefend.policies.totalIntegrationsCountMessage" @@ -108,7 +108,7 @@ const SearchField = ({ return ( <EuiFlexGroup> - <EuiFlexItem grow={true} style={{ alignItems: 'flex-end' }}> + <EuiFlexItem grow={true} css={{ alignItems: 'flex-end' }}> <EuiFieldSearch fullWidth onSearch={setLocalValue} diff --git a/x-pack/plugins/cloud_defend/public/plugin.tsx b/x-pack/plugins/cloud_defend/public/plugin.tsx index 106ad3e47de7..43224794cddd 100755 --- a/x-pack/plugins/cloud_defend/public/plugin.tsx +++ b/x-pack/plugins/cloud_defend/public/plugin.tsx @@ -71,7 +71,7 @@ export class CloudDefendPlugin const CloudDefendRouter = (props: CloudDefendRouterProps) => ( <KibanaContextProvider services={{ ...core, ...plugins }}> <RedirectAppLinks coreStart={core}> - <div style={{ width: '100%', height: '100%' }}> + <div css={{ width: '100%', height: '100%' }}> <SetupContext.Provider value={{ isCloudEnabled: this.isCloudEnabled }}> <Router {...props} /> </SetupContext.Provider> diff --git a/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts b/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts index 9fb817b275a0..f9544b656f92 100644 --- a/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts +++ b/x-pack/plugins/cloud_security_posture/server/routes/graph/route.ts @@ -12,7 +12,7 @@ import { import { transformError } from '@kbn/securitysolution-es-utils'; import type { GraphRequest } from '@kbn/cloud-security-posture-common/types/graph/v1'; import { GRAPH_ROUTE_PATH } from '../../../common/constants'; -import { CspRouter } from '../../types'; +import { CspRequestHandlerContext, CspRouter } from '../../types'; import { getGraph as getGraphV1 } from './v1'; export const defineGraphRoute = (router: CspRouter) => @@ -39,10 +39,11 @@ export const defineGraphRoute = (router: CspRouter) => }, }, }, - async (context, request, response) => { + async (context: CspRequestHandlerContext, request, response) => { + const cspContext = await context.csp; + const { nodesLimit, showUnknownTarget = false } = request.body; const { eventIds, start, end, esQuery } = request.body.query as GraphRequest['query']; - const cspContext = await context.csp; const spaceId = (await cspContext.spaces?.spacesService?.getActiveSpace(request))?.id; try { diff --git a/x-pack/plugins/cloud_security_posture/server/types.ts b/x-pack/plugins/cloud_security_posture/server/types.ts index df812fe53472..d5dc022bfcf6 100644 --- a/x-pack/plugins/cloud_security_posture/server/types.ts +++ b/x-pack/plugins/cloud_security_posture/server/types.ts @@ -22,6 +22,7 @@ import type { Logger, SavedObjectsClientContract, IScopedClusterClient, + CoreRequestHandlerContext, } from '@kbn/core/server'; import type { AgentService, @@ -88,6 +89,7 @@ export type CspRequestHandlerContext = CustomRequestHandlerContext<{ csp: CspApiRequestHandlerContext; fleet: FleetRequestHandlerContext['fleet']; alerting: AlertingApiRequestHandlerContext; + core: Promise<CoreRequestHandlerContext>; }>; /** diff --git a/x-pack/plugins/data_usage/common/utils.test.ts b/x-pack/plugins/data_usage/common/utils.test.ts deleted file mode 100644 index fc6b158c1caa..000000000000 --- a/x-pack/plugins/data_usage/common/utils.test.ts +++ /dev/null @@ -1,33 +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 { isDateRangeValid } from './utils'; - -describe('isDateRangeValid', () => { - describe('Valid ranges', () => { - it.each([ - ['both start and end date is `now`', { start: 'now', end: 'now' }], - ['start date is `now-10s` and end date is `now`', { start: 'now-10s', end: 'now' }], - ['bounded within the min and max date range', { start: 'now-8d', end: 'now-4s' }], - ])('should return true if %s', (_, { start, end }) => { - expect(isDateRangeValid({ start, end })).toBe(true); - }); - }); - - describe('Invalid ranges', () => { - it.each([ - ['starts before the min date', { start: 'now-11d', end: 'now-5s' }], - ['ends after the max date', { start: 'now-9d', end: 'now+2s' }], - [ - 'end date is before the start date even when both are within min and max date range', - { start: 'now-3s', end: 'now-10s' }, - ], - ])('should return false if the date range %s', (_, { start, end }) => { - expect(isDateRangeValid({ start, end })).toBe(false); - }); - }); -}); diff --git a/x-pack/plugins/data_usage/common/utils.ts b/x-pack/plugins/data_usage/common/utils.ts deleted file mode 100644 index 3fd7240153d4..000000000000 --- a/x-pack/plugins/data_usage/common/utils.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import dateMath from '@kbn/datemath'; - -export const DEFAULT_DATE_RANGE_OPTIONS = Object.freeze({ - autoRefreshOptions: { - enabled: false, - duration: 10000, - }, - startDate: 'now-24h/h', - endDate: 'now', - maxDate: 'now+1s', - minDate: 'now-9d', - recentlyUsedDateRanges: [], -}); - -export const momentDateParser = (date: string) => dateMath.parse(date); -export const transformToUTCtime = ({ - start, - end, - isISOString = false, -}: { - start: string; - end: string; - isISOString?: boolean; -}) => { - const utcOffset = momentDateParser(start)?.utcOffset() ?? 0; - const utcStart = momentDateParser(start)?.utc().add(utcOffset, 'm'); - const utcEnd = momentDateParser(end)?.utc().add(utcOffset, 'm'); - return { - start: isISOString ? utcStart?.toISOString() : momentDateParser(start), - end: isISOString ? utcEnd?.toISOString() : momentDateParser(end), - }; -}; - -export const isDateRangeValid = ({ start, end }: { start: string; end: string }): boolean => { - const startDate = momentDateParser(start); - const endDate = momentDateParser(end); - - if (!startDate || !endDate) { - return false; - } - const minDate = momentDateParser(DEFAULT_DATE_RANGE_OPTIONS.minDate); - const maxDate = momentDateParser(DEFAULT_DATE_RANGE_OPTIONS.maxDate); - return ( - startDate.isSameOrAfter(minDate, 's') && - endDate.isSameOrBefore(maxDate, 's') && - startDate <= endDate - ); -}; diff --git a/x-pack/plugins/data_usage/jest.config.js b/x-pack/plugins/data_usage/jest.config.js deleted file mode 100644 index f73ddf7ec31e..000000000000 --- a/x-pack/plugins/data_usage/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['<rootDir>/x-pack/plugins/data_usage'], - coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/data_usage', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['<rootDir>/x-pack/plugins/datas_usage/{common,public}/**/*.{ts,tsx}'], -}; diff --git a/x-pack/plugins/data_usage/public/app/components/filters/charts_filters.tsx b/x-pack/plugins/data_usage/public/app/components/filters/charts_filters.tsx deleted file mode 100644 index 52561aa9f26f..000000000000 --- a/x-pack/plugins/data_usage/public/app/components/filters/charts_filters.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { memo, useCallback, useMemo } from 'react'; -import { EuiFilterGroup, EuiFlexGroup, EuiFlexItem, EuiSuperUpdateButton } from '@elastic/eui'; -import type { - DurationRange, - OnRefreshChangeProps, -} from '@elastic/eui/src/components/date_picker/types'; -import { useTestIdGenerator } from '../../../hooks/use_test_id_generator'; -import { useGetDataUsageMetrics } from '../../../hooks/use_get_usage_metrics'; -import { DateRangePickerValues, UsageMetricsDateRangePicker } from './date_picker'; -import { ChartsFilter, ChartsFilterProps } from './charts_filter'; -import { FilterName } from '../../hooks'; - -export interface ChartFiltersProps { - dateRangePickerState: DateRangePickerValues; - isDataLoading: boolean; - isUpdateDisabled: boolean; - filterOptions: Record<FilterName, ChartsFilterProps['filterOptions']>; - onRefresh: () => void; - onRefreshChange: (evt: OnRefreshChangeProps) => void; - onTimeChange: ({ start, end }: DurationRange) => void; - onClick: ReturnType<typeof useGetDataUsageMetrics>['refetch']; - showMetricsTypesFilter?: boolean; - 'data-test-subj'?: string; -} - -export const ChartFilters = memo<ChartFiltersProps>( - ({ - dateRangePickerState, - isDataLoading, - isUpdateDisabled, - filterOptions, - onClick, - onRefresh, - onRefreshChange, - onTimeChange, - showMetricsTypesFilter = false, - 'data-test-subj': dataTestSubj, - }) => { - const getTestId = useTestIdGenerator(dataTestSubj); - - const filters = useMemo(() => { - return ( - <> - {showMetricsTypesFilter && ( - <ChartsFilter filterOptions={filterOptions.metricTypes} data-test-subj={dataTestSubj} /> - )} - {!filterOptions.dataStreams.isFilterLoading && ( - <ChartsFilter filterOptions={filterOptions.dataStreams} data-test-subj={dataTestSubj} /> - )} - </> - ); - }, [dataTestSubj, filterOptions, showMetricsTypesFilter]); - - const onClickRefreshButton = useCallback(() => onClick(), [onClick]); - - return ( - <EuiFlexGroup responsive gutterSize="m" alignItems="center" justifyContent="flexEnd"> - <EuiFlexItem grow={2} /> - <EuiFlexItem grow={1}> - <EuiFilterGroup>{filters}</EuiFilterGroup> - </EuiFlexItem> - <EuiFlexItem grow={2}> - <UsageMetricsDateRangePicker - dateRangePickerState={dateRangePickerState} - isDataLoading={isDataLoading} - onRefresh={onRefresh} - onRefreshChange={onRefreshChange} - onTimeChange={onTimeChange} - data-test-subj={dataTestSubj} - /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiSuperUpdateButton - data-test-subj={getTestId('super-refresh-button')} - fill={false} - isLoading={isDataLoading} - isDisabled={isUpdateDisabled} - onClick={onClickRefreshButton} - /> - </EuiFlexItem> - </EuiFlexGroup> - ); - } -); - -ChartFilters.displayName = 'ChartFilters'; diff --git a/x-pack/plugins/data_usage/public/app/components/legend_action_item.tsx b/x-pack/plugins/data_usage/public/app/components/legend_action_item.tsx deleted file mode 100644 index 3b4f0d9f698f..000000000000 --- a/x-pack/plugins/data_usage/public/app/components/legend_action_item.tsx +++ /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 React, { memo } from 'react'; -import { EuiListGroupItem } from '@elastic/eui'; - -export const LegendActionItem = memo( - ({ label, onClick }: { label: string; onClick: () => Promise<void> | void }) => ( - <EuiListGroupItem label={label} onClick={onClick} size="s" /> - ) -); - -LegendActionItem.displayName = 'LegendActionItem'; diff --git a/x-pack/plugins/data_usage/public/app/components/page.tsx b/x-pack/plugins/data_usage/public/app/components/page.tsx deleted file mode 100644 index d7ff20f5e933..000000000000 --- a/x-pack/plugins/data_usage/public/app/components/page.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 type { PropsWithChildren } from 'react'; -import React, { memo, useMemo } from 'react'; -import type { CommonProps } from '@elastic/eui'; -import { - EuiPageHeader, - EuiPageSection, - EuiFlexGroup, - EuiFlexItem, - EuiTitle, - EuiSpacer, -} from '@elastic/eui'; - -interface DataUsagePageProps { - title: React.ReactNode; - subtitle?: React.ReactNode; - actions?: React.ReactNode; - restrictWidth?: boolean | number; - hasBottomBorder?: boolean; - hideHeader?: boolean; -} - -export const DataUsagePage = memo<PropsWithChildren<DataUsagePageProps & CommonProps>>( - ({ title, subtitle, children, restrictWidth = false, hasBottomBorder = true, ...otherProps }) => { - const header = useMemo(() => { - return ( - <EuiFlexGroup direction="column" gutterSize="none" alignItems="flexStart"> - <EuiFlexItem grow={false}> - <EuiTitle size="l"> - <span data-test-subj="dataUsage-page-title">{title}</span> - </EuiTitle> - </EuiFlexItem> - </EuiFlexGroup> - ); - }, [, title]); - - const description = useMemo(() => { - return subtitle ? ( - <span data-test-subj="dataUsage-page-description">{subtitle}</span> - ) : undefined; - }, [subtitle]); - - return ( - <div {...otherProps}> - <> - <EuiPageHeader - pageTitle={header} - description={description} - bottomBorder={hasBottomBorder} - restrictWidth={restrictWidth} - data-test-subj={'dataUsage-page-header'} - /> - <EuiSpacer size="l" /> - </> - <EuiPageSection paddingSize="none" color="transparent" restrictWidth={restrictWidth}> - {children} - </EuiPageSection> - </div> - ); - } -); - -DataUsagePage.displayName = 'DataUsagePage'; diff --git a/x-pack/plugins/data_usage/public/app/data_usage_metrics_page.tsx b/x-pack/plugins/data_usage/public/app/data_usage_metrics_page.tsx deleted file mode 100644 index adc53e12b574..000000000000 --- a/x-pack/plugins/data_usage/public/app/data_usage_metrics_page.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 React from 'react'; -import { DataUsagePage } from './components/page'; -import { DATA_USAGE_PAGE } from '../translations'; -import { DataUsageMetrics } from './components/data_usage_metrics'; - -export const DataUsageMetricsPage = () => { - return ( - <DataUsagePage - data-test-subj="DataUsagePage" - title={DATA_USAGE_PAGE.title} - subtitle={DATA_USAGE_PAGE.subTitle} - > - <DataUsageMetrics /> - </DataUsagePage> - ); -}; - -DataUsageMetricsPage.displayName = 'DataUsageMetricsPage'; diff --git a/x-pack/plugins/data_usage/public/app/hooks/use_charts_filter.tsx b/x-pack/plugins/data_usage/public/app/hooks/use_charts_filter.tsx deleted file mode 100644 index 012a6027aadb..000000000000 --- a/x-pack/plugins/data_usage/public/app/hooks/use_charts_filter.tsx +++ /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 { useState, useEffect, useMemo } from 'react'; -import { DEFAULT_SELECTED_OPTIONS } from '../../../common'; -import { - METRIC_TYPE_VALUES, - METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP, - isDefaultMetricType, -} from '../../../common/rest_types'; -import { FILTER_NAMES } from '../../translations'; -import { useDataUsageMetricsUrlParams } from './use_charts_url_params'; -import { formatBytes } from '../../utils/format_bytes'; -import { ChartsFilterProps } from '../components/filters/charts_filter'; - -export type FilterName = keyof typeof FILTER_NAMES; - -export type FilterItems = Array<{ - key?: string; - label: string; - isGroupLabel?: boolean; - checked?: 'on' | undefined; - 'data-test-subj'?: string; -}>; - -export const useChartsFilter = ({ - filterOptions, -}: { - filterOptions: ChartsFilterProps['filterOptions']; -}): { - areDataStreamsSelectedOnMount: boolean; - items: FilterItems; - setItems: React.Dispatch<React.SetStateAction<FilterItems>>; - hasActiveFilters: boolean; - numActiveFilters: number; - numFilters: number; - setAreDataStreamsSelectedOnMount: (value: React.SetStateAction<boolean>) => void; - setUrlDataStreamsFilter: ReturnType< - typeof useDataUsageMetricsUrlParams - >['setUrlDataStreamsFilter']; - setUrlMetricTypesFilter: ReturnType< - typeof useDataUsageMetricsUrlParams - >['setUrlMetricTypesFilter']; -} => { - const { - dataStreams: selectedDataStreamsFromUrl, - metricTypes: selectedMetricTypesFromUrl, - setUrlMetricTypesFilter, - setUrlDataStreamsFilter, - } = useDataUsageMetricsUrlParams(); - const isMetricTypesFilter = filterOptions.filterName === 'metricTypes'; - const isDataStreamsFilter = filterOptions.filterName === 'dataStreams'; - - // track the state of selected data streams via URL - // when the page is loaded via selected data streams on URL - const [areDataStreamsSelectedOnMount, setAreDataStreamsSelectedOnMount] = - useState<boolean>(false); - - useEffect(() => { - if (selectedDataStreamsFromUrl && selectedDataStreamsFromUrl.length > 0) { - setAreDataStreamsSelectedOnMount(true); - } - // don't sync with changes to further selectedDataStreamsFromUrl - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - // filter options - const [items, setItems] = useState<FilterItems>( - isMetricTypesFilter - ? METRIC_TYPE_VALUES.map((metricType) => ({ - key: metricType, - label: METRIC_TYPE_API_VALUES_TO_UI_OPTIONS_MAP[metricType], - checked: selectedMetricTypesFromUrl - ? selectedMetricTypesFromUrl.includes(metricType) - ? 'on' - : undefined - : isDefaultMetricType(metricType) // default metrics are selected by default - ? 'on' - : undefined, - 'data-test-subj': `${filterOptions.filterName}-filter-option`, - })) - : isDataStreamsFilter && !!filterOptions.options.length - ? filterOptions.options?.map((filterOption, i) => ({ - key: filterOption, - label: filterOption, - append: formatBytes(filterOptions.appendOptions?.[filterOption] ?? 0), - checked: selectedDataStreamsFromUrl - ? selectedDataStreamsFromUrl.includes(filterOption) - ? 'on' - : undefined - : i < DEFAULT_SELECTED_OPTIONS - ? 'on' - : undefined, - 'data-test-subj': `${filterOptions.filterName}-filter-option`, - })) - : [] - ); - - const hasActiveFilters = useMemo(() => !!items.find((item) => item.checked === 'on'), [items]); - const numActiveFilters = useMemo( - () => items.filter((item) => item.checked === 'on').length, - [items] - ); - const numFilters = useMemo( - () => items.filter((item) => item.key && item.checked !== 'on').length, - [items] - ); - - return { - areDataStreamsSelectedOnMount, - items, - setItems, - hasActiveFilters, - numActiveFilters, - numFilters, - setAreDataStreamsSelectedOnMount, - setUrlMetricTypesFilter, - setUrlDataStreamsFilter, - }; -}; diff --git a/x-pack/plugins/data_usage/public/hooks/use_get_data_streams.ts b/x-pack/plugins/data_usage/public/hooks/use_get_data_streams.ts deleted file mode 100644 index d43c3fff139f..000000000000 --- a/x-pack/plugins/data_usage/public/hooks/use_get_data_streams.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 type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; -import { useQuery } from '@tanstack/react-query'; -import type { IHttpFetchError } from '@kbn/core-http-browser'; -import { DATA_USAGE_DATA_STREAMS_API_ROUTE, DEFAULT_SELECTED_OPTIONS } from '../../common'; -import { useKibanaContextForPlugin } from '../utils/use_kibana'; - -type GetDataUsageDataStreamsResponse = Array<{ - name: string; - storageSizeBytes: number; - selected: boolean; -}>; - -export const useGetDataUsageDataStreams = ({ - selectedDataStreams, - options = { - enabled: false, - }, -}: { - selectedDataStreams?: string[]; - options?: UseQueryOptions<GetDataUsageDataStreamsResponse, IHttpFetchError>; -}): UseQueryResult<GetDataUsageDataStreamsResponse, IHttpFetchError> => { - const { http } = useKibanaContextForPlugin().services; - - return useQuery<GetDataUsageDataStreamsResponse, IHttpFetchError>({ - queryKey: ['get-data-usage-data-streams'], - ...options, - keepPreviousData: true, - queryFn: async ({ signal }) => { - const dataStreamsResponse = await http - .get<GetDataUsageDataStreamsResponse>(DATA_USAGE_DATA_STREAMS_API_ROUTE, { - signal, - version: '1', - }) - .catch((error) => { - throw error.body; - }); - - const augmentedDataStreamsBasedOnSelectedItems = dataStreamsResponse.reduce<{ - selected: GetDataUsageDataStreamsResponse; - rest: GetDataUsageDataStreamsResponse; - }>( - (acc, ds, i) => { - const item = { - name: ds.name, - storageSizeBytes: ds.storageSizeBytes, - selected: ds.selected, - }; - - if (selectedDataStreams?.includes(ds.name) && i < DEFAULT_SELECTED_OPTIONS) { - acc.selected.push({ ...item, selected: true }); - } else { - acc.rest.push({ ...item, selected: false }); - } - - return acc; - }, - { selected: [], rest: [] } - ); - - return [ - ...augmentedDataStreamsBasedOnSelectedItems.selected, - ...augmentedDataStreamsBasedOnSelectedItems.rest, - ]; - }, - }); -}; diff --git a/x-pack/plugins/data_usage/public/translations.tsx b/x-pack/plugins/data_usage/public/translations.tsx deleted file mode 100644 index 0996ec2bb6d5..000000000000 --- a/x-pack/plugins/data_usage/public/translations.tsx +++ /dev/null @@ -1,72 +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 PLUGIN_NAME = i18n.translate('xpack.dataUsage.name', { - defaultMessage: 'Data Usage', -}); - -export const FILTER_NAMES = Object.freeze({ - metricTypes: i18n.translate('xpack.dataUsage.metrics.filter.metricTypes', { - defaultMessage: 'Metric types', - }), - dataStreams: i18n.translate('xpack.dataUsage.metrics.filter.dataStreams', { - defaultMessage: 'Data streams', - }), -}); - -export const CHART_TITLES = Object.freeze({ - ingest_rate: i18n.translate('xpack.dataUsage.charts.ingestedMax', { - defaultMessage: 'Data Ingested', - }), - storage_retained: i18n.translate('xpack.dataUsage.charts.retainedMax', { - defaultMessage: 'Data Retained in Storage', - }), -}); - -export const DATA_USAGE_PAGE = Object.freeze({ - title: i18n.translate('xpack.dataUsage.name', { - defaultMessage: 'Data Usage', - }), - subTitle: i18n.translate('xpack.dataUsage.pageSubtitle', { - defaultMessage: 'Monitor data ingested and retained by data streams.', - }), -}); - -export const UX_LABELS = Object.freeze({ - filterSelectAll: i18n.translate('xpack.dataUsage.metrics.filter.selectAll', { - defaultMessage: 'Select all', - }), - filterClearAll: i18n.translate('xpack.dataUsage.metrics.filter.clearAll', { - defaultMessage: 'Clear all', - }), - filterSearchPlaceholder: (filterName: string) => - i18n.translate('xpack.dataUsage.metrics.filter.searchPlaceholder', { - defaultMessage: 'Search {filterName}', - values: { filterName }, - }), - filterEmptyMessage: (filterName: string) => - i18n.translate('xpack.dataUsage.metrics.filter.emptyMessage', { - defaultMessage: 'No {filterName} available', - values: { filterName }, - }), - dataQualityPopup: { - open: i18n.translate('xpack.dataUsage.metrics.dataQuality.open.actions', { - defaultMessage: 'Open data stream actions', - }), - copy: i18n.translate('xpack.dataUsage.metrics.dataQuality.copy.dataStream', { - defaultMessage: 'Copy data stream name', - }), - manage: i18n.translate('xpack.dataUsage.metrics.dataQuality.manage.dataStream', { - defaultMessage: 'Manage data stream', - }), - view: i18n.translate('xpack.dataUsage.metrics.dataQuality.view', { - defaultMessage: 'View data quality', - }), - }, -}); diff --git a/x-pack/plugins/data_usage/server/routes/internal/data_streams_handler.ts b/x-pack/plugins/data_usage/server/routes/internal/data_streams_handler.ts deleted file mode 100644 index 28967b9a0ee4..000000000000 --- a/x-pack/plugins/data_usage/server/routes/internal/data_streams_handler.ts +++ /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 { RequestHandler } from '@kbn/core/server'; -import { DataUsageContext, DataUsageRequestHandlerContext } from '../../types'; -import { errorHandler } from '../error_handler'; -import { getMeteringStats } from '../../utils/get_metering_stats'; -import { DataStreamsRequestQuery } from '../../../common/rest_types/data_streams'; -import { NoIndicesMeteringError, NoPrivilegeMeteringError } from '../../errors'; - -export const getDataStreamsHandler = ( - dataUsageContext: DataUsageContext -): RequestHandler<never, DataStreamsRequestQuery, unknown, DataUsageRequestHandlerContext> => { - const logger = dataUsageContext.logFactory.get('dataStreamsRoute'); - return async (context, request, response) => { - const { includeZeroStorage } = request.query; - - logger.debug('Retrieving user data streams'); - - try { - const core = await context.core; - const { datastreams: meteringStats } = await getMeteringStats( - core.elasticsearch.client.asSecondaryAuthUser - ); - - const body = - meteringStats && !!meteringStats.length - ? meteringStats - .sort((a, b) => b.size_in_bytes - a.size_in_bytes) - .reduce<Array<{ name: string; storageSizeBytes: number }>>((acc, stat) => { - if (includeZeroStorage || stat.size_in_bytes > 0) { - acc.push({ - name: stat.name, - storageSizeBytes: stat.size_in_bytes ?? 0, - }); - } - return acc; - }, []) - : []; - - return response.ok({ - body, - }); - } catch (error) { - if (error.message.includes('security_exception')) { - return errorHandler(logger, response, new NoPrivilegeMeteringError()); - } else if (error.message.includes('index_not_found_exception')) { - return errorHandler(logger, response, new NoIndicesMeteringError()); - } - - return errorHandler(logger, response, error); - } - }; -}; diff --git a/x-pack/plugins/data_usage/tsconfig.json b/x-pack/plugins/data_usage/tsconfig.json deleted file mode 100644 index 8647f7957451..000000000000 --- a/x-pack/plugins/data_usage/tsconfig.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "index.ts", - "common/**/*", - "public/**/*", - "server/**/*", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/i18n", - "@kbn/data-plugin", - "@kbn/kibana-react-plugin", - "@kbn/management-plugin", - "@kbn/react-kibana-context-render", - "@kbn/shared-ux-router", - "@kbn/ebt-tools", - "@kbn/share-plugin", - "@kbn/config-schema", - "@kbn/logging", - "@kbn/deeplinks-observability", - "@kbn/unified-search-plugin", - "@kbn/core-http-browser", - "@kbn/core-chrome-browser", - "@kbn/features-plugin", - "@kbn/index-management-shared-types", - "@kbn/repo-info", - "@kbn/cloud-plugin", - "@kbn/server-http-tools", - "@kbn/utility-types-jest", - "@kbn/datemath", - "@kbn/ui-theme", - "@kbn/i18n-react", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/error_handling.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/error_handling.spec.ts index 914558fbdc97..82c45b52ad56 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/error_handling.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/error_handling.spec.ts @@ -5,10 +5,10 @@ * 2.0. */ -import { expect } from '@kbn/scout'; +import { expect, tags } from '@kbn/scout'; import { test, testData } from '../fixtures'; -test.describe('Discover app - errors', { tag: ['@ess'] }, () => { +test.describe('Discover app - errors', { tag: tags.ESS_ONLY }, () => { test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { await kbnClient.savedObjects.clean({ types: ['search', 'index-pattern'] }); await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.LOGSTASH); diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_search_embeddable.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_search_embeddable.spec.ts index 7103f2b25e63..6c37611dbc20 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_search_embeddable.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_search_embeddable.spec.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { ScoutWorkerFixtures, expect } from '@kbn/scout'; +import { ScoutWorkerFixtures, expect, tags } from '@kbn/scout'; import { test, testData } from '../fixtures'; const createSavedSearch = async ( @@ -37,66 +37,62 @@ const createSavedSearch = async ( ], }); -test.describe( - 'Discover app - saved search embeddable', - { tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, - () => { - const SAVED_SEARCH_TITLE = 'TempSearch'; - const SAVED_SEARCH_ID = '90943e30-9a47-11e8-b64d-95841ca0b247'; - test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { - await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.LOGSTASH); - await kbnClient.importExport.load(testData.KBN_ARCHIVES.DASHBOARD_DRILLDOWNS); - await uiSettings.set({ - defaultIndex: testData.DATA_VIEW_ID.LOGSTASH, // TODO: investigate why it is required for `node scripts/playwright_test.js` run - 'timepicker:timeDefaults': `{ "from": "${testData.LOGSTASH_DEFAULT_START_TIME}", "to": "${testData.LOGSTASH_DEFAULT_END_TIME}"}`, - }); +test.describe('Discover app - saved search embeddable', { tag: tags.DEPLOYMENT_AGNOSTIC }, () => { + const SAVED_SEARCH_TITLE = 'TempSearch'; + const SAVED_SEARCH_ID = '90943e30-9a47-11e8-b64d-95841ca0b247'; + test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { + await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.LOGSTASH); + await kbnClient.importExport.load(testData.KBN_ARCHIVES.DASHBOARD_DRILLDOWNS); + await uiSettings.set({ + defaultIndex: testData.DATA_VIEW_ID.LOGSTASH, // TODO: investigate why it is required for `node scripts/playwright_test.js` run + 'timepicker:timeDefaults': `{ "from": "${testData.LOGSTASH_DEFAULT_START_TIME}", "to": "${testData.LOGSTASH_DEFAULT_END_TIME}"}`, }); + }); - test.afterAll(async ({ kbnClient, uiSettings }) => { - await uiSettings.unset('defaultIndex', 'timepicker:timeDefaults'); - await kbnClient.savedObjects.cleanStandardList(); - }); + test.afterAll(async ({ kbnClient, uiSettings }) => { + await uiSettings.unset('defaultIndex', 'timepicker:timeDefaults'); + await kbnClient.savedObjects.cleanStandardList(); + }); - test.beforeEach(async ({ browserAuth, pageObjects }) => { - await browserAuth.loginAsPrivilegedUser(); - await pageObjects.dashboard.goto(); - }); + test.beforeEach(async ({ browserAuth, pageObjects }) => { + await browserAuth.loginAsPrivilegedUser(); + await pageObjects.dashboard.goto(); + }); - test('should allow removing the dashboard panel after the underlying saved search has been deleted', async ({ + test('should allow removing the dashboard panel after the underlying saved search has been deleted', async ({ + kbnClient, + page, + pageObjects, + }) => { + await pageObjects.dashboard.openNewDashboard(); + await createSavedSearch( kbnClient, - page, - pageObjects, - }) => { - await pageObjects.dashboard.openNewDashboard(); - await createSavedSearch( - kbnClient, - SAVED_SEARCH_ID, - SAVED_SEARCH_TITLE, - testData.DATA_VIEW_ID.LOGSTASH - ); - await pageObjects.dashboard.addPanelFromLibrary(SAVED_SEARCH_TITLE); - await page.testSubj.locator('savedSearchTotalDocuments').waitFor({ - state: 'visible', - }); + SAVED_SEARCH_ID, + SAVED_SEARCH_TITLE, + testData.DATA_VIEW_ID.LOGSTASH + ); + await pageObjects.dashboard.addPanelFromLibrary(SAVED_SEARCH_TITLE); + await page.testSubj.locator('savedSearchTotalDocuments').waitFor({ + state: 'visible', + }); - await pageObjects.dashboard.saveDashboard('Dashboard with deleted saved search'); - await kbnClient.savedObjects.delete({ - type: 'search', - id: SAVED_SEARCH_ID, - }); + await pageObjects.dashboard.saveDashboard('Dashboard with deleted saved search'); + await kbnClient.savedObjects.delete({ + type: 'search', + id: SAVED_SEARCH_ID, + }); - await page.reload(); - await page.waitForLoadingIndicatorHidden(); - await expect( - page.testSubj.locator('embeddableError'), - 'Embeddable error should be displayed' - ).toBeVisible(); + await page.reload(); + await page.waitForLoadingIndicatorHidden(); + await expect( + page.testSubj.locator('embeddableError'), + 'Embeddable error should be displayed' + ).toBeVisible(); - await pageObjects.dashboard.removePanel('embeddableError'); - await expect( - page.testSubj.locator('embeddableError'), - 'Embeddable error should not be displayed' - ).toBeHidden(); - }); - } -); + await pageObjects.dashboard.removePanel('embeddableError'); + await expect( + page.testSubj.locator('embeddableError'), + 'Embeddable error should not be displayed' + ).toBeHidden(); + }); +}); diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts index 1398f5f24ab2..94a0d6b7b063 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/saved_searches.spec.ts @@ -31,98 +31,93 @@ const assertDataViewIsSelected = async (page: ExtendedScoutTestFixtures['page'], 'Incorrect data view is selected' ).toHaveText(name); -test.describe( - 'Discover app - saved searches', - { tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, - () => { - const START_TIME = '2019-04-27T23:56:51.374Z'; - const END_TIME = '2019-08-23T16:18:51.821Z'; - const PANEL_NAME = 'Ecommerce Data'; - const SEARCH_QUERY = 'customer_gender:MALE'; - const SAVED_SEARCH_NAME = 'test-unselect-saved-search'; - const filterFieldAndValue = { - field: 'category', - value: `Men's Shoes`, - }; - - test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { - await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.ECOMMERCE); - await kbnClient.importExport.load(testData.KBN_ARCHIVES.DISCOVER); - await kbnClient.importExport.load(testData.KBN_ARCHIVES.ECOMMERCE); - await uiSettings.set({ - defaultIndex: testData.DATA_VIEW_ID.ECOMMERCE, - 'timepicker:timeDefaults': `{ "from": "${START_TIME}", "to": "${END_TIME}"}`, - }); +test.describe('Discover app - saved searches', { tag: ['@ess', '@svlSearch', '@svlOblt'] }, () => { + // TODO: Update to use an ES archive with an index accessible to 'viewer' + // for running this test against the Security serverless project. + const START_TIME = '2019-04-27T23:56:51.374Z'; + const END_TIME = '2019-08-23T16:18:51.821Z'; + const PANEL_NAME = 'Ecommerce Data'; + const SEARCH_QUERY = 'customer_gender:MALE'; + const SAVED_SEARCH_NAME = 'test-unselect-saved-search'; + const filterFieldAndValue = { + field: 'category', + value: `Men's Shoes`, + }; + + test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { + await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.ECOMMERCE); + await kbnClient.importExport.load(testData.KBN_ARCHIVES.DISCOVER); + await kbnClient.importExport.load(testData.KBN_ARCHIVES.ECOMMERCE); + await uiSettings.set({ + defaultIndex: testData.DATA_VIEW_ID.ECOMMERCE, + 'timepicker:timeDefaults': `{ "from": "${START_TIME}", "to": "${END_TIME}"}`, }); - - test.afterAll(async ({ kbnClient, uiSettings }) => { - await uiSettings.unset('defaultIndex', 'timepicker:timeDefaults'); - await kbnClient.savedObjects.cleanStandardList(); + }); + + test.afterAll(async ({ kbnClient, uiSettings }) => { + await uiSettings.unset('defaultIndex', 'timepicker:timeDefaults'); + await kbnClient.savedObjects.cleanStandardList(); + }); + + test.beforeEach(async ({ browserAuth }) => { + await browserAuth.loginAsPrivilegedUser(); + }); + + test('should customize time range on dashboards', async ({ pageObjects, page }) => { + await pageObjects.dashboard.goto(); + await pageObjects.dashboard.openNewDashboard(); + await pageObjects.dashboard.addPanelFromLibrary(PANEL_NAME); + await page.testSubj.locator('savedSearchTotalDocuments').waitFor({ + state: 'visible', }); - test.beforeEach(async ({ browserAuth }) => { - await browserAuth.loginAsPrivilegedUser(); + await pageObjects.dashboard.customizePanel({ + name: PANEL_NAME, + customTimeRageCommonlyUsed: { value: 'Last_90 days' }, }); - - test('should customize time range on dashboards', async ({ pageObjects, page }) => { - await pageObjects.dashboard.goto(); - await pageObjects.dashboard.openNewDashboard(); - await pageObjects.dashboard.addPanelFromLibrary(PANEL_NAME); - await page.testSubj.locator('savedSearchTotalDocuments').waitFor({ - state: 'visible', - }); - - await pageObjects.dashboard.customizePanel({ - name: PANEL_NAME, - customTimeRageCommonlyUsed: { value: 'Last_90 days' }, - }); - await expect( - page.testSubj.locator('embeddedSavedSearchDocTable').locator('.euiDataGrid__noResults'), - 'No results message in Saved Search panel should be visible' - ).toBeVisible(); + await expect( + page.testSubj.locator('embeddedSavedSearchDocTable').locator('.euiDataGrid__noResults'), + 'No results message in Saved Search panel should be visible' + ).toBeVisible(); + }); + + test(`should unselect saved search when navigating to a 'new'`, async ({ pageObjects, page }) => { + await pageObjects.discover.goto(); + await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); + await pageObjects.filterBar.addFilter({ + ...filterFieldAndValue, + operator: 'is', }); + await page.testSubj.fill('queryInput', SEARCH_QUERY); + await page.testSubj.click('querySubmitButton'); + await pageObjects.discover.waitForHistogramRendered(); - test(`should unselect saved search when navigating to a 'new'`, async ({ - pageObjects, - page, - }) => { - await pageObjects.discover.goto(); - await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); - await pageObjects.filterBar.addFilter({ + await pageObjects.discover.saveSearch(SAVED_SEARCH_NAME); + await pageObjects.discover.waitForHistogramRendered(); + + expect( + await pageObjects.filterBar.hasFilter({ ...filterFieldAndValue, - operator: 'is', - }); - await page.testSubj.fill('queryInput', SEARCH_QUERY); - await page.testSubj.click('querySubmitButton'); - await pageObjects.discover.waitForHistogramRendered(); - - await pageObjects.discover.saveSearch(SAVED_SEARCH_NAME); - await pageObjects.discover.waitForHistogramRendered(); - - expect( - await pageObjects.filterBar.hasFilter({ - ...filterFieldAndValue, - enabled: true, // Filter is enabled by default - }) - ).toBe(true); - await expect(page.testSubj.locator('queryInput')).toHaveText(SEARCH_QUERY); - - // create new search - await pageObjects.discover.clickNewSearch(); - await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); - await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); - - // change data view - await pageObjects.discover.selectDataView(testData.DATA_VIEW.LOGSTASH); - await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); - - // change data view again - await pageObjects.discover.selectDataView(testData.DATA_VIEW.ECOMMERCE); - await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); - - // create new search again - await pageObjects.discover.clickNewSearch(); - await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); - }); - } -); + enabled: true, // Filter is enabled by default + }) + ).toBe(true); + await expect(page.testSubj.locator('queryInput')).toHaveText(SEARCH_QUERY); + + // create new search + await pageObjects.discover.clickNewSearch(); + await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); + await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); + + // change data view + await pageObjects.discover.selectDataView(testData.DATA_VIEW.LOGSTASH); + await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); + + // change data view again + await pageObjects.discover.selectDataView(testData.DATA_VIEW.ECOMMERCE); + await assertNoFilterAndEmptyQuery(filterFieldAndValue, pageObjects, page); + + // create new search again + await pageObjects.discover.clickNewSearch(); + await assertDataViewIsSelected(page, testData.DATA_VIEW.ECOMMERCE); + }); +}); diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions.spec.ts index 04836afb99b5..40b07726b31e 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions.spec.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { expect } from '@kbn/scout'; +import { expect, tags } from '@kbn/scout'; import { test, testData, assertionMessages } from '../fixtures'; test.describe( 'Discover app - value suggestions: useTimeRange enabled', - { tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, + { tag: tags.DEPLOYMENT_AGNOSTIC }, () => { test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.LOGSTASH); diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_non_time_based.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_non_time_based.spec.ts index 319d8af3e93c..d8035597fa0e 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_non_time_based.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_non_time_based.spec.ts @@ -10,7 +10,9 @@ import { test, testData, assertionMessages } from '../fixtures'; test.describe( 'Discover app - value suggestions non-time based', - { tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, + { tag: ['@ess', '@svlSearch', '@svlOblt'] }, + // TODO: Update to use an ES archive with an index accessible to 'viewer' + // for running this test against the Security serverless project. () => { test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.NO_TIME_FIELD); diff --git a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_use_time_range_disabled.spec.ts b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_use_time_range_disabled.spec.ts index 857709b09194..cce172ad8494 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_use_time_range_disabled.spec.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/tests/value_suggestions_use_time_range_disabled.spec.ts @@ -5,12 +5,12 @@ * 2.0. */ -import { expect } from '@kbn/scout'; +import { expect, tags } from '@kbn/scout'; import { test, testData, assertionMessages } from '../fixtures'; test.describe( 'Discover app - value suggestions: useTimeRange disabled', - { tag: ['@ess', '@svlSecurity', '@svlOblt', '@svlSearch'] }, + { tag: tags.DEPLOYMENT_AGNOSTIC }, () => { test.beforeAll(async ({ esArchiver, kbnClient, uiSettings }) => { await esArchiver.loadIfNeeded(testData.ES_ARCHIVES.LOGSTASH); diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts index 706e4444488d..f17ffac7d42a 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; +import { AuditLogger, AuthenticatedUser, ElasticsearchClient, Logger } from '@kbn/core/server'; import { DEFAULT_NAMESPACE_STRING } from '@kbn/core-saved-objects-utils-server'; import { ESSearchRequest, ESSearchResponse } from '@kbn/es-types'; @@ -19,6 +19,7 @@ export interface AIAssistantDataClientParams { elasticsearchClientPromise: Promise<ElasticsearchClient>; kibanaVersion: string; spaceId: string; + auditLogger?: AuditLogger; logger: Logger; indexPatternsResourceName: string; currentUser: AuthenticatedUser | null; diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.test.ts new file mode 100644 index 000000000000..8d65d9e62828 --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + knowledgeBaseAuditEvent, + KnowledgeBaseAuditAction, + AUDIT_OUTCOME, + AUDIT_CATEGORY, + AUDIT_TYPE, +} from './audit_events'; + +describe('knowledgeBaseAuditEvent', () => { + it('should generate a success event with id', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + id: '123', + outcome: AUDIT_OUTCOME.SUCCESS, + }); + + expect(event).toEqual({ + message: 'User has created knowledge base entry [id=123]', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + it('should generate a success event with name', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + name: 'My document', + outcome: AUDIT_OUTCOME.SUCCESS, + }); + + expect(event).toEqual({ + message: 'User has created knowledge base entry [name="My document"]', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + it('should generate a success event with name and id', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + name: 'My document', + id: '123', + outcome: AUDIT_OUTCOME.SUCCESS, + }); + + expect(event).toEqual({ + message: 'User has created knowledge base entry [id=123, name="My document"]', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + + it('should generate a success event without id or name', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + outcome: AUDIT_OUTCOME.SUCCESS, + }); + + expect(event).toEqual({ + message: 'User has created a knowledge base entry', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + + it('should generate a failure event with an error', () => { + const error = new Error('Test error'); + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + id: '456', + error, + }); + + expect(event).toEqual({ + message: 'Failed attempt to create knowledge base entry [id=456]', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.FAILURE, + }, + error: { + code: error.name, + message: error.message, + }, + }); + }); + + it('should handle unknown outcome', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + id: '789', + outcome: AUDIT_OUTCOME.UNKNOWN, + }); + + expect(event).toEqual({ + message: 'User is creating knowledge base entry [id=789]', + event: { + action: KnowledgeBaseAuditAction.CREATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CREATION], + outcome: AUDIT_OUTCOME.UNKNOWN, + }, + }); + }); + + it('should handle update action', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.UPDATE, + id: '123', + outcome: AUDIT_OUTCOME.SUCCESS, + }); + + expect(event).toEqual({ + message: 'User has updated knowledge base entry [id=123]', + event: { + action: KnowledgeBaseAuditAction.UPDATE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.CHANGE], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + + it('should handle delete action', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.DELETE, + id: '123', + }); + + expect(event).toEqual({ + message: 'User has deleted knowledge base entry [id=123]', + event: { + action: KnowledgeBaseAuditAction.DELETE, + category: [AUDIT_CATEGORY.DATABASE], + type: [AUDIT_TYPE.DELETION], + outcome: AUDIT_OUTCOME.SUCCESS, + }, + }); + }); + + it('should default to success if outcome is not provided and no error exists', () => { + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + }); + + expect(event.event?.outcome).toBe(AUDIT_OUTCOME.SUCCESS); + }); + + it('should prioritize error outcome over provided outcome', () => { + const error = new Error('Error with priority'); + const event = knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + outcome: AUDIT_OUTCOME.SUCCESS, + error, + }); + + expect(event.event?.outcome).toBe(AUDIT_OUTCOME.FAILURE); + }); +}); diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.ts new file mode 100644 index 000000000000..584efd603f4b --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/audit_events.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EcsEvent } from '@kbn/core/server'; +import { AuditEvent } from '@kbn/security-plugin/server'; +import { ArrayElement } from '@kbn/utility-types'; + +export enum AUDIT_TYPE { + CHANGE = 'change', + DELETION = 'deletion', + ACCESS = 'access', + CREATION = 'creation', +} + +export enum AUDIT_CATEGORY { + AUTHENTICATION = 'authentication', + DATABASE = 'database', + WEB = 'web', +} + +export enum AUDIT_OUTCOME { + FAILURE = 'failure', + SUCCESS = 'success', + UNKNOWN = 'unknown', +} + +export enum KnowledgeBaseAuditAction { + CREATE = 'knowledge_base_entry_create', + UPDATE = 'knowledge_base_entry_update', + DELETE = 'knowledge_base_entry_delete', +} + +type VerbsTuple = [string, string, string]; +const knowledgeBaseEventVerbs: Record<KnowledgeBaseAuditAction, VerbsTuple> = { + knowledge_base_entry_create: ['create', 'creating', 'created'], + knowledge_base_entry_update: ['update', 'updating', 'updated'], + knowledge_base_entry_delete: ['delete', 'deleting', 'deleted'], +}; + +const knowledgeBaseEventTypes: Record<KnowledgeBaseAuditAction, ArrayElement<EcsEvent['type']>> = { + knowledge_base_entry_create: AUDIT_TYPE.CREATION, + knowledge_base_entry_update: AUDIT_TYPE.CHANGE, + knowledge_base_entry_delete: AUDIT_TYPE.DELETION, +}; + +export interface KnowledgeBaseAuditEventParams { + action: KnowledgeBaseAuditAction; + error?: Error; + id?: string; + name?: string; + outcome?: EcsEvent['outcome']; +} + +export function knowledgeBaseAuditEvent({ + action, + error, + id, + name, + outcome, +}: KnowledgeBaseAuditEventParams): AuditEvent { + let doc = 'a knowledge base entry'; + if (id && name) { + doc = `knowledge base entry [id=${id}, name="${name}"]`; + } else if (id) { + doc = `knowledge base entry [id=${id}]`; + } else if (name) { + doc = `knowledge base entry [name="${name}"]`; + } + const [present, progressive, past] = knowledgeBaseEventVerbs[action]; + const message = error + ? `Failed attempt to ${present} ${doc}` + : outcome === 'unknown' + ? `User is ${progressive} ${doc}` + : `User has ${past} ${doc}`; + const type = knowledgeBaseEventTypes[action]; + + return { + message, + event: { + action, + category: [AUDIT_CATEGORY.DATABASE], + type: type ? [type] : undefined, + outcome: error ? AUDIT_OUTCOME.FAILURE : outcome ?? AUDIT_OUTCOME.SUCCESS, + }, + error: error && { + code: error.name, + message: error.message, + }, + }; +} diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts index 8e1d749c7f78..cda1781c3a1e 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/create_knowledge_base_entry.ts @@ -8,6 +8,7 @@ import { v4 as uuidv4 } from 'uuid'; import { AnalyticsServiceSetup, + type AuditLogger, AuthenticatedUser, ElasticsearchClient, Logger, @@ -18,6 +19,7 @@ import { KnowledgeBaseEntryResponse, KnowledgeBaseEntryUpdateProps, } from '@kbn/elastic-assistant-common'; +import { AUDIT_OUTCOME, KnowledgeBaseAuditAction, knowledgeBaseAuditEvent } from './audit_events'; import { CREATE_KNOWLEDGE_BASE_ENTRY_ERROR_EVENT, CREATE_KNOWLEDGE_BASE_ENTRY_SUCCESS_EVENT, @@ -26,6 +28,7 @@ import { getKnowledgeBaseEntry } from './get_knowledge_base_entry'; import { CreateKnowledgeBaseEntrySchema, UpdateKnowledgeBaseEntrySchema } from './types'; export interface CreateKnowledgeBaseEntryParams { + auditLogger?: AuditLogger; esClient: ElasticsearchClient; knowledgeBaseIndex: string; logger: Logger; @@ -37,6 +40,7 @@ export interface CreateKnowledgeBaseEntryParams { } export const createKnowledgeBaseEntry = async ({ + auditLogger, esClient, knowledgeBaseIndex, spaceId, @@ -75,13 +79,27 @@ export const createKnowledgeBaseEntry = async ({ logger, user, }); - + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + id: newKnowledgeBaseEntry?.id, + name: newKnowledgeBaseEntry?.name, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); telemetry.reportEvent(CREATE_KNOWLEDGE_BASE_ENTRY_SUCCESS_EVENT.eventType, telemetryPayload); return newKnowledgeBaseEntry; } catch (err) { logger.error( `Error creating Knowledge Base Entry: ${err} with kbResource: ${knowledgeBaseEntry.name}` ); + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + outcome: AUDIT_OUTCOME.FAILURE, + error: err, + }) + ); telemetry.reportEvent(CREATE_KNOWLEDGE_BASE_ENTRY_ERROR_EVENT.eventType, { ...telemetryPayload, errorMessage: err.message ?? 'Unknown error', diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts index c3ce7fb1a43a..006506645547 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_data_clients/knowledge_base/index.ts @@ -25,7 +25,7 @@ import { import pRetry from 'p-retry'; import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; import { StructuredTool } from '@langchain/core/tools'; -import { AnalyticsServiceSetup, ElasticsearchClient } from '@kbn/core/server'; +import { AnalyticsServiceSetup, AuditLogger, ElasticsearchClient } from '@kbn/core/server'; import { IndexPatternsFetcher } from '@kbn/data-views-plugin/server'; import { map } from 'lodash'; import { AIAssistantDataClient, AIAssistantDataClientParams } from '..'; @@ -333,6 +333,8 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { } }; + // TODO make this function private + // no telemetry, no audit logs /** * Adds LangChain Documents to the knowledge base * @@ -591,10 +593,12 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { * @param global */ public createKnowledgeBaseEntry = async ({ + auditLogger, knowledgeBaseEntry, telemetry, global = false, }: { + auditLogger?: AuditLogger; knowledgeBaseEntry: KnowledgeBaseEntryCreateProps; global?: boolean; telemetry: AnalyticsServiceSetup; @@ -617,6 +621,7 @@ export class AIAssistantKnowledgeBaseDataClient extends AIAssistantDataClient { this.options.logger.debug(`kbIndex: ${this.indexTemplateAndPattern.alias}`); const esClient = await this.options.elasticsearchClientPromise; return createKnowledgeBaseEntry({ + auditLogger, esClient, knowledgeBaseIndex: this.indexTemplateAndPattern.alias, logger: this.options.logger, diff --git a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts index c60fe9a22048..32a1a30fec25 100644 --- a/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts +++ b/x-pack/plugins/elastic_assistant/server/ai_assistant_service/index.test.ts @@ -79,6 +79,7 @@ const GetDataStreamResponse: IndicesGetDataStreamResponse = { template: 'ignored', next_generation_managed_by: 'Data stream lifecycle', prefer_ilm: false, + rollover_on_write: false, }, ], }; diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/cups_overflow.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/cups_overflow.md index 2be741a88b69..aac67e6329fb 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/cups_overflow.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/cups_overflow.md @@ -23,6 +23,15 @@ tags: - CVE-2024-47177 --- +## Update October 2, 2024 + +The following packages introduced out-of-the-box (OOTB) rules to detect the exploitation of these vulnerabilities. Please check your "Prebuilt Security Detection Rules" integration versions or visit the [Downloadable rule updates](https://www.elastic.co/guide/en/security/current/prebuilt-rules-downloadable-updates.html) site. + +- Stack Version 8.15 - Package Version 8.15.6+ +- Stack Version 8.14 - Package Version 8.14.12+ +- Stack Version 8.13 - Package Version 8.13.18+ +- Stack Version 8.12 - Package Version 8.12.23+ + ## Key takeaways * On September 26, 2024, security researcher Simone Margaritelli (@evilsocket) disclosed multiple vulnerabilities affecting the `cups-browsed`, `libscupsfilters`, and `libppd` components of the CUPS printing system, impacting versions \<= 2.0.1. @@ -232,4 +241,4 @@ We expect more to be revealed as the initial disclosure was labeled part 1. Ulti * [https://www.cve.org/CVERecord?id=CVE-2024-47176](https://www.cve.org/CVERecord?id=CVE-2024-47176) * [https://www.cve.org/CVERecord?id=CVE-2024-47177](https://www.cve.org/CVERecord?id=CVE-2024-47177) -*The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.* \ No newline at end of file +*The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.* diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elastic_releases_debmm.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elastic_releases_debmm.md index e0348caa5926..883b84f1eb44 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elastic_releases_debmm.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elastic_releases_debmm.md @@ -434,7 +434,7 @@ Covering non-commodity malware (APTs, zero-days, etc.) and emerging threats (new The expert tier focuses on advanced automation, seamless integration with other security tools, and continuous improvement through regular updates and external collaboration. While proactive threat hunting is essential for maintaining a solid security posture, it complements the ruleset management process by identifying new patterns and insights that can be incorporated into detection rules. Teams implement sophisticated automation for rule updates, ensuring continuous integration of advanced detections. At Elastic, our team is constantly refining our rulesets through daily triage, regular updates, and sharing [threat hunt queries](https://github.com/elastic/detection-rules/tree/main/hunting) in our public GitHub repository to help the community improve their detection capabilities. -![DEBMM - Tier 4](/assets/images/elastic-releases-debmm/image7.png "DEBMM - Tier 4") +![DEBMM - Tier 4](/assets/images/elastic-releases-debmm/image1.png "DEBMM - Tier 4") ##### Criteria @@ -480,11 +480,11 @@ Once you understand the DEBMM and its tiers, you can begin applying it to assess The following steps will guide you through the process: -**1. Audit Your Current Maturity Tier**: Evaluate your existing detection rulesets against the criteria outlined in the DEBMM. Identify your rulesets' strengths, weaknesses, and most significant risks to help determine your current maturity tier. For more details, see the [Example Questionnaire](#Example-Questionnaire). +**1. Audit Your Current Maturity Tier:** Evaluate your existing detection rulesets against the criteria outlined in the DEBMM. Identify your rulesets' strengths, weaknesses, and most significant risks to help determine your current maturity tier. For more details, see the [Example Questionnaire](#Example-Questionnaire). -**2. Understand the Scope of Effort: **Recognize the significant and sustained effort required to move from one tier to the next. As teams progress through the tiers, the complexity and depth of activities increase, requiring more resources, advanced skills, and comprehensive strategies. For example, transitioning from Tier 1 to Tier 2 involves systematic rule tuning and detailed gap analysis, while advancing to Tier 3 and Tier 4 requires robust external validation processes, proactive threat hunting, and sophisticated automation. +**2. Understand the Scope of Effort:** Recognize the significant and sustained effort required to move from one tier to the next. As teams progress through the tiers, the complexity and depth of activities increase, requiring more resources, advanced skills, and comprehensive strategies. For example, transitioning from Tier 1 to Tier 2 involves systematic rule tuning and detailed gap analysis, while advancing to Tier 3 and Tier 4 requires robust external validation processes, proactive threat hunting, and sophisticated automation. -**3. Set Goals for Progression: **Define specific goals for advancing to the next tier. Use the qualitative and quantitative measures to set clear objectives for each criterion. +**3. Set Goals for Progression:** Define specific goals for advancing to the next tier. Use the qualitative and quantitative measures to set clear objectives for each criterion. **4. Develop a Roadmap:** Create a detailed plan outlining the actions needed to achieve the goals. Include timelines, resources, and responsible team members. Ensure foundational practices from lower tiers are consistently applied as you progress while identifying opportunities for quick wins or significant impact by first addressing the most critical and riskiest areas for improvement. diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elevate_your_threat_hunting.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elevate_your_threat_hunting.md new file mode 100644 index 000000000000..dcf4e4839bbf --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/elevate_your_threat_hunting.md @@ -0,0 +1,226 @@ +--- +title: "Elevate Your Threat Hunting with Elastic" +slug: "elevate-your-threat-hunting" +date: "2024-10-18" +description: "Elastic is releasing a threat hunting package designed to aid defenders with proactive detection queries to identify actor-agnostic intrusions." +author: + - slug: terrance-dejesus + - slug: mika-ayenson + - slug: samir-bousseaden + - slug: justin-ibarra +image: "elevate-your-threat-hunting.jpg" +category: + - slug: security-operations +tags: + - threat hunting +--- + +We are excited to announce a new resource in the Elastic [Detection Rules](https://github.com/elastic/detection-rules) repository: a collection of hunting queries powered by various Elastic query languages! + +These hunting queries can be found under the [Hunting](https://github.com/elastic/detection-rules/tree/main/hunting) package. This initiative is designed to empower our community with specialized threat hunting queries and resources across multiple platforms, complementing our robust SIEM and EDR ruleset. These are developed to be consistent with the paradigms and methodologies we discuss in the Elastic [Threat Hunting guide](https://www.elastic.co/security/threat-hunting). + +## Why Threat Hunting? + +Threat hunting is a proactive approach to security that involves searching for hidden threats that evade conventional detection solutions while assuming breach. At Elastic, we recognize the importance of threat hunting in strengthening security defenses and are committed to facilitating this critical activity. + +While we commit a substantial amount of time and effort towards building out resilient detections, we understand that alerting on malicious behavior is only one part of an effective overall strategy. Threat hunting moves the needle to the left, allowing for a more proactive approach to understanding and securing the environment. + +The idea is that the rules and hunt queries will supplement each other in many ways. Most hunts also serve as great pivot points once an alert has triggered, as a powerful means to ascertain related details and paint a full picture. They are just as useful when it comes to triaging as proactively hunting. + +Additionally, we often find ourselves writing resilient and robust logic that just doesn’t meet the criteria for a rule, whether it is too noisy or not specific enough. This will serve as an additional means to preserve the value of these research outcomes in the form of these queries. + +## What We Are Providing + +The new Hunting package provides a diverse range of hunting queries targeting all the same environments as our rules do, and potentially even more, including: + +* Endpoints (Windows, Linux, macOS) +* Cloud (CSPs, SaaS providers, etc.) +* Network +* Large Language Models (LLM) +* Any other Elastic [integration](https://www.elastic.co/integrations) or datasource that adds value + +These queries are crafted by our security experts to help you gather initial data that is required to test your hypothesis during your hunts. These queries also include names and descriptions that may be a starting point for your hunting efforts as well. All of this valuable information is then stored in an index file (both YAML and Markdown) for management, ease-of-use and centralizing our collection of hunting queries. + +### Hunting Package + +The Hunting package has also been made to be its own module within Detection Rules with a few simple commands for easy management and searching throughout the catalogue of hunting queries. Our goal is not to provide an out-of-the-box hunting tool, but rather a foundation for programmatically managing and eventually leveraging these hunting queries. + +Existing Commands: + +**Generate Markdown** - Load TOML files or path of choice and convert to Markdown representation in respective locations. +![](/assets/images/elevate-your-threat-hunting/image6.png "") + +**Refresh Index** - Refresh indexes from the collection of queries, both YAML and Markdown. +![](/assets/images/elevate-your-threat-hunting/image4.png "") + +**Search** - Search for hunting queries based on MITRE tactic, technique or subtechnique IDs. Also includes the ability to search per data source. +![](/assets/images/elevate-your-threat-hunting/image5.png "") + +**Run Query** - Run query of choice against a particular stack to identify hits (requires pre-auth). Generates a search link for easy pivot. +![](/assets/images/elevate-your-threat-hunting/image8.png "") + +**View Hunt**- View a hunting file in TOML or JSON format. +![](/assets/images/elevate-your-threat-hunting/image7.png "") + +**Hunt Summary**- Generate count statistics based on breakdown of integration, platform, or language +![](/assets/images/elevate-your-threat-hunting/image2.png "") + +## Benefits of these Hunt Queries + +Each hunting query will be saved in its respective TOML file for programmatic use, but also have a replicated markdown file that serves as a quick reference for manual tasks or review. We understand that while automation is crucial to hunting maturity, often hunters may want a quick and easy copy-paste job to reveal events of interest. Our collection of hunt queries and CLI options offers several advantages to both novice and experienced threat hunters. Each query in the library is designed to serve as a powerful tool for detecting hidden threats, as well as offering additional layers of investigation during incident response. + +* Programmatic and Manual Flexibility: Each query is structured in a standardized TOML format for programmatic use, but also offers a Markdown version for those who prefer manual interaction. +* Scalable queries: Our hunt queries are designed with scalability in mind, leveraging the power of Elastic’s versatile and latest query languages such as ES|QL. This scalability ensures that you can continuously adapt your hunting efforts as your organization’s infrastructure grows, maintaining high levels of visibility and security. +* Integration with Elastic’s Product: These queries integrate with the Elastic Stack and our automation enables you to test quickly, enabling you to pivot through Elastic’s Security UI for deeper analysis. +* Diverse Query Types Available: Out hunt queries support a wide variety of query languages, including KQL, EQL, ES|QL, OsQuery, and YARA, making them adaptable across different data sources and environments. Whether hunting across endpoints, cloud environments, or specific integrations like Okta or LLMs, users can leverage the right language for their unique needs. +* Extended Coverage for Elastic Prebuilt Rules: While Elastic’s prebuilt detection rules offer robust coverage, there are always scenarios where vendor detection logic may not fully meet operational needs due to the specific environment or nature of the threat. These hunting queries help to fill in those gaps by offering broader and more nuanced coveraged, particularly for behaviors that don’t nearly fit into rule-based detections. +* Stepping stone for hunt initialization or pivoting: These queries serve as an initial approach to kickstart investigations or pivot from initial findings. Whether used proactively to identify potential threats or reactively to expand upon triggered alerts, these queries can provide additional context and insights based on threat hunter hypothesis and workflows. +* MITRE ATT&CK Alignment: Every hunt query includes MITRE ATT&CK mappings to provide contextual insight and help prioritize the investigation of threats according to threat behaviors. +* Community and Maintenance: This hunting module lives within the broader Elastic Detection Rules repository, ensuring continual updates alongside our prebuilt rules. Community contributions also enable our users to collaborate and expand unique ways to hunt. + +As we understand the fast-paced nature of hunting and need for automation, we have included searching capabilities and a run option to quickly identify if you have matching results from any hunting queries in this library. + +## Details of Each Hunting Analytic + +Each hunting search query in our repository includes the following details to maximize its effectiveness and ease of use: + +* **Data Source or Integration**: The origin of the data utilized in the hunt. +* **Name**: A descriptive title for the hunting query. +* **Hypothesis**: The underlying assumption or threat scenario the hunt aims to investigate. This is representated as the description. +* **Query(s)**: Provided in one of several formats, including ES|QL, EQL, KQL, or OsQuery. +* **Notes**: Additional information on how to pivot within the data, key indicators to watch for, and other valuable insights. +* **References**: Links to relevant resources and documentation that support the hunt. +* **Mapping to MITRE ATT&CK**: How the hunt correlates to known tactics, techniques, and procedures in the MITRE ATT&CK framework. + +![](/assets/images/elevate-your-threat-hunting/image9.png "") + +For those who prefer a more hands-on approach, we also provide TOML files for programmatic consumption. Additionally, we offer an easy converter to Markdown for users who prefer to manually copy and paste the hunts into their systems. + +### Hunting Query Creation Example: + +In the following example, we will explore a basic hunting cycle for the purpose of creating a new hunting query that we want to use in later hunting cycles. Note that this is an oversimplified hunting cycle that may require several more steps in a real-world application. + +**Hypothesis**: We assume that a threat adversary (TA) is targeting identity providers (IdPs), specifically Okta, by compromising cloud accounts by identifying runtime instances in CI/CD pipelines that use client credentials for authentication with Okta’s API. Their goal is to identify unsecure credentials, take these and obtain an access token whose assumed credentials are tied to an Okta administrator. + +**Evidence**: We suspect that in order to identify evidence of this, we need Okta system logs that report API activity, specifically any public client app sending access token requests where the grant type provided are client credentials. We also suspect that because the TA is unaware of the mapped OAuth scopes for this application, that when the access token request is sent, it may fail due to the incorrect OAuth scopes being explicitly sent. We also know that demonstrating proof-of-possession (DPoP) is not required for our client applications during authentication workflow because doing so would be disruptive to operations so we prioritize operability over security. + +Below is the python code used to emulate the behavior of attempting to get an access token with stolen client credentials where the scope is `okta.trustedOrigins.manage` so the actor can add a new cross-origins (CORS) policy and route client authentication through their own server. + +``` +import requests + +okta_domain = "TARGET_DOMAIN" +client_id = "STOLEN_CLIENT_ID" +client_secret = "STOLEN_CLIENT_CREDENTIALS" + +# Prepare the request +auth_url = f"{okta_domain}/oauth2/default/v1/token" +auth_data = { + "grant_type": "client_credentials", + "scope": "okta.trustedOrigins.manage" +} +auth_headers = { + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + "Authorization": f"Basic {client_id}:{client_secret}" +} +# Make the request +response = requests.post(auth_url, headers=auth_headers, data=auth_data) + +# Handle the response +if response.ok: + token = response.json().get("access_token") + print(f"Token: {token}") +else: + print(f"Error: {response.text}") +``` + +Following this behavior, we formulate a query as such for hunting where we filter out some known client applications like DataDog and Elastic’s Okta integrations. + +``` +from logs-okta.system* +| where @timestamp > NOW() - 7 day +| where + event.dataset == "okta.system" + + // filter on failed access token grant requests where source is a public client app + and event.action == "app.oauth2.as.token.grant" + and okta.actor.type == "PublicClientApp" + and okta.outcome.result == "FAILURE" + + // filter out known Elastic and Datadog actors + and not ( + okta.actor.display_name LIKE "Elastic%" + or okta.actor.display_name LIKE "Datadog%" + ) + + // filter for scopes that are not implicitly granted + and okta.outcome.reason == "no_matching_scope" +``` + +As shown below, we identify matching results and begin to pivot and dive deeper into this investigation, eventually involving incident response (IR) and escalating appropriately. + +![](/assets/images/elevate-your-threat-hunting/image10.png "") + +During our after actions report (AAR), we take note of the query that helped identify these compromised credentials and decide to preserve this as a hunting query in our forked Detection Rules repository. It doesn’t quite make sense to create a detection rule based on the fidelity of this and knowing the constant development work we do with custom applications that interact with the Okta APIs, therefore we reserve it as a hunting query. + +Creating a new hunting query TOML file in the `hunting/okta/queries` package, we add the following information: + +``` +author = "EvilC0rp Defenders" +description = """Long Description of Hunt Intentions""" +integration = ["okta"] +uuid = "0b936024-71d9-11ef-a9be-f661ea17fbcc" +name = "Failed OAuth Access Token Retrieval via Public Client App" +language = ["ES|QL"] +license = "Apache License 2.0" +notes = [Array of useful notes from our investigation] +mitre = ['T1550.001'] +query = [Our query as shown above] +``` + +With the file saved we run `python -m hunting generate-markdown FILEPATH` to generate the markdown version of it in `hunting/okta/docs/`. + +![](/assets/images/elevate-your-threat-hunting/image1.png "") + +Once saved, we can view our new hunting content by using the `view-rule` command or search for it by running the `search` command, specifying Okta as the data source and [T1550.001](https://attack.mitre.org/techniques/T1550/001/) as the subtechnique we are looking for. + +![](/assets/images/elevate-your-threat-hunting/image7.png "") + +![](/assets/images/elevate-your-threat-hunting/image5.png "") + +Last but not least, we can check that the query runs successfully by using the `run-query` command as long as we save a `.detection-rules-cfg-yaml` file with our Elasticsearch authentication details, which will tell us if we have matching results or not. + +![](/assets/images/elevate-your-threat-hunting/image8.png "") + +Now we can refresh our hunting indexes with the `refresh-index` command and ensure that our markdown file has been created. + +![](/assets/images/elevate-your-threat-hunting/image11.png "") + +## How We Plan to Expand + +Our aim is to continually enhance the Hunting package with additional queries, covering an even wider array of threat scenarios. We will update this resource based on: + +* **Emerging Threats**: Developing new queries as new types of cyber threats arise. +* **Community Feedbac**k: Incorporating suggestions and improvements proposed by our community. +* **Fill Gaps Where Traditional alerting Fails**: While we understand the power of our advanced SIEM and EDR, we also understand how some situations favor hunting instead. +* **Longevity and Maintenance**: Our hunting package lives within the very same repository we actively manage our out-of-the-box (OOTB) prebuilt detection rules for the Elastic SIEM. As a result, we plan to routinely add and update our hunting resources. +* **New Features**: Develop new features and commands to aid users with the repository of their hunting efforts. + +Our expansion would not be complete without sharing to the rest of the community in an effort to provide value wherever possible. The adoption of these resources or even paradigms surrounding threat scenarios is an important effort by our team to help hunting efforts. + +Lastly, we acknowledge and applaud the existing hunting efforts done or in-progress by our industry peers and community. We also acknowledge that maintaining such a package of hunting analytics and/or queries requires consistency and careful planning. Thus this package will receive continued support and additional hunting queries added over time, often aligning with our detection research efforts or community submissions! + +## Get Involved + +Explore the Hunting resources, utilize the queries and python package, participate in our community discussion forums to share your experiences and contribute to the evolution of this resource. Your feedback is crucial for us to refine and expand our offerings. + +* [Detection Rules Community Slack Channel](https://elasticstack.slack.com/archives/C016E72DWDS) +* Hunting “[Getting Started](https://github.com/elastic/detection-rules/tree/main/hunting)” Doc +* [Elastic Security Labs](https://twitter.com/elasticseclabs) on X + +## Conclusion + +With the expansion of these hunting resources, Elastic reaffirms its commitment to advancing cybersecurity defenses. This resource is designed for both experienced threat hunters and those new to the field, providing the tools needed to detect and mitigate sophisticated cyber threats effectively. + +Stay tuned for more updates, and happy hunting! \ No newline at end of file diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/exploring_aws_sts_assumeroot.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/exploring_aws_sts_assumeroot.md new file mode 100644 index 000000000000..b00b2cc5938a --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/exploring_aws_sts_assumeroot.md @@ -0,0 +1,363 @@ +--- +title: "Exploring AWS STS AssumeRoot" +subtitle: "AssumeRoot Abuse and Detection Strategies in AWS Organizations" +slug: "exploring-aws-sts-assumeroot" +date: "2024-12-09" +description: "Explore AWS STS AssumeRoot, its risks, detection strategies, and practical scenarios to secure against privilege escalation and account compromise using Elastic's SIEM and CloudTrail data." +author: + - slug: terrance-dejesus +image: "Security Labs Images 20.jpg" +category: + - slug: security-research +--- + +## Preamble + +Welcome to another installment of AWS detection engineering with Elastic. This article will dive into the new AWS [Security Token Service](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html) (STS) API operation, [AssumeRoot](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoot.html), simulate some practical behavior in a sandbox AWS environment, and explore detection capabilities within Elastic’s SIEM. + +What to expect from this article: + +* Basic insight into AWS STS web service +* Insight into STS’ AssumeRoot API operation +* Threat scenario using AssumeRoot with Terraform and Python code +* Detection and hunting opportunities for potential AssumeRoot abuse + +## Understanding AWS STS and the AssumeRoot API + +AWS Security Token Service (STS) is a web service that enables users, accounts, and roles to request temporary, limited-privilege credentials. For IAM users, their accounts are typically registered in AWS Identity and Access Management (IAM), where either a login profile is attached for accessing the console or access keys, and secrets are created for programmatic use by services like Lambda, EC2, and others. + +While IAM credentials are persistent, [**STS credentials**](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-regionalization) are temporary. These credentials \- comprising an access key, secret key, and session token \- are granted upon request and are valid for a specific period. Requests are typically sent to the global `sts.amazonaws.com` endpoint, which responds with temporary credentials for a user or role. These credentials can then be used to access other AWS services on behalf of the specified user or role, as long as the action is explicitly allowed by the associated permission policy. + +This process is commonly known as assuming a role, executed via the [`AssumeRole`](https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html) API. It is frequently used in AWS environments and organizations for various scenarios. For example: + +* An EC2 instance with an attached role will automatically use `AssumeRole` to retrieve temporary credentials for API requests. +* Similarly, Lambda functions often invoke `AssumeRole` to authenticate and perform their designated actions. + +Although `AssumeRole` is incredibly useful, it can pose a risk if roles are over-permissioned by the organization. Misconfigured policies with excessive permissions can allow adversaries to abuse these roles, especially in environments where the [Principle of Least Privilege](https://docs.aws.amazon.com/wellarchitected/latest/framework/sec_permissions_least_privileges.html) (PoLP) is not strictly enforced. Note that the security risks associated with AssumeRole are typically attributed to misconfigurations or not following best security practices by organizations. These are not the result of AssumeRole or even AssumeRoot development decisions. + +### Introduction to AssumeRoot + +AWS recently introduced the `AssumeRoot` API operation to STS. Similar to `AssumeRole`, it allows users to retrieve temporary credentials \- but specifically for the [root user](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-user.html) of a member account in an AWS organization. + +### What Are Member Accounts? + +In AWS, [member accounts](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html) are separate accounts within an organization that have their own IAM users, services, and roles. These accounts are distinct from the management account, but they still fall under the same organizational hierarchy. Each AWS organization is created with a unique root account tied to the email address used during its setup. Similarly, every member account requires a root user or email address at the time of its creation, effectively establishing its own root identity. + +### How Does AssumeRoot Work? + +When a privileged user in the management account needs root-level privileges for a member account, they can use the `AssumeRoot` API to retrieve temporary credentials for the member account's root user. Unlike `AssumeRole`, where the target principal is a user ARN, the target principal for `AssumeRoot` is the member account ID itself. Additionally, a task policy ARN must be specified, which defines the specific permissions allowed with the temporary credentials. + +Here are the available task policy ARNs for `AssumeRoot`: + +* [IAMAuditRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials) +* [IAMCreateRootUserPassword](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword) +* [IAMDeleteRootUserCredentials](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials) +* [S3UnlockBucketPolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy) +* [SQSUnlockQueuePolicy](https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy) + +### Potential Abuse of Task Policies + +While these predefined task policies limit what can be done with `AssumeRoot`, their scope can still be theoretically abused in the right circumstances. For example: + +* **IAMCreateRootUserPassword**: This policy grants the [`iam:CreateLoginProfile`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html) permission, allowing the creation of a login profile for a user that typically doesn't require console access. If an adversary gains access to programmatic credentials, they could create a login profile and gain console access to the account that is more persistent. +* **IAMDeleteRootUserCredentials**: This policy allows the deletion of root credentials, but also grants permissions like [`iam:ListAccessKeys`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListAccessKeys.html) and [`iam:ListMFADevices`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListMFADevices.html). These permissions could help an adversary gather critical information about access credentials or MFA configurations for further exploitation. + +## AssumeRoot in Action + +Now that we understand how AssumeRoot works at a high level, how it differs from AssumeRole, and the potential risks associated with improper security practices, let’s walk through a practical scenario to simulate its usage. It should be noted that this is one of many potential scenarios where AssumeRoot may or could be abused. As of this article's publication, no active abuse has been reported in the wild, as expected with a newer AWS functionality. + +Below is a simple depiction of what we will accomplish in the following sections: + +![AssumeRoot scenario workflow](/assets/images/exploring-aws-sts-assumeroot/image3.png) + +Before diving in, it’s important to highlight that we’re using an admin-level IAM user configured as the default profile for our local AWS CLI. This setup enables us to properly configure the environment using [Terraform](https://developer.hashicorp.com/terraform) and simulate potential threat scenarios in AWS for detection purposes. + +### Member Account Creation + +The first step is to enable centralized root access for member accounts, as outlined in the [AWS documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts.html). Centralized root access allows us to group all AWS accounts into a single organization, with each member account having its own root user. + +Next, we manually create a member account within our organization through the Accounts section in the AWS Management Console. For this scenario, the key requirement is to note the member account ID, a unique 12-digit number. For our example, we’ll assume this ID is `000000000001` and name it *AWSAssumeRoot*. Centralized management of AWS accounts is a common practice for organizations that may separate different operational services into separate AWS accounts but want to maintain centralized management. + +![AWS console showing management account and member account *AWSAssumeRoot*](/assets/images/exploring-aws-sts-assumeroot/image4.png) + +We also add the member account as the [delegated administrator](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_delegate_policies.html) for centralized root access as well, which allows that root member account to have centralized root access for any other member accounts of the organization. + +While we won’t cover it in depth, we have also enabled the new [Resource control policies](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html) (RCPs) within Identity and Access Management (IAM), which will allow central administration over permissions granted to resources within accounts in our organization, but by default, the *RCPFullAWSAccess* policy allows all permissions to all services for all principals and is attached directly to root. + +### Environment Setup + +For our simulation, we use Terraform to create an overly permissive IAM user named compromised\_user. This user is granted the predefined [AdministratorAccess](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AdministratorAccess.html) policy, which provides admin-level privileges. Additionally, we generated an access key for this user while intentionally omitting a login profile to reflect a typical setup where credentials are used programmatically. This is not an uncommon practice, especially in developer environments. + +Below is the `main.tf` configuration used to create the resources: + +``` +provider "aws" { + region = var.region +} + +data "aws_region" "current" {} + +# Create an IAM user with AdministratorAccess (simulated compromised user) +resource "aws_iam_user" "compromised_user" { + name = "CompromisedUser" +} + +# Attach AdministratorAccess Policy to the compromised user +resource "aws_iam_user_policy_attachment" "compromised_user_policy" { + user = aws_iam_user.compromised_user.name + policy_arn = "arn:aws:iam::aws:policy/AdministratorAccess" +} + +# Create access keys for the compromised user +resource "aws_iam_access_key" "compromised_user_key" { + user = aws_iam_user.compromised_user.name +} +``` + +We also define an `outputs.tf` file to capture key details about the environment, such as the region, access credentials, and the user ARN: + +``` +output "aws_region" { + description = "AWS Region where the resources are deployed" + value = var.region +} + +output "compromised_user_access_key" { + value = aws_iam_access_key.compromised_user_key.id + sensitive = true + description = "Access key for the compromised IAM user" +} + +output "compromised_user_secret_key" { + value = aws_iam_access_key.compromised_user_key.secret + sensitive = true + description = "Secret key for the compromised IAM user" +} + +output "compromised_user_name" { + value = aws_iam_user.compromised_user.name + description = "Name of the compromised IAM user" +} + +output "compromised_user_arn" { + value = aws_iam_user.compromised_user.arn + description = "ARN of the compromised IAM user" +} +``` + +Once we run `terraform apply`, the configuration creates a highly permissive IAM user (`compromised_user`) with associated credentials. These credentials simulate those that an adversary might obtain for initial access or escalating privileges. + +This is one of the first hurdles for an adversary, collecting valid credentials. In today’s threat landscape information stealer malware and phishing campaigns are more common than ever, aimed at obtaining credentials that can be sold or used for lateral movement. While this is a hurdle, the probability of compromised credentials for initial access is high \- such as those with [SCATTERED SPIDER](https://www.cisa.gov/sites/default/files/2023-11/aa23-320a_scattered_spider_0.pdf) and [SCARLETEEL](https://sysdig.com/blog/scarleteel-2-0/). + +![](/assets/images/exploring-aws-sts-assumeroot/image1.png) + +### Establish an STS Client Session with Stolen Credentials + +The next step is to establish an STS client session using the compromised credentials (`compromised_user` access key and secret key). This session allows the adversary to make requests to AWS STS on behalf of the compromised user. + +Here’s the Python code to establish the STS client using the [AWS Boto3 SDK](https://aws.amazon.com/sdk-for-python/) (the AWS SDK used to create, configure, and manage AWS services, such as Amazon EC2 and Amazon S3). This Python code is used to create the STS client with stolen IAM user credentials: + +``` + sts_client = boto3.client( + "sts", + aws_access_key_id=compromised_access_key, + aws_secret_access_key=compromised_secret_key, + region_name=region, + endpoint_url=f'https://sts.{region}.amazonaws.com' + ) + ``` + +![Terminal output when creating STS client with stolen IAM user credentials](/assets/images/exploring-aws-sts-assumeroot/image7.png) + +**Note:** During testing, we discovered that the `endpoint_url` must explicitly point to `https://sts.<region>.amazonaws.com`. Omitting this may result in an `InvalidOperation` error when attempting to invoke the `AssumeRoot` API. + +This STS client session forms the foundation for simulating an adversary's actions as we have taken compromised credentials and initiated our malicious actions. + +### Assume Root for Member Account on Behalf of Compromised User + +After establishing an STS client session as the compromised user, we can proceed to call the AssumeRoot API. This request allows us to assume the root identity of a member account within an AWS Organization. For the request, the TargetPrincipal is set to the member account ID we obtained earlier, the session duration is set to 900 seconds (15 minutes), and the TaskPolicyArn is defined as `IAMCreateRootUserPassword`. This policy scopes the permissions to actions related to creating or managing root login credentials. + +A notable permission included in this policy is [`CreateLoginProfile`](https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateLoginProfile.html), which enables the creation of a login password for the root user. This allows access to the AWS Management Console as the root user. + +Below is the Python code to assume root of member account `000000000001`, with permissions scoped by *IAMCreateRootUserPassword*. + +``` +response = sts_client.assume_root( + TargetPrincipal=member_account_id, + DurationSeconds=900, + TaskPolicyArn={"arn": "arn:aws:iam::aws:policy/root-task/IAMCreateRootUserPassword"}, +) +root_temp_creds = response["Credentials"] +``` + +If the AssumeRoot request is successful, the response provides temporary credentials (`root_temp_creds`) for the root account of the target member. These credentials include an access key, secret key, and session token, enabling temporary root-level access for the duration of the session. + +![Terminal output showing AssumeRoot with IAMCreateRootUserPassword for AWSAssumeRoot member account +](/assets/images/exploring-aws-sts-assumeroot/image6.png) + +### Creating a Login Profile for the Member Root Account + +With temporary root credentials in hand, the next step is to establish an authenticated IAM client session as the root user of the member account. Using this session, we can call the `create_login_profile()` method. This method allows us to assign a login password to the root user, enabling console access. + +The following Python code establishes an authenticated IAM client and creates a login profile: + +``` +iam_client = boto3.client( + "iam", + aws_access_key_id=root_temp_creds["AccessKeyId"], + aws_secret_access_key=root_temp_creds["SecretAccessKey"], + aws_session_token=root_temp_creds["SessionToken"], +) + +response = iam_client.create_login_profile() +``` + +It’s worth noting that the `create_login_profile()` method requires no explicit parameters for the root user, as it acts on the credentials of the currently authenticated session. In this case, it will apply to the root user of the member account. + +![Terminal output showing IAM client established as Root member account and CreateLoginProfile request](/assets/images/exploring-aws-sts-assumeroot/image5.png) + + +### Reset the Administrator Password and Login to the AWS Console + +At this stage, we’re nearly complete\! Let’s recap the progress so far: + +1. Using compromised IAM user credentials, we established an STS session to assume the identity of an overly permissive user. +2. Leveraging this session, we assumed the identity of the root user of a target member account, acquiring temporary credentials scoped to the `IAMCreateRootUserPassword` task policy. +3. With these temporary root credentials, we established an IAM client session and successfully created a login profile for the root user. + +The final step involves resetting the root user password to gain permanent access to the AWS Management Console. To do this, visit the AWS console login page and attempt to log in as the root user. Select the “Forgot Password” option to initiate the password recovery process. This will prompt a CAPTCHA challenge, after which a password reset link is sent to the root user’s email address. This would be the third roadblock for an adversary as they would need access to the root user’s email inbox to continue with the password reset workflow. It should be acknowledged that if *CreateLoginProfile* is called, you can specify the password for the user and enforce a “password reset required”. However, this is not allowed for root accounts by default, and for good reason by AWS. Unlike the first hurdle of having valid credentials, access to a user’s inbox may prove more difficult and less likely, but again, with enough motivation and resources, it is still possible. + +![Password recovery request from AWS sign-in for root](/assets/images/exploring-aws-sts-assumeroot/image2.png) + +After selecting the password reset link, you can set a new password for the root user. This step provides lasting access to the console as the root user. Unlike the temporary credentials obtained earlier, this access is no longer limited by the session duration or scoped permissions of the IAMCreateRootUserPassword policy, granting unrestricted administrative control over the member account. + +![Successful login as root for AWSAssumeRoot member account](/assets/images/exploring-aws-sts-assumeroot/image8.png) + +**Before moving on, if you followed along and tried this in your environment, we want to gently remind you to use Terraform to remove testing resources** using the terraform destroy command in the same folder where you initialized and deployed the resources. + +## Detection and Hunting Opportunities + +While exploring cloud features and APIs from an adversary's perspective is insightful, our ultimate responsibility lies in detecting and mitigating malicious or anomalous behavior, alerting stakeholders, and responding effectively. Also, while such a scenario has not been publicly documented in the wild, we should not wait to be a victim either and be reactive, hence the reason for our whitebox scenario. + +The following detection and hunting queries rely on AWS CloudTrail data ingested into the Elastic Stack using the [AWS integration](https://www.elastic.co/docs/current/integrations/aws). If your environment differs, you may need to adjust these queries for custom ingestion processes or adapt them for a different SIEM or query tool. + +**Note:** Ensure that AWS CloudTrail is enabled for all accounts in your organization to provide comprehensive visibility into activity across your AWS environment. You may also need to enable the specific trail used for monitoring across the entire organization so all member accounts are observed properly. + +### Hunting \- Unusual Action for IAM User Access Key + +This query identifies potentially compromised IAM access keys that are used to make unusual API calls. It sorts the results in ascending order to surface less frequent API calls within the last two weeks. This query can be adjusted to account for different API calls or include other CloudTrail-specific fields. + +Hunting Query: [AWS IAM Unusual AWS Access Key Usage for User](https://github.com/elastic/detection-rules/blob/7b88b36d294407cc1ea2ab1b0acbbbf3104162a9/hunting/aws/docs/iam_unusual_access_key_usage_for_user.md) + +MITRE ATT\&CK: + +* T1078.004 \- [Valid Accounts: Cloud Accounts](https://attack.mitre.org/techniques/T1078/004/) + +Language: ES|QL + +``` +FROM logs-aws.cloudtrail* +| WHERE @timestamp > now() - 14 day +| WHERE + event.dataset == "aws.cloudtrail" + and event.outcome == "success" + and aws.cloudtrail.user_identity.access_key_id IS NOT NULL + and aws.cloudtrail.resources.arn IS NOT NULL + and event.action NOT IN ("GetObject") +| EVAL daily_buckets = DATE_TRUNC(1 days, @timestamp) +| STATS + api_counts = count(*) by daily_buckets, aws.cloudtrail.user_identity.arn, aws.cloudtrail.user_identity.access_key_id, aws.cloudtrail.resources.arn, event.action +| WHERE api_counts < 2 +| SORT api_counts ASC +``` + +### Detection \- Unusual Assume Root Action by Rare IAM User + +Detection Rule: [AWS STS AssumeRoot by Rare User and Member Account](https://github.com/elastic/detection-rules/blob/main/rules/integrations/aws/privilege_escalation_sts_assume_root_from_rare_user_and_member_account.toml) + +This query identifies instances where the `AssumeRoot` API call is made by an IAM user ARN and member account that have not performed this action in the last 14 days. This anomaly-based detection uses Elastic’s [New Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) detection rule. + +* The `aws.cloudtrail.user_identity.arn` field identifies the source IAM user from the management AWS account. +* The `aws.cloudtrail.resources.account_id` field reflects the target member account. + +MITRE ATT\&CK: + +* T1548.005 \- [Temporary Elevated Cloud Access](https://attack.mitre.org/techniques/T1548/005/) +* T1098.003 \- [Additional Cloud Roles](https://attack.mitre.org/techniques/T1098/003/) + +Language: KQL + +``` +event.dataset: "aws.cloudtrail" + and event.provider: "sts.amazonaws.com" + and event.action: "AssumeRoot" + and event.outcome: "success" +``` + +New Term Fields: +If any combination of these fields has not been seen executing AssumeRoot within the last 14 days, an alert is generated. + +* `aws.cloudtrail.user_identity.arn` +* `aws.cloudtrail.resources.account_id` + +### Detection \- Self-Created Login Profile for Root Member Account + +This query detects instances where a login profile is created for a root member account by the root account itself, potentially indicating unauthorized or anomalous behavior. + +Detection Rule: [AWS IAM Login Profile Added for Root](https://github.com/elastic/detection-rules/blob/4374128458d116211d5d22993b6d87f6c82a30a0/rules/integrations/aws/persistence_iam_create_login_profile_for_root.toml) + +MITRE ATT\&CK: + +* T1098.003 \- [Account Manipulation: Additional Cloud Roles](https://attack.mitre.org/techniques/T1098/003/) +* T1548.005 \- [Abuse Elevation Control Mechanism: Temporary Elevated Cloud Access](https://attack.mitre.org/techniques/T1548/005/) +* T1078.004 \- [Valid Accounts: Cloud Accounts](https://attack.mitre.org/techniques/T1078/004/) + +Language: ES|QL + +``` +FROM logs-aws.cloudtrail* +| WHERE + // filter for CloudTrail logs from IAM + event.dataset == "aws.cloudtrail" + and event.provider == "iam.amazonaws.com" + // filter for successful CreateLoginProfile API call + and event.action == "CreateLoginProfile" + and event.outcome == "success" + // filter for Root member account + and aws.cloudtrail.user_identity.type == "Root" + // filter for an access key existing which sources from AssumeRoot + and aws.cloudtrail.user_identity.access_key_id IS NOT NULL + // filter on the request parameters not including UserName which assumes self-assignment + and NOT TO_LOWER(aws.cloudtrail.request_parameters) LIKE "*username*" +| keep + @timestamp, + aws.cloudtrail.request_parameters, + aws.cloudtrail.response_elements, + aws.cloudtrail.user_identity.type, + aws.cloudtrail.user_identity.arn, + aws.cloudtrail.user_identity.access_key_id, + cloud.account.id, + event.action, + source.address + source.geo.continent_name, + source.geo.region_name, + source.geo.city_name, + user_agent.original, + user.id +``` + +These detections are specific to our scenario, however, are not fully inclusive regarding all potential AssumeRoot abuse. If you choose to explore and discover some additional hunting or threat detection opportunities, feel free to share in our [Detection Rules](https://github.com/elastic/detection-rules) repository or the [Threat Hunting](https://github.com/elastic/detection-rules/tree/main/hunting) library of ours. + +## Hardening Practices for AssumeRoot Use + +AWS [documentation](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) contains several important considerations for best security practices regarding IAM, STS, and many other services. However, cloud security is not a “one size fits all” workflow and security practices should be tailored to your environment, risk-tolerance, and more. + +**Visibility is Key:** If you can’t see it, you can’t protect it. Start by enabling CloudTrail with organization-wide trails to log activity across all accounts. Focus on capturing IAM and STS operations for insights into access and permission usage. Pair this with Security Hub for continuous monitoring and tools like Elastic or GuardDuty to hunt for unusual AssumeRoot actions. + +**Lock Down AssumeRoot Permissions:** Scope AssumeRoot usage to critical tasks only, like audits or recovery, by restricting task policies to essentials like IAMAuditRootUserCredentials. Assign these permissions to specific roles in the management account and keep those roles tightly controlled. Regularly review and remove unnecessary permissions to maintain the PLoP. + +**MFA and Guardrails for Root Access:** Enforce MFA for all users, especially those with access to AssumeRoot. Use AWS Organizations to disable root credential recovery unless absolutely needed and remove unused root credentials entirely. RCPs can help centralize and tighten permissions for tasks involving AssumeRoot or other sensitive operations. + +# Conclusion + +We hope this article provides valuable insight into AWS’ AssumeRoot API operation, how it can be abused by adversaries, and some threat detection and hunting guidance. Abusing AssumeRoot is one of many living-off-the-cloud (LotC) techniques that adversaries have the capability to target, but we encourage others to explore, research, and share their findings accordingly with the community and AWS. \ No newline at end of file diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/false_file_immutability.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/false_file_immutability.md index 17830f2f3dab..94d14462751a 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/false_file_immutability.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/false_file_immutability.md @@ -11,12 +11,12 @@ category: - slug: vulnerability-updates --- -# Introduction +## Introduction This article will discuss a previously-unnamed vulnerability class in Windows, showing how long-standing incorrect assumptions in the design of core Windows features can result in both undefined behavior and security vulnerabilities. We will demonstrate how one such vulnerability in the Windows 11 kernel can be exploited to achieve arbitrary code execution with kernel privileges. -# Windows file sharing +## Windows file sharing When an application opens a file on Windows, it typically uses some form of the Win32 [**CreateFile**](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew) API. @@ -43,7 +43,7 @@ Sharing isn’t mandatory. Callers can pass a share mode of zero to obtain exclu > An open file that is not shared (dwShareMode set to zero) cannot be opened again, either by the application that opened it or by another application, until its handle has been closed. This is also referred to as exclusive access. -## Sharing enforcement +### Sharing enforcement In the kernel, sharing is enforced by filesystem drivers. As a file is opened, it’s the responsibility of the filesystem driver to call [**IoCheckShareAccess**](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-iocheckshareaccess) or [**IoCheckLinkShareAccess**](https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-iochecklinkshareaccess) to see whether the requested **DesiredAccess**/**ShareMode** tuple is compatible with any existing handles to the file being opened. [NTFS](https://learn.microsoft.com/en-us/windows-server/storage/file-server/ntfs-overview) is the primary filesystem on Windows, but it’s closed-source, so for illustrative purposes we’ll instead look at Microsoft’s FastFAT sample code performing [the same check](https://github.com/Microsoft/Windows-driver-samples/blob/622212c3fff587f23f6490a9da939fb85968f651/filesys/fastfat/create.c#L6822-L6884). Unlike an IDA decompilation, it even comes with comments! @@ -119,7 +119,7 @@ if (FlagOn(*DesiredAccess, FILE_WRITE_DATA) || DeleteOnClose) { Another way to think of this check is that **ZwMapViewOfSection(SEC_IMAGE)** implies no-write-sharing as long as the view exists. -# Authenticode +## Authenticode The [Windows Authenticode Specification](https://download.microsoft.com/download/9/c/5/9c5b2167-8017-4bae-9fde-d599bac8184a/authenticode_pe.docx) describes a way to employ cryptography to “sign” PE files. A “digital signature” cryptographically attests that the PE was produced by a particular entity. Digital signatures are tamper-evident, meaning that any material modification of signed files should be detectable because the digital signature will no longer match. Digital signatures are typically appended to the end of PE files. @@ -128,7 +128,7 @@ The [Windows Authenticode Specification](https://download.microsoft.com/download Authenticode can’t apply traditional hashing (e.g. **sha256sum**) in this case, because the act of appending the signature would change the file’s hash, breaking the signature it just generated. Instead, the Authenticode specification describes an algorithm to skip specific portions of the PE file that will be changed during the signing process. This algorithm is called **authentihash**. You can use authentihash with any hashing algorithm, such as SHA256. When a PE file is digitally signed, the file’s authentihash is what’s actually signed. -## Code integrity +### Code integrity Windows has a few different ways to validate Authenticode signatures. User mode applications can call [**WinVerifyTrust**](https://learn.microsoft.com/en-us/windows/win32/api/wintrust/nf-wintrust-winverifytrust) to validate a file’s signature in user mode. The Code Integrity (CI) subsystem, residing in ```ci.dll```, validates signatures in the kernel. If [Hypervisor-Protected Code Integrity](https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/device-guard-and-credential-guard) is running, the Secure Kernel employs ```skci.dll``` to validate Authenticode. This article will focus on Code Integrity (```ci.dll```) in the regular kernel. @@ -148,7 +148,7 @@ User Mode Code Integrity (UMCI): KMCI and UMCI implement different policies for different scenarios. For example, the policy for Protected Processes is different from that of INTEGRITYCHECK. -# Incorrect assumptions +## Incorrect assumptions Microsoft [documentation](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea) implies that files successfully opened without write sharing can’t be modified by another user or process. @@ -176,7 +176,7 @@ If those paged-out pages are later touched, the CPU will issue a page fault and Note the following exception: The memory manager may treat PE-relocated pages as unmodified, dynamically reapplying relocations during page faults. -## Page hashes +### Page hashes Page hashes are a list of hashes of each 4KB page within a PE file. Since pages are 4KB, page faults typically occur on 4KB of data at a time. Full Authenticode verification requires the entire contiguous PE file, which isn’t available during a page fault. Page hashes allow the MM to validate hashes of individual pages during page faults. @@ -187,7 +187,7 @@ CI can also compute them on-the-fly during signature validation, a mechanism we Page hashes are not free - they use CPU and slow down page faults. They’re not used in most cases. -# Attacking code integrity +## Attacking code integrity Imagine a scenario where a ransomware operator wants to ransom a hospital, so they send a phishing email to a hospital employee. The employee opens the email attachment and enables macros, running the ransomware. The ransomware employs a UAC bypass to immediately elevate to admin, then attempts to terminate any security software on the system so it can operate unhindered. Anti-Malware services run as [Protected Process Light](https://learn.microsoft.com/en-us/windows/win32/services/protecting-anti-malware-services-) (PPL), protecting them from tampering by malware with admin rights, so the ransomware can’t terminate the Anti-Malware service. @@ -202,7 +202,7 @@ When a network redirector is in use, the server on the other end of the pipe nee An attacker can employ a network redirector to modify a PPL’s DLL server-side, bypassing sharing restrictions. This means that PEs backing an executable image section are incorrectly assumed to be immutable. This is a class of vulnerability that we are calling **False File Immutability** (FFI). -## Paging exploitation +### Paging exploitation If an attacker successfully exploits False File Immutability to inject code into an in-use PE, wouldn’t page hashes catch such an attack? The answer is: sometimes. If we look at the following table, we can see that page hashes are enforced for kernel drivers and Protected Processes, but not for PPL, so let’s pretend we’re an attacker targeting PPL. @@ -219,7 +219,7 @@ Last year at Black Hat Asia 2023 ([abstract](https://www.blackhat.com/asia-23/br Alongside the presentation, we released the [PPLFault exploit](https://github.com/gabriellandau/PPLFault) which demonstrates the vulnerability by dumping the memory of an otherwise-protected PPL. We also released the GodFault exploit chain, which combines the PPLFault Admin-to-PPL exploit with the AngryOrchard PPL-to-kernel exploit to achieve full read/write control of physical memory from user mode. We did this to motivate Microsoft to take action on a vulnerability that MSRC [declined to fix](https://www.elastic.co/security-labs/forget-vulnerable-drivers-admin-is-all-you-need) because it did not meet their [servicing criteria](https://www.microsoft.com/en-us/msrc/windows-security-servicing-criteria). Thankfully, the Windows Defender team at Microsoft stepped up, [releasing a fix](https://x.com/GabrielLandau/status/1757818200127946922) in February 2024 that enforces dynamic page hashes for executable images loaded over network redirectors, breaking PPLFault. -# New research +## New research Above, we discussed Authenticode signatures embedded within PE files. In addition to embedded signatures, Windows supports a form of detached signature called a [security catalog](https://learn.microsoft.com/en-us/windows-hardware/drivers/install/catalog-files). Security catalogs (.cat files) are essentially a list of signed authentihashes. Every PE with an authentihash in that list is considered to be signed by that signer. Windows keeps a large collection of catalog files in ```C:\Windows\System32\CatRoot``` which CI loads, validates, and caches. @@ -240,7 +240,7 @@ Breaking this down, we see a few key insights. First, **ZwCreateSection(SEC_COMM Next, the file is opened without **FILE_SHARE_WRITE**, meaning write sharing is denied. This is intended to prevent modification of the security catalog during processing. However, as we have shown above, this is a bad assumption and another example of False File Immutability. It should be possible, in theory, to perform a PPLFault-style attack on security catalog processing. -## Planning the attack +### Planning the attack ![](/assets/images/false-file-immutability/image11.png) @@ -254,7 +254,7 @@ The general flow of the attack is as follows: 7. CI finds the malicious driver’s authentihash in the catalog and loads the driver. At this point, the attacker has achieved arbitrary code execution in the kernel. -## Implementation and considerations +### Implementation and considerations The plan is to use a PPLFault-style attack, but there are some important differences in this situation. PPLFault used an [opportunistic lock](https://learn.microsoft.com/en-us/windows/win32/fileio/opportunistic-locks) (oplock) to deterministically freeze the victim process’s initialization. This gave the attacker time to switch over to the payload and flush the system working set. Unfortunately, we couldn’t find any good opportunities for oplocks here. Instead, we’re going to pursue a probabilistic approach: rapidly toggling the security catalog between the malicious and benign versions. @@ -279,14 +279,14 @@ The attacker wins if CI validates a benign catalog then parses a malicious one. ![Code Integrity validating a benign catalog, then parsing a malicious one](/assets/images/false-file-immutability/image20.png) -## Exploit demo +### Exploit demo We named the exploit **ItsNotASecurityBoundary** as an homage to MSRC's [policy](https://www.microsoft.com/en-us/msrc/windows-security-servicing-criteria) that "Administrator-to-kernel is not a security boundary.” The code is in GitHub [here](https://github.com/gabriellandau/ItsNotASecurityBoundary). Demo video [here](https://drive.google.com/file/d/13Uw38ZrNeYwfoIuD76qlLgyXP8kRc8Nz/view?usp=sharing). -# Understanding these vulnerabilities +## Understanding these vulnerabilities In order to properly defend against these vulnerabilities, we first need to understand them better. @@ -311,7 +311,7 @@ First, the attacking client sets a packet’s structure’s length field to 16 b Double-read vulnerabilities frequently apply to shared-memory scenarios. They commonly occur in drivers that operate on user-writable buffers. Due to False File Immutability, developers need to be aware that their scope is actually much wider, and includes all files writable by attackers. Denying write sharing does not necessarily prevent file modification. -## Affected Operations +### Affected Operations What types of operations are affected by False File Immutability? @@ -322,7 +322,7 @@ What types of operations are affected by False File Immutability? | Regular I/O | **ReadFile** **ZwReadFile** | 1. Avoid double reads\ 2. Copy the file to a heap buffer before processing | -## What else could be vulnerable? +### What else could be vulnerable? Looking for potentially-vulnerable calls to **ZwMapViewOfSection** in the NT kernel yields quite a few interesting functions: @@ -339,27 +339,27 @@ Looking outside of the NT kernel, we can find other drivers to investigate: ![Potentially-vulnerable uses of **ZwMapViewOfSection** in Windows 11 kernel drivers](/assets/images/false-file-immutability/image1.png) -## Don’t forget about user mode +### Don’t forget about user mode We’ve mostly been discussing the kernel up to this point, but it’s important to note that any user mode application that calls **ReadFile**, **MapViewOfFile**, or **LoadLibrary** on an attacker-controllable file, denying write sharing for immutability, may be vulnerable. Here’s a few hypothetical examples. -### MapViewOfFile +#### MapViewOfFile Imagine an application that is split into two components - a low-privileged worker process with network access, and a privileged service that installs updates. The worker downloads updates and stages them to a specific folder. When the privileged service sees a new update staged, it first validates the signature before installing the update. An attacker could abuse FFI to modify the update after the signature check. -### ReadFile +#### ReadFile Since files are subject to double-read vulnerabilities, anything that parses complex file formats may be vulnerable, including antivirus engines and search indexers. -### LoadLibrary +#### LoadLibrary Some applications rely on UMCI to prevent attackers from loading malicious DLLs into their processes. As we’ve shown with PPLFault, FFI can defeat UMCI. -# Stopping the exploit +## Stopping the exploit Per their official servicing guidelines, MSRC won’t service Admin -> Kernel vulnerabilities by default. In this parlance, servicing means “fix via security update.” This type of vulnerability, however, allows malware to bypass [AV Process Protections](https://learn.microsoft.com/en-us/windows/win32/services/protecting-anti-malware-services-), leaving AV and EDR vulnerable to instant-kill attacks. @@ -376,7 +376,7 @@ As mentioned above in the Affected Operations section, applications can mitigate An alternative mitigation strategy to break these types of exploits is to pin the pages of the file mapping into physical memory using an API such as **MmProbeAndLockPages**. This prevents eviction of those pages when the attacker empties the working set. -## End-user detection and mitigation +### End-user detection and mitigation Fortunately, there is a way for end-users to mitigate this exploit without changes from Microsoft – Hypervisor Protected Code Integrity (HVCI). If HVCI is enabled, CI.dll doesn’t do catalog parsing at all. Instead, it sends the catalog contents to the Secure Kernel, which runs in a separate virtual machine on the same host. The Secure Kernel stores the received catalog contents in its own heap, from which signature validation and parsing are performed. Just like with the **ExAllocatePool** mitigation described above, the exploit is mitigated because file changes have no effect on the heap copy. @@ -387,7 +387,7 @@ The probabilistic nature of this attack means that there are likely many failed ![**Microsoft-Windows-CodeIntegrity/Operational** event log showing an invalid security catalog](/assets/images/false-file-immutability/image4.png) -# Disclosure +## Disclosure The disclosure timeline is as follows: - 2024-02-14: We reported ItsNotASecurityBoundary and FineButWeCanStillEasilyStopIt to MSRC as VULN-119340, suggesting **ExAllocatePool** and **MmProbeAndLockPages** as simple low-risk fixes @@ -397,7 +397,7 @@ The disclosure timeline is as follows: - 2024-06-14: MSRC closed the case, stating "We have completed our investigation and determined that the case doesn't meet our bar for servicing at this time. As a result, we have opened a next-version candidate bug for the issue, and it will be evaluated for upcoming releases. Thanks, again, for sharing this report with us." -# Fixing Code Integrity +## Fixing Code Integrity Looking at the original implementation of **CI!I_MapAndSizeDataFile**, we can see the legacy code calling **ZwCreateSection** and **ZwMapViewOfSection**: @@ -408,7 +408,7 @@ Contrast that with the new **CI!CipMapAndSizeDataFileWithMDL**, which follows th ![The new **CI!CipMapAndSizeDataFileWithMDL** has a mitigation](/assets/images/false-file-immutability/image3.png) -# Summary and conclusion +## Summary and conclusion Today we discussed and named a bug class: **False File Immutability**. We are aware of two public exploits that leverage it, PPLFault and ItsNotASecurityBoundary. diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/ghostpulse_haunts_victims_using_defense_evasion_bag_o_tricks.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/ghostpulse_haunts_victims_using_defense_evasion_bag_o_tricks.md index a96832f5de73..21392357f132 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/ghostpulse_haunts_victims_using_defense_evasion_bag_o_tricks.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/ghostpulse_haunts_victims_using_defense_evasion_bag_o_tricks.md @@ -10,8 +10,15 @@ image: "photo-edited-05@2x.jpg" category: - slug: attack-pattern - slug: malware-analysis +tags: + - ghostpulse + - ref8207 --- +## Update + +In October 2024, we released an update to stage 2 of GHOSTPULSE that includes new evasion techniques. You can check it out [here](https://www.elastic.co/security-labs/tricks-and-treats). + ## Preamble Elastic Security Labs has observed a campaign to compromise users with signed [MSIX](https://learn.microsoft.com/en-us/windows/msix/overview) application packages to gain initial access. The campaign leverages a stealthy loader we call GHOSTPULSE which decrypts and injects its final payload to evade detection. @@ -71,7 +78,7 @@ Next, GHOSTPULSE builds an Import Address Table (IAT) incorporating essential AP ![Stage 1 hashing algorithm](/assets/images/ghostpulse-haunts-victims-using-defense-evasion-bag-o-tricks/image13.png) -``` +``` python # Python code used for API hashing def calculate_api_name_hash(api_name): value = 0 @@ -82,7 +89,7 @@ def calculate_api_name_hash(api_name): Below is the Stage 1 IAT structure reconstructed from the GHOSTPULSE malware sample, provided for reference: -``` +``` c struct core_stage1_IAT { void *kernel32_LoadLibraryW; @@ -124,7 +131,7 @@ It then proceeds with its operation by reading and parsing the file named `hando The initial phase involves identifying the commencement of the encrypted data by searching for the IDAT string in the file, which is followed by a distinctive 4-byte tag value. If the tag corresponds to the value stored in the malware's configuration, the malware extracts the bytes of the encrypted blob. The initial structure is as follows: -``` +``` c struct initial_idat_chunk { DWORD size_of_chunk; @@ -145,7 +152,7 @@ struct initial_idat_chunk In the second step, the malware locates the next occurrence of IDAT and proceeds to extract the encrypted chunks that follow it which has the following format: -``` +``` c struct next_idat_chunk { DWORD size_of_chunk; @@ -174,7 +181,7 @@ This technique is known as “module stomping”. The following image shows the Stage 2 initiates by constructing a new IAT structure and utilizing the CRC32 algorithm as the API name hashing mechanism. The following is the IAT structure of stage 2: -``` +``` c struct core_stage2_IAT { void *kernel32_module; @@ -244,7 +251,7 @@ Concerning NT functions, the malware reads the ntdll.dll library from disk and w The following is the structure used by the malware to store NT API offsets: -``` +``` c struct __unaligned __declspec(align(4)) core_stage2_nt_offsets_table { __int64 ntdll_module; diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/globally_distributed_stealers.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/globally_distributed_stealers.md index 65a42ae95c13..5a452164b6a1 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/globally_distributed_stealers.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/globally_distributed_stealers.md @@ -181,7 +181,7 @@ To fully leverage detection capabilities listed below for these threats with Ela - [Connection to WebService by an Unsigned Binary](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/command_and_control_connection_to_webservice_by_an_unsigned_binary.toml) - [Connection to WebService by a Signed Binary Proxy](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/command_and_control_connection_to_webservice_by_a_signed_binary_proxy.toml) - - [Suspicious DNS Query from Mounted Virtual Disk](https://github.com/elastic/endpoint-rules/blob/main/rules/command_and_control_execution_wevsvc_from_virtual_disk.toml) + - [Suspicious DNS Query from Mounted Virtual Disk](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/command_and_control_suspicious_dns_query_from_mounted_virtual_disk.toml) - [Suspicious Access to Web Browser Credential Stores](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/credential_access_suspicious_access_to_web_browser_credential_stores.toml) - [Web Browser Credential Access via Unsigned Process](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/credential_access_web_browser_credential_access_via_unsigned_process.toml) - [Access to Browser Credentials from Suspicious Memory](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/credential_access_access_to_browser_credentials_from_suspicious_memory.toml) diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/inital_research_of_jokerspy.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/inital_research_of_jokerspy.md index 4adcfcecaa03..12c65e414ddd 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/inital_research_of_jokerspy.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/inital_research_of_jokerspy.md @@ -173,11 +173,6 @@ Techniques and Sub techniques represent how an adversary achieves a tactical goa ## Detection logic -### Prevention - -- [Non-Native Dylib Extracted into Suspicious Directory](https://github.com/elastic/endpoint-rules/blob/1006a4d9a3d95e35149a3640fadf68a32c02afa9/rules/execution_dylib_extracted_to_new_directory.toml#L10) -- [Potential Privilege Escalation via TCC bypass with fake TCC.db](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/privilege_escalation_potential_privilege_escalation_via_tcc_bypass_with_fake_tcc.db.toml) - ### YARA Elastic Security has created YARA rules to identify this activity. Below are YARA rules to identify the JOKERSPY backdoor and SwiftBelt tool. diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/itw_windows_lpe_0days_insights_and_detection_strategies.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/itw_windows_lpe_0days_insights_and_detection_strategies.md index 3a0ef112df81..7801e7762e00 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/itw_windows_lpe_0days_insights_and_detection_strategies.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/itw_windows_lpe_0days_insights_and_detection_strategies.md @@ -137,7 +137,7 @@ process.name :"dwm.exe" and user.id:S-1-5-90-0-* and ![DWM dropping reflective DLL to disk post exploit execution](/assets/images/itw-windows-lpe-0days-insights-and-detection-strategies/image5.png) -Below is a [detection](https://github.com/elastic/endpoint-rules/blob/20833cbeaac4284ecf9818b44438bda4bc3cae18/rules/privilege_escalation_logonui_dcomp.toml) EQL query that looks for the LogonUI DLL load hijack: +Below is a [detection](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/privilege_escalation_potential_privilege_escalation_via_logonui.toml) EQL query that looks for the LogonUI DLL load hijack: ``` library where process.executable : "?:\\Windows\\System32\\LogonUI.exe" and @@ -282,7 +282,7 @@ api where process.pid != 4 and process.Ext.api.name : "WriteProcessMemory" process.Ext.api.parameters.address > 281474976710655 ``` -Here is an example of these [alerts](https://github.com/elastic/endpoint-rules/blob/20833cbeaac4284ecf9818b44438bda4bc3cae18/rules/privilege_escalation_api_kernel_address_space.toml) triggering on exploits leveraging this primitive: +Here is an example of these [alerts](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/privilege_escalation_suspicious_kernel_mode_address_manipulation.tom) triggering on exploits leveraging this primitive: ![Detection of PreviousMode abuse](/assets/images/itw-windows-lpe-0days-insights-and-detection-strategies/image7.png) diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/katz_and_mouse_game.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/katz_and_mouse_game.md new file mode 100644 index 000000000000..b9db8c5a904a --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/katz_and_mouse_game.md @@ -0,0 +1,414 @@ +--- +title: "Katz and Mouse Game: MaaS Infostealers Adapt to Patched Chrome Defenses" +slug: "katz-and-mouse-game" +date: "2024-10-28" +description: "Elastic Security Labs breaks down bypass implementations from the infostealer ecosystem’s reaction to Chrome 127's Application-Bound Encryption scheme." +author: + - slug: jia-yu-chan + - slug: salim-bitam + - slug: daniel-stepanic + - slug: samir-bousseaden + - slug: cyril-francois + - slug: seth-goodwin +image: "Security Labs Images 2.jpg" +category: + - slug: malware-analysis +tags: + - infostealer + - chrome + - cookie + - VIDAR + - STEALC + - LUMMA + - METASTEALER + - PHEMEDRONE + - XENOSTEALER +--- + +# Introduction + +In July, Google [announced](https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html) a new protection mechanism for cookies stored within Chrome on Windows, known as Application-Bound Encryption. There is no doubt this security implementation has raised the bar and directly impacted the malware ecosystem. After months with this new feature, many infostealers have written new code to bypass this protection (as the Chrome Security Team predicted) in order to stay competitive in the market and deliver capabilities that reliably retrieve cookie data from Chrome browsers. + +Elastic Security Labs has been tracking a subset of this activity, identifying multiple techniques used by different malware families to circumvent App-Bound Encryption. While the ecosystem is still evolving in light of this pressure, our goal is to share technical details that help organizations understand and defend against these techniques. In this article, we will cover the different methods used by the following infostealer families: + + - STEALC/VIDAR + - METASTEALER + - PHEMEDRONE + - XENOSTEALER + - LUMMA + +# Key takeaways + + - Latest versions of infostealers implement bypasses around Google’s recent cookie protection feature using Application-Bound Encryption + - Techniques include integrating offensive security tool ChromeKatz, leveraging COM to interact with Chrome services and decrypt the app-bound encryption key, and using the remote debugging feature within Chrome + - Defenders should actively monitor for different cookie bypass techniques against Chrome on Windows in anticipation of future mitigations and bypasses likely to emerge in the near- to mid-term + - Elastic Security provides mitigations through memory signatures, behavioral rules, and hunting opportunities to enable faster identification and response to infostealer activity + +# Background + +Generically speaking, cookies are used by web applications to store visitor information in the browser the visitor uses to access that web app. This information helps the web app track that user, their preferences, and other information from location to location– even across devices. + +The authentication token is one use of the client-side data storage structures that enables much of how modern web interactivity works. These tokens are stored by the browser after the user has successfully authenticated with a web application. After username and password, after multifactor authentication (MFA) via one-time passcodes or biometrics, the web application “remembers” your browser is you via the exchange of this token with each subsequent web request. + +A malicious actor who gets access to a valid authentication token can reuse it to impersonate the user to that web service with the ability to take over accounts, steal personal or financial information, or perform other actions as that user such as transfer financial assets. + +Cybercriminals use infostealers to steal and commoditize this type of information for their financial gain. + +## Google Chrome Cookie Security + +Legacy versions of Google Chrome on Windows used the Windows native [Data Protection API](https://learn.microsoft.com/en-us/dotnet/standard/security/how-to-use-data-protection) (DPAPI) to encrypt cookies and protect them from other user contexts. This provided adequate protection against several attack scenarios, but any malicious software running in the targeted user’s context could decrypt these cookies using the DPAPI methods directly. Unfortunately, this context is exactly the niche that infostealers often find themselves in after social engineering for initial access. The DPAPI scheme is now [well known to attackers](https://posts.specterops.io/operational-guidance-for-offensive-user-dpapi-abuse-1fb7fac8b107) with several attack vectors; from local decryption using the API, to stealing the masterkey and decrypting remotely, to abusing the domain-wide backup DPAPI key in an enterprise environment. + +With the release of Chrome 127 in July 2024, Google [implemented](https://developer.chrome.com/release-notes/127) Application-Bound Encryption of browser data. This mechanism directly addressed many common DPAPI attacks against Windows Chrome browser data–including cookies. It does this by storing the data in encrypted datafiles, and using a service running as SYSTEM to verify any decryption attempts are coming from the Chrome process before returning the key to that process for decryption of the stored data. + +![Chrome 127 Application-Bound Encryption Scheme. Source: https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html](/assets/images/katz-and-mouse-game/image5.png) + + + +While it is our view that this encryption scheme is not a panacea to protect all browser data (as the Chrome Security Team acknowledges in their release) we do feel it has been successful in driving malware authors to TTPs that are more overtly malicious, and easier for defenders to identify and respond to. + +# Stealer Bypass Techniques, Summarized + +The following sections will describe specific infostealer techniques used to bypass Google’s App-Bound Encryption feature as observed by Elastic. Although this isn’t an exhaustive compilation of bypasses, and development of these families is ongoing, they represent an interesting dynamic within the infostealer space showing how malware developers responded to Google’s recently updated security control. The techniques observed by our team include: + + - Remote debugging via Chrome’s DevTools Protocol + - Reading process memory of Chrome network service process (ChromeKatz and ```ReadProcessMemory``` (RPM)) + - Elevating to ```SYSTEM``` then decrypting ```app_bound_encryption_key``` with the ```DecryptData``` method of ```GoogleChromeElevationService``` through COM + +![Timeline of events](/assets/images/katz-and-mouse-game/image30.png) + +## STEALC/VIDAR + +Our team observed new code introduced to STEALC/VIDAR related to the cookie bypass technique around September 20th. These were atypical samples that stood out from previous versions and were implemented as embedded 64-bit PE files along with conditional checks. Encrypted values in the SQLite databases where Chrome stores its data are now prefixed with v20, indicating that the values are now encrypted using application-bound encryption. + +> [STEALC](https://malpedia.caad.fkie.fraunhofer.de/details/win.stealc) was introduced in 2023 and was developed with “heavy inspiration” from other more established stealers such as [RACOON](https://malpedia.caad.fkie.fraunhofer.de/details/win.raccoon) and [VIDAR](https://malpedia.caad.fkie.fraunhofer.de/details/win.vidar). STEALC and VIDAR have continued concurrent development, and in the case of App-Bound Encryption bypasses have settled on the same implementation. + +During the extraction of encrypted data from the databases the malware checks for this prefix. If it begins with ```v20```, a child process is spawned using the embedded PE file in the ```.data``` section of the binary. This program is responsible for extracting unencrypted cookie values residing in one of Chrome's child processes. + +![Embedded PE file](/assets/images/katz-and-mouse-game/image2.png) + +This embedded binary creates a hidden desktop via ```OpenDesktopA``` / ```CreateDesktopA``` then uses ```CreateToolhelp32Snapshot``` to scan and terminate all ```chrome.exe``` processes. A new ```chrome.exe``` process is then started with the new desktop object. Based on the installed version of Chrome, the malware selects a signature pattern for the Chromium feature [CookieMonster](https://www.chromium.org/developers/design-documents/network-stack/cookiemonster/), an internal component used to manage cookies. + +![Signature pattern for ```CookieMonster```](/assets/images/katz-and-mouse-game/image38.png) + +We used the [signature patterns](https://github.com/Meckazin/ChromeKatz/blob/9152004174e9a0b2d092c70ebc75efbf80fa1098/CookieKatz/Main.cpp#L123) to pivot to existing code developed for an offensive security tool called [ChromeKatz](https://github.com/Meckazin/ChromeKatz). At this time, the patterns have been removed from the ChromeKatz repository and replaced with a new technique. Based on our analysis, the malware author appears to have reimplemented ChromeKatz within STEALC in order to bypass the app-bound encryption protection feature. + +Once the malware identifies a matching signature, it enumerates Chrome’s child processes to check for the presence of the ```--utility-sub-type=network.mojom.NetworkService``` command-line flag. This flag indicates that the process is the network service responsible for handling all internet communication. It becomes a prime target as it holds the sensitive data the attacker seeks, as described in MDSec’s [post](https://www.mdsec.co.uk/2021/01/breaking-the-browser-a-tale-of-ipc-credentials-and-backdoors/). It then returns a handle for that specific child process. + +![Enumerating for Chrome’s network service](/assets/images/katz-and-mouse-game/image37.png) + +Next, it enumerates each module in the network service child process to find and retrieve the base address and size of ```chrome.dll``` loaded into memory. STEALC uses [```CredentialKatz::FindDllPattern```](https://github.com/Meckazin/ChromeKatz/blob/767047dcf8f53c70be5e3e0859c5eee3f129d758/CredentialKatz/Memory.cpp#L280) and [```CookieKatz::FindPattern```](https://github.com/Meckazin/ChromeKatz/blob/767047dcf8f53c70be5e3e0859c5eee3f129d758/CookieKatz/Memory.cpp#L435) to locate the CookieMonster instances. There are 2 calls to ```CredentialKatz::FindDllPattern```. + +![Calls to ```CredentialKatz::FindDllPattern```](/assets/images/katz-and-mouse-game/image17.png) + +In the first call to ```CredentialKatz::FindDllPattern```, it tries to locate one of the signature patterns (depending on the victim’s Chrome version) in ```chrome.dll```. Once found, STEALC now has a reference pointer to that memory location where the byte sequence begins which is the function ```net::CookieMonster::~CookieMonster```, destructor of the ```CookieMonster``` class. + +![Byte sequence for ```net::CookieMonster::~CookieMonster``` found in ```chrome.dll```](/assets/images/katz-and-mouse-game/image14.png) + +The second call to ```CredentialKatz::FindDllPattern``` passes in the function address for ```net::CookieMonster::~CookieMonster(void)``` as an argument for the byte sequence search, resulting in STEALC having a pointer to ```CookieMonster```’s Virtual Function Pointer struct. + +![```CookieMonster```’s vtable in ```chrome.dll```](/assets/images/katz-and-mouse-game/image19.png) + +The following method used by STEALC is again, identical to ChromeKatz, where it locates ```CookieMonster``` instances by scanning memory chunks in the ```chrome.dll``` module for pointers referencing the ```CookieMonster``` vtable. Since the vtable is a constant across all objects of a given class, any ```CookieMonster``` object will have the same vtable pointer. When a match is identified, STEALC treats the memory location as a ```CookieMonster``` instance and stores its address in an array. + +![Using ```CookieKatz::FindPattern``` to locate ```CookieMonster``` instances](/assets/images/katz-and-mouse-game/image16.png) + +For each identified ```CookieMonster``` instance, STEALC accesses the internal ```CookieMap``` structure located at an offset of ```+0x30```, and which is a binary tree. Each node within this tree contains pointers to ```CanonicalCookieChrome``` structures. ```CanonicalCookieChrome``` structures hold unencrypted cookie data, making it accessible for extraction. STEALC then initiates a tree traversal by passing the first node into a dedicated traversal function. + +![Initiating ```CookieMap``` tree traversal for each ```CookieMonster``` instance found](/assets/images/katz-and-mouse-game/image20.png) + +For each node, it calls ```ReadProcessMemory``` to access the ```CanonicalCookieChrome``` structure from the target process’s memory, then further processing it in ```jy::GenerateExfilString```. + +![```CookieMap``` traversal subroutine](/assets/images/katz-and-mouse-game/image31.png) + +STEALC formats the extracted cookie data by converting the expiration date to UNIX format and verifying the presence of the ```HttpOnly``` and ```Secure``` flags. It then appends details such as the cookie's name, value, domain, path, and the ```HttpOnly``` and ```Secure``` into a final string for exfiltration. [```OptimizedString```](https://github.com/Meckazin/ChromeKatz/blob/9152004174e9a0b2d092c70ebc75efbf80fa1098/CookieKatz/Memory.cpp#L10) structs are used in place of strings, so string values can either be the string itself, or if the string length is greater than 23, it will point to the address storing the string. + +![Constructing string for data exfiltration](/assets/images/katz-and-mouse-game/image23.png) + +## METASTEALER + +[METASTEALER](https://malpedia.caad.fkie.fraunhofer.de/details/win.metastealer), first observed in 2022, recently upgraded its ability to steal Chrome data, bypassing Google’s latest mitigation efforts. On September 30th, the malware authors announced this update via their Telegram channel, highlighting its enhanced capability to extract sensitive information, including cookies, despite the security changes in Chrome's version ```129+```. + +![METASTEALER announcement and translation](/assets/images/katz-and-mouse-game/image26.png) + +![source: https://x.com/g0njxa/status/1840761619686568319/](/assets/images/katz-and-mouse-game/image28.png) + +The [first sample](https://www.virustotal.com/gui/file/973a9056040af402d6f92f436a287ea164fae09c263f80aba0b8d5366ed9957a) observed in the wild by our team was discovered on September 30th, the same day the authors promoted the update. Despite claims that the malware operates without needing ```Administrator``` privileges, our testing revealed it does require elevated access, as it attempts to impersonate the ```SYSTEM``` token during execution. + +![Code comparison between an old and a new version of the family](/assets/images/katz-and-mouse-game/image11.png) + +As shown in the screenshots above, the ```get_decryption``` method now includes a new Boolean parameter. This value is set to ```TRUE``` if the encrypted data (cookie) begins with the ```v20``` prefix, indicating that the cookie is encrypted using Chrome's latest encryption method. The updated function retains backward compatibility, still supporting the decryption of cookies from older Chrome versions if present on the infected machine. + +The malware then attempts to access the ```Local State``` or ```LocalPrefs.json``` files located in the Chrome profile directory. Both files are JSON formatted and store encryption keys (```encrypted_key```) for older Chrome versions and ```app_bound_encrypted_key``` for newer ones. If the flag is set to ```TRUE```, the malware specifically uses the ```app_bound_encrypted_key``` to decrypt cookies in line with the updated Chrome encryption method. + +![```app_bound_encrypted_key``` extracted from Chrome json file](/assets/images/katz-and-mouse-game/image13.png) + +In this case, the malware first impersonates the ```SYSTEM``` token using a newly introduced class called ```ContextSwitcher```. + +![New class for TOKEN impersonation](/assets/images/katz-and-mouse-game/image35.png) + +It then decrypts the key by creating an instance via the COM of the Chrome service responsible for decryption, named ```GoogleChromeElevationService```, using the CLSID ```708860E0-F641-4611-8895-7D867DD3675B```. Once initialized, it invokes the [```DecryptData```](https://github.com/chromium/chromium/blob/225f82f8025e4f93981310fd33daa71dc972bfa9/chrome/elevation_service/elevator.cc#L155) method to decrypt the ```app_bound_encrypted_key``` key which will be used to decrypt the encrypted cookies. + +![New class ```ComInvoker``` to invoke methods from ```GoogleChromeElevationService``` service](/assets/images/katz-and-mouse-game/image8.png) + +METASTEALER employs a technique similar to the one demonstrated in a [gist](https://gist.github.com/snovvcrash/caded55a318bbefcb6cc9ee30e82f824) shared [on X](https://x.com/snovvcrash/status/1839715912812802162) on September 27th, which may have served as inspiration for the malware authors. Both approaches leverage similar methods to bypass Chrome's encryption mechanisms and extract sensitive data. + +## PHEMEDRONE + +This [open-source stealer](https://malpedia.caad.fkie.fraunhofer.de/details/win.phemedrone_stealer) caught the world’s attention earlier in the year through its usage of a Windows SmartScreen vulnerability (CVE-2023-36025). While its development is still occurring on Telegram, our team found a recent [release](https://www.virustotal.com/gui/file/1067d27007ea862ddd68e90ef68b6d17fa18f9305c09f72bad04d00102a60b8c) (2.3.2) submitted at the end of September including new cookie grabber functionality for Chrome. + +![```README.txt``` within PHEMEDRONE project](/assets/images/katz-and-mouse-game/image10.png) + +The malware first enumerates the different profiles within Chrome, then performs a browser check using function (```BrowserHelpers.NewEncryption```) checking for the Chrome browser with a version greater than or equal to ```127```. + +![Chrome version verification in PHEMEDRONE](/assets/images/katz-and-mouse-game/image27.png) + +If the condition matches, PHEMEDRONE uses a combination of helper functions to extract the cookies. + +![High-level functions used cookie extraction in PHEMEDRONE](/assets/images/katz-and-mouse-game/image34.png) + +By viewing the ```ChromeDevToolsWrapper``` class and its different functions, we can see that PHEMEDRONE sets up a remote debugging session within Chrome to access the cookies. The default port (```9222```) is used along with window-position set to ```-2400```,```-2400``` which is set off-screen preventing any visible window from alerting the victim. + +![New Chrome process in remote debug mode](/assets/images/katz-and-mouse-game/image15.png) + +Next, the malware establishes a WebSocket connection to Chrome’s debugging interface making a request using deprecated Chrome DevTools Protocol method (```Network.getAllCookies```). + +![Chrome DevTools Protocol used to retrieve cookies](/assets/images/katz-and-mouse-game/image24.png) + +The cookies are then returned from the previous request in plaintext, below is a network capture showing this behavior: + +![Cookie data within network capture](/assets/images/katz-and-mouse-game/image32.png) + +## XENOSTEALER + +[XENOSTEALER](https://github.com/moom825/XenoStealer/) is an open-source infostealer hosted on GitHub. It appeared in July 2024 and is under active development at the time of this publication. Notably, the Chrome bypass feature was committed on September 26, 2024. + +The approach taken by XENOSTEALER is similar to that of METASTEALER. It first parses the JSON file under a given Chrome profile to extract the ```app_bound_encrypted_key```. However, the decryption process occurs within a Chrome process. To achieve this, XENOSTEALER launches an instance of ```Chrome.exe```, then injects code using a helper class called [```SharpInjector```](https://github.com/moom825/XenoStealer/blob/d1c7e242183a2c8582c179a1b546f0a5cdff5f75/XenoStealer/Injector/SharpInjector.cs), passing the encrypted key as a parameter. + +The injected code subsequently calls the ```DecryptData``` method from the ```GoogleChromeElevationService``` to obtain the decrypted key. + +![Source code of the injected code](/assets/images/katz-and-mouse-game/image29.png) + +## LUMMA + +In mid-October, the latest version of [LUMMA](https://malpedia.caad.fkie.fraunhofer.de/details/win.lumma) implemented a new method to bypass Chrome cookie protection, as reported by [@g0njxa](https://x.com/g0njxa). + +![](/assets/images/katz-and-mouse-game/image40.png) + +We analyzed a recent version of LUMMA, confirming that it managed to successfully recover the cookie data from the latest version of Google Chrome (```130.0.6723.70```). LUMMA first creates a visible Chrome process via ```Kernel32!CreateProcessW```. + +![Dump of ```CreateProcessW lpApplicationName``` parameter](/assets/images/katz-and-mouse-game/image3.png) + +This activity was followed up in the debugger with multiple calls to ```NtReadVirtualMemory``` where we identified LUMMA searching within the Chrome process for ```chrome.dll```. + +![LUMMA seeks ```chrome.dll``` in Chrome](/assets/images/katz-and-mouse-game/image7.png) + +Once found, the malware copies the ```chrome.dll``` image to its own process memory using ```NtReadVirtualMemory```. In a similar fashion to the ChromeKatz technique, Lumma leverages pattern scanning to target Chrome’s ```CookieMonster``` component. + +![Lumma’s pattern scanning](/assets/images/katz-and-mouse-game/image36.png) + +Lumma uses an obfuscated signature pattern to pinpoint the ```CookieMonster``` functionality: + +``` +3Rf5Zn7oFA2a????k4fAsdxx????l8xX5vJnm47AUJ8uXUv2bA0s34S6AfFA????kdamAY3?PdE????6G????L8v6D8MJ4uq????k70a?oAj7a3????????K3smA????maSd?3l4 +``` + +Below is the YARA rule after de-obfuscation: + +``` +rule lumma_stealer +{ + meta: + author = "Elastic Security Labs" + strings: + $lumma_pattern = { 56 57 48 83 EC 28 89 D7 48 89 CE E8 ?? ?? ?? ?? 85 FF 74 08 48 89 F1 E8 ?? ?? ?? ?? 48 89 F0 48 83 C4 28 5F 5E C3 CC CC CC CC CC CC CC CC CC CC 56 57 48 83 EC 38 48 89 CE 48 8B 05 ?? ?? ?? ?? 48 31 E0 48 89 44 24 ?? 48 8D 79 ?? ?? ?? ?? 28 E8 ?? ?? ?? ?? 48 8B 46 20 48 8B 4E 28 48 8B 96 ?? ?? ?? ?? 4C 8D 44 24 ?? 49 89 10 48 C7 86 ?? ?? ?? ?? ?? ?? ?? ?? 48 89 FA FF 15 ?? ?? ?? ?? 48 8B 4C 24 ?? 48 31 E1} + condition: + all of them +} +``` + +After decoding and searching for the pattern in ```chrome.dll```, this leads to the ```CookieMonster``` destructor ([```net::CookieMonster::~CookieMonster```](https://chromium.googlesource.com/chromium/src/net/+/master/cookies/cookie_monster.cc#657)). + +![Lumma pattern match on ```CookieMonster```](/assets/images/katz-and-mouse-game/image25.png) + +The cookies are then identified in memory and dumped out in clear text from the Chrome process. + +![LUMMA dumping the cookie in clear text from Chrome](/assets/images/katz-and-mouse-game/image21.png) + +Once completed, LUMMA sends out the cookies along with the other requested data as multiple zip files (xor encrypted and base64 encoded) to the C2 server. + +![Received stolen cookies on the C2 side](/assets/images/katz-and-mouse-game/image12.png) + +# Detection + +Below are the following behavioral detections that can be used to identify techniques used by information stealers: + + - [Web Browser Credential Access via Unusual Process](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/credential_access_web_browser_credential_access_via_unusual_process.toml#L8) + - [Web Browser Credential Access via Unsigned Process](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/credential_access_web_browser_credential_access_via_unsigned_process.toml#L8) + - [Access to Browser Credentials from Suspicious Memory](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/credential_access_access_to_browser_credentials_from_suspicious_memory.toml#L8) + - [Failed Access Attempt to Web Browser Files](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/credential_access_failed_access_attempt_to_web_browser_files.toml#L8) + - [Browser Debugging from Unusual Parent](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/credential_access_browser_debugging_from_unusual_parent.toml#L3) + - [Potential Browser Information Discovery](https://github.com/elastic/protections-artifacts/blob/da25aa57994ee265583227dbe6fe02261b65415c/behavior/rules/windows/discovery_potential_browser_information_discovery.toml#L8) + +Additionally, the following queries can be used for hunting diverse related abnormal behaviors: + +## Cookies access by an unusual process + +This query uses file open events and aggregate accesses by process, then looks for ones that are observed in unique hosts and with a low total access count: + +``` sql +FROM logs-endpoint.events.file-default* +| where event.category == "file" and event.action == "open" and file.name == "Cookies" and file.path like "*Chrome*" +| keep file.path, process.executable, agent.id +| eval process_path = replace(to_lower(process.executable), """c:\\users\\[a-zA-Z0-9\.\-\_\$]+\\""", "c:\\\\users\\\\user\\\\") +| stats agents_count = COUNT_DISTINCT(agent.id), access_count= count(*) by process_path +| where agents_count <= 2 and access_count <=2 +``` + +Below example of matches from diverse information stealers including the updated ones with new Chrome cookies stealing capabilities: + +![ES|QL query results for suspicious browser cookies file access](/assets/images/katz-and-mouse-game/image22.png) + +METASTEALER behavior tends to first terminate all running chrome instances then calls [```CoCreateInstance```](https://learn.microsoft.com/en-us/windows/win32/api/combaseapi/nf-combaseapi-cocreateinstance) to instantiate the Google Chrome [elevation service](https://chromium.googlesource.com/chromium/src/+/main/chrome/elevation_service/), this series of events can be expressed with the following EQL query: + +``` sql +sequence by host.id with maxspan=1s +[process where event.action == "end" and process.name == "chrome.exe"] with runs=5 +[process where event.action == "start" and process.name == "elevation_service.exe"] +``` + +![EQL query results for suspicious browser termination](/assets/images/katz-and-mouse-game/image4.png) + +The previous hunt indicates suspicious agents but doesn't identify the source process. By [enabling registry object access auditing through event 4663](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4663) on the Chrome Elevation service CLSID registry key ```{708860E0-F641-4611-8895-7D867DD3675B}```, we can detect unusual processes attempting to access that key: + +![Google Chrome Elevation COM registry access](/assets/images/katz-and-mouse-game/image9.png) + +``` sql +FROM logs-system.security-default* | where event.code == "4663" and winlog.event_data.ObjectName == "\\REGISTRY\\MACHINE\\SOFTWARE\\Classes\\CLSID\\{708860E0-F641-4611-8895-7D867DD3675B}" and not winlog.event_data.ProcessName in ("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe") and not winlog.event_data.ProcessName like "C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\*\\\\elevation_service.exe" | stats agents_count = COUNT_DISTINCT(agent.id), access_count= count(*) by winlog.event_data.ProcessName | where agents_count <= 2 and access_count <=2 +``` + +Below is an example of matches on the METASTEALER malware while calling ```CoCreateInstance (CLSID_Elevator)```: + +![ES|QL query results for suspicious access to chrome elevation service registry](/assets/images/katz-and-mouse-game/image39.png) + +The [PHEMEDRONE](https://malpedia.caad.fkie.fraunhofer.de/details/win.phemedrone_stealer) stealer uses the [known](https://posts.specterops.io/hands-in-the-cookie-jar-dumping-cookies-with-chromiums-remote-debugger-port-34c4f468844e) browser debugging method to collect cookies via Chromium API, this can be observed in the following screenshot where we can see an instance of NodeJs communicating with a browser instance with debugging enabled over port ```9222```: + +![PHEMEDRONE - network connection to chrome over port ```9222```](/assets/images/katz-and-mouse-game/image33.png) + +The following EQL query can be used to look for unusual processes performing similar behavior: + +``` sql +sequence by host.id, destination.port with maxspan=5s +[network where event.action == "disconnect_received" and + network.direction == "ingress" and + process.executable in~ ("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", +"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe") and + source.address like "127.*" and destination.address like "127.*"] +[network where event.action == "disconnect_received" and network.direction == "egress" and not + process.executable in~ ("C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", +"C:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe") and source.address like "127.*" and destination.address like "127.*"] +``` + +![EQL query results for browser debugging activity](/assets/images/katz-and-mouse-game/image1.png) + +## Chrome Browser Spawned from an Unusual Parent + +The STEALC sample that uses ChromeKatz implementation spawns an instance of Google Chrome to load the user default profile, while looking for normal parent executables, it turns out it’s limited to Chrome signed parents and Explorer.exe, the following ES|QL query can be used to find unusual parents: + +``` sql +FROM logs-endpoint.events.process-* +| where event.category == "process" and event.type == "start" and to_lower(process.name) == "chrome.exe" and process.command_line like "*--profile-directory=Default*" +| eval process_parent_path = replace(to_lower(process.parent.executable), """c:\\users\\[a-zA-Z0-9\.\-\_\$]+\\""", "c:\\\\users\\\\user\\\\") +| stats agents_count = COUNT_DISTINCT(agent.id), total_executions = count(*) by process_parent_path +| where agents_count == 1 and total_executions <= 10 +``` + +![ES|QL query results for chrome browser spawned from an unusual parent](/assets/images/katz-and-mouse-game/image18.png) + +## Untrusted Binaries from Chrome Application folder + +Since the Chrome elevation service [trusts](https://github.com/chromium/chromium/blob/main/chrome/elevation_service/caller_validation.cc#L33-L56) binaries running from the Chrome ```program files``` folder, the following queries can be used to hunt for unsigned or untrusted binaries executed or loaded from there: + +### Unsigned DLLs loaded from google chrome application folder + +``` sql +FROM logs-endpoint.events.library* +| where event.category == "library" and event.action == "load" and to_lower(dll.path) like "c:\\\\program files\\\\google\\\\chrome\\\\application\\\\*" and not (dll.code_signature.trusted == true) +| keep process.executable, dll.path, dll.hash.sha256, agent.id +| stats agents_count = COUNT_DISTINCT(agent.id), total_executions = count(*) by process.executable, dll.path, dll.hash.sha256 +| where agents_count == 1 and total_executions <= 10 +``` + +### Unsigned executable launched from google chrome application folder + +``` sql +FROM logs-endpoint.events.process* +| where event.category == "library" and event.type == "start" and (to_lower(process.executable) like "c:\\\\program files\\\\google\\\\chrome\\\\application\\\\*" or to_lower(process.executable) like "c:\\\\scoped_dir\\\\program files\\\\google\\\\chrome\\\\application\\\\*") +and not (process.code_signature.trusted == true and process.code_signature.subject_name == "Goole LLC") +| keep process.executable,process.hash.sha256, agent.id +| stats agents_count = COUNT_DISTINCT(agent.id), total_executions = count(*) by process.executable, process.hash.sha256 +| where agents_count == 1 and total_executions <= 10 +``` + +![ES|QL query results for malicious DLL loaded by Chrome](/assets/images/katz-and-mouse-game/image6.png) + +# Conclusion + +Google has raised the bar implementing new security controls to protect cookie data within Chrome. As expected, this has caused malware developers to develop or integrate their own bypasses. We hope Google will continue to innovate to provide stronger protection for user data. + +Organizations and defenders should consistently monitor for unusual endpoint activity. While these new techniques may be successful, they are also noisy and detectable with the right security instrumentation, processes, and personnel. + +## Stealer Bypasses and MITRE ATT&CK + +Elastic uses the [MITRE ATT&CK](https://attack.mitre.org/) framework to document common tactics, techniques, and procedures that threats use against enterprise networks. + +### Tactics + +Tactics represent the why of a technique or sub-technique. It is the adversary’s tactical goal: the reason for performing an action. + + - [Credential Access](https://attack.mitre.org/tactics/TA0006/) + - [Defense Evasion](https://attack.mitre.org/tactics/TA0005/) + - [Discovery](https://attack.mitre.org/tactics/TA0007/) + - [Execution](https://attack.mitre.org/tactics/TA0002/) + +### Techniques + +Techniques represent how an adversary achieves a tactical goal by performing an action. + + - [Steal Web Session Cookie](https://attack.mitre.org/techniques/T1539/) + - [Process Injection](https://attack.mitre.org/techniques/T1055/) + - [Credentials from Password Stores](https://attack.mitre.org/techniques/T1555/) + - [System Information Discovery](https://attack.mitre.org/techniques/T1082/) + - [Process Discovery](https://attack.mitre.org/techniques/T1057/) + - [Inter-Process Communication: Component Object Model](https://attack.mitre.org/techniques/T1559/001/) + +## YARA + +Elastic Security has created YARA rules to identify this activity. + + - [Windows.Trojan.Stealc](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Trojan_Stealc.yar) + - [Windows.Infostealer.PhemedroneStealer](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Infostealer_PhemedroneStealer.yar) + - [Windows.Trojan.MetaStealer](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Trojan_MetaStealer.yar) + - [Windows.Trojan.Xeno](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Trojan_Xeno.yar) + - [Windows.Trojan.Lumma](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Trojan_Lumma.yar) + - [Windows.Infostealer.Generic](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Infostealer_Generic.yar) + +## Observations + +All observables are also available for [download](https://github.com/elastic/labs-releases/tree/main/indicators/app-bound_bypass) in both ECS and STIX format. + +The following observables were discussed in this research. + +| Observable | Type | Name | Reference | +|-----|-----|-----|-----| +| 27e4a3627d7df2b22189dd4bebc559ae1986d49a8f4e35980b428fadb66cf23d | SHA-256 | num.exe | STEALC | +| 08d9d4e6489dc5b05a6caa434fc36ad6c1bd8c8eb08888f61cbed094eac6cb37 | SHA-256 | HardCoreCrack.exe | PHEMEDRONE | +| 43cb70d31daa43d24e5b063f4309281753176698ad2aba9c557d80cf710f9b1d | SHA-256 | Ranginess.exe | METASTEALER | +| 84033def9ffa70c7b77ce9a7f6008600c0145c28fe5ea0e56dfafd8474fb8176 | SHA-256 | | LUMMA | +| b74733d68e95220ab0630a68ddf973b0c959fd421628e639c1b91e465ba9299b | SHA-256 | XenoStealer.exe | XENOSTEALER | + + +## References +The following were referenced throughout the above research: + + - [https://developer.chrome.com/release-notes/127](https://developer.chrome.com/release-notes/127) +- [https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html](https://security.googleblog.com/2024/07/improving-security-of-chrome-cookies-on.html) diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/protecting_your_devices_from_information_theft_keylogger_protection_jp.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/protecting_your_devices_from_information_theft_keylogger_protection_jp.md index 7c239d1f4812..6bfc447cff63 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/protecting_your_devices_from_information_theft_keylogger_protection_jp.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/protecting_your_devices_from_information_theft_keylogger_protection_jp.md @@ -1,7 +1,7 @@ --- title: "情報窃取から端末を守る" slug: "protecting-your-devices-from-information-theft-keylogger-protection-jp" -date: "2020-05-30" +date: "2024-05-30" subtitle: "Windows APIの挙動を用いたキーロガー検知" description: "本記事ではElastic Securityにおいて、エンドポイント保護を担っているElastic Defendに今年(バージョン8.12より)新たに追加された、キーロガーおよびキーロギング検出機能について紹介します。" author: diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/streamlining_security_integrating_amazon_bedrock.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/streamlining_security_integrating_amazon_bedrock.md new file mode 100644 index 000000000000..9ba2b033a851 --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/streamlining_security_integrating_amazon_bedrock.md @@ -0,0 +1,237 @@ +--- +title: "Streamlining Security: Integrating Amazon Bedrock with Elastic" +slug: "streamlining-security-integrating-amazon-bedrock" +date: "2024-11-14" +description: "This article will guide you through the process of setting up the Amazon Bedrock integration and enabling Elastic's prebuilt detection rules to streamline your security operations." +author: + - slug: shashank-k-s +image: "Security Labs Images 36.jpg" +category: + - slug: security-research +--- + +# Preamble + +In the ever-evolving landscape of cloud computing, maintaining robust security while ensuring compliance is a critical challenge for organizations of all sizes. As businesses increasingly adopt the cloud, the complexity of managing and securing data across various platforms grows exponentially. + +[Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html), with its powerful foundation of machine learning and AI services, offers a scalable, secure environment for organizations to develop and deploy intelligent applications. However, to fully harness the potential of these innovations, it’s essential to implement a streamlined approach to security and compliance. + +Integrating Elastic with Amazon Bedrock can significantly enhance security monitoring and compliance management within your cloud environment. This integration leverages Elastic’s search, observability, and security capabilities to optimize how you manage and secure applications and data hosted on Amazon Bedrock. + +Elastic’s [security information and event management (SIEM) capabilities](https://www.elastic.co/security/siem) can be used to analyze logs and monitor events generated by applications running on Amazon Bedrock. This allows for the detection of potential security threats in real-time and automated response actions to mitigate risks. + +This article will guide you through the process of setting up Amazon Bedrock integration and enabling our prebuilt detection rules to streamline your security operations. We will cover the following key aspects: + + 1. **Prerequisites for Elastic Amazon Bedrock Integration:** Understanding the core requirements for setting up Elastic Amazon Bedrock integration for cloud security. + 2. **Setting Up Amazon Bedrock Integration**: Step-by-step instructions to set up Amazon Bedrock in your existing AWS infrastructure. + 3. **Enabling Prebuilt Security Rules**: How to leverage [prebuilt rules](https://www.elastic.co/guide/en/security/current/rules-ui-management.html) to detect high-confidence policy violations and other security threats. + 4. **Exploring High-Confidence Misconduct Blocks Detection:** An in-depth look at a specific prebuilt rule designed to detect high-confidence misconduct blocks within Amazon Bedrocklogs. + 5. **Demonstrate an Exploit Case Scenario for Amazon Bedrock:** Using a sample python script to simulate interactions with an Amazon Bedrock model for testing exploit scenarios that could trigger Elastic prebuilt detection rules. + +# Prerequisites for Elastic Amazon Bedrock Integration + +## Elastic Integration for Amazon Bedrock + +The Amazon Bedrock integration collects Amazon Bedrock model invocation logs and runtime metrics with Elastic Agent. For a deeper dive on the integration, documentation can be found in our [documentation.](https://www.elastic.co/docs/current/integrations/aws_bedrock) + +Below are the list of prerequisites to have a complete and successful configuration of Amazon Bedrock Elastic Integration: + + * AWS Account Setup + * Elastic Cloud Requirements + * Terraform (Optional) + +### AWS Account Setup + + * **Active AWS Account**: Ensure you have an active AWS account with the appropriate permissions to deploy and manage resources on Amazon Bedrock. + * **Amazon Bedrock Setup**: Confirm that Amazon Bedrock is correctly configured and operational within your AWS environment. This includes setting up AI models, datasets, and other resources necessary for your applications. Refer to [Getting started with Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/getting-started.html) for additional information on the setup. + * **IAM Roles and Permissions**: Create or configure Identity and Access Management (IAM) roles with the necessary permissions to allow Elastic to access Amazon Bedrock resources. These roles should have sufficient privileges to read logs, metrics, and traces from AWS services. Additional details of the requirements can be found in our [AWS documentation](https://www.elastic.co/docs/current/integrations/aws#requirements). + +### Elastic Cloud Requirements + +| [Version](https://www.elastic.co/docs/current/integrations/aws_bedrock#changelog) | 0.7.0 (Beta) | +| :---- | :---- | +| **Compatible Kibana version(s)** | 8.13.0 or higher for integration version 0.2.0 and above. Minimum Kibana Version 8.12.0 | +| [**Supported Serverless project types**](https://www.elastic.co/docs/current/integrations/serverless/support) | Security Observability | +| [**Subscription level**](https://www.elastic.co/subscriptions) | Basic | +| [**Level of support**](https://www.elastic.co/docs/current/integrations/support) | Elastic | + +**Note:** Since the integration is in Beta Release Stage, please enable ***Display Beta Integrations in the browse integration section of the Management pane in your Elastic stack.*** + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image1.png) + +### Terraform + +[Terraform](https://www.terraform.io/) is an open source infrastructure-as-code (IaC) tool created by HashiCorp that allows you to define, provision, and manage cloud and on-premises infrastructure in a consistent and repeatable way. + +This is an optional step, but good to have as the next sections of the article we use this tool to set up the required AWS Infrastructure. Deep dive on installation and docs can be found [here](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/install-cli). + +# Setting Up Amazon Bedrock Integration + +In this section of the article, we will walk through the steps to set up Amazon Bedrock integration with Elastic in two parts: + + 1. **Setting Up AWS Infrastructure with Terraform**: In this section, we'll walk through the steps to set up an AWS infrastructure using Terraform. We'll create an S3 bucket, an EC2 instance with the necessary IAM roles and policies to access the S3 bucket, and configure security groups to allow SSH access. This setup is ideal for scenarios where you need an EC2 instance to interact with S3, such as for data processing or storage. + 2. **Elastic Agent and Integration Setup**: In this section, we'll walk through the steps to install Elastic Agent on the AWS EC2 instance and Configure the Amazon Bedrock Integration. + +### Setting Up AWS Infrastructure with Terraform + +The high-level configuration process will involve the following steps: + + 1. Configuring ```providers.tf``` + 2. Configuring ```variables.tf``` + 3. Configuring ```outputs.tf``` + 4. Configuring ```main.tf``` + +The ```providers.tf``` file typically contains the configuration for any Terraform providers you are using in your project. In our example, it includes the configuration for the AWS provider. Here is the [sample content](https://gist.github.com/shashank-elastic/290218cd4e787f65fbcbfd6423a0ca85#file-providers-tf) of our ```providers.tf``` file. The ```profile``` mentioned in the ```providers.tf``` should be configured in the user’s space of the AWS credentials file ```(~/.aws/credentials)```. Refer to [Configuration and credential file settings \- AWS Command Line Interface](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html#cli-configure-files-format-profile), which is also highlighted in the credential section of Elastic’s [AWS documentation](https://www.elastic.co/docs/current/integrations/aws#aws-credentials). + +The ```variables.tf``` file contains the variable definitions used throughout your Terraform configuration. For our scenario, it includes the definition for the aws\_region and resource\_labels. Here is the [sample content](https://gist.github.com/shashank-elastic/290218cd4e787f65fbcbfd6423a0ca85#file-variables-tf) of our ```variables.tf``` file. + +The ```outputs.tf``` file typically contains the output definitions for your Terraform configuration. These outputs can be used to display useful information after your infrastructure is provisioned. Here is the [sample content](https://gist.github.com/shashank-elastic/290218cd4e787f65fbcbfd6423a0ca85#file-outputs-tf) of our ```outputs.tf``` file + +The ```main.tf``` file typically contains the collection of all of these resources such as data sources, S3 bucket and bucket policy, Amazon Bedrock Model Invocation Log configuration, SQS Queue configuration, IAM Role and Policies required by the EC2 instance that would install Elastic Agent and stream logs and Amazon Bedrock Guardrail configuration. Here is the [sample content](https://gist.github.com/shashank-elastic/290218cd4e787f65fbcbfd6423a0ca85#file-main-tf) of our ```main.tf``` file. + +Once the ```main.tf``` is configured according to the requirements we can then initialize, plan and apply the terraform configuration. + +``` +terraform init // initializes the directory and sets up state files in backend +terraform plan // command creates an execution plan +terraform apply // command applies the configuration aka execution step +``` + +To tear down the infrastructure that terraform has previously created one can use the ```terraform destroy``` command. + +Once the infrastructure setup is completed, necessary resource identifiers are provided via ```outputs.tf.``` We can conduct a basic verification of the infrastructure created using the following steps: + + 1. Verify the S3 Bucket created from the Terraform, one can either use aws cli command reference [list-buckets — AWS CLI 1.34.10 Command Reference](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-buckets.html) or navigate via AWS console to verify the same. 2. Verify the SQS Queue created from the terraform, one can either use aws cli command reference [list-queues — AWS CLI 1.34.10 Command Reference](https://docs.aws.amazon.com/cli/latest/reference/sqs/list-queues.html) or navigate via AWS console to verify the same. + 3. Verify the EC2 Instance created from the AWS console and connect to the ec2-instance via [Connect using EC2 Instance Connect \- Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-methods.html#ec2-instance-connect-connecting-console) and run ```aws s3 ls example-bucket-name``` to check if the instance has access to the created S3 bucket. + 4. Verify the Amazon Bedrock Guardrail created from the Terraform, once can either use Amazon Bedrock API [ListGuardrails \- Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListGuardrails.html) or navigate via AWS console to verify the same. + +### Setting Up Elastic Agent and Integration Setup + +To install Elastic Agent on the AWS EC2 instance and configure the Amazon Bedrock integration, create an agent policy using the guided steps in [Elastic Agent policies | Fleet and Elastic Agent Guide \[8.15\]](https://www.elastic.co/guide/en/fleet/current/agent-policy.html). Then log into to the ec2-instance created in the infrastructure setup steps via [Connect using EC2 Instance Connect \- Amazon Elastic Compute Cloud](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-methods.html#ec2-instance-connect-connecting-console), and install the elastic agent using the guided steps in [Install Elastic Agents | Fleet and Elastic Agent Guide \[8.15\]](https://www.elastic.co/guide/en/fleet/current/elastic-agent-installation.html). During the agent installation, remember to select the agent policy created at the beginning of this setup process and use the relevant agent installation method depending on the instance created. Finally, ensure the agent is properly configured and there is incoming data from the agent. + +To configure the Amazon Bedrock integration in the newly-created policy, add the Amazon Bedrock integration using the guided steps: [Add an Elastic Agent integration to a policy](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html). Enable Beta Integrations to use Amazon Bedrock integration as displayed in the image below. + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image4.png) + +Configure the Integration with AWS Access Keys to access the AWS account where Amazon Bedrock is configured. Use the Collect Logs from S3 bucket and specify the Bucket ARN created in the setup step. Please note to use either the S3 Bucket or the SQS Queue URL during the setup and *not both*. Add this integration to the existing policy where the ec2-instance is configured. + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image8.png) + +### Verify Amazon Bedrock Model Invocation Log Ingestions + +Once the Elastic Agent and integration setup is completed, we can conduct a basic verification of the integration to determine if the logs are being ingested as expected by using the following example API call: + +``` +aws bedrock-runtime converse \ +--model-id "anthropic.claude-3-5-sonnet-20240620-v1:0" \ +--messages '[{"role":"user","content":[{"text":"Hello "}]}]' \ +--inference-config '{"maxTokens":2000,"stopSequences":[],"temperature":1,"topP":0.999}' \ +--additional-model-request-fields '{"top_k":250}' \ +--region us-east-1 +``` + +The example API call assumes a working setup with aws cli and there is access for the foundational model [Anthropic Claude Messages API \- Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters-anthropic-claude-messages.html). If the user does not have access to the model one can simply request access for models from the model-access page as suggested in [Access Amazon Bedrock foundation models](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access.html), or we can optionally change the API call to any existing model the user can access. + +On successful execution of the above API call, the Amazon Bedrock Model invocation logs are populated and in Kibana ```logs-aws_bedrock.invocation-default``` should be populated with those invocation logs. We can use the following simple ES|QL query to return recently ingested events. + +``` +from logs-aws_bedrock.invocation-* | LIMIT 10 +``` + +# Enable Prebuilt Detection Rules + +To enable prebuilt detection rules, first login to the elastic instance and from the left pane navigation navigate to Security → Rules → Detection rules (SIEM). Filter for “Data Source: Amazon Bedrock” from the tags section. + +Enable the available prebuilt rules. For prebuilt rules, the Setup information contains a helper guide to setup AWS Guardrails for Amazon Bedrock, which is accomplished in the [Setting Up AWS Infrastructure with Terraform](?tab=t.0#bookmark=id.5wbf10usmxhz) step if the example is followed correctly and the terraform has the Amazon Bedrock Guardrail configuration. Please note this setup is vital for some of the rules to generate alerts–we need to ensure the guardrail is set up accordingly if skipped in the infrastructure setup stage. + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image3.png) + +# Exploring High-Confidence Misconduct Blocks Detection + +Let’s simulate a real world scenario in which a user queries a topic denied to the Amazon Bedrock model. Navigate to the Amazon Bedrock section in the Amazon UI Console, and use the left navigation pane to navigate to the Guardrails subsection under Safeguards. Use the sample guardrail created during our setup instructions for this exercise, and use the test option to run a model invocation with the guardrails and query the denied topic configured. + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image6.png) + +Repeat the query at least 6 times as the prebuilt rule is designed to alert on greater than 5 high confidence blocks. When the Alert schedule runs, we can see an alert populate for ```Unusual High Confidence Misconduct Blocks Detected.``` + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image7.png) + +# Demonstrate an Exploit Case Scenario for Amazon Bedrock + +To simulate an Amazon Bedrock Security bypass, we need an exploit simulation script to interact with Amazon Bedrock models. The exploit script example we provide simulates the following attack pattern: + + * Attempts multiple successive requests to use denied model resources within AWS Bedrock + * Generates multiple successive validation exception errors within Amazon Bedrock + * User consistently generates high input token counts, submits numerous requests, and receives large responses that mimic patterns of resource exhaustion + * Combines repeated high-confidence 'BLOCKED' actions coupled with specific violation codes such as 'MISCONDUCT', indicating persistent misuse or attempts to probe the model's ethical boundaries + +```py +class BedrockModelSimulator: + def __init__(self, profile_name, region_name): + // Create a Boto3 Session Client for Ineration + def generate_args_invoke_model(self, model_id, user_message, tokens): // Generate Model Invocation parameters + guardrail_id = <<GUARDRAIL_ID>> + guardrail_version = <<GUARDRAIL_VERSION>> + + guardrail_config = { + "guardrailIdentifier": guardrail_id, + "guardrailVersion": guardrail_version, + "trace": "enabled" + } + conversation = [ + { + "role": "user", + "content": [{"text": user_message}], + } + ] + inference_config = {"maxTokens": tokens, "temperature": 0.7, "topP": 1} + additional_model_request_fields = {} + + kwargs = { + "modelId": model_id, + "messages": conversation, + "inferenceConfig": inference_config, + "additionalModelRequestFields": additional_model_request_fields + "guardrailConfig" : guardrail_config + } + return kwargs + + def invoke_model(self, invocation_arguments): + for _ in range(count): + try: + // Invoke Model With right invocation_arguments + except ClientError as e: + // Error meesage + +def main(): + profile_name = <<AWS Profile>> + region_name = 'us-east-1' + denied_model_id = // Use a denied model + denied_model_user_message = // Sample Message + available_model_id = // Use an available model + validation_exception_user_message = // Sample Message + resource_exploit_user_message = // A very big message for resource exhuastion + denied_topic_user_message = // Sample Message that can query denied topic configured + simulator = BedrockModelSimulator(profile_name, region_name) + denied_model_invocation_arguments = simulator.generate_args_invoke_model(denied_model_id, denied_model_user_message, 200) + simulator.invoke_model(denied_model_invocation_arguments) + validation_exception_invocation_arguments = simulator.generate_args_invoke_model(available_model_id, validation_exception_user_message, 6000) + simulator.invoke_model(validation_exception_invocation_arguments) + resource_exhaustion_invocation_arguments = simulator.generate_args_invoke_available_model(available_model_id, resource_exploit_user_message, 4096) + simulator.invoke_model(resource_exhaustion_invocation_arguments) + denied_topic_invocation_arguments = simulator.generate_args_invoke_available_model_guardrail(available_model_id, denied_topic_user_message, 4096) + simulator.invoke_model(denied_topic_invocation_arguments) + +if __name__ == "__main__": + main() +``` + +**Note:** The GUARDRAIL\_ID and GUARDRAIL\_VERSION can be found in ```outputs.tf``` + +When executed in a controlled environment, the provided script simulates an exploit scenario that would generate detection alerts in Elastic Security. When analyzing these alerts using the Elastic Attack Discovery feature, the script creates attack chains that show the relationships between various alerts, giving analysts a clear understanding of how multiple alerts might be part of a larger attack. + +![](/assets/images/streamlining-security-integrating-amazon-bedrock/image2.png) + +# Conclusion + +Integrating Elastic with Amazon Bedrock empowers organizations to maintain a secure and compliant cloud environment while maximizing the benefits of AI and machine learning. By leveraging Elastic’s advanced security and observability tools, businesses can proactively detect threats, automate compliance reporting, and gain deeper insights into their cloud operations. Increasingly, enterprises rely on opaque data sources and technologies to reveal the most serious threats-- our commitment to transparent security is evident in our open artifacts, integrations, and source code. \ No newline at end of file diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/tricks_and_treats.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/tricks_and_treats.md new file mode 100644 index 000000000000..d7a98fe2b725 --- /dev/null +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/tricks_and_treats.md @@ -0,0 +1,141 @@ +--- +title: "Tricks and Treats: GHOSTPULSE’s new pixel-level deception" +slug: "tricks-and-treats" +date: "2024-10-19" +description: "The updated GHOSTPULSE malware has evolved to embed malicious data directly within pixel structures, making it harder to detect and requiring new analysis and detection techniques." +author: + - slug: salim-bitam +image: "tricks-and-treats.jpg" +category: + - slug: malware-analysis +tags: + - ghostpulse + - lummastealer + - ref8207 +--- + +## Update + +This research covers an update to stage 2 of GHOSTPULSE, [originally disclosed](https://www.elastic.co/security-labs/ghostpulse-haunts-victims-using-defense-evasion-bag-o-tricks#stage-2) by Elastic Security Labs in October 2023. + +## Key takeaways + +1. GHOSTPULSE has shifted from using the IDAT chunk of PNG files to embedding its encrypted configuration and payload within the pixel structure. +1. Recent campaigns involve tricking victims with creative social engineering techniques, such as CAPTCHA validations that trigger malicious commands through Windows keyboard shortcuts. +1. Elastic Security has enhanced its YARA rules and updated the configuration extractor tool to detect and analyze both the old and new versions of GHOSTPULSE. + +## Preamble + +The GHOSTPULSE malware family (also known as HIJACKLOADER or IDATLOADER) has continuously evolved since its discovery in 2023, evading detection with increasingly developed techniques. + +In its earlier iterations, GHOSTPULSE abused the IDAT chunk of PNG files to hide malicious payloads, as detailed in a [previous article from Elastic Security Labs](https://www.elastic.co/security-labs/ghostpulse-haunts-victims-using-defense-evasion-bag-o-tricks). However, recent analysis has uncovered a significant change in its algorithm. Instead of extracting the payload from the IDAT chunk, the latest version of GHOSTPULSE now parses the pixels of the image to retrieve its configuration and payload. This new approach involves embedding malicious data directly within the pixel structure. + +In this research publication, we’ll explore this new pixel-based algorithm and compare it with the previous IDAT chunk technique with updated detection rules. + +## Introduction + +Recently, we've observed several campaigns involving LUMMA STEALER using GHOSTPULSE as its loader, a topic also explored by [HarfangLab](https://harfanglab.io/insidethelab/hijackloader-abusing-genuine-certificates/). These campaigns stand out due to their [creative social engineering tactics](https://www.secureworks.com/blog/fake-human-verification-prompt-delivers-infostealers). Victims are tricked into validating a CAPTCHA, but the website instructs them to execute a series of Windows keyboard shortcuts instead of the usual process. These shortcuts trigger a command copied to the clipboard by malicious JavaScript. This leads to a PowerShell script being executed, initiating the infection chain by downloading and executing a GHOSTPULSE payload. + +![Social engineer lure website](/assets/images/tricks-and-treats/image1.png "Lure website") + +In previous versions of GHOSTPULSE, it was delivered as part of a multi-file package. This package typically contained a benign executable, an infected DLL loaded by the executable, and a PNG file storing the encrypted configuration. + +However, in the latest version, GHOSTPULSE has streamlined its deployment. Now, the entire package consists of a single file—a benign but compromised executable that includes the PNG file within its resources section. + +![Large embedded PNG file in the resources section](/assets/images/tricks-and-treats/image2.png "Large embedded PNG file in the resources section") + +## Technical analysis + +The updated second stage of the malware retains much of its previous structure, including using the same hashing algorithm for resolving Windows API names. However, the most significant change is in how the malware now locates its configuration, which holds both the payload and critical instructions for its deployment. + +The following is a screenshot showing the pseudocode of both implementations: + +![Pseudocode code comparison between old and new algorithm](/assets/images/tricks-and-treats/image4.png "Pseudocode code comparison between old and new algorithm") + +In earlier versions, GHOSTPULSE would parse a PNG file for an encrypted data blob, which was divided into chunks and stored sequentially. The malware’s parsing process was straightforward: it would search for a specific marker within the file—in this case, the IDAT string. Once found, the malware would check for a 4-byte tag that followed the string. The encrypted chunk would be extracted if this tag matched the expected value. This process continues for every occurrence of the IDAT string that comes after until the full encrypted payload is collected. + +In the new version, the encrypted configuration is stored in the pixels of the image. The malware constructs a byte array by extracting each pixel's `RED`, `GREEN`, and `BLUE` (RGB) values sequentially using standard Windows APIs from the [GdiPlus(GDI+)](https://learn.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-gdi-start) library. Once the byte array is built, the malware searches for the start of a structure that contains the encrypted GHOSTPULSE configuration, including the XOR key needed for decryption. It does this by looping through the byte array in 16-byte blocks. For each block, the first 4 bytes represent a CRC32 hash, and the next 12 bytes are the data to be hashed. The malware computes the CRC32 of the 12 bytes and checks if it matches the hash. If a match is found, it extracts the offset of the encrypted GHOSTPULSE configuration, its size, and the 4-byte XOR key, and then XOR decrypts it. + +The following diagram provides a visual breakdown of this process: + +![](/assets/images/tricks-and-treats/image5.png) + +## Updated configuration extractor + +Based on these findings, we have updated our configuration extractor to support both versions of GHOSTPULSE. This tool takes a PNG file as input and outputs the embedded payload. You can find the updated tool in our [labs-releases repository](https://github.com/elastic/labs-releases/tree/main/tools/ghostpulse). + +![](/assets/images/tricks-and-treats/image3.png) + +## Detecting GHOSTPULSE with YARA + +The original [GHOSTPULSE YARA](https://github.com/elastic/protections-artifacts/blob/main/yara/rules/Windows_Trojan_GhostPulse.yar) rule still prevents the final stage of an infection and is built into Elastic Defend. The updated sample can be detected using the following YARA rules and will be included with Elastic Defend in a future release. + +Elastic Security has updated the GHOSTPULSE YARA rules to identify this activity: + +``` +rule Windows_Trojan_GHOSTPULSE_1 { + meta: + author = "Elastic Security" + creation_date = "2024-10-15" + last_modified = "2024-10-15" + os = "Windows" + arch = "x86" + category_type = "Trojan" + family = "GHOSTPULSE" + threat_name = "Windows.Trojan.GHOSTPULSE" + license = "Elastic License v2" + + strings: + $stage_1 = { 49 63 D0 42 8B 0C 0A 41 03 CA 89 0C 1A 8B 05 ?? ?? ?? ?? 44 03 C0 8B 05 ?? ?? ?? ?? 44 3B C0 } + $stage_2 = { 48 89 01 48 8B 84 24 D8 00 00 00 48 8B 4C 24 78 8B 49 0C 89 08 C7 44 24 44 00 00 00 00 } + + condition: + any of them +} + +rule Windows_Trojan_GHOSTPULSE_2 { + meta: + author = "Elastic Security" + creation_date = "2024-10-10" + last_modified = "2024-10-10" + os = "Windows" + arch = "x86" + category_type = "Trojan" + family = "GHOSTPULSE" + threat_name = "Windows.Trojan.GHOSTPULSE" + license = "Elastic License v2" + + strings: + $a1 = { 48 83 EC 18 C7 04 24 00 00 00 00 8B 04 24 48 8B 4C 24 20 0F B7 04 41 85 C0 74 0A 8B 04 24 FF C0 89 04 24 EB E6 C7 44 24 08 00 00 00 00 8B 04 24 FF C8 8B C0 48 8B 4C 24 20 0F B7 04 41 83 F8 5C } + + condition: + all of them +} +``` + +## Conclusion + +In summary, the GHOSTPULSE malware family has evolved since its release in 2023, with this recent update marking one of the most significant changes. + +As attackers continue to innovate, defenders must adapt by utilizing updated tools and techniques to mitigate these threats effectively. We are excited to share our newly developed configuration extractor tool, designed to analyze the older and newer versions of GHOSTPULSE. This tool empowers researchers and cybersecurity professionals by providing enhanced capabilities for understanding and combating these evolving threats. As the landscape of cyber threats changes, collaboration, and innovation remain essential for effective protection. + +## Observations + +All observables are also available for [download](https://github.com/elastic/labs-releases/tree/main/indicators/ghostpulse) in both ECS and STIX format. + +The following observables were discussed in this research. + +| Observable | Type | Name | Reference | +|------------------------------------------------------------------|-------------|-----------------|------------------------------------------| +| `57ebf79c384366162cb0f13de0de4fc1300ebb733584e2d8887505f22f877077` | SHA-256 | `Setup.exe` | GHOSTPULSE sample | +| `b54d9db283e6c958697bfc4f97a5dd0ba585bc1d05267569264a2d700f0799ae` | SHA-256 | `Setup_light.exe` | GHOSTPULSE sample | +| `winrar01.b-cdn[.]net` | domain-name | | Infrastructure hosting GHOSTPULSE sample | +| `reinforcenh[.]shop` | domain-name | | LUMMASTEALER C2 | +| `stogeneratmns[.]shop` | domain-name | | LUMMASTEALER C2 | +| `fragnantbui[.]shop` | domain-name | | LUMMASTEALER C2 | +| `drawzhotdog[.]shop` | domain-name | | LUMMASTEALER C2 | +| `vozmeatillu[.]shop` | domain-name | | LUMMASTEALER C2 | +| `offensivedzvju[.]shop` | domain-name | | LUMMASTEALER C2 | +| `ghostreedmnu[.]shop` | domain-name | | LUMMASTEALER C2 | +| `gutterydhowi[.]shop` | domain-name | | LUMMASTEALER C2 | +| `riderratttinow[.]shop` | domain-name | | LUMMASTEALER C2 | \ No newline at end of file diff --git a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/twice_around_the_dance_floor_with_pipedance.md b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/twice_around_the_dance_floor_with_pipedance.md index 4775edad8024..1767d5edd4c9 100644 --- a/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/twice_around_the_dance_floor_with_pipedance.md +++ b/x-pack/plugins/elastic_assistant/server/knowledge_base/security_labs/twice_around_the_dance_floor_with_pipedance.md @@ -230,7 +230,7 @@ PIPEDANCE is designed to conduct covert operations using named pipes and has var ### Detection -- [Suspicious Windows Service Execution](https://github.com/elastic/endpoint-rules/blob/main/rules/privilege_escalation_suspicious_services_child.toml) +- [Suspicious Windows Service Execution](https://github.com/elastic/protections-artifacts/blob/main/behavior/rules/windows/privilege_escalation_suspicious_windows_service_execution.toml) - [NullSessionPipe Registry Modification](https://www.elastic.co/guide/en/security/current/nullsessionpipe-registry-modification.html) - [Potential Lateral Tool Transfer via SMB Share](https://www.elastic.co/guide/en/security/master/potential-lateral-tool-transfer-via-smb-share.html) diff --git a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts index 170d0599de17..5804f195fb85 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/bulk_actions_route.ts @@ -118,8 +118,12 @@ export const bulkActionAnonymizationFieldsRoute = ( .post({ access: 'public', path: ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_BULK_ACTION, + security: { + authz: { + requiredPrivileges: ['securitySolution-updateAIAssistantAnonymization'], + }, + }, options: { - tags: ['access:securitySolution-updateAIAssistantAnonymization'], timeout: { idleSocket: moment.duration(15, 'minutes').asMilliseconds(), }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts index 061dd9ff3eac..e23c06dbb642 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/anonymization_fields/find_route.ts @@ -32,8 +32,10 @@ export const findAnonymizationFieldsRoute = ( .get({ access: 'public', path: ELASTIC_AI_ASSISTANT_ANONYMIZATION_FIELDS_URL_FIND, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts index e3756b10a3fb..9049c152183b 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/get/get_attack_discovery.ts @@ -24,8 +24,10 @@ export const getAttackDiscoveryRoute = (router: IRouter<ElasticAssistantRequestH .get({ access: 'internal', path: ATTACK_DISCOVERY_BY_CONNECTOR_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts index 86631708b1cf..7b17f0db6e7a 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/cancel/cancel_attack_discovery.ts @@ -26,8 +26,10 @@ export const cancelAttackDiscoveryRoute = ( .post({ access: 'internal', path: ATTACK_DISCOVERY_CANCEL_BY_CONNECTOR_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts index b0273741bdf5..ff4764ab0483 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/attack_discovery/post/post_attack_discovery.ts @@ -35,8 +35,12 @@ export const postAttackDiscoveryRoute = ( .post({ access: 'internal', path: ATTACK_DISCOVERY, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: ROUTE_HANDLER_TIMEOUT, }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/capabilities/get_capabilities_route.ts b/x-pack/plugins/elastic_assistant/server/routes/capabilities/get_capabilities_route.ts index 9f57c6c95a32..7c6a36d7dd2c 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/capabilities/get_capabilities_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/capabilities/get_capabilities_route.ts @@ -30,8 +30,10 @@ export const getCapabilitiesRoute = (router: IRouter<ElasticAssistantRequestHand .get({ access: INTERNAL_API_ACCESS, path: CAPABILITIES, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts b/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts index cf1cff3d6201..56ccca59da22 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/chat/chat_complete_route.ts @@ -46,8 +46,10 @@ export const chatCompleteRoute = ( access: 'public', path: ELASTIC_AI_ASSISTANT_CHAT_COMPLETE_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts index 5766b3d1b014..eda6e1bf1890 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insight.ts @@ -26,8 +26,10 @@ export const getDefendInsightRoute = (router: IRouter<ElasticAssistantRequestHan .get({ access: 'internal', path: DEFEND_INSIGHTS_BY_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts index e980c9be0915..0f72d2eeef39 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/get_defend_insights.ts @@ -26,8 +26,10 @@ export const getDefendInsightsRoute = (router: IRouter<ElasticAssistantRequestHa .get({ access: 'internal', path: DEFEND_INSIGHTS, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts index d69b60a47880..4516efc5e5d1 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/defend_insights/post_defend_insights.ts @@ -42,11 +42,15 @@ export const postDefendInsightsRoute = (router: IRouter<ElasticAssistantRequestH access: 'internal', path: DEFEND_INSIGHTS, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: ROUTE_HANDLER_TIMEOUT, }, }, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, }) .addVersion( { diff --git a/x-pack/plugins/elastic_assistant/server/routes/evaluate/get_evaluate.ts b/x-pack/plugins/elastic_assistant/server/routes/evaluate/get_evaluate.ts index dd7462696621..71cba55a23ea 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/evaluate/get_evaluate.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/evaluate/get_evaluate.ts @@ -26,8 +26,10 @@ export const getEvaluateRoute = (router: IRouter<ElasticAssistantRequestHandlerC .get({ access: INTERNAL_API_ACCESS, path: ELASTIC_AI_ASSISTANT_EVALUATE_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts index 3c61fe75f6d0..80d507504d12 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/evaluate/post_evaluate.ts @@ -64,8 +64,12 @@ export const postEvaluateRoute = ( .post({ access: INTERNAL_API_ACCESS, path: ELASTIC_AI_ASSISTANT_EVALUATE_URL, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: ROUTE_HANDLER_TIMEOUT, }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts index cac334cd73f9..82c8b4e0148f 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/bulk_actions_route.ts @@ -6,7 +6,12 @@ */ import moment from 'moment'; -import { AnalyticsServiceSetup, IKibanaResponse, KibanaResponseFactory } from '@kbn/core/server'; +import { + AnalyticsServiceSetup, + AuditLogger, + IKibanaResponse, + KibanaResponseFactory, +} from '@kbn/core/server'; import { transformError } from '@kbn/securitysolution-es-utils'; import { @@ -20,6 +25,11 @@ import { } from '@kbn/elastic-assistant-common'; import { buildRouteValidationWithZod } from '@kbn/elastic-assistant-common/impl/schemas/common'; +import { + AUDIT_OUTCOME, + KnowledgeBaseAuditAction, + knowledgeBaseAuditEvent, +} from '../../../ai_assistant_data_clients/knowledge_base/audit_events'; import { CREATE_KNOWLEDGE_BASE_ENTRY_SUCCESS_EVENT } from '../../../lib/telemetry/event_based_telemetry'; import { performChecks } from '../../helpers'; import { KNOWLEDGE_BASE_ENTRIES_TABLE_MAX_PAGE_SIZE } from '../../../../common/constants'; @@ -62,7 +72,8 @@ const buildBulkResponse = ( deleted = [], skipped = [], }: KnowledgeBaseEntryBulkCrudActionResults & { errors: BulkOperationError[] }, - telemetry: AnalyticsServiceSetup + telemetry: AnalyticsServiceSetup, + auditLogger?: AuditLogger ): IKibanaResponse<KnowledgeBaseEntryBulkCrudActionResponse> => { const numSucceeded = updated.length + created.length + deleted.length; const numSkipped = skipped.length; @@ -90,6 +101,39 @@ const buildBulkResponse = ( sharing: entry.users.length ? 'private' : 'global', ...(entry.type === 'document' ? { source: entry.source } : {}), }); + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.CREATE, + id: entry.id, + name: entry.name, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); + }); + } + + if (updated.length) { + updated.forEach((entry) => { + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.UPDATE, + id: entry.id, + name: entry.name, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); + }); + } + + if (deleted.length) { + deleted.forEach((deletedId) => { + auditLogger?.log( + knowledgeBaseAuditEvent({ + action: KnowledgeBaseAuditAction.DELETE, + id: deletedId, + outcome: AUDIT_OUTCOME.SUCCESS, + }) + ); }); } if (numFailed > 0) { @@ -125,8 +169,12 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug .post({ access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_BULK_ACTION, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: moment.duration(15, 'minutes').asMilliseconds(), }, @@ -304,7 +352,8 @@ export const bulkActionKnowledgeBaseEntriesRoute = (router: ElasticAssistantPlug skipped: [], errors, }, - ctx.elasticAssistant.telemetry + ctx.elasticAssistant.telemetry, + ctx.elasticAssistant.auditLogger ); } catch (err) { const error = transformError(err); diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts index 4c1ea3851aaf..cd1216713e18 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/create_route.ts @@ -26,8 +26,10 @@ export const createKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRout access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( @@ -61,6 +63,7 @@ export const createKnowledgeBaseEntryRoute = (router: ElasticAssistantPluginRout const createResponse = await kbDataClient?.createKnowledgeBaseEntry({ knowledgeBaseEntry: request.body, global: request.body.users != null && request.body.users.length === 0, + auditLogger: ctx.elasticAssistant.auditLogger, telemetry: ctx.elasticAssistant.telemetry, }); diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts index e4035264a835..6ed6001a59db 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/entries/find_route.ts @@ -33,8 +33,10 @@ export const findKnowledgeBaseEntriesRoute = (router: ElasticAssistantPluginRout .get({ access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_ENTRIES_URL_FIND, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts index 96728f66aef7..c617bbb3bda0 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_indices.ts @@ -26,8 +26,10 @@ export const getKnowledgeBaseIndicesRoute = (router: ElasticAssistantPluginRoute .get({ access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_INDICES_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts index 4e8112b420d0..c782fc6dc7a1 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/get_knowledge_base_status.ts @@ -28,8 +28,10 @@ export const getKnowledgeBaseStatusRoute = (router: ElasticAssistantPluginRouter .get({ access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts index fa7716a51033..b57e9832c126 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/knowledge_base/post_knowledge_base.ts @@ -30,8 +30,12 @@ export const postKnowledgeBaseRoute = (router: ElasticAssistantPluginRouter) => .post({ access: 'internal', path: ELASTIC_AI_ASSISTANT_KNOWLEDGE_BASE_URL, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: ROUTE_HANDLER_TIMEOUT, }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts b/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts index 55c23629c5de..59dd35bc0f61 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/post_actions_connector_execute.ts @@ -38,8 +38,10 @@ export const postActionsConnectorExecuteRoute = ( .post({ access: 'internal', path: POST_ACTIONS_CONNECTOR_EXECUTE, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts index 79fd23c0cc84..d5898c6eb245 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/prompts/bulk_actions_route.ts @@ -112,8 +112,12 @@ export const bulkPromptsRoute = (router: ElasticAssistantPluginRouter, logger: L .post({ access: 'public', path: ELASTIC_AI_ASSISTANT_PROMPTS_URL_BULK_ACTION, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: moment.duration(15, 'minutes').asMilliseconds(), }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts index a2980b173d76..c4b3e5720f74 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/prompts/find_route.ts @@ -25,8 +25,10 @@ export const findPromptsRoute = (router: ElasticAssistantPluginRouter, logger: L .get({ access: 'public', path: ELASTIC_AI_ASSISTANT_PROMPTS_URL_FIND, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts index 30045b3da8ad..08ef1bb1828d 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/request_context_factory.ts @@ -62,7 +62,7 @@ export class RequestContextFactory implements IRequestContextFactory { core: coreContext, actions: startPlugins.actions, - + auditLogger: coreStart.security.audit?.asScoped(request), logger: this.logger, getServerBasePath: () => core.http.basePath.serverBasePath, @@ -94,7 +94,6 @@ export class RequestContextFactory implements IRequestContextFactory { capabilityPath: 'securitySolutionAssistant.*', } ); - return this.assistantService.createAIAssistantKnowledgeBaseDataClient({ spaceId: getSpaceId(), logger: this.logger, diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts index 06bfa023136d..4d1010517354 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/append_conversation_messages_route.ts @@ -24,8 +24,10 @@ export const appendConversationMessageRoute = (router: ElasticAssistantPluginRou .post({ access: 'internal', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID_MESSAGES, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts index 29fe59cc3d4c..436b77fc2624 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/bulk_actions_route.ts @@ -116,8 +116,12 @@ export const bulkActionConversationsRoute = ( .post({ access: 'internal', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BULK_ACTION, + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, + }, options: { - tags: ['access:elasticAssistant'], timeout: { idleSocket: moment.duration(15, 'minutes').asMilliseconds(), }, diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts index 9955494b5f29..39971dca7480 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/create_route.ts @@ -25,8 +25,10 @@ export const createConversationRoute = (router: ElasticAssistantPluginRouter): v access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts index 9c974fdb78de..5679d8cb35c6 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/delete_route.ts @@ -21,8 +21,10 @@ export const deleteConversationRoute = (router: ElasticAssistantPluginRouter) => .delete({ access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts index 07ba23710b12..5d75860c7e66 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/find_route.ts @@ -28,8 +28,10 @@ export const findUserConversationsRoute = (router: ElasticAssistantPluginRouter) .get({ access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_FIND, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts index ab69dc20999a..3ccc2c93d8bd 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/read_route.ts @@ -23,8 +23,10 @@ export const readConversationRoute = (router: ElasticAssistantPluginRouter) => { .get({ access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts index 41956b9bc80f..f7068e0f3742 100644 --- a/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts +++ b/x-pack/plugins/elastic_assistant/server/routes/user_conversations/update_route.ts @@ -26,8 +26,10 @@ export const updateConversationRoute = (router: ElasticAssistantPluginRouter) => .put({ access: 'public', path: ELASTIC_AI_ASSISTANT_CONVERSATIONS_URL_BY_ID, - options: { - tags: ['access:elasticAssistant'], + security: { + authz: { + requiredPrivileges: ['elasticAssistant'], + }, }, }) .addVersion( diff --git a/x-pack/plugins/elastic_assistant/server/types.ts b/x-pack/plugins/elastic_assistant/server/types.ts index 6158acde679f..1102d4b7b844 100755 --- a/x-pack/plugins/elastic_assistant/server/types.ts +++ b/x-pack/plugins/elastic_assistant/server/types.ts @@ -18,7 +18,7 @@ import type { IRouter, KibanaRequest, Logger, - SecurityServiceStart, + AuditLogger, } from '@kbn/core/server'; import type { LlmTasksPluginStart } from '@kbn/llm-tasks-plugin/server'; import { type MlPluginSetup } from '@kbn/ml-plugin/server'; @@ -116,7 +116,6 @@ export interface ElasticAssistantPluginStartDependencies { llmTasks: LlmTasksPluginStart; inference: InferenceServerStart; spaces?: SpacesPluginStart; - security: SecurityServiceStart; licensing: LicensingPluginStart; productDocBase: ProductDocBaseStartContract; } @@ -124,6 +123,7 @@ export interface ElasticAssistantPluginStartDependencies { export interface ElasticAssistantApiRequestHandlerContext { core: CoreRequestHandlerContext; actions: ActionsPluginStart; + auditLogger?: AuditLogger; getRegisteredFeatures: GetRegisteredFeatures; getRegisteredTools: GetRegisteredTools; logger: Logger; diff --git a/x-pack/plugins/embeddable_enhanced/public/actions/drilldown_grouping.ts b/x-pack/plugins/embeddable_enhanced/public/actions/drilldown_grouping.ts deleted file mode 100644 index 1e896817b324..000000000000 --- a/x-pack/plugins/embeddable_enhanced/public/actions/drilldown_grouping.ts +++ /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 { i18n } from '@kbn/i18n'; -import { UiActionsPresentableGrouping as PresentableGrouping } from '@kbn/ui-actions-plugin/public'; - -export const drilldownGrouping: PresentableGrouping = [ - { - id: 'drilldowns', - getDisplayName: () => - i18n.translate('xpack.embeddableEnhanced.Drilldowns', { - defaultMessage: 'Drilldowns', - }), - getIconType: () => 'symlink', - order: 25, - }, -]; diff --git a/x-pack/plugins/embeddable_enhanced/public/actions/index.ts b/x-pack/plugins/embeddable_enhanced/public/actions/index.ts deleted file mode 100644 index c351935bbf8b..000000000000 --- a/x-pack/plugins/embeddable_enhanced/public/actions/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './drilldown_grouping'; diff --git a/x-pack/plugins/embeddable_enhanced/public/index.ts b/x-pack/plugins/embeddable_enhanced/public/index.ts index e14c8629ced9..c0242fecc094 100644 --- a/x-pack/plugins/embeddable_enhanced/public/index.ts +++ b/x-pack/plugins/embeddable_enhanced/public/index.ts @@ -19,9 +19,7 @@ export function plugin(context: PluginInitializerContext) { return new EmbeddableEnhancedPlugin(context); } -export type { EnhancedEmbeddable, EnhancedEmbeddableContext } from './types'; export { type HasDynamicActions, apiHasDynamicActions, } from './embeddables/interfaces/has_dynamic_actions'; -export { drilldownGrouping as embeddableEnhancedDrilldownGrouping } from './actions'; diff --git a/x-pack/plugins/embeddable_enhanced/public/plugin.ts b/x-pack/plugins/embeddable_enhanced/public/plugin.ts index a76f33f09595..0e374070c00d 100644 --- a/x-pack/plugins/embeddable_enhanced/public/plugin.ts +++ b/x-pack/plugins/embeddable_enhanced/public/plugin.ts @@ -6,23 +6,12 @@ */ import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from '@kbn/core/public'; -import { - defaultEmbeddableFactoryProvider, - EmbeddableContext, - EmbeddableFactory, - EmbeddableFactoryDefinition, - EmbeddableInput, - EmbeddableOutput, - EmbeddableSetup, - EmbeddableStart, - IEmbeddable, -} from '@kbn/embeddable-plugin/public'; +import { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; import { apiHasUniqueId, EmbeddableApiContext, StateComparators, } from '@kbn/presentation-publishing'; -import type { FinderAttributes } from '@kbn/saved-objects-finder-plugin/common'; import { AdvancedUiActionsSetup, AdvancedUiActionsStart, @@ -30,13 +19,12 @@ import { UiActionsEnhancedDynamicActionManager as DynamicActionManager, } from '@kbn/ui-actions-enhanced-plugin/public'; import deepEqual from 'react-fast-compare'; -import { BehaviorSubject, distinctUntilChanged } from 'rxjs'; +import { BehaviorSubject } from 'rxjs'; import { DynamicActionStorage, type DynamicActionStorageApi, } from './embeddables/dynamic_action_storage'; import { HasDynamicActions } from './embeddables/interfaces/has_dynamic_actions'; -import { EnhancedEmbeddable } from './types'; import { getDynamicActionsState } from './get_dynamic_actions_state'; export interface SetupDependencies { @@ -79,8 +67,6 @@ export class EmbeddableEnhancedPlugin private uiActions?: StartDependencies['uiActionsEnhanced']; public setup(core: CoreSetup<StartDependencies>, plugins: SetupDependencies): SetupContract { - this.setCustomEmbeddableFactoryProvider(plugins); - return {}; } @@ -94,45 +80,6 @@ export class EmbeddableEnhancedPlugin public stop() {} - private setCustomEmbeddableFactoryProvider(plugins: SetupDependencies) { - plugins.embeddable.setCustomEmbeddableFactoryProvider( - < - I extends EmbeddableInput = EmbeddableInput, - O extends EmbeddableOutput = EmbeddableOutput, - E extends IEmbeddable<I, O> = IEmbeddable<I, O>, - T extends FinderAttributes = {} - >( - def: EmbeddableFactoryDefinition<I, O, E, T> - ): EmbeddableFactory<I, O, E, T> => { - const factory: EmbeddableFactory<I, O, E, T> = defaultEmbeddableFactoryProvider<I, O, E, T>( - def - ); - return { - ...factory, - create: async (...args) => { - const embeddable = await factory.create(...args); - if (!embeddable) return embeddable; - return this.enhanceEmbeddableWithDynamicActions(embeddable); - }, - createFromSavedObject: async (...args) => { - const embeddable = await factory.createFromSavedObject(...args); - if (!embeddable) return embeddable; - return this.enhanceEmbeddableWithDynamicActions(embeddable); - }, - }; - } - ); - } - - private readonly isEmbeddableContext = (context: unknown): context is EmbeddableContext => { - if (!(context as EmbeddableContext)?.embeddable) { - // eslint-disable-next-line no-console - console.warn('For drilldowns to work action context should contain .embeddable field.'); - return false; - } - return true; - }; - private initializeDynamicActions( uuid: string, getTitle: () => string | undefined, @@ -183,77 +130,6 @@ export class EmbeddableEnhancedPlugin }; } - /** - * TODO: Remove this entire enhanceEmbeddableWithDynamicActions method once the embeddable refactor work is complete - */ - private enhanceEmbeddableWithDynamicActions<E extends IEmbeddable>( - embeddable: E - ): EnhancedEmbeddable<E> { - const enhancedEmbeddable = embeddable as EnhancedEmbeddable<E>; - - const dynamicActionsState$ = new BehaviorSubject<DynamicActionsSerializedState['enhancements']>( - { - dynamicActions: { events: [] }, - ...(embeddable.getInput().enhancements ?? {}), - } - ); - const api = { - dynamicActionsState$, - setDynamicActions: (newState: DynamicActionsSerializedState['enhancements']) => { - embeddable.updateInput({ enhancements: newState }); - }, - }; - - /** - * Keep the dynamicActionsState$ publishing subject in sync with changes to the embeddable's input. - */ - embeddable - .getInput$() - .pipe( - distinctUntilChanged(({ enhancements: old }, { enhancements: updated }) => - deepEqual(old, updated) - ) - ) - .subscribe((input) => { - dynamicActionsState$.next({ - dynamicActions: { events: [] }, - ...(input.enhancements ?? {}), - } as DynamicActionsSerializedState['enhancements']); - }); - - const storage = new DynamicActionStorage( - String(embeddable.runtimeId), - embeddable.getTitle, - api - ); - const dynamicActions = new DynamicActionManager({ - isCompatible: async (context: unknown) => { - if (!this.isEmbeddableContext(context)) return false; - return context.embeddable.runtimeId === embeddable.runtimeId; - }, - storage, - uiActions: this.uiActions!, - }); - - const stop = this.startDynamicActions(dynamicActions); - embeddable.getInput$().subscribe({ - next: () => { - storage.reload$.next(); - }, - error: stop, - complete: stop, - }); - - enhancedEmbeddable.enhancements = { - ...enhancedEmbeddable.enhancements, - dynamicActions, - }; - enhancedEmbeddable.dynamicActionsState$ = api.dynamicActionsState$; - enhancedEmbeddable.setDynamicActions = api.setDynamicActions; - - return enhancedEmbeddable; - } - private startDynamicActions(dynamicActions: DynamicActionManager) { dynamicActions.start().catch((error) => { /* eslint-disable no-console */ diff --git a/x-pack/plugins/embeddable_enhanced/public/types.ts b/x-pack/plugins/embeddable_enhanced/public/types.ts deleted file mode 100644 index c065e3b89060..000000000000 --- a/x-pack/plugins/embeddable_enhanced/public/types.ts +++ /dev/null @@ -1,18 +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 { IEmbeddable } from '@kbn/embeddable-plugin/public'; -import { HasDynamicActions } from './embeddables/interfaces/has_dynamic_actions'; - -export type EnhancedEmbeddable<E extends IEmbeddable = IEmbeddable> = E & HasDynamicActions; - -/** - * @deprecated use `EmbeddableApiContext` from `@kbn/presentation-publishing` - */ -export interface EnhancedEmbeddableContext { - embeddable: EnhancedEmbeddable; -} diff --git a/x-pack/plugins/embeddable_enhanced/tsconfig.json b/x-pack/plugins/embeddable_enhanced/tsconfig.json index 7aa9a6a2f42a..a065672b9162 100644 --- a/x-pack/plugins/embeddable_enhanced/tsconfig.json +++ b/x-pack/plugins/embeddable_enhanced/tsconfig.json @@ -9,12 +9,9 @@ "kbn_references": [ "@kbn/core", "@kbn/embeddable-plugin", - "@kbn/ui-actions-plugin", "@kbn/ui-actions-enhanced-plugin", - "@kbn/i18n", "@kbn/kibana-utils-plugin", "@kbn/data-plugin", - "@kbn/saved-objects-finder-plugin", "@kbn/presentation-publishing", ], "exclude": [ diff --git a/x-pack/plugins/enterprise_search/SERVER.md b/x-pack/plugins/enterprise_search/SERVER.md index b4275f3bb545..7b6865443e31 100644 --- a/x-pack/plugins/enterprise_search/SERVER.md +++ b/x-pack/plugins/enterprise_search/SERVER.md @@ -12,7 +12,7 @@ On startup, [the plugin](server/plugin.ts) registers all API routes with the mai API endpoints are organized according to loosely applied RESTful principles. GET for fetching data, POST for creating new data, PUT for updating data. The main routes you'll likely be working with: `enterprise_search` -- enterprise_search/analytics +- elasticsearch/analytics - enterprise_search/crawler - enterprise_search/connectors - enterprise_search/indices diff --git a/x-pack/plugins/enterprise_search/common/constants.ts b/x-pack/plugins/enterprise_search/common/constants.ts index 13afad3f1a34..638e292ff0e2 100644 --- a/x-pack/plugins/enterprise_search/common/constants.ts +++ b/x-pack/plugins/enterprise_search/common/constants.ts @@ -41,7 +41,7 @@ export const ENTERPRISE_SEARCH_OVERVIEW_PLUGIN = { DESCRIPTION: i18n.translate('xpack.enterpriseSearch.overview.description', { defaultMessage: 'Create search experiences with a refined set of APIs and tools.', }), - URL: '/app/enterprise_search/overview', + URL: '/app/elasticsearch/overview', LOGO: 'logoEnterpriseSearch', }; @@ -55,7 +55,7 @@ export const ENTERPRISE_SEARCH_CONTENT_PLUGIN = { defaultMessage: 'Enterprise search offers a number of ways to easily make your data searchable. Choose from the web crawler, Elasticsearch indices, API, direct uploads, or thrid party connectors.', // TODO: Make sure this content is correct. }), - URL: '/app/enterprise_search/content', + URL: '/app/elasticsearch/content', LOGO: 'logoEnterpriseSearch', SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', }; @@ -72,7 +72,7 @@ export const AI_SEARCH_PLUGIN = { defaultMessage: 'Toolkit for enabling developers to build AI search-powered applications using the Elastic platform.', }), - URL: '/app/enterprise_search/ai_search', + URL: '/app/elasticsearch/ai_search', LOGO: 'logoEnterpriseSearch', }; @@ -89,7 +89,7 @@ export const ANALYTICS_PLUGIN = { defaultMessage: 'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications.', }), - URL: '/app/enterprise_search/analytics', + URL: '/app/elasticsearch/analytics', SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', }; @@ -101,7 +101,7 @@ export const ELASTICSEARCH_PLUGIN = { DESCRIPTION: i18n.translate('xpack.enterpriseSearch.elasticsearch.productDescription', { defaultMessage: 'Low-level tools for creating performant and relevant search experiences.', }), - URL: '/app/enterprise_search/elasticsearch', + URL: '/app/elasticsearch/elasticsearch', SUPPORT_URL: 'https://discuss.elastic.co/c/elastic-stack/elasticsearch/', }; @@ -162,7 +162,7 @@ export const APPLICATIONS_PLUGIN = { defaultMessage: 'Build', }), SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', - URL: '/app/enterprise_search/applications', + URL: '/app/elasticsearch/applications', }; export const VECTOR_SEARCH_PLUGIN = { @@ -179,7 +179,7 @@ export const VECTOR_SEARCH_PLUGIN = { defaultMessage: 'Vector Search', }), SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', - URL: '/app/enterprise_search/vector_search', + URL: '/app/elasticsearch/vector_search', }; export const SEMANTIC_SEARCH_PLUGIN = { @@ -196,7 +196,7 @@ export const SEMANTIC_SEARCH_PLUGIN = { defaultMessage: 'Semantic Search', }), SUPPORT_URL: 'https://discuss.elastic.co/c/enterprise-search/', - URL: '/app/enterprise_search/semantic_search', + URL: '/app/elasticsearch/semantic_search', }; export const CREATE_CONNECTOR_PLUGIN = { @@ -224,7 +224,7 @@ export const ENTERPRISE_SEARCH_AUDIT_LOGS_SOURCE_ID = 'ent-search-audit-logs'; export const ENTERPRISE_SEARCH_ANALYTICS_LOGS_SOURCE_ID = 'ent-search-analytics-logs'; export const APP_SEARCH_URL = '/app/enterprise_search/app_search'; -export const ENTERPRISE_SEARCH_ELASTICSEARCH_URL = '/app/enterprise_search/elasticsearch'; +export const ENTERPRISE_SEARCH_ELASTICSEARCH_URL = '/app/elasticsearch/elasticsearch'; export const WORKPLACE_SEARCH_URL = '/app/enterprise_search/workplace_search'; export const CREATE_NEW_INDEX_URL = '/search_indices/new_index'; export const PLAYGROUND_URL = '/playground'; diff --git a/x-pack/plugins/enterprise_search/cypress/e2e/content/selectors.ts b/x-pack/plugins/enterprise_search/cypress/e2e/content/selectors.ts index 03cb09385a0f..b4e1aee6f21b 100644 --- a/x-pack/plugins/enterprise_search/cypress/e2e/content/selectors.ts +++ b/x-pack/plugins/enterprise_search/cypress/e2e/content/selectors.ts @@ -6,10 +6,10 @@ */ export const ROUTES = { - CRAWLER_INDEX: '/app/enterprise_search/content/crawlers/new_crawler', - NEW_INDEX: '/app/enterprise_search/content/search_indices/new_index', - SEARCH_INDICES_OVERVIEW: '/app/enterprise_search/content/search_indices/', - SELECT_CONNECTOR: '/app/enterprise_search/content/connectors/select_connector', + CRAWLER_INDEX: '/app/elasticsearch/content/crawlers/new_crawler', + NEW_INDEX: '/app/elasticsearch/content/search_indices/new_index', + SEARCH_INDICES_OVERVIEW: '/app/elasticsearch/content/search_indices/', + SELECT_CONNECTOR: '/app/elasticsearch/content/connectors/select_connector', }; export const SEARCH_INDICES = { @@ -66,5 +66,5 @@ export const INDEX_OVERVIEW = { }; export const getIndexRoute = (indexName: string) => { - return `/app/enterprise_search/content/search_indices/search-${indexName}/`; + return `/app/elasticsearch/content/search_indices/search-${indexName}/`; }; diff --git a/x-pack/plugins/enterprise_search/kibana.jsonc b/x-pack/plugins/enterprise_search/kibana.jsonc index 42e4db528a75..a484cf625c0a 100644 --- a/x-pack/plugins/enterprise_search/kibana.jsonc +++ b/x-pack/plugins/enterprise_search/kibana.jsonc @@ -3,7 +3,7 @@ "id": "@kbn/enterprise-search-plugin", "owner": "@elastic/search-kibana", // TODO this is currently used from Observability too, must be refactored before solution-specific builds - // see x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx + // see x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx // cc sphilipse "group": "search", "visibility": "private", @@ -21,6 +21,7 @@ "logsDataAccess", "esUiShared", "navigation", + "uiActions" ], "optionalPlugins": [ "customIntegrations", diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.test.ts index 2b1fb081f51c..603936327de4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.test.ts @@ -23,7 +23,7 @@ describe('AddAnalyticsCollectionsApiLogic', () => { http.post.mockReturnValue(promise); const result = createAnalyticsCollection({ name: 'test' }); await nextTick(); - expect(http.post).toHaveBeenCalledWith('/internal/enterprise_search/analytics/collections', { + expect(http.post).toHaveBeenCalledWith('/internal/elasticsearch/analytics/collections', { body: JSON.stringify({ name: 'test' }), }); await expect(result).resolves.toEqual({ name: 'test' }); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.ts index 2aee9c0feb26..d7d497891e92 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/add_analytics_collection/add_analytics_collection_api_logic.ts @@ -20,7 +20,7 @@ export const createAnalyticsCollection = async ({ name, }: AddAnalyticsCollectionApiLogicArgs): Promise<AddAnalyticsCollectionApiLogicResponse> => { const { http } = HttpLogic.values; - const route = '/internal/enterprise_search/analytics/collections'; + const route = '/internal/elasticsearch/analytics/collections'; const response = await http.post<AnalyticsCollection>(route, { body: JSON.stringify({ name }), }); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.test.ts index 091b71574424..ead64d2eb174 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.test.ts @@ -25,7 +25,7 @@ describe('AnalyticsEventsExistApiLogic', () => { const result = checkAnalyticsEventsExist({ indexName }); await nextTick(); expect(http.get).toHaveBeenCalledWith( - `/internal/enterprise_search/analytics/collection/${indexName}/events/exist` + `/internal/elasticsearch/analytics/collection/${indexName}/events/exist` ); await expect(result).resolves.toEqual({ exists: true }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.ts index 083297f571a9..c1a3a0bcf1e5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/check_analytics_events/check_analytics_events_exist_api_logic.ts @@ -19,7 +19,7 @@ export const checkAnalyticsEventsExist = async ({ indexName, }: AnalyticsEventsExistApiLogicArgs): Promise<AnalyticsEventsExistApiLogicResponse> => { const { http } = HttpLogic.values; - const route = `/internal/enterprise_search/analytics/collection/${indexName}/events/exist`; + const route = `/internal/elasticsearch/analytics/collection/${indexName}/events/exist`; const response = await http.get<AnalyticsEventsExist>(route); return response; diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.test.ts index 1ad6c18fea3b..b3379b47a0fb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.test.ts @@ -25,7 +25,7 @@ describe('DeleteAnalyticsCollectionApiLogic', () => { const result = deleteAnalyticsCollection({ name }); await nextTick(); expect(http.delete).toHaveBeenCalledWith( - `/internal/enterprise_search/analytics/collections/${name}` + `/internal/elasticsearch/analytics/collections/${name}` ); await expect(result).resolves.toEqual(undefined); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.tsx b/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.tsx index 2cddffd49dd5..08108bab744e 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/delete_analytics_collection/delete_analytics_collection_api_logic.tsx @@ -14,7 +14,7 @@ export type DeleteAnalyticsCollectionApiLogicResponse = void; export const deleteAnalyticsCollection = async ({ name }: { name: string }) => { const { http } = HttpLogic.values; - const route = `/internal/enterprise_search/analytics/collections/${name}`; + const route = `/internal/elasticsearch/analytics/collections/${name}`; await http.delete<DeleteAnalyticsCollectionApiLogicResponse>(route); return; diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.test.ts index ae21c61a8fad..3a24a97a4ed3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.test.ts @@ -25,7 +25,7 @@ describe('FetchAnalyticsCollectionApiLogic', () => { const result = fetchAnalyticsCollection({ name }); await nextTick(); expect(http.get).toHaveBeenCalledWith( - `/internal/enterprise_search/analytics/collections/${name}` + `/internal/elasticsearch/analytics/collections/${name}` ); await expect(result).resolves.toEqual({ name: 'result' }); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.tsx b/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.tsx index 5aafc82c29e0..92938344a0bb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/fetch_analytics_collection/fetch_analytics_collection_api_logic.tsx @@ -14,7 +14,7 @@ export type FetchAnalyticsCollectionApiLogicResponse = AnalyticsCollection; export const fetchAnalyticsCollection = async ({ name }: { name: string }) => { const { http } = HttpLogic.values; - const route = `/internal/enterprise_search/analytics/collections/${name}`; + const route = `/internal/elasticsearch/analytics/collections/${name}`; const response = await http.get<AnalyticsCollection>(route); return response; diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.test.ts index c1a5950e0307..460badab4ddf 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.test.ts @@ -34,7 +34,7 @@ describe('GenerateAnalyticsApiKeyLogic', () => { }); await nextTick(); expect(http.post).toHaveBeenCalledWith( - '/internal/enterprise_search/analytics/collections/puggles/api_key', + '/internal/elasticsearch/analytics/collections/puggles/api_key', { body: JSON.stringify({ keyName: 'puggles read only key', diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.ts index 2603ee977a6a..c0f4e8ea7177 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/generate_analytics_api_key/generate_analytics_api_key_logic.ts @@ -24,7 +24,7 @@ export const generateAnalyticsApiKey = async ({ collectionName: string; keyName: string; }) => { - const route = `/internal/enterprise_search/analytics/collections/${collectionName}/api_key`; + const route = `/internal/elasticsearch/analytics/collections/${collectionName}/api_key`; return await HttpLogic.values.http.post<APIKeyResponse>(route, { body: JSON.stringify({ diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.test.ts index 15d73d21ff89..c4fff16e6d19 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.test.ts @@ -23,7 +23,7 @@ describe('FetchAnalyticsCollectionsApiLogic', () => { http.get.mockReturnValue(promise); const result = fetchAnalyticsCollections({}); await nextTick(); - expect(http.get).toHaveBeenCalledWith('/internal/enterprise_search/analytics/collections', { + expect(http.get).toHaveBeenCalledWith('/internal/elasticsearch/analytics/collections', { query: { query: '' }, }); await expect(result).resolves.toEqual([{ name: 'result' }]); diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.ts index 45567d920263..e1e8080973c2 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/api/index/fetch_analytics_collections_api_logic.ts @@ -20,7 +20,7 @@ export const fetchAnalyticsCollections = async ({ query = '', }: FetchAnalyticsCollectionsApiLogicArgs) => { const { http } = HttpLogic.values; - const route = '/internal/enterprise_search/analytics/collections'; + const route = '/internal/elasticsearch/analytics/collections'; const response = await http.get<FetchAnalyticsCollectionsApiLogicResponse>(route, { query: { query, diff --git a/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_modal.tsx index a13fd20760c1..6008c391239b 100644 --- a/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/analytics/components/add_analytics_collections/add_analytics_collection_modal.tsx @@ -41,6 +41,7 @@ export const AddAnalyticsCollectionModal: React.FC<AddAnalyticsCollectionModalPr }) => { const { isLoading, isSuccess, isSystemError, canSubmit } = useValues(AddAnalyticsCollectionLogic); const modalFormId = useGeneratedHtmlId({ prefix: 'createAnalyticsCollection' }); + const modalTitleId = useGeneratedHtmlId({ prefix: 'modalTitleId' }); useEffect(() => { if (isSuccess || isSystemError) { @@ -52,11 +53,12 @@ export const AddAnalyticsCollectionModal: React.FC<AddAnalyticsCollectionModalPr <EuiModal onClose={onClose} maxWidth={minModalWidth} + aria-labelledby={modalTitleId} initialFocus={`[name=${collectionNameField}]`} > <EuiModalHeader> <EuiFlexItem> - <EuiModalHeaderTitle> + <EuiModalHeaderTitle id={modalTitleId}> {i18n.translate('xpack.enterpriseSearch.analytics.collectionsCreate.form.title', { defaultMessage: 'Name your Collection', })} @@ -81,13 +83,17 @@ export const AddAnalyticsCollectionModal: React.FC<AddAnalyticsCollectionModalPr </EuiModalBody> <EuiModalFooter> - <EuiButtonEmpty onClick={onClose}> + <EuiButtonEmpty + data-test-subj="enterpriseSearchAddAnalyticsCollectionModalCancelButton" + onClick={onClose} + > {i18n.translate('xpack.enterpriseSearch.analytics.collectionsCreate.form.cancelButton', { defaultMessage: 'Cancel', })} </EuiButtonEmpty> <EuiButton + data-test-subj="enterpriseSearchAddAnalyticsCollectionModalCreateButton" fill type="submit" form={modalFormId} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/nav.tsx index c70971ebc6ec..20bbfe38e5f3 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/nav.tsx @@ -65,20 +65,3 @@ export const useAppSearchNav = () => { // to cause all our navItems to properly render as nav links. return [{ id: '', name: '', items: navItems }]; }; - -// Process App Search side nav items for use in the new Solution Nav -export const cleanAppSearchNavItems = ( - items: Array<EuiSideNavItemType<unknown>> -): Array<EuiSideNavItemType<unknown>> => { - const enginesItem = items.find((item) => item.id === 'engines'); - if (enginesItem && enginesItem.items && enginesItem.items.length > 0) { - const engineChildren = enginesItem.items; - const engineNameItem = engineChildren.find((item) => item.id === 'engineName'); - if (engineNameItem && engineNameItem.renderItem) { - delete engineNameItem.renderItem; - engineNameItem.items = engineChildren.filter((item) => item.id !== 'engineName'); - enginesItem.items = [engineNameItem]; - } - } - return items; -}; diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx index 35792e2d0cbf..5168a05c8a37 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/layout/page_template.tsx @@ -16,26 +16,15 @@ import { SetAppSearchChrome } from '../../../shared/kibana_chrome'; import { EnterpriseSearchPageTemplateWrapper, PageTemplateProps } from '../../../shared/layout'; import { SendAppSearchTelemetry } from '../../../shared/telemetry'; -import { useAppSearchNav, cleanAppSearchNavItems } from './nav'; +import { useAppSearchNav } from './nav'; export const AppSearchPageTemplate: React.FC< Omit<PageTemplateProps, 'useEndpointHeaderActions'> > = ({ children, pageChrome, pageViewTelemetry, ...pageTemplateProps }) => { const navItems = useAppSearchNav(); - const { getChromeStyle$, updateSideNavDefinition } = useValues(KibanaLogic); + const { getChromeStyle$ } = useValues(KibanaLogic); const chromeStyle = useObservable(getChromeStyle$(), 'classic'); - React.useEffect(() => { - if (chromeStyle === 'classic') return; - const appSearch = cleanAppSearchNavItems(navItems?.[0]?.items); - // We update the new side nav definition with the selected app items - updateSideNavDefinition({ appSearch }); - - return () => { - updateSideNavDefinition({ appSearch: undefined }); - }; - }, [chromeStyle, navItems, updateSideNavDefinition]); - return ( <EnterpriseSearchPageTemplateWrapper {...pageTemplateProps} diff --git a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/synonym_modal.tsx b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/synonym_modal.tsx index 93dbc9cea444..ed3274112db9 100644 --- a/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/synonym_modal.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/app_search/components/synonyms/components/synonym_modal.tsx @@ -19,6 +19,7 @@ import { EuiFlexItem, EuiButton, EuiButtonEmpty, + useGeneratedHtmlId, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; @@ -37,6 +38,7 @@ export const SynonymModal: React.FC = () => { const { isModalOpen, modalLoading, activeSynonymSet } = useValues(SynonymsLogic); const { closeModal, createSynonymSet, updateSynonymSet, deleteSynonymSet } = useActions(SynonymsLogic); + const modalTitleId = useGeneratedHtmlId(); const modalTitle = activeSynonymSet ? SYNONYM_UPDATE_TITLE : SYNONYM_CREATE_TITLE; const id = activeSynonymSet?.id || 'createNewSynonymSet'; @@ -46,9 +48,9 @@ export const SynonymModal: React.FC = () => { : (newSynonyms: string[]) => createSynonymSet(newSynonyms); return isModalOpen ? ( - <EuiModal onClose={closeModal}> + <EuiModal onClose={closeModal} aria-labelledby={modalTitleId}> <EuiModalHeader> - <EuiModalHeaderTitle>{modalTitle}</EuiModalHeaderTitle> + <EuiModalHeaderTitle id={modalTitleId}>{modalTitle}</EuiModalHeaderTitle> </EuiModalHeader> <FlashMessages /> <EuiModalBody> @@ -82,7 +84,12 @@ export const SynonymModal: React.FC = () => { )} </EuiFlexItem> <EuiFlexItem grow={false}> - <EuiButtonEmpty onClick={closeModal}>{CANCEL_BUTTON_LABEL}</EuiButtonEmpty> + <EuiButtonEmpty + data-test-subj="enterpriseSearchSynonymModalButton" + onClick={closeModal} + > + {CANCEL_BUTTON_LABEL} + </EuiButtonEmpty> </EuiFlexItem> <EuiFlexItem grow={false}> <EuiButton diff --git a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx index 1866d568af62..81827172acc6 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.test.tsx @@ -26,6 +26,7 @@ import { mlPluginMock } from '@kbn/ml-plugin/public/mocks'; import { navigationPluginMock } from '@kbn/navigation-plugin/public/mocks'; import { securityMock } from '@kbn/security-plugin/public/mocks'; import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; +import { uiActionsPluginMock } from '@kbn/ui-actions-plugin/public/mocks'; import { AppSearch } from './app_search'; import { EnterpriseSearchOverview } from './enterprise_search_overview'; @@ -52,6 +53,7 @@ describe('renderApp', () => { security: securityMock.createStart(), share: sharePluginMock.createStartContract(), ml: mlPluginMock.createStartContract(), + uiActions: uiActionsPluginMock.createStartContract(), user: {}, }, updateSideNavDefinition: jest.fn(), diff --git a/x-pack/plugins/enterprise_search/public/applications/index.tsx b/x-pack/plugins/enterprise_search/public/applications/index.tsx index d934932dd163..273bf1726cc5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/index.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/index.tsx @@ -14,8 +14,11 @@ import { Store } from 'redux'; import { of } from 'rxjs'; +import { CellActionsProvider } from '@kbn/cell-actions'; + import { AppMountParameters, CoreStart } from '@kbn/core/public'; import { I18nProvider } from '@kbn/i18n-react'; +import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; @@ -146,34 +149,41 @@ export const renderApp = ( http, readOnlyMode, }); + const unmountFlashMessagesLogic = mountFlashMessagesLogic({ notifications }); ReactDOM.render( <I18nProvider> <KibanaThemeProvider theme={{ theme$: params.theme$ }}> - <KibanaContextProvider - services={{ - ...core, - ...plugins, - }} - > - <CloudContext> - <Provider store={store}> - <Router history={params.history}> - <App - access={productAccess} - appSearch={appSearch} - configuredLimits={configuredLimits} - enterpriseSearchVersion={enterpriseSearchVersion} - features={features} - kibanaVersion={kibanaVersion} - readOnlyMode={readOnlyMode} - searchOAuth={searchOAuth} - workplaceSearch={workplaceSearch} - /> - </Router> - </Provider> - </CloudContext> - </KibanaContextProvider> + <EuiThemeProvider darkMode={core.theme.getTheme().darkMode}> + <KibanaContextProvider + services={{ + ...core, + ...plugins, + }} + > + <CellActionsProvider + getTriggerCompatibleActions={plugins.uiActions.getTriggerCompatibleActions} + > + <CloudContext> + <Provider store={store}> + <Router history={params.history}> + <App + access={productAccess} + appSearch={appSearch} + configuredLimits={configuredLimits} + enterpriseSearchVersion={enterpriseSearchVersion} + features={features} + kibanaVersion={kibanaVersion} + readOnlyMode={readOnlyMode} + searchOAuth={searchOAuth} + workplaceSearch={workplaceSearch} + /> + </Router> + </Provider> + </CloudContext> + </CellActionsProvider> + </KibanaContextProvider> + </EuiThemeProvider> </KibanaThemeProvider> </I18nProvider>, params.element diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/cypress/routes.ts b/x-pack/plugins/enterprise_search/public/applications/shared/cypress/routes.ts index b1a0aaba9566..3d74b81cfddb 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/cypress/routes.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/cypress/routes.ts @@ -5,6 +5,6 @@ * 2.0. */ -export const overviewPath = '/app/enterprise_search/overview'; +export const overviewPath = '/app/elasticsearch/overview'; export const appSearchPath = '/app/enterprise_search/app_search'; export const workplaceSearchPath = '/app/enterprise_search/workplace_search'; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.test.ts index 47dcd899d82c..7cda1c6893b1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/generate_breadcrumbs.test.ts @@ -163,7 +163,7 @@ describe('useSearchBreadcrumbs', () => { expect(useSearchBreadcrumbs(breadcrumbs)).toEqual([ { text: 'Elasticsearch', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { @@ -206,7 +206,7 @@ describe('useEnterpriseSearchBreadcrumbs', () => { expect(useEnterpriseSearchBreadcrumbs(breadcrumbs)).toEqual([ { text: 'Enterprise Search', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { @@ -252,7 +252,7 @@ describe('useAppSearchBreadcrumbs', () => { expect(useAppSearchBreadcrumbs(breadcrumbs)).toEqual([ { text: 'Enterprise Search', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { @@ -275,7 +275,7 @@ describe('useAppSearchBreadcrumbs', () => { expect(useAppSearchBreadcrumbs()).toEqual([ { text: 'Enterprise Search', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { @@ -308,7 +308,7 @@ describe('useWorkplaceSearchBreadcrumbs', () => { expect(useWorkplaceSearchBreadcrumbs(breadcrumbs)).toEqual([ { text: 'Enterprise Search', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { @@ -331,7 +331,7 @@ describe('useWorkplaceSearchBreadcrumbs', () => { expect(useWorkplaceSearchBreadcrumbs()).toEqual([ { text: 'Enterprise Search', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', onClick: expect.any(Function), }, { diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx index 0c1e959f7b50..7fe1ba1e017c 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/base_nav.tsx @@ -21,11 +21,7 @@ import type { ClassicNavItem } from '@kbn/search-navigation/public'; import { GETTING_STARTED_TITLE } from '../../../../common/constants'; -import { BuildClassicNavParameters } from '../types'; - -export const buildBaseClassicNavItems = ({ - productAccess, -}: BuildClassicNavParameters): ClassicNavItem[] => { +export const buildBaseClassicNavItems = (): ClassicNavItem[] => { const navItems: ClassicNavItem[] = []; // Home @@ -168,35 +164,5 @@ export const buildBaseClassicNavItems = ({ name: GETTING_STARTED_TITLE, }); - if (productAccess.hasAppSearchAccess || productAccess.hasWorkplaceSearchAccess) { - const entSearchItems: ClassicNavItem[] = []; - if (productAccess.hasAppSearchAccess) { - entSearchItems.push({ - 'data-test-subj': 'searchSideNav-AppSearch', - deepLink: { - link: 'appSearch:engines', - }, - id: 'app_search', - }); - } - if (productAccess.hasWorkplaceSearchAccess) { - entSearchItems.push({ - 'data-test-subj': 'searchSideNav-WorkplaceSearch', - deepLink: { - link: 'workplaceSearch', - }, - id: 'workplace_search', - }); - } - navItems.push({ - 'data-test-subj': 'searchSideNav-EnterpriseSearch', - id: 'enterpriseSearch', - items: entSearchItems, - name: i18n.translate('xpack.enterpriseSearch.nav.title', { - defaultMessage: 'Enterprise Search', - }), - }); - } - return navItems; }; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts b/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts index 50c5841092a6..457dfcbad3b5 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/classic_nav_helpers.test.ts @@ -22,23 +22,23 @@ describe('generateSideNavItems', () => { const deepLinksMap = { enterpriseSearch: { id: 'enterpriseSearch', - url: '/app/enterprise_search/overview', + url: '/app/elasticsearch/overview', title: 'Overview', }, 'enterpriseSearchContent:searchIndices': { id: 'enterpriseSearchContent:searchIndices', title: 'Indices', - url: '/app/enterprise_search/content/search_indices', + url: '/app/elasticsearch/content/search_indices', }, 'enterpriseSearchContent:connectors': { id: 'enterpriseSearchContent:connectors', title: 'Connectors', - url: '/app/enterprise_search/content/connectors', + url: '/app/elasticsearch/content/connectors', }, 'enterpriseSearchContent:webCrawlers': { id: 'enterpriseSearchContent:webCrawlers', title: 'Web Crawlers', - url: '/app/enterprise_search/content/crawlers', + url: '/app/elasticsearch/content/crawlers', }, } as unknown as Record<string, ChromeNavLink | undefined>; beforeEach(() => { @@ -58,7 +58,7 @@ describe('generateSideNavItems', () => { expect(generateSideNavItems(classicNavItems, deepLinksMap)).toEqual([ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Overview', @@ -88,7 +88,7 @@ describe('generateSideNavItems', () => { id: 'parent', items: [ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Overview', @@ -113,7 +113,7 @@ describe('generateSideNavItems', () => { expect(generateSideNavItems(classicNavItems, deepLinksMap)).toEqual([ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Home', @@ -141,7 +141,7 @@ describe('generateSideNavItems', () => { expect(generateSideNavItems(classicNavItems, deepLinksMap)).toEqual([ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Home', diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx index 08976a4dc68c..21b399892269 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.test.tsx @@ -35,7 +35,7 @@ const DEFAULT_PRODUCT_ACCESS: ProductAccess = { const baseNavItems = [ expect.objectContaining({ 'data-test-subj': 'searchSideNav-Home', - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'home', items: undefined, }), @@ -45,21 +45,21 @@ const baseNavItems = [ items: [ { 'data-test-subj': 'searchSideNav-Indices', - href: '/app/enterprise_search/content/search_indices', + href: '/app/elasticsearch/content/search_indices', id: 'search_indices', items: [], name: 'Indices', }, { 'data-test-subj': 'searchSideNav-Connectors', - href: '/app/enterprise_search/content/connectors', + href: '/app/elasticsearch/content/connectors', id: 'connectors', items: undefined, name: 'Connectors', }, { 'data-test-subj': 'searchSideNav-Crawlers', - href: '/app/enterprise_search/content/crawlers', + href: '/app/elasticsearch/content/crawlers', id: 'crawlers', items: undefined, name: 'Web Crawlers', @@ -80,14 +80,14 @@ const baseNavItems = [ }, { 'data-test-subj': 'searchSideNav-SearchApplications', - href: '/app/enterprise_search/applications/search_applications', + href: '/app/elasticsearch/applications/search_applications', id: 'searchApplications', items: undefined, name: 'Search Applications', }, { 'data-test-subj': 'searchSideNav-BehavioralAnalytics', - href: '/app/enterprise_search/analytics', + href: '/app/elasticsearch/analytics', id: 'analyticsCollections', items: undefined, name: 'Behavioral Analytics', @@ -115,28 +115,28 @@ const baseNavItems = [ items: [ { 'data-test-subj': 'searchSideNav-Elasticsearch', - href: '/app/enterprise_search/elasticsearch', + href: '/app/elasticsearch/elasticsearch', id: 'elasticsearch', items: undefined, name: 'Elasticsearch', }, { 'data-test-subj': 'searchSideNav-VectorSearch', - href: '/app/enterprise_search/vector_search', + href: '/app/elasticsearch/vector_search', id: 'vectorSearch', items: undefined, name: 'Vector Search', }, { 'data-test-subj': 'searchSideNav-SemanticSearch', - href: '/app/enterprise_search/semantic_search', + href: '/app/elasticsearch/semantic_search', id: 'semanticSearch', items: undefined, name: 'Semantic Search', }, { 'data-test-subj': 'searchSideNav-AISearch', - href: '/app/enterprise_search/ai_search', + href: '/app/elasticsearch/ai_search', id: 'aiSearch', items: undefined, name: 'AI Search', @@ -144,48 +144,27 @@ const baseNavItems = [ ], name: 'Getting started', }, - { - 'data-test-subj': 'searchSideNav-EnterpriseSearch', - id: 'enterpriseSearch', - items: [ - { - 'data-test-subj': 'searchSideNav-AppSearch', - href: '/app/enterprise_search/app_search', - id: 'app_search', - items: undefined, - name: 'App Search', - }, - { - 'data-test-subj': 'searchSideNav-WorkplaceSearch', - href: '/app/enterprise_search/workplace_search', - id: 'workplace_search', - items: undefined, - name: 'Workplace Search', - }, - ], - name: 'Enterprise Search', - }, ]; const mockNavLinks = [ { id: 'enterpriseSearch', - url: '/app/enterprise_search/overview', + url: '/app/elasticsearch/overview', }, { id: 'enterpriseSearchContent:searchIndices', title: 'Indices', - url: '/app/enterprise_search/content/search_indices', + url: '/app/elasticsearch/content/search_indices', }, { id: 'enterpriseSearchContent:connectors', title: 'Connectors', - url: '/app/enterprise_search/content/connectors', + url: '/app/elasticsearch/content/connectors', }, { id: 'enterpriseSearchContent:webCrawlers', title: 'Web Crawlers', - url: '/app/enterprise_search/content/crawlers', + url: '/app/elasticsearch/content/crawlers', }, { id: 'searchPlayground', @@ -195,12 +174,12 @@ const mockNavLinks = [ { id: 'enterpriseSearchApplications:searchApplications', title: 'Search Applications', - url: '/app/enterprise_search/applications/search_applications', + url: '/app/elasticsearch/applications/search_applications', }, { id: 'enterpriseSearchAnalytics', title: 'Behavioral Analytics', - url: '/app/enterprise_search/analytics', + url: '/app/elasticsearch/analytics', }, { id: 'searchInferenceEndpoints:inferenceEndpoints', @@ -220,22 +199,22 @@ const mockNavLinks = [ { id: 'enterpriseSearchElasticsearch', title: 'Elasticsearch', - url: '/app/enterprise_search/elasticsearch', + url: '/app/elasticsearch/elasticsearch', }, { id: 'enterpriseSearchVectorSearch', title: 'Vector Search', - url: '/app/enterprise_search/vector_search', + url: '/app/elasticsearch/vector_search', }, { id: 'enterpriseSearchSemanticSearch', title: 'Semantic Search', - url: '/app/enterprise_search/semantic_search', + url: '/app/elasticsearch/semantic_search', }, { id: 'enterpriseSearchAISearch', title: 'AI Search', - url: '/app/enterprise_search/ai_search', + url: '/app/elasticsearch/ai_search', }, ]; @@ -264,86 +243,6 @@ describe('useEnterpriseSearchContentNav', () => { expect(result.current).toEqual(baseNavItems); }); - - it('excludes legacy products when the user has no access to them', () => { - const noProductAccess: ProductAccess = { - ...DEFAULT_PRODUCT_ACCESS, - hasAppSearchAccess: false, - hasWorkplaceSearchAccess: false, - }; - - setMockValues({ - ...defaultMockValues, - productAccess: noProductAccess, - }); - mockKibanaValues.uiSettings.get.mockReturnValue(false); - - const { result } = renderHook(() => useEnterpriseSearchNav()); - const esNav = result.current; - const legacyESNav = esNav?.find((item) => item.id === 'enterpriseSearch'); - expect(legacyESNav).toBeUndefined(); - }); - - it('excludes App Search when the user has no access to it', () => { - const workplaceSearchProductAccess: ProductAccess = { - ...DEFAULT_PRODUCT_ACCESS, - hasAppSearchAccess: false, - hasWorkplaceSearchAccess: true, - }; - - setMockValues({ - ...defaultMockValues, - productAccess: workplaceSearchProductAccess, - }); - - const { result } = renderHook(() => useEnterpriseSearchNav()); - const esNav = result.current; - const legacyESNav = esNav?.find((item) => item.id === 'enterpriseSearch'); - expect(legacyESNav).not.toBeUndefined(); - expect(legacyESNav).toEqual({ - 'data-test-subj': 'searchSideNav-EnterpriseSearch', - id: 'enterpriseSearch', - items: [ - { - 'data-test-subj': 'searchSideNav-WorkplaceSearch', - href: '/app/enterprise_search/workplace_search', - id: 'workplace_search', - name: 'Workplace Search', - }, - ], - name: 'Enterprise Search', - }); - }); - - it('excludes Workplace Search when the user has no access to it', () => { - const appSearchProductAccess: ProductAccess = { - ...DEFAULT_PRODUCT_ACCESS, - hasWorkplaceSearchAccess: false, - }; - - setMockValues({ - ...defaultMockValues, - productAccess: appSearchProductAccess, - }); - - const { result } = renderHook(() => useEnterpriseSearchNav()); - const esNav = result.current; - const legacyESNav = esNav?.find((item) => item.id === 'enterpriseSearch'); - expect(legacyESNav).not.toBeUndefined(); - expect(legacyESNav).toEqual({ - 'data-test-subj': 'searchSideNav-EnterpriseSearch', - id: 'enterpriseSearch', - items: [ - { - 'data-test-subj': 'searchSideNav-AppSearch', - href: '/app/enterprise_search/app_search', - id: 'app_search', - name: 'App Search', - }, - ], - name: 'Enterprise Search', - }); - }); }); describe('useEnterpriseSearchApplicationNav', () => { @@ -370,7 +269,6 @@ describe('useEnterpriseSearchApplicationNav', () => { 'Build', 'Relevance', 'Getting started', - 'Enterprise Search', ]); const searchItem = navItems?.find((ni) => ni.id === 'build'); expect(searchItem).not.toBeUndefined(); @@ -387,17 +285,17 @@ describe('useEnterpriseSearchApplicationNav', () => { const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0]; expect(engineItem).toMatchInlineSnapshot(` Object { - "href": "/app/enterprise_search/applications/search_applications/my-test-engine", + "href": "/app/elasticsearch/applications/search_applications/my-test-engine", "id": "searchApplicationId", "items": Array [ Object { - "href": "/app/enterprise_search/applications/search_applications/my-test-engine/docs_explorer", + "href": "/app/elasticsearch/applications/search_applications/my-test-engine/docs_explorer", "id": "enterpriseSearchApplicationDocsExplorer", "items": undefined, "name": "Docs Explorer", }, Object { - "href": "/app/enterprise_search/applications/search_applications/my-test-engine/content", + "href": "/app/elasticsearch/applications/search_applications/my-test-engine/content", "iconToString": undefined, "id": "enterpriseSearchApplicationsContent", "items": undefined, @@ -410,7 +308,7 @@ describe('useEnterpriseSearchApplicationNav', () => { "nameToString": "Content", }, Object { - "href": "/app/enterprise_search/applications/search_applications/my-test-engine/connect", + "href": "/app/elasticsearch/applications/search_applications/my-test-engine/connect", "id": "enterpriseSearchApplicationConnect", "items": undefined, "name": "Connect", @@ -432,7 +330,6 @@ describe('useEnterpriseSearchApplicationNav', () => { 'Build', 'Relevance', 'Getting started', - 'Enterprise Search', ]); const searchItem = navItems?.find((ni) => ni.id === 'build'); expect(searchItem).not.toBeUndefined(); @@ -448,7 +345,7 @@ describe('useEnterpriseSearchApplicationNav', () => { // @ts-ignore const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0]; expect(engineItem).toEqual({ - href: `/app/enterprise_search/applications/search_applications/${engineName}`, + href: `/app/elasticsearch/applications/search_applications/${engineName}`, id: 'searchApplicationId', name: engineName, }); @@ -470,7 +367,7 @@ describe('useEnterpriseSearchApplicationNav', () => { expect(engineItem).toMatchInlineSnapshot(` Object { - "href": "/app/enterprise_search/applications/search_applications/my-test-engine/content", + "href": "/app/elasticsearch/applications/search_applications/my-test-engine/content", "iconToString": "warning", "id": "enterpriseSearchApplicationsContent", "items": undefined, @@ -535,24 +432,24 @@ describe('useEnterpriseSearchAnalyticsNav', () => { expect(analyticsNav).not.toBeUndefined(); expect(analyticsNav).toEqual({ 'data-test-subj': 'searchSideNav-BehavioralAnalytics', - href: '/app/enterprise_search/analytics', + href: '/app/elasticsearch/analytics', id: 'analyticsCollections', items: [ { id: 'analyticsCollection', items: [ { - href: '/app/enterprise_search/analytics/overview-path', + href: '/app/elasticsearch/analytics/overview-path', id: 'analyticsCollectionOverview', name: 'Overview', }, { - href: '/app/enterprise_search/analytics/explorer-path', + href: '/app/elasticsearch/analytics/explorer-path', id: 'analyticsCollectionExplorer', name: 'Explorer', }, { - href: '/app/enterprise_search/analytics/integration-path', + href: '/app/elasticsearch/analytics/integration-path', id: 'analyticsCollectionIntegration', name: 'Integration', }, diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx index 8f83b6c73402..d122cf788fd4 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/layout/nav.tsx @@ -30,19 +30,19 @@ import { generateNavLink } from './nav_link_helpers'; * @returns The Enterprise Search navigation items */ export const useEnterpriseSearchNav = (alwaysReturn = false) => { - const { isSidebarEnabled, productAccess, getNavLinks } = useValues(KibanaLogic); + const { isSidebarEnabled, getNavLinks } = useValues(KibanaLogic); const indicesNavItems = useIndicesNav(); const navItems: Array<EuiSideNavItemTypeEnhanced<unknown>> = useMemo(() => { - const baseNavItems = buildBaseClassicNavItems({ productAccess }); + const baseNavItems = buildBaseClassicNavItems(); const deepLinks = getNavLinks().reduce((links, link) => { links[link.id] = link; return links; }, {} as Record<string, ChromeNavLink | undefined>); return generateSideNavItems(baseNavItems, deepLinks, { search_indices: indicesNavItems }); - }, [productAccess, indicesNavItems]); + }, [indicesNavItems]); if (!isSidebarEnabled && !alwaysReturn) return undefined; diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/types.ts b/x-pack/plugins/enterprise_search/public/applications/shared/types.ts index 25fce6c62d05..83148acd05cc 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/types.ts +++ b/x-pack/plugins/enterprise_search/public/applications/shared/types.ts @@ -8,7 +8,6 @@ import type { AppDeepLinkId, EuiSideNavItemTypeEnhanced } from '@kbn/core-chrome-browser'; import { APP_SEARCH_PLUGIN, WORKPLACE_SEARCH_PLUGIN } from '../../../common/constants'; -import type { ProductAccess } from '../../../common/types'; import { ADD, UPDATE } from './constants/operations'; @@ -81,7 +80,3 @@ export interface GenerateNavLinkFromDeepLinkParameters { link: AppDeepLinkId; shouldShowActiveForSubroutes?: boolean; } - -export interface BuildClassicNavParameters { - productAccess: ProductAccess; -} diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/page_template.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/page_template.tsx index ed352cd42aa8..87c70d19351d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/page_template.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/components/layout/page_template.tsx @@ -25,20 +25,9 @@ export const WorkplaceSearchPageTemplate: React.FC<PageTemplateProps> = ({ ...pageTemplateProps }) => { const navItems = useWorkplaceSearchNav(); - const { getChromeStyle$, updateSideNavDefinition } = useValues(KibanaLogic); + const { getChromeStyle$ } = useValues(KibanaLogic); const chromeStyle = useObservable(getChromeStyle$(), 'classic'); - React.useEffect(() => { - if (chromeStyle === 'classic') return; - // We update the new side nav definition with the selected app items - updateSideNavDefinition({ workplaceSearch: navItems?.[0]?.items }); - }, [chromeStyle, navItems, updateSideNavDefinition]); - React.useEffect(() => { - return () => { - updateSideNavDefinition({ workplaceSearch: undefined }); - }; - }, [updateSideNavDefinition]); - return ( <EnterpriseSearchPageTemplateWrapper restrictWidth diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_key_flyout.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_key_flyout.tsx index 150778ad7fdb..18bb73d8d5fd 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_key_flyout.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_key_flyout.tsx @@ -23,6 +23,7 @@ import { EuiButton, EuiForm, EuiTitle, + useGeneratedHtmlId, } from '@elastic/eui'; import { CLOSE_BUTTON_LABEL, SAVE_BUTTON_LABEL } from '../../../../shared/constants'; @@ -44,12 +45,20 @@ export const ApiKeyFlyout: React.FC = () => { activeApiTokenRawName: rawName, } = useValues(ApiKeysLogic); + const flyoutTitleId = useGeneratedHtmlId(); + return ( <EuiPortal> - <EuiFlyout onClose={hideApiKeyForm} hideCloseButton ownFocus size="s"> + <EuiFlyout + onClose={hideApiKeyForm} + hideCloseButton + ownFocus + size="s" + aria-labelledby={flyoutTitleId} + > <EuiFlyoutHeader hasBorder> <EuiTitle size="m"> - <h2>{API_KEY_FLYOUT_TITLE}</h2> + <h2 id={flyoutTitleId}>{API_KEY_FLYOUT_TITLE}</h2> </EuiTitle> </EuiFlyoutHeader> <EuiFlyoutBody> @@ -86,7 +95,11 @@ export const ApiKeyFlyout: React.FC = () => { <EuiFlyoutFooter> <EuiFlexGroup justifyContent="spaceBetween"> <EuiFlexItem grow={false}> - <EuiButtonEmpty iconType="cross" onClick={hideApiKeyForm}> + <EuiButtonEmpty + data-test-subj="enterpriseSearchApiKeyFlyoutButton" + iconType="cross" + onClick={hideApiKeyForm} + > {CLOSE_BUTTON_LABEL} </EuiButtonEmpty> </EuiFlexItem> diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_keys_list.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_keys_list.tsx index 016ab78b3abb..10f1ca12a613 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_keys_list.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/api_keys/components/api_keys_list.tsx @@ -9,7 +9,13 @@ import React from 'react'; import { useActions, useValues } from 'kea'; -import { EuiBasicTable, EuiBasicTableColumn, EuiCopy, EuiConfirmModal } from '@elastic/eui'; +import { + EuiBasicTable, + EuiBasicTableColumn, + EuiCopy, + EuiConfirmModal, + useGeneratedHtmlId, +} from '@elastic/eui'; import { DELETE_BUTTON_LABEL, CANCEL_BUTTON_LABEL } from '../../../../shared/constants'; import { HiddenText } from '../../../../shared/hidden_text'; @@ -32,16 +38,19 @@ export const ApiKeysList: React.FC = () => { const { deleteApiKey, onPaginate, stageTokenNameForDeletion, hideDeleteModal } = useActions(ApiKeysLogic); const { apiTokens, meta, dataLoading, deleteModalVisible } = useValues(ApiKeysLogic); + const modalTitleId = useGeneratedHtmlId(); const deleteModal = ( <EuiConfirmModal title={API_KEYS_CONFIRM_DELETE_TITLE} + titleProps={{ id: modalTitleId }} onCancel={hideDeleteModal} onConfirm={deleteApiKey} cancelButtonText={CANCEL_BUTTON_LABEL} confirmButtonText={DELETE_BUTTON_LABEL} buttonColor="danger" defaultFocusedButton="confirm" + aria-labelledby={modalTitleId} > <p>{API_KEYS_CONFIRM_DELETE_LABEL}</p> </EuiConfirmModal> diff --git a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.tsx b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.tsx index 30b450df91c1..33efd2d84222 100644 --- a/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/workplace_search/views/settings/components/branding_section.tsx @@ -16,6 +16,7 @@ import { EuiFilePicker, EuiText, EuiSpacer, + useGeneratedHtmlId, } from '@elastic/eui'; import { @@ -71,6 +72,7 @@ export const BrandingSection: React.FC<Props> = ({ const isLogo = imageType === 'logo'; const imageText = isLogo ? LOGO_TEXT : ICON_TEXT; const defaultImage = isLogo ? defaultLogo : defaultIcon; + const confirmationTitleId = useGeneratedHtmlId(); const handleUpload = async (files: FileList | null) => { if (!files || files.length < 1) { @@ -84,6 +86,7 @@ export const BrandingSection: React.FC<Props> = ({ const resetConfirmModal = ( <EuiConfirmModal title={RESET_IMAGE_TITLE} + titleProps={{ id: confirmationTitleId }} onCancel={closeDeleteModal} onConfirm={() => { resetImage(); @@ -93,6 +96,7 @@ export const BrandingSection: React.FC<Props> = ({ confirmButtonText={RESET_DEFAULT_BUTTON_LABEL} buttonColor="danger" defaultFocusedButton="confirm" + aria-labelledby={confirmationTitleId} > <> <p>{isLogo ? RESET_LOGO_DESCRIPTION : RESET_ICON_DESCRIPTION}</p> @@ -137,6 +141,7 @@ export const BrandingSection: React.FC<Props> = ({ <EuiFlexGroup> <EuiFlexItem grow={false}> <EuiButton + data-test-subj="enterpriseSearchBrandingSectionButton" isLoading={buttonLoading} disabled={!stagedImage} color="primary" diff --git a/x-pack/plugins/enterprise_search/public/navigation_tree.ts b/x-pack/plugins/enterprise_search/public/navigation_tree.ts index dfd639a07552..1485ecd8536f 100644 --- a/x-pack/plugins/enterprise_search/public/navigation_tree.ts +++ b/x-pack/plugins/enterprise_search/public/navigation_tree.ts @@ -21,11 +21,9 @@ import { SEARCH_APPLICATIONS_PATH } from './applications/applications/routes'; import { SEARCH_INDICES_PATH } from './applications/enterprise_search_content/routes'; export interface DynamicSideNavItems { - appSearch?: Array<EuiSideNavItemType<unknown>>; collections?: Array<EuiSideNavItemType<unknown>>; indices?: Array<EuiSideNavItemType<unknown>>; searchApps?: Array<EuiSideNavItemType<unknown>>; - workplaceSearch?: Array<EuiSideNavItemType<unknown>>; } const title = i18n.translate( @@ -79,7 +77,7 @@ export const getNavigationTreeDefinition = ({ id: 'es', navigationTree$: dynamicItems$.pipe( debounceTime(10), - map(({ appSearch, indices, searchApps, collections, workplaceSearch }) => { + map(({ indices, searchApps, collections }) => { const navTree: NavigationTreeDefinition = { body: [ { @@ -127,7 +125,7 @@ export const getNavigationTreeDefinition = ({ return ( pathNameSerialized === - prepend(`/app/enterprise_search/content${SEARCH_INDICES_PATH}`) + prepend(`/app/elasticsearch/content${SEARCH_INDICES_PATH}`) ); }, link: 'enterpriseSearchContent:searchIndices', @@ -163,7 +161,7 @@ export const getNavigationTreeDefinition = ({ return ( pathNameSerialized === - prepend(`/app/enterprise_search/applications${SEARCH_APPLICATIONS_PATH}`) + prepend(`/app/elasticsearch/applications${SEARCH_APPLICATIONS_PATH}`) ); }, link: 'enterpriseSearchApplications:searchApplications', @@ -190,7 +188,7 @@ export const getNavigationTreeDefinition = ({ if (someSubItemSelected) return false; - return pathNameSerialized === prepend(`/app/enterprise_search/analytics`); + return pathNameSerialized === prepend(`/app/elasticsearch/analytics`); }, link: 'enterpriseSearchAnalytics', renderAs: 'item', @@ -215,50 +213,6 @@ export const getNavigationTreeDefinition = ({ defaultMessage: 'Relevance', }), }, - { - children: [ - { - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith( - prepend('/app/enterprise_search/app_search') - ); - }, - link: 'appSearch:engines', - title: i18n.translate( - 'xpack.enterpriseSearch.searchNav.entsearch.appSearch', - { - defaultMessage: 'App Search', - } - ), - ...(appSearch - ? { - children: appSearch.map(euiItemTypeToNodeDefinition), - isCollapsible: false, - renderAs: 'accordion', - } - : {}), - }, - { - getIsActive: ({ pathNameSerialized, prepend }) => { - return pathNameSerialized.startsWith( - prepend('/app/enterprise_search/workplace_search') - ); - }, - link: 'workplaceSearch', - ...(workplaceSearch - ? { - children: workplaceSearch.map(euiItemTypeToNodeDefinition), - isCollapsible: false, - renderAs: 'accordion', - } - : {}), - }, - ], - id: 'entsearch', - title: i18n.translate('xpack.enterpriseSearch.searchNav.entsearch', { - defaultMessage: 'Enterprise Search', - }), - }, { children: [{ link: 'maps' }, { link: 'canvas' }, { link: 'graph' }], id: 'otherTools', diff --git a/x-pack/plugins/enterprise_search/public/plugin.ts b/x-pack/plugins/enterprise_search/public/plugin.ts index b483796540ad..0f90f60d2974 100644 --- a/x-pack/plugins/enterprise_search/public/plugin.ts +++ b/x-pack/plugins/enterprise_search/public/plugin.ts @@ -23,7 +23,6 @@ import { AppStatus, } from '@kbn/core/public'; import { DataPublicPluginStart } from '@kbn/data-plugin/public'; - import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/public'; import type { HomePublicPluginSetup } from '@kbn/home-plugin/public'; import { i18n } from '@kbn/i18n'; @@ -38,6 +37,7 @@ import type { SearchNavigationPluginStart } from '@kbn/search-navigation/public' import { SearchPlaygroundPluginStart } from '@kbn/search-playground/public'; import { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; import { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; import { ANALYTICS_PLUGIN, @@ -54,7 +54,7 @@ import { SEMANTIC_SEARCH_PLUGIN, } from '../common/constants'; import { registerLocators } from '../common/locators'; -import { ClientConfigType, InitialAppData, ProductAccess } from '../common/types'; +import { ClientConfigType, InitialAppData } from '../common/types'; import { hasEnterpriseLicense } from '../common/utils/licensing'; import { ENGINES_PATH } from './applications/app_search/routes'; @@ -82,6 +82,7 @@ interface PluginsSetup { licensing: LicensingPluginStart; security?: SecurityPluginSetup; share?: SharePluginSetup; + uiActions: UiActionsSetup; } export interface PluginsStart { @@ -100,6 +101,7 @@ export interface PluginsStart { searchPlayground?: SearchPlaygroundPluginStart; security?: SecurityPluginStart; share?: SharePluginStart; + uiActions: UiActionsStart; } export interface ESConfig { @@ -575,12 +577,7 @@ export class EnterpriseSearchPlugin implements Plugin { // to the base set of classic side nav items to the search-navigation plugin. import('./applications/shared/layout/base_nav').then(({ buildBaseClassicNavItems }) => { plugins.searchNavigation?.setGetBaseClassicNavItems(() => { - const productAccess: ProductAccess = this.data?.access ?? { - hasAppSearchAccess: false, - hasWorkplaceSearchAccess: false, - }; - - return buildBaseClassicNavItems({ productAccess }); + return buildBaseClassicNavItems(); }); }); diff --git a/x-pack/plugins/enterprise_search/server/integrations.ts b/x-pack/plugins/enterprise_search/server/integrations.ts index d66768e57873..cc1682386642 100644 --- a/x-pack/plugins/enterprise_search/server/integrations.ts +++ b/x-pack/plugins/enterprise_search/server/integrations.ts @@ -23,7 +23,7 @@ export const registerEnterpriseSearchIntegrations = ( defaultMessage: 'Add search to your website with the web crawler.', }), categories: ['search', 'web', 'elastic_stack', 'crawler'], - uiInternalPath: '/app/enterprise_search/content/crawlers/new_crawler', + uiInternalPath: '/app/elasticsearch/content/crawlers/new_crawler', icons: [ { type: 'eui', @@ -44,7 +44,7 @@ export const registerEnterpriseSearchIntegrations = ( defaultMessage: "Add search to your application with Elasticsearch's robust APIs.", }), categories: ['search', 'custom', 'elastic_stack', 'sdk_search', 'language_client'], - uiInternalPath: '/app/enterprise_search/content/search_indices/new_index/api', + uiInternalPath: '/app/elasticsearch/content/search_indices/new_index/api', icons: [ { type: 'eui', diff --git a/x-pack/plugins/enterprise_search/server/plugin.ts b/x-pack/plugins/enterprise_search/server/plugin.ts index 6079e53e618e..9120db1b93ac 100644 --- a/x-pack/plugins/enterprise_search/server/plugin.ts +++ b/x-pack/plugins/enterprise_search/server/plugin.ts @@ -13,7 +13,6 @@ import { Logger, SavedObjectsServiceStart, IRouter, - KibanaRequest, DEFAULT_APP_CATEGORIES, } from '@kbn/core/server'; import { CustomIntegrationsPluginSetup } from '@kbn/custom-integrations-plugin/server'; @@ -23,6 +22,7 @@ import { KibanaFeatureScope } from '@kbn/features-plugin/common'; import { FeaturesPluginSetup } from '@kbn/features-plugin/server'; import { GlobalSearchPluginSetup } from '@kbn/global-search-plugin/server'; import type { GuidedOnboardingPluginSetup } from '@kbn/guided-onboarding-plugin/server'; +import { i18n } from '@kbn/i18n'; import type { LicensingPluginStart } from '@kbn/licensing-plugin/public'; import { LogsSharedPluginSetup } from '@kbn/logs-shared-plugin/server'; import type { MlPluginSetup } from '@kbn/ml-plugin/server'; @@ -64,7 +64,6 @@ import { registerTelemetryUsageCollector as registerESTelemetryUsageCollector } import { registerTelemetryUsageCollector as registerWSTelemetryUsageCollector } from './collectors/workplace_search/telemetry'; import { registerEnterpriseSearchIntegrations } from './integrations'; -import { checkAccess } from './lib/check_access'; import { entSearchHttpAgent } from './lib/enterprise_search_http_agent'; import { EnterpriseSearchRequestHandler, @@ -140,17 +139,9 @@ export class EnterpriseSearchPlugin implements Plugin { } public setup( - { - capabilities, - elasticsearch, - http, - savedObjects, - getStartServices, - uiSettings, - }: CoreSetup<PluginsStart>, + { elasticsearch, http, savedObjects, getStartServices, uiSettings }: CoreSetup<PluginsStart>, { usageCollection, - security, features, globalSearch, logsShared, @@ -169,12 +160,10 @@ export class EnterpriseSearchPlugin implements Plugin { ENTERPRISE_SEARCH_OVERVIEW_PLUGIN.ID, ENTERPRISE_SEARCH_CONTENT_PLUGIN.ID, ELASTICSEARCH_PLUGIN.ID, - ANALYTICS_PLUGIN.ID, ...(config.canDeployEntSearch ? [APP_SEARCH_PLUGIN.ID, WORKPLACE_SEARCH_PLUGIN.ID] : []), SEARCH_EXPERIENCES_PLUGIN.ID, VECTOR_SEARCH_PLUGIN.ID, SEMANTIC_SEARCH_PLUGIN.ID, - APPLICATIONS_PLUGIN.ID, AI_SEARCH_PLUGIN.ID, ]; const isCloud = !!cloud?.cloudId; @@ -220,46 +209,72 @@ export class EnterpriseSearchPlugin implements Plugin { }, }, }); + features.registerKibanaFeature({ + id: APPLICATIONS_PLUGIN.ID, + name: i18n.translate('xpack.enterpriseSearch.applications.featureName', { + defaultMessage: 'Search Applications', + }), + order: 3, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security], + app: ['kibana', APPLICATIONS_PLUGIN.ID], + catalogue: [APPLICATIONS_PLUGIN.ID], + privileges: { + all: { + app: ['kibana', APPLICATIONS_PLUGIN.ID], + api: [], + catalogue: [APPLICATIONS_PLUGIN.ID], + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + read: { + disabled: true, + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + }); + features.registerKibanaFeature({ + id: ANALYTICS_PLUGIN.ID, + name: ANALYTICS_PLUGIN.NAME, + order: 4, + category: DEFAULT_APP_CATEGORIES.enterpriseSearch, + scope: [KibanaFeatureScope.Spaces, KibanaFeatureScope.Security], + app: ['kibana', ANALYTICS_PLUGIN.ID], + catalogue: [ANALYTICS_PLUGIN.ID], + privileges: { + all: { + app: ['kibana', ANALYTICS_PLUGIN.ID], + api: [], + catalogue: [ANALYTICS_PLUGIN.ID], + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + read: { + disabled: true, + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + }); /** * Register Enterprise Search UI Settings */ uiSettings.register(enterpriseSearchUISettings); - /** - * Register user access to the Enterprise Search plugins - */ - capabilities.registerSwitcher( - async (request: KibanaRequest) => { - const [, { spaces }] = await getStartServices(); - - const dependencies = { - config, - security, - spaces, - request, - log, - ml, - }; - - const { hasAppSearchAccess, hasWorkplaceSearchAccess } = await checkAccess(dependencies); - - return { - navLinks: { - appSearch: hasAppSearchAccess && config.canDeployEntSearch, - workplaceSearch: hasWorkplaceSearchAccess && config.canDeployEntSearch, - }, - catalogue: { - appSearch: hasAppSearchAccess && config.canDeployEntSearch, - workplaceSearch: hasWorkplaceSearchAccess && config.canDeployEntSearch, - }, - }; - }, - { - capabilityPath: ['navLinks.*', 'catalogue.*'], - } - ); - /** * Register routes */ diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.test.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.test.ts index 96c6501200e5..74a161c1fd80 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.test.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.test.ts @@ -25,7 +25,7 @@ describe('Enterprise Search Analytics API', () => { let mockRouter: MockRouter; const mockClient = {}; - describe('GET /internal/enterprise_search/analytics/collections', () => { + describe('GET /internal/elasticsearch/analytics/collections', () => { beforeEach(() => { const context = { core: Promise.resolve({ elasticsearch: { client: mockClient } }), @@ -34,7 +34,7 @@ describe('Enterprise Search Analytics API', () => { mockRouter = new MockRouter({ context, method: 'get', - path: '/internal/enterprise_search/analytics/collections', + path: '/internal/elasticsearch/analytics/collections', }); const mockDataPlugin = { @@ -99,7 +99,7 @@ describe('Enterprise Search Analytics API', () => { }); }); - describe('GET /internal/enterprise_search/analytics/collections/{id}', () => { + describe('GET /internal/elasticsearch/analytics/collections/{id}', () => { beforeEach(() => { const context = { core: Promise.resolve({ elasticsearch: { client: mockClient } }), @@ -108,7 +108,7 @@ describe('Enterprise Search Analytics API', () => { mockRouter = new MockRouter({ context, method: 'get', - path: '/internal/enterprise_search/analytics/collections/{name}', + path: '/internal/elasticsearch/analytics/collections/{name}', }); const mockDataPlugin = { diff --git a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts index abdf0673665c..dcab09156f0b 100644 --- a/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts +++ b/x-pack/plugins/enterprise_search/server/routes/enterprise_search/analytics.ts @@ -50,7 +50,7 @@ export function registerAnalyticsRoutes({ }: AnalyticsRouteDependencies) { router.get( { - path: '/internal/enterprise_search/analytics/collections', + path: '/internal/elasticsearch/analytics/collections', validate: { query: schema.object({ query: schema.maybe(schema.string()), @@ -75,7 +75,7 @@ export function registerAnalyticsRoutes({ router.get( { - path: '/internal/enterprise_search/analytics/collections/{name}', + path: '/internal/elasticsearch/analytics/collections/{name}', validate: { params: schema.object({ name: schema.string(), @@ -101,7 +101,7 @@ export function registerAnalyticsRoutes({ router.post( { - path: '/internal/enterprise_search/analytics/collections/{name}/api_key', + path: '/internal/elasticsearch/analytics/collections/{name}/api_key', validate: { body: schema.object({ keyName: schema.string(), @@ -127,7 +127,7 @@ export function registerAnalyticsRoutes({ router.post( { - path: '/internal/enterprise_search/analytics/collections', + path: '/internal/elasticsearch/analytics/collections', validate: { body: schema.object({ name: schema.string(), @@ -172,7 +172,7 @@ export function registerAnalyticsRoutes({ router.delete( { - path: '/internal/enterprise_search/analytics/collections/{name}', + path: '/internal/elasticsearch/analytics/collections/{name}', validate: { params: schema.object({ name: schema.string(), @@ -195,7 +195,7 @@ export function registerAnalyticsRoutes({ router.get( { - path: '/internal/enterprise_search/analytics/collection/{name}/events/exist', + path: '/internal/elasticsearch/analytics/collection/{name}/events/exist', validate: { params: schema.object({ name: schema.string(), diff --git a/x-pack/plugins/enterprise_search/tsconfig.json b/x-pack/plugins/enterprise_search/tsconfig.json index bd716c8ac169..f06262024ce6 100644 --- a/x-pack/plugins/enterprise_search/tsconfig.json +++ b/x-pack/plugins/enterprise_search/tsconfig.json @@ -84,5 +84,7 @@ "@kbn/core-security-server-mocks", "@kbn/unsaved-changes-prompt", "@kbn/search-navigation", + "@kbn/cell-actions", + "@kbn/ui-actions-plugin", ] } diff --git a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts index eb76b90f0556..4e8e43352f45 100644 --- a/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts +++ b/x-pack/plugins/event_log/server/es/cluster_client_adapter.test.ts @@ -569,6 +569,7 @@ export const GetDataStreamsResponse: estypes.IndicesGetDataStreamResponse = { template: '', hidden: true, prefer_ilm: false, + rollover_on_write: true, next_generation_managed_by: 'Index Lifecycle Management', }, ], diff --git a/x-pack/plugins/features/server/feature_registry.test.ts b/x-pack/plugins/features/server/feature_registry.test.ts index 9ed7a207560b..15988d213b31 100644 --- a/x-pack/plugins/features/server/feature_registry.test.ts +++ b/x-pack/plugins/features/server/feature_registry.test.ts @@ -57,7 +57,7 @@ describe('FeatureRegistry', () => { app: ['app1'], savedObject: { all: ['space', 'etc', 'telemetry'], - read: ['canvas', 'config', 'config-global', 'url'], + read: ['canvas', 'config', 'config-global', 'url', 'tag'], }, api: ['someApiEndpointTag', 'anotherEndpointTag'], ui: ['allowsFoo', 'showBar', 'showBaz'], @@ -65,7 +65,7 @@ describe('FeatureRegistry', () => { read: { savedObject: { all: [], - read: ['config', 'config-global', 'url', 'telemetry'], + read: ['config', 'config-global', 'url', 'telemetry', 'tag'], }, ui: [], }, @@ -130,7 +130,7 @@ describe('FeatureRegistry', () => { app: ['app1'], savedObject: { all: ['space', 'etc', 'telemetry'], - read: ['canvas', 'config', 'config-global', 'url'], + read: ['canvas', 'config', 'config-global', 'url', 'tag'], }, api: ['someApiEndpointTag', 'anotherEndpointTag'], ui: ['allowsFoo', 'showBar', 'showBaz'], @@ -314,7 +314,7 @@ describe('FeatureRegistry', () => { expect(allPrivilege?.savedObject.all).toEqual(['telemetry']); }); - it(`automatically grants access to config, config-global, url, and telemetry saved objects`, () => { + it(`automatically grants access to config, config-global, url, telemetry and tag saved objects`, () => { const feature: KibanaFeatureConfig = { id: 'test-feature', name: 'Test Feature', @@ -348,16 +348,17 @@ describe('FeatureRegistry', () => { const allPrivilege = result[0].privileges?.all; const readPrivilege = result[0].privileges?.read; - expect(allPrivilege?.savedObject.read).toEqual(['config', 'config-global', 'url']); + expect(allPrivilege?.savedObject.read).toEqual(['config', 'config-global', 'url', 'tag']); expect(readPrivilege?.savedObject.read).toEqual([ 'config', 'config-global', 'telemetry', 'url', + 'tag', ]); }); - it(`automatically grants 'all' access to telemetry and 'read' to [config, config-global, url] saved objects for the reserved privilege`, () => { + it(`automatically grants 'all' access to telemetry and 'read' to [config, config-global, url, tag] saved objects for the reserved privilege`, () => { const feature: KibanaFeatureConfig = { id: 'test-feature', name: 'Test Feature', @@ -388,7 +389,7 @@ describe('FeatureRegistry', () => { const reservedPrivilege = result[0]!.reserved!.privileges[0].privilege; expect(reservedPrivilege.savedObject.all).toEqual(['telemetry']); - expect(reservedPrivilege.savedObject.read).toEqual(['config', 'config-global', 'url']); + expect(reservedPrivilege.savedObject.read).toEqual(['config', 'config-global', 'url', 'tag']); }); it(`does not duplicate the automatic grants if specified on the incoming feature`, () => { @@ -402,14 +403,14 @@ describe('FeatureRegistry', () => { ui: [], savedObject: { all: ['telemetry'], - read: ['config', 'config-global', 'url'], + read: ['config', 'config-global', 'url', 'tag'], }, }, read: { ui: [], savedObject: { all: [], - read: ['config', 'config-global', 'url'], + read: ['config', 'config-global', 'url', 'tag'], }, }, }, @@ -426,11 +427,12 @@ describe('FeatureRegistry', () => { const allPrivilege = result[0].privileges!.all; const readPrivilege = result[0].privileges!.read; expect(allPrivilege?.savedObject.all).toEqual(['telemetry']); - expect(allPrivilege?.savedObject.read).toEqual(['config', 'config-global', 'url']); + expect(allPrivilege?.savedObject.read).toEqual(['config', 'config-global', 'url', 'tag']); expect(readPrivilege?.savedObject.read).toEqual([ 'config', 'config-global', 'url', + 'tag', 'telemetry', ]); }); @@ -518,7 +520,7 @@ describe('FeatureRegistry', () => { name: 'Foo', app: ['app1', 'app2'], savedObject: { - all: ['config', 'config-global', 'space', 'etc'], + all: ['config', 'config-global', 'space', 'tag', 'etc'], read: ['canvas'], }, api: ['someApiEndpointTag', 'anotherEndpointTag'], @@ -2455,7 +2457,7 @@ describe('FeatureRegistry', () => { expect(featureA.privileges).toEqual({ all: { ui: [], - savedObject: { all: ['telemetry'], read: ['config', 'config-global', 'url'] }, + savedObject: { all: ['telemetry'], read: ['config', 'config-global', 'url', 'tag'] }, composedOf: [ { feature: 'featureC', privileges: ['subFeatureCOne'] }, { feature: 'featureD', privileges: ['all'] }, @@ -2463,7 +2465,7 @@ describe('FeatureRegistry', () => { }, read: { ui: [], - savedObject: { all: [], read: ['config', 'config-global', 'telemetry', 'url'] }, + savedObject: { all: [], read: ['config', 'config-global', 'telemetry', 'url', 'tag'] }, composedOf: [{ feature: 'featureD', privileges: ['read'] }], }, }); @@ -2483,12 +2485,12 @@ describe('FeatureRegistry', () => { expect(featureA.privileges).toEqual({ all: { ui: [], - savedObject: { all: ['telemetry'], read: ['config', 'config-global', 'url'] }, + savedObject: { all: ['telemetry'], read: ['config', 'config-global', 'url', 'tag'] }, composedOf: [{ feature: 'featureE', privileges: ['all'] }], }, read: { ui: [], - savedObject: { all: [], read: ['config', 'config-global', 'telemetry', 'url'] }, + savedObject: { all: [], read: ['config', 'config-global', 'telemetry', 'url', 'tag'] }, }, }); }); diff --git a/x-pack/plugins/features/server/feature_registry.ts b/x-pack/plugins/features/server/feature_registry.ts index adeb0f4cc9da..df01f4d773bc 100644 --- a/x-pack/plugins/features/server/feature_registry.ts +++ b/x-pack/plugins/features/server/feature_registry.ts @@ -340,6 +340,7 @@ function applyAutomaticAllPrivilegeGrants( 'config', 'config-global', 'url', + 'tag', ]); } }); @@ -356,6 +357,7 @@ function applyAutomaticReadPrivilegeGrants( 'config-global', 'telemetry', 'url', + 'tag', ]); } }); diff --git a/x-pack/plugins/features/server/plugin.test.ts b/x-pack/plugins/features/server/plugin.test.ts index 96062085e577..b06f9282c573 100644 --- a/x-pack/plugins/features/server/plugin.test.ts +++ b/x-pack/plugins/features/server/plugin.test.ts @@ -168,6 +168,7 @@ describe('Features Plugin', () => { "config", "config-global", "url", + "tag", ], }, "ui": Array [], @@ -183,6 +184,7 @@ describe('Features Plugin', () => { "config-global", "telemetry", "url", + "tag", ], }, "ui": Array [], diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx index 94bcf380f708..8ddc2e80b0aa 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/index.test.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { fireEvent, act, waitFor } from '@testing-library/react'; +import { fireEvent, waitFor } from '@testing-library/react'; import type { TestRenderer } from '../../../../../mock'; import { createFleetTestRendererMock } from '../../../../../mock'; @@ -291,23 +291,21 @@ describe('edit package policy page', () => { expect(renderResult.getByDisplayValue('Nginx description')).toBeInTheDocument(); }); - await act(async () => { - fireEvent.click(renderResult.getByText('Change defaults')); - }); + fireEvent.click(renderResult.getByText('Change defaults')); - await act(async () => { - fireEvent.change(renderResult.getByDisplayValue('/var/log/nginx/access.log*'), { - target: { value: '' }, - }); + fireEvent.change(renderResult.getByDisplayValue('/var/log/nginx/access.log*'), { + target: { value: '' }, }); - expect( - renderResult.getByText('Your integration policy has errors. Please fix them before saving.') - ).toBeInTheDocument(); - expect(renderResult.getByText(/Save integration/).closest('button')!).toBeDisabled(); + await waitFor(() => { + expect( + renderResult.getByText('Your integration policy has errors. Please fix them before saving.') + ).toBeInTheDocument(); + expect(renderResult.getByText(/Save integration/).closest('button')!).toBeDisabled(); - renderResult.getAllByRole('link', { name: 'Cancel' }).forEach((btn) => { - expect(btn).toHaveAttribute('href', '/navigate/path'); + renderResult.getAllByRole('link', { name: 'Cancel' }).forEach((btn) => { + expect(btn).toHaveAttribute('href', '/navigate/path'); + }); }); }); @@ -317,32 +315,31 @@ describe('edit package policy page', () => { await waitFor(() => { expect(renderResult.getByText('Collect logs from Nginx instances')).toBeInTheDocument(); }); - act(() => { - fireEvent.click(renderResult.getByRole('switch')); - }); - await act(async () => { - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - }); + fireEvent.click(renderResult.getByRole('switch')); - const { id, ...restProps } = mockPackagePolicy; - expect(sendUpdatePackagePolicy).toHaveBeenCalledWith('nginx-1', { - ...restProps, - vars: {}, - inputs: [ - { - ...mockPackagePolicy.inputs[0], - enabled: false, - streams: [ - { - ...mockPackagePolicy.inputs[0].streams[0], - enabled: false, - }, - ], - }, - ], + fireEvent.click(renderResult.getByText('Save integration').closest('button')!); + + await waitFor(() => { + const { id, ...restProps } = mockPackagePolicy; + expect(sendUpdatePackagePolicy).toHaveBeenCalledWith('nginx-1', { + ...restProps, + vars: {}, + inputs: [ + { + ...mockPackagePolicy.inputs[0], + enabled: false, + streams: [ + { + ...mockPackagePolicy.inputs[0].streams[0], + enabled: false, + }, + ], + }, + ], + }); + expect(useStartServices().application.navigateToUrl).toHaveBeenCalledWith('/navigate/path'); }); - expect(useStartServices().application.navigateToUrl).toHaveBeenCalledWith('/navigate/path'); }); it('should show out of date error on 409 statusCode on submit', async () => { @@ -353,23 +350,21 @@ describe('edit package policy page', () => { await waitFor(() => { expect(renderResult.getByText('Collect logs from Nginx instances')).toBeInTheDocument(); }); - act(() => { - fireEvent.click(renderResult.getByRole('switch')); - }); + fireEvent.click(renderResult.getByRole('switch')); - await act(async () => { - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - }); + fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - expect(useStartServices().notifications.toasts.addError).toHaveBeenCalledWith( - { statusCode: 409 }, - { - title: "Error updating 'nginx-1'", - toastMessage: 'Data is out of date. Refresh the page to get the latest policy.', - } - ); + await waitFor(() => { + expect(useStartServices().notifications.toasts.addError).toHaveBeenCalledWith( + { statusCode: 409 }, + { + title: "Error updating 'nginx-1'", + toastMessage: 'Data is out of date. Refresh the page to get the latest policy.', + } + ); - expect(useStartServices().application.navigateToUrl).not.toHaveBeenCalled(); + expect(useStartServices().application.navigateToUrl).not.toHaveBeenCalled(); + }); }); it('should show generic error on other statusCode on submit', async () => { @@ -380,20 +375,19 @@ describe('edit package policy page', () => { await waitFor(() => { expect(renderResult.getByText('Collect logs from Nginx instances')).toBeInTheDocument(); }); - act(() => { - fireEvent.click(renderResult.getByRole('switch')); - }); - await act(async () => { - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - }); + fireEvent.click(renderResult.getByRole('switch')); + + fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - expect(useStartServices().notifications.toasts.addError).toHaveBeenCalledWith( - { statusCode: 500 }, - { title: "Error updating 'nginx-1'" } - ); + await waitFor(() => { + expect(useStartServices().notifications.toasts.addError).toHaveBeenCalledWith( + { statusCode: 500 }, + { title: "Error updating 'nginx-1'" } + ); - expect(useStartServices().application.navigateToUrl).not.toHaveBeenCalled(); + expect(useStartServices().application.navigateToUrl).not.toHaveBeenCalled(); + }); }); it("throws when both 'package-policy-edit' and 'package-policy-replace-define-step' are defined", async () => { @@ -510,15 +504,12 @@ describe('edit package policy page', () => { await waitFor(() => { expect(renderResult.getByText('Collect logs from Nginx instances')).toBeInTheDocument(); }); - act(() => { - fireEvent.click(renderResult.getByRole('switch')); - }); - await act(async () => { - fireEvent.click(renderResult.getByText('Save integration').closest('button')!); - }); + fireEvent.click(renderResult.getByRole('switch')); - expect(sendUpdatePackagePolicy).toHaveBeenCalled(); + fireEvent.click(renderResult.getByText('Save integration').closest('button')!); + + await waitFor(() => expect(sendUpdatePackagePolicy).toHaveBeenCalled()); }); it('should hide the multiselect agent policies when agent policy is agentless', async () => { @@ -529,9 +520,8 @@ describe('edit package policy page', () => { isLoading: false, }); - await act(async () => { - render(); - }); + render(); + expect(renderResult.queryByTestId('agentPolicyMultiSelect')).not.toBeInTheDocument(); }); @@ -546,9 +536,7 @@ describe('edit package policy page', () => { }); it('should create agent policy with sys monitoring when new agent policy button is clicked', async () => { - await act(async () => { - render(); - }); + render(); await waitFor(() => { expect(renderResult.getByTestId('agentPolicyMultiItem')).toHaveAttribute( @@ -557,35 +545,32 @@ describe('edit package policy page', () => { ); }); - await act(async () => { - fireEvent.click(renderResult.getByTestId('createNewAgentPolicyButton')); - }); + fireEvent.click(renderResult.getByTestId('createNewAgentPolicyButton')); - await act(async () => { - fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); - }); + fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); + + fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); - await act(async () => { - fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); + await waitFor(() => { + expect(sendCreateAgentPolicy as jest.MockedFunction<any>).toHaveBeenCalledWith( + { + description: '', + monitoring_enabled: ['logs', 'metrics', 'traces'], + name: 'Agent policy 2', + namespace: 'default', + inactivity_timeout: 1209600, + is_protected: false, + }, + { withSysMonitoring: true } + ); + expect(sendUpdatePackagePolicy).toHaveBeenCalledWith( + 'nginx-1', + expect.objectContaining({ + policy_ids: ['agent-policy-1', 'agent-policy-2'], + }) + ); + expect(sendGetAgentStatus).toHaveBeenCalledTimes(1); }); - expect(sendCreateAgentPolicy as jest.MockedFunction<any>).toHaveBeenCalledWith( - { - description: '', - monitoring_enabled: ['logs', 'metrics', 'traces'], - name: 'Agent policy 2', - namespace: 'default', - inactivity_timeout: 1209600, - is_protected: false, - }, - { withSysMonitoring: true } - ); - expect(sendUpdatePackagePolicy).toHaveBeenCalledWith( - 'nginx-1', - expect.objectContaining({ - policy_ids: ['agent-policy-1', 'agent-policy-2'], - }) - ); - expect(sendGetAgentStatus).toHaveBeenCalledTimes(1); }); it('should not remove managed policy when policies are modified', async () => { @@ -613,33 +598,31 @@ describe('edit package policy page', () => { isLoading: false, }); - await act(async () => { - render(); - }); - expect(renderResult.getByTestId('agentPolicyMultiSelect')).toBeInTheDocument(); + render(); - await act(async () => { - renderResult.getByTestId('comboBoxToggleListButton').click(); + await waitFor(() => { + expect(renderResult.getByTestId('agentPolicyMultiSelect')).toBeInTheDocument(); }); - expect(renderResult.queryByText('Agent policy 1')).toBeNull(); + fireEvent.click(renderResult.getByTestId('comboBoxToggleListButton')); - await act(async () => { - fireEvent.click(renderResult.getByText('Fleet Server Policy')); - }); + await waitFor(() => expect(renderResult.queryByText('Agent policy 1')).toBeNull()); - await act(async () => { - fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); - }); - await act(async () => { - fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); - }); + fireEvent.click(renderResult.getByText('Fleet Server Policy')); - expect(sendUpdatePackagePolicy).toHaveBeenCalledWith( - 'nginx-1', - expect.objectContaining({ - policy_ids: ['agent-policy-1', 'fleet-server-policy'], - }) + await waitFor(() => Promise.resolve(null)); + + fireEvent.click(renderResult.getByText(/Save integration/).closest('button')!); + + fireEvent.click(renderResult.getAllByText(/Save and deploy changes/)[1].closest('button')!); + + await waitFor(() => + expect(sendUpdatePackagePolicy).toHaveBeenCalledWith( + 'nginx-1', + expect.objectContaining({ + policy_ids: ['agent-policy-1', 'fleet-server-policy'], + }) + ) ); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_export_csv_tour.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_export_csv_tour.tsx new file mode 100644 index 000000000000..c0e9e4f5427b --- /dev/null +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agent_export_csv_tour.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiText, EuiTourStep } from '@elastic/eui'; +import React, { useState } from 'react'; +import { FormattedMessage } from '@kbn/i18n-react'; + +import type { TOUR_STORAGE_CONFIG } from '../../../../constants'; +import { TOUR_STORAGE_KEYS } from '../../../../constants'; +import { useStartServices } from '../../../../hooks'; + +export const AgentExportCSVTour: React.FC<{}> = () => { + const { storage, uiSettings } = useStartServices(); + + const [tourState, setTourState] = useState({ isOpen: true }); + + const isTourHidden = + uiSettings.get('hideAnnouncements', false) || + ( + storage.get(TOUR_STORAGE_KEYS.AGENT_EXPORT_CSV) as + | TOUR_STORAGE_CONFIG['AGENT_EXPORT_CSV'] + | undefined + )?.active === false; + + const setTourAsHidden = () => { + storage.set(TOUR_STORAGE_KEYS.AGENT_EXPORT_CSV, { + active: false, + } as TOUR_STORAGE_CONFIG['AGENT_EXPORT_CSV']); + }; + + const onFinish = () => { + setTourState({ isOpen: false }); + setTourAsHidden(); + }; + + return ( + <> + <EuiTourStep + content={ + <EuiText> + <FormattedMessage + id="xpack.fleet.agentExportCSVTour.tourContent" + defaultMessage="Once you have selected the agents, click the action menu to download the CSV file." + /> + </EuiText> + } + isStepOpen={!isTourHidden && tourState.isOpen} + onFinish={onFinish} + minWidth={360} + maxWidth={360} + step={1} + stepsTotal={1} + title={ + <FormattedMessage + id="xpack.fleet.agentExportCSVTour.tourTitle" + defaultMessage="Download CSV file" + /> + } + anchorPosition="upLeft" + anchor="#agentListSelectionText" + /> + </> + ); +}; diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agents_selection_status.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agents_selection_status.tsx index 618a7a6b8e11..160e29737bf7 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agents_selection_status.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/components/agents_selection_status.tsx @@ -14,6 +14,7 @@ import { SO_SEARCH_LIMIT } from '../../../../constants'; import type { Agent } from '../../../../types'; import type { SelectionMode } from './types'; +import { AgentExportCSVTour } from './agent_export_csv_tour'; const Divider = styled.div` width: 0; @@ -62,7 +63,7 @@ export const AgentsSelectionStatus: React.FunctionComponent<{ <> <EuiFlexGroup gutterSize="s" alignItems="center"> <EuiFlexItem grow={false}> - <EuiText size="xs" color="subdued"> + <EuiText size="xs" color="subdued" id="agentListSelectionText"> {totalAgents > SO_SEARCH_LIMIT ? ( <FormattedMessage id="xpack.fleet.agentBulkActions.totalAgentsWithLimit" @@ -97,6 +98,7 @@ export const AgentsSelectionStatus: React.FunctionComponent<{ </> )} </EuiText> + <AgentExportCSVTour /> </EuiFlexItem> {showSelectionInfoAndOptions ? ( <> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx index 985e709ba22d..319c2ee5455d 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.test.tsx @@ -69,6 +69,12 @@ jest.mock('../../../hooks', () => ({ cloud: {}, data: { dataViews: { getFieldsForWildcard: jest.fn() } }, docLinks: { links: { kibana: { secureSavedObject: 'my-link' } } }, + uiSettings: { + get: jest.fn(), + }, + storage: { + get: jest.fn(), + }, }), useBreadcrumbs: jest.fn(), useLink: jest.fn().mockReturnValue({ getHref: jest.fn() }), diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_export_csv_modal/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_export_csv_modal/index.tsx index 901a90d5dea6..e289f660eb00 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_export_csv_modal/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/components/agent_export_csv_modal/index.tsx @@ -6,7 +6,7 @@ */ import React, { useState } from 'react'; -import type { EuiBasicTableColumn, EuiSearchBarProps, EuiTableSelectionType } from '@elastic/eui'; +import type { EuiBasicTableColumn, EuiTableSelectionType } from '@elastic/eui'; import { EuiConfirmModal, EuiFlexGroup, @@ -67,12 +67,6 @@ export const AgentExportCSVModal: React.FunctionComponent<Props> = ({ initialSelected: INITIAL_AGENT_FIELDS_TO_EXPORT, }; - const search: EuiSearchBarProps = { - box: { - incremental: true, - }, - }; - return ( <EuiConfirmModal data-test-subj="agentExportCSVModal" @@ -129,7 +123,6 @@ export const AgentExportCSVModal: React.FunctionComponent<Props> = ({ items={items} itemId="field" columns={columns} - search={search} selection={selectionValue} /> </EuiFlexItem> diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.test.tsx index bfd9028f5d0c..b5396fa54c7f 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/multi_row_input/index.test.tsx @@ -33,7 +33,8 @@ function renderInput( return { utils, mockOnChange }; } -test('it should allow to add a new host', async () => { +// FLAKY: https://github.com/elastic/kibana/issues/202504 +test.skip('it should allow to add a new host', async () => { const { utils, mockOnChange } = renderInput(); const addRowEl = await utils.findByText('Add row'); diff --git a/x-pack/plugins/fleet/public/constants/index.ts b/x-pack/plugins/fleet/public/constants/index.ts index 4fbe799aa733..059bae6ea7bf 100644 --- a/x-pack/plugins/fleet/public/constants/index.ts +++ b/x-pack/plugins/fleet/public/constants/index.ts @@ -54,6 +54,7 @@ export const TOUR_STORAGE_KEYS = { ADD_AGENT_POPOVER: 'fleet.addAgentPopoverTour', INACTIVE_AGENTS: 'fleet.inactiveAgentsTour', GRANULAR_PRIVILEGES: 'fleet.granularPrivileges', + AGENT_EXPORT_CSV: 'fleet.agentExportCSVTour', }; export interface TourConfig { diff --git a/x-pack/plugins/fleet/server/errors/index.ts b/x-pack/plugins/fleet/server/errors/index.ts index ac6eca6b3b97..af0770b61f18 100644 --- a/x-pack/plugins/fleet/server/errors/index.ts +++ b/x-pack/plugins/fleet/server/errors/index.ts @@ -125,6 +125,8 @@ export class SigningServiceNotFoundError extends FleetNotFoundError {} export class InputNotFoundError extends FleetNotFoundError {} export class OutputNotFoundError extends FleetNotFoundError {} export class PackageNotFoundError extends FleetNotFoundError {} +export class ArchiveNotFoundError extends FleetNotFoundError {} + export class PackagePolicyNotFoundError extends FleetNotFoundError<{ /** The package policy ID that was not found */ packagePolicyId: string; diff --git a/x-pack/plugins/fleet/server/routes/epm/file_handler.ts b/x-pack/plugins/fleet/server/routes/epm/file_handler.ts index 701915d384f4..8ae344cfc626 100644 --- a/x-pack/plugins/fleet/server/routes/epm/file_handler.ts +++ b/x-pack/plugins/fleet/server/routes/epm/file_handler.ts @@ -105,10 +105,17 @@ export const getFileHandler: FleetRequestHandler< }); } else { const registryResponse = await getFile(pkgName, pkgVersion, filePath); + if (!registryResponse) + return response.custom({ + body: {}, + statusCode: 400, + }); + const headersToProxy: KnownHeaders[] = ['content-type']; const proxiedHeaders = headersToProxy.reduce((headers, knownHeader) => { - const value = registryResponse.headers.get(knownHeader); - if (value !== null) { + const value = registryResponse?.headers.get(knownHeader); + + if (!!value) { headers[knownHeader] = value; } return headers; diff --git a/x-pack/plugins/fleet/server/services/epm/airgapped.ts b/x-pack/plugins/fleet/server/services/epm/airgapped.ts new file mode 100644 index 000000000000..4507de3ea15e --- /dev/null +++ b/x-pack/plugins/fleet/server/services/epm/airgapped.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 { appContextService } from '..'; + +export const airGappedUtils = () => { + const config = appContextService.getConfig(); + const hasRegistryUrls = config?.registryUrl || config?.registryProxyUrl; + const isAirGapped = config?.isAirGapped; + + const shouldSkipRegistryRequests = isAirGapped && !hasRegistryUrls; + + return { hasRegistryUrls, isAirGapped, shouldSkipRegistryRequests }; +}; diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts index 5711c8fcccaf..c3b0eee26cb5 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.test.ts @@ -925,6 +925,32 @@ owner: elastic`, }); }); + it('should avoid loading archive when isAirGapped == true', async () => { + const mockContract = createAppContextStartContractMock({ isAirGapped: true }); + appContextService.start(mockContract); + + const soClient = savedObjectsClientMock.create(); + soClient.get.mockRejectedValue(SavedObjectsErrorHelpers.createGenericNotFoundError()); + MockRegistry.fetchInfo.mockResolvedValue({ + name: 'my-package', + version: '1.0.0', + assets: [], + } as unknown as RegistryPackage); + + await expect( + getPackageInfo({ + savedObjectsClient: soClient, + pkgName: 'my-package', + pkgVersion: '1.0.0', + }) + ).resolves.toMatchObject({ + latestVersion: '1.0.0', + status: 'not_installed', + }); + + expect(MockRegistry.getPackage).not.toHaveBeenCalled(); + }); + describe('installation status', () => { it('should be not_installed when no package SO exists', async () => { const soClient = savedObjectsClientMock.create(); diff --git a/x-pack/plugins/fleet/server/services/epm/packages/get.ts b/x-pack/plugins/fleet/server/services/epm/packages/get.ts index 5b0e3df279cd..824d3f4b30f7 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/get.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/get.ts @@ -68,6 +68,8 @@ import { auditLoggingService } from '../../audit_logging'; import { getFilteredSearchPackages } from '../filtered_packages'; +import { airGappedUtils } from '../airgapped'; + import { createInstallableFrom } from '.'; import { getPackageAssetsMapCache, @@ -478,7 +480,11 @@ export async function getPackageInfo({ let packageInfo; // We need to get input only packages from source to get all fields // see https://github.com/elastic/package-registry/issues/864 - if (registryInfo && skipArchive && registryInfo.type !== 'input') { + if ( + registryInfo && + (skipArchive || airGappedUtils().shouldSkipRegistryRequests) && + registryInfo.type !== 'input' + ) { packageInfo = registryInfo; // Fix the paths paths = @@ -629,6 +635,7 @@ export async function getPackageFromSource(options: { } catch (err) { if (err instanceof RegistryResponseError && err.status === 404) { res = await Registry.getBundledArchive(pkgName, pkgVersion); + logger.debug(`retrieved bundled package ${pkgName}-${pkgVersion}`); } else { throw err; } @@ -763,7 +770,7 @@ export async function getPackageAssetsMap({ packageInfo: PackageInfo; logger: Logger; ignoreUnverified?: boolean; -}) { +}): Promise<AssetsMap> { const cache = getPackageAssetsMapCache(packageInfo.name, packageInfo.version); if (cache) { return cache; @@ -774,17 +781,22 @@ export async function getPackageAssetsMap({ logger, }); - let assetsMap: AssetsMap | undefined; - if (installedPackageWithAssets?.installation.version !== packageInfo.version) { - // Try to get from registry - const pkg = await Registry.getPackage(packageInfo.name, packageInfo.version, { - ignoreUnverified, - }); - assetsMap = pkg.assetsMap; - } else { - assetsMap = installedPackageWithAssets.assetsMap; - } - setPackageAssetsMapCache(packageInfo.name, packageInfo.version, assetsMap); + try { + let assetsMap: AssetsMap | undefined; + if (installedPackageWithAssets?.installation.version !== packageInfo.version) { + // Try to get from registry + const pkg = await Registry.getPackage(packageInfo.name, packageInfo.version, { + ignoreUnverified, + }); + assetsMap = pkg.assetsMap; + } else { + assetsMap = installedPackageWithAssets.assetsMap; + } + setPackageAssetsMapCache(packageInfo.name, packageInfo.version, assetsMap); - return assetsMap; + return assetsMap; + } catch (error) { + logger.warn(`getPackageAssetsMap error: ${error}`); + throw error; + } } diff --git a/x-pack/plugins/fleet/server/services/epm/packages/install.ts b/x-pack/plugins/fleet/server/services/epm/packages/install.ts index ebe5acc35178..07d7392971d7 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/install.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/install.ts @@ -1354,44 +1354,48 @@ export async function installAssetsForInputPackagePolicy(opts: { `Error while creating index templates: unable to find installed package ${pkgInfo.name}` ); } - if (installedPkgWithAssets.installation.version !== pkgInfo.version) { - const pkg = await Registry.getPackage(pkgInfo.name, pkgInfo.version, { - ignoreUnverified: force, - }); + try { + if (installedPkgWithAssets.installation.version !== pkgInfo.version) { + const pkg = await Registry.getPackage(pkgInfo.name, pkgInfo.version, { + ignoreUnverified: force, + }); - const archiveIterator = createArchiveIteratorFromMap(pkg.assetsMap); - packageInstallContext = { - assetsMap: pkg.assetsMap, - packageInfo: pkg.packageInfo, - paths: pkg.paths, - archiveIterator, - }; - } else { - const archiveIterator = createArchiveIteratorFromMap(installedPkgWithAssets.assetsMap); - packageInstallContext = { - assetsMap: installedPkgWithAssets.assetsMap, - packageInfo: installedPkgWithAssets.packageInfo, - paths: installedPkgWithAssets.paths, - archiveIterator, - }; - } + const archiveIterator = createArchiveIteratorFromMap(pkg.assetsMap); + packageInstallContext = { + assetsMap: pkg.assetsMap, + packageInfo: pkg.packageInfo, + paths: pkg.paths, + archiveIterator, + }; + } else { + const archiveIterator = createArchiveIteratorFromMap(installedPkgWithAssets.assetsMap); + packageInstallContext = { + assetsMap: installedPkgWithAssets.assetsMap, + packageInfo: installedPkgWithAssets.packageInfo, + paths: installedPkgWithAssets.paths, + archiveIterator, + }; + } - await installIndexTemplatesAndPipelines({ - installedPkg: installedPkgWithAssets.installation, - packageInstallContext, - esReferences: installedPkgWithAssets.installation.installed_es || [], - savedObjectsClient: soClient, - esClient, - logger, - onlyForDataStreams: [dataStream], - }); - // Upate ES index patterns - await optimisticallyAddEsAssetReferences( - soClient, - installedPkgWithAssets.installation.name, - [], - generateESIndexPatterns([dataStream]) - ); + await installIndexTemplatesAndPipelines({ + installedPkg: installedPkgWithAssets.installation, + packageInstallContext, + esReferences: installedPkgWithAssets.installation.installed_es || [], + savedObjectsClient: soClient, + esClient, + logger, + onlyForDataStreams: [dataStream], + }); + // Upate ES index patterns + await optimisticallyAddEsAssetReferences( + soClient, + installedPkgWithAssets.installation.name, + [], + generateESIndexPatterns([dataStream]) + ); + } catch (error) { + logger.warn(`installAssetsForInputPackagePolicy error: ${error}`); + } } interface NoPkgArgs { diff --git a/x-pack/plugins/fleet/server/services/epm/packages/package_verification.ts b/x-pack/plugins/fleet/server/services/epm/packages/package_verification.ts index 92068dfcd424..d95d38732212 100644 --- a/x-pack/plugins/fleet/server/services/epm/packages/package_verification.ts +++ b/x-pack/plugins/fleet/server/services/epm/packages/package_verification.ts @@ -75,7 +75,7 @@ export async function verifyPackageArchiveSignature({ }: { pkgName: string; pkgVersion: string; - pkgArchiveBuffer: Buffer; + pkgArchiveBuffer: Buffer | undefined; logger: Logger; }): Promise<PackageVerificationResult> { const verificationKey = await getGpgKeyOrUndefined(); @@ -97,6 +97,11 @@ export async function verifyPackageArchiveSignature({ return result; } + if (!pkgArchiveBuffer) { + logger.warn(`Archive not found for package ${pkgName}-${pkgVersion}. Skipping verification.`); + return result; + } + const { isVerified, keyId } = await _verifyPackageSignature({ pkgArchiveBuffer, pkgArchiveSignature, diff --git a/x-pack/plugins/fleet/server/services/epm/registry/index.test.ts b/x-pack/plugins/fleet/server/services/epm/registry/index.test.ts index 6de0577e3323..34a474c0900e 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/index.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/index.test.ts @@ -84,6 +84,7 @@ describe('splitPkgKey', () => { describe('fetch package', () => { afterEach(() => { mockFetchUrl.mockReset(); + mockGetConfig.mockReset(); mockGetBundledPackageByName.mockReset(); }); @@ -100,6 +101,22 @@ describe('fetch package', () => { expect(result).toEqual(registryPackage); }); + it('Should return bundled package when isAirGapped = true', async () => { + mockGetConfig.mockReturnValue({ + isAirGapped: true, + enabled: true, + agents: { enabled: true, elasticsearch: {} }, + }); + const bundledPackage = { name: 'testpkg', version: '1.0.0' }; + const registryPackage = { name: 'testpkg', version: '1.0.1' }; + + mockFetchUrl.mockResolvedValue(JSON.stringify([registryPackage])); + + mockGetBundledPackageByName.mockResolvedValue(bundledPackage); + const result = await fetchMethodToTest('testpkg'); + expect(result).toEqual(bundledPackage); + }); + it('Should return bundled package if bundled package is newer version', async () => { const bundledPackage = { name: 'testpkg', version: '1.0.1' }; const registryPackage = { name: 'testpkg', version: '1.0.0' }; @@ -220,6 +237,15 @@ describe('fetchInfo', () => { expect(e).toBeInstanceOf(PackageNotFoundError); } }); + + it('falls back to bundled package when isAirGapped config == true', async () => { + mockGetConfig.mockReturnValue({ + isAirGapped: true, + }); + + const fetchedInfo = await fetchInfo('test-package', '1.0.0'); + expect(fetchedInfo).toBeTruthy(); + }); }); describe('fetchCategories', () => { @@ -317,6 +343,13 @@ describe('fetchList', () => { expect(callUrl.searchParams.get('capabilities')).toBeNull(); }); + it('does not call registry if isAirGapped == true', async () => { + mockGetConfig.mockReturnValue({ isAirGapped: true }); + mockFetchUrl.mockResolvedValue(JSON.stringify([])); + await fetchList(); + expect(mockFetchUrl).toBeCalledTimes(0); + }); + it('does call registry with kibana.version if not explictly disabled', async () => { mockGetConfig.mockReturnValue({ internal: { diff --git a/x-pack/plugins/fleet/server/services/epm/registry/index.ts b/x-pack/plugins/fleet/server/services/epm/registry/index.ts index 75b9869d0a7c..3fd0e09578ca 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/index.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/index.ts @@ -46,6 +46,7 @@ import { RegistryResponseError, PackageFailedVerificationError, PackageUnsupportedMediaTypeError, + ArchiveNotFoundError, } from '../../../errors'; import { getBundledPackageByName } from '../packages/bundled_packages'; @@ -56,6 +57,8 @@ import { verifyPackageArchiveSignature } from '../packages/package_verification' import type { ArchiveIterator } from '../../../../common/types'; +import { airGappedUtils } from '../airgapped'; + import { fetchUrl, getResponse, getResponseStream } from './requests'; import { getRegistryUrl } from './registry_url'; @@ -67,6 +70,15 @@ export const pkgToPkgKey = ({ name, version }: { name: string; version: string } export async function fetchList( params?: GetPackagesRequest['query'] ): Promise<RegistrySearchResults> { + if (airGappedUtils().shouldSkipRegistryRequests) { + appContextService + .getLogger() + .debug( + 'fetchList: isAirGapped enabled and no registryUrl or RegistryProxyUrl configured, skipping registry requests' + ); + return []; + } + const registryUrl = getRegistryUrl(); const url = new URL(`${registryUrl}/search`); if (params) { @@ -106,16 +118,24 @@ async function _fetchFindLatestPackage( } try { - const res = await fetchUrl(url.toString(), 1); - const searchResults: RegistryPackage[] = JSON.parse(res); - - const latestPackageFromRegistry = searchResults[0] ?? null; - - if (bundledPackage && semverGte(bundledPackage.version, latestPackageFromRegistry.version)) { + if (!airGappedUtils().shouldSkipRegistryRequests) { + const res = await fetchUrl(url.toString(), 1); + const searchResults: RegistryPackage[] = JSON.parse(res); + + const latestPackageFromRegistry = searchResults[0] ?? null; + + if ( + bundledPackage && + semverGte(bundledPackage.version, latestPackageFromRegistry.version) + ) { + return bundledPackage; + } + return latestPackageFromRegistry; + } else if (airGappedUtils().shouldSkipRegistryRequests && bundledPackage) { return bundledPackage; + } else { + return null; } - - return latestPackageFromRegistry; } catch (error) { logger.error( `Failed to fetch latest version of ${packageName} from registry: ${error.message}` @@ -169,6 +189,13 @@ export async function fetchInfo( pkgVersion: string ): Promise<RegistryPackage | ArchivePackage> { const registryUrl = getRegistryUrl(); + // if isAirGapped config enabled and bundled package, use the bundled version + if (airGappedUtils().shouldSkipRegistryRequests) { + const archivePackage = await getBundledArchive(pkgName, pkgVersion); + if (archivePackage) { + return archivePackage.packageInfo; + } + } try { // Trailing slash avoids 301 redirect / extra hop const res = await fetchUrl(`${registryUrl}/package/${pkgName}/${pkgVersion}/`).then(JSON.parse); @@ -208,12 +235,20 @@ export async function getFile( pkgName: string, pkgVersion: string, relPath: string -): Promise<Response> { +): Promise<Response | null> { const filePath = `/package/${pkgName}/${pkgVersion}/${relPath}`; return fetchFile(filePath); } -export async function fetchFile(filePath: string): Promise<Response> { +export async function fetchFile(filePath: string): Promise<Response | null> { + if (airGappedUtils().shouldSkipRegistryRequests) { + appContextService + .getLogger() + .debug( + 'fetchFile: isAirGapped enabled and no registryUrl or RegistryProxyUrl configured, skipping registry requests' + ); + return null; + } const registryUrl = getRegistryUrl(); return getResponse(`${registryUrl}${filePath}`); } @@ -264,6 +299,15 @@ function setConstraints(url: URL) { export async function fetchCategories( params?: GetCategoriesRequest['query'] ): Promise<CategorySummaryList> { + if (airGappedUtils().shouldSkipRegistryRequests) { + appContextService + .getLogger() + .debug( + 'fetchCategories: isAirGapped enabled and no registryUrl or RegistryProxyUrl configured, skipping registry requests' + ); + return []; + } + const registryUrl = getRegistryUrl(); const url = new URL(`${registryUrl}/categories`); if (params) { @@ -319,42 +363,52 @@ export async function getPackage( archiveIterator: ArchiveIterator; verificationResult?: PackageVerificationResult; }> { + const logger = appContextService.getLogger(); const verifyPackage = appContextService.getExperimentalFeatures().packageVerification; let packageInfo: ArchivePackage | undefined = getPackageInfo({ name, version }); let verificationResult: PackageVerificationResult | undefined = verifyPackage ? getVerificationResult({ name, version }) : undefined; + try { + const { + archiveBuffer, + archivePath, + verificationResult: latestVerificationResult, + } = await withPackageSpan('Fetch package archive from archive buffer', () => + fetchArchiveBuffer({ + pkgName: name, + pkgVersion: version, + shouldVerify: verifyPackage, + ignoreUnverified: options?.ignoreUnverified, + }) + ); - const { - archiveBuffer, - archivePath, - verificationResult: latestVerificationResult, - } = await withPackageSpan('Fetch package archive from archive buffer', () => - fetchArchiveBuffer({ - pkgName: name, - pkgVersion: version, - shouldVerify: verifyPackage, - ignoreUnverified: options?.ignoreUnverified, - }) - ); - - if (latestVerificationResult) { - verificationResult = latestVerificationResult; - setVerificationResult({ name, version }, latestVerificationResult); - } + if (latestVerificationResult) { + verificationResult = latestVerificationResult; + setVerificationResult({ name, version }, latestVerificationResult); + } - const contentType = ensureContentType(archivePath); - const { paths, assetsMap, archiveIterator } = await unpackBufferToAssetsMap({ - archiveBuffer, - contentType, - useStreaming: options?.useStreaming, - }); + const contentType = ensureContentType(archivePath); + const { paths, assetsMap, archiveIterator } = await unpackBufferToAssetsMap({ + archiveBuffer, + contentType, + useStreaming: options?.useStreaming, + }); - if (!packageInfo) { - packageInfo = await getPackageInfoFromArchiveOrCache(name, version, archiveBuffer, archivePath); - } + if (!packageInfo) { + packageInfo = await getPackageInfoFromArchiveOrCache( + name, + version, + archiveBuffer, + archivePath + ); + } - return { paths, packageInfo, assetsMap, archiveIterator, verificationResult }; + return { paths, packageInfo, assetsMap, archiveIterator, verificationResult }; + } catch (error) { + logger.warn(`getPackage failed with error: ${error}`); + throw error; + } } export async function getPackageFieldsMetadata( @@ -367,36 +421,40 @@ export async function getPackageFieldsMetadata( // Attempt retrieving latest package name and version const latestPackage = await fetchFindLatestPackageOrThrow(packageName); const { name, version } = latestPackage; - - // Attempt retrieving latest package - const resolvedPackage = await getPackage(name, version); - - // We need to collect all the available data streams for the package. - // In case a dataset is specified from the parameter, it will load the fields only for that specific dataset. - // As a fallback case, we'll try to read the fields for all the data streams in the package. - const dataStreamsMap = resolveDataStreamsMap(resolvedPackage.packageInfo.data_streams); - - const { assetsMap } = resolvedPackage; - - const dataStream = datasetName ? dataStreamsMap.get(datasetName) : null; - - if (dataStream) { - // Resolve a single data stream fields when the `datasetName` parameter is specified - return resolveDataStreamFields({ dataStream, assetsMap, excludedFieldsAssets }); - } else { - // Resolve and merge all the integration data streams fields otherwise - return [...dataStreamsMap.values()].reduce( - (packageDataStreamsFields, currentDataStream) => - Object.assign( - packageDataStreamsFields, - resolveDataStreamFields({ - dataStream: currentDataStream, - assetsMap, - excludedFieldsAssets, - }) - ), - {} - ); + try { + // Attempt retrieving latest package + const resolvedPackage = await getPackage(name, version); + + // We need to collect all the available data streams for the package. + // In case a dataset is specified from the parameter, it will load the fields only for that specific dataset. + // As a fallback case, we'll try to read the fields for all the data streams in the package. + const dataStreamsMap = resolveDataStreamsMap(resolvedPackage.packageInfo.data_streams); + + const assetsMap = resolvedPackage.assetsMap; + + const dataStream = datasetName ? dataStreamsMap.get(datasetName) : null; + + if (dataStream) { + // Resolve a single data stream fields when the `datasetName` parameter is specified + return resolveDataStreamFields({ dataStream, assetsMap, excludedFieldsAssets }); + } else { + // Resolve and merge all the integration data streams fields otherwise + return [...dataStreamsMap.values()].reduce( + (packageDataStreamsFields, currentDataStream) => + Object.assign( + packageDataStreamsFields, + resolveDataStreamFields({ + dataStream: currentDataStream, + assetsMap, + excludedFieldsAssets, + }) + ), + {} + ); + } + } catch (error) { + appContextService.getLogger().warn(`getPackageFieldsMetadata error: ${error}`); + throw error; } } @@ -436,22 +494,31 @@ export async function fetchArchiveBuffer({ } const registryUrl = getRegistryUrl(); const archiveUrl = `${registryUrl}${archivePath}`; - const archiveBuffer = await getResponseStream(archiveUrl).then(streamToBuffer); - - if (shouldVerify) { - const verificationResult = await verifyPackageArchiveSignature({ - pkgName, - pkgVersion, - pkgArchiveBuffer: archiveBuffer, - logger, - }); + try { + const archiveBuffer = await getResponseStream(archiveUrl).then(streamToBuffer); + if (!archiveBuffer) { + logger.warn(`Archive Buffer not found`); + throw new ArchiveNotFoundError('Archive Buffer not found'); + } + + if (shouldVerify) { + const verificationResult = await verifyPackageArchiveSignature({ + pkgName, + pkgVersion, + pkgArchiveBuffer: archiveBuffer, + logger, + }); - if (verificationResult.verificationStatus === 'unverified' && !ignoreUnverified) { - throw new PackageFailedVerificationError(pkgName, pkgVersion); + if (verificationResult.verificationStatus === 'unverified' && !ignoreUnverified) { + throw new PackageFailedVerificationError(pkgName, pkgVersion); + } + return { archiveBuffer, archivePath, verificationResult }; } - return { archiveBuffer, archivePath, verificationResult }; + return { archiveBuffer, archivePath }; + } catch (error) { + logger.warn(`fetchArchiveBuffer failed with error: ${error}`); + throw error; } - return { archiveBuffer, archivePath }; } export async function getPackageArchiveSignatureOrUndefined({ @@ -473,9 +540,10 @@ export async function getPackageArchiveSignatureOrUndefined({ } try { - const { body } = await fetchFile(signaturePath); + const res = await fetchFile(signaturePath); - return streamToString(body); + if (res?.body) return streamToString(res.body); + return undefined; } catch (e) { logger.error(`Error retrieving package signature at '${signaturePath}' : ${e}`); return undefined; diff --git a/x-pack/plugins/fleet/server/services/epm/registry/requests.test.ts b/x-pack/plugins/fleet/server/services/epm/registry/requests.test.ts index e4e34d25671f..367f68f50acd 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/requests.test.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/requests.test.ts @@ -5,11 +5,17 @@ * 2.0. */ +import { securityMock } from '@kbn/security-plugin/server/mocks'; +import { loggerMock } from '@kbn/logging-mocks'; + +import type { Logger } from '@kbn/core/server'; + import { RegistryError, RegistryConnectionError, RegistryResponseError } from '../../../errors'; import { appContextService } from '../../app_context'; import { fetchUrl, getResponse } from './requests'; jest.mock('node-fetch'); +jest.mock('../../app_context'); let mockRegistryProxyUrl: string | undefined; jest.mock('./proxy', () => ({ @@ -17,11 +23,9 @@ jest.mock('./proxy', () => ({ getRegistryProxyUrl: () => mockRegistryProxyUrl, })); -jest.mock('../../app_context', () => ({ - appContextService: { - getKibanaVersion: jest.fn(), - getLogger: jest.fn().mockReturnValue({ debug: jest.fn() }), - }, +const mockedAppContextService = appContextService as jest.Mocked<typeof appContextService>; +mockedAppContextService.getSecuritySetup.mockImplementation(() => ({ + ...securityMock.createSetup(), })); const { Response, FetchError } = jest.requireActual('node-fetch'); @@ -29,18 +33,23 @@ const { Response, FetchError } = jest.requireActual('node-fetch'); const fetchMock = require('node-fetch') as jest.Mock; jest.setTimeout(120 * 1000); -describe('Registry request', () => { + +describe('Registry requests', () => { beforeEach(async () => {}); afterEach(async () => { jest.clearAllMocks(); }); + let mockedLogger: jest.Mocked<Logger>; describe('fetch options', () => { beforeEach(() => { fetchMock.mockImplementationOnce(() => Promise.resolve(new Response(''))); - (appContextService.getKibanaVersion as jest.Mock).mockReturnValue('8.0.0'); + mockedAppContextService.getKibanaVersion.mockReturnValue('8.0.0'); + mockedLogger = loggerMock.create(); + mockedAppContextService.getLogger.mockReturnValue(mockedLogger); }); + it('should set User-Agent header including kibana version', async () => { await getResponse(''); @@ -219,5 +228,32 @@ describe('Registry request', () => { expect(fetchMock).toHaveBeenCalledTimes(1); }); }); + + describe('with config.isAirGapped == true', () => { + beforeEach(() => { + mockedLogger = loggerMock.create(); + mockedAppContextService.getLogger.mockReturnValue(mockedLogger); + mockedAppContextService.getConfig.mockReturnValue({ + isAirGapped: true, + enabled: true, + agents: { enabled: true, elasticsearch: {} }, + }); + }); + + it('should not call fetch', async () => { + await getResponse(''); + + expect(fetchMock).toHaveBeenCalledTimes(0); + }); + + it('fetchUrl throws error', async () => { + fetchMock.mockImplementationOnce(() => { + throw new Error('mocked'); + }); + const promise = fetchUrl(''); + await expect(promise).rejects.toThrow(RegistryResponseError); + expect(fetchMock).toHaveBeenCalledTimes(0); + }); + }); }); }); diff --git a/x-pack/plugins/fleet/server/services/epm/registry/requests.ts b/x-pack/plugins/fleet/server/services/epm/registry/requests.ts index 47084b601a27..a67e01408a1e 100644 --- a/x-pack/plugins/fleet/server/services/epm/registry/requests.ts +++ b/x-pack/plugins/fleet/server/services/epm/registry/requests.ts @@ -13,6 +13,8 @@ import { streamToString } from '../streams'; import { appContextService } from '../../app_context'; import { RegistryError, RegistryConnectionError, RegistryResponseError } from '../../../errors'; +import { airGappedUtils } from '../airgapped'; + import { getProxyAgent, getRegistryProxyUrl } from './proxy'; type FailedAttemptErrors = pRetry.FailedAttemptError | FetchError | Error; @@ -20,6 +22,7 @@ type FailedAttemptErrors = pRetry.FailedAttemptError | FetchError | Error; // not sure what to call this function, but we're not exporting it async function registryFetch(url: string) { const response = await fetch(url, getFetchOptions(url)); + if (response.ok) { return response; } else { @@ -34,7 +37,16 @@ async function registryFetch(url: string) { } } -export async function getResponse(url: string, retries: number = 5): Promise<Response> { +export async function getResponse(url: string, retries: number = 5): Promise<Response | null> { + const logger = appContextService.getLogger(); + + if (airGappedUtils().shouldSkipRegistryRequests) { + logger.debug( + 'getResponse: isAirGapped enabled and no registryUrl or RegistryProxyUrl configured, skipping registry requests' + ); + return null; + } + try { // we only want to retry certain failures like network issues // the rest should only try the one time then fail as they do now @@ -72,11 +84,20 @@ export async function getResponseStream( retries?: number ): Promise<NodeJS.ReadableStream> { const res = await getResponse(url, retries); - return res.body; + if (res) { + return res?.body; + } + throw new RegistryResponseError('isAirGapped config enabled, registry not reacheable'); } export async function fetchUrl(url: string, retries?: number): Promise<string> { - return getResponseStream(url, retries).then(streamToString); + const logger = appContextService.getLogger(); + try { + return getResponseStream(url, retries).then(streamToString); + } catch (error) { + logger.warn(`getResponseStream failed with error: ${error}`); + throw error; + } } // node-fetch throws a FetchError for those types of errors and diff --git a/x-pack/plugins/fleet/server/services/register_fields_metadata_extractors.ts b/x-pack/plugins/fleet/server/services/register_fields_metadata_extractors.ts index 9a53c235622b..a468c20137b3 100644 --- a/x-pack/plugins/fleet/server/services/register_fields_metadata_extractors.ts +++ b/x-pack/plugins/fleet/server/services/register_fields_metadata_extractors.ts @@ -10,6 +10,8 @@ import type { FieldsMetadataServerSetup } from '@kbn/fields-metadata-plugin/serv import type { FleetStartContract, FleetStartDeps } from '../plugin'; +import { appContextService } from '.'; + interface RegistrationDeps { core: CoreSetup<FleetStartDeps, FleetStartContract>; fieldsMetadata: FieldsMetadataServerSetup; @@ -17,12 +19,17 @@ interface RegistrationDeps { export const registerFieldsMetadataExtractors = ({ core, fieldsMetadata }: RegistrationDeps) => { fieldsMetadata.registerIntegrationFieldsExtractor(async ({ integration, dataset }) => { - const [_core, _startDeps, { packageService }] = await core.getStartServices(); + try { + const [_core, _startDeps, { packageService }] = await core.getStartServices(); - return packageService.asInternalUser.getPackageFieldsMetadata({ - packageName: integration, - datasetName: dataset, - }); + return packageService.asInternalUser.getPackageFieldsMetadata({ + packageName: integration, + datasetName: dataset, + }); + } catch (error) { + appContextService.getLogger().warn(`registerIntegrationFieldsExtractor error: ${error}`); + throw error; + } }); fieldsMetadata.registerIntegrationListExtractor(async () => { diff --git a/x-pack/plugins/fleet/server/services/spaces/agent_policy.test.ts b/x-pack/plugins/fleet/server/services/spaces/agent_policy.test.ts index 079148a6ae04..6b2c63aae912 100644 --- a/x-pack/plugins/fleet/server/services/spaces/agent_policy.test.ts +++ b/x-pack/plugins/fleet/server/services/spaces/agent_policy.test.ts @@ -7,6 +7,7 @@ import { createAppContextStartContractMock } from '../../mocks'; import { agentPolicyService } from '../agent_policy'; +import { getAgentsByKuery } from '../agents'; import { appContextService } from '../app_context'; import { packagePolicyService } from '../package_policy'; @@ -16,6 +17,7 @@ import { isSpaceAwarenessEnabled } from './helpers'; jest.mock('./helpers'); jest.mock('../agent_policy'); jest.mock('../package_policy'); +jest.mock('../agents'); describe('updateAgentPolicySpaces', () => { beforeEach(() => { @@ -55,6 +57,10 @@ describe('updateAgentPolicySpaces', () => { } as any, ], }); + + jest.mocked(getAgentsByKuery).mockResolvedValue({ + agents: [], + } as any); }); it('does nothings if agent policy already in correct space', async () => { diff --git a/x-pack/plugins/fleet/server/services/spaces/agent_policy.ts b/x-pack/plugins/fleet/server/services/spaces/agent_policy.ts index 50f20443c326..dce40f4cc3ff 100644 --- a/x-pack/plugins/fleet/server/services/spaces/agent_policy.ts +++ b/x-pack/plugins/fleet/server/services/spaces/agent_policy.ts @@ -6,27 +6,29 @@ */ import deepEqual from 'fast-deep-equal'; - import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; +import type { SortResults } from '@elastic/elasticsearch/lib/api/types'; import { AGENTS_INDEX, + AGENT_ACTIONS_INDEX, AGENT_POLICY_SAVED_OBJECT_TYPE, PACKAGE_POLICY_SAVED_OBJECT_TYPE, SO_SEARCH_LIMIT, UNINSTALL_TOKENS_SAVED_OBJECT_TYPE, } from '../../../common/constants'; - import { appContextService } from '../app_context'; import { agentPolicyService } from '../agent_policy'; import { ENROLLMENT_API_KEYS_INDEX } from '../../constants'; import { packagePolicyService } from '../package_policy'; import { FleetError, HostedAgentPolicyRestrictionRelatedError } from '../../errors'; - import type { UninstallTokenSOAttributes } from '../security/uninstall_token_service'; +import { closePointInTime, getAgentsByKuery, openPointInTime } from '../agents'; import { isSpaceAwarenessEnabled } from './helpers'; +const UPDATE_AGENT_BATCH_SIZE = 1000; + export async function updateAgentPolicySpaces({ agentPolicyId, currentSpaceId, @@ -49,6 +51,7 @@ export async function updateAgentPolicySpaces({ const soClient = appContextService.getInternalUserSOClientWithoutSpaceExtension(); const currentSpaceSoClient = appContextService.getInternalUserSOClientForSpaceId(currentSpaceId); + const newSpaceSoClient = appContextService.getInternalUserSOClientForSpaceId(newSpaceIds[0]); const existingPolicy = await agentPolicyService.get(currentSpaceSoClient, agentPolicyId); const existingPackagePolicies = await packagePolicyService.findAllForAgentPolicy( @@ -166,4 +169,55 @@ export async function updateAgentPolicySpaces({ ignore_unavailable: true, refresh: true, }); + + const agentIndexExists = await esClient.indices.exists({ + index: AGENTS_INDEX, + }); + + // Update agent actions + if (agentIndexExists) { + const pitId = await openPointInTime(esClient); + + try { + let hasMore = true; + let searchAfter: SortResults | undefined; + while (hasMore) { + const { agents } = await getAgentsByKuery(esClient, newSpaceSoClient, { + kuery: `policy_id:"${agentPolicyId}"`, + showInactive: true, + perPage: UPDATE_AGENT_BATCH_SIZE, + pitId, + searchAfter, + }); + + if (agents.length === 0) { + hasMore = false; + break; + } + + const lastAgent = agents[agents.length - 1]; + searchAfter = lastAgent.sort; + + await esClient.updateByQuery({ + index: AGENT_ACTIONS_INDEX, + query: { + bool: { + must: { + terms: { + agents: agents.map(({ id }) => id), + }, + }, + }, + }, + script: `ctx._source.namespaces = [${newSpaceIds + .map((spaceId) => `"${spaceId}"`) + .join(',')}]`, + ignore_unavailable: true, + refresh: true, + }); + } + } finally { + await closePointInTime(esClient, pitId); + } + } } diff --git a/x-pack/plugins/fleet/server/telemetry/sender.ts b/x-pack/plugins/fleet/server/telemetry/sender.ts index 8fb71683b2c9..bdecd6cc8d0b 100644 --- a/x-pack/plugins/fleet/server/telemetry/sender.ts +++ b/x-pack/plugins/fleet/server/telemetry/sender.ts @@ -14,10 +14,10 @@ import axios from 'axios'; import type { InfoResponse, LicenseGetResponse } from '@elastic/elasticsearch/lib/api/types'; -import { appContextService } from '../services'; - import { exhaustMap, Subject, takeUntil, timer } from 'rxjs'; +import { appContextService } from '../services'; + import { TelemetryQueue } from './queue'; import type { FleetTelemetryChannel, FleetTelemetryChannelEvents } from './types'; diff --git a/x-pack/plugins/graph/public/components/workspace_layout/workspace_top_nav_menu.tsx b/x-pack/plugins/graph/public/components/workspace_layout/workspace_top_nav_menu.tsx index f4dc33f73176..0473f2364302 100644 --- a/x-pack/plugins/graph/public/components/workspace_layout/workspace_top_nav_menu.tsx +++ b/x-pack/plugins/graph/public/components/workspace_layout/workspace_top_nav_menu.tsx @@ -165,7 +165,7 @@ export const WorkspaceTopNavMenu = (props: WorkspaceTopNavMenuProps) => { <Provider store={store}> <Settings observable={settingsObservable} /> </Provider>, - { theme: props.coreStart.theme, i18n: props.coreStart.i18n } + props.coreStart ), { size: 'm', diff --git a/x-pack/plugins/graph/public/helpers/saved_objects_utils/check_for_duplicate_title.ts b/x-pack/plugins/graph/public/helpers/saved_objects_utils/check_for_duplicate_title.ts index c4ea22344a45..0524c0bc5c1b 100644 --- a/x-pack/plugins/graph/public/helpers/saved_objects_utils/check_for_duplicate_title.ts +++ b/x-pack/plugins/graph/public/helpers/saved_objects_utils/check_for_duplicate_title.ts @@ -27,7 +27,7 @@ export async function checkForDuplicateTitle( onTitleDuplicate: (() => void) | undefined, services: { contentClient: ContentClient; - } & Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> + } & Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> ): Promise<boolean> { const { contentClient, ...startServices } = services; // Don't check for duplicates if user has already confirmed save with duplicate title diff --git a/x-pack/plugins/graph/public/helpers/saved_objects_utils/confirm_modal_promise.tsx b/x-pack/plugins/graph/public/helpers/saved_objects_utils/confirm_modal_promise.tsx index c1d8899c3407..7e7464754fd4 100644 --- a/x-pack/plugins/graph/public/helpers/saved_objects_utils/confirm_modal_promise.tsx +++ b/x-pack/plugins/graph/public/helpers/saved_objects_utils/confirm_modal_promise.tsx @@ -15,7 +15,7 @@ export function confirmModalPromise( message = '', title = '', confirmBtnText = '', - startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> + startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> ): Promise<boolean> { return new Promise((resolve, reject) => { const cancelButtonText = i18n.translate('xpack.graph.confirmModal.cancelButtonLabel', { diff --git a/x-pack/plugins/graph/public/helpers/saved_objects_utils/display_duplicate_title_confirm_modal.ts b/x-pack/plugins/graph/public/helpers/saved_objects_utils/display_duplicate_title_confirm_modal.ts index 4256d3bc0267..eec216fceb15 100644 --- a/x-pack/plugins/graph/public/helpers/saved_objects_utils/display_duplicate_title_confirm_modal.ts +++ b/x-pack/plugins/graph/public/helpers/saved_objects_utils/display_duplicate_title_confirm_modal.ts @@ -13,7 +13,7 @@ import { confirmModalPromise } from './confirm_modal_promise'; export function displayDuplicateTitleConfirmModal( savedObject: Pick<GraphWorkspaceSavedObject, 'title'>, - startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> + startServices: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> ): Promise<boolean> { const confirmTitle = i18n.translate('xpack.graph.confirmModal.saveDuplicateConfirmationTitle', { defaultMessage: `This visualization already exists`, diff --git a/x-pack/plugins/graph/public/helpers/saved_objects_utils/save_with_confirmation.ts b/x-pack/plugins/graph/public/helpers/saved_objects_utils/save_with_confirmation.ts index 75b846ca076a..a9b85e544834 100644 --- a/x-pack/plugins/graph/public/helpers/saved_objects_utils/save_with_confirmation.ts +++ b/x-pack/plugins/graph/public/helpers/saved_objects_utils/save_with_confirmation.ts @@ -34,7 +34,7 @@ export async function saveWithConfirmation( options: SavedObjectsCreateOptions, services: { contentClient: ContentClient } & Pick< CoreStart, - 'overlays' | 'analytics' | 'i18n' | 'theme' + 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile' > ): Promise<{ item: GraphSavedObject }> { const { contentClient, ...startServices } = services; diff --git a/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts b/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts index 5a2546d122e5..566d9f26be30 100644 --- a/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts +++ b/x-pack/plugins/graph/public/helpers/saved_workspace_utils.ts @@ -167,7 +167,7 @@ export async function saveSavedWorkspace( }: SavedObjectSaveOpts = {}, services: { contentClient: ContentClient; - } & Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> + } & Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> ) { let attributes: SavedObjectAttributes = {}; diff --git a/x-pack/plugins/graph/public/services/save_modal.tsx b/x-pack/plugins/graph/public/services/save_modal.tsx index baf6a9640516..e05800ec20dd 100644 --- a/x-pack/plugins/graph/public/services/save_modal.tsx +++ b/x-pack/plugins/graph/public/services/save_modal.tsx @@ -14,7 +14,7 @@ import { GraphWorkspaceSavedObject, GraphSavePolicy } from '../types'; import { SaveModal, OnSaveGraphProps } from '../components/save_modal'; export interface SaveWorkspaceServices - extends Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> { + extends Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> { contentClient: ContentClient; } diff --git a/x-pack/plugins/graph/public/state_management/store.ts b/x-pack/plugins/graph/public/state_management/store.ts index 60b44ed234e0..a150ad59336e 100644 --- a/x-pack/plugins/graph/public/state_management/store.ts +++ b/x-pack/plugins/graph/public/state_management/store.ts @@ -40,7 +40,7 @@ export interface GraphState { } export interface GraphStoreDependencies - extends Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'> { + extends Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'> { addBasePath: (url: string) => string; indexPatternProvider: IndexPatternProvider; createWorkspace: (index: string, advancedSettings: AdvancedSettings) => Workspace; diff --git a/x-pack/plugins/index_management/common/types/data_streams.ts b/x-pack/plugins/index_management/common/types/data_streams.ts index 993d32f32bee..b6c3e46966df 100644 --- a/x-pack/plugins/index_management/common/types/data_streams.ts +++ b/x-pack/plugins/index_management/common/types/data_streams.ts @@ -81,7 +81,7 @@ export interface DataStreamIndex { name: string; uuid: string; preferILM: boolean; - managedBy: string; + managedBy?: string; } export interface DataRetention { diff --git a/x-pack/plugins/index_management/common/types/templates.ts b/x-pack/plugins/index_management/common/types/templates.ts index ab4614200c0b..ffcc27ed0897 100644 --- a/x-pack/plugins/index_management/common/types/templates.ts +++ b/x-pack/plugins/index_management/common/types/templates.ts @@ -51,7 +51,7 @@ export interface TemplateDeserialized { priority?: number; // Composable template only allowAutoCreate: string; order?: number; // Legacy template only - indexMode: IndexMode; + indexMode?: IndexMode; ilmPolicy?: { name: string; }; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields.tsx index d81b1e3dc9e5..54dd43445848 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/document_fields.tsx @@ -27,6 +27,7 @@ interface Props { onCancelAddingNewFields?: () => void; isAddingFields?: boolean; semanticTextInfo?: SemanticTextInfo; + pendingFieldsRef?: React.RefObject<HTMLDivElement>; } export const DocumentFields = React.memo( ({ @@ -35,6 +36,7 @@ export const DocumentFields = React.memo( onCancelAddingNewFields, isAddingFields, semanticTextInfo, + pendingFieldsRef, }: Props) => { const { fields, documentFields } = useMappingsState(); const dispatch = useDispatch(); @@ -58,6 +60,7 @@ export const DocumentFields = React.memo( onCancelAddingNewFields={onCancelAddingNewFields} isAddingFields={isAddingFields} semanticTextInfo={semanticTextInfo} + pendingFieldsRef={pendingFieldsRef} /> ); @@ -81,8 +84,9 @@ export const DocumentFields = React.memo( useEffect(() => { if (!isEditing) { removeContentFromGlobalFlyout('mappingsEditField'); + if (pendingFieldsRef?.current) pendingFieldsRef.current.focus(); } - }, [isEditing, removeContentFromGlobalFlyout]); + }, [isEditing, removeContentFromGlobalFlyout, pendingFieldsRef]); useEffect(() => { return () => { diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/type_parameter.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/type_parameter.tsx index ec467f113c46..528019416ad6 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/type_parameter.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/field_parameters/type_parameter.tsx @@ -24,6 +24,7 @@ interface Props { isMultiField?: boolean | null; showDocLink?: boolean; isSemanticTextEnabled?: boolean; + fieldTypeInputRef?: React.MutableRefObject<HTMLInputElement | null>; } export const TypeParameter = ({ @@ -31,6 +32,7 @@ export const TypeParameter = ({ isRootLevelField, showDocLink = false, isSemanticTextEnabled = true, + fieldTypeInputRef, }: Props) => { const fieldTypeOptions = useMemo(() => { let options = isMultiField @@ -97,6 +99,9 @@ export const TypeParameter = ({ onChange={typeField.setValue} isClearable={false} data-test-subj="fieldType" + inputRef={(input) => { + if (fieldTypeInputRef) fieldTypeInputRef.current = input; + }} /> </EuiFormRow> ); diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx index 1daa43735654..0289f07534d3 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/create_field/create_field.tsx @@ -17,7 +17,7 @@ import { i18n } from '@kbn/i18n'; import { TrainedModelStat } from '@kbn/ml-plugin/common/types/trained_models'; import { MlPluginStart } from '@kbn/ml-plugin/public'; import classNames from 'classnames'; -import React, { useEffect } from 'react'; +import React, { useEffect, useRef } from 'react'; import { EUI_SIZE, TYPE_DEFINITION } from '../../../../constants'; import { fieldSerializer } from '../../../../lib'; import { isSemanticTextField } from '../../../../lib/utils'; @@ -62,6 +62,7 @@ interface Props { onCancelAddingNewFields?: () => void; isAddingFields?: boolean; semanticTextInfo?: SemanticTextInfo; + createFieldFormRef?: React.RefObject<HTMLDivElement>; } export const CreateField = React.memo(function CreateFieldComponent({ @@ -74,9 +75,11 @@ export const CreateField = React.memo(function CreateFieldComponent({ onCancelAddingNewFields, isAddingFields, semanticTextInfo, + createFieldFormRef, }: Props) { const { isSemanticTextEnabled, ml, setErrorsInTrainedModelDeployment } = semanticTextInfo ?? {}; const dispatch = useDispatch(); + const fieldTypeInputRef = useRef<HTMLInputElement>(null); const { form } = useForm<Field>({ serializer: fieldSerializer, @@ -111,6 +114,10 @@ export const CreateField = React.memo(function CreateFieldComponent({ const isSemanticText = form.getFormData().type === 'semantic_text'; + useEffect(() => { + if (createFieldFormRef?.current) createFieldFormRef?.current.focus(); + }, [createFieldFormRef]); + const submitForm = async ( e?: React.FormEvent, exitAfter: boolean = false, @@ -134,6 +141,10 @@ export const CreateField = React.memo(function CreateFieldComponent({ } form.reset(); } + + if (fieldTypeInputRef.current) { + fieldTypeInputRef.current.focus(); + } }; const onClickOutside = () => { @@ -157,6 +168,7 @@ export const CreateField = React.memo(function CreateFieldComponent({ isMultiField={isMultiField} showDocLink isSemanticTextEnabled={isSemanticTextEnabled} + fieldTypeInputRef={fieldTypeInputRef} /> </EuiFlexItem> @@ -266,6 +278,8 @@ export const CreateField = React.memo(function CreateFieldComponent({ : paddingLeft }px`, }} + ref={createFieldFormRef} + tabIndex={0} > <div className="mappingsEditor__createFieldContent"> {renderFormFields()} diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list.tsx index 241fa132a28b..9b2e8e021990 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list.tsx @@ -16,6 +16,7 @@ interface Props { state: State; setPreviousState?: (state: State) => void; isAddingFields?: boolean; + pendingFieldsRef?: React.RefObject<HTMLDivElement>; } export const FieldsList = React.memo(function FieldsListComponent({ @@ -24,6 +25,7 @@ export const FieldsList = React.memo(function FieldsListComponent({ state, setPreviousState, isAddingFields, + pendingFieldsRef, }: Props) { if (fields === undefined) { return null; @@ -39,6 +41,7 @@ export const FieldsList = React.memo(function FieldsListComponent({ state={state} setPreviousState={setPreviousState} isAddingFields={isAddingFields} + pendingFieldsRef={pendingFieldsRef} /> ))} </ul> diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item.tsx index 33c51a3cb644..505ca26ce7ca 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item.tsx @@ -64,6 +64,8 @@ interface Props { treeDepth: number; state: State; isAddingFields?: boolean; + createFieldFormRef?: React.RefObject<HTMLDivElement>; + pendingFieldsRef?: React.RefObject<HTMLDivElement>; } function FieldListItemComponent( @@ -85,6 +87,7 @@ function FieldListItemComponent( state, isAddingFields, setPreviousState, + pendingFieldsRef, }: Props, ref: React.Ref<HTMLLIElement> ) { @@ -141,7 +144,6 @@ function FieldListItemComponent( const { addMultiFieldButtonLabel, addPropertyButtonLabel, editButtonLabel, deleteButtonLabel } = i18nTexts; - return ( <EuiFlexGroup gutterSize="s" className="mappingsEditor__fieldsListItem__actions"> {canHaveMultiFields && ( @@ -321,6 +323,7 @@ function FieldListItemComponent( state={state} isAddingFields={isAddingFields} setPreviousState={setPreviousState} + pendingFieldsRef={pendingFieldsRef} /> )} diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item_container.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item_container.tsx index a5e85eb1aad1..bcadd859f179 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item_container.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields/fields_list_item_container.tsx @@ -18,6 +18,7 @@ interface Props { state: State; setPreviousState?: (state: State) => void; isAddingFields?: boolean; + pendingFieldsRef?: React.RefObject<HTMLDivElement>; } export const FieldsListItemContainer = ({ @@ -27,6 +28,7 @@ export const FieldsListItemContainer = ({ state, setPreviousState, isAddingFields, + pendingFieldsRef, }: Props) => { const dispatch = useDispatch(); const listElement = useRef<HTMLLIElement | null>(null); @@ -110,6 +112,7 @@ export const FieldsListItemContainer = ({ toggleExpand={toggleExpand} state={state} isAddingFields={isAddingFields} + pendingFieldsRef={pendingFieldsRef} /> ); }; diff --git a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields_tree_editor.tsx b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields_tree_editor.tsx index e7ae3c995a2f..9274f10ab603 100644 --- a/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields_tree_editor.tsx +++ b/x-pack/plugins/index_management/public/application/components/mappings_editor/components/document_fields/fields_tree_editor.tsx @@ -7,7 +7,7 @@ import { EuiButtonEmpty, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback, useMemo, useRef } from 'react'; import { useDispatch, useMappingsState } from '../../mappings_state_context'; import { CreateField, FieldsList, SemanticTextInfo } from './fields'; @@ -16,19 +16,21 @@ interface Props { onCancelAddingNewFields?: () => void; isAddingFields?: boolean; semanticTextInfo?: SemanticTextInfo; + pendingFieldsRef?: React.RefObject<HTMLDivElement>; } export const DocumentFieldsTreeEditor = ({ onCancelAddingNewFields, isAddingFields, semanticTextInfo, + pendingFieldsRef, }: Props) => { const dispatch = useDispatch(); const { fields: { byId, rootLevelFields }, documentFields: { status, fieldToAddFieldTo }, } = useMappingsState(); - + const createFieldFormRef = useRef<HTMLDivElement>(null); const getField = useCallback((fieldId: string) => byId[fieldId], [byId]); const fields = useMemo(() => rootLevelFields.map(getField), [rootLevelFields, getField]); @@ -52,6 +54,7 @@ export const DocumentFieldsTreeEditor = ({ onCancelAddingNewFields={onCancelAddingNewFields} isAddingFields={isAddingFields} semanticTextInfo={semanticTextInfo} + createFieldFormRef={createFieldFormRef} /> ); }; @@ -77,7 +80,12 @@ export const DocumentFieldsTreeEditor = ({ return ( <> - <FieldsList fields={fields} state={useMappingsState()} isAddingFields={isAddingFields} /> + <FieldsList + fields={fields} + state={useMappingsState()} + isAddingFields={isAddingFields} + pendingFieldsRef={pendingFieldsRef} + /> {renderCreateField()} {renderAddFieldButton()} </> diff --git a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx index 593655da62fe..4e1901538cb9 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/steps/step_review.tsx @@ -271,15 +271,19 @@ export const StepReview: React.FunctionComponent<Props> = React.memo( </EuiDescriptionListDescription> {/* Index mode */} - <EuiDescriptionListTitle data-test-subj="indexModeTitle"> - <FormattedMessage - id="xpack.idxMgmt.templateForm.stepReview.summaryTab.indexModeLabel" - defaultMessage="Index mode" - /> - </EuiDescriptionListTitle> - <EuiDescriptionListDescription data-test-subj="indexModeValue"> - {indexModeLabels[indexMode]} - </EuiDescriptionListDescription> + {indexMode && ( + <> + <EuiDescriptionListTitle data-test-subj="indexModeTitle"> + <FormattedMessage + id="xpack.idxMgmt.templateForm.stepReview.summaryTab.indexModeLabel" + defaultMessage="Index mode" + /> + </EuiDescriptionListTitle> + <EuiDescriptionListDescription data-test-subj="indexModeValue"> + {indexModeLabels[indexMode]} + </EuiDescriptionListDescription> + </> + )} {/* Mappings */} <EuiDescriptionListTitle> diff --git a/x-pack/plugins/index_management/public/application/lib/data_streams.tsx b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx index 6747e84df751..138a91e86df6 100644 --- a/x-pack/plugins/index_management/public/application/lib/data_streams.tsx +++ b/x-pack/plugins/index_management/public/application/lib/data_streams.tsx @@ -87,7 +87,7 @@ export const isDataStreamFullyManagedByILM = (dataStream?: DataStream | null) => return ( dataStream?.nextGenerationManagedBy?.toLowerCase() === 'index lifecycle management' && dataStream?.indices?.every( - (index) => index.managedBy.toLowerCase() === 'index lifecycle management' + (index) => index.managedBy?.toLowerCase() === 'index lifecycle management' ) ); }; @@ -95,20 +95,22 @@ export const isDataStreamFullyManagedByILM = (dataStream?: DataStream | null) => export const isDataStreamFullyManagedByDSL = (dataStream?: DataStream | null) => { return ( dataStream?.nextGenerationManagedBy?.toLowerCase() === 'data stream lifecycle' && - dataStream?.indices?.every((index) => index.managedBy.toLowerCase() === 'data stream lifecycle') + dataStream?.indices?.every( + (index) => index.managedBy?.toLowerCase() === 'data stream lifecycle' + ) ); }; export const isDSLWithILMIndices = (dataStream?: DataStream | null) => { if (dataStream?.nextGenerationManagedBy?.toLowerCase() === 'data stream lifecycle') { const ilmIndices = dataStream?.indices?.filter( - (index) => index.managedBy.toLowerCase() === 'index lifecycle management' + (index) => index.managedBy?.toLowerCase() === 'index lifecycle management' ); const dslIndices = dataStream?.indices?.filter( - (index) => index.managedBy.toLowerCase() === 'data stream lifecycle' + (index) => index.managedBy?.toLowerCase() === 'data stream lifecycle' ); - // When there arent any ILM indices, there's no need to show anything. + // When there aren't any ILM indices, there's no need to show anything. if (!ilmIndices?.length) { return; } diff --git a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx index ec5deabc5f1f..063460f448cc 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_mappings_content.tsx @@ -27,7 +27,7 @@ import { import { css } from '@emotion/react'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import React, { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react'; +import React, { FunctionComponent, useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { ILicense } from '@kbn/licensing-plugin/public'; import { useUnsavedChangesPrompt } from '@kbn/unsaved-changes-prompt'; import { @@ -85,6 +85,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{ overlays, history, } = useAppContext(); + const pendingFieldsRef = useRef<HTMLDivElement>(null); const [isPlatinumLicense, setIsPlatinumLicense] = useState<boolean>(false); useEffect(() => { @@ -559,7 +560,7 @@ export const DetailsPageMappingsContent: FunctionComponent<{ </EuiFlexItem> {errorSavingMappings} {isAddingFields && ( - <EuiFlexItem grow={false}> + <EuiFlexItem grow={false} ref={pendingFieldsRef} tabIndex={0}> <EuiPanel hasBorder paddingSize="s"> <EuiAccordion id={pendingFieldListId} @@ -597,11 +598,13 @@ export const DetailsPageMappingsContent: FunctionComponent<{ onCancelAddingNewFields={onCancelAddingNewFields} isAddingFields={isAddingFields} semanticTextInfo={semanticTextInfo} + pendingFieldsRef={pendingFieldsRef} /> ) : ( <DocumentFields isAddingFields={isAddingFields} semanticTextInfo={semanticTextInfo} + pendingFieldsRef={pendingFieldsRef} /> )} </EuiPanel> diff --git a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx index eed3335d0143..6958a32845fe 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx +++ b/x-pack/plugins/index_management/public/application/sections/home/template_list/template_details/tabs/tab_summary.tsx @@ -226,15 +226,19 @@ export const TabSummary: React.FunctionComponent<Props> = ({ templateDetails }) )} {/* Index mode */} - <EuiDescriptionListTitle> - <FormattedMessage - id="xpack.idxMgmt.templateDetails.stepReview.summaryTab.indexModeLabel" - defaultMessage="Index mode" - /> - </EuiDescriptionListTitle> - <EuiDescriptionListDescription> - {indexModeLabels[indexMode]} - </EuiDescriptionListDescription> + {indexMode && ( + <> + <EuiDescriptionListTitle> + <FormattedMessage + id="xpack.idxMgmt.templateDetails.stepReview.summaryTab.indexModeLabel" + defaultMessage="Index mode" + /> + </EuiDescriptionListTitle> + <EuiDescriptionListDescription> + {indexModeLabels[indexMode]} + </EuiDescriptionListDescription> + </> + )} {/* Allow auto create */} {isLegacy !== true && diff --git a/x-pack/plugins/index_management/server/lib/data_stream_serialization.ts b/x-pack/plugins/index_management/server/lib/data_stream_serialization.ts index 31c0baa6c6b8..2556fab94766 100644 --- a/x-pack/plugins/index_management/server/lib/data_stream_serialization.ts +++ b/x-pack/plugins/index_management/server/lib/data_stream_serialization.ts @@ -43,13 +43,13 @@ export function deserializeDataStream(dataStreamFromEs: EnhancedDataStreamFromEs ({ index_name: indexName, index_uuid: indexUuid, - prefer_ilm: preferILM, + prefer_ilm: preferILM = false, managed_by: managedBy, }: { index_name: string; index_uuid: string; - prefer_ilm: boolean; - managed_by: string; + prefer_ilm?: boolean; + managed_by?: string; }) => ({ name: indexName, uuid: indexUuid, diff --git a/x-pack/plugins/index_management/server/routes/api/templates/validate_schemas.ts b/x-pack/plugins/index_management/server/routes/api/templates/validate_schemas.ts index cfd9c1d18e61..5bea0c36067c 100644 --- a/x-pack/plugins/index_management/server/routes/api/templates/validate_schemas.ts +++ b/x-pack/plugins/index_management/server/routes/api/templates/validate_schemas.ts @@ -13,7 +13,7 @@ export const templateSchema = schema.object({ version: schema.maybe(schema.number()), order: schema.maybe(schema.number()), priority: schema.maybe(schema.number()), - indexMode: schema.string(), + indexMode: schema.maybe(schema.string()), // Not present for legacy templates allowAutoCreate: schema.maybe(schema.string()), template: schema.maybe( diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx index ca4d50958005..133da383e4e9 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.test.tsx @@ -6,11 +6,13 @@ */ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, act } from '@testing-library/react'; import { TestProvider } from '../../../mocks/test_provider'; import { CreateIntegrationAssistant } from './create_integration_assistant'; import type { State } from './state'; import { ExperimentalFeaturesService } from '../../../services'; +import { mockReportEvent } from '../../../services/telemetry/mocks/service'; +import { TelemetryEventType } from '../../../services/telemetry/types'; export const defaultInitialState: State = { step: 1, @@ -20,6 +22,7 @@ export const defaultInitialState: State = { hasCelInput: false, result: undefined, }; + const mockInitialState = jest.fn((): State => defaultInitialState); jest.mock('./state', () => ({ ...jest.requireActual('./state'), @@ -39,39 +42,45 @@ const mockCelInputStep = jest.fn(() => <div data-test-subj="celInputStepMock" /> const mockReviewCelStep = jest.fn(() => <div data-test-subj="reviewCelStepMock" />); const mockDeployStep = jest.fn(() => <div data-test-subj="deployStepMock" />); -const mockIsConnectorStepReady = jest.fn(); -const mockIsIntegrationStepReady = jest.fn(); -const mockIsDataStreamStepReady = jest.fn(); -const mockIsReviewStepReady = jest.fn(); -const mockIsCelInputStepReady = jest.fn(); -const mockIsCelReviewStepReady = jest.fn(); +const mockIsConnectorStepReadyToComplete = jest.fn(); +const mockIsIntegrationStepReadyToComplete = jest.fn(); +const mockIsDataStreamStepReadyToComplete = jest.fn(); +const mockIsReviewStepReadyToComplete = jest.fn(); +const mockIsCelInputStepReadyToComplete = jest.fn(); +const mockIsCelReviewStepReadyToComplete = jest.fn(); jest.mock('./steps/connector_step', () => ({ ConnectorStep: () => mockConnectorStep(), - isConnectorStepReady: () => mockIsConnectorStepReady(), + isConnectorStepReadyToComplete: () => mockIsConnectorStepReadyToComplete(), })); jest.mock('./steps/integration_step', () => ({ IntegrationStep: () => mockIntegrationStep(), - isIntegrationStepReady: () => mockIsIntegrationStepReady(), + isIntegrationStepReadyToComplete: () => mockIsIntegrationStepReadyToComplete(), })); jest.mock('./steps/data_stream_step', () => ({ DataStreamStep: () => mockDataStreamStep(), - isDataStreamStepReady: () => mockIsDataStreamStepReady(), + isDataStreamStepReadyToComplete: () => mockIsDataStreamStepReadyToComplete(), })); jest.mock('./steps/review_step', () => ({ ReviewStep: () => mockReviewStep(), - isReviewStepReady: () => mockIsReviewStepReady(), + isReviewStepReadyToComplete: () => mockIsReviewStepReadyToComplete(), })); jest.mock('./steps/cel_input_step', () => ({ CelInputStep: () => mockCelInputStep(), - isCelInputStepReady: () => mockIsCelInputStepReady(), + isCelInputStepReadyToComplete: () => mockIsCelInputStepReadyToComplete(), })); jest.mock('./steps/review_cel_step', () => ({ ReviewCelStep: () => mockReviewCelStep(), - isCelReviewStepReady: () => mockIsCelReviewStepReady(), + isCelReviewStepReadyToComplete: () => mockIsCelReviewStepReadyToComplete(), })); jest.mock('./steps/deploy_step', () => ({ DeployStep: () => mockDeployStep() })); +const mockNavigate = jest.fn(); +jest.mock('../../../common/hooks/use_navigate', () => ({ + ...jest.requireActual('../../../common/hooks/use_navigate'), + useNavigate: () => mockNavigate, +})); + const renderIntegrationAssistant = () => render(<CreateIntegrationAssistant />, { wrapper: TestProvider }); @@ -89,19 +98,116 @@ describe('CreateIntegration', () => { mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 1 }); }); - it('should render connector', () => { + it('shoud report telemetry for assistant open', () => { + renderIntegrationAssistant(); + expect(mockReportEvent).toHaveBeenCalledWith(TelemetryEventType.IntegrationAssistantOpen, { + sessionId: expect.any(String), + }); + }); + + it('should render connector step', () => { const result = renderIntegrationAssistant(); expect(result.queryByTestId('connectorStepMock')).toBeInTheDocument(); }); - it('should call isConnectorStepReady', () => { + it('should call isConnectorStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsConnectorStepReady).toHaveBeenCalled(); + expect(mockIsConnectorStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show "Next" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Next'); + }); + + describe('when connector step is not done', () => { + beforeEach(() => { + mockIsConnectorStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); + }); + + it('should still enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should still enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + }); + + describe('when connector step is done', () => { + beforeEach(() => { + mockIsConnectorStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for connector step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 1, + stepName: 'Connector Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + }); + }); + + describe('when back button is clicked', () => { + let result: ReturnType<typeof renderIntegrationAssistant>; + beforeEach(() => { + result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-backButton').click(); + }); + }); + + it('should not report telemetry', () => { + expect(mockReportEvent).not.toHaveBeenCalled(); + }); + + it('should navigate to the landing page', () => { + expect(mockNavigate).toHaveBeenCalledWith('landing'); + }); }); }); describe('when step is 2', () => { beforeEach(() => { + mockIsConnectorStepReadyToComplete.mockReturnValue(true); mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 2 }); }); @@ -110,14 +216,109 @@ describe('CreateIntegration', () => { expect(result.queryByTestId('integrationStepMock')).toBeInTheDocument(); }); - it('should call isIntegrationStepReady', () => { + it('should call isIntegrationStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsIntegrationStepReady).toHaveBeenCalled(); + expect(mockIsIntegrationStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show "Next" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Next'); + }); + + describe('when integration step is not done', () => { + beforeEach(() => { + mockIsIntegrationStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); + }); + + it('should still enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should still enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + }); + + describe('when integration step is done', () => { + beforeEach(() => { + mockIsIntegrationStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for integration step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 2, + stepName: 'Integration Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + }); + }); + + describe('when back button is clicked', () => { + let result: ReturnType<typeof renderIntegrationAssistant>; + beforeEach(() => { + result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-backButton').click(); + }); + }); + + it('should not report telemetry', () => { + expect(mockReportEvent).not.toHaveBeenCalled(); + }); + + it('should show connector step', () => { + expect(result.queryByTestId('connectorStepMock')).toBeInTheDocument(); + }); + + it('should enable the next button', () => { + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); }); }); describe('when step is 3', () => { beforeEach(() => { + mockIsConnectorStepReadyToComplete.mockReturnValue(true); + mockIsIntegrationStepReadyToComplete.mockReturnValue(true); mockInitialState.mockReturnValueOnce({ ...defaultInitialState, step: 3 }); }); @@ -126,9 +327,116 @@ describe('CreateIntegration', () => { expect(result.queryByTestId('dataStreamStepMock')).toBeInTheDocument(); }); - it('should call isDataStreamStepReady', () => { + it('should call isDataStreamStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsDataStreamStepReady).toHaveBeenCalled(); + expect(mockIsDataStreamStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show "Analyze logs" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Analyze logs'); + }); + + describe('when data stream step is not done', () => { + beforeEach(() => { + mockIsDataStreamStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); + }); + + it('should still enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should still enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + }); + + describe('when data stream step is done', () => { + beforeEach(() => { + mockIsDataStreamStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for data stream step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 3, + stepName: 'DataStream Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + + it('should show loader on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('generatingLoader')).toBeInTheDocument(); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + // Not sure why there are two buttons when testing. + const nextButton = result + .getAllByTestId('buttonsFooter-nextButton') + .filter((button) => button.textContent !== 'Next')[0]; + expect(nextButton).toBeDisabled(); + }); + }); + }); + + describe('when back button is clicked', () => { + let result: ReturnType<typeof renderIntegrationAssistant>; + beforeEach(() => { + result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-backButton').click(); + }); + }); + + it('should not report telemetry', () => { + expect(mockReportEvent).not.toHaveBeenCalled(); + }); + + it('should show integration step', () => { + expect(result.queryByTestId('integrationStepMock')).toBeInTheDocument(); + }); + + it('should enable the next button', () => { + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); }); }); @@ -142,9 +450,89 @@ describe('CreateIntegration', () => { expect(result.queryByTestId('reviewStepMock')).toBeInTheDocument(); }); - it('should call isReviewStepReady', () => { + it('should call isReviewStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsReviewStepReady).toHaveBeenCalled(); + expect(mockIsReviewStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show the "Add to Elastic" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Add to Elastic'); + }); + + describe('when review step is not done', () => { + beforeEach(() => { + mockIsReviewStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); + }); + + it('should still enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should still enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + }); + + describe('when review step is done', () => { + beforeEach(() => { + mockIsReviewStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for review step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 4, + stepName: 'Review Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + + it('should show deploy step', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + }); }); }); @@ -157,6 +545,26 @@ describe('CreateIntegration', () => { const result = renderIntegrationAssistant(); expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); }); + + it('should hide the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should hide the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + it('should show "Close" on the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toHaveTextContent('Close'); + }); }); }); @@ -179,9 +587,107 @@ describe('CreateIntegration with generateCel enabled', () => { expect(result.queryByTestId('celInputStepMock')).toBeInTheDocument(); }); - it('should call isCelInputStepReady', () => { + it('should call isCelInputStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsCelInputStepReady).toHaveBeenCalled(); + expect(mockIsCelInputStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show "Generate CEL input configuration" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent( + 'Generate CEL input configuration' + ); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + describe('when cel input step is not done', () => { + beforeEach(() => { + mockIsCelInputStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + // Not sure why there are two buttons when testing. + const nextButton = result + .getAllByTestId('buttonsFooter-nextButton') + .filter((button) => button.textContent !== 'Next')[0]; + expect(nextButton).toBeDisabled(); + }); + }); + + describe('when cel input step is done', () => { + beforeEach(() => { + mockIsCelInputStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for cel input step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 5, + stepName: 'CEL Input Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + + it('should show loader on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('generatingLoader')).toBeInTheDocument(); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + // Not sure why there are two buttons when testing. + const nextButton = result + .getAllByTestId('buttonsFooter-nextButton') + .filter((button) => button.textContent !== 'Next')[0]; + expect(nextButton).toBeDisabled(); + }); + }); + }); + + describe('when back button is clicked', () => { + let result: ReturnType<typeof renderIntegrationAssistant>; + beforeEach(() => { + result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-backButton').click(); + }); + }); + + it('should not report telemetry', () => { + expect(mockReportEvent).not.toHaveBeenCalled(); + }); + + it('should show review step', () => { + expect(result.queryByTestId('reviewStepMock')).toBeInTheDocument(); + }); + + it('should enable the next button', () => { + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); }); }); @@ -194,6 +700,26 @@ describe('CreateIntegration with generateCel enabled', () => { const result = renderIntegrationAssistant(); expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); }); + + it('should hide the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should hide the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + it('should show "Close" on the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toHaveTextContent('Close'); + }); }); describe('when step is 6', () => { @@ -210,9 +736,89 @@ describe('CreateIntegration with generateCel enabled', () => { expect(result.queryByTestId('reviewCelStepMock')).toBeInTheDocument(); }); - it('should call isReviewCelStepReady', () => { + it('should call isReviewCelStepReadyToComplete', () => { renderIntegrationAssistant(); - expect(mockIsCelReviewStepReady).toHaveBeenCalled(); + expect(mockIsCelReviewStepReadyToComplete).toHaveBeenCalled(); + }); + + it('should show the "Add to Elastic" on the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toHaveTextContent('Add to Elastic'); + }); + + describe('when cel review step is not done', () => { + beforeEach(() => { + mockIsCelReviewStepReadyToComplete.mockReturnValue(false); + }); + + it('should disable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeDisabled(); + }); + + it('should still enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should still enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + }); + + describe('when cel review step is done', () => { + beforeEach(() => { + mockIsCelReviewStepReadyToComplete.mockReturnValue(true); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + + it('should enable the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-backButton')).toBeEnabled(); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + describe('when next button is clicked', () => { + beforeEach(() => { + const result = renderIntegrationAssistant(); + mockReportEvent.mockClear(); + act(() => { + result.getByTestId('buttonsFooter-nextButton').click(); + }); + }); + + it('should report telemetry for review step completion', () => { + expect(mockReportEvent).toHaveBeenCalledWith( + TelemetryEventType.IntegrationAssistantStepComplete, + { + sessionId: expect.any(String), + step: 6, + stepName: 'CEL Review Step', + durationMs: expect.any(Number), + sessionElapsedTime: expect.any(Number), + } + ); + }); + + it('should show deploy step', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); + }); + + it('should enable the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-nextButton')).toBeEnabled(); + }); + }); }); }); @@ -225,5 +831,25 @@ describe('CreateIntegration with generateCel enabled', () => { const result = renderIntegrationAssistant(); expect(result.queryByTestId('deployStepMock')).toBeInTheDocument(); }); + + it('should hide the back button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should hide the next button', () => { + const result = renderIntegrationAssistant(); + expect(result.queryByTestId('buttonsFooter-backButton')).toBe(null); + }); + + it('should enable the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toBeEnabled(); + }); + + it('should show "Close" on the cancel button', () => { + const result = renderIntegrationAssistant(); + expect(result.getByTestId('buttonsFooter-cancelButton')).toHaveTextContent('Close'); + }); }); }); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx index 72e085e19920..81cb5a9b3b13 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/create_integration_assistant.tsx @@ -5,31 +5,96 @@ * 2.0. */ -import React, { useReducer, useMemo, useEffect } from 'react'; +import React, { useReducer, useMemo, useEffect, useCallback } from 'react'; import { KibanaPageTemplate } from '@kbn/shared-ux-page-kibana-template'; import { Header } from './header'; import { Footer } from './footer'; -import { ConnectorStep, isConnectorStepReady } from './steps/connector_step'; -import { IntegrationStep, isIntegrationStepReady } from './steps/integration_step'; -import { DataStreamStep, isDataStreamStepReady } from './steps/data_stream_step'; -import { ReviewStep, isReviewStepReady } from './steps/review_step'; -import { CelInputStep, isCelInputStepReady } from './steps/cel_input_step'; -import { ReviewCelStep, isCelReviewStepReady } from './steps/review_cel_step'; +import { useNavigate, Page } from '../../../common/hooks/use_navigate'; +import { ConnectorStep, isConnectorStepReadyToComplete } from './steps/connector_step'; +import { IntegrationStep, isIntegrationStepReadyToComplete } from './steps/integration_step'; +import { DataStreamStep, isDataStreamStepReadyToComplete } from './steps/data_stream_step'; +import { ReviewStep, isReviewStepReadyToComplete } from './steps/review_step'; +import { CelInputStep, isCelInputStepReadyToComplete } from './steps/cel_input_step'; +import { ReviewCelStep, isCelReviewStepReadyToComplete } from './steps/review_cel_step'; import { DeployStep } from './steps/deploy_step'; import { reducer, initialState, ActionsProvider, type Actions } from './state'; import { useTelemetry } from '../telemetry'; import { ExperimentalFeaturesService } from '../../../services'; +const stepNames: Record<number | string, string> = { + 1: 'Connector Step', + 2: 'Integration Step', + 3: 'DataStream Step', + 4: 'Review Step', + cel_input: 'CEL Input Step', + cel_review: 'CEL Review Step', + deploy: 'Deploy Step', +}; + export const CreateIntegrationAssistant = React.memo(() => { const [state, dispatch] = useReducer(reducer, initialState); - + const navigate = useNavigate(); const { generateCel: isGenerateCelEnabled } = ExperimentalFeaturesService.get(); + const celInputStepIndex = isGenerateCelEnabled && state.hasCelInput ? 5 : null; + const celReviewStepIndex = isGenerateCelEnabled && state.celInputResult ? 6 : null; + const deployStepIndex = + celInputStepIndex !== null || celReviewStepIndex !== null || state.step === 7 ? 7 : 5; + + const stepName = + state.step === deployStepIndex + ? stepNames.deploy + : state.step === celReviewStepIndex + ? stepNames.cel_review + : state.step === celInputStepIndex + ? stepNames.cel_input + : state.step in stepNames + ? stepNames[state.step] + : 'Unknown Step'; + const telemetry = useTelemetry(); useEffect(() => { telemetry.reportAssistantOpen(); }, [telemetry]); + const isThisStepReadyToComplete = useMemo(() => { + if (state.step === 1) { + return isConnectorStepReadyToComplete(state); + } else if (state.step === 2) { + return isIntegrationStepReadyToComplete(state); + } else if (state.step === 3) { + return isDataStreamStepReadyToComplete(state); + } else if (state.step === 4) { + return isReviewStepReadyToComplete(state); + } else if (isGenerateCelEnabled && state.step === 5) { + return isCelInputStepReadyToComplete(state); + } else if (isGenerateCelEnabled && state.step === 6) { + return isCelReviewStepReadyToComplete(state); + } + return false; + }, [state, isGenerateCelEnabled]); + + const goBackStep = useCallback(() => { + if (state.step === 1) { + navigate(Page.landing); + } else { + dispatch({ type: 'SET_STEP', payload: state.step - 1 }); + } + }, [navigate, dispatch, state.step]); + + const completeStep = useCallback(() => { + if (!isThisStepReadyToComplete) { + // If the user tries to navigate to the next step without completing the current step. + return; + } + telemetry.reportAssistantStepComplete({ step: state.step, stepName }); + if (state.step === 3 || state.step === celInputStepIndex) { + dispatch({ type: 'SET_IS_GENERATING', payload: true }); + } else { + dispatch({ type: 'SET_STEP', payload: state.step + 1 }); + } + }, [telemetry, state.step, stepName, celInputStepIndex, isThisStepReadyToComplete]); + const actions = useMemo<Actions>( () => ({ setStep: (payload) => { @@ -53,27 +118,11 @@ export const CreateIntegrationAssistant = React.memo(() => { setCelInputResult: (payload) => { dispatch({ type: 'SET_CEL_INPUT_RESULT', payload }); }, + completeStep, }), - [] + [completeStep] ); - const isNextStepEnabled = useMemo(() => { - if (state.step === 1) { - return isConnectorStepReady(state); - } else if (state.step === 2) { - return isIntegrationStepReady(state); - } else if (state.step === 3) { - return isDataStreamStepReady(state); - } else if (state.step === 4) { - return isReviewStepReady(state); - } else if (isGenerateCelEnabled && state.step === 5) { - return isCelInputStepReady(state); - } else if (isGenerateCelEnabled && state.step === 6) { - return isCelReviewStepReady(state); - } - return false; - }, [state, isGenerateCelEnabled]); - return ( <ActionsProvider value={actions}> <KibanaPageTemplate> @@ -95,28 +144,21 @@ export const CreateIntegrationAssistant = React.memo(() => { result={state.result} /> )} - {state.step === 5 && - (isGenerateCelEnabled && state.hasCelInput ? ( - <CelInputStep - integrationSettings={state.integrationSettings} - connector={state.connector} - isGenerating={state.isGenerating} - /> - ) : ( - <DeployStep - integrationSettings={state.integrationSettings} - result={state.result} - connector={state.connector} - /> - ))} - - {isGenerateCelEnabled && state.celInputResult && state.step === 6 && ( + {state.step === celInputStepIndex && ( + <CelInputStep + integrationSettings={state.integrationSettings} + connector={state.connector} + isGenerating={state.isGenerating} + /> + )} + {state.step === celReviewStepIndex && ( <ReviewCelStep isGenerating={state.isGenerating} celInputResult={state.celInputResult} /> )} - {isGenerateCelEnabled && state.step === 7 && ( + + {state.step === deployStepIndex && ( <DeployStep integrationSettings={state.integrationSettings} result={state.result} @@ -126,10 +168,14 @@ export const CreateIntegrationAssistant = React.memo(() => { )} </KibanaPageTemplate.Section> <Footer - currentStep={state.step} isGenerating={state.isGenerating} - hasCelInput={state.hasCelInput} - isNextStepEnabled={isNextStepEnabled} + isAnalyzeStep={state.step === 3} + isAnalyzeCelStep={state.step === celInputStepIndex} + isLastStep={state.step === deployStepIndex} + isNextStepEnabled={isThisStepReadyToComplete && !state.isGenerating} + isNextAddingToElastic={state.step === deployStepIndex - 1} + onBack={goBackStep} + onNext={completeStep} /> </KibanaPageTemplate> </ActionsProvider> diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx index 1ca79210bb19..1291507e3f62 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.test.tsx @@ -6,13 +6,11 @@ */ import React from 'react'; -import { render, act, type RenderResult } from '@testing-library/react'; +import { render, type RenderResult } from '@testing-library/react'; import { TestProvider } from '../../../../mocks/test_provider'; import { Footer } from './footer'; import { ActionsProvider } from '../state'; import { mockActions } from '../mocks/state'; -import { mockReportEvent } from '../../../../services/telemetry/mocks/service'; -import { TelemetryEventType } from '../../../../services/telemetry/types'; import { ExperimentalFeaturesService } from '../../../../services'; const mockNavigate = jest.fn(); @@ -39,15 +37,12 @@ describe('Footer', () => { } as never); }); - describe('when rendered', () => { + describe('when rendered for the most common case', () => { let result: RenderResult; beforeEach(() => { - result = render( - <Footer currentStep={1} isGenerating={false} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); + result = render(<Footer isNextStepEnabled />, { + wrapper, + }); }); it('should render footer buttons component', () => { expect(result.queryByTestId('buttonsFooter')).toBeInTheDocument(); @@ -65,230 +60,4 @@ describe('Footer', () => { expect(result.queryByTestId('buttonsFooter-nextButton')).toBeInTheDocument(); }); }); - - describe('when step is 1', () => { - let result: RenderResult; - beforeEach(() => { - result = render( - <Footer currentStep={1} isGenerating={false} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); - }); - - describe('when next button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-nextButton').click(); - }); - }); - - it('should set step 2', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(2); - }); - - it('should report telemetry', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, - { - sessionId: expect.any(String), - step: 1, - stepName: 'Connector Step', - durationMs: expect.any(Number), - sessionElapsedTime: expect.any(Number), - } - ); - }); - }); - - describe('when back button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-backButton').click(); - }); - }); - - it('should navigate to landing', () => { - expect(mockNavigate).toHaveBeenCalledWith('landing'); - }); - }); - }); - - describe('when step is 2', () => { - let result: RenderResult; - beforeEach(() => { - result = render( - <Footer currentStep={2} isGenerating={false} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); - }); - - describe('when next button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-nextButton').click(); - }); - }); - - it('should set step 3', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(3); - }); - - it('should report telemetry', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, - { - sessionId: expect.any(String), - step: 2, - stepName: 'Integration Step', - durationMs: expect.any(Number), - sessionElapsedTime: expect.any(Number), - } - ); - }); - }); - - describe('when back button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-backButton').click(); - }); - }); - - it('should set step 1', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(1); - }); - }); - }); - - describe('when step is 3', () => { - describe('when it is not generating', () => { - let result: RenderResult; - beforeEach(() => { - result = render( - <Footer currentStep={3} isGenerating={false} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); - }); - - describe('when next button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-nextButton').click(); - }); - }); - - it('should set step 4', () => { - expect(mockActions.setIsGenerating).toHaveBeenCalledWith(true); - }); - - it('should report telemetry', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, - { - sessionId: expect.any(String), - step: 3, - stepName: 'DataStream Step', - durationMs: expect.any(Number), - sessionElapsedTime: expect.any(Number), - } - ); - }); - }); - - describe('when back button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-backButton').click(); - }); - }); - - it('should set step 2', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(2); - }); - }); - }); - - describe('when it is generating', () => { - let result: RenderResult; - beforeEach(() => { - result = render( - <Footer currentStep={3} isGenerating={true} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); - }); - - it('should render the loader', () => { - expect(result.queryByTestId('generatingLoader')).toBeInTheDocument(); - }); - }); - }); - - describe('when step is 4', () => { - let result: RenderResult; - beforeEach(() => { - result = render( - <Footer currentStep={4} isGenerating={false} hasCelInput={false} isNextStepEnabled />, - { - wrapper, - } - ); - }); - - describe('when next button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-nextButton').click(); - }); - }); - - it('should set step 5', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(5); - }); - - it('should report telemetry', () => { - expect(mockReportEvent).toHaveBeenCalledWith( - TelemetryEventType.IntegrationAssistantStepComplete, - { - sessionId: expect.any(String), - step: 4, - stepName: 'Review Step', - durationMs: expect.any(Number), - sessionElapsedTime: expect.any(Number), - } - ); - }); - }); - - describe('when back button is clicked', () => { - beforeEach(() => { - act(() => { - result.getByTestId('buttonsFooter-backButton').click(); - }); - }); - - it('should set step 3', () => { - expect(mockActions.setStep).toHaveBeenCalledWith(3); - }); - }); - }); - - describe('when next step is disabled', () => { - let result: RenderResult; - beforeEach(() => { - result = render(<Footer currentStep={1} isGenerating={false} hasCelInput={false} />, { - wrapper, - }); - }); - it('should render next button disabled', () => { - expect(result.queryByTestId('buttonsFooter-nextButton')).toBeDisabled(); - }); - }); }); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx index 839d751e6f38..dfd38517e160 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/footer/footer.tsx @@ -6,13 +6,10 @@ */ import { EuiLoadingSpinner } from '@elastic/eui'; -import React, { useCallback, useMemo } from 'react'; +import React, { useMemo } from 'react'; import { ButtonsFooter } from '../../../../common/components/buttons_footer'; -import { useNavigate, Page } from '../../../../common/hooks/use_navigate'; -import { useTelemetry } from '../../telemetry'; -import { useActions, type State } from '../state'; +import { type State } from '../state'; import * as i18n from './translations'; -import { ExperimentalFeaturesService } from '../../../../services'; // Generation button for Step 3 const AnalyzeButtonText = React.memo<{ isGenerating: boolean }>(({ isGenerating }) => { @@ -43,61 +40,47 @@ const AnalyzeCelButtonText = React.memo<{ isGenerating: boolean }>(({ isGenerati AnalyzeCelButtonText.displayName = 'AnalyzeCelButtonText'; interface FooterProps { - currentStep: State['step']; - isGenerating: State['isGenerating']; - hasCelInput: State['hasCelInput']; + isGenerating?: State['isGenerating']; + isAnalyzeStep?: boolean; + isAnalyzeCelStep?: boolean; + isLastStep?: boolean; isNextStepEnabled?: boolean; + isNextAddingToElastic?: boolean; + onBack?: () => void; + onNext?: () => void; } export const Footer = React.memo<FooterProps>( - ({ currentStep, isGenerating, hasCelInput, isNextStepEnabled = false }) => { - const telemetry = useTelemetry(); - const { setStep, setIsGenerating } = useActions(); - const navigate = useNavigate(); - - const { generateCel: isGenerateCelEnabled } = ExperimentalFeaturesService.get(); - - const onBack = useCallback(() => { - if (currentStep === 1) { - navigate(Page.landing); - } else { - setStep(currentStep - 1); - } - }, [currentStep, navigate, setStep]); - - const onNext = useCallback(() => { - telemetry.reportAssistantStepComplete({ step: currentStep }); - if (currentStep === 3 || currentStep === 5) { - setIsGenerating(true); - } else { - setStep(currentStep + 1); - } - }, [currentStep, setIsGenerating, setStep, telemetry]); - - const nextButtonText = useMemo(() => { - if (currentStep === 3) { - return <AnalyzeButtonText isGenerating={isGenerating} />; - } - if (currentStep === 4 && (!isGenerateCelEnabled || !hasCelInput)) { - return i18n.ADD_TO_ELASTIC; - } - if (currentStep === 5 && isGenerateCelEnabled && hasCelInput) { - return <AnalyzeCelButtonText isGenerating={isGenerating} />; - } - if (currentStep === 6 && isGenerateCelEnabled) { - return i18n.ADD_TO_ELASTIC; - } - }, [currentStep, isGenerating, hasCelInput, isGenerateCelEnabled]); + ({ + isGenerating = false, + isAnalyzeStep = false, + isAnalyzeCelStep = false, + isLastStep = false, + isNextStepEnabled = false, + isNextAddingToElastic = false, + onBack = () => {}, + onNext = () => {}, + }) => { + const nextButtonText = useMemo( + () => + isNextAddingToElastic ? ( + i18n.ADD_TO_ELASTIC + ) : isAnalyzeStep ? ( + <AnalyzeButtonText isGenerating={isGenerating} /> + ) : isAnalyzeCelStep ? ( + <AnalyzeCelButtonText isGenerating={isGenerating} /> + ) : null, + [isNextAddingToElastic, isAnalyzeStep, isGenerating, isAnalyzeCelStep] + ); - if (currentStep === 7 || (currentStep === 5 && (!isGenerateCelEnabled || !hasCelInput))) { - return <ButtonsFooter cancelButtonText={i18n.CLOSE} />; - } - return ( + return isLastStep ? ( + <ButtonsFooter cancelButtonText={i18n.CLOSE} /> + ) : ( <ButtonsFooter - isNextDisabled={!isNextStepEnabled || isGenerating} + nextButtonText={nextButtonText} + isNextDisabled={!isNextStepEnabled} onBack={onBack} onNext={onNext} - nextButtonText={nextButtonText} /> ); } diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts index c25a78a35416..bdae762e83c2 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/mocks/state.ts @@ -435,4 +435,5 @@ export const mockActions: Actions = { setHasCelInput: jest.fn(), setResult: jest.fn(), setCelInputResult: jest.fn(), + completeStep: jest.fn(), }; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts index 1e7b22128843..17ac3bdd9f90 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/state.ts @@ -78,6 +78,7 @@ export interface Actions { setHasCelInput: (payload: State['hasCelInput']) => void; setResult: (payload: State['result']) => void; setCelInputResult: (payload: State['celInputResult']) => void; + completeStep: () => void; } const ActionsContext = createContext<Actions | undefined>(undefined); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/cel_input_step.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/cel_input_step.tsx index b0a0b3194ec3..851ea3f7e6a2 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/cel_input_step.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/cel_input_step.tsx @@ -22,7 +22,7 @@ interface CelInputStepProps { export const CelInputStep = React.memo<CelInputStepProps>( ({ integrationSettings, connector, isGenerating }) => { - const { setIsGenerating, setStep, setCelInputResult } = useActions(); + const { setIsGenerating, setStep, setCelInputResult, completeStep } = useActions(); const onGenerationCompleted = useCallback<OnComplete>( (result: State['celInputResult']) => { @@ -43,7 +43,14 @@ export const CelInputStep = React.memo<CelInputStepProps>( <EuiFlexItem> <StepContentWrapper title={i18n.CEL_INPUT_TITLE} subtitle={i18n.CEL_INPUT_DESCRIPTION}> <EuiPanel hasShadow={false} hasBorder> - <EuiForm component="form" fullWidth> + <EuiForm + component="form" + fullWidth + onSubmit={(e) => { + e.preventDefault(); + completeStep(); + }} + > <ApiDefinitionInput integrationSettings={integrationSettings} /> </EuiForm> </EuiPanel> diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/is_step_ready.ts index 594f4230164c..fa89ccc3882d 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/cel_input_step/is_step_ready.ts @@ -6,7 +6,7 @@ */ import type { State } from '../../state'; -export const isCelInputStepReady = ({ integrationSettings }: State) => +export const isCelInputStepReadyToComplete = ({ integrationSettings }: State) => Boolean( integrationSettings?.name && integrationSettings?.dataStreamTitle && diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx index 4ea33cc8668e..a5577ca96110 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_selector.tsx @@ -6,12 +6,18 @@ */ import React from 'react'; -import { useEuiTheme, EuiBadge, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiRadio } from '@elastic/eui'; -import { noop } from 'lodash/fp'; +import { + useEuiTheme, + EuiBadge, + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiRadio, + EuiFormFieldset, +} from '@elastic/eui'; import { css } from '@emotion/react'; import { useKibana } from '../../../../../common/hooks/use_kibana'; import type { AIConnector } from '../../types'; -import { useActions } from '../../state'; const useRowCss = () => { const { euiTheme } = useEuiTheme(); @@ -25,7 +31,7 @@ const useRowCss = () => { background-color: ${euiTheme.colors.lightestShade}; } .euiRadio { - color: ${euiTheme.colors.primaryText}; + color: ${euiTheme.colors.textPrimary}; label.euiRadio__label { padding-left: ${euiTheme.size.xl} !important; } @@ -36,54 +42,60 @@ const useRowCss = () => { interface ConnectorSelectorProps { connectors: AIConnector[]; selectedConnectorId: string | undefined; + setConnector: (connector: AIConnector | undefined) => void; } export const ConnectorSelector = React.memo<ConnectorSelectorProps>( - ({ connectors, selectedConnectorId }) => { + ({ connectors, setConnector, selectedConnectorId }) => { const { triggersActionsUi: { actionTypeRegistry }, } = useKibana().services; - const { setConnector } = useActions(); const rowCss = useRowCss(); return ( - <EuiFlexGroup - alignItems="stretch" - direction="column" - gutterSize="s" - data-test-subj="connectorSelector" - > - {connectors.map((connector) => ( - <EuiFlexItem key={connector.id}> - <EuiPanel - key={connector.id} - onClick={() => setConnector(connector)} - hasShadow={false} - hasBorder - paddingSize="l" - css={rowCss} - data-test-subj={`connectorSelector-${connector.id}`} - > - <EuiFlexGroup direction="row" alignItems="center" justifyContent="spaceBetween"> - <EuiFlexItem> - <EuiRadio - label={connector.name} - id={connector.id} - checked={selectedConnectorId === connector.id} - onChange={noop} - data-test-subj={`connectorSelectorRadio-${connector.id}${ - selectedConnectorId === connector.id ? '-selected' : '' - }`} - /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <EuiBadge color="hollow"> - {actionTypeRegistry.get(connector.actionTypeId).actionTypeTitle} - </EuiBadge> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - </EuiFlexItem> - ))} - </EuiFlexGroup> + <EuiFormFieldset> + <EuiFlexGroup + alignItems="stretch" + direction="column" + gutterSize="s" + data-test-subj="connectorSelector" + > + {connectors.map((connector) => ( + <EuiFlexItem key={connector.id}> + <EuiPanel + element="button" + type="button" // So that the enter button will not submit the form. + role="radio" + key={connector.id} + onClick={() => setConnector(connector)} + hasShadow={false} + hasBorder + paddingSize="l" + css={rowCss} + data-test-subj={`connectorSelector-${connector.id}`} + > + <EuiFlexGroup direction="row" alignItems="center" justifyContent="spaceBetween"> + <EuiFlexItem> + <EuiRadio + label={connector.name} + id={connector.id} + value={connector.id} + checked={selectedConnectorId === connector.id} + onChange={() => setConnector(connector)} + data-test-subj={`connectorSelectorRadio-${connector.id}${ + selectedConnectorId === connector.id ? '-selected' : '' + }`} + /> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiBadge color="hollow"> + {actionTypeRegistry.get(connector.actionTypeId).actionTypeTitle} + </EuiBadge> + </EuiFlexItem> + </EuiFlexGroup> + </EuiPanel> + </EuiFlexItem> + ))} + </EuiFlexGroup> + </EuiFormFieldset> ); } ); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx index c2643ffa9e92..8c7fa66795c8 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/connector_step.tsx @@ -8,6 +8,7 @@ import React, { useCallback, useEffect, useState } from 'react'; import { useLoadConnectors } from '@kbn/elastic-assistant'; import { + EuiForm, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, @@ -42,7 +43,8 @@ interface ConnectorStepProps { export const ConnectorStep = React.memo<ConnectorStepProps>(({ connector }) => { const { euiTheme } = useEuiTheme(); const { http, notifications } = useKibana().services; - const { setConnector } = useActions(); + const { setConnector, completeStep } = useActions(); + const [connectors, setConnectors] = useState<AIConnector[]>(); const { isLoading, @@ -69,41 +71,56 @@ export const ConnectorStep = React.memo<ConnectorStepProps>(({ connector }) => { const hasConnectors = !isLoading && connectors?.length; return ( - <StepContentWrapper - title={i18n.TITLE} - subtitle={i18n.DESCRIPTION} - right={hasConnectors ? <CreateConnectorPopover onConnectorSaved={onConnectorSaved} /> : null} + <EuiForm + component="form" + fullWidth + onSubmit={(e) => { + e.preventDefault(); + completeStep(); + }} > - <EuiFlexGroup direction="column" alignItems="stretch"> - <EuiFlexItem> - {isLoading ? ( - <EuiLoadingSpinner /> - ) : ( - <> - {hasConnectors ? ( - <ConnectorSelector connectors={connectors} selectedConnectorId={connector?.id} /> - ) : ( - <AuthorizationWrapper canCreateConnectors> - <ConnectorSetup - actionTypeIds={AllowedActionTypeIds} - onConnectorSaved={onConnectorSaved} + <StepContentWrapper + title={i18n.TITLE} + subtitle={i18n.DESCRIPTION} + right={ + hasConnectors ? <CreateConnectorPopover onConnectorSaved={onConnectorSaved} /> : null + } + > + <EuiFlexGroup direction="column" alignItems="stretch"> + <EuiFlexItem> + {isLoading ? ( + <EuiLoadingSpinner /> + ) : ( + <> + {hasConnectors ? ( + <ConnectorSelector + connectors={connectors} + setConnector={setConnector} + selectedConnectorId={connector?.id} /> - </AuthorizationWrapper> - )} - </> - )} - </EuiFlexItem> - </EuiFlexGroup> - <EuiSpacer size="m" /> - <EuiText size="s" color="subdued"> - <EuiFlexGroup direction="row" gutterSize="xs" alignItems="flexStart"> - <EuiFlexItem grow={false} css={{ margin: euiTheme.size.xxs }}> - <EuiIcon type="iInCircle" /> + ) : ( + <AuthorizationWrapper canCreateConnectors> + <ConnectorSetup + actionTypeIds={AllowedActionTypeIds} + onConnectorSaved={onConnectorSaved} + /> + </AuthorizationWrapper> + )} + </> + )} </EuiFlexItem> - <EuiFlexItem>{i18n.SUPPORTED_MODELS_INFO}</EuiFlexItem> </EuiFlexGroup> - </EuiText> - </StepContentWrapper> + <EuiSpacer size="m" /> + <EuiText size="s" color="subdued"> + <EuiFlexGroup direction="row" gutterSize="xs" alignItems="flexStart"> + <EuiFlexItem grow={false} css={{ margin: euiTheme.size.xxs }}> + <EuiIcon type="iInCircle" /> + </EuiFlexItem> + <EuiFlexItem>{i18n.SUPPORTED_MODELS_INFO}</EuiFlexItem> + </EuiFlexGroup> + </EuiText> + </StepContentWrapper> + </EuiForm> ); }); ConnectorStep.displayName = 'ConnectorStep'; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts index 5b425b094009..cc09cd2a6c87 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/connector_step/is_step_ready.ts @@ -7,4 +7,4 @@ import type { State } from '../../state'; -export const isConnectorStepReady = ({ connector }: State) => connector != null; +export const isConnectorStepReadyToComplete = ({ connector }: State) => connector != null; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx index 4b505fb7062d..1bd7b92b2e0c 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/data_stream_step.tsx @@ -53,8 +53,14 @@ interface DataStreamStepProps { } export const DataStreamStep = React.memo<DataStreamStepProps>( ({ integrationSettings, connector, isGenerating }) => { - const { setIntegrationSettings, setIsGenerating, setHasCelInput, setStep, setResult } = - useActions(); + const { + setIntegrationSettings, + setIsGenerating, + setHasCelInput, + setStep, + setResult, + completeStep, + } = useActions(); const { isLoading: isLoadingPackageNames, packageNames } = useLoadPackageNames(); // this is used to avoid duplicate names const [name, setName] = useState<string>(integrationSettings?.name ?? ''); @@ -150,14 +156,21 @@ export const DataStreamStep = React.memo<DataStreamStepProps>( ); return ( - <EuiFlexGroup direction="column" gutterSize="l" data-test-subj="dataStreamStep"> - <EuiFlexItem> - <StepContentWrapper - title={i18n.INTEGRATION_NAME_TITLE} - subtitle={i18n.INTEGRATION_NAME_DESCRIPTION} - > - <EuiPanel hasShadow={false} hasBorder> - <EuiForm component="form" fullWidth> + <EuiForm + component="form" + fullWidth + onSubmit={(e) => { + e.preventDefault(); + completeStep(); + }} + > + <EuiFlexGroup direction="column" gutterSize="l" data-test-subj="dataStreamStep"> + <EuiFlexItem> + <StepContentWrapper + title={i18n.INTEGRATION_NAME_TITLE} + subtitle={i18n.INTEGRATION_NAME_DESCRIPTION} + > + <EuiPanel hasShadow={false} hasBorder> <EuiFormRow label={i18n.INTEGRATION_NAME_LABEL} helpText={ @@ -176,18 +189,16 @@ export const DataStreamStep = React.memo<DataStreamStepProps>( disabled={isLoadingPackageNames} /> </EuiFormRow> - </EuiForm> - </EuiPanel> - </StepContentWrapper> - </EuiFlexItem> + </EuiPanel> + </StepContentWrapper> + </EuiFlexItem> - <EuiFlexItem> - <StepContentWrapper - title={i18n.DATA_STREAM_TITLE} - subtitle={i18n.DATA_STREAM_DESCRIPTION} - > - <EuiPanel hasShadow={false} hasBorder> - <EuiForm component="form" fullWidth> + <EuiFlexItem> + <StepContentWrapper + title={i18n.DATA_STREAM_TITLE} + subtitle={i18n.DATA_STREAM_DESCRIPTION} + > + <EuiPanel hasShadow={false} hasBorder> <EuiFormRow label={i18n.DATA_STREAM_TITLE_LABEL}> <EuiFieldText name="dataStreamTitle" @@ -228,19 +239,19 @@ export const DataStreamStep = React.memo<DataStreamStepProps>( /> </EuiFormRow> <SampleLogsInput integrationSettings={integrationSettings} /> - </EuiForm> - </EuiPanel> - </StepContentWrapper> - {isGenerating && ( - <GenerationModal - integrationSettings={integrationSettings} - connector={connector} - onComplete={onGenerationCompleted} - onClose={onGenerationClosed} - /> - )} - </EuiFlexItem> - </EuiFlexGroup> + </EuiPanel> + </StepContentWrapper> + {isGenerating && ( + <GenerationModal + integrationSettings={integrationSettings} + connector={connector} + onComplete={onGenerationCompleted} + onClose={onGenerationClosed} + /> + )} + </EuiFlexItem> + </EuiFlexGroup> + </EuiForm> ); } ); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts index 4a40334a72ab..509ee99b4122 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/data_stream_step/is_step_ready.ts @@ -6,7 +6,7 @@ */ import type { State } from '../../state'; -export const isDataStreamStepReady = ({ integrationSettings }: State) => +export const isDataStreamStepReadyToComplete = ({ integrationSettings }: State) => Boolean( integrationSettings?.name && integrationSettings?.dataStreamTitle && diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx index dc27abd9529c..928f4db5f065 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/integration_step.tsx @@ -51,7 +51,7 @@ interface IntegrationStepProps { export const IntegrationStep = React.memo<IntegrationStepProps>(({ integrationSettings }) => { const styles = useLayoutStyles(); - const { setIntegrationSettings } = useActions(); + const { setIntegrationSettings, completeStep } = useActions(); const [logoError, setLogoError] = React.useState<string>(); const setIntegrationValues = useCallback( @@ -95,7 +95,14 @@ export const IntegrationStep = React.memo<IntegrationStepProps>(({ integrationSe <EuiPanel paddingSize="none" hasShadow={false} hasBorder data-test-subj="integrationStep"> <EuiFlexGroup direction="row" gutterSize="none"> <EuiFlexItem css={styles.left}> - <EuiForm component="form" fullWidth> + <EuiForm + component="form" + fullWidth + onSubmit={(e) => { + e.preventDefault(); + completeStep(); + }} + > <EuiFormRow label={i18n.TITLE_LABEL}> <EuiFieldText name="title" diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts index 80ef605c981b..4f4064131167 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/integration_step/is_step_ready.ts @@ -7,5 +7,5 @@ import type { State } from '../../state'; -export const isIntegrationStepReady = ({ integrationSettings }: State) => +export const isIntegrationStepReadyToComplete = ({ integrationSettings }: State) => Boolean(integrationSettings?.title && integrationSettings?.description); diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/is_step_ready.ts index 166c40e8e261..902cdea32d5e 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/is_step_ready.ts @@ -7,5 +7,5 @@ import type { State } from '../../state'; -export const isCelReviewStepReady = ({ isGenerating, celInputResult }: State) => +export const isCelReviewStepReadyToComplete = ({ isGenerating, celInputResult }: State) => isGenerating === false && celInputResult != null; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/review_cel_step.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/review_cel_step.tsx index a40fec082894..85b9980a4a5d 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/review_cel_step.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_cel_step/review_cel_step.tsx @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiLoadingSpinner, EuiPanel } from '@elastic/eui'; +import { EuiForm, EuiLoadingSpinner, EuiPanel } from '@elastic/eui'; import React from 'react'; -import type { State } from '../../state'; +import { useActions, type State } from '../../state'; import { StepContentWrapper } from '../step_content_wrapper'; import * as i18n from './translations'; import { CelConfigResults } from './cel_config_results'; @@ -17,15 +17,24 @@ interface ReviewCelStepProps { } export const ReviewCelStep = React.memo<ReviewCelStepProps>(({ isGenerating, celInputResult }) => { + const { completeStep } = useActions(); + return ( <StepContentWrapper title={i18n.TITLE} subtitle={i18n.DESCRIPTION}> <EuiPanel hasShadow={false} hasBorder data-test-subj="reviewCelStep"> {isGenerating ? ( <EuiLoadingSpinner size="l" /> ) : ( - <> + <EuiForm + component="form" + fullWidth + onSubmit={(e) => { + e.preventDefault(); + completeStep(); + }} + > <CelConfigResults celInputResult={celInputResult} /> - </> + </EuiForm> )} </EuiPanel> </StepContentWrapper> diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts index b03215c5e825..91b9726e03a3 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/create_integration_assistant/steps/review_step/is_step_ready.ts @@ -7,5 +7,5 @@ import type { State } from '../../state'; -export const isReviewStepReady = ({ isGenerating, result }: State) => +export const isReviewStepReadyToComplete = ({ isGenerating, result }: State) => isGenerating === false && result != null; diff --git a/x-pack/plugins/integration_assistant/public/components/create_integration/telemetry.tsx b/x-pack/plugins/integration_assistant/public/components/create_integration/telemetry.tsx index 39076726b7f9..04d8a07cd128 100644 --- a/x-pack/plugins/integration_assistant/public/components/create_integration/telemetry.tsx +++ b/x-pack/plugins/integration_assistant/public/components/create_integration/telemetry.tsx @@ -15,20 +15,12 @@ import type { IntegrationSettings, } from './create_integration_assistant/types'; -const stepNames: Record<string, string> = { - '1': 'Connector Step', - '2': 'Integration Step', - '3': 'DataStream Step', - '4': 'Review Step', - '5': 'Deploy Step', -}; - type ReportUploadZipIntegrationComplete = (params: { integrationName?: string; error?: string; }) => void; type ReportAssistantOpen = () => void; -type ReportAssistantStepComplete = (params: { step: number }) => void; +type ReportAssistantStepComplete = (params: { step: number; stepName: string }) => void; type ReportGenerationComplete = (params: { connector: AIConnector; integrationSettings: IntegrationSettings; @@ -92,11 +84,11 @@ export const TelemetryContextProvider = React.memo<PropsWithChildren<{}>>(({ chi }, [telemetry]); const reportAssistantStepComplete = useCallback<ReportAssistantStepComplete>( - ({ step }) => { + ({ step, stepName }) => { telemetry.reportEvent(TelemetryEventType.IntegrationAssistantStepComplete, { sessionId: sessionData.current.sessionId, step, - stepName: stepNames[step.toString()] ?? 'Unknown Step', + stepName, durationMs: Date.now() - stepsData.current.startedAt, sessionElapsedTime: Date.now() - sessionData.current.startedAt, }); diff --git a/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns.test.ts b/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns.test.ts index 5a70c4385784..530d3bf3121a 100644 --- a/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns.test.ts +++ b/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns.test.ts @@ -319,8 +319,8 @@ describe('map_to_columns', () => { ); expect(result.columns).toStrictEqual([ - { id: 'a', name: 'A', meta: { type: 'number' } }, - { id: 'b', name: 'B', meta: { type: 'number' } }, + { id: 'a', name: 'A', meta: { type: 'number', field: undefined, params: undefined } }, + { id: 'b', name: 'B', meta: { type: 'number', field: undefined, params: undefined } }, ]); expect(result.rows).toStrictEqual([ diff --git a/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns_fn_textbased.ts b/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns_fn_textbased.ts index cbaa8b8888df..1e6a869626ff 100644 --- a/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns_fn_textbased.ts +++ b/x-pack/plugins/lens/common/expressions/map_to_columns/map_to_columns_fn_textbased.ts @@ -32,7 +32,16 @@ export const mapToOriginalColumnsTextBased: MapToColumnsExpressionFunction['fn'] if (!(column.id in idMap)) { return []; } - return idMap[column.id].map((originalColumn) => ({ ...column, id: originalColumn.id })); + return idMap[column.id].map((originalColumn) => ({ + ...column, + id: originalColumn.id, + name: originalColumn.label, + meta: { + ...column.meta, + field: originalColumn.sourceField, + params: originalColumn.format, + }, + })); }), }; }; diff --git a/x-pack/plugins/lens/common/expressions/map_to_columns/types.ts b/x-pack/plugins/lens/common/expressions/map_to_columns/types.ts index e6617c38863b..f7559a539910 100644 --- a/x-pack/plugins/lens/common/expressions/map_to_columns/types.ts +++ b/x-pack/plugins/lens/common/expressions/map_to_columns/types.ts @@ -6,8 +6,9 @@ */ import { Datatable, ExpressionFunctionDefinition } from '@kbn/expressions-plugin/common'; +import { SerializedFieldFormat } from '@kbn/field-formats-plugin/common'; -export type OriginalColumn = { id: string; label: string } & ( +export type OriginalColumn = { id: string; label: string; format?: SerializedFieldFormat } & ( | { operationType: 'date_histogram'; sourceField: string } | { operationType: string; sourceField: never } ); diff --git a/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx b/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx index cf76df44eefc..c673c48db6c8 100644 --- a/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx +++ b/x-pack/plugins/lens/public/app_plugin/lens_top_nav.tsx @@ -17,6 +17,8 @@ import { useKibana } from '@kbn/kibana-react-plugin/public'; import { DataViewPickerProps } from '@kbn/unified-search-plugin/public'; import { getManagedContentBadge } from '@kbn/managed-content-badge'; import moment from 'moment'; +import { EuiCallOut } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; import { LENS_APP_LOCATOR } from '../../common/locator/locator'; import { LENS_APP_NAME } from '../../common/constants'; import { LensAppServices, LensTopNavActions, LensTopNavMenuProps } from './types'; @@ -641,6 +643,26 @@ export const LensTopNavMenu = ({ title: i18n.translate('xpack.lens.app.shareModal.title', { defaultMessage: 'Share this Lens visualization', }), + config: { + link: { + draftModeCallOut: ( + <EuiCallOut + color="warning" + title={ + <FormattedMessage + id="xpack.lens.app.shareModal.draftModeCallout.title" + defaultMessage="Unsaved changes" + /> + } + > + <FormattedMessage + id="xpack.lens.app.shareModal.draftModeCallout.link.warning" + defaultMessage="The copied link resolves to the current state of this visualization. To get a permanent link, make sure to save your Lens visualization first." + /> + </EuiCallOut> + ), + }, + }, }, sharingData, // only want to know about changes when savedObjectURL.href diff --git a/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx b/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx index f1ccacc37db5..f287e4426eaa 100644 --- a/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx +++ b/x-pack/plugins/lens/public/app_plugin/save_modal_container.tsx @@ -52,6 +52,7 @@ export type SaveModalContainerProps = { | 'analytics' | 'i18n' | 'theme' + | 'userProfile' | 'stateTransfer' | 'savedObjectStore' >; @@ -238,6 +239,7 @@ export type SaveVisualizationProps = Simplify< | 'analytics' | 'i18n' | 'theme' + | 'userProfile' | 'notifications' | 'stateTransfer' | 'attributeService' diff --git a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/format_selector.tsx b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/format_selector.tsx index d3982881a870..2b838ac8036e 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/format_selector.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/dimension_panel/format_selector.tsx @@ -28,6 +28,7 @@ import { } from '@kbn/field-formats-plugin/common'; import { css } from '@emotion/react'; import type { DocLinksStart } from '@kbn/core/public'; +import { TextBasedLayerColumn } from '../../text_based/types'; import { LensAppServices } from '../../../app_plugin/types'; import { GenericIndexPatternColumn } from '../form_based'; import { isColumnFormatted } from '../operations/definitions/helpers'; @@ -127,7 +128,7 @@ type FormatParams = NonNullable<ValueFormatConfig['params']>; type FormatParamsKeys = keyof FormatParams; export interface FormatSelectorProps { - selectedColumn: GenericIndexPatternColumn; + selectedColumn: GenericIndexPatternColumn | TextBasedLayerColumn; onChange: (newFormat?: { id: string; params?: FormatParams }) => void; docLinks: DocLinksStart; } diff --git a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/helpers.tsx b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/helpers.tsx index b65deebec963..59e0d43e491b 100644 --- a/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/helpers.tsx +++ b/x-pack/plugins/lens/public/datasources/form_based/operations/definitions/helpers.tsx @@ -10,6 +10,7 @@ import React, { Fragment } from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { isEqual } from 'lodash'; import { Query } from '@kbn/es-query'; +import { TextBasedLayerColumn } from '../../../text_based/types'; import type { IndexPattern, IndexPatternField } from '../../../../types'; import { type FieldBasedOperationErrorMessage, @@ -178,8 +179,8 @@ export const isColumn = ( }; export function isColumnFormatted( - column: GenericIndexPatternColumn -): column is FormattedIndexPatternColumn { + column: GenericIndexPatternColumn | TextBasedLayerColumn +): column is FormattedIndexPatternColumn | TextBasedLayerColumn { return Boolean( 'params' in column && (column as FormattedIndexPatternColumn).params && diff --git a/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx b/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx index 5b0032caff0d..bfaf056f6089 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/datasources/text_based/components/dimension_editor.tsx @@ -5,16 +5,24 @@ * 2.0. */ -import React, { useEffect, useState, useMemo } from 'react'; +import React, { useEffect, useState, useMemo, useCallback } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiFormRow } from '@elastic/eui'; +import { EuiFormRow, useEuiTheme, EuiText } from '@elastic/eui'; import { euiThemeVars } from '@kbn/ui-theme'; import type { ExpressionsStart } from '@kbn/expressions-plugin/public'; import { fetchFieldsFromESQL } from '@kbn/esql-editor'; +import { NameInput } from '@kbn/visualization-ui-components'; +import { css } from '@emotion/react'; +import { mergeLayer, updateColumnFormat, updateColumnLabel } from '../utils'; +import { + FormatSelector, + FormatSelectorProps, +} from '../../form_based/dimension_panel/format_selector'; import type { DatasourceDimensionEditorProps, DataType } from '../../../types'; import { FieldSelect, type FieldOptionCompatible } from './field_select'; import type { TextBasedPrivateState } from '../types'; import { isNotNumeric, isNumeric } from '../utils'; +import { TextBasedLayer } from '../types'; export type TextBasedDimensionEditorProps = DatasourceDimensionEditorProps<TextBasedPrivateState> & { @@ -24,6 +32,17 @@ export type TextBasedDimensionEditorProps = export function TextBasedDimensionEditor(props: TextBasedDimensionEditorProps) { const [allColumns, setAllColumns] = useState<FieldOptionCompatible[]>([]); const query = props.state.layers[props.layerId]?.query; + const { euiTheme } = useEuiTheme(); + const { + isFullscreen, + columnId, + layerId, + state, + setState, + indexPatterns, + dateRange, + expressions, + } = props; useEffect(() => { // in case the columns are not in the cache, I refetch them @@ -31,7 +50,12 @@ export function TextBasedDimensionEditor(props: TextBasedDimensionEditorProps) { if (query) { const table = await fetchFieldsFromESQL( { esql: `${query.esql} | limit 0` }, - props.expressions + expressions, + { from: dateRange.fromDate, to: dateRange.toDate }, + undefined, + Object.values(indexPatterns).length + ? Object.values(indexPatterns)[0].timeFieldName + : undefined ); if (table) { const hasNumberTypeColumns = table.columns?.some(isNumeric); @@ -55,13 +79,40 @@ export function TextBasedDimensionEditor(props: TextBasedDimensionEditorProps) { } } fetchColumns(); - }, [props, props.expressions, query]); + }, [ + dateRange.fromDate, + dateRange.toDate, + expressions, + indexPatterns, + props, + props.expressions, + query, + ]); const selectedField = useMemo(() => { const layerColumns = props.state.layers[props.layerId].columns; return layerColumns?.find((column) => column.columnId === props.columnId); }, [props.columnId, props.layerId, props.state.layers]); + const updateLayer = useCallback( + (newLayer: Partial<TextBasedLayer>) => + setState((prevState) => mergeLayer({ state: prevState, layerId, newLayer })), + [layerId, setState] + ); + + const onFormatChange = useCallback<FormatSelectorProps['onChange']>( + (newFormat) => { + updateLayer( + updateColumnFormat({ + layer: state.layers[layerId], + columnId, + value: newFormat, + }) + ); + }, + [columnId, layerId, state.layers, updateLayer] + ); + return ( <> <EuiFormRow @@ -80,6 +131,7 @@ export function TextBasedDimensionEditor(props: TextBasedDimensionEditorProps) { const newColumn = { columnId: props.columnId, fieldName: choice.field, + label: choice.field, meta, }; return props.setState( @@ -122,6 +174,44 @@ export function TextBasedDimensionEditor(props: TextBasedDimensionEditorProps) { {props.dataSectionExtra} </div> )} + {!isFullscreen && selectedField && ( + <div className="lnsIndexPatternDimensionEditor--padded lnsIndexPatternDimensionEditor--collapseNext"> + <EuiText + size="s" + css={css` + margin-bottom: ${euiTheme.size.base}; + `} + > + <h4> + {i18n.translate('xpack.lens.indexPattern.dimensionEditor.headingAppearance', { + defaultMessage: 'Appearance', + })} + </h4> + </EuiText> + + <NameInput + value={selectedField.label || ''} + defaultValue={''} + onChange={(value) => { + updateLayer( + updateColumnLabel({ + layer: state.layers[layerId], + columnId, + value, + }) + ); + }} + /> + + {selectedField.meta?.type === 'number' ? ( + <FormatSelector + selectedColumn={selectedField} + onChange={onFormatChange} + docLinks={props.core.docLinks} + /> + ) : null} + </div> + )} </> ); } diff --git a/x-pack/plugins/lens/public/datasources/text_based/fetch_data_from_aggregate_query.ts b/x-pack/plugins/lens/public/datasources/text_based/fetch_data_from_aggregate_query.ts index 84fc5bbd950d..779541f95a9c 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/fetch_data_from_aggregate_query.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/fetch_data_from_aggregate_query.ts @@ -33,7 +33,7 @@ export function fetchDataFromAggregateQuery( filters, query, time: timeRange, - dataView, + timeFieldName: dataView.timeFieldName, inputQuery, }) .then((ast) => { diff --git a/x-pack/plugins/lens/public/datasources/text_based/to_expression.ts b/x-pack/plugins/lens/public/datasources/text_based/to_expression.ts index a175f191d591..d1ef206ad5b5 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/to_expression.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/to_expression.ts @@ -8,8 +8,9 @@ import { i18n } from '@kbn/i18n'; import { Ast } from '@kbn/interpreter'; import { textBasedQueryStateToExpressionAst } from '@kbn/data-plugin/common'; -import type { OriginalColumn } from '../../../common/types'; +import { ExpressionAstFunction } from '@kbn/expressions-plugin/common'; import { TextBasedPrivateState, TextBasedLayer, IndexPatternRef } from './types'; +import type { OriginalColumn } from '../../../common/types'; function getExpressionForLayer( layer: TextBasedLayer, @@ -25,7 +26,7 @@ function getExpressionForLayer( if (idMapper[col.fieldName]) { idMapper[col.fieldName].push({ id: col.columnId, - label: col.fieldName, + label: col.customLabel ? col.label : col.fieldName, } as OriginalColumn); } else { idMapper = { @@ -33,7 +34,7 @@ function getExpressionForLayer( [col.fieldName]: [ { id: col.columnId, - label: col.fieldName, + label: col.customLabel ? col.label : col.fieldName, } as OriginalColumn, ], }; @@ -41,6 +42,45 @@ function getExpressionForLayer( }); const timeFieldName = layer.timeField ?? undefined; + const formatterOverrides: ExpressionAstFunction[] = layer.columns + .filter((col) => col.params?.format) + .map((col) => { + const format = col.params!.format!; + + const base: ExpressionAstFunction = { + type: 'function', + function: 'lens_format_column', + arguments: { + format: format ? [format.id] : [''], + columnId: [col.columnId], + decimals: typeof format?.params?.decimals === 'number' ? [format.params.decimals] : [], + suffix: + format?.params && 'suffix' in format.params && format.params.suffix + ? [format.params.suffix] + : [], + compact: + format?.params && 'compact' in format.params && format.params.compact + ? [format.params.compact] + : [], + pattern: + format?.params && 'pattern' in format.params && format.params.pattern + ? [format.params.pattern] + : [], + fromUnit: + format?.params && 'fromUnit' in format.params && format.params.fromUnit + ? [format.params.fromUnit] + : [], + toUnit: + format?.params && 'toUnit' in format.params && format.params.toUnit + ? [format.params.toUnit] + : [], + parentFormat: [], + }, + }; + + return base; + }); + if (!layer.table) { const textBasedQueryToAst = textBasedQueryStateToExpressionAst({ query: layer.query, @@ -62,6 +102,7 @@ function getExpressionForLayer( isTextBased: [true], }, }); + textBasedQueryToAst.chain.push(...formatterOverrides); return textBasedQueryToAst; } else { return { @@ -81,6 +122,7 @@ function getExpressionForLayer( idMap: [JSON.stringify(idMapper)], }, }, + ...formatterOverrides, ], }; } diff --git a/x-pack/plugins/lens/public/datasources/text_based/types.ts b/x-pack/plugins/lens/public/datasources/text_based/types.ts index cd4568101a60..4516a4e46a41 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/types.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/types.ts @@ -7,11 +7,17 @@ import type { Datatable, DatatableColumn } from '@kbn/expressions-plugin/public'; import type { AggregateQuery } from '@kbn/es-query'; import type { VisualizeFieldContext } from '@kbn/ui-actions-plugin/public'; +import { ValueFormatConfig } from '../form_based/operations/definitions/column_types'; import type { VisualizeEditorContext } from '../../types'; export interface TextBasedLayerColumn { columnId: string; fieldName: string; + label?: string; + customLabel?: boolean; + params?: { + format?: ValueFormatConfig; + }; meta?: DatatableColumn['meta']; inMetricDimension?: boolean; } diff --git a/x-pack/plugins/lens/public/datasources/text_based/utils.test.ts b/x-pack/plugins/lens/public/datasources/text_based/utils.test.ts index 77853e3052b2..72ee6869e811 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/utils.test.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/utils.test.ts @@ -129,6 +129,7 @@ describe('Text based languages utils', () => { { fieldName: 'timestamp', columnId: 'timestamp', + label: 'timestamp', meta: { type: 'date', }, @@ -136,6 +137,7 @@ describe('Text based languages utils', () => { { fieldName: 'memory', columnId: 'memory', + label: 'memory', meta: { type: 'number', }, diff --git a/x-pack/plugins/lens/public/datasources/text_based/utils.ts b/x-pack/plugins/lens/public/datasources/text_based/utils.ts index 79e3a15e78a5..ec8b1cc7645e 100644 --- a/x-pack/plugins/lens/public/datasources/text_based/utils.ts +++ b/x-pack/plugins/lens/public/datasources/text_based/utils.ts @@ -11,9 +11,15 @@ import { getESQLAdHocDataview } from '@kbn/esql-utils'; import type { AggregateQuery } from '@kbn/es-query'; import { getIndexPatternFromESQLQuery } from '@kbn/esql-utils'; import type { DatatableColumn } from '@kbn/expressions-plugin/public'; +import { ValueFormatConfig } from '../form_based/operations/definitions/column_types'; import { generateId } from '../../id_generator'; import { fetchDataFromAggregateQuery } from './fetch_data_from_aggregate_query'; -import type { IndexPatternRef, TextBasedPrivateState, TextBasedLayerColumn } from './types'; +import type { + IndexPatternRef, + TextBasedPrivateState, + TextBasedLayerColumn, + TextBasedLayer, +} from './types'; import type { DataViewsState } from '../../state_management'; import { addColumnsToCache } from './fieldlist_cache'; @@ -46,7 +52,12 @@ export const getAllColumns = ( }); const allCols = [ ...columns, - ...columnsFromQuery.map((c) => ({ columnId: c.id, fieldName: c.id, meta: c.meta })), + ...columnsFromQuery.map((c) => ({ + columnId: c.id, + fieldName: c.id, + label: c.name, + meta: c.meta, + })), ]; const uniqueIds: string[] = []; @@ -154,3 +165,70 @@ export function canColumnBeUsedBeInMetricDimension( (hasNumberTypeColumns && selectedColumnType === 'number') ); } + +export function mergeLayer({ + state, + layerId, + newLayer, +}: { + state: TextBasedPrivateState; + layerId: string; + newLayer: Partial<TextBasedLayer>; +}) { + return { + ...state, + layers: { + ...state.layers, + [layerId]: { ...state.layers[layerId], ...newLayer }, + }, + }; +} + +export function updateColumnLabel({ + layer, + columnId, + value, +}: { + layer: TextBasedLayer; + columnId: string; + value: string; +}): TextBasedLayer { + const currentColumnIndex = layer.columns.findIndex((c) => c.columnId === columnId); + const currentColumn = layer.columns[currentColumnIndex]; + return { + ...layer, + columns: [ + ...layer.columns.slice(0, currentColumnIndex), + { + ...currentColumn, + label: value, + customLabel: !!value, + }, + ...layer.columns.slice(currentColumnIndex + 1), + ], + }; +} + +export function updateColumnFormat({ + layer, + columnId, + value, +}: { + layer: TextBasedLayer; + columnId: string; + value: ValueFormatConfig | undefined; +}): TextBasedLayer { + const currentColumnIndex = layer.columns.findIndex((c) => c.columnId === columnId); + const currentColumn = layer.columns[currentColumnIndex]; + return { + ...layer, + columns: [ + ...layer.columns.slice(0, currentColumnIndex), + { + ...currentColumn, + params: { format: value }, + }, + ...layer.columns.slice(currentColumnIndex + 1), + ], + }; +} diff --git a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx index 2ab2c8e78890..9140c90f67d6 100644 --- a/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx +++ b/x-pack/plugins/lens/public/editor_frame_service/editor_frame/config_panel/layer_actions/layer_actions.tsx @@ -59,7 +59,7 @@ export const getSharedActions = ({ isTextBasedLanguage?: boolean; hasLayerSettings: boolean; openLayerSettings: () => void; - core: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme'>; + core: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'userProfile'>; customRemoveModalText?: { title?: string; description?: string }; }) => [ getOpenLayerSettingsAction({ diff --git a/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.test.ts b/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.test.ts index 8719c54f6f1d..d677e052ae45 100644 --- a/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.test.ts +++ b/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.test.ts @@ -8,11 +8,10 @@ import { getColorMappingTelemetryEvents } from './color_telemetry_helpers'; import { ColorMapping, - EUIAmsterdamColorBlindPalette, - ElasticBrandPalette, DEFAULT_COLOR_MAPPING_CONFIG, DEFAULT_OTHER_ASSIGNMENT_INDEX, } from '@kbn/coloring'; +import { KbnPalette } from '@kbn/palettes'; import { faker } from '@faker-js/faker'; const exampleAssignment = ( @@ -24,7 +23,7 @@ const exampleAssignment = ( type === 'categorical' ? { type: 'categorical', - paletteId: ElasticBrandPalette.id, + paletteId: KbnPalette.ElasticClassic, colorIndex: 0, } : { @@ -57,13 +56,13 @@ const MANUAL_COLOR_MAPPING_CONFIG: ColorMapping.Config = { }, color: { type: 'categorical', - paletteId: ElasticBrandPalette.id, + paletteId: KbnPalette.ElasticClassic, colorIndex: 2, }, touched: true, }, ], - paletteId: ElasticBrandPalette.id, + paletteId: KbnPalette.ElasticClassic, colorMode: { type: 'categorical', }, @@ -74,7 +73,7 @@ const specialAssignmentsPalette: ColorMapping.Config['specialAssignments'] = [ ...DEFAULT_COLOR_MAPPING_CONFIG.specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX], color: { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Kibana7, colorIndex: 0, }, }, @@ -112,7 +111,7 @@ describe('color_telemetry_helpers', () => { }); it('settings (default): unassigned terms loop, default palette returns correct events', () => { expect(getColorMappingTelemetryEvents(DEFAULT_COLOR_MAPPING_CONFIG)).toEqual([ - 'color_mapping_palette_eui_amsterdam_color_blind', + 'color_mapping_palette_default', 'color_mapping_unassigned_terms_loop', ]); }); @@ -126,7 +125,7 @@ describe('color_telemetry_helpers', () => { steps: [ { type: 'categorical', - paletteId: EUIAmsterdamColorBlindPalette.id, + paletteId: KbnPalette.Kibana7, colorIndex: 0, touched: false, }, diff --git a/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.ts b/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.ts index 049caea8fb12..4f956e54c47f 100644 --- a/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.ts +++ b/x-pack/plugins/lens/public/lens_ui_telemetry/color_telemetry_helpers.ts @@ -5,8 +5,9 @@ * 2.0. */ -import { ColorMapping, NeutralPalette, DEFAULT_OTHER_ASSIGNMENT_INDEX } from '@kbn/coloring'; +import { ColorMapping, DEFAULT_OTHER_ASSIGNMENT_INDEX } from '@kbn/coloring'; import { isEqual } from 'lodash'; +import { KbnPalette } from '@kbn/palettes'; import { nonNullable } from '../utils'; const COLOR_MAPPING_PREFIX = 'color_mapping_'; @@ -83,8 +84,8 @@ const getUnassignedTermsType = ( : specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX]?.color.type === 'loop' ? 'loop' : specialAssignments[DEFAULT_OTHER_ASSIGNMENT_INDEX]?.color.paletteId === - NeutralPalette.id - ? NeutralPalette.id + KbnPalette.Neutral + ? KbnPalette.Neutral : 'palette' }` : undefined; diff --git a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts index 64b7ca4501b0..ac69b79b4223 100644 --- a/x-pack/plugins/lens/public/react_embeddable/data_loader.ts +++ b/x-pack/plugins/lens/public/react_embeddable/data_loader.ts @@ -6,8 +6,7 @@ */ import type { DefaultInspectorAdapters } from '@kbn/expressions-plugin/common'; -import { fetch$, type FetchContext } from '@kbn/presentation-publishing'; -import { apiPublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; +import { apiPublishesUnifiedSearch, fetch$ } from '@kbn/presentation-publishing'; import { type KibanaExecutionContext } from '@kbn/core/public'; import { BehaviorSubject, @@ -21,6 +20,7 @@ import { map, } from 'rxjs'; import fastIsEqual from 'fast-deep-equal'; +import { pick } from 'lodash'; import { getEditPath } from '../../common/constants'; import type { GetStateType, @@ -54,6 +54,24 @@ type ReloadReason = | 'viewMode' | 'searchContext'; +function getSearchContext(parentApi: unknown) { + const unifiedSearch$ = apiPublishesUnifiedSearch(parentApi) + ? pick(parentApi, 'filters$', 'query$', 'timeslice$', 'timeRange$') + : { + filters$: new BehaviorSubject(undefined), + query$: new BehaviorSubject(undefined), + timeslice$: new BehaviorSubject(undefined), + timeRange$: new BehaviorSubject(undefined), + }; + + return { + filters: unifiedSearch$.filters$.getValue(), + query: unifiedSearch$.query$.getValue(), + timeRange: unifiedSearch$.timeRange$.getValue(), + timeslice: unifiedSearch$.timeslice$?.getValue(), + }; +} + /** * The function computes the expression used to render the panel and produces the necessary props * for the ExpressionWrapper component, binding any outer context to them. @@ -112,16 +130,6 @@ export function loadEmbeddableData( } }; - const unifiedSearch$ = new BehaviorSubject< - Pick<FetchContext, 'query' | 'filters' | 'timeRange' | 'timeslice' | 'searchSessionId'> - >({ - query: undefined, - filters: undefined, - timeRange: undefined, - timeslice: undefined, - searchSessionId: undefined, - }); - async function reload( // make reload easier to debug sourceId: ReloadReason @@ -142,8 +150,6 @@ export function loadEmbeddableData( const currentState = getState(); - const { searchSessionId, ...unifiedSearch } = unifiedSearch$.getValue(); - const getExecutionContext = () => { const parentContext = getParentContext(parentApi); const lastState = getState(); @@ -198,7 +204,7 @@ export function loadEmbeddableData( const searchContext = getMergedSearchContext( currentState, - unifiedSearch, + getSearchContext(parentApi), api.timeRange$, parentApi, services @@ -216,7 +222,7 @@ export function loadEmbeddableData( }, renderMode: getRenderMode(parentApi), services, - searchSessionId, + searchSessionId: api.searchSessionId$.getValue(), abortController: internalApi.expressionAbortController$.getValue(), getExecutionContext, logError: getLogError(getExecutionContext), @@ -259,20 +265,8 @@ export function loadEmbeddableData( } const mergedSubscriptions = merge( - // on data change from the parentApi, reload - fetch$(api).pipe( - tap((data) => { - const searchSessionId = apiPublishesSearchSession(parentApi) ? data.searchSessionId : ''; - unifiedSearch$.next({ - query: data.query, - filters: data.filters, - timeRange: data.timeRange, - timeslice: data.timeslice, - searchSessionId, - }); - }), - map(() => 'searchContext' as ReloadReason) - ), + // on search context change, reload + fetch$(api).pipe(map(() => 'searchContext' as ReloadReason)), // On state change, reload // this is used to refresh the chart on inline editing // just make sure to avoid to rerender if there's no substantial change diff --git a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx index ca8f489a711a..30a0920f9557 100644 --- a/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/mocks/index.tsx @@ -116,6 +116,7 @@ const LensApiMock: LensApi = { disabledActionIds: new BehaviorSubject<string[] | undefined>(undefined), setDisabledActionIds: jest.fn(), rendered$: new BehaviorSubject<boolean>(false), + searchSessionId$: new BehaviorSubject<string | undefined>(undefined), }; const LensSerializedStateMock: LensSerializedState = createEmptyLensState( diff --git a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx index 5bc55d43c321..70d59fc7486b 100644 --- a/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx +++ b/x-pack/plugins/lens/public/react_embeddable/renderer/lens_custom_renderer_component.tsx @@ -59,6 +59,8 @@ export function LensRenderer({ filters, timeRange, disabledActions, + searchSessionId, + hidePanelTitles, ...props }: LensRendererProps) { // Use the settings interface to store panel settings @@ -71,6 +73,8 @@ export function LensRenderer({ }, []); const disabledActionIds$ = useObservableVariable(disabledActions); const viewMode$ = useObservableVariable(viewMode); + const searchSessionId$ = useObservableVariable(searchSessionId); + const hidePanelTitles$ = useObservableVariable(hidePanelTitles); // Lens API will be set once, but when set trigger a reflow to adopt the latest attributes const [lensApi, setLensApi] = useState<LensApi | undefined>(undefined); @@ -112,7 +116,6 @@ export function LensRenderer({ const panelProps: PanelProps = useMemo(() => { return { hideInspector: !showInspector, - hideHeader: showPanelChrome, showNotifications: false, showShadow: false, showBadges: false, @@ -124,7 +127,7 @@ export function LensRenderer({ return (extraActions ?? []).concat(actions || []); }, }; - }, [showInspector, showPanelChrome, withDefaultActions, extraActions, lensApi]); + }, [showInspector, withDefaultActions, extraActions, lensApi]); return ( <ReactEmbeddableRenderer<LensSerializedState, LensRuntimeState, LensApi> @@ -135,6 +138,7 @@ export function LensRenderer({ ...props, // forward the unified search context ...searchApi, + searchSessionId$, disabledActionIds: disabledActionIds$, setDisabledActionIds: (ids: string[] | undefined) => disabledActionIds$.next(ids), viewMode: viewMode$, @@ -147,6 +151,7 @@ export function LensRenderer({ ...initialStateRef.current, attributes: props.attributes, }), + hidePanelTitle: hidePanelTitles$, })} onApiAvailable={setLensApi} hidePanelChrome={!showPanelChrome} diff --git a/x-pack/plugins/lens/public/react_embeddable/types.ts b/x-pack/plugins/lens/public/react_embeddable/types.ts index c860c543570c..1a4bf45b11f1 100644 --- a/x-pack/plugins/lens/public/react_embeddable/types.ts +++ b/x-pack/plugins/lens/public/react_embeddable/types.ts @@ -65,6 +65,7 @@ import type { AllowedPartitionOverrides } from '@kbn/expression-partition-vis-pl import type { AllowedXYOverrides } from '@kbn/expression-xy-plugin/common'; import type { Action } from '@kbn/ui-actions-plugin/public'; import { PresentationContainer } from '@kbn/presentation-containers'; +import { PublishesSearchSession } from '@kbn/presentation-publishing/interfaces/fetch/publishes_search_session'; import type { LegacyMetricState } from '../../common'; import type { LensDocument } from '../persistence'; import type { LensInspector } from '../lens_inspector_service'; @@ -364,6 +365,8 @@ export type LensApi = Simplify< PublishesBlockingError & // This is used by dashboard/container to show filters/queries on the panel PublishesUnifiedSearch & + // Forward the search session id + PublishesSearchSession & // Let the container know the loading state PublishesDataLoading & // Let the container know when the rendering has completed rendering diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.test.ts b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.test.ts index 139c6ced456b..6ddbaff8d7b6 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.test.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { getKbnPalettes } from '@kbn/palettes'; import { getColorAccessorFn } from './color_mapping_accessor'; jest.mock('@kbn/coloring', () => ({ @@ -15,8 +16,10 @@ jest.mock('@kbn/coloring', () => ({ })); describe('getColorAccessorFn', () => { + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + // eslint-disable-next-line @typescript-eslint/no-explicit-any - const getColorAccessor = getColorAccessorFn('{}', {} as any, false); + const getColorAccessor = getColorAccessorFn(palettes, '{}', {} as any, false); it('should return null for null values', () => { expect(getColorAccessor(null)).toBe(null); diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.ts b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.ts index 116b21bb2245..7e3d076744d6 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_accessor.ts @@ -5,29 +5,20 @@ * 2.0. */ -import { - AVAILABLE_PALETTES, - getColorFactory, - getPalette, - NeutralPalette, - ColorMappingInputCategoricalData, -} from '@kbn/coloring'; +import { getColorFactory, ColorMappingInputCategoricalData } from '@kbn/coloring'; +import { KbnPalettes } from '@kbn/palettes'; import { CellColorFn } from './get_cell_color_fn'; /** * Return a color accessor function for XY charts depending on the split accessors received. */ export function getColorAccessorFn( + palettes: KbnPalettes, colorMapping: string, data: ColorMappingInputCategoricalData, isDarkMode: boolean ): CellColorFn { - const getColor = getColorFactory( - JSON.parse(colorMapping), - getPalette(AVAILABLE_PALETTES, NeutralPalette), - isDarkMode, - data - ); + const getColor = getColorFactory(JSON.parse(colorMapping), palettes, isDarkMode, data); return (value) => { if (value === undefined || value === null) return null; diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_terms.tsx b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_terms.tsx index 1eec5a409327..ffc23d68bc54 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_terms.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_terms.tsx @@ -21,21 +21,22 @@ import { DEFAULT_COLOR_MAPPING_CONFIG, CategoricalColorMapping, SPECIAL_TOKENS_STRING_CONVERSION, - AVAILABLE_PALETTES, PaletteOutput, PaletteRegistry, CustomPaletteParams, } from '@kbn/coloring'; import { i18n } from '@kbn/i18n'; +import { KbnPalettes } from '@kbn/palettes'; import { trackUiCounterEvents } from '../../lens_ui_telemetry'; import { PalettePicker } from '../palette_picker'; import { PalettePanelContainer } from './palette_panel_container'; -import { getColorStops } from './utils'; +import { getPaletteDisplayColors } from './utils'; interface ColorMappingByTermsProps { isDarkMode: boolean; colorMapping?: ColorMapping.Config; palette?: PaletteOutput<CustomPaletteParams>; + palettes: KbnPalettes; isInlineEditing?: boolean; setPalette: (palette: PaletteOutput) => void; setColorMapping: (colorMapping?: ColorMapping.Config) => void; @@ -48,6 +49,7 @@ export function ColorMappingByTerms({ isDarkMode, colorMapping, palette, + palettes, isInlineEditing, setPalette, setColorMapping, @@ -67,7 +69,13 @@ export function ColorMappingByTerms({ fullWidth > <PalettePanelContainer - palette={getColorStops(paletteService, isDarkMode, palette, colorMapping)} + palette={getPaletteDisplayColors( + paletteService, + palettes, + isDarkMode, + palette, + colorMapping + )} siblingRef={panelRef} title={ useNewColorMapping @@ -119,7 +127,7 @@ export function ColorMappingByTerms({ model={colorMapping ?? { ...DEFAULT_COLOR_MAPPING_CONFIG }} onModelUpdate={setColorMapping} specialTokens={SPECIAL_TOKENS_STRING_CONVERSION} - palettes={AVAILABLE_PALETTES} + palettes={palettes} data={{ type: 'categories', categories, diff --git a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_values.tsx b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_values.tsx index 9e18f6ae149a..d59906220479 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_values.tsx +++ b/x-pack/plugins/lens/public/shared_components/coloring/color_mapping_by_values.tsx @@ -24,7 +24,7 @@ interface ColorMappingByValuesProps { setPalette: (palette: PaletteOutput<CustomPaletteParams>) => void; paletteService: PaletteRegistry; panelRef: MutableRefObject<HTMLDivElement | null>; - dataBounds?: DataBounds; + dataBounds: DataBounds; } export function ColorMappingByValues<T>({ diff --git a/x-pack/plugins/lens/public/shared_components/coloring/get_cell_color_fn.ts b/x-pack/plugins/lens/public/shared_components/coloring/get_cell_color_fn.ts index bb7e25220f79..f2db77f41b10 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/get_cell_color_fn.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/get_cell_color_fn.ts @@ -12,12 +12,14 @@ import { getSpecialString, } from '@kbn/coloring'; import { CustomPaletteState } from '@kbn/charts-plugin/common'; +import { KbnPalettes } from '@kbn/palettes'; import { getColorAccessorFn } from './color_mapping_accessor'; export type CellColorFn = (value?: number | string | null) => string | null; export function getCellColorFn( paletteService: PaletteRegistry, + palettes: KbnPalettes, data: ColorMappingInputData, colorByTerms: boolean, isDarkMode: boolean, @@ -37,7 +39,7 @@ export function getCellColorFn( if (colorByTerms && data.type === 'categories') { if (colorMapping) { - return getColorAccessorFn(colorMapping, data, isDarkMode); + return getColorAccessorFn(palettes, colorMapping, data, isDarkMode); } else if (palette) { return (category) => { if (category === undefined || category === null) return null; diff --git a/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts b/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts index cc6044fc0f62..27f17f3c72c6 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/utils.test.ts @@ -5,53 +5,7 @@ * 2.0. */ -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { - applyPaletteParams, - findMinMaxByColumnId, - getContrastColor, - shouldColorByTerms, -} from './utils'; - -describe('applyPaletteParams', () => { - const paletteRegistry = chartPluginMock.createPaletteRegistry(); - it('should return a palette stops array only by the name', () => { - expect( - applyPaletteParams( - paletteRegistry, - { name: 'default', type: 'palette', params: { name: 'default' } }, - { min: 0, max: 100 } - ) - ).toEqual([ - // stops are 0 and 50 by with a 20 offset (100 divided by 5 steps) for display - // the mock palette service has only 2 colors so tests are a bit off by that - { color: 'red', stop: 20 }, - { color: 'black', stop: 70 }, - ]); - }); - - it('should return a palette stops array reversed', () => { - expect( - applyPaletteParams( - paletteRegistry, - { name: 'default', type: 'palette', params: { name: 'default', reverse: true } }, - { min: 0, max: 100 } - ) - ).toEqual([ - { color: 'black', stop: 20 }, - { color: 'red', stop: 70 }, - ]); - }); - - it('should pick the default palette from the activePalette object when passed', () => { - expect( - applyPaletteParams(paletteRegistry, { name: 'mocked', type: 'palette' }, { min: 0, max: 100 }) - ).toEqual([ - { color: 'blue', stop: 20 }, - { color: 'yellow', stop: 70 }, - ]); - }); -}); +import { findMinMaxByColumnId, getContrastColor, shouldColorByTerms } from './utils'; describe('getContrastColor', () => { it('should pick the light color when the passed one is dark', () => { diff --git a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts index ae797c1daa6c..711342c8e5d6 100644 --- a/x-pack/plugins/lens/public/shared_components/coloring/utils.ts +++ b/x-pack/plugins/lens/public/shared_components/coloring/utils.ts @@ -23,24 +23,26 @@ import { } from '@kbn/coloring'; import { getOriginalId } from '@kbn/transpose-utils'; import { Datatable, DatatableColumnType } from '@kbn/expressions-plugin/common'; +import { KbnPalettes } from '@kbn/palettes'; import { DataType } from '../../types'; /** * Returns array of colors for provided palette or colorMapping */ -export function getColorStops( +export function getPaletteDisplayColors( paletteService: PaletteRegistry, + palettes: KbnPalettes, isDarkMode: boolean, palette?: PaletteOutput<CustomPaletteParams>, colorMapping?: ColorMapping.Config ): string[] { return colorMapping - ? getColorsFromMapping(isDarkMode, colorMapping) + ? getColorsFromMapping(palettes, isDarkMode, colorMapping) : palette?.name === CUSTOM_PALETTE ? palette?.params?.stops?.map(({ color }) => color) ?? [] : paletteService .get(palette?.name || DEFAULT_FALLBACK_PALETTE) - .getCategoricalColors(10, palette); + .getCategoricalColors(palette?.params?.steps || 10, palette); } /** diff --git a/x-pack/plugins/lens/public/types.ts b/x-pack/plugins/lens/public/types.ts index d6dbccc492a6..f6d4edc02e16 100644 --- a/x-pack/plugins/lens/public/types.ts +++ b/x-pack/plugins/lens/public/types.ts @@ -73,6 +73,7 @@ export type StartServices = Pick< | 'analytics' | 'i18n' | 'theme' + | 'userProfile' >; export interface IndexPatternRef { @@ -662,6 +663,7 @@ export type DatasourceDimensionEditorProps<T = unknown> = DatasourceDimensionPro | 'analytics' | 'i18n' | 'theme' + | 'userProfile' | 'docLinks' >; dateRange: DateRange; diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.test.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.test.tsx index 738f7edab2a6..ee8566df52ff 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.test.tsx @@ -20,6 +20,7 @@ import { ColumnState } from '../../../../common/expressions'; import { capitalize } from 'lodash'; import { I18nProvider } from '@kbn/i18n-react'; import { DatatableColumnType } from '@kbn/expressions-plugin/common'; +import { getKbnPalettes } from '@kbn/palettes'; describe('data table dimension editor', () => { let user: UserEvent; @@ -89,6 +90,7 @@ describe('data table dimension editor', () => { setState: jest.fn(), isDarkMode: false, paletteService: chartPluginMock.createPaletteRegistry(), + palettes: getKbnPalettes({ name: 'amsterdam', darkMode: false }), panelRef: React.createRef(), addLayer: jest.fn(), removeLayer: jest.fn(), diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx index c67cf3cdb9b1..90c644555d6f 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/dimension_editor.tsx @@ -8,15 +8,22 @@ import React, { useCallback } from 'react'; import { i18n } from '@kbn/i18n'; import { EuiFormRow, EuiSwitch, EuiButtonGroup, htmlIdGenerator } from '@elastic/eui'; -import { PaletteRegistry, getFallbackDataBounds } from '@kbn/coloring'; +import { + CUSTOM_PALETTE, + CustomPaletteParams, + PaletteOutput, + PaletteRegistry, + applyPaletteParams, + getFallbackDataBounds, +} from '@kbn/coloring'; import { getColorCategories } from '@kbn/chart-expressions-common'; import { useDebouncedValue } from '@kbn/visualization-utils'; import { getOriginalId } from '@kbn/transpose-utils'; +import { KbnPalettes } from '@kbn/palettes'; import type { VisualizationDimensionEditorProps } from '../../../types'; import type { DatatableVisualizationState } from '../visualization'; import { - applyPaletteParams, defaultPaletteParams, findMinMaxByColumnId, shouldColorByTerms, @@ -54,6 +61,7 @@ function updateColumn( export type TableDimensionEditorProps = VisualizationDimensionEditorProps<DatatableVisualizationState> & { paletteService: PaletteRegistry; + palettes: KbnPalettes; isDarkMode: boolean; }; @@ -99,14 +107,24 @@ export function TableDimensionEditor(props: TableDimensionEditorProps) { const minMaxByColumnId = findMinMaxByColumnId(columnsToCheck, currentData); const currentMinMax = minMaxByColumnId.get(accessor) ?? getFallbackDataBounds(); - const activePalette = column?.palette ?? { + const activePalette: PaletteOutput<CustomPaletteParams> = { type: 'palette', name: showColorByTerms ? 'default' : defaultPaletteParams.name, + ...column?.palette, + params: { ...column?.palette?.params }, }; // need to tell the helper that the colorStops are required to display const displayStops = applyPaletteParams(props.paletteService, activePalette, currentMinMax); const categories = getColorCategories(currentData?.rows ?? [], accessor, false, [null]); + if (activePalette.name !== CUSTOM_PALETTE && activePalette.params?.stops) { + activePalette.params.stops = applyPaletteParams( + props.paletteService, + activePalette, + currentMinMax + ); + } + return ( <> <EuiFormRow @@ -225,6 +243,7 @@ export function TableDimensionEditor(props: TableDimensionEditorProps) { isDarkMode={isDarkMode} colorMapping={column.colorMapping} palette={activePalette} + palettes={props.palettes} isInlineEditing={isInlineEditing} setPalette={(palette) => { updateColumnState(accessor, { palette }); diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx index f30686a44a6a..dc6f818eb351 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.tsx @@ -33,6 +33,8 @@ import { IconChartDatatable } from '@kbn/chart-icons'; import useObservable from 'react-use/lib/useObservable'; import { getColorCategories } from '@kbn/chart-expressions-common'; import { getOriginalId, isTransposeId } from '@kbn/transpose-utils'; +import { CoreTheme } from '@kbn/core/public'; +import { getKbnPalettes } from '@kbn/palettes'; import type { LensTableRowContextMenuEvent } from '../../../types'; import type { FormatFactory } from '../../../../common/types'; import { RowHeightMode } from '../../../../common/types'; @@ -81,10 +83,11 @@ export const DatatableComponent = (props: DatatableRenderProps) => { const dataGridRef = useRef<EuiDataGridRefProps>(null); const isInteractive = props.interactive; - const isDarkMode = useObservable(props.theme.theme$, { + const theme = useObservable<CoreTheme>(props.theme.theme$, { darkMode: false, name: 'amsterdam', - }).darkMode; + }); + const palettes = getKbnPalettes(theme); const [columnConfig, setColumnConfig] = useState({ columns: props.args.columns, @@ -420,9 +423,10 @@ export const DatatableComponent = (props: DatatableRenderProps) => { }; const colorFn = getCellColorFn( props.paletteService, + palettes, data, colorByTerms, - isDarkMode, + theme.darkMode, syncColors, palette, colorMapping @@ -436,16 +440,17 @@ export const DatatableComponent = (props: DatatableRenderProps) => { formatters, columnConfig, DataContext, - isDarkMode, + theme.darkMode, getCellColor, props.args.fitRowToContent ); }, [ formatters, columnConfig, - isDarkMode, + theme.darkMode, props.args.fitRowToContent, props.paletteService, + palettes, firstLocalTable, bucketedColumns, minMaxByColumnId, diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx index 9a94e458c667..218aa875a375 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.test.tsx @@ -27,13 +27,13 @@ import { DatatableColumnFn, DatatableExpressionFunction, } from '../../../common/expressions'; -import { getColorStops } from '../../shared_components/coloring'; +import { getPaletteDisplayColors } from '../../shared_components/coloring'; import { fieldFormatsServiceMock } from '@kbn/field-formats-plugin/public/mocks'; jest.mock('../../shared_components/coloring', () => { return { ...jest.requireActual('../../shared_components/coloring'), - getColorStops: jest.fn().mockReturnValue([]), + getPaletteDisplayColors: jest.fn().mockReturnValue([]), }; }); @@ -438,7 +438,7 @@ describe('Datatable Visualization', () => { let params: VisualizationConfigProps<DatatableVisualizationState>; beforeEach(() => { - (getColorStops as jest.Mock).mockReturnValue(mockStops); + (getPaletteDisplayColors as jest.Mock).mockReturnValue(mockStops); }); describe('rows', () => { @@ -483,7 +483,7 @@ describe('Datatable Visualization', () => { it.each<ColumnState['colorMode']>(['cell', 'text'])( 'should not include palette if colorMode is %s but stops is empty', (colorMode) => { - (getColorStops as jest.Mock).mockReturnValue([]); + (getPaletteDisplayColors as jest.Mock).mockReturnValue([]); params.state.columns[0].colorMode = colorMode; expect(datatableVisualization.getConfiguration(params).groups[0].accessors).toEqual([ { columnId: 'b' }, @@ -532,7 +532,7 @@ describe('Datatable Visualization', () => { it.each<ColumnState['colorMode']>(['cell', 'text'])( 'should not include palette if colorMode is %s but stops is empty', (colorMode) => { - (getColorStops as jest.Mock).mockReturnValue([]); + (getPaletteDisplayColors as jest.Mock).mockReturnValue([]); params.state.columns[0].colorMode = colorMode; expect(datatableVisualization.getConfiguration(params).groups[2].accessors).toEqual([ { columnId: 'b' }, diff --git a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx index efe5a39458ee..23d8d432ce2d 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/visualization.tsx @@ -8,8 +8,15 @@ import React from 'react'; import { Ast } from '@kbn/interpreter'; import { i18n } from '@kbn/i18n'; -import { PaletteRegistry, CUSTOM_PALETTE, PaletteOutput, CustomPaletteParams } from '@kbn/coloring'; -import { ThemeServiceStart } from '@kbn/core/public'; +import { CoreTheme, ThemeServiceStart } from '@kbn/core/public'; +import { + PaletteRegistry, + CUSTOM_PALETTE, + PaletteOutput, + CustomPaletteParams, + applyPaletteParams, + getOverridePaletteStops, +} from '@kbn/coloring'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { IconChartDatatable } from '@kbn/chart-icons'; import { getOriginalId } from '@kbn/transpose-utils'; @@ -17,6 +24,7 @@ import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { buildExpression, buildExpressionFunction } from '@kbn/expressions-plugin/common'; import useObservable from 'react-use/lib/useObservable'; import { getSortingCriteria } from '@kbn/sort-predicates'; +import { getKbnPalettes } from '@kbn/palettes'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { SuggestionRequest, @@ -45,10 +53,9 @@ import { DEFAULT_ROW_HEIGHT, } from './components/constants'; import { - applyPaletteParams, defaultPaletteParams, findMinMaxByColumnId, - getColorStops, + getPaletteDisplayColors, shouldColorByTerms, } from '../../shared_components'; import { getColorMappingTelemetryEvents } from '../../lens_ui_telemetry/color_telemetry_helpers'; @@ -268,7 +275,9 @@ export const getDatatableVisualization = ({ on the Metric dimension in cases where there are no numeric columns **/ getConfiguration({ state, frame }) { - const isDarkMode = kibanaTheme.getTheme().darkMode; + const theme = kibanaTheme.getTheme(); + const palettes = getKbnPalettes(theme); + const { sortedColumns, datasource } = getDatasourceAndSortedColumns( state, frame.datasourceLayers @@ -320,7 +329,13 @@ export const getDatatableVisualization = ({ hidden, collapseFn, } = columnMap[accessor] ?? {}; - const stops = getColorStops(paletteService, isDarkMode, palette, colorMapping); + const stops = getPaletteDisplayColors( + paletteService, + palettes, + theme.darkMode, + palette, + colorMapping + ); const hasColoring = colorMode !== 'none' && stops.length > 0; return { @@ -407,7 +422,13 @@ export const getDatatableVisualization = ({ colorMapping, hidden, } = columnMap[accessor] ?? {}; - const stops = getColorStops(paletteService, isDarkMode, palette, colorMapping); + const stops = getPaletteDisplayColors( + paletteService, + palettes, + theme.darkMode, + palette, + colorMapping + ); const hasColoring = colorMode !== 'none' && stops.length > 0; return { @@ -465,13 +486,19 @@ export const getDatatableVisualization = ({ }; }, DimensionEditorComponent(props) { - const isDarkMode = useObservable(kibanaTheme.theme$, { + const theme = useObservable<CoreTheme>(kibanaTheme.theme$, { darkMode: false, name: 'amsterdam', - }).darkMode; + }); + const palettes = getKbnPalettes(theme); return ( - <TableDimensionEditor {...props} isDarkMode={isDarkMode} paletteService={paletteService} /> + <TableDimensionEditor + {...props} + isDarkMode={theme.darkMode} + palettes={palettes} + paletteService={paletteService} + /> ); }, @@ -556,13 +583,14 @@ export const getDatatableVisualization = ({ columns: columns .filter((c) => !c.collapseFn) .map((column) => { + const stops = getOverridePaletteStops(paletteService, column.palette); const paletteParams = { ...column.palette?.params, // rewrite colors and stops as two distinct arguments - colors: (column.palette?.params?.stops || []).map(({ color }) => color), + colors: stops?.map(({ color }) => color), stops: column.palette?.params?.name === RowHeightMode.custom - ? (column.palette?.params?.stops || []).map(({ stop }) => stop) + ? stops?.map(({ stop }) => stop) : [], reverse: false, // managed at UI level }; diff --git a/x-pack/plugins/lens/public/visualizations/gauge/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/gauge/dimension_editor.tsx index fdbe6913d21c..8c1d3bd96f2d 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/dimension_editor.tsx @@ -8,12 +8,17 @@ import { EuiFormRow, EuiSwitchEvent, EuiSwitch, EuiIcon } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { PaletteRegistry, CustomizablePalette, CUSTOM_PALETTE } from '@kbn/coloring'; +import { + PaletteRegistry, + CustomizablePalette, + CUSTOM_PALETTE, + applyPaletteParams, +} from '@kbn/coloring'; import { GaugeTicksPositions, GaugeColorModes } from '@kbn/expression-gauge-plugin/common'; import { getMaxValue, getMinValue } from '@kbn/expression-gauge-plugin/public'; import { TooltipWrapper } from '@kbn/visualization-utils'; import { isNumericFieldForDatatable } from '../../../common/expressions/datatable/utils'; -import { applyPaletteParams, PalettePanelContainer } from '../../shared_components'; +import { PalettePanelContainer } from '../../shared_components'; import type { VisualizationDimensionEditorProps } from '../../types'; import type { GaugeVisualizationState } from './constants'; import { defaultPaletteParams } from './palette_config'; diff --git a/x-pack/plugins/lens/public/visualizations/gauge/index.ts b/x-pack/plugins/lens/public/visualizations/gauge/index.ts index 870b4f3b6b58..a08d6d43097e 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/index.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/index.ts @@ -8,7 +8,6 @@ import type { CoreSetup } from '@kbn/core/public'; import type { ChartsPluginSetup } from '@kbn/charts-plugin/public'; import type { EditorFrameSetup } from '../../types'; -import { transparentizePalettes } from './palette_config'; export interface GaugeVisualizationPluginSetupPlugins { editorFrame: EditorFrameSetup; @@ -19,8 +18,8 @@ export class GaugeVisualization { setup(core: CoreSetup, { editorFrame, charts }: GaugeVisualizationPluginSetupPlugins) { editorFrame.registerVisualization(async () => { const { getGaugeVisualization } = await import('../../async_services'); - const palettes = transparentizePalettes(await charts.palettes.getPalettes()); - return getGaugeVisualization({ paletteService: palettes, theme: core.theme }); + const palettes = await charts.palettes.getPalettes(); + return getGaugeVisualization({ paletteService: palettes }); }); } } diff --git a/x-pack/plugins/lens/public/visualizations/gauge/palette_config.test.ts b/x-pack/plugins/lens/public/visualizations/gauge/palette_config.test.ts deleted file mode 100644 index f144a2f9f87f..000000000000 --- a/x-pack/plugins/lens/public/visualizations/gauge/palette_config.test.ts +++ /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 { transparentizePalettes } from './palette_config'; -import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; - -const paletteServiceMock = chartPluginMock.createPaletteRegistry(); - -describe('transparentizePalettes', () => { - it('converts all colors to half-transparent', () => { - const newPalettes = transparentizePalettes(paletteServiceMock); - - const singlePalette = newPalettes.get('mocked'); - expect(singlePalette.getCategoricalColors(2)).toEqual(['#0000FF80', '#FFFF0080']); - expect( - singlePalette.getCategoricalColor([ - { - name: 'abc', - rankAtDepth: 0, - totalSeriesAtDepth: 5, - }, - ]) - ).toEqual('#0000FF80'); - - const firstPalette = newPalettes.getAll()[0]; - expect(firstPalette.getCategoricalColors(2)).toEqual(['#FF000080', '#00000080']); - expect( - firstPalette.getCategoricalColor([ - { - name: 'abc', - rankAtDepth: 0, - totalSeriesAtDepth: 5, - }, - ]) - ).toEqual('#00000080'); - }); -}); diff --git a/x-pack/plugins/lens/public/visualizations/gauge/palette_config.tsx b/x-pack/plugins/lens/public/visualizations/gauge/palette_config.tsx index a2399c897b39..3d6bd9c94f01 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/palette_config.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/palette_config.tsx @@ -5,15 +5,8 @@ * 2.0. */ -import { - ChartColorConfiguration, - PaletteDefinition, - PaletteRegistry, - SeriesLayer, - RequiredPaletteParamTypes, -} from '@kbn/coloring'; +import { RequiredPaletteParamTypes } from '@kbn/coloring'; -import chroma from 'chroma-js'; import { defaultPaletteParams as sharedDefaultParams } from '../../shared_components'; export const DEFAULT_PALETTE_NAME = 'temperature'; @@ -29,23 +22,3 @@ export const defaultPaletteParams: RequiredPaletteParamTypes = { steps: DEFAULT_COLOR_STEPS, maxSteps: 5, }; - -export const transparentizePalettes = (palettes: PaletteRegistry) => { - const addAlpha = (c: string | null) => (c ? chroma(c).hex() + `80` : `000000`).toUpperCase(); - const transparentizePalette = (palette: PaletteDefinition<unknown>) => ({ - ...palette, - getCategoricalColor: ( - series: SeriesLayer[], - chartConfiguration?: ChartColorConfiguration, - state?: unknown - ) => addAlpha(palette.getCategoricalColor(series, chartConfiguration, state)), - getCategoricalColors: (size: number, state?: unknown): string[] => - palette.getCategoricalColors(size, state).map(addAlpha), - }); - - return { - ...palettes, - get: (name: string) => transparentizePalette(palettes.get(name)), - getAll: () => palettes.getAll().map((singlePalette) => transparentizePalette(singlePalette)), - }; -}; diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts index e5b908a6f4c7..e240b5ef8a51 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.test.ts @@ -13,7 +13,6 @@ import type { DatasourceLayers, OperationDescriptor } from '../../types'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import type { GaugeVisualizationState } from './constants'; -import { themeServiceMock } from '@kbn/core/public/mocks'; function exampleState(): GaugeVisualizationState { return { @@ -25,8 +24,9 @@ function exampleState(): GaugeVisualizationState { }; } -const paletteService = chartPluginMock.createPaletteRegistry(); -const theme = themeServiceMock.createStartContract(); +const deps = { + paletteService: chartPluginMock.createPaletteRegistry(), +}; describe('gauge', () => { let frame: ReturnType<typeof createMockFramePublicAPI>; @@ -37,7 +37,7 @@ describe('gauge', () => { describe('#intialize', () => { test('returns a default state', () => { - expect(getGaugeVisualization({ paletteService, theme }).initialize(() => 'l1')).toEqual({ + expect(getGaugeVisualization(deps).initialize(() => 'l1')).toEqual({ layerId: 'l1', layerType: LayerTypes.DATA, shape: 'horizontalBullet', @@ -47,12 +47,9 @@ describe('gauge', () => { }); test('returns persisted state', () => { - expect( - getGaugeVisualization({ paletteService, theme }).initialize( - () => 'test-layer', - exampleState() - ) - ).toEqual(exampleState()); + expect(getGaugeVisualization(deps).initialize(() => 'test-layer', exampleState())).toEqual( + exampleState() + ); }); }); @@ -89,10 +86,7 @@ describe('gauge', () => { }; expect( - getGaugeVisualization({ - paletteService, - theme, - }).getConfiguration({ state, frame, layerId: 'first' }) + getGaugeVisualization(deps).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ { @@ -175,10 +169,7 @@ describe('gauge', () => { minAccessor: 'min-accessor', }; expect( - getGaugeVisualization({ - paletteService, - theme, - }).getConfiguration({ state, frame, layerId: 'first' }) + getGaugeVisualization(deps).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ { @@ -267,10 +258,7 @@ describe('gauge', () => { frame.activeData = undefined; expect( - getGaugeVisualization({ - paletteService, - theme, - }).getConfiguration({ state, frame, layerId: 'first' }) + getGaugeVisualization(deps).getConfiguration({ state, frame, layerId: 'first' }) ).toEqual({ groups: [ { @@ -355,10 +343,7 @@ describe('gauge', () => { maxAccessor: 'max-accessor', }; expect( - getGaugeVisualization({ - paletteService, - theme, - }).setDimension({ + getGaugeVisualization(deps).setDimension({ prevState, layerId: 'first', columnId: 'new-min-accessor', @@ -383,10 +368,7 @@ describe('gauge', () => { }; test('removes metric correctly', () => { expect( - getGaugeVisualization({ - paletteService, - theme, - }).removeDimension({ + getGaugeVisualization(deps).removeDimension({ prevState, layerId: 'first', columnId: 'metric-accessor', @@ -399,10 +381,7 @@ describe('gauge', () => { }); test('removes min correctly', () => { expect( - getGaugeVisualization({ - paletteService, - theme, - }).removeDimension({ + getGaugeVisualization(deps).removeDimension({ prevState, layerId: 'first', columnId: 'min-accessor', @@ -419,12 +398,7 @@ describe('gauge', () => { }); describe('#getSupportedLayers', () => { it('should return a single layer type', () => { - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getSupportedLayers() - ).toHaveLength(1); + expect(getGaugeVisualization(deps).getSupportedLayers()).toHaveLength(1); }); }); describe('#getLayerType', () => { @@ -434,10 +408,7 @@ describe('gauge', () => { minAccessor: 'min-accessor', goalAccessor: 'value-accessor', }; - const instance = getGaugeVisualization({ - paletteService, - theme, - }); + const instance = getGaugeVisualization(deps); expect(instance.getLayerType('test-layer', state)).toEqual(LayerTypes.DATA); expect(instance.getLayerType('foo', state)).toBeUndefined(); }); @@ -465,12 +436,7 @@ describe('gauge', () => { maxAccessor: 'max-accessor', labelMinor: 'Subtitle', }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).toExpression(state, datasourceLayers) - ).toEqual({ + expect(getGaugeVisualization(deps).toExpression(state, datasourceLayers)).toEqual({ type: 'expression', chain: [ { @@ -497,12 +463,7 @@ describe('gauge', () => { layerId: 'first', minAccessor: 'min-accessor', }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).toExpression(state, datasourceLayers) - ).toEqual(null); + expect(getGaugeVisualization(deps).toExpression(state, datasourceLayers)).toEqual(null); }); }); @@ -543,12 +504,8 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(localState, { frame }) - ).toMatchInlineSnapshot(` + expect(getGaugeVisualization(deps).getUserMessages!(localState, { frame })) + .toMatchInlineSnapshot(` Array [ Object { "displayLocations": Array [ @@ -587,12 +544,7 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(state, { frame }) - ).toHaveLength(0); + expect(getGaugeVisualization(deps).getUserMessages!(state, { frame })).toHaveLength(0); }); it('should warn when minimum value is greater than metric value', () => { frame.activeData = { @@ -610,12 +562,7 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(state, { frame }) - ).toHaveLength(1); + expect(getGaugeVisualization(deps).getUserMessages!(state, { frame })).toHaveLength(1); }); it('should warn when metric value is greater than maximum value', () => { @@ -633,12 +580,7 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(state, { frame }) - ).toHaveLength(1); + expect(getGaugeVisualization(deps).getUserMessages!(state, { frame })).toHaveLength(1); }); it('should warn when goal value is greater than maximum value', () => { frame.activeData = { @@ -656,12 +598,7 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(state, { frame }) - ).toHaveLength(1); + expect(getGaugeVisualization(deps).getUserMessages!(state, { frame })).toHaveLength(1); }); it('should warn when minimum value is greater than goal value', () => { frame.activeData = { @@ -679,12 +616,7 @@ describe('gauge', () => { }, }; - expect( - getGaugeVisualization({ - paletteService, - theme, - }).getUserMessages!(state, { frame }) - ).toHaveLength(1); + expect(getGaugeVisualization(deps).getUserMessages!(state, { frame })).toHaveLength(1); }); }); }); diff --git a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx index e1ef2b03e426..957c1b16cf2b 100644 --- a/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/gauge/visualization.tsx @@ -7,11 +7,17 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { ThemeServiceStart } from '@kbn/core/public'; import { FormattedMessage } from '@kbn/i18n-react'; import { Ast } from '@kbn/interpreter'; import { buildExpressionFunction, DatatableRow } from '@kbn/expressions-plugin/common'; -import { PaletteRegistry, CustomPaletteParams, CUSTOM_PALETTE } from '@kbn/coloring'; +import { + PaletteRegistry, + CustomPaletteParams, + CUSTOM_PALETTE, + applyPaletteParams, + getOverridePaletteStops, + PaletteOutput, +} from '@kbn/coloring'; import type { GaugeExpressionFunctionDefinition, GaugeShape, @@ -37,7 +43,6 @@ import type { import { getSuggestions } from './suggestions'; import { GROUP_ID, LENS_GAUGE_ID, GaugeVisualizationState } from './constants'; import { GaugeToolbar } from './toolbar_component'; -import { applyPaletteParams } from '../../shared_components'; import { GaugeDimensionEditor } from './dimension_editor'; import { generateId } from '../../id_generator'; import { getAccessorsFromState } from './utils'; @@ -52,7 +57,6 @@ import { interface GaugeVisualizationDeps { paletteService: PaletteRegistry; - theme: ThemeServiceStart; } export const isNumericMetric = (op: OperationMetadata) => @@ -61,12 +65,17 @@ export const isNumericMetric = (op: OperationMetadata) => export const isNumericDynamicMetric = (op: OperationMetadata) => isNumericMetric(op) && !op.isStaticValue; -function computePaletteParams(params: CustomPaletteParams) { +function computePaletteParams( + paletteService: PaletteRegistry, + palette: PaletteOutput<CustomPaletteParams> +) { + const stops = getOverridePaletteStops(paletteService, palette); + return { - ...params, + ...palette.params, // rewrite colors and stops as two distinct arguments - colors: (params?.stops || []).map(({ color }) => color), - stops: params?.name === 'custom' ? (params?.stops || []).map(({ stop }) => stop) : [], + colors: stops?.map(({ color }) => color), + stops: palette.params?.name === 'custom' ? stops?.map(({ stop }) => stop) : [], reverse: false, // managed at UI level }; } @@ -144,7 +153,9 @@ const toExpression = ( shape: state.shape ?? GaugeShapes.HORIZONTAL_BULLET, colorMode: state?.colorMode ?? 'none', palette: state.palette?.params - ? paletteService.get(CUSTOM_PALETTE).toExpression(computePaletteParams(state.palette.params)) + ? paletteService + .get(CUSTOM_PALETTE) + .toExpression(computePaletteParams(paletteService, state.palette)) : undefined, ticksPosition: state.ticksPosition ?? 'auto', labelMinor: state.labelMinor, diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/utils.ts b/x-pack/plugins/lens/public/visualizations/heatmap/utils.ts index fe942dd40427..66b2a1029501 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/utils.ts +++ b/x-pack/plugins/lens/public/visualizations/heatmap/utils.ts @@ -5,9 +5,9 @@ * 2.0. */ -import type { PaletteRegistry } from '@kbn/coloring'; +import { applyPaletteParams, type PaletteRegistry } from '@kbn/coloring'; import type { Datatable } from '@kbn/expressions-plugin/common'; -import { applyPaletteParams, findMinMaxByColumnId } from '../../shared_components'; +import { findMinMaxByColumnId } from '../../shared_components'; import { DEFAULT_PALETTE_NAME } from './constants'; import type { HeatmapVisualizationState, Palette } from './types'; diff --git a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx index 1fb747427a05..4dfb17241866 100644 --- a/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/heatmap/visualization.tsx @@ -11,7 +11,13 @@ import { FormattedMessage } from '@kbn/i18n-react'; import { Ast } from '@kbn/interpreter'; import { Position } from '@elastic/charts'; import { IconChartHeatmap } from '@kbn/chart-icons'; -import { CUSTOM_PALETTE, PaletteRegistry, CustomPaletteParams } from '@kbn/coloring'; +import { + CUSTOM_PALETTE, + PaletteRegistry, + CustomPaletteParams, + PaletteOutput, + getOverridePaletteStops, +} from '@kbn/coloring'; import { ThemeServiceStart } from '@kbn/core/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; @@ -88,12 +94,17 @@ function getInitialState(): Omit<HeatmapVisualizationState, 'layerId' | 'layerTy }; } -function computePaletteParams(params: CustomPaletteParams) { +function computePaletteParams( + paletteService: PaletteRegistry, + palette: PaletteOutput<CustomPaletteParams> +) { + const stops = getOverridePaletteStops(paletteService, palette); + return { - ...params, + ...palette.params, // rewrite colors and stops as two distinct arguments - colors: (params?.stops || []).map(({ color }) => color), - stops: params?.name === 'custom' ? (params?.stops || []).map(({ stop }) => stop) : [], + colors: stops?.map(({ color }) => color), + stops: palette.params?.name === 'custom' ? stops?.map(({ stop }) => stop) : [], reverse: false, // managed at UI level }; } @@ -349,7 +360,7 @@ export const getHeatmapVisualization = ({ palette: state.palette?.params ? paletteService .get(CUSTOM_PALETTE) - .toExpression(computePaletteParams(state.palette?.params)) + .toExpression(computePaletteParams(paletteService, state.palette)) : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), legend: buildExpression([legendFn]), gridConfig: buildExpression([gridConfigFn]), @@ -407,7 +418,7 @@ export const getHeatmapVisualization = ({ palette: state.palette?.params ? paletteService .get(CUSTOM_PALETTE) - .toExpression(computePaletteParams(state.palette?.params)) + .toExpression(computePaletteParams(paletteService, state.palette)) : paletteService.get(DEFAULT_PALETTE_NAME).toExpression(), }); diff --git a/x-pack/plugins/lens/public/visualizations/legacy_metric/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/legacy_metric/dimension_editor.tsx index c6eccd9a7072..552b5f0a52a3 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/dimension_editor.tsx @@ -5,13 +5,18 @@ * 2.0. */ import { EuiButtonGroup, EuiFormRow, htmlIdGenerator } from '@elastic/eui'; -import { PaletteRegistry, CustomizablePalette, CUSTOM_PALETTE } from '@kbn/coloring'; +import { + PaletteRegistry, + CustomizablePalette, + CUSTOM_PALETTE, + applyPaletteParams, +} from '@kbn/coloring'; import { i18n } from '@kbn/i18n'; import React from 'react'; import { ColorMode } from '@kbn/charts-plugin/common'; import type { LegacyMetricState } from '../../../common/types'; import { isNumericFieldForDatatable } from '../../../common/expressions/datatable/utils'; -import { applyPaletteParams, PalettePanelContainer } from '../../shared_components'; +import { PalettePanelContainer } from '../../shared_components'; import type { VisualizationDimensionEditorProps } from '../../types'; import { defaultPaletteParams } from './palette_config'; @@ -54,7 +59,7 @@ export function MetricDimensionEditor( }; // need to tell the helper that the colorStops are required to display - const displayStops = applyPaletteParams(props.paletteService, activePalette, currentMinMax); + const stops = applyPaletteParams(props.paletteService, activePalette, currentMinMax); return ( <> @@ -109,7 +114,7 @@ export function MetricDimensionEditor( // align this initial computation with same format for default // palettes in the panel. This to avoid custom computation issue with metric // fake data range - stops: displayStops.map((v, i, array) => ({ + stops: stops.map((v, i, array) => ({ ...v, stop: currentMinMax.min + (i === 0 ? 0 : array[i - 1].stop), })), @@ -137,7 +142,7 @@ export function MetricDimensionEditor( })} > <PalettePanelContainer - palette={displayStops.map(({ color }) => color)} + palette={stops.map(({ color }) => color)} siblingRef={props.panelRef} isInlineEditing={isInlineEditing} title={i18n.translate('xpack.lens.paletteMetricGradient.label', { diff --git a/x-pack/plugins/lens/public/visualizations/legacy_metric/index.ts b/x-pack/plugins/lens/public/visualizations/legacy_metric/index.ts index 933bf4dab6ae..a62417226444 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/index.ts +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/index.ts @@ -20,9 +20,9 @@ export class LegacyMetricVisualization { const { getLegacyMetricVisualization: getMetricVisualization } = await import( '../../async_services' ); - const palettes = await charts.palettes.getPalettes(); + const paletteService = await charts.palettes.getPalettes(); - return getMetricVisualization({ paletteService: palettes, theme: core.theme }); + return getMetricVisualization({ paletteService }); }); } } diff --git a/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.test.ts index d6a70ddbe711..faf50074ee8f 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.test.ts @@ -13,7 +13,7 @@ import { generateId } from '../../id_generator'; import { DatasourcePublicAPI, FramePublicAPI } from '../../types'; import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { ColorMode } from '@kbn/charts-plugin/common'; -import { themeServiceMock } from '@kbn/core/public/mocks'; +import { CUSTOM_PALETTE } from '@kbn/coloring'; jest.mock('../../id_generator'); @@ -37,7 +37,6 @@ function mockFrame(): FramePublicAPI { const metricVisualization = getLegacyMetricVisualization({ paletteService: chartPluginMock.createPaletteRegistry(), - theme: themeServiceMock.createStartContract(), }); describe('metric_visualization', () => { @@ -128,7 +127,13 @@ describe('metric_visualization', () => { layerType: LayerTypes.DATA, palette: { type: 'palette', - name: 'status', + name: CUSTOM_PALETTE, + params: { + stops: [ + { color: 'blue', stop: 0 }, + { color: 'yellow', stop: 100 }, + ], + }, }, }, layerId: 'l1', @@ -138,7 +143,7 @@ describe('metric_visualization', () => { groups: [ expect.objectContaining({ accessors: expect.arrayContaining([ - { columnId: 'a', triggerIconType: 'colorBy', palette: [] }, + { columnId: 'a', triggerIconType: 'colorBy', palette: ['blue', 'yellow'] }, ]), }), ], diff --git a/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx b/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx index 35983e52f80d..74f1642cb096 100644 --- a/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/legacy_metric/visualization.tsx @@ -7,8 +7,13 @@ import { i18n } from '@kbn/i18n'; import { euiThemeVars } from '@kbn/ui-theme'; import { Ast } from '@kbn/interpreter'; -import { PaletteOutput, PaletteRegistry, CUSTOM_PALETTE, shiftPalette } from '@kbn/coloring'; -import { ThemeServiceStart } from '@kbn/core/public'; +import { + PaletteOutput, + PaletteRegistry, + CUSTOM_PALETTE, + shiftPalette, + getOverridePaletteStops, +} from '@kbn/coloring'; import { ColorMode, CustomPaletteState } from '@kbn/charts-plugin/common'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { IconChartMetric } from '@kbn/chart-icons'; @@ -65,7 +70,7 @@ const toExpression = ( const datasourceExpression = datasourceExpressionsByLayers[state.layerId]; const operation = datasource && datasource.getOperationForColumnId(state.accessor); - const stops = state.palette?.params?.stops || []; + const stops = getOverridePaletteStops(paletteService, state.palette) ?? []; const isCustomPalette = state.palette?.params?.name === CUSTOM_PALETTE; const canColor = operation?.dataType === 'number'; @@ -150,10 +155,8 @@ const toExpression = ( export const getLegacyMetricVisualization = ({ paletteService, - theme, }: { paletteService: PaletteRegistry; - theme: ThemeServiceStart; }): Visualization<LegacyMetricState> => ({ id: 'lnsLegacyMetric', @@ -215,7 +218,8 @@ export const getLegacyMetricVisualization = ({ getConfiguration(props) { const hasColoring = props.state.palette != null; - const stops = props.state.palette?.params?.stops || []; + const stops = getOverridePaletteStops(paletteService, props.state.palette); + return { groups: [ { @@ -236,7 +240,7 @@ export const getLegacyMetricVisualization = ({ { columnId: props.state.accessor, triggerIconType: hasColoring ? 'colorBy' : undefined, - palette: hasColoring ? stops.map(({ color }) => color) : undefined, + palette: hasColoring ? stops?.map(({ color }) => color) : undefined, }, ] : [], @@ -314,7 +318,7 @@ export const getLegacyMetricVisualization = ({ } const hasColoring = state.palette != null; - const stops = state.palette?.params?.stops || []; + const stops = getOverridePaletteStops(paletteService, state.palette); return { layers: [ @@ -324,7 +328,7 @@ export const getLegacyMetricVisualization = ({ chartType: 'metric', ...this.getDescription(state), dimensions, - palette: hasColoring ? stops.map(({ color }) => color) : undefined, + palette: hasColoring ? stops?.map(({ color }) => color) : undefined, }, ], }; diff --git a/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap b/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap index 2490904751e8..6306758e256f 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap +++ b/x-pack/plugins/lens/public/visualizations/metric/__snapshots__/visualization.test.ts.snap @@ -7,7 +7,10 @@ Object { "accessors": Array [ Object { "columnId": "metric-col-id", - "palette": Array [], + "palette": Array [ + "blue", + "yellow", + ], "triggerIconType": "colorBy", }, ], diff --git a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx index 78fcd67f3643..5d98be54e23e 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/dimension_editor.tsx @@ -24,6 +24,7 @@ import { CustomizablePalette, DEFAULT_MAX_STOP, DEFAULT_MIN_STOP, + applyPaletteParams, } from '@kbn/coloring'; import { getDataBoundsForPalette } from '@kbn/expression-metric-vis-plugin/public'; import { getColumnByAccessor } from '@kbn/visualizations-plugin/common/utils'; @@ -31,7 +32,7 @@ import { css } from '@emotion/react'; import { DebouncedInput, IconSelect } from '@kbn/visualization-ui-components'; import { useDebouncedValue } from '@kbn/visualization-utils'; import { isNumericFieldForDatatable } from '../../../common/expressions/datatable/utils'; -import { applyPaletteParams, PalettePanelContainer } from '../../shared_components'; +import { PalettePanelContainer } from '../../shared_components'; import type { VisualizationDimensionEditorProps } from '../../types'; import { defaultNumberPaletteParams, defaultPercentagePaletteParams } from './palette_config'; import { DEFAULT_MAX_COLUMNS, getDefaultColor, showingBar } from './visualization'; diff --git a/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts b/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts index 02292a4ddce0..09e1de619247 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/to_expression.ts @@ -5,7 +5,13 @@ * 2.0. */ -import { CustomPaletteParams, CUSTOM_PALETTE, PaletteRegistry } from '@kbn/coloring'; +import { + CustomPaletteParams, + CUSTOM_PALETTE, + PaletteRegistry, + PaletteOutput, + getOverridePaletteStops, +} from '@kbn/coloring'; import type { TrendlineExpressionFunctionDefinition, MetricVisExpressionFunctionDefinition, @@ -23,12 +29,17 @@ import { MetricVisualizationState } from './types'; import { metricStateDefaults } from './constants'; // TODO - deduplicate with gauges? -function computePaletteParams(params: CustomPaletteParams) { +function computePaletteParams( + paletteService: PaletteRegistry, + palette: PaletteOutput<CustomPaletteParams> +) { + const stops = getOverridePaletteStops(paletteService, palette); + return { - ...params, + ...palette.params, // rewrite colors and stops as two distinct arguments - colors: (params?.stops || []).map(({ color }) => color), - stops: params?.name === 'custom' ? (params?.stops || []).map(({ stop }) => stop) : [], + colors: stops?.map(({ color }) => color), + stops: palette.params?.name === 'custom' ? stops?.map(({ stop }) => stop) : [], reverse: false, // managed at UI level }; } @@ -162,7 +173,7 @@ export const toExpression = ( ? [ paletteService .get(CUSTOM_PALETTE) - .toExpression(computePaletteParams(state.palette.params as CustomPaletteParams)), + .toExpression(computePaletteParams(paletteService, state.palette)), ] : [], maxCols: state.maxCols ?? DEFAULT_MAX_COLUMNS, diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts index e4011ca8431a..a696ab47a487 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.test.ts @@ -6,7 +6,7 @@ */ import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; -import { CustomPaletteParams, PaletteOutput } from '@kbn/coloring'; +import { CUSTOM_PALETTE, CustomPaletteParams, PaletteOutput } from '@kbn/coloring'; import { ExpressionAstExpression, ExpressionAstFunction } from '@kbn/expressions-plugin/common'; import { euiLightVars, euiThemeVars } from '@kbn/ui-theme'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; @@ -36,9 +36,13 @@ describe('metric visualization', () => { const palette: PaletteOutput<CustomPaletteParams> = { type: 'palette', - name: 'foo', + name: CUSTOM_PALETTE, params: { rangeType: 'percent', + stops: [ + { color: 'blue', stop: 0 }, + { color: 'yellow', stop: 100 }, + ], }, }; @@ -133,7 +137,10 @@ describe('metric visualization', () => { Array [ Object { "columnId": "metric-col-id", - "palette": Array [], + "palette": Array [ + "blue", + "yellow", + ], "triggerIconType": "colorBy", }, ] @@ -183,7 +190,10 @@ describe('metric visualization', () => { Array [ Object { "columnId": "metric-col-id", - "palette": Array [], + "palette": Array [ + "blue", + "yellow", + ], "triggerIconType": "colorBy", }, ] diff --git a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx index 6d3bd42f26cf..eb16bd36e683 100644 --- a/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/metric/visualization.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { PaletteRegistry } from '@kbn/coloring'; +import { PaletteRegistry, getOverridePaletteStops } from '@kbn/coloring'; import { ThemeServiceStart } from '@kbn/core/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { euiLightVars, euiThemeVars } from '@kbn/ui-theme'; @@ -60,6 +60,7 @@ export const metricLabel = i18n.translate('xpack.lens.metric.label', { }); const getMetricLayerConfiguration = ( + paletteService: PaletteRegistry, props: VisualizationConfigProps<MetricVisualizationState> ): { groups: VisualizationDimensionGroupConfig[]; @@ -73,17 +74,20 @@ const getMetricLayerConfiguration = ( const getPrimaryAccessorDisplayConfig = (): Partial<AccessorConfig> => { const hasDynamicColoring = Boolean(isMetricNumeric && props.state.palette); - const stops = props.state.palette?.params?.stops || []; - return hasDynamicColoring - ? { - triggerIconType: 'colorBy', - palette: stops.map(({ color }) => color), - } - : { - triggerIconType: 'color', - color: props.state.color ?? getDefaultColor(props.state, isMetricNumeric), - }; + if (hasDynamicColoring) { + const stops = getOverridePaletteStops(paletteService, props.state.palette); + + return { + triggerIconType: 'colorBy', + palette: stops?.map(({ color }) => color), + }; + } + + return { + triggerIconType: 'color', + color: props.state.color ?? getDefaultColor(props.state, isMetricNumeric), + }; }; const isBucketed = (op: OperationMetadata) => op.isBucketed; @@ -354,7 +358,7 @@ export const getMetricVisualization = ({ getConfiguration(props) { return props.layerId === props.state.layerId - ? getMetricLayerConfiguration(props) + ? getMetricLayerConfiguration(paletteService, props) : getTrendlineLayerConfiguration(props); }, diff --git a/x-pack/plugins/lens/public/visualizations/partition/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/partition/dimension_editor.tsx index 32f8f2e4c972..21cd550d4f53 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/partition/dimension_editor.tsx @@ -14,17 +14,20 @@ import { PaletteRegistry, ColorMapping, SPECIAL_TOKENS_STRING_CONVERSION, - AVAILABLE_PALETTES, - getColorsFromMapping, } from '@kbn/coloring'; import { ColorPicker } from '@kbn/visualization-ui-components'; import { useDebouncedValue } from '@kbn/visualization-utils'; import { EuiFormRow, EuiFlexGroup, EuiFlexItem, EuiSwitch, EuiText, EuiBadge } from '@elastic/eui'; import { useState, useCallback } from 'react'; import { getColorCategories } from '@kbn/chart-expressions-common'; +import { KbnPalette, KbnPalettes } from '@kbn/palettes'; import { PieVisualizationState } from '../../../common/types'; import { VisualizationDimensionEditorProps } from '../../types'; -import { PalettePanelContainer, PalettePicker } from '../../shared_components'; +import { + PalettePanelContainer, + PalettePicker, + getPaletteDisplayColors, +} from '../../shared_components'; import { CollapseSetting } from '../../shared_components/collapse_setting'; import { getDefaultColorForMultiMetricDimension, @@ -35,6 +38,7 @@ import { trackUiCounterEvents } from '../../lens_ui_telemetry'; type DimensionEditorProps = VisualizationDimensionEditorProps<PieVisualizationState> & { paletteService: PaletteRegistry; + palettes: KbnPalettes; isDarkMode: boolean; }; @@ -118,7 +122,13 @@ export function DimensionEditor(props: DimensionEditorProps) { }) : undefined; - const colors = getColorsFromMapping(props.isDarkMode, currentLayer.colorMapping); + const colors = getPaletteDisplayColors( + props.paletteService, + props.palettes, + props.isDarkMode, + props.state.palette, + currentLayer.colorMapping + ); const table = props.frame.activeData?.[currentLayer.layerId]; const splitCategories = getColorCategories(table?.rows ?? [], props.accessor); @@ -183,7 +193,7 @@ export function DimensionEditor(props: DimensionEditorProps) { isDarkMode={props.isDarkMode} model={currentLayer.colorMapping ?? { ...DEFAULT_COLOR_MAPPING_CONFIG }} onModelUpdate={(model: ColorMapping.Config) => setColorMapping(model)} - palettes={AVAILABLE_PALETTES} + palettes={props.palettes} data={{ type: 'categories', categories: splitCategories, @@ -209,6 +219,7 @@ export function DimensionEditor(props: DimensionEditorProps) { {showColorPicker && ( <ColorPicker {...props} + swatches={props.palettes.get(KbnPalette.Default).colors(10)} overwriteColor={currentLayer.colorsByDimension?.[props.accessor]} defaultColor={getDefaultColorForMultiMetricDimension({ layer: currentLayer, diff --git a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx index 8d44fec4e96e..b564f6dbd7d4 100644 --- a/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/partition/visualization.tsx @@ -14,13 +14,14 @@ import { PaletteRegistry, getColorsFromMapping, } from '@kbn/coloring'; -import { ThemeServiceStart } from '@kbn/core/public'; +import { CoreTheme, ThemeServiceStart } from '@kbn/core/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import { EuiSpacer } from '@elastic/eui'; import { PartitionVisConfiguration } from '@kbn/visualizations-plugin/common/convert_to_lens'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { AccessorConfig } from '@kbn/visualization-ui-components'; import useObservable from 'react-use/lib/useObservable'; +import { getKbnPalettes } from '@kbn/palettes'; import type { FormBasedPersistedState } from '../../datasources/form_based/types'; import type { Visualization, @@ -201,8 +202,10 @@ export const getPieVisualization = ({ kibanaTheme.theme$ .subscribe({ next(theme) { + const palettes = getKbnPalettes(theme); + colors = state.layers[0]?.colorMapping - ? getColorsFromMapping(theme.darkMode, state.layers[0].colorMapping) + ? getColorsFromMapping(palettes, theme.darkMode, state.layers[0].colorMapping) : paletteService .get(state.palette?.name || 'default') .getCategoricalColors(10, state.palette?.params); @@ -494,11 +497,19 @@ export const getPieVisualization = ({ }; }, DimensionEditorComponent(props) { - const isDarkMode = useObservable(kibanaTheme.theme$, { + const theme = useObservable<CoreTheme>(kibanaTheme.theme$, { darkMode: false, name: 'amsterdam', - }).darkMode; - return <DimensionEditor {...props} paletteService={paletteService} isDarkMode={isDarkMode} />; + }); + const palettes = getKbnPalettes(theme); + return ( + <DimensionEditor + {...props} + paletteService={paletteService} + palettes={palettes} + isDarkMode={theme.darkMode} + /> + ); }, DimensionEditorDataExtraComponent(props) { return <DimensionDataExtraEditor {...props} paletteService={paletteService} />; diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx b/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx index b457926fe373..16ba1ecf61b7 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/tagcloud_visualization.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; -import { ThemeServiceStart } from '@kbn/core/public'; +import { CoreTheme, ThemeServiceStart } from '@kbn/core/public'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; import type { ExpressionTagcloudFunctionDefinition } from '@kbn/expression-tagcloud-plugin/common'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; @@ -20,6 +20,7 @@ import { PaletteRegistry, getColorsFromMapping } from '@kbn/coloring'; import { IconChartTagcloud } from '@kbn/chart-icons'; import { SystemPaletteExpressionFunctionDefinition } from '@kbn/charts-plugin/common'; import useObservable from 'react-use/lib/useObservable'; +import { getKbnPalettes } from '@kbn/palettes'; import type { OperationMetadata, Visualization } from '../..'; import { getColorMappingDefaults } from '../../utils'; import type { TagcloudState } from './types'; @@ -122,7 +123,8 @@ export const getTagcloudVisualization = ({ kibanaTheme.theme$ .subscribe({ next(theme) { - colors = getColorsFromMapping(theme.darkMode, state.colorMapping); + const palettes = getKbnPalettes(theme); + colors = getColorsFromMapping(palettes, theme.darkMode, state.colorMapping); }, }) .unsubscribe(); @@ -294,15 +296,18 @@ export const getTagcloudVisualization = ({ }, DimensionEditorComponent(props) { - const isDarkMode: boolean = useObservable(kibanaTheme.theme$, { + const theme = useObservable<CoreTheme>(kibanaTheme.theme$, { darkMode: false, name: 'amsterdam', - }).darkMode; + }); + const palettes = getKbnPalettes(theme); + if (props.groupId === TAG_GROUP_ID) { return ( <TagsDimensionEditor - isDarkMode={isDarkMode} + isDarkMode={theme.darkMode} paletteService={paletteService} + palettes={palettes} state={props.state} setState={props.setState} frame={props.frame} diff --git a/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx index 4e28701fd677..5dea1057c371 100644 --- a/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/tagcloud/tags_dimension_editor.tsx @@ -13,21 +13,25 @@ import { ColorMapping, SPECIAL_TOKENS_STRING_CONVERSION, PaletteOutput, - AVAILABLE_PALETTES, - getColorsFromMapping, } from '@kbn/coloring'; import { i18n } from '@kbn/i18n'; import { EuiFlexGroup, EuiFlexItem, EuiSwitch, EuiFormRow, EuiText, EuiBadge } from '@elastic/eui'; import { useState, MutableRefObject, useCallback } from 'react'; import { useDebouncedValue } from '@kbn/visualization-utils'; import { getColorCategories } from '@kbn/chart-expressions-common'; +import { KbnPalettes } from '@kbn/palettes'; import type { TagcloudState } from './types'; -import { PalettePanelContainer, PalettePicker } from '../../shared_components'; +import { + PalettePanelContainer, + PalettePicker, + getPaletteDisplayColors, +} from '../../shared_components'; import { FramePublicAPI } from '../../types'; import { trackUiCounterEvents } from '../../lens_ui_telemetry'; interface Props { paletteService: PaletteRegistry; + palettes: KbnPalettes; state: TagcloudState; setState: (state: TagcloudState) => void; frame: FramePublicAPI; @@ -42,6 +46,7 @@ export function TagsDimensionEditor({ setState, panelRef, isDarkMode, + palettes, paletteService, isInlineEditing, }: Props) { @@ -52,7 +57,13 @@ export function TagsDimensionEditor({ }); const [useNewColorMapping, setUseNewColorMapping] = useState(state.colorMapping ? true : false); - const colors = getColorsFromMapping(isDarkMode, state.colorMapping); + const colors = getPaletteDisplayColors( + paletteService, + palettes, + isDarkMode, + state.palette, + state.colorMapping + ); const table = frame.activeData?.[state.layerId]; const splitCategories = getColorCategories(table?.rows ?? [], state.tagAccessor); @@ -136,7 +147,7 @@ export function TagsDimensionEditor({ isDarkMode={isDarkMode} model={state.colorMapping ?? { ...DEFAULT_COLOR_MAPPING_CONFIG }} onModelUpdate={(model: ColorMapping.Config) => setColorMapping(model)} - palettes={AVAILABLE_PALETTES} + palettes={palettes} data={{ type: 'categories', categories: splitCategories, diff --git a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/revert_changes_action.tsx b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/revert_changes_action.tsx index 7593374ca83c..61408286af1d 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/revert_changes_action.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/annotations/actions/revert_changes_action.tsx @@ -36,7 +36,10 @@ export const getRevertChangesAction = ({ state: XYState; layer: XYByReferenceAnnotationLayerConfig; setState: StateSetter<XYState, unknown>; - core: Pick<CoreStart, 'overlays' | 'analytics' | 'i18n' | 'theme' | 'notifications'>; + core: Pick< + CoreStart, + 'overlays' | 'analytics' | 'i18n' | 'theme' | 'notifications' | 'userProfile' + >; }): LayerAction => { return { displayName: i18n.translate('xpack.lens.xyChart.annotations.revertChanges', { diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx index e2c6ce25bd2e..ecb3c16fb6dd 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.test.tsx @@ -224,7 +224,7 @@ describe('xy_visualization', () => { "colorMode": Object { "type": "categorical", }, - "paletteId": "eui_amsterdam_color_blind", + "paletteId": "default", "specialAssignments": Array [ Object { "color": Object { diff --git a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx index a01c26ece9c1..ceba71c4d4f3 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/visualization.tsx @@ -12,7 +12,7 @@ import { i18n } from '@kbn/i18n'; import type { PaletteRegistry } from '@kbn/coloring'; import { IconChartBarReferenceLine, IconChartBarAnnotations } from '@kbn/chart-icons'; import { FieldFormatsStart } from '@kbn/field-formats-plugin/public'; -import { CoreStart, SavedObjectReference, ThemeServiceStart } from '@kbn/core/public'; +import { CoreStart, CoreTheme, SavedObjectReference, ThemeServiceStart } from '@kbn/core/public'; import { EventAnnotationServiceType } from '@kbn/event-annotation-plugin/public'; import { getAnnotationAccessor } from '@kbn/event-annotation-components'; import { VIS_EVENT_TO_TRIGGER } from '@kbn/visualizations-plugin/public'; @@ -29,6 +29,7 @@ import { getColorsFromMapping } from '@kbn/coloring'; import useObservable from 'react-use/lib/useObservable'; import { EuiPopover, EuiSelectable } from '@elastic/eui'; import { ToolbarButton } from '@kbn/shared-ux-button-toolbar'; +import { getKbnPalettes } from '@kbn/palettes'; import { generateId } from '../../id_generator'; import { isDraggedDataViewField, @@ -466,14 +467,14 @@ export const getXyVisualization = ({ kibanaTheme.theme$ .subscribe({ next(theme) { - colors = getColorsFromMapping(theme.darkMode, layer.colorMapping); + const palettes = getKbnPalettes(theme); + colors = getColorsFromMapping(palettes, theme.darkMode, layer.colorMapping); }, }) .unsubscribe(); } else { - colors = paletteService - .get(dataLayer.palette?.name || 'default') - .getCategoricalColors(10, dataLayer.palette?.params); + const palette = paletteService.get(dataLayer.palette?.name || 'default'); + colors = palette.getCategoricalColors(10, dataLayer.palette?.params); } return { @@ -742,17 +743,18 @@ export const getXyVisualization = ({ paletteService, }; - const isDarkMode: boolean = useObservable(kibanaTheme.theme$, { + const theme = useObservable<CoreTheme>(kibanaTheme.theme$, { darkMode: false, name: 'amsterdam', - }).darkMode; + }); + const palettes = getKbnPalettes(theme); const layer = props.state.layers.find((l) => l.layerId === props.layerId)!; const dimensionEditor = isReferenceLayer(layer) ? ( - <ReferenceLinePanel {...allProps} /> + <ReferenceLinePanel {...allProps} palettes={palettes} /> ) : isAnnotationsLayer(layer) ? ( <AnnotationsPanel {...allProps} dataViewsService={dataViewsService} /> ) : ( - <DataDimensionEditor {...allProps} isDarkMode={isDarkMode} /> + <DataDimensionEditor {...allProps} palettes={palettes} isDarkMode={theme.darkMode} /> ); return dimensionEditor; diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.test.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.test.tsx index 08a83ef7e017..42224fa5f050 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.test.tsx @@ -18,6 +18,7 @@ import { chartPluginMock } from '@kbn/charts-plugin/public/mocks'; import { EuiColorPicker } from '@elastic/eui'; import { LayerTypes } from '@kbn/expression-xy-plugin/public'; import { act } from 'react-dom/test-utils'; +import { getKbnPalettes } from '@kbn/palettes'; describe('XY Config panels', () => { let frame: FramePublicAPI; @@ -63,6 +64,7 @@ describe('XY Config panels', () => { }} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} @@ -91,6 +93,7 @@ describe('XY Config panels', () => { state={state} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} @@ -140,6 +143,7 @@ describe('XY Config panels', () => { state={state} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} @@ -186,6 +190,7 @@ describe('XY Config panels', () => { state={state} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} @@ -239,6 +244,7 @@ describe('XY Config panels', () => { state={state} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} @@ -292,6 +298,7 @@ describe('XY Config panels', () => { state={state} formatFactory={jest.fn()} paletteService={chartPluginMock.createPaletteRegistry()} + palettes={getKbnPalettes({ name: 'amsterdam', darkMode: false })} panelRef={React.createRef()} addLayer={jest.fn()} removeLayer={jest.fn()} diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx index f06f2d861d86..994e254bea95 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/dimension_editor.tsx @@ -14,6 +14,7 @@ import { EuiButtonGroup, EuiFormRow, htmlIdGenerator } from '@elastic/eui'; import { PaletteRegistry, ColorMapping, PaletteOutput } from '@kbn/coloring'; import { getColorCategories } from '@kbn/chart-expressions-common'; import type { ValuesType } from 'utility-types'; +import { KbnPalette, KbnPalettes } from '@kbn/palettes'; import type { VisualizationDimensionEditorProps } from '../../../types'; import { State, XYState, XYDataLayerConfig, YConfig, YAxisMode } from '../types'; import { FormatFactory } from '../../../../common/types'; @@ -45,6 +46,7 @@ export function DataDimensionEditor( props: VisualizationDimensionEditorProps<State> & { formatFactory: FormatFactory; paletteService: PaletteRegistry; + palettes: KbnPalettes; isDarkMode: boolean; } ) { @@ -144,6 +146,7 @@ export function DataDimensionEditor( setPalette={setPalette} setColorMapping={setColorMapping} paletteService={props.paletteService} + palettes={props.palettes} panelRef={props.panelRef} categories={splitCategories} /> @@ -165,6 +168,7 @@ export function DataDimensionEditor( overwriteColor={overwriteColor} defaultColor={assignedColor} disabledMessage={disabledMessage} + swatches={props.palettes.get(KbnPalette.Default).colors(10)} setConfig={setConfig} /> diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx index cd9bb6644399..e36e19dd80c2 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/reference_line_config_panel/reference_line_panel.tsx @@ -17,6 +17,7 @@ import { TextDecorationSetting, } from '@kbn/visualization-ui-components'; import { useDebouncedValue } from '@kbn/visualization-utils'; +import { KbnPalette, KbnPalettes } from '@kbn/palettes'; import { referenceLineIconsSet } from '../../../../shared_components/icon_set'; import type { VisualizationDimensionEditorProps } from '../../../../types'; import { State, XYState, XYReferenceLineLayerConfig, YConfig } from '../../types'; @@ -32,6 +33,7 @@ export const ReferenceLinePanel = ( props: VisualizationDimensionEditorProps<State> & { formatFactory: FormatFactory; paletteService: PaletteRegistry; + palettes: KbnPalettes; } ) => { const { state, setState, layerId, accessor } = props; @@ -98,6 +100,7 @@ export const ReferenceLinePanel = ( defaultColor={defaultReferenceLineColor} setConfig={setConfig} disableHelpTooltip + swatches={props.palettes.get(KbnPalette.Default).colors(10)} label={i18n.translate('xpack.lens.xyChart.lineColor.label', { defaultMessage: 'Color', })} diff --git a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/visual_options_popover/missing_values_option.tsx b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/visual_options_popover/missing_values_option.tsx index d39a1a410d6a..c3275a5e643f 100644 --- a/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/visual_options_popover/missing_values_option.tsx +++ b/x-pack/plugins/lens/public/visualizations/xy/xy_config_panel/visual_options_popover/missing_values_option.tsx @@ -88,6 +88,7 @@ export const MissingValuesOptions: React.FC<MissingValuesOptionProps> = ({ {fittingFunction && fittingFunction !== FittingFunctions.NONE && ( <> <EuiFormRow + fullWidth display="columnCompressed" label={i18n.translate('xpack.lens.xyChart.endValuesLabel', { defaultMessage: 'End values', @@ -117,6 +118,7 @@ export const MissingValuesOptions: React.FC<MissingValuesOptionProps> = ({ /> </EuiFormRow> <EuiFormRow + fullWidth label={i18n.translate('xpack.lens.xyChart.missingValuesStyle', { defaultMessage: 'Show as dotted line', })} diff --git a/x-pack/plugins/lens/tsconfig.json b/x-pack/plugins/lens/tsconfig.json index 39ec69385644..ca1a9b8fd0b1 100644 --- a/x-pack/plugins/lens/tsconfig.json +++ b/x-pack/plugins/lens/tsconfig.json @@ -114,6 +114,7 @@ "@kbn/es-types", "@kbn/esql-datagrid", "@kbn/transpose-utils", + "@kbn/palettes", "@kbn/core-application-browser", "@kbn/core-chrome-browser", "@kbn/core-capabilities-common", diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts index 7cb2311c5e10..95ca6285f0d7 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts +++ b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_item.test.ts @@ -5,14 +5,10 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; -import * as api from '@kbn/securitysolution-list-api'; -import { PersistHookProps } from '@kbn/securitysolution-io-ts-list-types'; -import { - ReturnPersistExceptionItem, - usePersistExceptionItem, -} from '@kbn/securitysolution-list-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { coreMock } from '@kbn/core/public/mocks'; +import { usePersistExceptionItem } from '@kbn/securitysolution-list-hooks'; +import * as api from '@kbn/securitysolution-list-api/src/api'; import { ENTRIES_WITH_IDS } from '../../../common/constants.mock'; import { getCreateExceptionListItemSchemaMock } from '../../../common/schemas/request/create_exception_list_item_schema.mock'; @@ -20,16 +16,22 @@ import { getUpdateExceptionListItemSchemaMock } from '../../../common/schemas/re import { getExceptionListItemSchemaMock } from '../../../common/schemas/response/exception_list_item_schema.mock'; const mockKibanaHttpService = coreMock.createStart().http; -jest.mock('@kbn/securitysolution-list-api'); // TODO: Port this test over to packages/kbn-securitysolution-list-hooks/src/use_persist_exception_item/index.test.ts once the other mocks are added to the kbn package system describe('usePersistExceptionItem', () => { + let addExceptionListItemSpy: jest.SpyInstance<ReturnType<typeof api.addEndpointExceptionList>>; + let updateExceptionListItemSpy: jest.SpyInstance<ReturnType<typeof api.updateExceptionListItem>>; const onError = jest.fn(); + beforeAll(() => { + addExceptionListItemSpy = jest.spyOn(api, 'addExceptionListItem'); + updateExceptionListItemSpy = jest.spyOn(api, 'updateExceptionListItem'); + }); + beforeEach(() => { - jest.spyOn(api, 'addExceptionListItem').mockResolvedValue(getExceptionListItemSchemaMock()); - jest.spyOn(api, 'updateExceptionListItem').mockResolvedValue(getExceptionListItemSchemaMock()); + addExceptionListItemSpy.mockResolvedValue(getExceptionListItemSchemaMock()); + updateExceptionListItemSpy.mockResolvedValue(getExceptionListItemSchemaMock()); }); afterEach(() => { @@ -37,7 +39,7 @@ describe('usePersistExceptionItem', () => { }); test('initializes hook', async () => { - const { result } = renderHook<PersistHookProps, ReturnPersistExceptionItem>(() => + const { result } = renderHook(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError }) ); @@ -45,101 +47,106 @@ describe('usePersistExceptionItem', () => { }); test('"isLoading" is "true" when exception item is being saved', async () => { - await act(async () => { - const { result, rerender, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionItem - >(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError })); + const { result } = renderHook(() => + usePersistExceptionItem({ http: mockKibanaHttpService, onError }) + ); - await waitForNextUpdate(); + await waitFor(() => + expect(result.current).toEqual([{ isLoading: false, isSaved: false }, result.current[1]]) + ); + + act(() => { result.current[1](getCreateExceptionListItemSchemaMock()); - rerender(); + }); - expect(result.current).toEqual([{ isLoading: true, isSaved: false }, result.current[1]]); + expect(result.current).toEqual([{ isLoading: true, isSaved: false }, result.current[1]]); + + await waitFor(() => { + expect(addExceptionListItemSpy).toHaveBeenCalled(); + expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); }); }); test('"isSaved" is "true" when exception item saved successfully', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionItem - >(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError })); + const { result } = renderHook(() => + usePersistExceptionItem({ http: mockKibanaHttpService, onError }) + ); - await waitForNextUpdate(); + act(() => { result.current[1](getCreateExceptionListItemSchemaMock()); - await waitForNextUpdate(); - - expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); }); + + await waitFor(() => + expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]) + ); }); test('it invokes "updateExceptionListItem" when payload has "id"', async () => { - const addExceptionListItem = jest.spyOn(api, 'addExceptionListItem'); - const updateExceptionListItem = jest.spyOn(api, 'updateExceptionListItem'); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionItem - >(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError })); - - await waitForNextUpdate(); + const { result } = renderHook(() => + usePersistExceptionItem({ http: mockKibanaHttpService, onError }) + ); + + await waitFor(() => new Promise((resolve) => resolve(null))); + + act(() => { // NOTE: Take note here passing in an exception item where it's // entries have been enriched with ids to ensure that they get stripped // before the call goes through result.current[1]({ ...getUpdateExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }); - await waitForNextUpdate(); + }); + await waitFor(() => { expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); - expect(addExceptionListItem).not.toHaveBeenCalled(); - expect(updateExceptionListItem).toHaveBeenCalledWith({ - http: mockKibanaHttpService, - listItem: getUpdateExceptionListItemSchemaMock(), - signal: new AbortController().signal, - }); + }); + + expect(addExceptionListItemSpy).not.toHaveBeenCalled(); + expect(updateExceptionListItemSpy).toHaveBeenCalledWith({ + http: mockKibanaHttpService, + listItem: getUpdateExceptionListItemSchemaMock(), + signal: expect.any(AbortSignal), }); }); test('it invokes "addExceptionListItem" when payload does not have "id"', async () => { - const updateExceptionListItem = jest.spyOn(api, 'updateExceptionListItem'); - const addExceptionListItem = jest.spyOn(api, 'addExceptionListItem'); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionItem - >(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError })); - - await waitForNextUpdate(); + const { result } = renderHook(() => + usePersistExceptionItem({ http: mockKibanaHttpService, onError }) + ); + + await waitFor(() => new Promise((resolve) => resolve(null))); + + act(() => { // NOTE: Take note here passing in an exception item where it's // entries have been enriched with ids to ensure that they get stripped // before the call goes through result.current[1]({ ...getCreateExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }); - await waitForNextUpdate(); + }); + await waitFor(() => { expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); - expect(updateExceptionListItem).not.toHaveBeenCalled(); - expect(addExceptionListItem).toHaveBeenCalledWith({ - http: mockKibanaHttpService, - listItem: getCreateExceptionListItemSchemaMock(), - signal: new AbortController().signal, - }); + }); + + expect(updateExceptionListItemSpy).not.toHaveBeenCalled(); + expect(addExceptionListItemSpy).toHaveBeenCalledWith({ + http: mockKibanaHttpService, + listItem: getCreateExceptionListItemSchemaMock(), + signal: expect.any(AbortSignal), }); }); test('"onError" callback is invoked and "isSaved" is "false" when api call fails', async () => { const error = new Error('persist rule failed'); - jest.spyOn(api, 'addExceptionListItem').mockRejectedValue(error); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionItem - >(() => usePersistExceptionItem({ http: mockKibanaHttpService, onError })); + addExceptionListItemSpy.mockRejectedValue(error); - await waitForNextUpdate(); - result.current[1](getCreateExceptionListItemSchemaMock()); - await waitForNextUpdate(); + const { result } = renderHook(() => + usePersistExceptionItem({ http: mockKibanaHttpService, onError }) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + act(() => { + result.current[1](getCreateExceptionListItemSchemaMock()); + }); + await waitFor(() => { expect(result.current).toEqual([{ isLoading: false, isSaved: false }, result.current[1]]); expect(onError).toHaveBeenCalledWith(error); }); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts index 09257c489a89..c27888b6d8cc 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts +++ b/x-pack/plugins/lists/public/exceptions/hooks/persist_exception_list.test.ts @@ -5,13 +5,9 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import * as api from '@kbn/securitysolution-list-api'; -import { PersistHookProps } from '@kbn/securitysolution-io-ts-list-types'; -import { - ReturnPersistExceptionList, - usePersistExceptionList, -} from '@kbn/securitysolution-list-hooks'; +import { usePersistExceptionList } from '@kbn/securitysolution-list-hooks'; import { coreMock } from '@kbn/core/public/mocks'; import { getCreateExceptionListSchemaMock } from '../../../common/schemas/request/create_exception_list_schema.mock'; @@ -37,7 +33,7 @@ describe('usePersistExceptionList', () => { }); test('initializes hook', async () => { - const { result } = renderHook<PersistHookProps, ReturnPersistExceptionList>(() => + const { result } = renderHook(() => usePersistExceptionList({ http: mockKibanaHttpService, onError }) ); @@ -45,46 +41,48 @@ describe('usePersistExceptionList', () => { }); test('"isLoading" is "true" when exception item is being saved', async () => { - await act(async () => { - const { result, rerender, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionList - >(() => usePersistExceptionList({ http: mockKibanaHttpService, onError })); - await waitForNextUpdate(); + const { result, rerender } = renderHook(() => + usePersistExceptionList({ http: mockKibanaHttpService, onError }) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + act(() => { result.current[1](getCreateExceptionListSchemaMock()); - rerender(); - - expect(result.current).toEqual([{ isLoading: true, isSaved: false }, result.current[1]]); }); + rerender(); + + expect(result.current).toEqual([{ isLoading: true, isSaved: false }, result.current[1]]); }); test('"isSaved" is "true" when exception item saved successfully', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionList - >(() => usePersistExceptionList({ http: mockKibanaHttpService, onError })); - await waitForNextUpdate(); - result.current[1](getCreateExceptionListSchemaMock()); - await waitForNextUpdate(); + const { result } = renderHook(() => + usePersistExceptionList({ http: mockKibanaHttpService, onError }) + ); - expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); + await waitFor(() => new Promise((resolve) => resolve(null))); + + act(() => { + result.current[1](getCreateExceptionListSchemaMock()); }); + + await waitFor(() => + expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]) + ); }); test('it invokes "updateExceptionList" when payload has "id"', async () => { const addException = jest.spyOn(api, 'addExceptionList'); const updateException = jest.spyOn(api, 'updateExceptionList'); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionList - >(() => usePersistExceptionList({ http: mockKibanaHttpService, onError })); + const { result } = renderHook(() => + usePersistExceptionList({ http: mockKibanaHttpService, onError }) + ); + + await waitFor(() => new Promise((resolve) => resolve(null))); - await waitForNextUpdate(); + act(() => { result.current[1](getUpdateExceptionListSchemaMock()); - await waitForNextUpdate(); + }); + await waitFor(() => { expect(result.current).toEqual([{ isLoading: false, isSaved: true }, result.current[1]]); expect(addException).not.toHaveBeenCalled(); expect(updateException).toHaveBeenCalled(); @@ -95,15 +93,14 @@ describe('usePersistExceptionList', () => { const error = new Error('persist rule failed'); jest.spyOn(api, 'addExceptionList').mockRejectedValue(error); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - PersistHookProps, - ReturnPersistExceptionList - >(() => usePersistExceptionList({ http: mockKibanaHttpService, onError })); - await waitForNextUpdate(); + const { result } = renderHook(() => + usePersistExceptionList({ http: mockKibanaHttpService, onError }) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + act(() => { result.current[1](getCreateExceptionListSchemaMock()); - await waitForNextUpdate(); - + }); + await waitFor(() => { expect(result.current).toEqual([{ isLoading: false, isSaved: false }, result.current[1]]); expect(onError).toHaveBeenCalledWith(error); }); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts index 55c8ebde7ceb..a980261ba5f8 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts +++ b/x-pack/plugins/lists/public/exceptions/hooks/use_api.test.ts @@ -5,9 +5,9 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import * as api from '@kbn/securitysolution-list-api'; -import { ExceptionsApi, useApi } from '@kbn/securitysolution-list-hooks'; +import { useApi } from '@kbn/securitysolution-list-hooks'; import type { AddExceptionListItemProps, ApiCallByIdProps, @@ -16,7 +16,6 @@ import type { UpdateExceptionListItemProps, } from '@kbn/securitysolution-io-ts-list-types'; import { coreMock } from '@kbn/core/public/mocks'; -import { HttpStart } from '@kbn/core/public'; import { ENTRIES_WITH_IDS } from '../../../common/constants.mock'; import { getUpdateExceptionListItemSchemaMock } from '../../../common/schemas/request/update_exception_list_item_schema.mock'; @@ -51,54 +50,50 @@ describe('useApi', () => { .spyOn(api, 'deleteExceptionListItemById') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = payload; + const { id, namespace_type: namespaceType } = payload; + await act(async () => { await result.current.deleteExceptionItem({ id, namespaceType, onError: jest.fn(), onSuccess: onSuccessMock, }); + }); - const expected: ApiCallByIdProps = { - http: mockKibanaHttpService, - id, - namespaceType, - signal: new AbortController().signal, - }; + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; - expect(spyOnDeleteExceptionListItemById).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalled(); - }); + expect(spyOnDeleteExceptionListItemById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); }); test('invokes "onError" callback if "deleteExceptionListItemById" fails', async () => { const mockError = new Error('failed to delete item'); jest.spyOn(api, 'deleteExceptionListItemById').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = getExceptionListItemSchemaMock(); + const { id, namespace_type: namespaceType } = getExceptionListItemSchemaMock(); + await act(async () => { await result.current.deleteExceptionItem({ id, namespaceType, onError: onErrorMock, onSuccess: jest.fn(), }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); @@ -110,54 +105,50 @@ describe('useApi', () => { .spyOn(api, 'deleteExceptionListById') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = payload; + const { id, namespace_type: namespaceType } = payload; + await act(async () => { await result.current.deleteExceptionList({ id, namespaceType, onError: jest.fn(), onSuccess: onSuccessMock, }); + }); - const expected: ApiCallByIdProps = { - http: mockKibanaHttpService, - id, - namespaceType, - signal: new AbortController().signal, - }; + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; - expect(spyOnDeleteExceptionListById).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalled(); - }); + expect(spyOnDeleteExceptionListById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); }); test('invokes "onError" callback if "deleteExceptionListById" fails', async () => { const mockError = new Error('failed to delete item'); jest.spyOn(api, 'deleteExceptionListById').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + await act(async () => { await result.current.deleteExceptionList({ id, namespaceType, onError: onErrorMock, onSuccess: jest.fn(), }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); @@ -169,58 +160,54 @@ describe('useApi', () => { .spyOn(api, 'fetchExceptionListItemById') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = payload; + const { id, namespace_type: namespaceType } = payload; + await act(async () => { await result.current.getExceptionItem({ id, namespaceType, onError: jest.fn(), onSuccess: onSuccessMock, }); - - const expected: ApiCallByIdProps = { - http: mockKibanaHttpService, - id, - namespaceType, - signal: new AbortController().signal, - }; - const expectedExceptionListItem = { - ...getExceptionListItemSchemaMock(), - entries: ENTRIES_WITH_IDS, - }; - - expect(spyOnFetchExceptionListItemById).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalledWith(expectedExceptionListItem); }); + + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; + const expectedExceptionListItem = { + ...getExceptionListItemSchemaMock(), + entries: ENTRIES_WITH_IDS, + }; + + expect(spyOnFetchExceptionListItemById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalledWith(expectedExceptionListItem); }); test('invokes "onError" callback if "fetchExceptionListItemById" fails', async () => { const mockError = new Error('failed to delete item'); jest.spyOn(api, 'fetchExceptionListItemById').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + await act(async () => { await result.current.getExceptionItem({ id, namespaceType, onError: onErrorMock, onSuccess: jest.fn(), }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); @@ -232,54 +219,50 @@ describe('useApi', () => { .spyOn(api, 'fetchExceptionListById') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = payload; + const { id, namespace_type: namespaceType } = payload; + await act(async () => { await result.current.getExceptionList({ id, namespaceType, onError: jest.fn(), onSuccess: onSuccessMock, }); + }); - const expected: ApiCallByIdProps = { - http: mockKibanaHttpService, - id, - namespaceType, - signal: new AbortController().signal, - }; + const expected: ApiCallByIdProps = { + http: mockKibanaHttpService, + id, + namespaceType, + signal: new AbortController().signal, + }; - expect(spyOnFetchExceptionListById).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalled(); - }); + expect(spyOnFetchExceptionListById).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); }); test('invokes "onError" callback if "fetchExceptionListById" fails', async () => { const mockError = new Error('failed to delete item'); jest.spyOn(api, 'fetchExceptionListById').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); - const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + const { id, namespace_type: namespaceType } = getExceptionListSchemaMock(); + await act(async () => { await result.current.getExceptionList({ id, namespaceType, onError: onErrorMock, onSuccess: jest.fn(), }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); @@ -291,12 +274,10 @@ describe('useApi', () => { .spyOn(api, 'fetchExceptionListsItemsByListIds') .mockResolvedValue(output); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.getExceptionListsItems({ lists: [ { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, @@ -311,28 +292,28 @@ describe('useApi', () => { showDetectionsListsOnly: false, showEndpointListsOnly: false, }); + }); - const expected: ApiCallByListIdProps = { - http: mockKibanaHttpService, - listIds: ['list_id'], - namespaceTypes: ['single'], - pagination: { - page: 1, - perPage: 1, - total: 0, - }, - signal: new AbortController().signal, - }; - - expect(spyOnFetchExceptionListsItemsByListIds).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalledWith({ - exceptions: [{ ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }], - pagination: { - page: 1, - perPage: 1, - total: 1, - }, - }); + const expected: ApiCallByListIdProps = { + http: mockKibanaHttpService, + listIds: ['list_id'], + namespaceTypes: ['single'], + pagination: { + page: 1, + perPage: 1, + total: 0, + }, + signal: new AbortController().signal, + }; + + expect(spyOnFetchExceptionListsItemsByListIds).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalledWith({ + exceptions: [{ ...getExceptionListItemSchemaMock(), entries: ENTRIES_WITH_IDS }], + pagination: { + page: 1, + perPage: 1, + total: 1, + }, }); }); @@ -343,12 +324,10 @@ describe('useApi', () => { .spyOn(api, 'fetchExceptionListsItemsByListIds') .mockResolvedValue(output); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.getExceptionListsItems({ lists: [ { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, @@ -363,16 +342,16 @@ describe('useApi', () => { showDetectionsListsOnly: false, showEndpointListsOnly: true, }); + }); - expect(spyOnFetchExceptionListsItemsByListIds).not.toHaveBeenCalled(); - expect(onSuccessMock).toHaveBeenCalledWith({ - exceptions: [], - pagination: { - page: 0, - perPage: 20, - total: 0, - }, - }); + expect(spyOnFetchExceptionListsItemsByListIds).not.toHaveBeenCalled(); + expect(onSuccessMock).toHaveBeenCalledWith({ + exceptions: [], + pagination: { + page: 0, + perPage: 20, + total: 0, + }, }); }); @@ -380,12 +359,10 @@ describe('useApi', () => { const mockError = new Error('failed to delete item'); jest.spyOn(api, 'fetchExceptionListsItemsByListIds').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.getExceptionListsItems({ lists: [ { id: 'myListId', listId: 'list_id', namespaceType: 'single', type: 'detection' }, @@ -400,9 +377,9 @@ describe('useApi', () => { showDetectionsListsOnly: false, showEndpointListsOnly: false, }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); @@ -414,24 +391,22 @@ describe('useApi', () => { .spyOn(api, 'addExceptionListItem') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.addExceptionListItem({ listItem: itemToCreate, }); + }); - const expected: AddExceptionListItemProps = { - http: mockKibanaHttpService, - listItem: getCreateExceptionListItemSchemaMock(), - signal: new AbortController().signal, - }; + const expected: AddExceptionListItemProps = { + http: mockKibanaHttpService, + listItem: getCreateExceptionListItemSchemaMock(), + signal: new AbortController().signal, + }; - expect(spyOnFetchExceptionListItemById).toHaveBeenCalledWith(expected); - }); + expect(spyOnFetchExceptionListItemById).toHaveBeenCalledWith(expected); }); }); @@ -443,24 +418,22 @@ describe('useApi', () => { .spyOn(api, 'updateExceptionListItem') .mockResolvedValue(payload); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.updateExceptionListItem({ listItem: itemToUpdate, }); + }); - const expected: UpdateExceptionListItemProps = { - http: mockKibanaHttpService, - listItem: getUpdateExceptionListItemSchemaMock(), - signal: new AbortController().signal, - }; + const expected: UpdateExceptionListItemProps = { + http: mockKibanaHttpService, + listItem: getUpdateExceptionListItemSchemaMock(), + signal: new AbortController().signal, + }; - expect(spyOnUpdateExceptionListItem).toHaveBeenCalledWith(expected); - }); + expect(spyOnUpdateExceptionListItem).toHaveBeenCalledWith(expected); }); }); @@ -471,12 +444,10 @@ describe('useApi', () => { .spyOn(api, 'duplicateExceptionList') .mockResolvedValue(getExceptionListSchemaMock()); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.duplicateExceptionList({ includeExpiredExceptions: false, listId: 'my_list', @@ -484,30 +455,28 @@ describe('useApi', () => { onError: jest.fn(), onSuccess: onSuccessMock, }); + }); - const expected: DuplicateExceptionListProps = { - http: mockKibanaHttpService, - includeExpiredExceptions: false, - listId: 'my_list', - namespaceType: 'single', - signal: new AbortController().signal, - }; + const expected: DuplicateExceptionListProps = { + http: mockKibanaHttpService, + includeExpiredExceptions: false, + listId: 'my_list', + namespaceType: 'single', + signal: new AbortController().signal, + }; - expect(spyOnDuplicateExceptionList).toHaveBeenCalledWith(expected); - expect(onSuccessMock).toHaveBeenCalled(); - }); + expect(spyOnDuplicateExceptionList).toHaveBeenCalledWith(expected); + expect(onSuccessMock).toHaveBeenCalled(); }); test('invokes "onError" callback if "duplicateExceptionList" fails', async () => { const mockError = new Error('failed to duplicate item'); jest.spyOn(api, 'duplicateExceptionList').mockRejectedValue(mockError); - await act(async () => { - const { result, waitForNextUpdate } = renderHook<HttpStart, ExceptionsApi>(() => - useApi(mockKibanaHttpService) - ); - await waitForNextUpdate(); + const { result } = renderHook(() => useApi(mockKibanaHttpService)); + await waitFor(() => new Promise((resolve) => resolve(null))); + await act(async () => { await result.current.duplicateExceptionList({ includeExpiredExceptions: false, listId: 'my_list', @@ -515,9 +484,9 @@ describe('useApi', () => { onError: onErrorMock, onSuccess: jest.fn(), }); - - expect(onErrorMock).toHaveBeenCalledWith(mockError); }); + + expect(onErrorMock).toHaveBeenCalledWith(mockError); }); }); }); diff --git a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts index 0148feff83d5..6c684d199e53 100644 --- a/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts +++ b/x-pack/plugins/lists/public/exceptions/hooks/use_exception_lists.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, waitFor } from '@testing-library/react'; import type { ExceptionListSchema, UseExceptionListsProps, @@ -32,66 +32,53 @@ describe('useExceptionLists', () => { }); test('initializes hook', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseExceptionListsProps, - ReturnExceptionLists - >(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: {}, - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - await waitForNextUpdate(); - - expect(result.current).toEqual([ - true, - [], - { + const { result } = renderHook<ReturnExceptionLists, UseExceptionListsProps>(() => + useExceptionLists({ + errorMessage: 'Uh oh', + filterOptions: {}, + http: mockKibanaHttpService, + initialPagination: { page: 1, perPage: 20, total: 0, }, - expect.any(Function), - expect.any(Function), - { field: 'created_at', order: 'desc' }, - expect.any(Function), - ]); - }); + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, + }) + ); + + expect(result.current).toEqual([ + true, + [], + { + page: 1, + perPage: 20, + total: 0, + }, + expect.any(Function), + expect.any(Function), + { field: 'created_at', order: 'desc' }, + expect.any(Function), + ]); }); test('fetches exception lists', async () => { - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseExceptionListsProps, - ReturnExceptionLists - >(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: {}, - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + const { result } = renderHook(() => + useExceptionLists({ + errorMessage: 'Uh oh', + filterOptions: {}, + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, + }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, + }) + ); + await waitFor(() => { const expectedListItemsResult: ExceptionListSchema[] = getFoundExceptionListSchemaMock().data; expect(result.current).toEqual([ @@ -113,27 +100,23 @@ describe('useExceptionLists', () => { test('does not fetch specific list id if it is added to the hideLists array', async () => { const spyOnfetchExceptionLists = jest.spyOn(api, 'fetchExceptionLists'); - await act(async () => { - const { waitForNextUpdate } = renderHook<UseExceptionListsProps, ReturnExceptionLists>(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: {}, - hideLists: ['listId-1'], - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + renderHook(() => + useExceptionLists({ + errorMessage: 'Uh oh', + filterOptions: {}, + hideLists: ['listId-1'], + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, + }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, + }) + ); + await waitFor(() => expect(spyOnfetchExceptionLists).toHaveBeenCalledWith({ filters: '(not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)', @@ -142,37 +125,33 @@ describe('useExceptionLists', () => { pagination: { page: 1, perPage: 20 }, signal: new AbortController().signal, sort: { field: 'created_at', order: 'desc' }, - }); - }); + }) + ); }); test('applies filters to query', async () => { const spyOnfetchExceptionLists = jest.spyOn(api, 'fetchExceptionLists'); - await act(async () => { - const { waitForNextUpdate } = renderHook<UseExceptionListsProps, ReturnExceptionLists>(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: { - created_by: 'Moi', - name: 'Sample Endpoint', - }, - hideLists: ['listId-1'], - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + renderHook(() => + useExceptionLists({ + errorMessage: 'Uh oh', + filterOptions: { + created_by: 'Moi', + name: 'Sample Endpoint', + }, + hideLists: ['listId-1'], + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, + }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, + }) + ); + await waitFor(() => expect(spyOnfetchExceptionLists).toHaveBeenCalledWith({ filters: '(exception-list.attributes.created_by:Moi OR exception-list-agnostic.attributes.created_by:Moi) AND (exception-list.attributes.name.text:Sample Endpoint OR exception-list-agnostic.attributes.name.text:Sample Endpoint) AND (not exception-list.attributes.list_id: listId-1* AND not exception-list-agnostic.attributes.list_id: listId-1*)', @@ -184,47 +163,60 @@ describe('useExceptionLists', () => { field: 'created_at', order: 'desc', }, - }); - }); + }) + ); }); test('fetches a new exception list and its items when props change', async () => { const spyOnfetchExceptionLists = jest.spyOn(api, 'fetchExceptionLists'); - await act(async () => { - const { rerender, waitForNextUpdate } = renderHook< - UseExceptionListsProps, - ReturnExceptionLists - >( - ({ errorMessage, filterOptions, http, initialPagination, namespaceTypes, notifications }) => - useExceptionLists({ - errorMessage, - filterOptions, - http, - initialPagination, - namespaceTypes, - notifications, - }), - { - initialProps: { - errorMessage: 'Uh oh', - filterOptions: {}, - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single'], - notifications: mockKibanaNotificationsService, + const { rerender } = renderHook<ReturnExceptionLists, UseExceptionListsProps>( + ({ errorMessage, filterOptions, http, initialPagination, namespaceTypes, notifications }) => + useExceptionLists({ + errorMessage, + filterOptions, + http, + initialPagination, + namespaceTypes, + notifications, + }), + { + initialProps: { + errorMessage: 'Uh oh', + filterOptions: {}, + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, }, - } - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + namespaceTypes: ['single' as const], + notifications: mockKibanaNotificationsService, + }, + } + ); - rerender({ + await waitFor(() => new Promise((resolve) => resolve(null))); + + rerender({ + errorMessage: 'Uh oh', + filterOptions: {}, + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, + }, + namespaceTypes: ['single' as const, 'agnostic' as const], + notifications: mockKibanaNotificationsService, + }); + + await waitFor(() => expect(spyOnfetchExceptionLists).toHaveBeenCalledTimes(2)); + }); + + test('fetches list when refreshExceptionList callback invoked', async () => { + const spyOnfetchExceptionLists = jest.spyOn(api, 'fetchExceptionLists'); + const { result } = renderHook<ReturnExceptionLists, UseExceptionListsProps>(() => + useExceptionLists({ errorMessage: 'Uh oh', filterOptions: {}, http: mockKibanaHttpService, @@ -235,49 +227,18 @@ describe('useExceptionLists', () => { }, namespaceTypes: ['single', 'agnostic'], notifications: mockKibanaNotificationsService, - }); - // NOTE: Only need one call here because hook already initilaized - await waitForNextUpdate(); + }) + ); - expect(spyOnfetchExceptionLists).toHaveBeenCalledTimes(2); - }); - }); - - test('fetches list when refreshExceptionList callback invoked', async () => { - const spyOnfetchExceptionLists = jest.spyOn(api, 'fetchExceptionLists'); - await act(async () => { - const { result, waitForNextUpdate } = renderHook< - UseExceptionListsProps, - ReturnExceptionLists - >(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: {}, - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + await waitFor(() => new Promise((resolve) => resolve(null))); - expect(typeof result.current[3]).toEqual('function'); + expect(typeof result.current[3]).toEqual('function'); - if (result.current[4] != null) { - result.current[4](); - } - // NOTE: Only need one call here because hook already initilaized - await waitForNextUpdate(); + if (result.current[4] != null) { + result.current[4](); + } - expect(spyOnfetchExceptionLists).toHaveBeenCalledTimes(2); - }); + await waitFor(() => expect(spyOnfetchExceptionLists).toHaveBeenCalledTimes(2)); }); test('invokes notifications service if "fetchExceptionLists" fails', async () => { @@ -285,26 +246,22 @@ describe('useExceptionLists', () => { const spyOnfetchExceptionLists = jest .spyOn(api, 'fetchExceptionLists') .mockRejectedValue(mockError); - await act(async () => { - const { waitForNextUpdate } = renderHook<UseExceptionListsProps, ReturnExceptionLists>(() => - useExceptionLists({ - errorMessage: 'Uh oh', - filterOptions: {}, - http: mockKibanaHttpService, - initialPagination: { - page: 1, - perPage: 20, - total: 0, - }, - namespaceTypes: ['single', 'agnostic'], - notifications: mockKibanaNotificationsService, - }) - ); - // NOTE: First `waitForNextUpdate` is initialization - // Second call applies the params - await waitForNextUpdate(); - await waitForNextUpdate(); + renderHook(() => + useExceptionLists({ + errorMessage: 'Uh oh', + filterOptions: {}, + http: mockKibanaHttpService, + initialPagination: { + page: 1, + perPage: 20, + total: 0, + }, + namespaceTypes: ['single', 'agnostic'], + notifications: mockKibanaNotificationsService, + }) + ); + await waitFor(() => { expect(mockKibanaNotificationsService.toasts.addError).toHaveBeenCalledWith(mockError, { title: 'Uh oh', }); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts b/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts index 3e91e9b26983..7021d49940f2 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts +++ b/x-pack/plugins/lists/public/lists/hooks/use_create_list_index.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { useCreateListIndex } from '@kbn/securitysolution-list-hooks'; import * as Api from '@kbn/securitysolution-list-api'; import { httpServiceMock } from '@kbn/core/public/mocks'; @@ -28,52 +28,49 @@ describe('useCreateListIndex', () => { }); it('should call Api.createListIndex when start() executes', async () => { - const { result, waitForNextUpdate } = renderHook(() => useCreateListIndex({ http: httpMock }), { + const { result } = renderHook(() => useCreateListIndex({ http: httpMock }), { wrapper: queryWrapper, }); act(() => { result.current.start(); }); - await waitForNextUpdate(); - - expect(Api.createListIndex).toHaveBeenCalledWith(expect.objectContaining({ http: httpMock })); + await waitFor(() => + expect(Api.createListIndex).toHaveBeenCalledWith(expect.objectContaining({ http: httpMock })) + ); }); it('should call onError callback when Api.createListIndex fails', async () => { const onError = jest.fn(); jest.spyOn(Api, 'createListIndex').mockRejectedValue(new Error('Mocked error')); - const { result, waitForNextUpdate } = renderHook( - () => useCreateListIndex({ http: httpMock, onError }), - { wrapper: queryWrapper } - ); + const { result } = renderHook(() => useCreateListIndex({ http: httpMock, onError }), { + wrapper: queryWrapper, + }); act(() => { result.current.start(); }); - await waitForNextUpdate(); - - expect(onError).toHaveBeenCalledWith(new Error('Mocked error'), undefined, undefined); + await waitFor(() => + expect(onError).toHaveBeenCalledWith(new Error('Mocked error'), undefined, undefined) + ); }); it('should not invalidate read index query on failure', async () => { jest.spyOn(Api, 'createListIndex').mockRejectedValue(new Error('Mocked error')); const invalidateQueriesSpy = jest.spyOn(queryClient, 'invalidateQueries'); - const { result, waitForNextUpdate } = renderHook(() => useCreateListIndex({ http: httpMock }), { + const { result } = renderHook(() => useCreateListIndex({ http: httpMock }), { wrapper: queryWrapper, }); act(() => { result.current.start(); }); - await waitForNextUpdate(); - - expect(invalidateQueriesSpy).not.toHaveBeenCalled(); + await waitFor(() => expect(invalidateQueriesSpy).not.toHaveBeenCalled()); }); it('should invalidate read index query on success', async () => { - const { result, waitForNextUpdate } = renderHook(() => useCreateListIndex({ http: httpMock }), { + const { result } = renderHook(() => useCreateListIndex({ http: httpMock }), { wrapper: queryWrapper, }); const invalidateQueriesSpy = jest.spyOn(queryClient, 'invalidateQueries'); @@ -81,8 +78,8 @@ describe('useCreateListIndex', () => { act(() => { result.current.start(); }); - await waitForNextUpdate(); - - expect(invalidateQueriesSpy).toHaveBeenCalledWith(['detectionEngine', 'listIndex']); + await waitFor(() => + expect(invalidateQueriesSpy).toHaveBeenCalledWith(['detectionEngine', 'listIndex']) + ); }); }); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts b/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts index aac604a89bc8..7a339f3e12a4 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts +++ b/x-pack/plugins/lists/public/lists/hooks/use_delete_list.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { useDeleteList } from '@kbn/securitysolution-list-hooks'; import * as Api from '@kbn/securitysolution-list-api'; import { httpServiceMock } from '@kbn/core/public/mocks'; @@ -25,14 +25,14 @@ describe('useDeleteList', () => { }); it('invokes Api.deleteList', async () => { - const { result, waitForNextUpdate } = renderHook(() => useDeleteList()); + const { result } = renderHook(() => useDeleteList()); act(() => { result.current.start({ http: httpMock, id: 'list' }); }); - await waitForNextUpdate(); - - expect(Api.deleteList).toHaveBeenCalledWith( - expect.objectContaining({ http: httpMock, id: 'list' }) + await waitFor(() => + expect(Api.deleteList).toHaveBeenCalledWith( + expect.objectContaining({ http: httpMock, id: 'list' }) + ) ); }); }); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts b/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts index 4977d585fe43..8f08ad5c8bd0 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts +++ b/x-pack/plugins/lists/public/lists/hooks/use_export_list.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { useExportList } from '@kbn/securitysolution-list-hooks'; import * as Api from '@kbn/securitysolution-list-api'; import { httpServiceMock } from '@kbn/core/public/mocks'; @@ -23,14 +23,14 @@ describe('useExportList', () => { }); it('invokes Api.exportList', async () => { - const { result, waitForNextUpdate } = renderHook(() => useExportList()); + const { result } = renderHook(() => useExportList()); act(() => { result.current.start({ http: httpMock, listId: 'list' }); }); - await waitForNextUpdate(); - - expect(Api.exportList).toHaveBeenCalledWith( - expect.objectContaining({ http: httpMock, listId: 'list' }) + await waitFor(() => + expect(Api.exportList).toHaveBeenCalledWith( + expect.objectContaining({ http: httpMock, listId: 'list' }) + ) ); }); }); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts b/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts index 4a1557e94fe7..d56478a0321b 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts +++ b/x-pack/plugins/lists/public/lists/hooks/use_import_list.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook, waitFor } from '@testing-library/react'; import { useImportList } from '@kbn/securitysolution-list-hooks'; import * as Api from '@kbn/securitysolution-list-api'; import { httpServiceMock } from '@kbn/core/public/mocks'; @@ -32,7 +32,7 @@ describe('useImportList', () => { it('invokes Api.importList', async () => { const fileMock = 'my file' as unknown as File; - const { result, waitForNextUpdate } = renderHook(() => useImportList()); + const { result } = renderHook(() => useImportList()); act(() => { result.current.start({ @@ -42,21 +42,21 @@ describe('useImportList', () => { type: 'keyword', }); }); - await waitForNextUpdate(); - - expect(Api.importList).toHaveBeenCalledWith( - expect.objectContaining({ - file: fileMock, - listId: 'my_list_id', - type: 'keyword', - }) + await waitFor(() => + expect(Api.importList).toHaveBeenCalledWith( + expect.objectContaining({ + file: fileMock, + listId: 'my_list_id', + type: 'keyword', + }) + ) ); }); it('populates result with the response of Api.importList', async () => { const fileMock = 'my file' as unknown as File; - const { result, waitForNextUpdate } = renderHook(() => useImportList()); + const { result } = renderHook(() => useImportList()); act(() => { result.current.start({ @@ -66,15 +66,13 @@ describe('useImportList', () => { type: 'keyword', }); }); - await waitForNextUpdate(); - - expect(result.current.result).toEqual(getListResponseMock()); + await waitFor(() => expect(result.current.result).toEqual(getListResponseMock())); }); it('error is populated if importList rejects', async () => { const fileMock = 'my file' as unknown as File; (Api.importList as jest.Mock).mockRejectedValue(new Error('whoops')); - const { result, waitForNextUpdate } = renderHook(() => useImportList()); + const { result } = renderHook(() => useImportList()); act(() => { result.current.start({ @@ -85,9 +83,9 @@ describe('useImportList', () => { }); }); - await waitForNextUpdate(); - - expect(result.current.result).toBeUndefined(); - expect(result.current.error).toEqual(new Error('whoops')); + await waitFor(() => { + expect(result.current.result).toBeUndefined(); + expect(result.current.error).toEqual(new Error('whoops')); + }); }); }); diff --git a/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts b/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts index dc57825d9acf..643ac2df5b05 100644 --- a/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts +++ b/x-pack/plugins/lists/public/lists/hooks/use_read_list_index.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook, waitFor } from '@testing-library/react'; import { useReadListIndex } from '@kbn/securitysolution-list-hooks'; import * as Api from '@kbn/securitysolution-list-api'; import { httpServiceMock } from '@kbn/core/public/mocks'; @@ -30,16 +30,11 @@ describe.skip('useReadListIndex', () => { }); it('should call Api.readListIndex when is enabled', async () => { - const { waitForNextUpdate } = renderHook( - () => useReadListIndex({ http: httpMock, isEnabled: true }), - { - wrapper: queryWrapper, - } - ); - - await waitForNextUpdate(); + renderHook(() => useReadListIndex({ http: httpMock, isEnabled: true }), { + wrapper: queryWrapper, + }); - expect(Api.readListIndex).toHaveBeenCalled(); + await waitFor(() => expect(Api.readListIndex).toHaveBeenCalled()); }); it('should not call Api.readListIndex when is not enabled', async () => { @@ -54,15 +49,10 @@ describe.skip('useReadListIndex', () => { const onError = jest.fn(); jest.spyOn(Api, 'readListIndex').mockRejectedValue(new Error('Mocked error')); - const { waitForNextUpdate } = renderHook( - () => useReadListIndex({ http: httpMock, isEnabled: true, onError }), - { - wrapper: queryWrapper, - } - ); - - await waitForNextUpdate(); + renderHook(() => useReadListIndex({ http: httpMock, isEnabled: true, onError }), { + wrapper: queryWrapper, + }); - expect(onError).toHaveBeenCalledWith(new Error('Mocked error')); + await waitFor(() => expect(onError).toHaveBeenCalledWith(new Error('Mocked error'))); }); }); diff --git a/x-pack/plugins/logstash/kibana.jsonc b/x-pack/plugins/logstash/kibana.jsonc index 83665c1ed344..2242e6254fff 100644 --- a/x-pack/plugins/logstash/kibana.jsonc +++ b/x-pack/plugins/logstash/kibana.jsonc @@ -4,7 +4,7 @@ "owner": [ "@elastic/logstash" ], - "group": "observability", + "group": "platform", "visibility": "private", "plugin": { "id": "logstash", diff --git a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx index 3e09a7e0fd81..0bc116f254e9 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/region_map/region_map_renderer.tsx @@ -12,7 +12,7 @@ import { dynamic } from '@kbn/shared-ux-utility'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import type { RegionMapVisRenderValue } from './region_map_fn'; import { REGION_MAP_RENDER } from './types'; -import { getAnalytics, getCoreI18n, getTheme } from '../../kibana_services'; +import { getCore } from '../../kibana_services'; const Component = dynamic(async () => { const { RegionMapVisualization } = await import('./region_map_visualization'); @@ -40,11 +40,7 @@ export const regionMapRenderer = { }; render( - <KibanaRenderContextProvider - analytics={getAnalytics()} - i18n={getCoreI18n()} - theme={getTheme()} - > + <KibanaRenderContextProvider {...getCore()}> <Component {...props} /> </KibanaRenderContextProvider>, domNode diff --git a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx index 9bc828e617bb..f3079825df3e 100644 --- a/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx +++ b/x-pack/plugins/maps/public/legacy_visualizations/tile_map/tile_map_renderer.tsx @@ -12,7 +12,7 @@ import { dynamic } from '@kbn/shared-ux-utility'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import type { TileMapVisRenderValue } from './tile_map_fn'; import { TILE_MAP_RENDER } from './types'; -import { getAnalytics, getCoreI18n, getTheme } from '../../kibana_services'; +import { getCore } from '../../kibana_services'; const Component = dynamic(async () => { const { TileMapVisualization } = await import('./tile_map_visualization'); @@ -40,11 +40,7 @@ export const tileMapRenderer = { }; render( - <KibanaRenderContextProvider - analytics={getAnalytics()} - i18n={getCoreI18n()} - theme={getTheme()} - > + <KibanaRenderContextProvider {...getCore()}> <Component {...props} /> </KibanaRenderContextProvider>, domNode diff --git a/x-pack/plugins/maps/public/lens/choropleth_chart/expression_renderer.tsx b/x-pack/plugins/maps/public/lens/choropleth_chart/expression_renderer.tsx index 6e7e9a2da422..988affb8fa7e 100644 --- a/x-pack/plugins/maps/public/lens/choropleth_chart/expression_renderer.tsx +++ b/x-pack/plugins/maps/public/lens/choropleth_chart/expression_renderer.tsx @@ -15,7 +15,7 @@ import type { KibanaExecutionContext } from '@kbn/core-execution-context-common' import { ChartSizeEvent } from '@kbn/chart-expressions-common'; import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render'; import type { MapsPluginStartDependencies } from '../../plugin'; -import { getAnalytics, getCoreI18n, getTheme } from '../../kibana_services'; +import { getCore } from '../../kibana_services'; import type { ChoroplethChartProps } from './types'; export const RENDERER_ID = 'lens_choropleth_chart_renderer'; @@ -99,11 +99,7 @@ export function getExpressionRenderer(coreSetup: CoreSetup<MapsPluginStartDepend handlers.event(chartSizeEvent); ReactDOM.render( - <KibanaRenderContextProvider - analytics={getAnalytics()} - i18n={getCoreI18n()} - theme={getTheme()} - > + <KibanaRenderContextProvider {...getCore()}> <ChoroplethChart {...config} formatFactory={plugins.fieldFormats.deserialize} diff --git a/x-pack/plugins/maps/public/render_app.tsx b/x-pack/plugins/maps/public/render_app.tsx index 71caec5db8c4..a1bf84746a76 100644 --- a/x-pack/plugins/maps/public/render_app.tsx +++ b/x-pack/plugins/maps/public/render_app.tsx @@ -18,9 +18,6 @@ import type { SavedObjectTaggingPluginStart } from '@kbn/saved-objects-tagging-p import { TableListViewKibanaProvider } from '@kbn/content-management-table-list-view-table'; import { getCoreChrome, - getAnalytics, - getCoreI18n, - getTheme, getMapsCapabilities, getEmbeddableService, getDocLinks, @@ -110,7 +107,7 @@ export async function renderApp( } render( - <KibanaRenderContextProvider analytics={getAnalytics()} i18n={getCoreI18n()} theme={getTheme()}> + <KibanaRenderContextProvider {...getCore()}> <AppUsageTracker> <TableListViewKibanaProvider {...{ diff --git a/x-pack/plugins/monitoring/common/constants.ts b/x-pack/plugins/monitoring/common/constants.ts index 89dcba563778..61dcf1a17df6 100644 --- a/x-pack/plugins/monitoring/common/constants.ts +++ b/x-pack/plugins/monitoring/common/constants.ts @@ -10,6 +10,8 @@ import { CommonAlertParamDetail, ExpressionConfig } from './types/alerts'; import { AlertParamType } from './enums'; import { validateDuration } from './validate_duration'; +export const USAGE_COLLECTION_APP_NAME = 'stack_monitoring'; + /** * Helper string to add as a tag in every logging call */ diff --git a/x-pack/plugins/monitoring/kibana.jsonc b/x-pack/plugins/monitoring/kibana.jsonc index 334ffd05890b..31c4d9f4e10d 100644 --- a/x-pack/plugins/monitoring/kibana.jsonc +++ b/x-pack/plugins/monitoring/kibana.jsonc @@ -4,7 +4,7 @@ "owner": [ "@elastic/stack-monitoring" ], - "group": "observability", + "group": "platform", "visibility": "private", "plugin": { "id": "monitoring", @@ -18,14 +18,11 @@ "features", "data", "navigation", - "observability", - "observabilityShared", "dataViews", "unifiedSearch", "share" ], "optionalPlugins": [ - "infra", "usageCollection", "home", "cloud", @@ -42,4 +39,4 @@ "kibanaReact", ] } -} \ No newline at end of file +} diff --git a/x-pack/plugins/monitoring/public/application/contexts/external_config_context.tsx b/x-pack/plugins/monitoring/public/application/contexts/external_config_context.tsx index e86262defb65..45791507fa72 100644 --- a/x-pack/plugins/monitoring/public/application/contexts/external_config_context.tsx +++ b/x-pack/plugins/monitoring/public/application/contexts/external_config_context.tsx @@ -14,6 +14,7 @@ export interface ExternalConfig { renderReactApp: boolean; staleStatusThresholdSeconds: number; isCcsEnabled: boolean; + logsIndices: string; } export const ExternalConfigContext = createContext({} as ExternalConfig); diff --git a/x-pack/plugins/monitoring/public/application/hooks/use_track_metric.tsx b/x-pack/plugins/monitoring/public/application/hooks/use_track_metric.tsx new file mode 100644 index 000000000000..863f1af6422b --- /dev/null +++ b/x-pack/plugins/monitoring/public/application/hooks/use_track_metric.tsx @@ -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 { useEffect, useMemo } from 'react'; +import { METRIC_TYPE, UiCounterMetricType } from '@kbn/analytics'; +import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { USAGE_COLLECTION_APP_NAME } from '../../../common/constants'; + +/** + * Note: The usage_collection plugin will take care of sending this data to the telemetry server. + * You can find the metrics that are collected by these hooks in Stack Telemetry. + * Search the index `kibana-ui-counter`. You can filter for `eventName` and/or `appName`. + */ + +interface TrackOptions { + metricType?: UiCounterMetricType; + delay?: number; // in ms +} +type EffectDeps = unknown[]; + +interface ServiceDeps { + usageCollection: UsageCollectionSetup; // TODO: This should really be start. Looking into it. +} + +export type TrackMetricOptions = TrackOptions & { metric: string }; +export type UiTracker = ReturnType<typeof useUiTracker>; +export type TrackEvent = (options: TrackMetricOptions) => void; + +export { METRIC_TYPE }; + +export function useUiTracker<Services extends ServiceDeps>(): TrackEvent { + const reportUiCounter = useKibana<Services>().services?.usageCollection?.reportUiCounter; + const trackEvent = useMemo(() => { + return ({ metric, metricType = METRIC_TYPE.COUNT }: TrackMetricOptions) => { + if (reportUiCounter) { + reportUiCounter(USAGE_COLLECTION_APP_NAME, metricType, metric); + } + }; + }, [reportUiCounter]); + return trackEvent; +} + +export function useTrackMetric<Services extends ServiceDeps>( + { metric, metricType = METRIC_TYPE.COUNT, delay = 0 }: TrackMetricOptions, + effectDependencies: EffectDeps = [] +) { + const reportUiCounter = useKibana<Services>().services?.usageCollection?.reportUiCounter; + + useEffect(() => { + if (!reportUiCounter) { + // eslint-disable-next-line no-console + console.log( + 'usageCollection.reportUiCounter is unavailable. Ensure this is setup via <KibanaContextProvider />.' + ); + } else { + let decoratedMetric = metric; + if (delay > 0) { + decoratedMetric += `__delayed_${delay}ms`; + } + const id = setTimeout( + () => reportUiCounter(USAGE_COLLECTION_APP_NAME, metricType, decoratedMetric), + Math.max(delay, 0) + ); + return () => clearTimeout(id); + } + // the dependencies are managed externally + // eslint-disable-next-line react-hooks/exhaustive-deps + }, effectDependencies); +} + +/** + * useTrackPageview is a convenience wrapper for tracking a pageview + * Its metrics will be found at: + * stack_stats.kibana.plugins.ui_metric.{app}.pageview__{path}(__delayed_{n}ms)? + */ +type TrackPageviewProps = TrackOptions & { path: string }; + +export function useTrackPageview<Services extends ServiceDeps>( + { path, ...rest }: TrackPageviewProps, + effectDependencies: EffectDeps = [] +) { + useTrackMetric<Services>({ ...rest, metric: `pageview__${path}` }, effectDependencies); +} diff --git a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx index 88868295b0bc..befe47b3f7c6 100644 --- a/x-pack/plugins/monitoring/public/application/pages/page_template.tsx +++ b/x-pack/plugins/monitoring/public/application/pages/page_template.tsx @@ -9,7 +9,6 @@ import { EuiPage, EuiPageBody, EuiPageTemplate, EuiTab, EuiTabs, EuiSpacer } fro import React, { useContext, useState, useEffect, useCallback, FC, PropsWithChildren } from 'react'; import { useHistory } from 'react-router-dom'; import type { IHttpFetchError, ResponseErrorBody } from '@kbn/core-http-browser'; -import { HeaderMenuPortal } from '@kbn/observability-shared-plugin/public'; import { useTitle } from '../hooks/use_title'; import { MonitoringToolbar } from '../../components/shared/toolbar'; import { useMonitoringTimeContainerContext } from '../hooks/use_monitoring_time'; @@ -25,6 +24,7 @@ import { AlertsDropdown } from '../../alerts/alerts_dropdown'; import { useRequestErrorHandler } from '../hooks/use_request_error_handler'; import { SetupModeToggleButton } from '../../components/setup_mode/toggle_button'; import { HeaderActionMenuContext } from '../contexts/header_action_menu_context'; +import { HeaderMenuPortal } from '../../components/header_menu'; export interface TabMenuItem { id: string; diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu_portal.test.tsx b/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu_portal.test.tsx rename to x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.test.tsx diff --git a/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx b/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.tsx new file mode 100644 index 000000000000..4f7c4bb817e3 --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/header_menu/header_menu_portal.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 React, { useEffect, useMemo } from 'react'; +import { createHtmlPortalNode, InPortal, OutPortal } from 'react-reverse-portal'; +import { toMountPoint } from '@kbn/kibana-react-plugin/public'; +import type { HeaderMenuPortalProps } from '../../types'; + +// eslint-disable-next-line import/no-default-export +export default function HeaderMenuPortal({ + children, + setHeaderActionMenu, + theme$, +}: HeaderMenuPortalProps) { + const portalNode = useMemo(() => createHtmlPortalNode(), []); + + useEffect(() => { + setHeaderActionMenu((element) => { + const mount = toMountPoint(<OutPortal node={portalNode} />, { theme$ }); + return mount(element); + }); + + return () => { + portalNode.unmount(); + setHeaderActionMenu(undefined); + }; + }, [portalNode, setHeaderActionMenu, theme$]); + + return <InPortal node={portalNode}>{children}</InPortal>; +} diff --git a/x-pack/plugins/monitoring/public/components/header_menu/index.tsx b/x-pack/plugins/monitoring/public/components/header_menu/index.tsx new file mode 100644 index 000000000000..f0f39d1f12a3 --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/header_menu/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 React, { lazy, Suspense } from 'react'; +import { EuiLoadingSpinner } from '@elastic/eui'; +import { HeaderMenuPortalProps } from '../../types'; + +const HeaderMenuPortalLazy = lazy(() => import('./header_menu_portal')); + +export function HeaderMenuPortal(props: HeaderMenuPortalProps) { + return ( + <Suspense fallback={<EuiLoadingSpinner />}> + <HeaderMenuPortalLazy {...props} /> + </Suspense> + ); +} diff --git a/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.js.snap b/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.js.snap deleted file mode 100644 index 91b3dea5ab04..000000000000 --- a/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.js.snap +++ /dev/null @@ -1,296 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Logs should render a link to filter by cluster uuid 1`] = ` -<EuiCallOut - iconType="logsApp" - size="m" - title="Want to see more log entries?" -> - <RedirectAppLinks> - <MemoizedFormattedMessage - defaultMessage="Visit {link} to dive deeper." - id="xpack.monitoring.logs.listing.linkText" - values={ - Object { - "link": <EuiLink> - Discover - </EuiLink>, - } - } - /> - </RedirectAppLinks> -</EuiCallOut> -`; - -exports[`Logs should render a link to filter by cluster uuid and index uuid 1`] = ` -<EuiCallOut - iconType="logsApp" - size="m" - title="Want to see more log entries?" -> - <RedirectAppLinks> - <MemoizedFormattedMessage - defaultMessage="Visit {link} to dive deeper." - id="xpack.monitoring.logs.listing.linkText" - values={ - Object { - "link": <EuiLink> - Discover - </EuiLink>, - } - } - /> - </RedirectAppLinks> -</EuiCallOut> -`; - -exports[`Logs should render a link to filter by cluster uuid and node uuid 1`] = ` -<EuiCallOut - iconType="logsApp" - size="m" - title="Want to see more log entries?" -> - <RedirectAppLinks> - <MemoizedFormattedMessage - defaultMessage="Visit {link} to dive deeper." - id="xpack.monitoring.logs.listing.linkText" - values={ - Object { - "link": <EuiLink> - Discover - </EuiLink>, - } - } - /> - </RedirectAppLinks> -</EuiCallOut> -`; - -exports[`Logs should render a reason if the logs are disabled 1`] = ` -<div> - <EuiTitle> - <h1> - Recent Log Entries - </h1> - </EuiTitle> - <EuiText - size="s" - > - <p> - Showing the most recent log entries for this cluster, up to 15 total log entries. - </p> - </EuiText> - <EuiSpacer - size="m" - /> - <Reason - reason={Object {}} - /> - <EuiSpacer - size="m" - /> -</div> -`; - -exports[`Logs should render fewer columns for node or index view 1`] = ` -Array [ - Object { - "field": "timestamp", - "name": "Timestamp", - "render": [Function], - "width": "12%", - }, - Object { - "field": "level", - "name": "Level", - "width": "5%", - }, - Object { - "field": "type", - "name": "Type", - "render": [Function], - "width": "10%", - }, - Object { - "field": "message", - "name": "Message", - "width": "55%", - }, - Object { - "field": "component", - "name": "Component", - "width": "18%", - }, -] -`; - -exports[`Logs should render normally 1`] = ` -<div> - <EuiTitle> - <h1> - Recent Log Entries - </h1> - </EuiTitle> - <EuiText - size="s" - > - <p> - Showing the most recent log entries for this cluster, up to 10 total log entries. - </p> - </EuiText> - <EuiSpacer - size="m" - /> - <EuiBasicTable - columns={ - Array [ - Object { - "field": "timestamp", - "name": "Timestamp", - "render": [Function], - "width": "12%", - }, - Object { - "field": "level", - "name": "Level", - "width": "5%", - }, - Object { - "field": "type", - "name": "Type", - "render": [Function], - "width": "10%", - }, - Object { - "field": "message", - "name": "Message", - "width": "45%", - }, - Object { - "field": "component", - "name": "Component", - "width": "15%", - }, - Object { - "field": "node", - "name": "Node", - "width": "13%", - }, - ] - } - items={ - Array [ - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:49:33.783Z", - "type": "deprecation", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:49:26.781Z", - "type": "deprecation", - }, - Object { - "component": "o.e.c.r.a.DiskThresholdMonitor", - "level": "WARN", - "message": "high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.5gb[6.3%], shards will be relocated away from this node", - "node": "foobar2", - "timestamp": "2019-03-18T12:49:24.414Z", - "type": "server", - }, - Object { - "component": "o.e.c.r.a.DiskThresholdMonitor", - "level": "INFO", - "message": "rerouting shards: [high disk watermark exceeded on one or more nodes]", - "node": "foobar", - "timestamp": "2019-03-18T12:49:24.414Z", - "type": "server", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:49:11.776Z", - "type": "deprecation", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:49:08.770Z", - "type": "deprecation", - }, - Object { - "component": "o.e.c.r.a.DiskThresholdMonitor", - "level": "WARN", - "message": "high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.3gb[6.2%], shards will be relocated away from this node", - "node": "foobar", - "timestamp": "2019-03-18T12:48:59.409Z", - "type": "server", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:48:53.753Z", - "type": "deprecation", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar", - "timestamp": "2019-03-18T12:48:53.753Z", - "type": "deprecation", - }, - Object { - "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", - "level": "WARN", - "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", - "node": "foobar2", - "timestamp": "2019-03-18T12:48:46.745Z", - "type": "deprecation", - }, - ] - } - noItemsMessage={ - <EuiI18n - default="No items found" - token="euiBasicTable.noItemsMessage" - /> - } - tableLayout="fixed" - /> - <EuiSpacer - size="m" - /> - <EuiCallOut - iconType="logsApp" - size="m" - title="Want to see more log entries?" - > - <RedirectAppLinks> - <MemoizedFormattedMessage - defaultMessage="Visit {link} to dive deeper." - id="xpack.monitoring.logs.listing.linkText" - values={ - Object { - "link": <EuiLink> - Discover - </EuiLink>, - } - } - /> - </RedirectAppLinks> - </EuiCallOut> -</div> -`; diff --git a/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.tsx.snap b/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.tsx.snap new file mode 100644 index 000000000000..36ebe98fb014 --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/logs/__snapshots__/logs.test.tsx.snap @@ -0,0 +1,304 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Logs should render a link to filter by cluster uuid 1`] = ` +<EuiCallOut + iconType="logsApp" + size="m" + title="Want to see more log entries?" +> + <RedirectAppLinks> + <MemoizedFormattedMessage + defaultMessage="Visit {link} to dive deeper." + id="xpack.monitoring.logs.listing.linkText" + values={ + Object { + "link": <EuiLink + href="http://localhost:5601/app/discover" + > + Discover + </EuiLink>, + } + } + /> + </RedirectAppLinks> +</EuiCallOut> +`; + +exports[`Logs should render a link to filter by cluster uuid and index uuid 1`] = ` +<EuiCallOut + iconType="logsApp" + size="m" + title="Want to see more log entries?" +> + <RedirectAppLinks> + <MemoizedFormattedMessage + defaultMessage="Visit {link} to dive deeper." + id="xpack.monitoring.logs.listing.linkText" + values={ + Object { + "link": <EuiLink + href="http://localhost:5601/app/discover" + > + Discover + </EuiLink>, + } + } + /> + </RedirectAppLinks> +</EuiCallOut> +`; + +exports[`Logs should render a link to filter by cluster uuid and node uuid 1`] = ` +<EuiCallOut + iconType="logsApp" + size="m" + title="Want to see more log entries?" +> + <RedirectAppLinks> + <MemoizedFormattedMessage + defaultMessage="Visit {link} to dive deeper." + id="xpack.monitoring.logs.listing.linkText" + values={ + Object { + "link": <EuiLink + href="http://localhost:5601/app/discover" + > + Discover + </EuiLink>, + } + } + /> + </RedirectAppLinks> +</EuiCallOut> +`; + +exports[`Logs should render a reason if the logs are disabled 1`] = ` +<div> + <EuiTitle> + <h1> + Recent Log Entries + </h1> + </EuiTitle> + <EuiText + size="s" + > + <p> + Showing the most recent log entries for this cluster, up to 15 total log entries. + </p> + </EuiText> + <EuiSpacer + size="m" + /> + <Reason + reason={Object {}} + /> + <EuiSpacer + size="m" + /> +</div> +`; + +exports[`Logs should render fewer columns for node or index view 1`] = ` +Array [ + Object { + "field": "timestamp", + "name": "Timestamp", + "render": [Function], + "width": "12%", + }, + Object { + "field": "level", + "name": "Level", + "width": "5%", + }, + Object { + "field": "type", + "name": "Type", + "render": [Function], + "width": "10%", + }, + Object { + "field": "message", + "name": "Message", + "width": "55%", + }, + Object { + "field": "component", + "name": "Component", + "width": "18%", + }, +] +`; + +exports[`Logs should render normally 1`] = ` +<div> + <EuiTitle> + <h1> + Recent Log Entries + </h1> + </EuiTitle> + <EuiText + size="s" + > + <p> + Showing the most recent log entries for this cluster, up to 10 total log entries. + </p> + </EuiText> + <EuiSpacer + size="m" + /> + <EuiBasicTable + columns={ + Array [ + Object { + "field": "timestamp", + "name": "Timestamp", + "render": [Function], + "width": "12%", + }, + Object { + "field": "level", + "name": "Level", + "width": "5%", + }, + Object { + "field": "type", + "name": "Type", + "render": [Function], + "width": "10%", + }, + Object { + "field": "message", + "name": "Message", + "width": "45%", + }, + Object { + "field": "component", + "name": "Component", + "width": "15%", + }, + Object { + "field": "node", + "name": "Node", + "width": "13%", + }, + ] + } + items={ + Array [ + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:49:33.783Z", + "type": "deprecation", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:49:26.781Z", + "type": "deprecation", + }, + Object { + "component": "o.e.c.r.a.DiskThresholdMonitor", + "level": "WARN", + "message": "high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.5gb[6.3%], shards will be relocated away from this node", + "node": "foobar2", + "timestamp": "2019-03-18T12:49:24.414Z", + "type": "server", + }, + Object { + "component": "o.e.c.r.a.DiskThresholdMonitor", + "level": "INFO", + "message": "rerouting shards: [high disk watermark exceeded on one or more nodes]", + "node": "foobar", + "timestamp": "2019-03-18T12:49:24.414Z", + "type": "server", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:49:11.776Z", + "type": "deprecation", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:49:08.770Z", + "type": "deprecation", + }, + Object { + "component": "o.e.c.r.a.DiskThresholdMonitor", + "level": "WARN", + "message": "high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.3gb[6.2%], shards will be relocated away from this node", + "node": "foobar", + "timestamp": "2019-03-18T12:48:59.409Z", + "type": "server", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:48:53.753Z", + "type": "deprecation", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar", + "timestamp": "2019-03-18T12:48:53.753Z", + "type": "deprecation", + }, + Object { + "component": "o.e.d.x.m.r.a.RestMonitoringBulkAction", + "level": "WARN", + "message": "[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.", + "node": "foobar2", + "timestamp": "2019-03-18T12:48:46.745Z", + "type": "deprecation", + }, + ] + } + noItemsMessage={ + <EuiI18n + default="No items found" + token="euiBasicTable.noItemsMessage" + /> + } + tableLayout="fixed" + /> + <EuiSpacer + size="m" + /> + <EuiCallOut + iconType="logsApp" + size="m" + title="Want to see more log entries?" + > + <RedirectAppLinks> + <MemoizedFormattedMessage + defaultMessage="Visit {link} to dive deeper." + id="xpack.monitoring.logs.listing.linkText" + values={ + Object { + "link": <EuiLink + href="http://localhost:5601/app/discover" + > + Discover + </EuiLink>, + } + } + /> + </RedirectAppLinks> + </EuiCallOut> +</div> +`; diff --git a/x-pack/plugins/monitoring/public/components/logs/__snapshots__/reason.test.js.snap b/x-pack/plugins/monitoring/public/components/logs/__snapshots__/reason.test.tsx.snap similarity index 100% rename from x-pack/plugins/monitoring/public/components/logs/__snapshots__/reason.test.js.snap rename to x-pack/plugins/monitoring/public/components/logs/__snapshots__/reason.test.tsx.snap diff --git a/x-pack/plugins/monitoring/public/components/logs/index.js b/x-pack/plugins/monitoring/public/components/logs/index.tsx similarity index 100% rename from x-pack/plugins/monitoring/public/components/logs/index.js rename to x-pack/plugins/monitoring/public/components/logs/index.tsx diff --git a/x-pack/plugins/monitoring/public/components/logs/logs.js b/x-pack/plugins/monitoring/public/components/logs/logs.js deleted file mode 100644 index 82fdac6ea1f0..000000000000 --- a/x-pack/plugins/monitoring/public/components/logs/logs.js +++ /dev/null @@ -1,278 +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, { PureComponent, useContext } from 'react'; -import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; -import { upperFirst } from 'lodash'; -import { Legacy } from '../../legacy_shims'; -import { EuiBasicTable, EuiTitle, EuiSpacer, EuiText, EuiCallOut, EuiLink } from '@elastic/eui'; -import { formatDateTimeLocal } from '../../../common/formatting'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { Reason } from './reason'; -import { useKibana } from '@kbn/kibana-react-plugin/public'; -import { ExternalConfigContext } from '../../application/contexts/external_config_context'; - -const getFormattedDateTimeLocal = (timestamp) => { - const timezone = Legacy.shims.uiSettings?.get('dateFormat:tz'); - return formatDateTimeLocal(timestamp, timezone); -}; - -const columnTimestampTitle = i18n.translate('xpack.monitoring.logs.listing.timestampTitle', { - defaultMessage: 'Timestamp', -}); - -const columnLevelTitle = i18n.translate('xpack.monitoring.logs.listing.levelTitle', { - defaultMessage: 'Level', -}); - -const columnTypeTitle = i18n.translate('xpack.monitoring.logs.listing.typeTitle', { - defaultMessage: 'Type', -}); - -const columnMessageTitle = i18n.translate('xpack.monitoring.logs.listing.messageTitle', { - defaultMessage: 'Message', -}); - -const columnComponentTitle = i18n.translate('xpack.monitoring.logs.listing.componentTitle', { - defaultMessage: 'Component', -}); - -const columnNodeTitle = i18n.translate('xpack.monitoring.logs.listing.nodeTitle', { - defaultMessage: 'Node', -}); - -const columns = [ - { - field: 'timestamp', - name: columnTimestampTitle, - width: '12%', - render: (timestamp) => getFormattedDateTimeLocal(timestamp), - }, - { - field: 'level', - name: columnLevelTitle, - width: '5%', - }, - { - field: 'type', - name: columnTypeTitle, - width: '10%', - render: (type) => upperFirst(type), - }, - { - field: 'message', - name: columnMessageTitle, - width: '55%', - }, - { - field: 'component', - name: columnComponentTitle, - width: '18%', - }, -]; - -const clusterColumns = [ - { - field: 'timestamp', - name: columnTimestampTitle, - width: '12%', - render: (timestamp) => getFormattedDateTimeLocal(timestamp), - }, - { - field: 'level', - name: columnLevelTitle, - width: '5%', - }, - { - field: 'type', - name: columnTypeTitle, - width: '10%', - render: (type) => upperFirst(type), - }, - { - field: 'message', - name: columnMessageTitle, - width: '45%', - }, - { - field: 'component', - name: columnComponentTitle, - width: '15%', - }, - { - field: 'node', - name: columnNodeTitle, - width: '13%', - }, -]; - -function getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin, logsIndices) { - const params = []; - if (clusterUuid) { - params.push(`elasticsearch.cluster.uuid:${clusterUuid}`); - } - if (nodeId) { - params.push(`elasticsearch.node.id:${nodeId}`); - } - if (indexUuid) { - params.push(`elasticsearch.index.name:${indexUuid}`); - } - - const filter = params.join(' and '); - const discoverLocator = sharePlugin.url.locators.get('DISCOVER_APP_LOCATOR'); - - const base = discoverLocator.getRedirectUrl({ - dataViewSpec: { - id: logsIndices, - title: logsIndices, - }, - query: { - language: 'kuery', - query: filter, - }, - }); - - return base; -} - -export const Logs = (props) => { - const { - services: { share }, - } = useKibana(); - const externalConfig = useContext(ExternalConfigContext); - return <LogsContent sharePlugin={share} logsIndices={externalConfig.logsIndices} {...props} />; -}; -export class LogsContent extends PureComponent { - renderLogs() { - const { - logs: { enabled, logs }, - nodeId, - indexUuid, - } = this.props; - if (!enabled) { - return null; - } - - return ( - <EuiBasicTable items={logs || []} columns={nodeId || indexUuid ? columns : clusterColumns} /> - ); - } - - renderNoLogs() { - const { - logs: { enabled, reason }, - } = this.props; - if (enabled) { - return null; - } - - return <Reason reason={reason} />; - } - - renderCallout() { - const { capabilities: uiCapabilities, infra, kibanaServices } = Legacy.shims; - const show = uiCapabilities.discover && uiCapabilities.discover.show; - - const { - logs: { enabled }, - nodeId, - clusterUuid, - indexUuid, - sharePlugin, - logsIndices, - } = this.props; - - if (!enabled || !show) { - return null; - } - - return infra ? ( - <EuiCallOut - size="m" - title={i18n.translate('xpack.monitoring.logs.listing.calloutTitle', { - defaultMessage: 'Want to see more log entries?', - })} - iconType="logsApp" - > - <RedirectAppLinks coreStart={kibanaServices}> - <FormattedMessage - id="xpack.monitoring.logs.listing.linkText" - defaultMessage="Visit {link} to dive deeper." - values={{ - link: ( - <EuiLink - href={getLogsUiLink(clusterUuid, nodeId, indexUuid, sharePlugin, logsIndices)} - > - {i18n.translate('xpack.monitoring.logs.listing.calloutLinkText', { - defaultMessage: 'Discover', - })} - </EuiLink> - ), - }} - /> - </RedirectAppLinks> - </EuiCallOut> - ) : null; - } - - render() { - const { - nodeId, - indexUuid, - logs: { limit }, - } = this.props; - - let description; - - if (nodeId) { - description = i18n.translate('xpack.monitoring.logs.listing.nodePageDescription', { - defaultMessage: - 'Showing the most recent log entries for this node, up to {limit} total log entries.', - values: { - limit, - }, - }); - } else if (indexUuid) { - description = i18n.translate('xpack.monitoring.logs.listing.indexPageDescription', { - defaultMessage: - 'Showing the most recent log entries for this index, up to {limit} total log entries.', - values: { - limit, - }, - }); - } else { - description = i18n.translate('xpack.monitoring.logs.listing.clusterPageDescription', { - defaultMessage: - 'Showing the most recent log entries for this cluster, up to {limit} total log entries.', - values: { - limit, - }, - }); - } - - return ( - <div> - <EuiTitle> - <h1> - {i18n.translate('xpack.monitoring.logs.listing.pageTitle', { - defaultMessage: 'Recent Log Entries', - })} - </h1> - </EuiTitle> - <EuiText size="s"> - <p>{description}</p> - </EuiText> - <EuiSpacer size="m" /> - {this.renderLogs()} - {this.renderNoLogs()} - <EuiSpacer size="m" /> - {this.renderCallout()} - </div> - ); - } -} diff --git a/x-pack/plugins/monitoring/public/components/logs/logs.test.js b/x-pack/plugins/monitoring/public/components/logs/logs.test.js deleted file mode 100644 index 9d3f68c85450..000000000000 --- a/x-pack/plugins/monitoring/public/components/logs/logs.test.js +++ /dev/null @@ -1,197 +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 { shallow } from 'enzyme'; -import { LogsContent } from './logs'; -import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; - -jest.mock('../../legacy_shims', () => ({ - Legacy: { - shims: { - getBasePath: () => '', - capabilities: { discover: { show: true } }, - infra: {}, - }, - }, -})); - -const sharePlugin = { - url: { - locators: { - get: () => { - return sharePluginMock.createLocator(); - }, - }, - }, -}; - -const logs = { - enabled: true, - limit: 10, - logs: [ - { - timestamp: '2019-03-18T12:49:33.783Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:49:26.781Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:49:24.414Z', - component: 'o.e.c.r.a.DiskThresholdMonitor', - level: 'WARN', - type: 'server', - node: 'foobar2', - message: - 'high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.5gb[6.3%], shards will be relocated away from this node', - }, - { - timestamp: '2019-03-18T12:49:24.414Z', - component: 'o.e.c.r.a.DiskThresholdMonitor', - level: 'INFO', - type: 'server', - node: 'foobar', - message: 'rerouting shards: [high disk watermark exceeded on one or more nodes]', - }, - { - timestamp: '2019-03-18T12:49:11.776Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:49:08.770Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:48:59.409Z', - component: 'o.e.c.r.a.DiskThresholdMonitor', - level: 'WARN', - type: 'server', - node: 'foobar', - message: - 'high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.3gb[6.2%], shards will be relocated away from this node', - }, - { - timestamp: '2019-03-18T12:48:53.753Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:48:53.753Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - { - timestamp: '2019-03-18T12:48:46.745Z', - component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', - level: 'WARN', - type: 'deprecation', - node: 'foobar2', - message: - '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', - }, - ], -}; - -describe('Logs', () => { - it('should render normally', () => { - const component = shallow( - <LogsContent sharePlugin={sharePlugin} logsIndices={'logs-*,*:logs-*'} logs={logs} /> - ); - expect(component).toMatchSnapshot(); - }); - - it('should render fewer columns for node or index view', () => { - const component = shallow( - <LogsContent - sharePlugin={sharePlugin} - logsIndices={'logs-*,*:logs-*'} - logs={logs} - nodeId="12345" - /> - ); - expect(component.find('EuiBasicTable').prop('columns')).toMatchSnapshot(); - }); - - it('should render a link to filter by cluster uuid', () => { - const component = shallow( - <LogsContent - sharePlugin={sharePlugin} - logsIndices={'logs-*,*:logs-*'} - logs={logs} - clusterUuid="12345" - /> - ); - expect(component.find('EuiCallOut')).toMatchSnapshot(); - }); - - it('should render a link to filter by cluster uuid and node uuid', () => { - const component = shallow( - <LogsContent - sharePlugin={sharePlugin} - logsIndices={'logs-*,*:logs-*'} - logs={logs} - clusterUuid="12345" - nodeId="6789" - /> - ); - expect(component.find('EuiCallOut')).toMatchSnapshot(); - }); - - it('should render a link to filter by cluster uuid and index uuid', () => { - const component = shallow( - <LogsContent - sharePlugin={sharePlugin} - logsIndices={'logs-*,*:logs-*'} - logs={logs} - clusterUuid="12345" - indexUuid="6789" - /> - ); - expect(component.find('EuiCallOut')).toMatchSnapshot(); - }); - - it('should render a reason if the logs are disabled', () => { - const component = shallow( - <LogsContent - sharePlugin={sharePlugin} - logsIndices={'logs-*,*:logs-*'} - logs={{ enabled: false, limit: 15, reason: {} }} - /> - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/monitoring/public/components/logs/logs.test.tsx b/x-pack/plugins/monitoring/public/components/logs/logs.test.tsx new file mode 100644 index 000000000000..f103288a2498 --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/logs/logs.test.tsx @@ -0,0 +1,198 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { shallow } from 'enzyme'; +import { LogsContent } from './logs'; +import { sharePluginMock } from '@kbn/share-plugin/public/mocks'; + +jest.mock('../../legacy_shims', () => ({ + Legacy: { + shims: { + getBasePath: () => '', + capabilities: { discover: { show: true } }, + }, + }, +})); + +const sharePlugin = { + url: { + locators: { + get: () => { + const locatorMock = sharePluginMock.createLocator(); + locatorMock.getRedirectUrl.mockReturnValue('http://localhost:5601/app/discover'); + return locatorMock; + }, + }, + }, +} as unknown as ReturnType<typeof sharePluginMock.createStartContract>; + +const logs = { + enabled: true, + limit: 10, + logs: [ + { + timestamp: '2019-03-18T12:49:33.783Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:49:26.781Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:49:24.414Z', + component: 'o.e.c.r.a.DiskThresholdMonitor', + level: 'WARN', + type: 'server', + node: 'foobar2', + message: + 'high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.5gb[6.3%], shards will be relocated away from this node', + }, + { + timestamp: '2019-03-18T12:49:24.414Z', + component: 'o.e.c.r.a.DiskThresholdMonitor', + level: 'INFO', + type: 'server', + node: 'foobar', + message: 'rerouting shards: [high disk watermark exceeded on one or more nodes]', + }, + { + timestamp: '2019-03-18T12:49:11.776Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:49:08.770Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:48:59.409Z', + component: 'o.e.c.r.a.DiskThresholdMonitor', + level: 'WARN', + type: 'server', + node: 'foobar', + message: + 'high disk watermark [90%] exceeded on [-pH5RhfsRl6FDeTPwD5vEw][Elastic-MBP.local][/Users/chris/Development/repos/kibana/.es/8.0.0/data/nodes/0] free: 29.3gb[6.2%], shards will be relocated away from this node', + }, + { + timestamp: '2019-03-18T12:48:53.753Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:48:53.753Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + { + timestamp: '2019-03-18T12:48:46.745Z', + component: 'o.e.d.x.m.r.a.RestMonitoringBulkAction', + level: 'WARN', + type: 'deprecation', + node: 'foobar2', + message: + '[POST /_xpack/monitoring/_bulk] is deprecated! Use [POST /_monitoring/bulk] instead.', + }, + ], +}; + +describe('Logs', () => { + it('should render normally', () => { + const component = shallow( + <LogsContent sharePlugin={sharePlugin} logsIndices={'logs-*,*:logs-*'} logs={logs} /> + ); + expect(component).toMatchSnapshot(); + }); + + it('should render fewer columns for node or index view', () => { + const component = shallow( + <LogsContent + sharePlugin={sharePlugin} + logsIndices={'logs-*,*:logs-*'} + logs={logs} + nodeId="12345" + /> + ); + expect(component.find('EuiBasicTable').prop('columns')).toMatchSnapshot(); + }); + + it('should render a link to filter by cluster uuid', () => { + const component = shallow( + <LogsContent + sharePlugin={sharePlugin} + logsIndices={'logs-*,*:logs-*'} + logs={logs} + clusterUuid="12345" + /> + ); + expect(component.find('EuiCallOut')).toMatchSnapshot(); + }); + + it('should render a link to filter by cluster uuid and node uuid', () => { + const component = shallow( + <LogsContent + sharePlugin={sharePlugin} + logsIndices={'logs-*,*:logs-*'} + logs={logs} + clusterUuid="12345" + nodeId="6789" + /> + ); + expect(component.find('EuiCallOut')).toMatchSnapshot(); + }); + + it('should render a link to filter by cluster uuid and index uuid', () => { + const component = shallow( + <LogsContent + sharePlugin={sharePlugin} + logsIndices={'logs-*,*:logs-*'} + logs={logs} + clusterUuid="12345" + indexUuid="6789" + /> + ); + expect(component.find('EuiCallOut')).toMatchSnapshot(); + }); + + it('should render a reason if the logs are disabled', () => { + const component = shallow( + <LogsContent + sharePlugin={sharePlugin} + logsIndices={'logs-*,*:logs-*'} + logs={{ enabled: false, limit: 15, reason: {} }} + /> + ); + expect(component).toMatchSnapshot(); + }); +}); diff --git a/x-pack/plugins/monitoring/public/components/logs/logs.tsx b/x-pack/plugins/monitoring/public/components/logs/logs.tsx new file mode 100644 index 000000000000..b17129d90eac --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/logs/logs.tsx @@ -0,0 +1,310 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, { PureComponent, useContext } from 'react'; +import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; +import { upperFirst } from 'lodash'; +import { EuiBasicTable, EuiTitle, EuiSpacer, EuiText, EuiCallOut, EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useKibana } from '@kbn/kibana-react-plugin/public'; +import { SharePluginStart } from '@kbn/share-plugin/public'; +import { Reason, type IReason } from './reason'; +import { formatDateTimeLocal } from '../../../common/formatting'; +import { Legacy } from '../../legacy_shims'; +import { ExternalConfigContext } from '../../application/contexts/external_config_context'; +import { MonitoringStartServices } from '../../types'; + +interface LogsProps { + logs: { + logs?: Array<{ + timestamp: string; + component: string; + level: string; + type: string; + node: string; + message: string; + }>; + enabled: boolean; + limit: number; + reason?: IReason; + }; + nodeId?: string; + indexUuid?: string; + clusterUuid?: string; +} + +interface LogsContentProps extends LogsProps { + sharePlugin: SharePluginStart; + logsIndices: string; +} + +const getFormattedDateTimeLocal = (timestamp: number | Date) => { + const timezone = Legacy.shims.uiSettings?.get('dateFormat:tz'); + return formatDateTimeLocal(timestamp, timezone); +}; + +const columnTimestampTitle = i18n.translate('xpack.monitoring.logs.listing.timestampTitle', { + defaultMessage: 'Timestamp', +}); + +const columnLevelTitle = i18n.translate('xpack.monitoring.logs.listing.levelTitle', { + defaultMessage: 'Level', +}); + +const columnTypeTitle = i18n.translate('xpack.monitoring.logs.listing.typeTitle', { + defaultMessage: 'Type', +}); + +const columnMessageTitle = i18n.translate('xpack.monitoring.logs.listing.messageTitle', { + defaultMessage: 'Message', +}); + +const columnComponentTitle = i18n.translate('xpack.monitoring.logs.listing.componentTitle', { + defaultMessage: 'Component', +}); + +const columnNodeTitle = i18n.translate('xpack.monitoring.logs.listing.nodeTitle', { + defaultMessage: 'Node', +}); + +const columns = [ + { + field: 'timestamp', + name: columnTimestampTitle, + width: '12%', + render: (timestamp: number | Date) => getFormattedDateTimeLocal(timestamp), + }, + { + field: 'level', + name: columnLevelTitle, + width: '5%', + }, + { + field: 'type', + name: columnTypeTitle, + width: '10%', + render: (type: string) => upperFirst(type), + }, + { + field: 'message', + name: columnMessageTitle, + width: '55%', + }, + { + field: 'component', + name: columnComponentTitle, + width: '18%', + }, +]; + +const clusterColumns = [ + { + field: 'timestamp', + name: columnTimestampTitle, + width: '12%', + render: (timestamp: number | Date) => getFormattedDateTimeLocal(timestamp), + }, + { + field: 'level', + name: columnLevelTitle, + width: '5%', + }, + { + field: 'type', + name: columnTypeTitle, + width: '10%', + render: (type: string) => upperFirst(type), + }, + { + field: 'message', + name: columnMessageTitle, + width: '45%', + }, + { + field: 'component', + name: columnComponentTitle, + width: '15%', + }, + { + field: 'node', + name: columnNodeTitle, + width: '13%', + }, +]; + +function getDiscoverLink( + clusterUuid?: string, + nodeId?: string, + indexUuid?: string, + sharePlugin?: SharePluginStart, + logsIndices?: string +) { + const params = []; + if (clusterUuid) { + params.push(`elasticsearch.cluster.uuid:${clusterUuid}`); + } + if (nodeId) { + params.push(`elasticsearch.node.id:${nodeId}`); + } + if (indexUuid) { + params.push(`elasticsearch.index.name:${indexUuid}`); + } + + const filter = params.join(' and '); + const discoverLocator = sharePlugin?.url.locators.get('DISCOVER_APP_LOCATOR'); + + const base = discoverLocator?.getRedirectUrl({ + dataViewSpec: { + id: logsIndices, + title: logsIndices, + }, + query: { + language: 'kuery', + query: filter, + }, + }); + + return base; +} + +export const Logs = (props: LogsProps) => { + const { + services: { share }, + } = useKibana<MonitoringStartServices>(); + const externalConfig = useContext(ExternalConfigContext); + return <LogsContent sharePlugin={share} logsIndices={externalConfig.logsIndices} {...props} />; +}; + +export class LogsContent extends PureComponent<LogsContentProps> { + renderLogs() { + const { + logs: { enabled, logs }, + nodeId, + indexUuid, + } = this.props; + if (!enabled) { + return null; + } + + return ( + <EuiBasicTable items={logs || []} columns={nodeId || indexUuid ? columns : clusterColumns} /> + ); + } + + renderNoLogs() { + const { + logs: { enabled, reason }, + } = this.props; + if (enabled) { + return null; + } + + return <Reason reason={reason} />; + } + + renderCallout() { + const { capabilities: uiCapabilities, kibanaServices } = Legacy.shims; + const show = uiCapabilities.discover && uiCapabilities.discover.show; + + const { + logs: { enabled }, + nodeId, + clusterUuid, + indexUuid, + sharePlugin, + logsIndices, + } = this.props; + + if (!enabled || !show) { + return null; + } + const discoverLink = getDiscoverLink(clusterUuid, nodeId, indexUuid, sharePlugin, logsIndices); + + return discoverLink ? ( + <EuiCallOut + size="m" + title={i18n.translate('xpack.monitoring.logs.listing.calloutTitle', { + defaultMessage: 'Want to see more log entries?', + })} + iconType="logsApp" + > + <RedirectAppLinks coreStart={kibanaServices}> + <FormattedMessage + id="xpack.monitoring.logs.listing.linkText" + defaultMessage="Visit {link} to dive deeper." + values={{ + link: ( + <EuiLink href={discoverLink}> + {i18n.translate('xpack.monitoring.logs.listing.calloutLinkText', { + defaultMessage: 'Discover', + })} + </EuiLink> + ), + }} + /> + </RedirectAppLinks> + </EuiCallOut> + ) : null; + } + + render() { + const { + nodeId, + indexUuid, + logs: { limit }, + } = this.props; + + let description; + + if (nodeId) { + description = i18n.translate('xpack.monitoring.logs.listing.nodePageDescription', { + defaultMessage: + 'Showing the most recent log entries for this node, up to {limit} total log entries.', + values: { + limit, + }, + }); + } else if (indexUuid) { + description = i18n.translate('xpack.monitoring.logs.listing.indexPageDescription', { + defaultMessage: + 'Showing the most recent log entries for this index, up to {limit} total log entries.', + values: { + limit, + }, + }); + } else { + description = i18n.translate('xpack.monitoring.logs.listing.clusterPageDescription', { + defaultMessage: + 'Showing the most recent log entries for this cluster, up to {limit} total log entries.', + values: { + limit, + }, + }); + } + + return ( + <div> + <EuiTitle> + <h1> + {i18n.translate('xpack.monitoring.logs.listing.pageTitle', { + defaultMessage: 'Recent Log Entries', + })} + </h1> + </EuiTitle> + <EuiText size="s"> + <p>{description}</p> + </EuiText> + <EuiSpacer size="m" /> + {this.renderLogs()} + {this.renderNoLogs()} + <EuiSpacer size="m" /> + {this.renderCallout()} + </div> + ); + } +} diff --git a/x-pack/plugins/monitoring/public/components/logs/reason.js b/x-pack/plugins/monitoring/public/components/logs/reason.js deleted file mode 100644 index 4444c818d5cc..000000000000 --- a/x-pack/plugins/monitoring/public/components/logs/reason.js +++ /dev/null @@ -1,193 +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 { EuiCallOut, EuiLink } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { Legacy } from '../../legacy_shims'; -import { Monospace } from '../metricbeat_migration/instruction_steps/components/monospace/monospace'; - -export const Reason = ({ reason }) => { - const filebeatUrl = Legacy.shims.docLinks.links.filebeat.installation; - const elasticsearchUrl = Legacy.shims.docLinks.links.filebeat.elasticsearchModule; - const troubleshootUrl = Legacy.shims.docLinks.links.monitoring.troubleshootKibana; - let title = i18n.translate('xpack.monitoring.logs.reason.defaultTitle', { - defaultMessage: 'No log data found', - }); - let message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.defaultMessage" - defaultMessage="We did not find any log data and we are unable to diagnose why. {link}" - values={{ - link: ( - <EuiLink target="_blank" href={filebeatUrl}> - <FormattedMessage - id="xpack.monitoring.logs.reason.defaultMessageLink" - defaultMessage="Please verify your setup is correct." - /> - </EuiLink> - ), - }} - /> - ); - - if (false === reason.indexPatternExists) { - title = i18n.translate('xpack.monitoring.logs.reason.noIndexPatternTitle', { - defaultMessage: 'No log data found', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noIndexPatternMessage" - defaultMessage="Set up {link}, then configure your Elasticsearch output to your monitoring cluster." - values={{ - link: ( - <EuiLink target="_blank" href={filebeatUrl}> - {i18n.translate('xpack.monitoring.logs.reason.noIndexPatternLink', { - defaultMessage: 'Filebeat', - })} - </EuiLink> - ), - }} - /> - ); - } else if ( - false === reason.indexPatternInTimeRangeExists || - (false === reason.typeExists && reason.typeExistsAtAnyTime) - ) { - title = i18n.translate('xpack.monitoring.logs.reason.noIndexPatternInTimePeriodTitle', { - defaultMessage: 'No logs for the selected time', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noIndexPatternInTimePeriodMessage" - defaultMessage="Use the time filter to adjust your timeframe." - /> - ); - } else if (false === reason.typeExists) { - title = i18n.translate('xpack.monitoring.logs.reason.noTypeTitle', { - defaultMessage: 'No logs for Elasticsearch', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noTypeMessage" - defaultMessage="Follow {link} to set up Elasticsearch." - values={{ - link: ( - <EuiLink target="_blank" href={elasticsearchUrl}> - {i18n.translate('xpack.monitoring.logs.reason.noTypeLink', { - defaultMessage: 'these directions', - })} - </EuiLink> - ), - }} - /> - ); - } else if (false === reason.usingStructuredLogs) { - title = i18n.translate('xpack.monitoring.logs.reason.notUsingStructuredLogsTitle', { - defaultMessage: 'No structured logs found', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.notUsingStructuredLogsMessage" - defaultMessage="Check if the {varPaths} setting {link}." - values={{ - varPaths: <Monospace>var.paths</Monospace>, - link: ( - <EuiLink target="_blank" href={elasticsearchUrl}> - {i18n.translate('xpack.monitoring.logs.reason.notUsingStructuredLogsLink', { - defaultMessage: 'points to JSON logs', - })} - </EuiLink> - ), - }} - /> - ); - } else if (false === reason.clusterExists) { - title = i18n.translate('xpack.monitoring.logs.reason.noClusterTitle', { - defaultMessage: 'No logs for this cluster', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noClusterMessage" - defaultMessage="Check that your {link} is correct." - values={{ - link: ( - <EuiLink target="_blank" href={elasticsearchUrl}> - {i18n.translate('xpack.monitoring.logs.reason.noClusterLink', { - defaultMessage: 'setup', - })} - </EuiLink> - ), - }} - /> - ); - } else if (false === reason.nodeExists) { - title = i18n.translate('xpack.monitoring.logs.reason.noNodeTitle', { - defaultMessage: 'No logs for this Elasticsearch node', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noNodeMessage" - defaultMessage="Check that your {link} is correct." - values={{ - link: ( - <EuiLink target="_blank" href={elasticsearchUrl}> - {i18n.translate('xpack.monitoring.logs.reason.noNodeLink', { - defaultMessage: 'setup', - })} - </EuiLink> - ), - }} - /> - ); - } else if (false === reason.indexExists) { - title = i18n.translate('xpack.monitoring.logs.reason.noIndexTitle', { - defaultMessage: 'No logs for this index', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.noIndexMessage" - defaultMessage="We found logs, but none for this index. If this problem continues, check that your {link} is correct." - values={{ - link: ( - <EuiLink target="_blank" href={elasticsearchUrl}> - {i18n.translate('xpack.monitoring.logs.reason.noIndexLink', { - defaultMessage: 'setup', - })} - </EuiLink> - ), - }} - /> - ); - } else if (false === reason.correctIndexName) { - title = i18n.translate('xpack.monitoring.logs.reason.correctIndexNameTitle', { - defaultMessage: 'Corrupted filebeat index', - }); - message = ( - <FormattedMessage - id="xpack.monitoring.logs.reason.correctIndexNameMessage" - defaultMessage="There is an issue reading from your filebeat indices. {link}." - values={{ - link: ( - <EuiLink target="_blank" href={troubleshootUrl}> - {i18n.translate('xpack.monitoring.logs.reason.correctIndexNameLink', { - defaultMessage: 'Click here for more information', - })} - </EuiLink> - ), - }} - /> - ); - } - - return ( - <EuiCallOut title={title} color="warning" iconType="help"> - <p>{message}</p> - </EuiCallOut> - ); -}; diff --git a/x-pack/plugins/monitoring/public/components/logs/reason.test.js b/x-pack/plugins/monitoring/public/components/logs/reason.test.tsx similarity index 100% rename from x-pack/plugins/monitoring/public/components/logs/reason.test.js rename to x-pack/plugins/monitoring/public/components/logs/reason.test.tsx diff --git a/x-pack/plugins/monitoring/public/components/logs/reason.tsx b/x-pack/plugins/monitoring/public/components/logs/reason.tsx new file mode 100644 index 000000000000..82a4f788df98 --- /dev/null +++ b/x-pack/plugins/monitoring/public/components/logs/reason.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiCallOut, EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { Legacy } from '../../legacy_shims'; +import { Monospace } from '../metricbeat_migration/instruction_steps/components/monospace/monospace'; + +export interface IReason { + indexPatternExists?: boolean; + indexPatternInTimeRangeExists?: boolean; + typeExists?: boolean; + typeExistsAtAnyTime?: boolean; + usingStructuredLogs?: boolean; + clusterExists?: boolean; + nodeExists?: boolean | null; + indexExists?: boolean; + correctIndexName?: boolean; +} + +export const Reason = ({ reason }: { reason?: IReason }) => { + const filebeatUrl = Legacy.shims.docLinks.links.filebeat.installation; + const elasticsearchUrl = Legacy.shims.docLinks.links.filebeat.elasticsearchModule; + const troubleshootUrl = Legacy.shims.docLinks.links.monitoring.troubleshootKibana; + let title = i18n.translate('xpack.monitoring.logs.reason.defaultTitle', { + defaultMessage: 'No log data found', + }); + let message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.defaultMessage" + defaultMessage="We did not find any log data and we are unable to diagnose why. {link}" + values={{ + link: ( + <EuiLink target="_blank" href={filebeatUrl}> + <FormattedMessage + id="xpack.monitoring.logs.reason.defaultMessageLink" + defaultMessage="Please verify your setup is correct." + /> + </EuiLink> + ), + }} + /> + ); + + if (false === reason?.indexPatternExists) { + title = i18n.translate('xpack.monitoring.logs.reason.noIndexPatternTitle', { + defaultMessage: 'No log data found', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noIndexPatternMessage" + defaultMessage="Set up {link}, then configure your Elasticsearch output to your monitoring cluster." + values={{ + link: ( + <EuiLink target="_blank" href={filebeatUrl}> + {i18n.translate('xpack.monitoring.logs.reason.noIndexPatternLink', { + defaultMessage: 'Filebeat', + })} + </EuiLink> + ), + }} + /> + ); + } else if ( + false === reason?.indexPatternInTimeRangeExists || + (false === reason?.typeExists && reason.typeExistsAtAnyTime) + ) { + title = i18n.translate('xpack.monitoring.logs.reason.noIndexPatternInTimePeriodTitle', { + defaultMessage: 'No logs for the selected time', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noIndexPatternInTimePeriodMessage" + defaultMessage="Use the time filter to adjust your timeframe." + /> + ); + } else if (false === reason?.typeExists) { + title = i18n.translate('xpack.monitoring.logs.reason.noTypeTitle', { + defaultMessage: 'No logs for Elasticsearch', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noTypeMessage" + defaultMessage="Follow {link} to set up Elasticsearch." + values={{ + link: ( + <EuiLink target="_blank" href={elasticsearchUrl}> + {i18n.translate('xpack.monitoring.logs.reason.noTypeLink', { + defaultMessage: 'these directions', + })} + </EuiLink> + ), + }} + /> + ); + } else if (false === reason?.usingStructuredLogs) { + title = i18n.translate('xpack.monitoring.logs.reason.notUsingStructuredLogsTitle', { + defaultMessage: 'No structured logs found', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.notUsingStructuredLogsMessage" + defaultMessage="Check if the {varPaths} setting {link}." + values={{ + varPaths: <Monospace>var.paths</Monospace>, + link: ( + <EuiLink target="_blank" href={elasticsearchUrl}> + {i18n.translate('xpack.monitoring.logs.reason.notUsingStructuredLogsLink', { + defaultMessage: 'points to JSON logs', + })} + </EuiLink> + ), + }} + /> + ); + } else if (false === reason?.clusterExists) { + title = i18n.translate('xpack.monitoring.logs.reason.noClusterTitle', { + defaultMessage: 'No logs for this cluster', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noClusterMessage" + defaultMessage="Check that your {link} is correct." + values={{ + link: ( + <EuiLink target="_blank" href={elasticsearchUrl}> + {i18n.translate('xpack.monitoring.logs.reason.noClusterLink', { + defaultMessage: 'setup', + })} + </EuiLink> + ), + }} + /> + ); + } else if (false === reason?.nodeExists) { + title = i18n.translate('xpack.monitoring.logs.reason.noNodeTitle', { + defaultMessage: 'No logs for this Elasticsearch node', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noNodeMessage" + defaultMessage="Check that your {link} is correct." + values={{ + link: ( + <EuiLink target="_blank" href={elasticsearchUrl}> + {i18n.translate('xpack.monitoring.logs.reason.noNodeLink', { + defaultMessage: 'setup', + })} + </EuiLink> + ), + }} + /> + ); + } else if (false === reason?.indexExists) { + title = i18n.translate('xpack.monitoring.logs.reason.noIndexTitle', { + defaultMessage: 'No logs for this index', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.noIndexMessage" + defaultMessage="We found logs, but none for this index. If this problem continues, check that your {link} is correct." + values={{ + link: ( + <EuiLink target="_blank" href={elasticsearchUrl}> + {i18n.translate('xpack.monitoring.logs.reason.noIndexLink', { + defaultMessage: 'setup', + })} + </EuiLink> + ), + }} + /> + ); + } else if (false === reason?.correctIndexName) { + title = i18n.translate('xpack.monitoring.logs.reason.correctIndexNameTitle', { + defaultMessage: 'Corrupted filebeat index', + }); + message = ( + <FormattedMessage + id="xpack.monitoring.logs.reason.correctIndexNameMessage" + defaultMessage="There is an issue reading from your filebeat indices. {link}." + values={{ + link: ( + <EuiLink target="_blank" href={troubleshootUrl}> + {i18n.translate('xpack.monitoring.logs.reason.correctIndexNameLink', { + defaultMessage: 'Click here for more information', + })} + </EuiLink> + ), + }} + /> + ); + } + + return ( + <EuiCallOut title={title} color="warning" iconType="help"> + <p>{message}</p> + </EuiCallOut> + ); +}; diff --git a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx index 3d2d788a787a..2b8b7ed522e9 100644 --- a/x-pack/plugins/monitoring/public/components/page_loading/index.tsx +++ b/x-pack/plugins/monitoring/public/components/page_loading/index.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { EuiPage, EuiPageBody, EuiPageTemplate, EuiLoadingSpinner } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import { useTrackPageview } from '@kbn/observability-shared-plugin/public'; +import { useTrackPageview } from '../../application/hooks/use_track_metric'; function PageLoadingUI() { return ( @@ -29,8 +29,8 @@ const PageLoadingTracking: React.FunctionComponent<{ pageViewTitle: string }> = pageViewTitle, }) => { const path = pageViewTitle.toLowerCase().replace(/-/g, '').replace(/\s+/g, '_'); - useTrackPageview({ app: 'stack_monitoring', path }); - useTrackPageview({ app: 'stack_monitoring', path, delay: 15000 }); + useTrackPageview({ path }); + useTrackPageview({ path, delay: 15000 }); return <PageLoadingUI />; }; diff --git a/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx b/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx index 90d90075f1c4..22c638f8f1a6 100644 --- a/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx +++ b/x-pack/plugins/monitoring/public/components/setup_mode/toggle_button.tsx @@ -8,9 +8,10 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { METRIC_TYPE, useUiTracker } from '@kbn/observability-shared-plugin/public'; +import { METRIC_TYPE } from '@kbn/analytics'; import { TELEMETRY_METRIC_BUTTON_CLICK } from '../../../common/constants'; import { SetupModeExitButton } from './exit_button'; +import { useUiTracker } from '../../application/hooks/use_track_metric'; export interface SetupModeToggleButtonProps { enabled: boolean; @@ -21,7 +22,7 @@ export const SetupModeToggleButton: React.FC<SetupModeToggleButtonProps> = ( props: SetupModeToggleButtonProps ) => { const [isLoading, setIsLoading] = React.useState(false); - const trackStat = useUiTracker({ app: 'stack_monitoring' }); + const trackStat = useUiTracker(); function toggleSetupMode(enabled: boolean, stat: string) { setIsLoading(true); diff --git a/x-pack/plugins/monitoring/public/legacy_shims.ts b/x-pack/plugins/monitoring/public/legacy_shims.ts index 32322a2b4f7a..b2b5cafedfb6 100644 --- a/x-pack/plugins/monitoring/public/legacy_shims.ts +++ b/x-pack/plugins/monitoring/public/legacy_shims.ts @@ -22,7 +22,6 @@ import { TriggersAndActionsUIPublicPluginStart } from '@kbn/triggers-actions-ui- import { TypeRegistry } from '@kbn/triggers-actions-ui-plugin/public/application/type_registry'; import { ActionTypeModel, RuleTypeModel } from '@kbn/triggers-actions-ui-plugin/public/types'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public'; -import type { InfraClientStartExports } from '@kbn/infra-plugin/public'; import { MonitoringStartPluginDependencies, LegacyMonitoringStartPluginDependencies, @@ -74,7 +73,6 @@ export interface IShims { usageCollection: UsageCollectionSetup; kibanaServices: CoreStart & { usageCollection: UsageCollectionSetup }; appMountParameters: AppMountParameters; - infra?: InfraClientStartExports; } export class Legacy { @@ -87,7 +85,6 @@ export class Legacy { triggersActionsUi, usageCollection, appMountParameters, - infra, }: LegacyMonitoringStartPluginDependencies) { this._shims = { toastNotifications: core.notifications.toasts, @@ -146,7 +143,6 @@ export class Legacy { usageCollection, }, appMountParameters, - infra, }; } diff --git a/x-pack/plugins/monitoring/public/plugin.ts b/x-pack/plugins/monitoring/public/plugin.ts index 02033d839e1a..b526a37ceb6d 100644 --- a/x-pack/plugins/monitoring/public/plugin.ts +++ b/x-pack/plugins/monitoring/public/plugin.ts @@ -111,7 +111,6 @@ export class MonitoringPlugin usageCollection: plugins.usageCollection, appMountParameters: params, dataViews: pluginsStart.dataViews, - infra: pluginsStart.infra, }; Legacy.init({ @@ -126,7 +125,6 @@ export class MonitoringPlugin usageCollection: deps.usageCollection, appMountParameters: deps.appMountParameters, dataViews: deps.dataViews, - infra: deps.infra, share: deps.share, }); diff --git a/x-pack/plugins/monitoring/public/types.ts b/x-pack/plugins/monitoring/public/types.ts index cd5314521f94..93598557ee58 100644 --- a/x-pack/plugins/monitoring/public/types.ts +++ b/x-pack/plugins/monitoring/public/types.ts @@ -15,8 +15,8 @@ export type { MLJobs } from '../server/lib/elasticsearch/get_ml_jobs'; import { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public'; import { DashboardStart } from '@kbn/dashboard-plugin/public'; import { FleetStart } from '@kbn/fleet-plugin/public'; -import type { InfraClientStartExports } from '@kbn/infra-plugin/public'; import { SharePluginStart } from '@kbn/share-plugin/public'; +import { ReactNode } from 'react'; export interface MonitoringStartPluginDependencies { navigation: NavigationStart; @@ -26,7 +26,6 @@ export interface MonitoringStartPluginDependencies { dataViews: DataViewsPublicPluginStart; dashboard?: DashboardStart; fleet?: FleetStart; - infra?: InfraClientStartExports; share: SharePluginStart; } @@ -43,3 +42,9 @@ export type LegacyMonitoringStartPluginDependencies = MonitoringStartPluginDepen LegacyStartDependencies; export type MonitoringStartServices = CoreStart & MonitoringStartPluginDependencies; + +export interface HeaderMenuPortalProps { + children: ReactNode; + setHeaderActionMenu: AppMountParameters['setHeaderActionMenu']; + theme$: AppMountParameters['theme$']; +} diff --git a/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.ts b/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.ts index ce03cc5aecf3..efdcde6d1f93 100644 --- a/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.ts +++ b/x-pack/plugins/monitoring/server/lib/setup/collection/get_collection_status.test.ts @@ -6,7 +6,6 @@ */ import { featuresPluginMock } from '@kbn/features-plugin/server/mocks'; -import { infraPluginMock } from '@kbn/infra-plugin/server/mocks'; import { loggerMock } from '@kbn/logging-mocks'; import { usageCollectionPluginMock } from '@kbn/usage-collection-plugin/server/mocks'; import { configSchema, createConfig } from '../../../config'; @@ -37,7 +36,6 @@ const mockReq = ( plugins: { usageCollection: usageCollectionSetup, features: featuresPluginMock.createSetup(), - infra: infraPluginMock.createSetupContract(), }, }, }, diff --git a/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts b/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts index 593f3c9b2b4a..61253d93dbeb 100644 --- a/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts +++ b/x-pack/plugins/monitoring/server/routes/api/v1/alerts/enable.ts @@ -26,7 +26,6 @@ export function enableAlertsRoute(server: MonitoringCore, npRoute: RouteDependen async (context, request, response) => { try { const alertingContext = await context.alerting; - const infraContext = await context.infra; const actionContext = await context.actions; const alerts = RulesFactory.getAll(); @@ -39,7 +38,7 @@ export function enableAlertsRoute(server: MonitoringCore, npRoute: RouteDependen if (!isSufficientlySecure || !hasPermanentEncryptionKey) { server.log.info( - `Skipping rule creation for "${infraContext.spaceId}" space; Stack Monitoring rules require API keys to be enabled and an encryption key to be configured.` + `Skipping rule creation; Stack Monitoring rules require API keys to be enabled and an encryption key to be configured.` ); return response.ok({ body: { @@ -90,9 +89,7 @@ export function enableAlertsRoute(server: MonitoringCore, npRoute: RouteDependen alerts.map((alert) => alert.createIfDoesNotExist(rulesClient, actionsClient, actions)) ); - server.log.info( - `Created ${createdAlerts.length} alerts for "${infraContext.spaceId}" space` - ); + server.log.info(`Created ${createdAlerts.length} alerts`); return response.ok({ body: { createdAlerts } }); } catch (err) { diff --git a/x-pack/plugins/monitoring/server/types.ts b/x-pack/plugins/monitoring/server/types.ts index 14ef949b9394..ea15ce98117e 100644 --- a/x-pack/plugins/monitoring/server/types.ts +++ b/x-pack/plugins/monitoring/server/types.ts @@ -25,7 +25,6 @@ import type { import type { AlertingApiRequestHandlerContext } from '@kbn/alerting-plugin/server'; import type { RacApiRequestHandlerContext } from '@kbn/rule-registry-plugin/server'; import { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; -import { InfraPluginSetup, InfraRequestHandlerContext } from '@kbn/infra-plugin/server'; import { LicensingPluginStart } from '@kbn/licensing-plugin/server'; import { FeaturesPluginSetup } from '@kbn/features-plugin/server'; import { EncryptedSavedObjectsPluginSetup } from '@kbn/encrypted-saved-objects-plugin/server'; @@ -51,14 +50,12 @@ export interface PluginsSetup { usageCollection?: UsageCollectionSetup; features: FeaturesPluginSetup; alerting?: AlertingServerSetup; - infra: InfraPluginSetup; cloud?: CloudSetup; } export type RequestHandlerContextMonitoringPlugin = CustomRequestHandlerContext<{ actions?: ActionsApiRequestHandlerContext; alerting?: AlertingApiRequestHandlerContext; - infra: InfraRequestHandlerContext; ruleRegistry?: RacApiRequestHandlerContext; }>; diff --git a/x-pack/plugins/monitoring/tsconfig.json b/x-pack/plugins/monitoring/tsconfig.json index 6be14087cc11..75676ed06e3c 100644 --- a/x-pack/plugins/monitoring/tsconfig.json +++ b/x-pack/plugins/monitoring/tsconfig.json @@ -17,7 +17,6 @@ "@kbn/cloud-plugin", "@kbn/encrypted-saved-objects-plugin", "@kbn/features-plugin", - "@kbn/infra-plugin", "@kbn/licensing-plugin", "@kbn/triggers-actions-ui-plugin", "@kbn/expect", @@ -38,7 +37,6 @@ "@kbn/dashboard-plugin", "@kbn/fleet-plugin", "@kbn/shared-ux-router", - "@kbn/observability-shared-plugin", "@kbn/shared-ux-link-redirect-app", "@kbn/alerts-as-data-utils", "@kbn/rule-data-utils", @@ -48,6 +46,7 @@ "@kbn/ui-theme", "@kbn/core-elasticsearch-server", "@kbn/share-plugin", + "@kbn/analytics", ], "exclude": [ "target/**/*", diff --git a/x-pack/plugins/observability_solution/apm/common/service_groups.ts b/x-pack/plugins/observability_solution/apm/common/service_groups.ts index 035aa06c83d3..a393399bbb4a 100644 --- a/x-pack/plugins/observability_solution/apm/common/service_groups.ts +++ b/x-pack/plugins/observability_solution/apm/common/service_groups.ts @@ -17,7 +17,6 @@ import { export const LABELS = 'labels'; // implies labels.* wildcard export const APM_SERVICE_GROUP_SAVED_OBJECT_TYPE = 'apm-service-group'; -export const SERVICE_GROUP_COLOR_DEFAULT = '#D1DAE7'; export const MAX_NUMBER_OF_SERVICE_GROUPS = 500; export interface ServiceGroup { diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/constants.ts b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/constants.ts index 806a5d1dd1c2..bd333b40e5a6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/constants.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/constants.ts @@ -8,7 +8,6 @@ import { SettingsSpec } from '@elastic/charts'; export const DEFAULT_DATE_FORMAT = 'HH:mm:ss'; -export const CHART_ANNOTATION_RED_COLOR = '#BD271E'; export const CHART_SETTINGS: Partial<SettingsSpec> = { showLegend: false, }; diff --git a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/failed_transaction_chart.tsx b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/failed_transaction_chart.tsx index f5031282ad7a..b917d6226465 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/failed_transaction_chart.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/alerting/ui_components/alert_details_app_section/failed_transaction_chart.tsx @@ -7,7 +7,6 @@ /* Error Rate */ import React from 'react'; -import chroma from 'chroma-js'; import { EuiFlexItem, EuiPanel, @@ -155,7 +154,7 @@ function FailedTransactionChart({ <AlertActiveTimeRangeAnnotation alertStart={alertStart} alertEnd={alertEnd} - color={chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase()} + color={transparentize(euiTheme.colors.danger, 0.2)} id={'alertActiveRect'} key={'alertActiveRect'} />, diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx index 1d8c39b1aa98..c75c8985f3a1 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/embedded_map.tsx @@ -13,6 +13,7 @@ import type { Filter } from '@kbn/es-query'; import { ApmPluginStartDeps } from '../../../../../plugin'; import { getLayerList } from './map_layers/get_layer_list'; import { MapTypes } from '../../../../../../common/mobile/constants'; +import { StyleColorParams } from './map_layers/style_color_params'; function EmbeddedMapComponent({ selectedMap, @@ -21,6 +22,11 @@ function EmbeddedMapComponent({ kuery = '', filters, dataView, + styleColors = { + lineColor: '', + labelColor: '', + labelOutlineColor: '', + }, }: { selectedMap: MapTypes; start: string; @@ -28,6 +34,7 @@ function EmbeddedMapComponent({ kuery?: string; filters: Filter[]; dataView?: DataView; + styleColors?: StyleColorParams; }) { const { maps } = useKibana<ApmPluginStartDeps>().services; @@ -37,9 +44,10 @@ function EmbeddedMapComponent({ selectedMap, maps, dataViewId: dataView?.id, + styleColors, }) : []; - }, [selectedMap, maps, dataView?.id]); + }, [selectedMap, maps, dataView?.id, styleColors]); return ( <div diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/index.tsx index ed49a521b9d0..3afaa9ce429b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/index.tsx @@ -9,9 +9,11 @@ import React, { useState } from 'react'; import { DataView } from '@kbn/data-views-plugin/common'; import { EuiSpacer } from '@elastic/eui'; import type { Filter } from '@kbn/es-query'; +import { useEuiTheme } from '@elastic/eui'; import { EmbeddedMap } from './embedded_map'; import { MapTypes } from '../../../../../../common/mobile/constants'; import { EmbeddedMapSelect } from './embedded_map_select'; +import { StyleColorParams } from './map_layers/style_color_params'; export function GeoMap({ start, @@ -27,7 +29,13 @@ export function GeoMap({ dataView?: DataView; }) { const [selectedMap, selectMap] = useState(MapTypes.Http); + const { euiTheme } = useEuiTheme(); + const styleColors = { + lineColor: euiTheme.colors.textParagraph, + labelColor: euiTheme.colors.textParagraph, + labelOutlineColor: euiTheme.colors.backgroundBasePlain, + } as StyleColorParams; return ( <> <EmbeddedMapSelect selectedMap={selectedMap} onChange={selectMap} /> @@ -44,6 +52,7 @@ export function GeoMap({ kuery={kuery} filters={filters} dataView={dataView} + styleColors={styleColors} /> </div> </> diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_http_requests_map_layer_list.ts b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_http_requests_map_layer_list.ts index 0aff60d6e155..98adacc76953 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_http_requests_map_layer_list.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_http_requests_map_layer_list.ts @@ -26,6 +26,7 @@ import { } from '../../../../../../../common/es_fields/apm'; import { getLayerStyle, PalleteColors } from './get_map_layer_style'; import { MobileSpanSubtype, MobileSpanType } from '../../../../../../../common/mobile/constants'; +import { StyleColorParams } from './style_color_params'; interface VectorLayerDescriptor extends BaseVectorLayerDescriptor { sourceDescriptor: EMSFileSourceDescriptor; @@ -41,7 +42,11 @@ const label = i18n.translate('xpack.apm.serviceOverview.embeddedMap.httpRequests defaultMessage: 'HTTP requests', }); -export function getHttpRequestsLayerList(maps: MapsStartApi | undefined, dataViewId: string) { +export function getHttpRequestsLayerList( + maps: MapsStartApi | undefined, + dataViewId: string, + styleColors: StyleColorParams +) { const whereQuery = { language: 'kuery', query: `${PROCESSOR_EVENT}:${ProcessorEvent.span} and ${SPAN_SUBTYPE}:${MobileSpanSubtype.Http} and ${SPAN_TYPE}:${MobileSpanType.External}`, @@ -74,7 +79,7 @@ export function getHttpRequestsLayerList(maps: MapsStartApi | undefined, dataVie id: 'world_countries', tooltipProperties: [COUNTRY_NAME], }, - style: getLayerStyle(HTTP_REQUEST_PER_COUNTRY, PalleteColors.BluetoRed), + style: getLayerStyle(HTTP_REQUEST_PER_COUNTRY, PalleteColors.BluetoRed, styleColors), id: uuidv4(), label: i18n.translate('xpack.apm.serviceOverview.embeddedMap.httpRequests.country.label', { defaultMessage: 'HTTP requests per country', @@ -113,7 +118,7 @@ export function getHttpRequestsLayerList(maps: MapsStartApi | undefined, dataVie id: 'administrative_regions_lvl2', tooltipProperties: ['region_iso_code'], }, - style: getLayerStyle(HTTP_REQUESTS_PER_REGION, PalleteColors.YellowtoRed), + style: getLayerStyle(HTTP_REQUESTS_PER_REGION, PalleteColors.YellowtoRed, styleColors), id: uuidv4(), label: i18n.translate('xpack.apm.serviceOverview.embeddedMap.httpRequests.region.label', { defaultMessage: 'HTTP requests per region', diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_layer_list.ts b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_layer_list.ts index 0b6d736ad255..848991d79f0b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_layer_list.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_layer_list.ts @@ -8,23 +8,26 @@ import type { MapsStartApi } from '@kbn/maps-plugin/public'; import { LayerDescriptor } from '@kbn/maps-plugin/common'; import { getHttpRequestsLayerList } from './get_http_requests_map_layer_list'; import { getSessionMapLayerList } from './get_session_map_layer_list'; +import { StyleColorParams } from './style_color_params'; import { MapTypes } from '../../../../../../../common/mobile/constants'; export function getLayerList({ selectedMap, maps, dataViewId, + styleColors, }: { selectedMap: MapTypes; maps: MapsStartApi | undefined; dataViewId: string; + styleColors: StyleColorParams; }): LayerDescriptor[] { switch (selectedMap) { case MapTypes.Http: - return getHttpRequestsLayerList(maps, dataViewId); + return getHttpRequestsLayerList(maps, dataViewId, styleColors); case MapTypes.Session: - return getSessionMapLayerList(maps, dataViewId); + return getSessionMapLayerList(maps, dataViewId, styleColors); default: - return getHttpRequestsLayerList(maps, dataViewId); + return getHttpRequestsLayerList(maps, dataViewId, styleColors); } } diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_map_layer_style.ts b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_map_layer_style.ts index 05581765a0aa..392ccc31ce0b 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_map_layer_style.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_map_layer_style.ts @@ -15,12 +15,19 @@ import { SYMBOLIZE_AS_TYPES, } from '@kbn/maps-plugin/common'; +import { StyleColorParams } from './style_color_params'; + export enum PalleteColors { BluetoRed = 'Blue to Red', YellowtoRed = 'Yellow to Red', } -export function getLayerStyle(fieldName: string, color: PalleteColors): VectorStyleDescriptor { +export function getLayerStyle( + fieldName: string, + color: PalleteColors, + styleColors: StyleColorParams +): VectorStyleDescriptor { + const { lineColor, labelColor, labelOutlineColor } = styleColors; return { type: 'VECTOR', properties: { @@ -41,7 +48,7 @@ export function getLayerStyle(fieldName: string, color: PalleteColors): VectorSt }, lineColor: { type: STYLE_TYPE.DYNAMIC, - options: { color: '#3d3d3d', fieldMetaOptions: { isEnabled: true } }, + options: { color: lineColor, fieldMetaOptions: { isEnabled: true } }, }, lineWidth: { type: STYLE_TYPE.STATIC, options: { size: 1 } }, iconSize: { type: STYLE_TYPE.STATIC, options: { size: 6 } }, @@ -72,12 +79,12 @@ export function getLayerStyle(fieldName: string, color: PalleteColors): VectorSt }, labelColor: { type: STYLE_TYPE.STATIC, - options: { color: '#3d3d3d' }, + options: { color: labelColor }, }, labelSize: { type: STYLE_TYPE.STATIC, options: { size: 14 } }, labelBorderColor: { type: STYLE_TYPE.STATIC, - options: { color: '#FFFFFF' }, + options: { color: labelOutlineColor }, }, symbolizeAs: { options: { value: SYMBOLIZE_AS_TYPES.CIRCLE } }, labelBorderSize: { options: { size: LABEL_BORDER_SIZES.SMALL } }, diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_session_map_layer_list.ts b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_session_map_layer_list.ts index 4a6e858085da..b71d3bd316b6 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_session_map_layer_list.ts +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/get_session_map_layer_list.ts @@ -22,6 +22,7 @@ import { SESSION_ID, } from '../../../../../../../common/es_fields/apm'; import { getLayerStyle, PalleteColors } from './get_map_layer_style'; +import { StyleColorParams } from './style_color_params'; interface VectorLayerDescriptor extends BaseVectorLayerDescriptor { sourceDescriptor: EMSFileSourceDescriptor; @@ -36,7 +37,11 @@ const SESSION_PER_REGION = `__kbnjoin__cardinality_of_session.id__${PER_REGION_L const label = i18n.translate('xpack.apm.serviceOverview.embeddedMap.session.metric.label', { defaultMessage: 'Sessions', }); -export function getSessionMapLayerList(maps: MapsStartApi | undefined, dataViewId: string) { +export function getSessionMapLayerList( + maps: MapsStartApi | undefined, + dataViewId: string, + styleColors: StyleColorParams +) { const sessionsByCountryLayer: VectorLayerDescriptor = { joins: [ { @@ -64,7 +69,7 @@ export function getSessionMapLayerList(maps: MapsStartApi | undefined, dataViewI id: 'world_countries', tooltipProperties: [COUNTRY_NAME], }, - style: getLayerStyle(SESSION_PER_COUNTRY, PalleteColors.BluetoRed), + style: getLayerStyle(SESSION_PER_COUNTRY, PalleteColors.BluetoRed, styleColors), id: uuidv4(), label: i18n.translate('xpack.apm.serviceOverview.embeddedMap.sessionCountry.metric.label', { defaultMessage: 'Sessions per country', @@ -103,7 +108,7 @@ export function getSessionMapLayerList(maps: MapsStartApi | undefined, dataViewI id: 'administrative_regions_lvl2', tooltipProperties: ['region_iso_code'], }, - style: getLayerStyle(SESSION_PER_REGION, PalleteColors.YellowtoRed), + style: getLayerStyle(SESSION_PER_REGION, PalleteColors.YellowtoRed, styleColors), id: uuidv4(), label: i18n.translate('xpack.apm.serviceOverview.embeddedMap.sessionRegion.metric.label', { defaultMessage: 'Sessions per region', diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/style_color_params.ts b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/style_color_params.ts new file mode 100644 index 000000000000..2934b7055a74 --- /dev/null +++ b/x-pack/plugins/observability_solution/apm/public/components/app/mobile/service_overview/geo_map/map_layers/style_color_params.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 interface StyleColorParams { + lineColor: string; + labelColor: string; + labelOutlineColor: string; +} diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/group_details.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/group_details.tsx index 5e82ab290e07..9d763a213863 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/group_details.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_group_save/group_details.tsx @@ -19,6 +19,7 @@ import { useColorPickerState, EuiText, isValidHex, + useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { useEffect, useState } from 'react'; @@ -43,7 +44,8 @@ export function GroupDetails({ isLoading, titleId, }: Props) { - const initialColor = serviceGroup?.color || '#5094C4'; + const { euiTheme } = useEuiTheme(); + const initialColor = serviceGroup?.color || euiTheme.colors.backgroundFilledPrimary; const [name, setName] = useState(serviceGroup?.groupName); const [color, setColor, colorPickerErrors] = useColorPickerState(initialColor); const [description, setDescription] = useState<string | undefined>(serviceGroup?.description); diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx index ecf8cf89452f..4972bf458281 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_groups/service_groups_list/service_group_card.tsx @@ -14,10 +14,11 @@ import { EuiFlexItem, EuiText, useIsWithinBreakpoints, + useEuiTheme, } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { ServiceGroup, SERVICE_GROUP_COLOR_DEFAULT } from '../../../../../common/service_groups'; +import { ServiceGroup } from '../../../../../common/service_groups'; import { useObservabilityActiveAlertsHref } from '../../../shared/links/kibana'; import { ServiceStat } from './service_stat'; @@ -30,7 +31,7 @@ interface Props { export function ServiceGroupsCard({ serviceGroup, href, serviceGroupCounts, isLoading }: Props) { const isMobile = useIsWithinBreakpoints(['xs', 's']); - + const { euiTheme } = useEuiTheme(); const activeAlertsHref = useObservabilityActiveAlertsHref(serviceGroup.kuery); const cardProps: EuiCardProps = { style: { width: isMobile ? '100%' : 286 }, @@ -38,7 +39,7 @@ export function ServiceGroupsCard({ serviceGroup, href, serviceGroupCounts, isLo <> <EuiAvatar name={serviceGroup.groupName} - color={serviceGroup.color || SERVICE_GROUP_COLOR_DEFAULT} + color={serviceGroup.color || euiTheme.colors.backgroundFilledPrimary} size="l" /> </> diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/http_status_badge.test.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/http_status_badge.test.tsx index 423cfa3e6163..e7d1d388a957 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/http_status_badge.test.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/http_status_badge.test.tsx @@ -8,52 +8,58 @@ import React from 'react'; import { mount } from 'enzyme'; import { HttpStatusBadge } from '.'; -import { - successColor, - neutralColor, - warningColor, - errorColor, -} from '../../../../utils/http_status_code_to_color'; +import { renderHook } from '@testing-library/react-hooks'; +import { useEuiTheme } from '@elastic/eui'; describe('HttpStatusBadge', () => { describe('render', () => { describe('with status code 100', () => { it('renders with neutral color', () => { const wrapper = mount(<HttpStatusBadge status={100} />); - - expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual(neutralColor); + const { result } = renderHook(() => useEuiTheme()); + expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual( + result.current.euiTheme.colors.vis.euiColorVisGrey0 + ); }); }); describe('with status code 200', () => { it('renders with success color', () => { const wrapper = mount(<HttpStatusBadge status={200} />); - - expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual(successColor); + const { result } = renderHook(() => useEuiTheme()); + expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual( + result.current.euiTheme.colors.vis.euiColorVisSuccess0 + ); }); }); describe('with status code 301', () => { it('renders with neutral color', () => { const wrapper = mount(<HttpStatusBadge status={301} />); - - expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual(neutralColor); + const { result } = renderHook(() => useEuiTheme()); + expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual( + result.current.euiTheme.colors.vis.euiColorVisGrey0 + ); }); }); describe('with status code 404', () => { it('renders with warning color', () => { const wrapper = mount(<HttpStatusBadge status={404} />); - - expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual(warningColor); + const { result } = renderHook(() => useEuiTheme()); + expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual( + result.current.euiTheme.colors.vis.euiColorVisWarning0 + ); }); }); describe('with status code 502', () => { it('renders with error color', () => { const wrapper = mount(<HttpStatusBadge status={502} />); - - expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual(errorColor); + const { result } = renderHook(() => useEuiTheme()); + expect(wrapper.find('HttpStatusBadge EuiBadge').prop('color')).toEqual( + result.current.euiTheme.colors.vis.euiColorVisDanger0 + ); }); }); diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/index.tsx index 48866619a654..e3f7f623642d 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/summary/http_status_badge/index.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { i18n } from '@kbn/i18n'; import { EuiToolTip, EuiBadge } from '@elastic/eui'; import { statusCodes } from './status_codes'; -import { httpStatusCodeToColor } from '../../../../utils/http_status_code_to_color'; +import { useGetStatusColor } from '../../../../utils/http_status_code_to_color'; interface HttpStatusBadgeProps { status: number; @@ -18,10 +18,9 @@ export function HttpStatusBadge({ status }: HttpStatusBadgeProps) { const label = i18n.translate('xpack.apm.transactionDetails.statusCode', { defaultMessage: 'Status code', }); - return ( <EuiToolTip content={label}> - <EuiBadge color={httpStatusCodeToColor(status) || 'default'}> + <EuiBadge color={useGetStatusColor(status) || 'default'}> {status} {statusCodes[status.toString()]} </EuiBadge> </EuiToolTip> diff --git a/x-pack/plugins/observability_solution/apm/public/utils/http_status_code_to_color.ts b/x-pack/plugins/observability_solution/apm/public/utils/http_status_code_to_color.ts index 4caa3bd7701f..3c2d1bb41051 100644 --- a/x-pack/plugins/observability_solution/apm/public/utils/http_status_code_to_color.ts +++ b/x-pack/plugins/observability_solution/apm/public/utils/http_status_code_to_color.ts @@ -5,35 +5,17 @@ * 2.0. */ -import { euiLightVars as theme } from '@kbn/ui-theme'; -const { euiColorDarkShade, euiColorWarning } = theme; +import { useEuiTheme } from '@elastic/eui'; -export const errorColor = '#c23c2b'; -export const neutralColor = euiColorDarkShade; -export const successColor = '#327a42'; -export const warningColor = euiColorWarning; - -const httpStatusCodeColors: Record<string, string> = { - 1: neutralColor, - 2: successColor, - 3: neutralColor, - 4: warningColor, - 5: errorColor, +export const useGetStatusColor = (status: string | number) => { + const { euiTheme } = useEuiTheme(); + const httpStatusCodeColors: Record<string, string> = { + 1: euiTheme.colors.vis.euiColorVisGrey0, + 2: euiTheme.colors.vis.euiColorVisSuccess0, + 3: euiTheme.colors.vis.euiColorVisGrey0, + 4: euiTheme.colors.vis.euiColorVisWarning0, + 5: euiTheme.colors.vis.euiColorVisDanger0, + }; + const intStatus = typeof status === 'string' ? parseInt(status.replace(/\D/g, ''), 10) : status; + return httpStatusCodeColors[intStatus.toString().substring(0, 1)]; }; - -function getStatusColor(status: number) { - return httpStatusCodeColors[status.toString().substr(0, 1)]; -} - -/** - * Convert an HTTP status code to a color. - * - * If passed a string, it will remove all non-numeric characters - */ -export function httpStatusCodeToColor(status: string | number) { - if (typeof status === 'string') { - return getStatusColor(parseInt(status.replace(/\D/g, ''), 10)); - } else { - return getStatusColor(status); - } -} diff --git a/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/cli.ts b/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/cli.ts index 385a6167fba7..f029ea8015e9 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/cli.ts +++ b/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/cli.ts @@ -164,7 +164,12 @@ async function getHostnameWithBasePath(kibanaHostname?: string) { const parsedHostName = parseHostName(kibanaHostname); try { - await axios.get(parsedHostName, { maxRedirects: 0 }); + await axios.get(parsedHostName, { + maxRedirects: 0, + headers: { + 'x-elastic-internal-origin': 'Kibana', + }, + }); } catch (e) { if (isAxiosError(e) && e.response?.status === 302) { const location = e.response?.headers?.location ?? ''; diff --git a/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/diagnostics_bundle.ts b/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/diagnostics_bundle.ts index 594fc3d78779..271a99038235 100644 --- a/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/diagnostics_bundle.ts +++ b/x-pack/plugins/observability_solution/apm/scripts/diagnostics_bundle/diagnostics_bundle.ts @@ -54,6 +54,7 @@ export async function initDiagnosticsBundle({ headers: { 'kbn-xsrf': 'true', 'elastic-api-version': '2023-10-31', + 'x-elastic-internal-origin': 'Kibana', ...apiKeyHeader, }, }; @@ -104,8 +105,8 @@ async function getApmIndices(kbnClientOpts: AxiosRequestConfig) { async function getFleetPackageInfo(kbnClientOpts: AxiosRequestConfig) { const res = await axios.get('/api/fleet/epm/packages/apm', kbnClientOpts); return { - version: res.data.response.version, - isInstalled: res.data.response.status, + version: res.data.item.version, + isInstalled: res.data.item.status, }; } diff --git a/x-pack/plugins/observability_solution/apm/server/test_helpers/create_apm_users/helpers/call_kibana.ts b/x-pack/plugins/observability_solution/apm/server/test_helpers/create_apm_users/helpers/call_kibana.ts index 72312645a644..87a28bfde666 100644 --- a/x-pack/plugins/observability_solution/apm/server/test_helpers/create_apm_users/helpers/call_kibana.ts +++ b/x-pack/plugins/observability_solution/apm/server/test_helpers/create_apm_users/helpers/call_kibana.ts @@ -8,6 +8,10 @@ import axios, { AxiosRequestConfig, AxiosError } from 'axios'; import { once } from 'lodash'; import { Elasticsearch, Kibana } from '../create_apm_users'; +const DEFAULT_HEADERS = { + 'kbn-xsrf': 'true', + 'x-elastic-internal-origin': 'Kibana', +}; export async function callKibana<T>({ elasticsearch, kibana, @@ -24,14 +28,18 @@ export async function callKibana<T>({ ...options, baseURL: baseUrl, auth: { username, password }, - headers: { 'kbn-xsrf': 'true', ...options.headers }, + headers: { ...DEFAULT_HEADERS, ...options.headers }, }); return data; } const getBaseUrl = once(async (kibanaHostname: string) => { try { - await axios.request({ url: kibanaHostname, maxRedirects: 0 }); + await axios.request({ + url: kibanaHostname, + maxRedirects: 0, + headers: DEFAULT_HEADERS, + }); } catch (e) { if (isAxiosError(e)) { const location = e.response?.headers?.location ?? ''; diff --git a/x-pack/plugins/observability_solution/dataset_quality/server/services/data_stream.ts b/x-pack/plugins/observability_solution/dataset_quality/server/services/data_stream.ts index 1157b40936a6..e54f0f33f375 100644 --- a/x-pack/plugins/observability_solution/dataset_quality/server/services/data_stream.ts +++ b/x-pack/plugins/observability_solution/dataset_quality/server/services/data_stream.ts @@ -20,7 +20,6 @@ class DataStreamService { try { const { data_streams: dataStreamsInfo } = await esClient.indices.getDataStream({ name: datasetName, - // @ts-expect-error verbose: true, }); diff --git a/x-pack/plugins/observability_solution/exploratory_view/README.md b/x-pack/plugins/observability_solution/exploratory_view/README.md deleted file mode 100644 index 67a73639cdf8..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Exploratory View plugin - -A shared component for visualizing observability data types via lens embeddable. [For further details.](./public/components/exploratory_view/README.md) - -## Unit testing - -Note: Run the following commands from `kibana/x-pack/plugins/observability_solution/exploratory_view`. - -### Run unit tests - -```bash -npx jest --watch -``` - -### Update snapshots - -```bash -npx jest --updateSnapshot -``` - -### Coverage - -HTML coverage report can be found in target/coverage/jest after tests have run. - -```bash -open target/coverage/jest/index.html -``` diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md b/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md deleted file mode 100644 index 00c7eaa80b88..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/README.md +++ /dev/null @@ -1,15 +0,0 @@ -## How to run these tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/exploratory_view/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From this directory, `~/x-pack/plugins/observability_solution/exploratory_view/e2e`, you can now run `node ../../../../scripts/functional_test_runner --config synthetics_run.ts`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/step_duration.journey.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/step_duration.journey.ts deleted file mode 100644 index 86291929afcc..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/step_duration.journey.ts +++ /dev/null @@ -1,89 +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 { journey, step } from '@elastic/synthetics'; -import moment from 'moment'; -import { recordVideo } from '../record_video'; -import { createExploratoryViewUrl } from '../../public/components/shared/exploratory_view/configurations/exploratory_view_url'; -import { byTestId, loginToKibana, TIMEOUT_60_SEC, waitForLoadingToFinish } from '../utils'; - -journey('Step Duration series', async ({ page, params }) => { - recordVideo(page); - - page.setDefaultTimeout(TIMEOUT_60_SEC.timeout); - - const expUrl = createExploratoryViewUrl({ - reportType: 'kpi-over-time', - allSeries: [ - { - dataType: 'uptime', - time: { - from: moment().subtract(10, 'y').toISOString(), - to: moment().toISOString(), - }, - name: 'synthetics-series-1', - breakdown: 'monitor.type', - selectedMetricField: 'monitor.duration.us', - reportDefinitions: { - 'url.full': ['ALL_VALUES'], - }, - }, - ], - }); - - const baseUrl = `${params.kibanaUrl}${expUrl}`; - - step('Go to Exploratory view', async () => { - await page.goto(baseUrl, { - waitUntil: 'networkidle', - }); - await loginToKibana({ - page, - user: { username: 'elastic', password: 'changeme' }, - }); - }); - - step('build series with monitor duration', async () => { - await page.waitForNavigation(TIMEOUT_60_SEC); - - await waitForLoadingToFinish({ page }); - await page.click('text=browser'); - await page.click('text=http'); - await page.click('[aria-label="Remove report metric"]'); - await page.click('button:has-text("Select report metric")'); - await page.click('button:has-text("Step duration")'); - await page.click(byTestId('seriesBreakdown')); - await page.click('button[role="option"]:has-text("Step name")'); - await page.click('.euiComboBox__inputWrap'); - await page.click('[role="combobox"][placeholder="Search Monitor name"]'); - await page.click('button[role="option"]:has-text("test-monitor - inline")'); - await page.click('button:has-text("Apply changes")'); - }); - - step('Verify that changes are applied', async () => { - await waitForLoadingToFinish({ page }); - - await page.click('[aria-label="series color: #54b399"]'); - await page.click('[aria-label="series color: #6092c0"]'); - await page.click('[aria-label="series color: #d36086"] path'); - await page.click('[aria-label="series color: #9170b8"]'); - await page.click('[aria-label="series color: #ca8eae"]'); - await page.click('[aria-label="series color: #d6bf57"]'); - await page.click('text=load homepage'); - await page.click('text=load homepage'); - await page.click('text=load github'); - await page.click('text=load github'); - await page.click('text=load google'); - await page.click('text=load google'); - await page.click('text=hover over products menu'); - await page.click('text=hover over products menu'); - await page.click('text=load homepage 1'); - await page.click('text=load homepage 1'); - await page.click('text=load homepage 2'); - await page.click('text=load homepage 2'); - }); -}); diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/parse_args_params.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/parse_args_params.ts deleted file mode 100644 index 41100ba2ec29..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/parse_args_params.ts +++ /dev/null @@ -1,33 +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 yargs from 'yargs'; - -const { argv } = yargs(process.argv.slice(2)) - .option('headless', { - default: true, - type: 'boolean', - description: 'Start in headless mode', - }) - .option('bail', { - default: false, - type: 'boolean', - description: 'Pause on error', - }) - .option('watch', { - default: false, - type: 'boolean', - description: 'Runs the server in watch mode, restarting on changes', - }) - .option('grep', { - default: undefined, - type: 'string', - description: 'run only journeys with a name or tags that matches the glob', - }) - .help(); - -export { argv }; diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/record_video.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/record_video.ts deleted file mode 100644 index 23bcdfb643e7..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/record_video.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import fs from 'fs'; -import Runner from '@elastic/synthetics/dist/core/runner'; -import { after, Page } from '@elastic/synthetics'; - -const SYNTHETICS_RUNNER = Symbol.for('SYNTHETICS_RUNNER'); - -// @ts-ignore -export const runner: Runner = global[SYNTHETICS_RUNNER]; - -export const recordVideo = (page: Page, postfix = '') => { - after(async () => { - try { - const videoFilePath = await page.video()?.path(); - const pathToVideo = videoFilePath?.replace('.journeys/videos/', '').replace('.webm', ''); - const newVideoPath = videoFilePath?.replace( - pathToVideo!, - postfix ? runner.currentJourney!.name + `-${postfix}` : runner.currentJourney!.name - ); - fs.renameSync(videoFilePath!, newVideoPath!); - } catch (e) { - // eslint-disable-next-line no-console - console.log('Error while renaming video file', e); - } - }); -}; diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts deleted file mode 100644 index 70a290ce9900..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_run.ts +++ /dev/null @@ -1,45 +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 { FtrConfigProviderContext } from '@kbn/test'; -import path from 'path'; -import { SyntheticsRunner } from './synthetics_runner'; -import { argv } from './parse_args_params'; - -const { headless, grep, bail: pauseOnError } = argv; - -async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { - const kibanaConfig = await readConfigFile(require.resolve('@kbn/synthetics-e2e/config')); - - return { - ...kibanaConfig.getAll(), - testRunner: async ({ getService }: any) => { - const syntheticsRunner = new SyntheticsRunner(getService, { - headless, - match: grep, - pauseOnError, - }); - - await syntheticsRunner.setup(); - - await syntheticsRunner.loadTestData(path.join(__dirname, '../../ux/e2e/fixtures/'), [ - 'rum_8.0.0', - 'rum_test_data', - ]); - await syntheticsRunner.loadTestData( - path.join(__dirname, '../../synthetics/e2e/fixtures/es_archiver/'), - ['full_heartbeat', 'browser'] - ); - await syntheticsRunner.loadTestFiles(async () => { - require(path.join(__dirname, './journeys')); - }); - await syntheticsRunner.run(); - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default runE2ETests; diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_runner.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_runner.ts deleted file mode 100644 index bc6222774f05..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/synthetics_runner.ts +++ /dev/null @@ -1,155 +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. - */ - -/* eslint-disable no-console */ - -import Url from 'url'; -import { run as syntheticsRun } from '@elastic/synthetics'; -import { PromiseType } from 'utility-types'; -import { createApmUsers } from '@kbn/apm-plugin/server/test_helpers/create_apm_users/create_apm_users'; - -import { EsArchiver } from '@kbn/es-archiver'; -import { esArchiverUnload } from './tasks/es_archiver'; -import { TestReporter } from './test_reporter'; - -export interface ArgParams { - headless: boolean; - match?: string; - pauseOnError: boolean; -} - -export class SyntheticsRunner { - public getService: any; - public kibanaUrl: string; - private elasticsearchUrl: string; - - public testFilesLoaded: boolean = false; - - public params: ArgParams; - - private loadTestFilesCallback?: (reload?: boolean) => Promise<void>; - - constructor(getService: any, params: ArgParams) { - this.getService = getService; - this.kibanaUrl = this.getKibanaUrl(); - this.elasticsearchUrl = this.getElasticsearchUrl(); - this.params = params; - } - - async setup() { - await this.createTestUsers(); - } - - async createTestUsers() { - await createApmUsers({ - elasticsearch: { node: this.elasticsearchUrl, username: 'elastic', password: 'changeme' }, - kibana: { hostname: this.kibanaUrl }, - }); - } - - async loadTestFiles(callback: (reload?: boolean) => Promise<void>, reload = false) { - console.log('Loading test files'); - await callback(reload); - this.loadTestFilesCallback = callback; - this.testFilesLoaded = true; - console.log('Successfully loaded test files'); - } - - async loadTestData(e2eDir: string, dataArchives: string[]) { - try { - console.log('Loading esArchiver...'); - - const esArchiver: EsArchiver = this.getService('esArchiver'); - - const promises = dataArchives.map((archive) => { - if (archive === 'synthetics_data') { - return esArchiver.load(e2eDir + archive, { - docsOnly: true, - skipExisting: true, - }); - } - return esArchiver.load(e2eDir + archive, { skipExisting: true }); - }); - - await Promise.all([...promises]); - } catch (e) { - console.log(e); - } - } - - getKibanaUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.kibana.protocol'), - hostname: config.get('servers.kibana.hostname'), - port: config.get('servers.kibana.port'), - }); - } - - getElasticsearchUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.elasticsearch.protocol'), - hostname: config.get('servers.elasticsearch.hostname'), - port: config.get('servers.elasticsearch.port'), - }); - } - - async run() { - if (!this.testFilesLoaded) { - throw new Error('Test files not loaded'); - } - const { headless, match, pauseOnError } = this.params; - const noOfRuns = process.env.NO_OF_RUNS ? Number(process.env.NO_OF_RUNS) : 1; - console.log(`Running ${noOfRuns} times`); - let results: PromiseType<ReturnType<typeof syntheticsRun>> = {}; - for (let i = 0; i < noOfRuns; i++) { - results = await syntheticsRun({ - params: { kibanaUrl: this.kibanaUrl, getService: this.getService }, - playwrightOptions: { - headless, - chromiumSandbox: false, - timeout: 60 * 1000, - viewport: { - height: 900, - width: 1600, - }, - recordVideo: { - dir: '.journeys/videos', - }, - }, - grepOpts: { match: match === 'undefined' ? '' : match }, - pauseOnError, - screenshots: 'only-on-failure', - reporter: TestReporter, - }); - if (noOfRuns > 1) { - // need to reload again since runner resets the journeys - await this.loadTestFiles(this.loadTestFilesCallback!, true); - } - } - - await this.assertResults(results); - } - - assertResults(results: PromiseType<ReturnType<typeof syntheticsRun>>) { - Object.entries(results).forEach(([_journey, result]) => { - if (result.status !== 'succeeded') { - process.exitCode = 1; - process.exit(); - } - }); - } - - cleanUp() { - console.log('Removing esArchiver...'); - esArchiverUnload('full_heartbeat'); - esArchiverUnload('browser'); - } -} diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/tasks/es_archiver.ts b/x-pack/plugins/observability_solution/exploratory_view/e2e/tasks/es_archiver.ts deleted file mode 100644 index bbb66b19f5a5..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/tasks/es_archiver.ts +++ /dev/null @@ -1,37 +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 Path from 'path'; -import { execSync } from 'child_process'; - -const ES_ARCHIVE_DIR = './fixtures/es_archiver'; - -// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https -const NODE_TLS_REJECT_UNAUTHORIZED = '1'; - -export const esArchiverLoad = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../scripts/es_archiver load "${path}" --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverUnload = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../scripts/es_archiver unload "${path}" --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverResetKibana = () => { - execSync( - `node ../../../../scripts/es_archiver empty-kibana-index --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/tsconfig.json b/x-pack/plugins/observability_solution/exploratory_view/e2e/tsconfig.json deleted file mode 100644 index 93a315a3e7a6..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "exclude": ["tmp", "target/**/*"], - "include": ["./**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": ["node"] - }, - "kbn_references": ["@kbn/test", "@kbn/apm-plugin", "@kbn/es-archiver"] -} diff --git a/x-pack/plugins/observability_solution/exploratory_view/jest.config.js b/x-pack/plugins/observability_solution/exploratory_view/jest.config.js deleted file mode 100644 index 089c3b9ed3ce..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/exploratory_view'], - setupFiles: [ - '<rootDir>/x-pack/plugins/observability_solution/exploratory_view/.storybook/jest_setup.js', - ], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/observability_solution/exploratory_view', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/exploratory_view/{common,public,server}/**/*.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md b/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md deleted file mode 100644 index 6aea217a1aaa..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/README.md +++ /dev/null @@ -1,161 +0,0 @@ -# Exploratory view component - -This component is used in observability plugin to show lens embeddable based observability visualizations. -The view is populated using configs stored as json within the view for each data type. - -This readme file contains few of the concepts being used in the component. - -Basic workflow for how exploratory view works, it looks like this - - -![Exploratory view workflow](https://i.imgur.com/Kgyfd29.png) - - -## Report Type - -The exploratory view report type controls how the data is visualized in the lens embeddable. The report type defines a set of constraints over the x and y axis. For example, the `kpi-over-time` report type is a time series chart type that plots key performance indicators over time, while the `data-distribution` chart plots the percentage of documents over key performance indicators. Current available data types can be found at `exploratory_view/configurations/constants`. - -Each report type has one or more available visualizations to plot data from one or more data types. - -## Data Types - -Each available visualization is backed by a data type. A data type consists of a set of configuration for displaying domain-specific visualizations for observability data. Some example data types include apm, metrics, and logs. - -For each respective data type, we fetch index pattern string from the app plugin contract, leveraging existing hasData API we have to return the index pattern string as well as a `hasData` boolean from each plugin. - -In most cases, there will be a 1-1 relation between apps and data types. - -### Observability `dataViews` - -Once we have index pattern string for each data type, a respective `dataView` is created. If there is an existing dataView for an index pattern, we will fetch and reuse it. - -After the dataView is created we also set field formats to promote human-readability. For example, we set format for monitor duration field, which is monitor.duration.us, from microseconds to seconds for browser monitors. - -### Visualization Configuration - -Each data type may have one or more visualization configurations. The data type to visualization configuration can be found in [`exploratory_view/obs_exploratory_view`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx#L86) - -Each visualization configuration is mapped to a single report type. - -Visualization configurations are used to define the UI we display for each report type and data type combination in the series builder. -Visualization configuration define UI options and display, including available `metrics`, available `filters`, available `breakdown` options, definitions for human-readable `labels`, and more. -The configuration also defines any custom base filters, which usually get pushed to a query, but are not displayed on the UI. You can also set more custom options on the configuration like colors which get used while rendering the chart. - -Visualization configuration can be found at [`exploratory_view/configurations`](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations), where each data type typically has a folder that holds one or more visualization configurations. - -The configuration defined ultimately influences the lens embeddable attributes which get pushed to lens embeddable, rendering the chart. - -Some options in configuration are: - -#### Definition fields -They are also filters, but usually main filters, around which usually app UI is based. -For apm, it could be service name and for uptime, monitor name. - -#### Filters -You can define base filters in kql form or data plugin filter format, filters are strongly typed. - -#### Breakdown fields -List of fields from an index pattern, UI will use this to populate breakdown option select. - -#### Labels -You can set key/value map for your field labels. UI will use these to set labels for data view fields. - -Sample config -``` -{ - reportType: ReportTypes.KPI, - defaultSeriesType: 'bar_stacked', - xAxisColumn: { - sourceField: '@timestamp', - }, - yAxisColumns: [ - { - sourceField: REPORT_METRIC_FIELD, - operationType: 'median', - }, - ], - hasOperationType: false, - filterFields: ['observer.geo.name', 'monitor.type', 'tags'], // these fields get's resolved from relevant dataView - breakdownFields: [ - 'observer.geo.name', - 'monitor.type', - 'monitor.name', - PERCENTILE, - ], // these fields get's resolved from relevant dataView - baseFilters: [], - palette: { type: 'palette', name: 'status' }, - definitionFields: [ - { field: 'monitor.name', nested: SYNTHETICS_STEP_NAME, singleSelection: true }, - { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, - ], - metricOptions: [ - { - label: MONITORS_DURATION_LABEL, - field: 'monitor.duration.us', - columnType: OPERATION_COLUMN, - } - ], - labels: { ...FieldLabels, [SUMMARY_UP]: UP_LABEL, [SUMMARY_DOWN]: DOWN_LABEL }, - } -``` - - - -## Lens Embeddable - -Lens embeddable is what actually renders the chart in exploratory view. - -Exploratory view generates the lens embeddable attributes as json and pass it to the component. - -Based on configuration, exploratory view generates layers and columns. - -Add a link to lens embeddable readme - -#### Example -A simple usage of lens embeddable example and playground options -[embedded_lens_example](../../../../../../examples/embedded_lens_example) - -## Exploratory view Embeddable - -The primary purpose of the exploratory view is to embed it in observability solutions like uptime to replace -existing static visualizations, - -For that purpose, all the configuration options we define in the exploratory view can be used as an embeddable -via a component that is exposed using observability plugin contract, -usage looks like this - -`const ExploratoryViewComponent = props.plugins.observability.ExploratoryViewEmbeddable; -` - -``` - <ExploratoryViewComponent - attributes={[ - { - name: 'Monitors response duration', - time: { - from: 'now-5d', - to: 'now', - }, - reportDefinitions: { - 'monitor.id': ['test-id'], - }, - breakdown: 'monitor.type', - operationType: 'average', - dataType: 'synthetics', - seriesType: 'line', - selectedMetricField: 'monitor.duration.us', - }, - ]} - reportType="kpi-over-time" - title={'Monitor response duration'} - withActions={['save', 'explore']} - /> -``` - -there is an example in kibana example which you can view using -`yarn start --run-examples` and view the code at [Exploratory view embeddable](../../../../../../examples/exploratory_view_example) - -#### Example -A simple usage of lens embeddable example and playground options, run kibana with -`yarn start --run-example` to see this example in action -source code is defined at [embedded_lens_example](../../../../../../examples/embedded_lens_example) \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/typings/fetch_overview_data/index.ts b/x-pack/plugins/observability_solution/exploratory_view/public/typings/fetch_overview_data/index.ts deleted file mode 100644 index 67a2663aca27..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/public/typings/fetch_overview_data/index.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { ApmIndicesConfig, UXMetrics } from '@kbn/observability-shared-plugin/public'; -import { ObservabilityApp } from '@kbn/observability-shared-plugin/typings/common'; - -export interface Stat { - type: 'number' | 'percent' | 'bytesPerSecond'; - value: number; -} - -export interface Coordinates { - x: number; - y?: number | null; -} - -export interface Series { - coordinates: Coordinates[]; -} - -export interface FetchDataParams { - absoluteTime: { start: number; end: number }; - relativeTime: { start: string; end: string }; - serviceName?: string; - // Bucket size in seconds (number) - bucketSize: number; - // Bucket size in seconds (string) - intervalString: string; - timeZone?: string; -} - -export interface HasDataParams { - absoluteTime: { start: number; end: number }; -} - -export interface HasDataResponse { - hasData: boolean; -} - -export interface UXHasDataResponse extends HasDataResponse { - serviceName?: string | number; - indices?: string; -} - -export interface SyntheticsHasDataResponse extends HasDataResponse { - indices: string; -} - -export interface APMHasDataResponse { - hasData: boolean; - indices: ApmIndicesConfig; -} - -export interface InfraMetricsHasDataResponse { - hasData: boolean; - indices: string; -} - -export interface InfraLogsHasDataResponse { - hasData: boolean; - indices: string; -} - -export type FetchData<T extends FetchDataResponse = FetchDataResponse> = ( - fetchDataParams: FetchDataParams -) => Promise<T>; - -export type HasData<T extends ObservabilityFetchDataPlugins> = ( - params?: HasDataParams -) => Promise<ObservabilityHasDataResponse[T]>; - -export type ObservabilityFetchDataPlugins = Exclude< - ObservabilityApp, - | 'observability-overview' - | 'stack_monitoring' - | 'fleet' - | 'synthetics' - | 'profiling' - | 'observability-onboarding' ->; - -export interface DataHandler< - T extends ObservabilityFetchDataPlugins = ObservabilityFetchDataPlugins -> { - fetchData: FetchData<ObservabilityFetchDataResponse[T]>; - hasData: HasData<T>; -} - -export interface FetchDataResponse { - appLink: string; -} - -export interface LogsFetchDataResponse extends FetchDataResponse { - stats: Record<string, Stat & { label: string }>; - series: Record<string, Series & { label: string }>; -} - -export type StringOrNull = string | null; -export type NumberOrNull = number | null; - -export interface MetricsFetchDataSeries { - id: string; - name: StringOrNull; - platform: StringOrNull; - provider: StringOrNull; - cpu: NumberOrNull; - iowait: NumberOrNull; - load: NumberOrNull; - uptime: NumberOrNull; - rx: NumberOrNull; - tx: NumberOrNull; - timeseries: Array<{ - timestamp: number; - cpu: NumberOrNull; - iowait: NumberOrNull; - load: NumberOrNull; - rx: NumberOrNull; - tx: NumberOrNull; - }>; -} - -export interface MetricsFetchDataResponse extends FetchDataResponse { - sort: (by: string, direction: string) => Promise<MetricsFetchDataResponse>; - series: MetricsFetchDataSeries[]; -} - -export interface UptimeFetchDataResponse extends FetchDataResponse { - stats: { - monitors: Stat; - up: Stat; - down: Stat; - }; - series: { - up: Series; - down: Series; - }; -} - -export interface ApmFetchDataResponse extends FetchDataResponse { - stats: { - services: Stat; - transactions: Stat; - }; - series: { - transactions: Series; - }; -} - -export interface UxFetchDataResponse extends FetchDataResponse { - coreWebVitals: UXMetrics; -} - -export interface ObservabilityFetchDataResponse { - apm: ApmFetchDataResponse; - infra_metrics: MetricsFetchDataResponse; - infra_logs: LogsFetchDataResponse; - uptime: UptimeFetchDataResponse; - ux: UxFetchDataResponse; -} - -export interface ObservabilityHasDataResponse { - apm: APMHasDataResponse; - infra_metrics: InfraMetricsHasDataResponse; - infra_logs: InfraLogsHasDataResponse; - uptime: SyntheticsHasDataResponse; - ux: UXHasDataResponse; -} diff --git a/x-pack/plugins/observability_solution/exploratory_view/tsconfig.json b/x-pack/plugins/observability_solution/exploratory_view/tsconfig.json deleted file mode 100644 index 3aca08a23f4e..000000000000 --- a/x-pack/plugins/observability_solution/exploratory_view/tsconfig.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": ["common/**/*", "public/**/*", "public/**/*.json", "../../../../typings/**/*"], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/home-plugin", - "@kbn/kibana-react-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/usage-collection-plugin", - "@kbn/licensing-plugin", - "@kbn/cases-plugin", - "@kbn/lens-plugin", - "@kbn/spaces-plugin", - "@kbn/unified-search-plugin", - "@kbn/discover-plugin", - "@kbn/i18n", - "@kbn/data-views-plugin", - "@kbn/embeddable-plugin", - "@kbn/triggers-actions-ui-plugin", - "@kbn/security-plugin", - "@kbn/navigation-plugin", - "@kbn/i18n-react", - "@kbn/es-types", - "@kbn/rison", - "@kbn/datemath", - "@kbn/es-query", - "@kbn/field-formats-plugin", - "@kbn/coloring", - "@kbn/ui-actions-plugin", - "@kbn/visualizations-plugin", - "@kbn/core-http-browser", - "@kbn/share-plugin", - "@kbn/charts-plugin", - "@kbn/shared-ux-router", - "@kbn/observability-shared-plugin", - "@kbn/core-ui-settings-browser-mocks", - "@kbn/observability-ai-assistant-plugin", - "@kbn/shared-ux-link-redirect-app", - "@kbn/react-kibana-context-render", - "@kbn/react-kibana-mount", - "@kbn/core-analytics-browser", - "@kbn/expressions-plugin", - "@kbn/ebt-tools" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/container_kpi_charts.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/container_kpi_charts.tsx index c2f61b97257f..95291d157745 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/container_kpi_charts.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/container_kpi_charts.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiFlexItem, useEuiTheme } from '@elastic/eui'; +import { EuiFlexItem } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { Kpi } from './kpi'; @@ -79,10 +79,8 @@ const DockerKpiCharts = ({ searchSessionId, loading = false, }: ContainerKpiChartsProps) => { - const { euiTheme } = useEuiTheme(); const charts = useDockerContainerKpiCharts({ dataViewId: dataView?.id, - seriesColor: euiTheme.colors.lightestShade, }); return ( @@ -112,10 +110,8 @@ const KubernetesKpiCharts = ({ searchSessionId, loading = false, }: ContainerKpiChartsProps) => { - const { euiTheme } = useEuiTheme(); const charts = useK8sContainerKpiCharts({ dataViewId: dataView?.id, - seriesColor: euiTheme.colors.lightestShade, }); return ( diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/host_kpi_charts.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/host_kpi_charts.tsx index adccf59e519d..64345efb1af8 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/host_kpi_charts.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/components/kpis/host_kpi_charts.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiFlexItem, useEuiTheme } from '@elastic/eui'; +import { EuiFlexItem } from '@elastic/eui'; import type { DataView } from '@kbn/data-views-plugin/public'; import type { Filter, Query, TimeRange } from '@kbn/es-query'; import { Kpi } from './kpi'; @@ -31,11 +31,9 @@ export const HostKpiCharts = ({ searchSessionId, loading = false, }: HostKpiChartsProps) => { - const { euiTheme } = useEuiTheme(); const charts = useHostKpiCharts({ dataViewId: dataView?.id, getSubtitle, - seriesColor: euiTheme.colors.lightestShade, }); return ( diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.test.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.test.ts new file mode 100644 index 000000000000..7c58445a503d --- /dev/null +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.test.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 { useEuiTheme } from '@elastic/eui'; +import { renderHook } from '@testing-library/react'; +import { useChartSeriesColor } from './use_chart_series_color'; + +describe('useChartSeriesColor', () => { + let seriesDefaultColor: string; + + beforeEach(() => { + const { result } = renderHook(() => useEuiTheme()); + + // Don't try to test a hardcoded value, just use what is provided by EUI. + // If in the future this value changes, the tests won't break. + seriesDefaultColor = result.current.euiTheme.colors.backgroundLightText; + }); + + it('returns a default color value if given no input', () => { + const { result } = renderHook(() => useChartSeriesColor()); + + expect(result.current).not.toBe(''); + expect(result.current).toBe(seriesDefaultColor); + }); + + it('returns a default color value if given an empty string', () => { + const { result } = renderHook(() => useChartSeriesColor('')); + + expect(result.current).not.toBe(''); + expect(result.current).toBe(seriesDefaultColor); + }); + + it('returns the provided color input', () => { + const { result } = renderHook(() => useChartSeriesColor('#fff')); + + expect(result.current).not.toBe(seriesDefaultColor); + expect(result.current).toBe('#fff'); + }); +}); diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.ts new file mode 100644 index 000000000000..d71408982226 --- /dev/null +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_chart_series_color.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 { useEuiTheme } from '@elastic/eui'; + +/** + * Provides either the input color, or yields the default EUI theme + * color for use as the KPI chart series color. + * @param seriesColor A user-defined color value + * @returns Either the input `seriesColor` or the default color from EUI + */ +export const useChartSeriesColor = (seriesColor?: string): string => { + const { euiTheme } = useEuiTheme(); + + // Prevent empty string being used as a valid color + return seriesColor || euiTheme.colors.backgroundLightText; +}; diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_container_metrics_charts.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_container_metrics_charts.ts index cf1d5062a5c6..c453725f3f52 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_container_metrics_charts.ts +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_container_metrics_charts.ts @@ -9,6 +9,7 @@ import { i18n } from '@kbn/i18n'; import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common'; import useAsync from 'react-use/lib/useAsync'; import { ContainerMetricTypes } from '../charts/types'; +import { useChartSeriesColor } from './use_chart_series_color'; const getSubtitleFromFormula = (value: string) => value.startsWith('max') @@ -106,6 +107,8 @@ export const useDockerContainerKpiCharts = ({ dataViewId?: string; seriesColor?: string; }) => { + seriesColor = useChartSeriesColor(seriesColor); + const { value: charts = [] } = useAsync(async () => { const model = findInventoryModel('container'); const { cpu, memory } = await model.metrics.getCharts(); @@ -134,6 +137,8 @@ export const useK8sContainerKpiCharts = ({ dataViewId?: string; seriesColor?: string; }) => { + seriesColor = useChartSeriesColor(seriesColor); + const { value: charts = [] } = useAsync(async () => { const model = findInventoryModel('container'); const { cpu, memory } = await model.metrics.getCharts(); diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_date_picker.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_date_picker.ts index e6b69c1ddca8..4cb20bfc4f3d 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_date_picker.ts +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_date_picker.ts @@ -52,8 +52,9 @@ export function useDatePicker({ (newDateRange: TimeRange) => { setUrlState({ dateRange: newDateRange }); setParsedDateRange(parseDateRange(newDateRange)); + updateSearchSessionId(); }, - [setUrlState] + [setUrlState, updateSearchSessionId] ); const onRefresh = useCallback( @@ -62,12 +63,10 @@ export function useDatePicker({ if (autoRefreshEnabled) { autoRefreshTick$.next(null); } else { - updateSearchSessionId(); + setDateRange(newDateRange); } - - setDateRange(newDateRange); }, - [autoRefreshEnabled, autoRefreshTick$, setDateRange, updateSearchSessionId] + [autoRefreshEnabled, autoRefreshTick$, setDateRange] ); const setAutoRefresh = useCallback( diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_host_metrics_charts.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_host_metrics_charts.ts index 57c9a5a0d7d4..ba3e3f973b35 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_host_metrics_charts.ts +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_host_metrics_charts.ts @@ -10,6 +10,7 @@ import { findInventoryModel } from '@kbn/metrics-data-access-plugin/common'; import { useMemo } from 'react'; import useAsync from 'react-use/lib/useAsync'; import { HostMetricTypes } from '../charts/types'; +import { useChartSeriesColor } from './use_chart_series_color'; export const useHostCharts = ({ metric, @@ -87,6 +88,8 @@ export const useHostKpiCharts = ({ seriesColor?: string; getSubtitle?: (formulaValue: string) => string; }) => { + seriesColor = useChartSeriesColor(seriesColor); + const { value: charts = [] } = useAsync(async () => { const model = findInventoryModel('host'); const { cpu, memory, disk } = await model.metrics.getCharts(); diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_log_charts.ts b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_log_charts.ts new file mode 100644 index 000000000000..e373e214a63c --- /dev/null +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_log_charts.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import { useMemo } from 'react'; +import { LensConfig } from '@kbn/lens-embeddable-utils/config_builder'; +import { useChartSeriesColor } from './use_chart_series_color'; + +const LOG_RATE = i18n.translate('xpack.infra.assetDetails.charts.logRate', { + defaultMessage: 'Log Rate', +}); + +const LOG_ERROR_RATE = i18n.translate('xpack.infra.assetDetails.charts.logErrorRate', { + defaultMessage: 'Log Error Rate', +}); + +const logRateMetric: LensConfig & { id: string } = { + id: 'logMetric', + chartType: 'metric', + title: LOG_RATE, + label: LOG_RATE, + trendLine: true, + value: 'count()', + format: 'number', + decimals: 1, + normalizeByUnit: 's', +}; + +const logErrorRateMetric: LensConfig & { id: string } = { + id: 'logErrorMetric', + chartType: 'metric', + title: LOG_ERROR_RATE, + label: LOG_ERROR_RATE, + trendLine: true, + value: + 'count(kql=\'log.level: "error" OR log.level: "ERROR" OR error.log.level: "error" OR error.log.level: "ERROR"\')', + format: 'number', + decimals: 1, + normalizeByUnit: 's', +}; + +export const useLogsCharts = ({ + dataViewId, + seriesColor, +}: { + dataViewId?: string; + seriesColor?: string; +}) => { + seriesColor = useChartSeriesColor(seriesColor); + + return useMemo(() => { + const dataset = dataViewId && { + dataset: { + index: dataViewId, + }, + }; + + return { + charts: [ + { + ...logRateMetric, + ...dataset, + seriesColor, + }, + { + ...logErrorRateMetric, + ...dataset, + seriesColor, + }, + ], + }; + }, [dataViewId, seriesColor]); +}; diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_page_header.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_page_header.tsx index efd8c6028b03..aeb85617015e 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_page_header.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/hooks/use_page_header.tsx @@ -26,6 +26,8 @@ import { LinkToNodeDetails } from '../links'; import { ContentTabIds, type LinkOptions, type Tab, type TabIds } from '../types'; import { useAssetDetailsRenderPropsContext } from './use_asset_details_render_props'; import { useTabSwitcherContext } from './use_tab_switcher'; +import { useEntitySummary } from './use_entity_summary'; +import { isMetricsSignal } from '../utils/get_data_stream_types'; type TabItem = NonNullable<Pick<EuiPageHeaderProps, 'tabs'>['tabs']>[number]; @@ -140,9 +142,31 @@ const useFeatureFlagTabs = () => { }; }; +const useMetricsTabs = () => { + const { asset } = useAssetDetailsRenderPropsContext(); + const { dataStreams } = useEntitySummary({ + entityType: asset.type, + entityId: asset.id, + }); + + const isMetrics = isMetricsSignal(dataStreams); + + const hasMetricsTab = useCallback( + (tabItem: Tab) => { + return isMetrics || tabItem.id !== ContentTabIds.METRICS; + }, + [isMetrics] + ); + + return { + hasMetricsTab, + }; +}; + const useTabs = (tabs: Tab[]) => { const { showTab, activeTabId } = useTabSwitcherContext(); const { isTabEnabled } = useFeatureFlagTabs(); + const { hasMetricsTab } = useMetricsTabs(); const onTabClick = useCallback( (tabId: TabIds) => { @@ -153,16 +177,18 @@ const useTabs = (tabs: Tab[]) => { const tabEntries: TabItem[] = useMemo( () => - tabs.filter(isTabEnabled).map(({ name, ...tab }) => { - return { - ...tab, - 'data-test-subj': `infraAssetDetails${capitalize(tab.id)}Tab`, - onClick: () => onTabClick(tab.id), - isSelected: tab.id === activeTabId, - label: name, - }; - }), - [activeTabId, isTabEnabled, onTabClick, tabs] + tabs + .filter((tab) => isTabEnabled(tab) && hasMetricsTab(tab)) + .map(({ name, ...tab }) => { + return { + ...tab, + 'data-test-subj': `infraAssetDetails${capitalize(tab.id)}Tab`, + onClick: () => onTabClick(tab.id), + isSelected: tab.id === activeTabId, + label: name, + }; + }), + [activeTabId, isTabEnabled, hasMetricsTab, onTabClick, tabs] ); return { tabEntries }; diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/logs.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/logs.tsx new file mode 100644 index 000000000000..5ca334acf20e --- /dev/null +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/logs.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 React, { useMemo } from 'react'; +import type { DataView } from '@kbn/data-views-plugin/public'; +import type { TimeRange } from '@kbn/es-query'; +import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { + findInventoryFields, + type InventoryItemType, +} from '@kbn/metrics-data-access-plugin/common'; +import { buildCombinedAssetFilter } from '../../../../utils/filters/build'; +import { useSearchSessionContext } from '../../../../hooks/use_search_session'; +import { useLogsCharts } from '../../hooks/use_log_charts'; +import { Kpi } from '../../components/kpis/kpi'; + +interface Props { + dataView?: DataView; + assetId: string; + assetType: InventoryItemType; + dateRange: TimeRange; +} + +export const LogsContent = ({ assetId, assetType, dataView, dateRange }: Props) => { + const { searchSessionId } = useSearchSessionContext(); + + const filters = useMemo(() => { + return [ + buildCombinedAssetFilter({ + field: findInventoryFields(assetType).id, + values: [assetId], + dataView, + }), + ]; + }, [dataView, assetId, assetType]); + + const { charts } = useLogsCharts({ + dataViewId: dataView?.id, + }); + + return ( + <EuiFlexGroup direction="row" gutterSize="s" data-test-subj="infraAssetDetailsLogsGrid"> + {charts.map((chartProps, index) => ( + <EuiFlexItem key={index}> + <Kpi + {...chartProps} + dateRange={dateRange} + filters={filters} + searchSessionId={searchSessionId} + /> + </EuiFlexItem> + ))} + </EuiFlexGroup> + ); +}; diff --git a/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/overview.tsx b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/overview.tsx index 9ace5606599d..a25ee35cb75f 100644 --- a/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/overview.tsx +++ b/x-pack/plugins/observability_solution/infra/public/components/asset_details/tabs/overview/overview.tsx @@ -26,7 +26,8 @@ import { MetricsContent } from './metrics/metrics'; import { AddMetricsCallout } from '../../add_metrics_callout'; import { AddMetricsCalloutKey } from '../../add_metrics_callout/constants'; import { useEntitySummary } from '../../hooks/use_entity_summary'; -import { isMetricsSignal } from '../../utils/get_data_stream_types'; +import { isMetricsSignal, isLogsSignal } from '../../utils/get_data_stream_types'; +import { LogsContent } from './logs'; export const Overview = () => { const { dateRange } = useDatePickerContext(); @@ -36,7 +37,7 @@ export const Overview = () => { loading: metadataLoading, error: fetchMetadataError, } = useMetadataStateContext(); - const { metrics } = useDataViewsContext(); + const { metrics, logs } = useDataViewsContext(); const isFullPageView = renderMode.mode === 'page'; const { dataStreams, status: dataStreamsStatus } = useEntitySummary({ entityType: asset.type, @@ -59,6 +60,10 @@ export const Overview = () => { /> ); + const isMetrics = isMetricsSignal(dataStreams); + const isLogs = isLogsSignal(dataStreams); + const isLogsOnly = !isMetrics && isLogs; + const shouldShowCallout = () => { if ( dataStreamsStatus !== 'success' || @@ -68,14 +73,14 @@ export const Overview = () => { return false; } - return !isMetricsSignal(dataStreams); + return !isMetrics; }; const showAddMetricsCallout = shouldShowCallout(); return ( <EuiFlexGroup direction="column" gutterSize="m"> - {showAddMetricsCallout ? ( + {showAddMetricsCallout && ( <EuiFlexItem grow={false}> <AddMetricsCallout id={addMetricsCalloutId} @@ -84,7 +89,18 @@ export const Overview = () => { }} /> </EuiFlexItem> - ) : ( + )} + {isLogsOnly ? ( + <EuiFlexItem grow={false}> + <LogsContent + assetId={asset.id} + assetType={asset.type} + dateRange={dateRange} + dataView={logs.dataView} + /> + </EuiFlexItem> + ) : null} + {!showAddMetricsCallout && isMetrics ? ( <EuiFlexItem grow={false}> <KPIGrid assetId={asset.id} @@ -94,7 +110,7 @@ export const Overview = () => { /> {asset.type === 'host' ? <CpuProfilingPrompt /> : null} </EuiFlexItem> - )} + ) : null} <EuiFlexItem grow={false}> {fetchMetadataError && !metadataLoading ? <MetadataErrorCallout /> : metadataSummarySection} <SectionSeparator /> @@ -111,14 +127,16 @@ export const Overview = () => { <SectionSeparator /> </EuiFlexItem> ) : null} - <EuiFlexItem grow={false}> - <MetricsContent - assetId={asset.id} - assetType={asset.type} - dateRange={dateRange} - dataView={metrics.dataView} - /> - </EuiFlexItem> + {isMetrics ? ( + <EuiFlexItem grow={false}> + <MetricsContent + assetId={asset.id} + assetType={asset.type} + dateRange={dateRange} + dataView={metrics.dataView} + /> + </EuiFlexItem> + ) : null} </EuiFlexGroup> ); }; diff --git a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts index 6feefd399a82..291f95554e89 100644 --- a/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts +++ b/x-pack/plugins/observability_solution/infra/public/pages/metrics/hosts/hooks/use_unified_search.ts @@ -53,7 +53,11 @@ export const useUnifiedSearch = () => { const { data: { - query: { filterManager: filterManagerService, queryString: queryStringService }, + query: { + filterManager: filterManagerService, + queryString: queryStringService, + timefilter: timeFilterService, + }, }, telemetry, } = services; @@ -68,29 +72,33 @@ export const useUnifiedSearch = () => { const onFiltersChange = useCallback( (filters: Filter[]) => { setSearch({ type: 'SET_FILTERS', filters }); + updateSearchSessionId(); }, - [setSearch] + [setSearch, updateSearchSessionId] ); const onPanelFiltersChange = useCallback( (panelFilters: Filter[]) => { setSearch({ type: 'SET_PANEL_FILTERS', panelFilters }); + updateSearchSessionId(); }, - [setSearch] + [setSearch, updateSearchSessionId] ); const onLimitChange = useCallback( (limit: number) => { setSearch({ type: 'SET_LIMIT', limit }); + updateSearchSessionId(); }, - [setSearch] + [setSearch, updateSearchSessionId] ); const onDateRangeChange = useCallback( (dateRange: StringDateRange) => { setSearch({ type: 'SET_DATE_RANGE', dateRange }); + updateSearchSessionId(); }, - [setSearch] + [setSearch, updateSearchSessionId] ); const onQueryChange = useCallback( @@ -99,19 +107,19 @@ export const useUnifiedSearch = () => { setError(null); validateQuery(query); setSearch({ type: 'SET_QUERY', query }); + updateSearchSessionId(); } catch (err) { setError(err); } }, - [validateQuery, setSearch] + [validateQuery, setSearch, updateSearchSessionId] ); const onSubmit = useCallback( ({ dateRange }: { dateRange: TimeRange }) => { onDateRangeChange(dateRange); - updateSearchSessionId(); }, - [onDateRangeChange, updateSearchSessionId] + [onDateRangeChange] ); const getDateRangeAsTimestamp = useCallback(() => { @@ -168,6 +176,16 @@ export const useUnifiedSearch = () => { .subscribe() ); + subscription.add( + timeFilterService.timefilter + .getTimeUpdate$() + .pipe( + map(() => timeFilterService.timefilter.getTime()), + tap((dateRange) => onDateRangeChange(dateRange)) + ) + .subscribe() + ); + subscription.add( queryStringService .getUpdates$() @@ -181,7 +199,14 @@ export const useUnifiedSearch = () => { return () => { subscription.unsubscribe(); }; - }, [filterManagerService, queryStringService, onQueryChange, onFiltersChange]); + }, [ + filterManagerService, + queryStringService, + onQueryChange, + onFiltersChange, + timeFilterService.timefilter, + onDateRangeChange, + ]); // Track telemetry event on query/filter/date changes useEffect(() => { diff --git a/x-pack/plugins/observability_solution/inventory/tsconfig.json b/x-pack/plugins/observability_solution/inventory/tsconfig.json index 561ca62eaf97..54b6336ab3be 100644 --- a/x-pack/plugins/observability_solution/inventory/tsconfig.json +++ b/x-pack/plugins/observability_solution/inventory/tsconfig.json @@ -51,6 +51,9 @@ "@kbn/rule-data-utils", "@kbn/spaces-plugin", "@kbn/cloud-plugin", + "@kbn/observability-utils-browser", + "@kbn/observability-utils-server", + "@kbn/observability-utils-common", "@kbn/storybook", "@kbn/dashboard-plugin", "@kbn/deeplinks-analytics", diff --git a/x-pack/plugins/observability_solution/investigate/jest.config.js b/x-pack/plugins/observability_solution/investigate/jest.config.js deleted file mode 100644 index bba3a2285005..000000000000 --- a/x-pack/plugins/observability_solution/investigate/jest.config.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: [ - '<rootDir>/x-pack/plugins/observability_solution/investigate/public', - '<rootDir>/x-pack/plugins/observability_solution/investigate/common', - '<rootDir>/x-pack/plugins/observability_solution/investigate/server', - ], - setupFiles: [], - collectCoverage: true, - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/investigate/{common,public,server}/**/*.{js,ts,tsx}', - ], - - coverageReporters: ['html'], -}; diff --git a/x-pack/plugins/observability_solution/investigate/tsconfig.json b/x-pack/plugins/observability_solution/investigate/tsconfig.json deleted file mode 100644 index e2e39f527c2e..000000000000 --- a/x-pack/plugins/observability_solution/investigate/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "public/**/*", - "typings/**/*", - "public/**/*.json", - "server/**/*", ], - "kbn_references": [ - "@kbn/core", - "@kbn/logging", - "@kbn/config-schema", - "@kbn/es-query", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/investigate_app/jest.config.js b/x-pack/plugins/observability_solution/investigate_app/jest.config.js deleted file mode 100644 index b37e5c69d463..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: [ - '<rootDir>/x-pack/plugins/observability_solution/investigate_app/public', - '<rootDir>/x-pack/plugins/observability_solution/investigate_app/server', - ], - setupFiles: [ - '<rootDir>/x-pack/plugins/observability_solution/investigate_app/.storybook/jest_setup.js', - ], - collectCoverage: true, - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/investigate_app/{public,server}/**/*.{js,ts,tsx}', - ], - - coverageReporters: ['html'], -}; diff --git a/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc b/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc deleted file mode 100644 index e105cacf75d0..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/kibana.jsonc +++ /dev/null @@ -1,37 +0,0 @@ -{ - "type": "plugin", - "id": "@kbn/investigate-app-plugin", - "owner": "@elastic/obs-ux-management-team", - "group": "observability", - "visibility": "private", - "plugin": { - "id": "investigateApp", - "server": true, - "browser": true, - "configPath": ["xpack", "investigateApp"], - "requiredPlugins": [ - "investigate", - "observabilityShared", - "lens", - "charts", - "dataViews", - "data", - "embeddable", - "contentManagement", - "datasetQuality", - "unifiedSearch", - "security", - "observability", - "licensing", - "ruleRegistry", - "usageCollection" - ], - "requiredBundles": [ - "esql", - "kibanaReact", - "kibanaUtils" - ], - "optionalPlugins": ["observabilityAIAssistant"], - "extraPublicDirs": [] - } -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/api/index.ts b/x-pack/plugins/observability_solution/investigate_app/public/api/index.ts deleted file mode 100644 index af02f4a15e74..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/api/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { CoreSetup, CoreStart, HttpFetchOptions } from '@kbn/core/public'; -import type { - ClientRequestParamsOf, - ReturnOf, - RouteRepositoryClient, -} from '@kbn/server-route-repository'; -import { formatRequest } from '@kbn/server-route-repository-utils/src/format_request'; -import type { InvestigateAppServerRouteRepository } from '../../server'; - -type FetchOptions = Omit<HttpFetchOptions, 'body'> & { - body?: any; -}; - -export type InvestigateAppAPIClientOptions = Omit< - FetchOptions, - 'query' | 'body' | 'pathname' | 'signal' -> & { - signal: AbortSignal | null; -}; - -export type InvestigateAppAPIClient = RouteRepositoryClient< - InvestigateAppServerRouteRepository, - InvestigateAppAPIClientOptions ->['fetch']; - -export type AutoAbortedInvestigateAppAPIClient = RouteRepositoryClient< - InvestigateAppServerRouteRepository, - Omit<InvestigateAppAPIClientOptions, 'signal'> ->['fetch']; - -export type InvestigateAppAPIEndpoint = keyof InvestigateAppServerRouteRepository; - -export type APIReturnType<TEndpoint extends InvestigateAppAPIEndpoint> = ReturnOf< - InvestigateAppServerRouteRepository, - TEndpoint ->; - -export type InvestigateAppAPIClientRequestParamsOf<TEndpoint extends InvestigateAppAPIEndpoint> = - ClientRequestParamsOf<InvestigateAppServerRouteRepository, TEndpoint>; - -export function createCallInvestigateAppAPI(core: CoreStart | CoreSetup) { - return ((endpoint, options) => { - const { params } = options as unknown as { - params?: Partial<Record<string, any>>; - }; - - const { method, pathname, version } = formatRequest(endpoint, params?.path); - - return core.http[method](pathname, { - ...options, - body: params && params.body ? JSON.stringify(params.body) : undefined, - query: params?.query, - version, - }); - }) as InvestigateAppAPIClient; -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx b/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx deleted file mode 100644 index 77833e80ec19..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/items/embeddable_item/register_embeddable_item.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 { EuiLoadingSpinner, EuiFlexItem } from '@elastic/eui'; -import { css } from '@emotion/css'; -import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; -import type { GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; -import { useAbortableAsync } from '@kbn/observability-utils-browser/hooks/use_abortable_async'; -import React, { useEffect, useMemo, useRef, useState } from 'react'; -import { v4 } from 'uuid'; -import { ErrorMessage } from '../../components/error_message'; -import { useKibana } from '../../hooks/use_kibana'; -import { Options } from '../register_items'; - -export const EMBEDDABLE_ITEM_TYPE = 'embeddable'; - -const embeddableClassName = css` - height: 100%; - > [data-shared-item] { - height: 100%; - } -`; - -type Props = EmbeddableItemParams & GlobalWidgetParameters; - -type ParentApi = ReturnType<React.ComponentProps<typeof ReactEmbeddableRenderer>['getParentApi']>; - -function ReactEmbeddable({ type, config, timeRange: { from, to }, savedObjectId }: Props) { - const configWithOverrides = useMemo(() => { - return { - ...config, - timeRange: { - from, - to, - }, - savedObjectId, - }; - }, [config, from, to, savedObjectId]); - - const configWithOverridesRef = useRef(configWithOverrides); - - configWithOverridesRef.current = configWithOverrides; - - const api = useMemo<ParentApi>(() => { - return { - getSerializedStateForChild: () => ({ rawState: configWithOverridesRef.current }), - }; - }, []); - - return ( - <div className={embeddableClassName}> - <ReactEmbeddableRenderer - type={type} - getParentApi={() => api} - maybeId={savedObjectId} - hidePanelChrome - /> - </div> - ); -} - -function LegacyEmbeddable({ type, config, timeRange: { from, to }, savedObjectId }: Props) { - const { - dependencies: { - start: { embeddable }, - }, - } = useKibana(); - - const [targetElement, setTargetElement] = useState<HTMLElement | null>(null); - - const embeddableInstanceAsync = useAbortableAsync(async () => { - const factory = embeddable.getEmbeddableFactory(type); - - if (!factory) { - throw new Error(`Cannot find embeddable factory for ${type}`); - } - - const configWithId = { - id: savedObjectId ?? v4(), - ...config, - }; - - const configWithOverrides = { - ...configWithId, - timeRange: { - from, - to, - }, - overrides: { - axisX: { hide: true }, - axisLeft: { style: { axisTitle: { visible: false } } }, - settings: { showLegend: false }, - }, - }; - - if (savedObjectId) { - return factory.createFromSavedObject(configWithOverrides.id, configWithOverrides); - } - - const instance = await factory.create(configWithOverrides); - - return instance; - }, [type, savedObjectId, config, from, to, embeddable]); - - const embeddableInstance = embeddableInstanceAsync.value; - - useEffect(() => { - if (!targetElement || !embeddableInstance) { - return; - } - - embeddableInstance.render(targetElement); - - return () => {}; - }, [embeddableInstance, targetElement]); - - useEffect(() => { - return () => { - if (embeddableInstance) { - embeddableInstance.destroy(); - } - }; - }, [embeddableInstance]); - - if (embeddableInstanceAsync.error) { - return <ErrorMessage error={embeddableInstanceAsync.error} />; - } - - if (!embeddableInstance) { - return <EuiLoadingSpinner />; - } - - return ( - <div - className={embeddableClassName} - ref={(element) => { - setTargetElement(element); - }} - /> - ); -} - -function EmbeddableWidget(props: Props) { - const { - dependencies: { - start: { embeddable }, - }, - } = useKibana(); - - if (embeddable.reactEmbeddableRegistryHasKey(props.type)) { - return <ReactEmbeddable {...props} />; - } - - return <LegacyEmbeddable {...props} />; -} - -interface EmbeddableItemParams { - type: string; - config: Record<string, any>; - savedObjectId?: string; -} - -export function registerEmbeddableItem({ - dependencies: { - setup: { investigate }, - }, - services, -}: Options) { - investigate.registerItemDefinition<EmbeddableItemParams, {}>({ - type: EMBEDDABLE_ITEM_TYPE, - generate: async (option: { - itemParams: EmbeddableItemParams; - globalParams: GlobalWidgetParameters; - }) => { - return {}; - }, - render: (option: { - itemParams: EmbeddableItemParams; - globalParams: GlobalWidgetParameters; - }) => { - const parameters = { - type: option.itemParams.type, - config: option.itemParams.config, - savedObjectId: option.itemParams.savedObjectId, - timeRange: option.globalParams.timeRange, - }; - - return ( - <EuiFlexItem - grow={true} - className={css` - > div { - height: 128px; - } - `} - > - <EmbeddableWidget {...parameters} /> - </EuiFlexItem> - ); - }, - }); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.tsx deleted file mode 100644 index f63cbb9c0161..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.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 dedent from 'dedent'; -import { - ALERT_RULE_PARAMETERS, - ALERT_START, - ALERT_RULE_CATEGORY, - ALERT_REASON, -} from '@kbn/rule-data-utils'; -import { i18n } from '@kbn/i18n'; -import { EntityWithSource } from '@kbn/investigation-shared'; -import React, { useCallback } from 'react'; -import { useKibana } from '../../../../hooks/use_kibana'; -import { useInvestigation } from '../../contexts/investigation_context'; -import { useFetchEntities } from '../../../../hooks/use_fetch_entities'; - -export interface InvestigationContextualInsight { - key: string; - description: string; - data: unknown; -} - -export function AssistantHypothesis({ investigationId }: { investigationId: string }) { - const { alert } = useInvestigation(); - const { - dependencies: { - start: { - observabilityAIAssistant: { - ObservabilityAIAssistantContextualInsight, - getContextualInsightMessages, - }, - }, - }, - } = useKibana(); - const { data: entitiesData } = useFetchEntities({ - investigationId, - serviceName: alert?.['service.name'] ? `${alert?.['service.name']}` : undefined, - serviceEnvironment: alert?.['service.environment'] - ? `${alert?.['service.environment']}` - : undefined, - hostName: alert?.['host.name'] ? `${alert?.['host.name']}` : undefined, - containerId: alert?.['container.id'] ? `${alert?.['container.id']}` : undefined, - }); - - const getAlertContextMessages = useCallback(async () => { - if (!getContextualInsightMessages || !alert) { - return []; - } - - const entities = entitiesData?.entities ?? []; - - const entityContext = entities?.length - ? ` - Alerts can optionally be associated with entities. Entities can be services, hosts, containers, or other resources. Entities can have metrics associated with them. - - The alert that triggered this investigation is associated with the following entities: ${entities - .map((entity, index) => { - return dedent(` - ## Entity ${index + 1}: - ${formatEntityMetrics(entity)}; - `); - }) - .join('/n/n')}` - : ''; - - return getContextualInsightMessages({ - message: `I am investigating a failure in my system. I was made aware of the failure by an alert and I am trying to understand the root cause of the issue.`, - instructions: dedent( - `I'm an SRE. I am investigating a failure in my system. I was made aware of the failure via an alert. Your current task is to help me identify the root cause of the failure in my system. - - The rule that triggered the alert is a ${ - alert[ALERT_RULE_CATEGORY] - } rule. The alert started at ${alert[ALERT_START]}. The alert reason is ${ - alert[ALERT_REASON] - }. The rule parameters are ${JSON.stringify(ALERT_RULE_PARAMETERS)}. - - ${entityContext} - - Based on the alert details, suggest a root cause and next steps to mitigate the issue. - - I do not have the alert details or entity details in front of me, so be sure to repeat the alert reason (${ - alert[ALERT_REASON] - }), when the alert was triggered (${ - alert[ALERT_START] - }), and the entity metrics in your response. - - When displaying the entity metrics, please convert the metrics to a human-readable format. For example, convert "logRate" to "Log Rate" and "errorRate" to "Error Rate". - ` - ), - }); - }, [alert, getContextualInsightMessages, entitiesData?.entities]); - - if (!ObservabilityAIAssistantContextualInsight) { - return null; - } - - return alert && entitiesData ? ( - <ObservabilityAIAssistantContextualInsight - title={i18n.translate( - 'xpack.investigateApp.assistantHypothesis.observabilityAIAssistantContextualInsight.helpMeInvestigateThisLabel', - { defaultMessage: 'Help me investigate this failure' } - )} - messages={getAlertContextMessages} - /> - ) : null; -} -const formatEntityMetrics = (entity: EntityWithSource): string => { - const entityMetrics = Object.entries(entity.metrics) - .map(([key, value]) => `${key}: ${value}`) - .join(', '); - const entitySources = entity.sources.map((source) => source.dataStream).join(', '); - return dedent(` - Entity name: ${entity.display_name}; - Entity type: ${entity.type}; - Entity metrics: ${entityMetrics}; - Entity data streams: ${entitySources} - `); -}; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/events_timeline.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/events_timeline.tsx deleted file mode 100644 index 45b245f68b4b..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/events_timeline.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 React, { useMemo, useRef } from 'react'; -import moment from 'moment'; - -import { Chart, Axis, AreaSeries, Position, ScaleType, Settings } from '@elastic/charts'; -import { useActiveCursor } from '@kbn/charts-plugin/public'; -import { EuiSkeletonText } from '@elastic/eui'; -import { getBrushData } from '@kbn/observability-utils-browser/chart/utils'; -import { AnnotationEvent } from './annotation_event'; -import { TIME_LINE_THEME } from './timeline_theme'; -import { useFetchEvents } from '../../../../hooks/use_fetch_events'; -import { useInvestigation } from '../../contexts/investigation_context'; -import { useKibana } from '../../../../hooks/use_kibana'; -import { AlertEvent } from './alert_event'; - -export const EventsTimeLine = () => { - const { dependencies } = useKibana(); - - const baseTheme = dependencies.start.charts.theme.useChartsBaseTheme(); - - const { globalParams, updateInvestigationParams } = useInvestigation(); - - const { data: events, isLoading } = useFetchEvents({ - rangeFrom: globalParams.timeRange.from, - rangeTo: globalParams.timeRange.to, - }); - - const chartRef = useRef(null); - const handleCursorUpdate = useActiveCursor(dependencies.start.charts.activeCursor, chartRef, { - isDateHistogram: true, - }); - - const data = useMemo(() => { - const points = [ - { x: moment(globalParams.timeRange.from).valueOf(), y: 0 }, - { x: moment(globalParams.timeRange.to).valueOf(), y: 0 }, - ]; - - // adding 100 fake points to the chart so the chart shows cursor on hover - for (let i = 0; i < 100; i++) { - const diff = - moment(globalParams.timeRange.to).valueOf() - moment(globalParams.timeRange.from).valueOf(); - points.push({ x: moment(globalParams.timeRange.from).valueOf() + (diff / 100) * i, y: 0 }); - } - return points; - }, [globalParams.timeRange.from, globalParams.timeRange.to]); - - if (isLoading) { - return <EuiSkeletonText />; - } - - const alertEvents = events?.filter((evt) => evt.eventType === 'alert'); - const annotations = events?.filter((evt) => evt.eventType === 'annotation'); - - return ( - <> - <Chart size={['100%', 100]} ref={chartRef}> - <Settings - xDomain={{ - min: moment(globalParams.timeRange.from).valueOf(), - max: moment(globalParams.timeRange.to).valueOf(), - }} - theme={TIME_LINE_THEME} - baseTheme={baseTheme} - onPointerUpdate={handleCursorUpdate} - externalPointerEvents={{ - tooltip: { visible: true }, - }} - onBrushEnd={(brush) => { - const { from, to } = getBrushData(brush); - updateInvestigationParams({ - timeRange: { from, to }, - }); - }} - /> - <Axis id="y" position={Position.Left} hide /> - <Axis - id="x" - position={Position.Bottom} - tickFormat={(d) => moment(d).format('LTS')} - style={{ - tickLine: { - visible: true, - strokeWidth: 1, - stroke: '#98A2B3', - }, - }} - /> - - {alertEvents?.map((event) => ( - <AlertEvent key={event.id} event={event} /> - ))} - - {annotations?.map((annotation) => ( - <AnnotationEvent key={annotation.id} event={annotation} /> - ))} - - <AreaSeries - id="Time" - xScaleType={ScaleType.Time} - xAccessor="x" - yAccessors={['y']} - data={data} - filterSeriesInTooltip={() => false} - /> - </Chart> - </> - ); -}; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.tsx deleted file mode 100644 index c43ae1ffaa04..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.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 { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; -import { css } from '@emotion/css'; -import React from 'react'; -import { useTheme } from '../../../../hooks/use_theme'; -import { InvestigateTextButton } from '../../../../components/investigate_text_button'; - -export const GRID_ITEM_HEADER_HEIGHT = 40; - -interface GridItemProps { - id: string; - title: string; - children: React.ReactNode; - onCopy: () => void; - onDelete: () => void; - loading: boolean; -} - -const editTitleButtonClassName = `investigateGridItemTitleEditButton`; - -const titleContainerClassName = css` - overflow: hidden; -`; -const titleItemClassName = css` - max-width: 100%; - .euiText { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } -`; - -const panelContainerClassName = css` - overflow: clip; - overflow-clip-margin: 20px; -`; - -const panelClassName = css` - overflow-y: auto; -`; - -const panelContentClassName = css` - overflow-y: auto; - height: 100%; - > [data-shared-item] { - height: 100%; - } -`; - -export function GridItem({ id, title, children, onDelete, onCopy, loading }: GridItemProps) { - const theme = useTheme(); - - const headerClassName = css` - padding: 0 ${theme.size.s} 0 ${theme.size.s}}; -`; - - const containerClassName = css` - height: 100%; - max-width: 100%; - transition: opacity ${theme.animation.normal} ${theme.animation.resistance}; - overflow: auto; - - &:not(:hover) .${editTitleButtonClassName} { - opacity: 0; - } - `; - - return ( - <EuiPanel hasBorder hasShadow={false} className={panelClassName} paddingSize="none"> - <EuiFlexGroup - direction="column" - gutterSize="none" - className={containerClassName} - alignItems="stretch" - > - <EuiFlexItem grow={false}> - <EuiFlexGroup - direction="row" - gutterSize="none" - alignItems="center" - className={headerClassName} - > - <EuiFlexItem className={titleContainerClassName}> - <EuiText size="s" className={titleItemClassName}> - <h5>{title}</h5> - </EuiText> - </EuiFlexItem> - <EuiFlexItem grow={false} className="gridItemControls"> - <EuiFlexGroup - direction="row" - gutterSize="none" - alignItems="center" - justifyContent="flexEnd" - > - <EuiFlexItem grow={false}> - <InvestigateTextButton - iconType="copy" - onClick={() => { - onCopy(); - }} - disabled={loading} - /> - </EuiFlexItem> - <EuiFlexItem grow={false}> - <InvestigateTextButton - iconType="trash" - onClick={() => { - onDelete(); - }} - disabled={loading} - /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - </EuiFlexGroup> - </EuiFlexItem> - <EuiFlexItem grow className={panelContainerClassName}> - <div className={panelContentClassName}>{children}</div> - </EuiFlexItem> - </EuiFlexGroup> - </EuiPanel> - ); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx deleted file mode 100644 index bd03324a994a..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import datemath from '@elastic/datemath'; -import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; -import React from 'react'; -import { EventsTimeLine } from '../events_timeline/events_timeline'; -import { useInvestigation } from '../../contexts/investigation_context'; -import { AddInvestigationItem } from '../add_investigation_item/add_investigation_item'; -import { InvestigationItemsList } from '../investigation_items_list/investigation_items_list'; -import { InvestigationSearchBar } from '../investigation_search_bar/investigation_search_bar'; -import { AssistantHypothesis } from '../assistant_hypothesis/assistant_hypothesis'; - -export function InvestigationItems() { - const { globalParams, updateInvestigationParams, investigation } = useInvestigation(); - - return ( - <> - <EuiFlexGroup direction="column" gutterSize="s"> - <InvestigationSearchBar - dateRangeFrom={globalParams.timeRange.from} - dateRangeTo={globalParams.timeRange.to} - onQuerySubmit={async ({ dateRange }) => { - const nextTimeRange = { - from: datemath.parse(dateRange.from)!.toISOString(), - to: datemath.parse(dateRange.to)!.toISOString(), - }; - - updateInvestigationParams({ timeRange: nextTimeRange }); - }} - /> - - <EuiFlexItem grow={false}> - <EventsTimeLine /> - </EuiFlexItem> - - {investigation?.id && ( - <EuiFlexItem grow={false}> - <AssistantHypothesis investigationId={investigation.id} /> - </EuiFlexItem> - )} - <EuiFlexItem grow={false}> - <InvestigationItemsList /> - </EuiFlexItem> - </EuiFlexGroup> - - <EuiSpacer size="m" /> - - <AddInvestigationItem /> - </> - ); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx b/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx deleted file mode 100644 index a6ad73bc67d0..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_search_bar/investigation_search_bar.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { css } from '@emotion/css'; -import type { TimeRange } from '@kbn/es-query'; -import { SearchBar } from '@kbn/unified-search-plugin/public'; -import React from 'react'; -import { useKibana } from '../../../../hooks/use_kibana'; - -const parentClassName = css` - width: 100%; -`; - -interface Props { - dateRangeFrom?: string; - dateRangeTo?: string; - onQuerySubmit: (payload: { dateRange: TimeRange }, isUpdate?: boolean) => void; - onRefresh?: Required<React.ComponentProps<typeof SearchBar>>['onRefresh']; -} - -export function InvestigationSearchBar({ - dateRangeFrom, - dateRangeTo, - onQuerySubmit, - onRefresh, -}: Props) { - const { - dependencies: { - start: { unifiedSearch }, - }, - } = useKibana(); - - return ( - <div className={parentClassName}> - <unifiedSearch.ui.SearchBar - appName="investigate" - onQuerySubmit={({ dateRange }) => { - onQuerySubmit({ dateRange }); - }} - showQueryInput={false} - showFilterBar={false} - showQueryMenu={false} - showDatePicker - showSubmitButton={true} - dateRangeFrom={dateRangeFrom} - dateRangeTo={dateRangeTo} - onRefresh={onRefresh} - displayStyle="inPage" - disableQueryLanguageSwitcher - /> - </div> - ); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx b/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx deleted file mode 100644 index 5ec88f9d7246..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/plugin.tsx +++ /dev/null @@ -1,149 +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 { - AppMountParameters, - AppStatus, - CoreSetup, - CoreStart, - DEFAULT_APP_CATEGORIES, - Plugin, - PluginInitializerContext, -} from '@kbn/core/public'; -import { INVESTIGATE_APP_ID } from '@kbn/deeplinks-observability/constants'; -import { i18n } from '@kbn/i18n'; -import type { Logger } from '@kbn/logging'; -import { once } from 'lodash'; -import React from 'react'; -import ReactDOM from 'react-dom'; -import type { InvestigateAppServices } from './services/types'; -import type { - ConfigSchema, - InvestigateAppPublicSetup, - InvestigateAppPublicStart, - InvestigateAppSetupDependencies, - InvestigateAppStartDependencies, -} from './types'; - -const getCreateEsqlService = once(() => import('./services/esql').then((m) => m.createEsqlService)); - -export class InvestigateAppPlugin - implements - Plugin< - InvestigateAppPublicSetup, - InvestigateAppPublicStart, - InvestigateAppSetupDependencies, - InvestigateAppStartDependencies - > -{ - logger: Logger; - config: ConfigSchema; - - constructor(context: PluginInitializerContext<ConfigSchema>) { - this.logger = context.logger.get(); - this.config = context.config.get(); - } - - setup( - coreSetup: CoreSetup<InvestigateAppStartDependencies, InvestigateAppPublicStart>, - pluginsSetup: InvestigateAppSetupDependencies - ): InvestigateAppPublicSetup { - coreSetup.application.register({ - id: INVESTIGATE_APP_ID, - title: i18n.translate('xpack.investigateApp.appTitle', { - defaultMessage: 'Investigations', - }), - euiIconType: 'logoObservability', - appRoute: '/app/investigations', - category: DEFAULT_APP_CATEGORIES.observability, - status: this.config.enabled ? AppStatus.accessible : AppStatus.inaccessible, - visibleIn: [], - deepLinks: [ - { - id: 'investigations', - title: i18n.translate('xpack.investigateApp.investigationsDeepLinkTitle', { - defaultMessage: 'All investigations', - }), - path: '/', - }, - { - id: 'investigationDetails', - title: i18n.translate('xpack.investigateApp.newInvestigateDeepLinkTitle', { - defaultMessage: 'New investigation', - }), - path: '/new', - }, - ], - mount: async (appMountParameters: AppMountParameters<unknown>) => { - // Load application bundle and Get start services - const [{ Application }, [coreStart, pluginsStart], createEsqlService] = await Promise.all([ - import('./application'), - coreSetup.getStartServices(), - getCreateEsqlService(), - ]); - - const services: InvestigateAppServices = { - ...coreStart, - esql: createEsqlService({ - data: pluginsStart.data, - dataViews: pluginsStart.dataViews, - lens: pluginsStart.lens, - }), - charts: pluginsStart.charts, - }; - - ReactDOM.render( - <Application - coreStart={coreStart} - history={appMountParameters.history} - pluginsStart={pluginsStart} - theme$={appMountParameters.theme$} - services={services} - />, - appMountParameters.element - ); - - return () => { - ReactDOM.unmountComponentAtNode(appMountParameters.element); - }; - }, - }); - - const pluginsStartPromise = coreSetup - .getStartServices() - .then(([, pluginsStart]) => pluginsStart); - - Promise.all([ - pluginsStartPromise, - import('./items/register_items').then((m) => m.registerItems), - getCreateEsqlService(), - ]).then(([pluginsStart, registerItems, createEsqlService]) => { - registerItems({ - dependencies: { - setup: pluginsSetup, - start: pluginsStart, - }, - services: { - esql: createEsqlService({ - data: pluginsStart.data, - dataViews: pluginsStart.dataViews, - lens: pluginsStart.lens, - }), - charts: pluginsStart.charts, - }, - }); - }); - - return {}; - } - - start( - coreStart: CoreStart, - pluginsStart: InvestigateAppStartDependencies - ): InvestigateAppPublicStart { - return {}; - } -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/services/types.ts b/x-pack/plugins/observability_solution/investigate_app/public/services/types.ts deleted file mode 100644 index 257ed5a7aeac..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/services/types.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { EsqlService } from './esql'; - -export interface InvestigateAppServices { - esql: EsqlService; - charts: ChartsPluginStart; -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/types.ts b/x-pack/plugins/observability_solution/investigate_app/public/types.ts deleted file mode 100644 index a2d7b5227a20..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/types.ts +++ /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 { - ObservabilityAIAssistantPublicSetup, - ObservabilityAIAssistantPublicStart, -} from '@kbn/observability-ai-assistant-plugin/public'; -import { ChartsPluginStart } from '@kbn/charts-plugin/public'; -import type { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; -import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { - DataViewsPublicPluginSetup, - DataViewsPublicPluginStart, -} from '@kbn/data-views-plugin/public'; -import type { - DatasetQualityPluginSetup, - DatasetQualityPluginStart, -} from '@kbn/dataset-quality-plugin/public'; -import type { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; -import type { - InvestigatePublicSetup, - InvestigatePublicStart, -} from '@kbn/investigate-plugin/public'; -import type { LensPublicSetup, LensPublicStart } from '@kbn/lens-plugin/public'; -import type { - ObservabilitySharedPluginSetup, - ObservabilitySharedPluginStart, -} from '@kbn/observability-shared-plugin/public'; -import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; -import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; - -/* eslint-disable @typescript-eslint/no-empty-interface*/ - -export interface ConfigSchema { - enabled: boolean; -} - -export interface InvestigateAppSetupDependencies { - investigate: InvestigatePublicSetup; - observabilityShared: ObservabilitySharedPluginSetup; - observabilityAIAssistant: ObservabilityAIAssistantPublicSetup; - lens: LensPublicSetup; - dataViews: DataViewsPublicPluginSetup; - data: DataPublicPluginSetup; - embeddable: EmbeddableSetup; - contentManagement: {}; - datasetQuality: DatasetQualityPluginSetup; - unifiedSearch: {}; - uiActions: UiActionsSetup; - security: SecurityPluginSetup; -} - -export interface InvestigateAppStartDependencies { - investigate: InvestigatePublicStart; - observabilityShared: ObservabilitySharedPluginStart; - observabilityAIAssistant: ObservabilityAIAssistantPublicStart; - lens: LensPublicStart; - dataViews: DataViewsPublicPluginStart; - data: DataPublicPluginStart; - embeddable: EmbeddableStart; - contentManagement: ContentManagementPublicStart; - datasetQuality: DatasetQualityPluginStart; - unifiedSearch: UnifiedSearchPublicPluginStart; - uiActions: UiActionsStart; - security: SecurityPluginStart; - charts: ChartsPluginStart; -} - -export interface InvestigateAppPublicSetup {} - -export interface InvestigateAppPublicStart {} diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_events.ts b/x-pack/plugins/observability_solution/investigate_app/server/services/get_events.ts deleted file mode 100644 index 53f42f4c6c05..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/server/services/get_events.ts +++ /dev/null @@ -1,105 +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 datemath from '@elastic/datemath'; -import { - GetEventsParams, - GetEventsResponse, - getEventsResponseSchema, -} from '@kbn/investigation-shared'; -import { ScopedAnnotationsClient } from '@kbn/observability-plugin/server'; -import { - ALERT_REASON, - ALERT_RULE_CATEGORY, - ALERT_START, - ALERT_STATUS, - ALERT_UUID, -} from '@kbn/rule-data-utils'; -import { AlertsClient } from './get_alerts_client'; -import { rangeQuery } from '../lib/queries'; - -export async function getAnnotationEvents( - params: GetEventsParams, - annotationsClient: ScopedAnnotationsClient -): Promise<GetEventsResponse> { - const response = await annotationsClient.find({ - start: params?.rangeFrom, - end: params?.rangeTo, - filter: params?.filter, - size: 100, - }); - - // we will return only "point_in_time" annotations - const events = response.items - .filter((item) => !item.event?.end) - .map((item) => { - const hostName = item.host?.name; - const serviceName = item.service?.name; - const serviceVersion = item.service?.version; - const sloId = item.slo?.id; - const sloInstanceId = item.slo?.instanceId; - - return { - id: item.id, - title: item.annotation.title, - description: item.message, - timestamp: new Date(item['@timestamp']).getTime(), - eventType: 'annotation', - annotationType: item.annotation.type, - source: { - ...(hostName ? { 'host.name': hostName } : undefined), - ...(serviceName ? { 'service.name': serviceName } : undefined), - ...(serviceVersion ? { 'service.version': serviceVersion } : undefined), - ...(sloId ? { 'slo.id': sloId } : undefined), - ...(sloInstanceId ? { 'slo.instanceId': sloInstanceId } : undefined), - }, - }; - }); - - return getEventsResponseSchema.parse(events); -} - -export async function getAlertEvents( - params: GetEventsParams, - alertsClient: AlertsClient -): Promise<GetEventsResponse> { - const startInMs = datemath.parse(params?.rangeFrom ?? 'now-15m')!.valueOf(); - const endInMs = datemath.parse(params?.rangeTo ?? 'now')!.valueOf(); - const filterJSON = params?.filter ? JSON.parse(params.filter) : {}; - - const body = { - size: 100, - track_total_hits: false, - query: { - bool: { - filter: [ - ...rangeQuery(startInMs, endInMs, ALERT_START), - ...Object.keys(filterJSON).map((filterKey) => ({ - term: { [filterKey]: filterJSON[filterKey] }, - })), - ], - }, - }, - }; - - const response = await alertsClient.search(body); - - const events = response.hits.hits.map((hit) => { - const _source = hit._source; - - return { - id: _source[ALERT_UUID], - title: `${_source[ALERT_RULE_CATEGORY]} breached`, - description: _source[ALERT_REASON], - timestamp: new Date(_source[ALERT_START] as string).getTime(), - eventType: 'alert', - alertStatus: _source[ALERT_STATUS], - }; - }); - - return getEventsResponseSchema.parse(events); -} diff --git a/x-pack/plugins/observability_solution/investigate_app/server/types.ts b/x-pack/plugins/observability_solution/investigate_app/server/types.ts deleted file mode 100644 index 8803221000d5..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/server/types.ts +++ /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 { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; -import { - RuleRegistryPluginSetupContract, - RuleRegistryPluginStartContract, -} from '@kbn/rule-registry-plugin/server'; -import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; - -/* eslint-disable @typescript-eslint/no-empty-interface*/ - -export interface ConfigSchema {} - -export interface InvestigateAppSetupDependencies { - observability: ObservabilityPluginSetup; - ruleRegistry: RuleRegistryPluginSetupContract; - usageCollection: UsageCollectionSetup; -} - -export interface InvestigateAppStartDependencies { - ruleRegistry: RuleRegistryPluginStartContract; -} - -export interface InvestigateAppServerSetup {} - -export interface InvestigateAppServerStart {} diff --git a/x-pack/plugins/observability_solution/investigate_app/tsconfig.json b/x-pack/plugins/observability_solution/investigate_app/tsconfig.json deleted file mode 100644 index bc67b591a57b..000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/tsconfig.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "public/**/*", - "typings/**/*", - "public/**/*.json", - "server/**/*", - ".storybook/**/*" - ], - "exclude": [ - "target/**/*", - ".storybook/**/*.js" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/react-kibana-context-theme", - "@kbn/shared-ux-link-redirect-app", - "@kbn/kibana-react-plugin", - "@kbn/i18n", - "@kbn/embeddable-plugin", - "@kbn/observability-ai-assistant-plugin", - "@kbn/lens-plugin", - "@kbn/esql", - "@kbn/esql-utils", - "@kbn/data-plugin", - "@kbn/es-types", - "@kbn/field-types", - "@kbn/expressions-plugin", - "@kbn/deeplinks-observability", - "@kbn/logging", - "@kbn/data-views-plugin", - "@kbn/observability-shared-plugin", - "@kbn/config-schema", - "@kbn/investigate-plugin", - "@kbn/dataset-quality-plugin", - "@kbn/utility-types-jest", - "@kbn/content-management-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/visualization-utils", - "@kbn/unified-search-plugin", - "@kbn/es-query", - "@kbn/server-route-repository", - "@kbn/security-plugin", - "@kbn/ui-actions-plugin", - "@kbn/server-route-repository-utils", - "@kbn/core-saved-objects-server", - "@kbn/rule-registry-plugin", - "@kbn/shared-ux-router", - "@kbn/investigation-shared", - "@kbn/core-security-common", - "@kbn/saved-objects-finder-plugin", - "@kbn/presentation-containers", - "@kbn/lens-embeddable-utils", - "@kbn/i18n-react", - "@kbn/zod", - "@kbn/observability-plugin", - "@kbn/licensing-plugin", - "@kbn/rule-data-utils", - "@kbn/entities-schema", - "@kbn/core-elasticsearch-server", - "@kbn/calculate-auto", - "@kbn/ml-random-sampler-utils", - "@kbn/charts-plugin", - "@kbn/observability-utils-browser", - "@kbn/usage-collection-plugin", - "@kbn/inference-common", - ], -} diff --git a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/highlights.ts b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/highlights.ts index e8019c58d600..dedf3ced27f2 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/highlights.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/highlights.ts @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; import { schema } from '@kbn/config-schema'; +import { i18n } from '@kbn/i18n'; import { logEntriesV1 } from '../../../common/http_api'; import { throwErrors } from '../../../common/runtime_types'; @@ -33,6 +34,20 @@ export const initLogEntriesHighlightsRoute = ({ framework, logEntries }: LogsSha { version: '1', validate: { request: { body: escapeHatch } }, + options: { + deprecated: { + documentationUrl: '', + severity: 'warning', + message: i18n.translate( + 'xpack.logsShared.deprecations.postLogEntriesHighlightsRoute.message', + { + defaultMessage: + 'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.', + } + ), + reason: { type: 'deprecate' }, + }, + }, }, async (requestContext, request, response) => { const payload = pipe( diff --git a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary.ts b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary.ts index 2ac889ab9ffd..68c9d5ea0e16 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary.ts @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; import { schema } from '@kbn/config-schema'; +import { i18n } from '@kbn/i18n'; import { logEntriesV1 } from '../../../common/http_api'; import { throwErrors } from '../../../common/runtime_types'; @@ -36,6 +37,20 @@ export const initLogEntriesSummaryRoute = ({ { version: '1', validate: { request: { body: escapeHatch } }, + options: { + deprecated: { + documentationUrl: '', + severity: 'warning', + message: i18n.translate( + 'xpack.logsShared.deprecations.postLogEntriesSummaryRoute.message', + { + defaultMessage: + 'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.', + } + ), + reason: { type: 'deprecate' }, + }, + }, }, async (requestContext, request, response) => { const payload = pipe( diff --git a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary_highlights.ts b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary_highlights.ts index b4093f1d6543..b8f030b91b71 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary_highlights.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_entries/summary_highlights.ts @@ -12,6 +12,7 @@ import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; import { schema } from '@kbn/config-schema'; +import { i18n } from '@kbn/i18n'; import { logEntriesV1 } from '../../../common/http_api'; import { throwErrors } from '../../../common/runtime_types'; @@ -35,6 +36,20 @@ export const initLogEntriesSummaryHighlightsRoute = ({ { version: '1', validate: { request: { body: escapeHatch } }, + options: { + deprecated: { + documentationUrl: '', + severity: 'warning', + message: i18n.translate( + 'xpack.logsShared.deprecations.postLogEntriesSummaryHighlightsRoute.message', + { + defaultMessage: + 'Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana.', + } + ), + reason: { type: 'deprecate' }, + }, + }, }, async (requestContext, request, response) => { const payload = pipe( diff --git a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/get_log_view.ts b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/get_log_view.ts index 9370c18243b5..16ca40ac2d6d 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/get_log_view.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/get_log_view.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { i18n } from '@kbn/i18n'; import { logViewsV1 } from '../../../common/http_api'; import { LOG_VIEW_URL } from '../../../common/http_api/log_views'; import { createValidationFunction } from '../../../common/runtime_types'; @@ -30,6 +31,17 @@ export const initGetLogViewRoute = ({ params: createValidationFunction(logViewsV1.getLogViewRequestParamsRT), }, }, + options: { + deprecated: { + documentationUrl: '', + severity: 'warning', + message: i18n.translate('xpack.logsShared.deprecations.getLogViewRoute.message', { + defaultMessage: + 'Given the deprecation of the LogStream feature, this API will not have any effect configuring upcoming versions of Kibana.', + }), + reason: { type: 'deprecate' }, + }, + }, }, async (_requestContext, request, response) => { const { logViewId } = request.params; diff --git a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/put_log_view.ts b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/put_log_view.ts index 95e37bff52f8..c2ba33867d06 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/put_log_view.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/routes/log_views/put_log_view.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { i18n } from '@kbn/i18n'; import { logViewsV1 } from '../../../common/http_api'; import { LOG_VIEW_URL } from '../../../common/http_api/log_views'; import { createValidationFunction } from '../../../common/runtime_types'; @@ -26,6 +27,17 @@ export const initPutLogViewRoute = ({ framework, getStartServices }: LogsSharedB body: createValidationFunction(logViewsV1.putLogViewRequestPayloadRT), }, }, + options: { + deprecated: { + documentationUrl: '', + severity: 'warning', + message: i18n.translate('xpack.logsShared.deprecations.putLogViewRoute.message', { + defaultMessage: + 'Given the deprecation of the LogStream feature, this API will not have any effect configuring upcoming versions of Kibana.', + }), + reason: { type: 'deprecate' }, + }, + }, }, async (_requestContext, request, response) => { const { logViewId } = request.params; diff --git a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_service.ts b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_service.ts index 61810c47ff8d..a1cfab1c24eb 100644 --- a/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_service.ts +++ b/x-pack/plugins/observability_solution/logs_shared/server/services/log_entries/log_entries_service.ts @@ -22,10 +22,20 @@ export class LogEntriesService { setupDeps: LogEntriesServiceSetupDeps ) { void core.getStartServices().then(([, startDeps, selfStartDeps]) => { + /** + * @deprecated + * + * Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana. + */ setupDeps.data.search.registerSearchStrategy( LOG_ENTRIES_SEARCH_STRATEGY, logEntriesSearchStrategyProvider({ ...setupDeps, ...startDeps, ...selfStartDeps }) ); + /** + * @deprecated + * + * Given the deprecation of the LogStream feature, this API will not return reliable data in upcoming versions of Kibana. + */ setupDeps.data.search.registerSearchStrategy( LOG_ENTRY_SEARCH_STRATEGY, logEntrySearchStrategyProvider({ ...setupDeps, ...startDeps, ...selfStartDeps }) diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts b/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts deleted file mode 100644 index 94ff0139414f..000000000000 --- a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts +++ /dev/null @@ -1,249 +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 { Aggregators } from './types'; -import { LocatorPublic } from '@kbn/share-plugin/common'; -import { LogsExplorerLocatorParams } from '@kbn/deeplinks-observability'; -import { getViewInAppUrl, GetViewInAppUrlArgs } from './get_view_in_app_url'; - -describe('getViewInAppUrl', () => { - const logsExplorerLocator = { - getRedirectUrl: jest.fn(() => 'mockedGetRedirectUrl'), - } as unknown as LocatorPublic<LogsExplorerLocatorParams>; - const startedAt = '2023-12-07T16:30:15.403Z'; - const endedAt = '2023-12-07T20:30:15.403Z'; - const returnedTimeRange = { - // Duration 4 hour, time range will be extended it with 30 minutes from each side - from: '2023-12-07T16:00:15.403Z', - to: '2023-12-07T21:00:15.403Z', - }; - - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('Should return empty string if logsExplorerLocator is not provided', () => { - const args: GetViewInAppUrlArgs = { - metrics: [], - startedAt, - endedAt, - }; - - expect(getViewInAppUrl(args)).toBe(''); - }); - - it('should call getRedirectUrl with data view, time range and filters', () => { - const args: GetViewInAppUrlArgs = { - metrics: [ - { - name: 'A', - aggType: Aggregators.COUNT, - filter: 'mockedCountFilter', - }, - ], - logsExplorerLocator, - startedAt, - endedAt, - searchConfiguration: { - index: {}, - query: { - language: '', - query: 'mockedFilter', - }, - }, - dataViewId: 'mockedDataViewId', - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: args.dataViewId, - timeRange: returnedTimeRange, - filters: [], - query: { - query: 'mockedFilter and mockedCountFilter', - language: 'kuery', - }, - }); - }); - - it('should call getRedirectUrl with only count filter', () => { - const args: GetViewInAppUrlArgs = { - metrics: [ - { - name: 'A', - aggType: Aggregators.COUNT, - filter: 'mockedCountFilter', - }, - ], - logsExplorerLocator, - startedAt, - endedAt, - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: undefined, - timeRange: returnedTimeRange, - filters: [], - query: { - query: 'mockedCountFilter', - language: 'kuery', - }, - }); - }); - - it('should call getRedirectUrl with only filter', () => { - const args: GetViewInAppUrlArgs = { - logsExplorerLocator, - startedAt, - endedAt, - searchConfiguration: { - index: {}, - query: { - language: '', - query: 'mockedFilter', - }, - }, - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: undefined, - timeRange: returnedTimeRange, - filters: [], - query: { - query: 'mockedFilter', - language: 'kuery', - }, - }); - }); - - it('should call getRedirectUrl with empty query if metrics and filter are not not provided', () => { - const args: GetViewInAppUrlArgs = { - logsExplorerLocator, - startedAt, - endedAt, - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: undefined, - timeRange: returnedTimeRange, - filters: [], - query: { - query: '', - language: 'kuery', - }, - }); - }); - - it('should call getRedirectUrl with empty if there are multiple metrics', () => { - const args: GetViewInAppUrlArgs = { - metrics: [ - { - name: 'A', - aggType: Aggregators.COUNT, - filter: 'mockedCountFilter', - }, - { - name: 'A', - aggType: Aggregators.AVERAGE, - field: 'mockedAvgField', - }, - ], - logsExplorerLocator, - startedAt, - endedAt, - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: undefined, - timeRange: returnedTimeRange, - filters: [], - query: { - query: '', - language: 'kuery', - }, - }); - }); - - it('should call getRedirectUrl with filters if group and searchConfiguration filter are provided', () => { - const args: GetViewInAppUrlArgs = { - metrics: [ - { - name: 'A', - aggType: Aggregators.COUNT, - filter: 'mockedCountFilter', - }, - { - name: 'A', - aggType: Aggregators.AVERAGE, - field: 'mockedAvgField', - }, - ], - logsExplorerLocator, - startedAt, - endedAt, - searchConfiguration: { - index: {}, - query: { - language: '', - query: 'mockedFilter', - }, - filter: [ - { - meta: {}, - query: { - term: { - field: { - value: 'justTesting', - }, - }, - }, - }, - ], - }, - groups: [ - { - field: 'host.name', - value: 'host-1', - }, - ], - }; - - expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); - expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith({ - dataset: undefined, - timeRange: returnedTimeRange, - filters: [ - { - meta: {}, - query: { - term: { - field: { - value: 'justTesting', - }, - }, - }, - }, - { - meta: {}, - query: { - match_phrase: { - 'host.name': 'host-1', - }, - }, - }, - ], - query: { - query: 'mockedFilter', - language: 'kuery', - }, - }); - }); -}); diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/feature_flags.md b/x-pack/plugins/observability_solution/observability/dev_docs/feature_flags.md deleted file mode 100644 index 56c0e4681382..000000000000 --- a/x-pack/plugins/observability_solution/observability/dev_docs/feature_flags.md +++ /dev/null @@ -1,16 +0,0 @@ -## Feature flags and advanced settings - -To set up a flagged feature or other advanced setting, add the name of the feature key (`observability:myFeature`) to [common/ui_settings_keys.ts](../common/ui_settings_keys.ts) and the feature parameters to [server/ui_settings.ts](../server/ui_settings.ts). - -Test for the feature like: - -```js -import { myFeatureEnabled } from '../ui_settings_keys'; -if (core.uiSettings.get(myFeatureEnabled)) { - doStuff(); -} -``` - -In order for telemetry to be collected, the keys and types need to be added in [src/plugins/kibana_usage_collection/server/collectors/management/schema.ts](../../../../src/plugins/kibana_usage_collection/server/collectors/management/schema.ts) and [src/plugins/kibana_usage_collection/server/collectors/management/types.ts](../../../../src/plugins/kibana_usage_collection/server/collectors/management/types.ts). - -Settings can be managed in Kibana under Stack Management > Advanced Settings > Observability. diff --git a/x-pack/plugins/observability_solution/observability/jest.config.js b/x-pack/plugins/observability_solution/observability/jest.config.js deleted file mode 100644 index 77d49b80d8bf..000000000000 --- a/x-pack/plugins/observability_solution/observability/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/observability'], - setupFiles: [ - '<rootDir>/x-pack/plugins/observability_solution/observability/.storybook/jest_setup.js', - ], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/observability_solution/observability', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/observability/{common,public,server}/**/*.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/observability/public/index.ts b/x-pack/plugins/observability_solution/observability/public/index.ts deleted file mode 100644 index 6230f5411b54..000000000000 --- a/x-pack/plugins/observability_solution/observability/public/index.ts +++ /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. - */ - -// TODO: https://github.com/elastic/kibana/issues/110905 -/* eslint-disable @kbn/eslint/no_export_all */ - -import { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; -import { lazy } from 'react'; -import { - Plugin, - ObservabilityPublicPluginsStart, - ObservabilityPublicPluginsSetup, - ObservabilityPublicStart, - ObservabilityPublicSetup, -} from './plugin'; -export type { - ObservabilityPublicSetup, - ObservabilityPublicStart, - ObservabilityPublicPluginsSetup, - ObservabilityPublicPluginsStart, -}; -export const plugin: PluginInitializer< - ObservabilityPublicSetup, - ObservabilityPublicStart, - ObservabilityPublicPluginsSetup, - ObservabilityPublicPluginsStart -> = (initializerContext: PluginInitializerContext) => { - return new Plugin(initializerContext); -}; - -export type { ConfigSchema } from './plugin'; - -export { - enableLegacyUptimeApp, - syntheticsThrottlingEnabled, - enableInspectEsQueries, - enableComparisonByDefault, - apmServiceGroupMaxNumberOfServices, - enableAgentExplorerView, - apmEnableTableSearchBar, -} from '../common/ui_settings_keys'; -export { - alertsLocatorID, - ruleDetailsLocatorID, - rulesLocatorID, - sloDetailsLocatorID, - sloEditLocatorID, - uptimeOverviewLocatorID, -} from '../common'; - -export type { RulesParams } from './locators/rules'; -export { getCoreVitalsComponent } from './pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy'; -export { ObservabilityAlertSearchBar } from './components/alert_search_bar/get_alert_search_bar_lazy'; -export { DatePicker } from './pages/overview/components/date_picker'; - -export const LazyAlertsFlyout = lazy(() => import('./components/alerts_flyout/alerts_flyout')); - -export * from './typings'; -import { TopAlert } from './typings/alerts'; -export type { TopAlert }; -import type { AlertDetailsAppSectionProps } from './pages/alert_details/types'; -export type { AlertDetailsAppSectionProps }; - -export { observabilityFeatureId, observabilityAppId } from '../common'; - -export { useFetchDataViews } from './hooks/use_fetch_data_views'; -export { useTimeBuckets } from './hooks/use_time_buckets'; -export { createUseRulesLink } from './hooks/create_use_rules_link'; -export { useSummaryTimeRange } from './hooks/use_summary_time_range'; - -export { getApmTraceUrl } from './utils/get_apm_trace_url'; -export { buildEsQuery } from './utils/build_es_query'; - -export type { - ObservabilityRuleTypeFormatter, - ObservabilityRuleTypeModel, - ObservabilityRuleTypeRegistry, -} from './rules/create_observability_rule_type_registry'; -export { createObservabilityRuleTypeRegistryMock } from './rules/observability_rule_type_registry_mock'; - -export { DatePickerContextProvider } from './context/date_picker_context/date_picker_context'; - -export { fromQuery, toQuery } from './utils/url'; -export { getAlertSummaryTimeRange } from './utils/alert_summary_widget'; -export { calculateTimeRangeBucketSize } from './pages/overview/helpers/calculate_bucket_size'; -export type { render } from './utils/test_helper'; - -export { convertTo } from '../common/utils/formatters/duration'; -export { formatAlertEvaluationValue } from './utils/format_alert_evaluation_value'; -export { - RuleFlyoutKueryBar, - AutocompleteField, - WithKueryAutocompletion, -} from './components/rule_kql_filter'; -export { useAnnotations } from './components/annotations/use_annotations'; -export { RuleConditionChart } from './components/rule_condition_chart'; -export { getGroupFilters } from '../common/custom_threshold_rule/helpers/get_group'; -export type { GenericAggType } from './components/rule_condition_chart/rule_condition_chart'; -export { Threshold } from './components/custom_threshold/components/threshold'; diff --git a/x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts b/x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts deleted file mode 100644 index 99943d305f65..000000000000 --- a/x-pack/plugins/observability_solution/observability/public/typings/fetch_overview_data/index.ts +++ /dev/null @@ -1,175 +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 { UXMetrics } from '@kbn/observability-shared-plugin/public'; -import type { ObservabilityApp } from '../../../typings/common'; -import { ApmIndicesConfig } from '../../../common/typings'; - -export interface Stat { - type: 'number' | 'percent' | 'bytesPerSecond'; - value: number; -} - -export interface Coordinates { - x: number; - y?: number | null; -} - -export interface Series { - coordinates: Coordinates[]; -} - -export interface FetchDataParams { - absoluteTime: { start: number; end: number }; - relativeTime: { start: string; end: string }; - serviceName?: string; - // Bucket size in seconds (number) - bucketSize: number; - // Bucket size in seconds (string) - intervalString: string; - timeZone?: string; -} - -export interface HasDataParams { - absoluteTime: { start: number; end: number }; -} - -export interface HasDataResponse { - hasData: boolean; -} - -export interface UXHasDataResponse extends HasDataResponse { - serviceName?: string | number; - indices?: string; -} - -export interface SyntheticsHasDataResponse extends HasDataResponse { - indices: string; -} - -export interface APMHasDataResponse { - hasData: boolean; - indices: ApmIndicesConfig; -} - -export interface InfraMetricsHasDataResponse { - hasData: boolean; - indices: string; -} - -export interface InfraLogsHasDataResponse { - hasData: boolean; - indices: string; -} - -interface UniversalProfilingHasDataResponse { - hasData: boolean; -} - -export type FetchData<T extends FetchDataResponse = FetchDataResponse> = ( - fetchDataParams: FetchDataParams -) => Promise<T>; - -export type HasData<T extends ObservabilityFetchDataPlugins> = ( - params?: HasDataParams -) => Promise<ObservabilityHasDataResponse[T]>; - -export type ObservabilityFetchDataPlugins = Exclude< - ObservabilityApp, - 'observability-overview' | 'stack_monitoring' | 'fleet' | 'synthetics' ->; - -export interface DataHandler< - T extends ObservabilityFetchDataPlugins = ObservabilityFetchDataPlugins -> { - fetchData: FetchData<ObservabilityFetchDataResponse[T]>; - hasData: HasData<T>; -} - -export interface FetchDataResponse { - appLink: string; -} - -export interface LogsFetchDataResponse extends FetchDataResponse { - stats: Record<string, Stat & { label: string }>; - series: Record<string, Series & { label: string }>; -} - -export type StringOrNull = string | null; -export type NumberOrNull = number | null; - -export interface MetricsFetchDataSeries { - id: string; - name: StringOrNull; - platform: StringOrNull; - provider: StringOrNull; - cpu: NumberOrNull; - iowait: NumberOrNull; - load: NumberOrNull; - uptime: NumberOrNull; - rx: NumberOrNull; - tx: NumberOrNull; - timeseries: Array<{ - timestamp: number; - cpu: NumberOrNull; - iowait: NumberOrNull; - load: NumberOrNull; - rx: NumberOrNull; - tx: NumberOrNull; - }>; -} - -export interface MetricsFetchDataResponse extends FetchDataResponse { - sort: (by: string, direction: string) => Promise<MetricsFetchDataResponse>; - series: MetricsFetchDataSeries[]; -} - -export interface UptimeFetchDataResponse extends FetchDataResponse { - stats: { - monitors: Stat; - up: Stat; - down: Stat; - }; - series: { - up: Series; - down: Series; - }; -} - -export interface ApmFetchDataResponse extends FetchDataResponse { - stats: { - services: Stat; - transactions: Stat; - }; - series: { - transactions: Series; - }; -} - -export interface UxFetchDataResponse extends FetchDataResponse { - coreWebVitals: UXMetrics; -} - -export type UniversalProfilingDataResponse = FetchDataResponse; - -export interface ObservabilityFetchDataResponse { - apm: ApmFetchDataResponse; - infra_metrics: MetricsFetchDataResponse; - infra_logs: LogsFetchDataResponse; - uptime: UptimeFetchDataResponse; - ux: UxFetchDataResponse; - universal_profiling: UniversalProfilingDataResponse; -} - -export interface ObservabilityHasDataResponse { - apm: APMHasDataResponse; - infra_metrics: InfraMetricsHasDataResponse; - infra_logs: InfraLogsHasDataResponse; - uptime: SyntheticsHasDataResponse; - ux: UXHasDataResponse; - universal_profiling: UniversalProfilingHasDataResponse; -} diff --git a/x-pack/plugins/observability_solution/observability/server/index.ts b/x-pack/plugins/observability_solution/observability/server/index.ts deleted file mode 100644 index ace13ca5ed66..000000000000 --- a/x-pack/plugins/observability_solution/observability/server/index.ts +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -// TODO: https://github.com/elastic/kibana/issues/110905 -/* eslint-disable @kbn/eslint/no_export_all */ - -import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema'; -import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { DEFAULT_ANNOTATION_INDEX } from '../common/annotations'; -import type { ObservabilityPluginSetup } from './plugin'; -import { createOrUpdateIndex, Mappings } from './utils/create_or_update_index'; -import { createOrUpdateIndexTemplate } from './utils/create_or_update_index_template'; -import { ScopedAnnotationsClient } from './lib/annotations/bootstrap_annotations'; -import { CustomThresholdLocators } from './lib/rules/custom_threshold/custom_threshold_executor'; -import { - unwrapEsResponse, - WrappedElasticsearchClientError, -} from '../common/utils/unwrap_es_response'; - -export { - rangeQuery, - kqlQuery, - termQuery, - termsQuery, - wildcardQuery, - existsQuery, -} from './utils/queries'; -export { getParsedFilterQuery } from './utils/get_parsed_filtered_query'; -export { getInspectResponse } from '../common/utils/get_inspect_response'; - -export * from './types'; - -const configSchema = schema.object({ - annotations: schema.object({ - enabled: schema.boolean({ defaultValue: true }), - index: schema.string({ defaultValue: DEFAULT_ANNOTATION_INDEX }), - }), - unsafe: schema.object({ - alertDetails: schema.object({ - metrics: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - logs: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - uptime: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - observability: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - }), - thresholdRule: schema.object({ - enabled: offeringBasedSchema({ - serverless: schema.boolean({ defaultValue: false }), - traditional: schema.boolean({ defaultValue: false }), - }), - }), - ruleFormV2: schema.object({ - enabled: schema.boolean({ defaultValue: false }), - }), - }), - customThresholdRule: schema.object({ - groupByPageSize: schema.number({ defaultValue: 10_000 }), - }), - enabled: schema.boolean({ defaultValue: true }), - createO11yGenericFeatureId: schema.boolean({ defaultValue: false }), -}); - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - unsafe: true, - aiAssistant: { - enabled: true, - feedback: { - enabled: true, - }, - }, - }, - schema: configSchema, - deprecations: ({ unused }) => [ - unused('unsafe.thresholdRule.enabled', { level: 'warning' }), - unused('unsafe.alertDetails.logs.enabled', { level: 'warning' }), - unused('unsafe.alertDetails.metrics.enabled', { level: 'warning' }), - unused('unsafe.alertDetails.observability.enabled', { level: 'warning' }), - ], -}; - -export type ObservabilityConfig = TypeOf<typeof configSchema>; - -export const plugin = async (initContext: PluginInitializerContext) => { - const { ObservabilityPlugin } = await import('./plugin'); - return new ObservabilityPlugin(initContext); -}; - -export type { - Mappings, - ObservabilityPluginSetup, - ScopedAnnotationsClient, - CustomThresholdLocators, -}; -export { - createOrUpdateIndex, - createOrUpdateIndexTemplate, - unwrapEsResponse, - WrappedElasticsearchClientError, -}; - -export { uiSettings } from './ui_settings'; diff --git a/x-pack/plugins/observability_solution/observability/tsconfig.json b/x-pack/plugins/observability_solution/observability/tsconfig.json deleted file mode 100644 index 1d88901626da..000000000000 --- a/x-pack/plugins/observability_solution/observability/tsconfig.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "public/**/*.json", - "server/**/*", - "typings/**/*", - "../../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/rule-data-utils", - "@kbn/triggers-actions-ui-plugin", - "@kbn/i18n", - "@kbn/deeplinks-observability", - "@kbn/es-query", - "@kbn/observability-get-padded-alert-time-range-util", - "@kbn/share-plugin", - "@kbn/data-plugin", - "@kbn/alerting-comparators", - "@kbn/guided-onboarding", - "@kbn/rison", - "@kbn/kibana-utils-plugin", - "@kbn/spaces-plugin", - "@kbn/utility-types", - "@kbn/core-http-server", - "@kbn/core", - "@kbn/inspector-plugin", - "@kbn/shared-ux-page-kibana-template", - "@kbn/observability-ai-assistant-plugin", - "@kbn/shared-ux-router", - "@kbn/kibana-react-plugin", - "@kbn/react-kibana-context-render", - "@kbn/observability-shared-plugin", - "@kbn/react-kibana-context-theme", - "@kbn/shared-ux-link-redirect-app", - "@kbn/usage-collection-plugin", - "@kbn/cases-components", - "@kbn/cases-plugin", - "@kbn/stack-alerts-plugin", - "@kbn/core-ui-settings-browser-mocks", - "@kbn/alerts-ui-shared", - "@kbn/core-notifications-browser", - "@kbn/core-ui-settings-browser", - "@kbn/rule-registry-plugin", - "@kbn/alerts-grouping", - "@kbn/grouping", - "@kbn/data-views-plugin", - "@kbn/core-http-browser", - "@kbn/visualization-ui-components", - "@kbn/event-annotation-components", - "@kbn/slo-schema", - "@kbn/event-annotation-common", - "@kbn/react-kibana-mount", - "@kbn/i18n-react", - "@kbn/expression-metric-vis-plugin", - "@kbn/charts-plugin", - "@kbn/alerting-plugin", - "@kbn/aiops-log-rate-analysis", - "@kbn/aiops-plugin", - "@kbn/field-types", - "@kbn/test-jest-helpers", - "@kbn/discover-plugin", - "@kbn/embeddable-plugin", - "@kbn/lens-plugin", - "@kbn/ui-actions-plugin", - "@kbn/unified-search-plugin", - "@kbn/lens-embeddable-utils", - "@kbn/std", - "@kbn/actions-plugin", - "@kbn/licensing-plugin", - "@kbn/core-chrome-browser", - "@kbn/navigation-plugin", - "@kbn/observability-alert-details", - "@kbn/investigation-shared", - "@kbn/observability-alerting-rule-utils", - "@kbn/ui-theme", - "@kbn/core-application-common", - "@kbn/securitysolution-ecs", - "@kbn/alerts-as-data-utils", - "@kbn/datemath", - "@kbn/logs-shared-plugin", - "@kbn/exploratory-view-plugin", - "@kbn/core-capabilities-common", - "@kbn/content-management-plugin", - "@kbn/cloud-plugin", - "@kbn/data-view-editor-plugin", - "@kbn/field-formats-plugin", - "@kbn/home-plugin", - "@kbn/data-view-field-editor-plugin", - "@kbn/guided-onboarding-plugin", - "@kbn/investigate-plugin", - "@kbn/license-management-plugin", - "@kbn/presentation-util-plugin", - "@kbn/security-plugin", - "@kbn/serverless", - "@kbn/core-application-browser", - "@kbn/core-theme-browser", - "@kbn/config-schema", - "@kbn/securitysolution-io-ts-utils", - "@kbn/core-elasticsearch-server", - "@kbn/logging", - "@kbn/safer-lodash-set", - "@kbn/features-plugin", - "@kbn/files-plugin", - "@kbn/server-route-repository", - "@kbn/io-ts-utils", - "@kbn/core-ui-settings-server-mocks", - "@kbn/es-types", - "@kbn/logging-mocks", - "@kbn/response-ops-rule-form", - "@kbn/streams-plugin" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js b/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js deleted file mode 100644 index b684a6126e53..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant/public', - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant/common', - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant/server', - ], - setupFiles: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/jest_setup.js', - ], - collectCoverage: true, - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant/{common,public,server}/**/*.{js,ts,tsx}', - ], - - coverageReporters: ['html'], -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/index.ts deleted file mode 100644 index ce4c8e59fbae..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/functions/index.ts +++ /dev/null @@ -1,153 +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 dedent from 'dedent'; -import { CONTEXT_FUNCTION_NAME, registerContextFunction } from './context'; -import { registerSummarizationFunction, SUMMARIZE_FUNCTION_NAME } from './summarize'; -import type { RegistrationCallback } from '../service/types'; -import { registerElasticsearchFunction } from './elasticsearch'; -import { GET_DATASET_INFO_FUNCTION_NAME, registerGetDatasetInfoFunction } from './get_dataset_info'; -import { registerKibanaFunction } from './kibana'; -import { registerExecuteConnectorFunction } from './execute_connector'; -import { GET_DATA_ON_SCREEN_FUNCTION_NAME } from '../service/chat_function_client'; - -// cannot be imported from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/index.ts due to circular dependency -export const QUERY_FUNCTION_NAME = 'query'; - -export type FunctionRegistrationParameters = Omit< - Parameters<RegistrationCallback>[0], - 'registerContext' | 'hasFunction' ->; - -export const registerFunctions: RegistrationCallback = async ({ - client, - functions, - resources, - signal, - scopes, -}) => { - const registrationParameters: FunctionRegistrationParameters = { - client, - functions, - resources, - signal, - scopes, - }; - - const isServerless = !!resources.plugins.serverless; - if (scopes.includes('observability')) { - functions.registerInstruction(`You are a helpful assistant for Elastic Observability. Your goal is to help the Elastic Observability users to quickly assess what is happening in their observed systems. You can help them visualise and analyze data, investigate their systems, perform root cause analysis or identify optimisation opportunities. - - It's very important to not assume what the user is meaning. Ask them for clarification if needed. - - If you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation. - - In KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: ':()\\\ - /\". Always put a field value in double quotes. Best: service.name:\"opbeans-go\". Wrong: service.name:opbeans-go. This is very important! - - You can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response. - - Note that ES|QL (the Elasticsearch Query Language which is a new piped language) is the preferred query language. - - If you want to call a function or tool, only call it a single time per message. Wait until the function has been executed and its results - returned to you, before executing the same tool or another tool again if needed. - - DO NOT UNDER ANY CIRCUMSTANCES USE ES|QL syntax (\`service.name == "foo"\`) with "kqlFilter" (\`service.name:"foo"\`). - - The user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability and Search, which can be found in the ${ - isServerless ? `Project settings.` : `Stack Management app under the option AI Assistants` - }. - If the user asks how to change the language, reply in the same language the user asked in.`); - } - - if (scopes.length === 0 || (scopes.length === 1 && scopes[0] === 'all')) { - functions.registerInstruction( - `You are a helpful assistant for Elasticsearch. Your goal is to help Elasticsearch users accomplish tasks using Kibana and Elasticsearch. You can help them construct queries, index data, search data, use Elasticsearch APIs, generate sample data, visualise and analyze data. - - It's very important to not assume what the user means. Ask them for clarification if needed. - - If you are unsure about which function should be used and with what arguments, ask the user for clarification or confirmation. - - In KQL ("kqlFilter")) escaping happens with double quotes, not single quotes. Some characters that need escaping are: ':()\\\ - /\". Always put a field value in double quotes. Best: service.name:\"opbeans-go\". Wrong: service.name:opbeans-go. This is very important! - - You can use Github-flavored Markdown in your responses. If a function returns an array, consider using a Markdown table to format the response. - - If you want to call a function or tool, only call it a single time per message. Wait until the function has been executed and its results - returned to you, before executing the same tool or another tool again if needed. - - The user is able to change the language which they want you to reply in on the settings page of the AI Assistant for Observability and Search, which can be found in the ${ - isServerless ? `Project settings.` : `Stack Management app under the option AI Assistants` - }. - If the user asks how to change the language, reply in the same language the user asked in.` - ); - } - - const { ready: isKnowledgeBaseReady } = await client.getKnowledgeBaseStatus(); - - functions.registerInstruction(({ availableFunctionNames }) => { - const instructions: string[] = []; - - if ( - availableFunctionNames.includes(QUERY_FUNCTION_NAME) && - availableFunctionNames.includes(GET_DATASET_INFO_FUNCTION_NAME) - ) { - instructions.push(`You MUST use the "${GET_DATASET_INFO_FUNCTION_NAME}" ${ - functions.hasFunction('get_apm_dataset_info') ? 'or the get_apm_dataset_info' : '' - } function before calling the "${QUERY_FUNCTION_NAME}" or the "changes" functions. - - If a function requires an index, you MUST use the results from the dataset info functions.`); - } - - if (availableFunctionNames.includes(GET_DATA_ON_SCREEN_FUNCTION_NAME)) { - instructions.push(`You have access to data on the screen by calling the "${GET_DATA_ON_SCREEN_FUNCTION_NAME}" function. - Use it to help the user understand what they are looking at. A short summary of what they are looking at is available in the return of the "${CONTEXT_FUNCTION_NAME}" function. - Data that is compact enough automatically gets included in the response for the "${CONTEXT_FUNCTION_NAME}" function.`); - } - - if (isKnowledgeBaseReady) { - if (availableFunctionNames.includes(SUMMARIZE_FUNCTION_NAME)) { - instructions.push(`You can use the "${SUMMARIZE_FUNCTION_NAME}" function to store new information you have learned in a knowledge database. - Only use this function when the user asks for it. - All summaries MUST be created in English, even if the conversation was carried out in a different language.`); - } - - if (availableFunctionNames.includes(CONTEXT_FUNCTION_NAME)) { - instructions.push( - `Additionally, you can use the "${CONTEXT_FUNCTION_NAME}" function to retrieve relevant information from the knowledge database.` - ); - } - } else { - instructions.push( - `You do not have a working memory. If the user expects you to remember the previous conversations, tell them they can set up the knowledge base.` - ); - } - return instructions.map((instruction) => dedent(instruction)); - }); - - if (isKnowledgeBaseReady) { - registerSummarizationFunction(registrationParameters); - } - - registerContextFunction({ ...registrationParameters, isKnowledgeBaseReady }); - - registerElasticsearchFunction(registrationParameters); - const request = registrationParameters.resources.request; - - if ('id' in request) { - registerKibanaFunction({ - ...registrationParameters, - resources: { - ...registrationParameters.resources, - request, - }, - }); - } - registerGetDatasetInfoFunction(registrationParameters); - - registerExecuteConnectorFunction(registrationParameters); -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts deleted file mode 100644 index 0ad41969cedc..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/index.ts +++ /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 type { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; - -import type { ObservabilityAIAssistantConfig } from './config'; - -export type { ObservabilityAIAssistantServerRouteRepository } from './routes/get_global_observability_ai_assistant_route_repository'; - -import { config as configSchema } from './config'; -export type { RegistrationCallback } from './service/types'; -export type { - ObservabilityAIAssistantServerStart, - ObservabilityAIAssistantServerSetup, -} from './types'; - -export { - aiAssistantLogsIndexPattern, - aiAssistantSimulatedFunctionCalling, - aiAssistantSearchConnectorIndexPattern, -} from '../common'; - -export { streamIntoObservable } from './service/util/stream_into_observable'; - -export const config: PluginConfigDescriptor<ObservabilityAIAssistantConfig> = { - deprecations: ({ unusedFromRoot }) => [ - unusedFromRoot('xpack.observability.aiAssistant.enabled', { - level: 'warning', - }), - unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.deploymentId', { - level: 'warning', - }), - unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.resourceName', { - level: 'warning', - }), - unusedFromRoot('xpack.observability.aiAssistant.provider.azureOpenAI.apiKey', { - level: 'warning', - }), - unusedFromRoot('xpack.observability.aiAssistant.provider.openAI.apiKey', { - level: 'warning', - }), - unusedFromRoot('xpack.observability.aiAssistant.provider.openAI.model', { - level: 'warning', - }), - ], - exposeToBrowser: { scope: true }, - schema: configSchema, -}; - -export const plugin = async (ctx: PluginInitializerContext<ObservabilityAIAssistantConfig>) => { - const { ObservabilityAIAssistantPlugin } = await import('./plugin'); - return new ObservabilityAIAssistantPlugin(ctx); -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts deleted file mode 100644 index 4ff94393bc52..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/routes/knowledge_base/route.ts +++ /dev/null @@ -1,331 +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 pLimit from 'p-limit'; -import { notImplemented } from '@hapi/boom'; -import { nonEmptyStringRt, toBooleanRt } from '@kbn/io-ts-utils'; -import * as t from 'io-ts'; -import { - InferenceInferenceEndpointInfo, - MlDeploymentAllocationState, - MlDeploymentState, -} from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import moment from 'moment'; -import { createObservabilityAIAssistantServerRoute } from '../create_observability_ai_assistant_server_route'; -import { Instruction, KnowledgeBaseEntry, KnowledgeBaseEntryRole } from '../../../common/types'; - -const getKnowledgeBaseStatus = createObservabilityAIAssistantServerRoute({ - endpoint: 'GET /internal/observability_ai_assistant/kb/status', - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async ({ - service, - request, - }): Promise<{ - errorMessage?: string; - ready: boolean; - enabled: boolean; - endpoint?: Partial<InferenceInferenceEndpointInfo>; - model_stats?: { - deployment_state: MlDeploymentState | undefined; - allocation_state: MlDeploymentAllocationState | undefined; - }; - }> => { - const client = await service.getClient({ request }); - - if (!client) { - throw notImplemented(); - } - - return client.getKnowledgeBaseStatus(); - }, -}); - -const setupKnowledgeBase = createObservabilityAIAssistantServerRoute({ - endpoint: 'POST /internal/observability_ai_assistant/kb/setup', - params: t.partial({ - query: t.partial({ - model_id: t.string, - }), - }), - options: { - timeout: { - idleSocket: moment.duration(20, 'minutes').asMilliseconds(), - }, - }, - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<InferenceInferenceEndpointInfo> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - const { model_id: modelId } = resources.params?.query ?? {}; - - return await client.setupKnowledgeBase(modelId); - }, -}); - -const resetKnowledgeBase = createObservabilityAIAssistantServerRoute({ - endpoint: 'POST /internal/observability_ai_assistant/kb/reset', - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<{ result: string }> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - await client.resetKnowledgeBase(); - - return { result: 'success' }; - }, -}); - -const semanticTextMigrationKnowledgeBase = createObservabilityAIAssistantServerRoute({ - endpoint: 'POST /internal/observability_ai_assistant/kb/semantic_text_migration', - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<void> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - return client.migrateKnowledgeBaseToSemanticText(); - }, -}); - -const getKnowledgeBaseUserInstructions = createObservabilityAIAssistantServerRoute({ - endpoint: 'GET /internal/observability_ai_assistant/kb/user_instructions', - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async ( - resources - ): Promise<{ - userInstructions: Array<Instruction & { public?: boolean }>; - }> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - return { - userInstructions: await client.getKnowledgeBaseUserInstructions(), - }; - }, -}); - -const saveKnowledgeBaseUserInstruction = createObservabilityAIAssistantServerRoute({ - endpoint: 'PUT /internal/observability_ai_assistant/kb/user_instructions', - params: t.type({ - body: t.type({ - id: t.string, - text: t.string, - public: toBooleanRt, - }), - }), - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<void> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - const { id, text, public: isPublic } = resources.params.body; - return client.addUserInstruction({ - entry: { id, text, public: isPublic }, - }); - }, -}); - -const getKnowledgeBaseEntries = createObservabilityAIAssistantServerRoute({ - endpoint: 'GET /internal/observability_ai_assistant/kb/entries', - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - params: t.type({ - query: t.type({ - query: t.string, - sortBy: t.string, - sortDirection: t.union([t.literal('asc'), t.literal('desc')]), - }), - }), - handler: async ( - resources - ): Promise<{ - entries: KnowledgeBaseEntry[]; - }> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - const { query, sortBy, sortDirection } = resources.params.query; - - return await client.getKnowledgeBaseEntries({ query, sortBy, sortDirection }); - }, -}); - -const knowledgeBaseEntryRt = t.intersection([ - t.type({ - id: t.string, - title: t.string, - text: nonEmptyStringRt, - }), - t.partial({ - confidence: t.union([t.literal('low'), t.literal('medium'), t.literal('high')]), - is_correction: toBooleanRt, - public: toBooleanRt, - labels: t.record(t.string, t.string), - role: t.union([ - t.literal(KnowledgeBaseEntryRole.AssistantSummarization), - t.literal(KnowledgeBaseEntryRole.UserEntry), - t.literal(KnowledgeBaseEntryRole.Elastic), - ]), - }), -]); - -const saveKnowledgeBaseEntry = createObservabilityAIAssistantServerRoute({ - endpoint: 'POST /internal/observability_ai_assistant/kb/entries/save', - params: t.type({ - body: knowledgeBaseEntryRt, - }), - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<void> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - const entry = resources.params.body; - return client.addKnowledgeBaseEntry({ - entry: { - confidence: 'high', - is_correction: false, - public: true, - labels: {}, - role: KnowledgeBaseEntryRole.UserEntry, - ...entry, - }, - }); - }, -}); - -const deleteKnowledgeBaseEntry = createObservabilityAIAssistantServerRoute({ - endpoint: 'DELETE /internal/observability_ai_assistant/kb/entries/{entryId}', - params: t.type({ - path: t.type({ - entryId: t.string, - }), - }), - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<void> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - return client.deleteKnowledgeBaseEntry(resources.params.path.entryId); - }, -}); - -const importKnowledgeBaseEntries = createObservabilityAIAssistantServerRoute({ - endpoint: 'POST /internal/observability_ai_assistant/kb/entries/import', - params: t.type({ - body: t.type({ - entries: t.array(knowledgeBaseEntryRt), - }), - }), - security: { - authz: { - requiredPrivileges: ['ai_assistant'], - }, - }, - handler: async (resources): Promise<void> => { - const client = await resources.service.getClient({ request: resources.request }); - - if (!client) { - throw notImplemented(); - } - - const { ready } = await client.getKnowledgeBaseStatus(); - if (!ready) { - throw new Error('Knowledge base is not ready'); - } - - const limiter = pLimit(5); - - const promises = resources.params.body.entries.map(async (entry) => { - return limiter(async () => { - return client.addKnowledgeBaseEntry({ - entry: { - confidence: 'high', - is_correction: false, - public: true, - labels: {}, - role: KnowledgeBaseEntryRole.UserEntry, - ...entry, - }, - }); - }); - }); - - await Promise.all(promises); - }, -}); - -export const knowledgeBaseRoutes = { - ...semanticTextMigrationKnowledgeBase, - ...setupKnowledgeBase, - ...resetKnowledgeBase, - ...getKnowledgeBaseStatus, - ...getKnowledgeBaseEntries, - ...saveKnowledgeBaseUserInstruction, - ...importKnowledgeBaseEntries, - ...getKnowledgeBaseUserInstructions, - ...saveKnowledgeBaseEntry, - ...deleteKnowledgeBaseEntry, -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts deleted file mode 100644 index 89e7aa4cbb4d..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.test.ts +++ /dev/null @@ -1,1684 +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 { ActionsClient } from '@kbn/actions-plugin/server/actions_client'; -import type { CoreSetup, ElasticsearchClient, IUiSettingsClient, Logger } from '@kbn/core/server'; -import type { DeeplyMockedKeys } from '@kbn/utility-types-jest'; -import { waitFor } from '@testing-library/react'; -import { last, merge, repeat } from 'lodash'; -import { Subject, Observable } from 'rxjs'; -import { EventEmitter, type Readable } from 'stream'; -import { finished } from 'stream/promises'; -import type { InferenceClient } from '@kbn/inference-plugin/server'; -import { ChatCompletionEventType as InferenceChatCompletionEventType } from '@kbn/inference-common'; -import { ObservabilityAIAssistantClient } from '.'; -import { MessageRole, type Message } from '../../../common'; -import { - ChatCompletionChunkEvent, - MessageAddEvent, - StreamingChatResponseEventType, -} from '../../../common/conversation_complete'; -import { createFunctionResponseMessage } from '../../../common/utils/create_function_response_message'; -import { CONTEXT_FUNCTION_NAME } from '../../functions/context'; -import { ChatFunctionClient } from '../chat_function_client'; -import type { KnowledgeBaseService } from '../knowledge_base_service'; -import { observableIntoStream } from '../util/observable_into_stream'; -import type { ObservabilityAIAssistantConfig } from '../../config'; -import type { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; - -interface ChunkDelta { - content?: string | undefined; - function_call?: - | { - name?: string | undefined; - arguments?: string | undefined; - } - | undefined; -} - -type LlmSimulator = ReturnType<typeof createLlmSimulator>; - -const EXPECTED_STORED_SYSTEM_MESSAGE = `system`; - -const nextTick = () => { - return new Promise(process.nextTick); -}; - -const waitForNextWrite = async (stream: Readable): Promise<any> => { - // this will fire before the client's internal write() promise is - // resolved - const response = await new Promise((resolve) => stream.once('data', resolve)); - // so we wait another tick to let the client move to the next step - await nextTick(); - - return response; -}; - -function createLlmSimulator(subscriber: any) { - return { - next: async (msg: ChunkDelta) => { - subscriber.next({ - type: InferenceChatCompletionEventType.ChatCompletionMessage, - content: msg.content, - toolCalls: msg.function_call ? [{ function: msg.function_call }] : [], - }); - }, - tokenCount: async ({ - completion, - prompt, - total, - }: { - completion: number; - prompt: number; - total: number; - }) => { - subscriber.next({ - type: InferenceChatCompletionEventType.ChatCompletionTokenCount, - tokens: { completion, prompt, total }, - }); - subscriber.complete(); - }, - chunk: async (msg: ChunkDelta) => { - subscriber.next({ - type: InferenceChatCompletionEventType.ChatCompletionChunk, - content: msg.content, - tool_calls: msg.function_call ? [{ function: msg.function_call }] : [], - }); - }, - complete: async () => { - subscriber.complete(); - }, - error: (error: Error) => { - subscriber.error(error); - }, - }; -} - -describe('Observability AI Assistant client', () => { - let client: ObservabilityAIAssistantClient; - - const actionsClientMock: DeeplyMockedKeys<ActionsClient> = { - execute: jest.fn(), - get: jest.fn(), - } as any; - - const inferenceClientMock: DeeplyMockedKeys<InferenceClient> = { - chatComplete: jest.fn(), - } as any; - - const uiSettingsClientMock: DeeplyMockedKeys<IUiSettingsClient> = { - get: jest.fn(), - } as any; - - const internalUserEsClientMock: DeeplyMockedKeys<ElasticsearchClient> = { - search: jest.fn(), - index: jest.fn(), - update: jest.fn(), - } as any; - - const currentUserEsClientMock: DeeplyMockedKeys<ElasticsearchClient> = { - search: jest.fn(), - fieldCaps: jest.fn(), - } as any; - - const knowledgeBaseServiceMock: DeeplyMockedKeys<KnowledgeBaseService> = { - recall: jest.fn(), - getUserInstructions: jest.fn(), - } as any; - - let loggerMock: DeeplyMockedKeys<Logger> = {} as any; - - const functionClientMock: DeeplyMockedKeys<ChatFunctionClient> = { - executeFunction: jest.fn(), - getFunctions: jest.fn(), - hasFunction: jest.fn(), - hasAction: jest.fn(), - getActions: jest.fn(), - validate: jest.fn(), - getInstructions: jest.fn(), - getAdhocInstructions: jest.fn(), - } as any; - - let llmSimulator: LlmSimulator; - - function createClient() { - jest.resetAllMocks(); - - // uncomment this line for debugging - // const consoleOrPassThrough = console.log.bind(console); - const consoleOrPassThrough = () => {}; - - loggerMock = { - log: jest.fn().mockImplementation(consoleOrPassThrough), - error: jest.fn().mockImplementation(consoleOrPassThrough), - debug: jest.fn().mockImplementation(consoleOrPassThrough), - trace: jest.fn().mockImplementation(consoleOrPassThrough), - isLevelEnabled: jest.fn().mockReturnValue(true), - } as any; - - functionClientMock.getFunctions.mockReturnValue([]); - functionClientMock.hasFunction.mockImplementation((name) => { - return name !== CONTEXT_FUNCTION_NAME; - }); - - functionClientMock.hasAction.mockReturnValue(false); - functionClientMock.getActions.mockReturnValue([]); - - currentUserEsClientMock.search.mockResolvedValue({ - hits: { - hits: [], - }, - } as any); - - currentUserEsClientMock.fieldCaps.mockResolvedValue({ - fields: [], - } as any); - - knowledgeBaseServiceMock.getUserInstructions.mockResolvedValue([]); - - functionClientMock.getInstructions.mockReturnValue(['system']); - functionClientMock.getAdhocInstructions.mockReturnValue([]); - - return new ObservabilityAIAssistantClient({ - config: {} as ObservabilityAIAssistantConfig, - core: {} as CoreSetup<ObservabilityAIAssistantPluginStartDependencies>, - actionsClient: actionsClientMock, - uiSettingsClient: uiSettingsClientMock, - esClient: { - asInternalUser: internalUserEsClientMock, - asCurrentUser: currentUserEsClientMock, - }, - inferenceClient: inferenceClientMock, - knowledgeBaseService: knowledgeBaseServiceMock, - logger: loggerMock, - namespace: 'default', - user: { - name: 'johndoe', - }, - scopes: ['all'], - }); - } - - function system(content: string | Omit<Message['message'], 'role'>): Message { - return merge( - { - '@timestamp': new Date().toString(), - message: { - role: MessageRole.System, - }, - }, - typeof content === 'string' ? { message: { content } } : content - ); - } - - function user(content: string | Omit<Message['message'], 'role'>): Message { - return merge( - { - '@timestamp': new Date().toString(), - message: { - role: MessageRole.User, - }, - }, - typeof content === 'string' ? { message: { content } } : content - ); - } - - beforeEach(() => { - jest.clearAllMocks(); - }); - - describe('when completing a conversation without an initial conversation id', () => { - let stream: Readable; - - let titleLlmPromiseResolve: (title: string) => void; - let titleLlmPromiseReject: Function; - - beforeEach(async () => { - client = createClient(); - - inferenceClientMock.chatComplete - .mockImplementationOnce(() => { - return new Observable((subscriber) => { - titleLlmPromiseResolve = (title: string) => { - const titleLlmSimulator = createLlmSimulator(subscriber); - titleLlmSimulator - .chunk({ content: title }) - .then(() => titleLlmSimulator.next({ content: title })) - .then(() => titleLlmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 })) - .then(() => titleLlmSimulator.complete()) - .catch((error) => titleLlmSimulator.error(error)); - }; - titleLlmPromiseReject = (error: Error) => { - subscriber.error(error); - }; - }); - }) - .mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - stream = observableIntoStream( - client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - persist: true, - }) - ); - }); - - describe('when streaming the response from the LLM', () => { - let dataHandler: jest.Mock; - - beforeEach(async () => { - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await llmSimulator.chunk({ content: 'Hello' }); - await llmSimulator.next({ content: 'Hello' }); - - await nextTick(); - }); - - it('calls the llm to generate a new title', () => { - expect(inferenceClientMock.chatComplete.mock.calls[0]).toEqual([ - expect.objectContaining({ - connectorId: 'foo', - stream: true, - functionCalling: 'native', - toolChoice: expect.objectContaining({ - function: 'title_conversation', - }), - tools: expect.objectContaining({ - title_conversation: { - description: - 'Use this function to title the conversation. Do not wrap the title in quotes', - schema: { - type: 'object', - properties: { - title: { type: 'string' }, - }, - required: ['title'], - }, - }, - }), - messages: expect.arrayContaining([ - { - role: 'user', - content: - 'Generate a title, using the title_conversation_function, based on the following conversation:\n\n user: How many alerts do I have?', - }, - ]), - }), - ]); - }); - - it('calls the llm again with the messages', () => { - expect(inferenceClientMock.chatComplete.mock.calls[1]).toEqual([ - { - connectorId: 'foo', - stream: true, - messages: expect.arrayContaining([ - { role: 'user', content: 'How many alerts do I have?' }, - ]), - functionCalling: 'native', - toolChoice: 'auto', - tools: {}, - }, - ]); - }); - - it('incrementally streams the response to the client', async () => { - expect(dataHandler).toHaveBeenCalledTimes(2); - - await new Promise((resolve) => setTimeout(resolve, 1000)); - - expect(JSON.parse(dataHandler.mock.calls[0])).toEqual({ - id: expect.any(String), - message: { - content: 'Hello', - }, - type: StreamingChatResponseEventType.ChatCompletionChunk, - }); - }); - - describe('after the LLM errors out', () => { - beforeEach(async () => { - await llmSimulator.next({ content: ' again' }); - - llmSimulator.error(new Error('Unexpected error')); - - await finished(stream); - }); - - it('adds an error to the stream and closes it', () => { - expect(dataHandler).toHaveBeenCalledTimes(4); - - expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ - error: { - message: 'Unexpected error', - stack: expect.any(String), - }, - type: StreamingChatResponseEventType.ChatCompletionError, - }); - }); - }); - - describe('when generating a title fails', () => { - beforeEach(async () => { - titleLlmPromiseReject(new Error('Failed generating title')); - - await nextTick(); - await llmSimulator.tokenCount({ completion: 1, prompt: 33, total: 34 }); - await llmSimulator.complete(); - - await finished(stream); - }); - - it('falls back to the default title', () => { - expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ - conversation: { - title: 'New conversation', - id: expect.any(String), - last_updated: expect.any(String), - token_count: { - completion: 1, - prompt: 33, - total: 34, - }, - }, - type: StreamingChatResponseEventType.ConversationCreate, - }); - - expect(loggerMock.error).toHaveBeenCalled(); - }); - }); - - describe('after completing the response from the LLM', () => { - beforeEach(async () => { - await llmSimulator.chunk({ content: ' again' }); - - titleLlmPromiseResolve('An auto-generated title'); - await llmSimulator.tokenCount({ completion: 6, prompt: 210, total: 216 }); - await llmSimulator.complete(); - - await finished(stream); - }); - - it('adds the completed message to the stream', () => { - expect(JSON.parse(dataHandler.mock.calls[2])).toEqual({ - id: expect.any(String), - message: { - content: ' again', - }, - type: StreamingChatResponseEventType.ChatCompletionChunk, - }); - - expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: 'Hello again', - role: MessageRole.Assistant, - function_call: { - arguments: '', - name: '', - trigger: MessageRole.Assistant, - }, - }, - }, - type: StreamingChatResponseEventType.MessageAdd, - }); - }); - - it('creates a new conversation with the automatically generated title', () => { - expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ - conversation: { - title: 'An auto-generated title', - id: expect.any(String), - last_updated: expect.any(String), - token_count: { - completion: 6, - prompt: 210, - total: 216, - }, - }, - type: StreamingChatResponseEventType.ConversationCreate, - }); - - expect(internalUserEsClientMock.index).toHaveBeenCalledWith({ - index: '.kibana-observability-ai-assistant-conversations', - refresh: true, - document: { - '@timestamp': expect.any(String), - conversation: { - id: expect.any(String), - last_updated: expect.any(String), - title: 'An auto-generated title', - token_count: { - completion: 6, - prompt: 210, - total: 216, - }, - }, - labels: {}, - numeric_labels: {}, - public: false, - namespace: 'default', - user: { - name: 'johndoe', - }, - messages: [ - { - '@timestamp': expect.any(String), - message: { - content: EXPECTED_STORED_SYSTEM_MESSAGE, - role: MessageRole.System, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'How many alerts do I have?', - role: MessageRole.User, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'Hello again', - role: MessageRole.Assistant, - function_call: { - name: '', - arguments: '', - trigger: MessageRole.Assistant, - }, - }, - }, - ], - }, - }); - }); - }); - }); - }); - - describe('when completing a conversation with an initial conversation id', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - - beforeEach(async () => { - client = createClient(); - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - internalUserEsClientMock.search.mockImplementation(async () => { - return { - hits: { - hits: [ - { - _id: 'my-es-document-id', - _index: '.kibana-observability-ai-assistant-conversations', - _source: { - '@timestamp': new Date().toISOString(), - conversation: { - id: 'my-conversation-id', - title: 'My stored conversation', - last_updated: new Date().toISOString(), - token_count: { - completion: 1, - prompt: 78, - total: 79, - }, - }, - labels: {}, - numeric_labels: {}, - public: false, - messages: [ - system('This is a system message'), - user('How many alerts do I have?'), - ], - }, - }, - ], - }, - } as any; - }); - - internalUserEsClientMock.update.mockImplementationOnce(async () => { - return {} as any; - }); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - conversationId: 'my-conversation-id', - persist: true, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await nextTick(); - - await llmSimulator.chunk({ content: 'Hello' }); - await llmSimulator.next({ content: 'Hello' }); - await llmSimulator.tokenCount({ completion: 1, prompt: 33, total: 34 }); - await llmSimulator.complete(); - - await finished(stream); - }); - - it('updates the conversation', () => { - expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ - conversation: { - title: 'My stored conversation', - id: expect.any(String), - last_updated: expect.any(String), - token_count: { - completion: 2, - prompt: 111, - total: 113, - }, - }, - type: StreamingChatResponseEventType.ConversationUpdate, - }); - - expect(internalUserEsClientMock.update).toHaveBeenCalledWith({ - refresh: true, - index: '.kibana-observability-ai-assistant-conversations', - id: 'my-es-document-id', - doc: { - '@timestamp': expect.any(String), - conversation: { - id: expect.any(String), - last_updated: expect.any(String), - title: 'My stored conversation', - token_count: { - completion: 2, - prompt: 111, - total: 113, - }, - }, - labels: {}, - numeric_labels: {}, - public: false, - namespace: 'default', - user: { - name: 'johndoe', - }, - messages: [ - { - '@timestamp': expect.any(String), - message: { - content: EXPECTED_STORED_SYSTEM_MESSAGE, - role: MessageRole.System, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'How many alerts do I have?', - role: MessageRole.User, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'Hello', - role: MessageRole.Assistant, - function_call: { - name: '', - arguments: '', - trigger: MessageRole.Assistant, - }, - }, - }, - ], - }, - }); - }); - }); - - describe('when the LLM response fails', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - - beforeEach(async () => { - client = createClient(); - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: true, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await nextTick(); - - await llmSimulator.chunk({ content: 'Hello' }); - await llmSimulator.error(new Error('Connection unexpectedly closed')); - await llmSimulator.complete(); - - await finished(stream); - }); - - it('ends the stream and writes an error', async () => { - expect(JSON.parse(dataHandler.mock.calls[1])).toEqual({ - error: { - message: 'Connection unexpectedly closed', - stack: expect.any(String), - }, - type: StreamingChatResponseEventType.ChatCompletionError, - }); - }); - - it('does not create or update the conversation', async () => { - expect(internalUserEsClientMock.index).not.toHaveBeenCalled(); - expect(internalUserEsClientMock.update).not.toHaveBeenCalled(); - }); - }); - - describe('when the assistant answers with a function request', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - - let respondFn: jest.Mock; - - let fnResponseResolve: (data: unknown) => void; - - let fnResponseReject: (error: Error) => void; - - beforeEach(async () => { - client = createClient(); - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - respondFn = jest.fn(); - - functionClientMock.getFunctions.mockImplementation(() => [ - { - definition: { - name: 'myFunction', - contexts: ['core'], - description: 'my-description', - descriptionForUser: '', - parameters: { - type: 'object', - properties: { - foo: { - type: 'string', - enum: ['bar'], - }, - }, - required: ['foo'], - }, - }, - respond: respondFn, - }, - ]); - - functionClientMock.executeFunction.mockImplementationOnce(() => { - return new Promise<any>((resolve, reject) => { - fnResponseResolve = resolve; - fnResponseReject = reject; - }); - }); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: true, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await nextTick(); - - await llmSimulator.next({ content: 'Hello' }); - await llmSimulator.chunk({ - content: 'Hello', - function_call: { name: 'myFunction', arguments: JSON.stringify({ foo: 'bar' }) }, - }); - - const prevLlmSimulator = llmSimulator; - - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - await prevLlmSimulator.complete(); - - await waitForNextWrite(stream); - }); - - describe('while the function call is pending', () => { - it('appends the request message', async () => { - expect(JSON.parse(dataHandler.mock.calls[2])).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: 'Hello', - role: MessageRole.Assistant, - function_call: { - name: 'myFunction', - arguments: JSON.stringify({ foo: 'bar' }), - trigger: MessageRole.Assistant, - }, - }, - }, - }); - }); - - it('executes the function', () => { - expect(functionClientMock.executeFunction).toHaveBeenCalledWith({ - name: 'myFunction', - chat: expect.any(Function), - args: JSON.stringify({ foo: 'bar' }), - signal: expect.any(AbortSignal), - connectorId: 'foo', - messages: [ - { - '@timestamp': expect.any(String), - message: { - role: MessageRole.System, - content: EXPECTED_STORED_SYSTEM_MESSAGE, - }, - }, - { - '@timestamp': expect.any(String), - message: { - role: MessageRole.User, - content: 'How many alerts do I have?', - }, - }, - { - '@timestamp': expect.any(String), - message: { - role: MessageRole.Assistant, - content: 'Hello', - function_call: { - name: 'myFunction', - arguments: JSON.stringify({ foo: 'bar' }), - trigger: MessageRole.Assistant, - }, - }, - }, - ], - useSimulatedFunctionCalling: false, - }); - }); - - afterEach(async () => { - fnResponseResolve({ content: { my: 'content' } }); - - await waitForNextWrite(stream); - - await llmSimulator.complete(); - await finished(stream); - }); - }); - - describe('and the function succeeds', () => { - beforeEach(async () => { - fnResponseResolve({ content: { my: 'content' } }); - // await waitForNextWrite(stream); - }); - - it('appends the function response', () => { - expect(JSON.parse(dataHandler.mock.calls[3])).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - role: MessageRole.User, - name: 'myFunction', - content: JSON.stringify({ - my: 'content', - }), - }, - }, - }); - }); - - it('sends the function response back to the llm', () => { - expect(inferenceClientMock.chatComplete).toHaveBeenCalledTimes(2); - - expect(inferenceClientMock.chatComplete.mock.lastCall!).toEqual([ - { - connectorId: 'foo', - stream: true, - messages: expect.arrayContaining([ - { role: 'user', content: 'How many alerts do I have?' }, - ]), - functionCalling: 'native', - toolChoice: 'auto', - tools: expect.any(Object), - }, - ]); - }); - - describe('and the assistant replies without a function request', () => { - beforeEach(async () => { - await llmSimulator.chunk({ content: 'I am done here' }); - await llmSimulator.next({ content: 'I am done here' }); - await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); - await llmSimulator.complete(); - await waitForNextWrite(stream); - - await finished(stream); - }); - - it('appends the assistant reply', () => { - expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ - type: StreamingChatResponseEventType.ChatCompletionChunk, - id: expect.any(String), - message: { - content: 'I am done here', - }, - }); - expect(JSON.parse(dataHandler.mock.calls[6])).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - role: MessageRole.Assistant, - content: 'I am done here', - function_call: { - name: '', - arguments: '', - trigger: MessageRole.Assistant, - }, - }, - }, - }); - }); - - it('stores the conversation', () => { - expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ - type: StreamingChatResponseEventType.ConversationCreate, - conversation: { - id: expect.any(String), - last_updated: expect.any(String), - title: 'My predefined title', - token_count: { - completion: expect.any(Number), - prompt: expect.any(Number), - total: expect.any(Number), - }, - }, - }); - - expect(internalUserEsClientMock.index).toHaveBeenCalled(); - - expect( - (internalUserEsClientMock.index.mock.lastCall![0] as any).document.messages - ).toEqual([ - { - '@timestamp': expect.any(String), - message: { - content: EXPECTED_STORED_SYSTEM_MESSAGE, - role: MessageRole.System, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'How many alerts do I have?', - role: MessageRole.User, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'Hello', - role: MessageRole.Assistant, - function_call: { - name: 'myFunction', - arguments: JSON.stringify({ foo: 'bar' }), - trigger: MessageRole.Assistant, - }, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: JSON.stringify({ - my: 'content', - }), - name: 'myFunction', - role: MessageRole.User, - }, - }, - { - '@timestamp': expect.any(String), - message: { - content: 'I am done here', - role: MessageRole.Assistant, - function_call: { - name: '', - arguments: '', - trigger: MessageRole.Assistant, - }, - }, - }, - ]); - }); - }); - }); - - describe('and the function fails', () => { - beforeEach(async () => { - fnResponseReject(new Error('Function failed')); - await waitForNextWrite(stream); - }); - - it('appends the function response', () => { - const parsed = JSON.parse(dataHandler.mock.lastCall!); - - parsed.message.message.content = JSON.parse(parsed.message.message.content); - parsed.message.message.data = JSON.parse(parsed.message.message.data); - - expect(parsed).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - role: MessageRole.User, - name: 'myFunction', - content: { - message: 'Function failed', - error: { - name: 'Error', - message: 'Function failed', - }, - }, - data: { - stack: expect.any(String), - }, - }, - }, - }); - }); - - it('sends the function response back to the llm', () => { - expect(inferenceClientMock.chatComplete).toHaveBeenCalledTimes(2); - expect(inferenceClientMock.chatComplete.mock.lastCall!).toEqual([ - { - connectorId: 'foo', - stream: true, - messages: expect.arrayContaining([ - { role: 'user', content: 'How many alerts do I have?' }, - ]), - functionCalling: 'native', - toolChoice: 'auto', - tools: expect.any(Object), - }, - ]); - }); - }); - - describe('and the function responds with an observable', () => { - let response$: Subject<ChatCompletionChunkEvent | MessageAddEvent>; - beforeEach(async () => { - response$ = new Subject(); - fnResponseResolve(response$); - - await nextTick(); - - response$.next(createFunctionResponseMessage({ name: 'myFunction', content: {} })); - }); - - it('appends the function response', async () => { - expect(JSON.parse(dataHandler.mock.calls[3]!)).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - role: MessageRole.User, - name: 'myFunction', - content: '{}', - }, - }, - }); - }); - - describe('if the observable completes', () => { - beforeEach(async () => { - response$.next({ - type: StreamingChatResponseEventType.ChatCompletionChunk, - message: { - content: 'Hello', - }, - id: 'my-id', - }); - - response$.next({ - type: StreamingChatResponseEventType.MessageAdd, - message: { - '@timestamp': new Date().toString(), - message: { - role: MessageRole.Assistant, - content: 'Hello', - }, - }, - id: 'my-id', - }); - - response$.complete(); - - await finished(stream); - }); - - it('emits a completion chunk', () => { - expect(JSON.parse(dataHandler.mock.calls[4])).toEqual({ - type: StreamingChatResponseEventType.ChatCompletionChunk, - id: expect.any(String), - message: { - content: 'Hello', - }, - }); - }); - - it('appends the observable response', () => { - expect(JSON.parse(dataHandler.mock.calls[5])).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - role: MessageRole.Assistant, - content: 'Hello', - }, - }, - }); - }); - }); - - describe('if the observable errors out', () => { - beforeEach(async () => { - response$.next({ - type: StreamingChatResponseEventType.ChatCompletionChunk, - message: { - content: 'Hello', - }, - id: 'my-id', - }); - response$.error(new Error('Unexpected error')); - - await finished(stream); - }); - - it('appends an error', () => { - expect(JSON.parse(dataHandler.mock.lastCall!)).toEqual({ - type: StreamingChatResponseEventType.ChatCompletionError, - error: { - message: 'Unexpected error', - stack: expect.any(String), - }, - }); - }); - }); - }); - }); - - describe('when context is available', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - beforeEach(async () => { - client = createClient(); - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - functionClientMock.hasFunction.mockReturnValue(true); - - functionClientMock.executeFunction.mockImplementationOnce(async (body) => { - return { - content: [ - { - id: 'my_document', - text: 'My document', - }, - ], - }; - }); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - persist: false, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await waitForNextWrite(stream); - - await llmSimulator.chunk({ content: 'Hello' }); - await llmSimulator.next({ content: 'Hello' }); - await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); - await llmSimulator.complete(); - - await finished(stream); - }); - - it('appends the context request message', () => { - expect(JSON.parse(dataHandler.mock.calls[0]!)).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: '', - role: MessageRole.Assistant, - function_call: { - name: CONTEXT_FUNCTION_NAME, - trigger: MessageRole.Assistant, - }, - }, - }, - }); - }); - - it('appends the context response', () => { - expect(JSON.parse(dataHandler.mock.calls[1]!)).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: JSON.stringify([{ id: 'my_document', text: 'My document' }]), - role: MessageRole.User, - name: CONTEXT_FUNCTION_NAME, - }, - }, - }); - }); - - it('appends the response from the LLM', () => { - expect(JSON.parse(dataHandler.mock.calls[2]!)).toEqual({ - type: StreamingChatResponseEventType.ChatCompletionChunk, - id: expect.any(String), - message: { - content: 'Hello', - }, - }); - - expect(JSON.parse(dataHandler.mock.calls[4]!)).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: 'Hello', - function_call: { - name: '', - arguments: '', - trigger: MessageRole.Assistant, - }, - role: MessageRole.Assistant, - }, - }, - }); - }); - }); - - describe('when the LLM keeps on calling a function and the limit has been exceeded', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - const maxFunctionCalls = 8; - - beforeEach(async () => { - client = createClient(); - - const onLlmCall = new EventEmitter(); - - function waitForNextLlmCall() { - return new Promise<void>((resolve) => onLlmCall.addListener('next', resolve)); - } - - inferenceClientMock.chatComplete.mockImplementation(() => { - return new Observable((subscriber) => { - onLlmCall.emit('next'); - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - functionClientMock.getFunctions.mockImplementation(() => [ - { - definition: { - name: 'get_top_alerts', - contexts: ['core'], - description: '', - }, - respond: async () => { - return { content: 'Call this function again' }; - }, - }, - ]); - - functionClientMock.hasFunction.mockImplementation((name) => name === 'get_top_alerts'); - functionClientMock.executeFunction.mockImplementation(async () => ({ - content: 'Call this function again', - })); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: true, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - async function requestAlertsFunctionCall() { - const body = inferenceClientMock.chatComplete.mock.lastCall![0]; - let nextLlmCallPromise: Promise<void>; - - if (Object.keys(body.tools ?? {}).length) { - nextLlmCallPromise = waitForNextLlmCall(); - await llmSimulator.chunk({ function_call: { name: 'get_top_alerts', arguments: '{}' } }); - } else { - nextLlmCallPromise = Promise.resolve(); - await llmSimulator.chunk({ content: 'Looks like we are done here' }); - } - - await llmSimulator.complete(); - await nextLlmCallPromise; - } - - await nextTick(); - - for (let i = 0; i <= maxFunctionCalls; i++) { - await requestAlertsFunctionCall(); - } - - await llmSimulator.complete(); - await finished(stream); - }); - - it(`executed the function no more than ${maxFunctionCalls} times`, () => { - expect(functionClientMock.executeFunction).toHaveBeenCalledTimes(maxFunctionCalls); - }); - - it('asks the LLM to suggest next steps', () => { - const firstBody = inferenceClientMock.chatComplete.mock.calls[0][0] as any; - const body = inferenceClientMock.chatComplete.mock.lastCall![0] as any; - - expect(Object.keys(firstBody.tools ?? {}).length).toEqual(1); - - expect(body.tools).toEqual({}); - }); - }); - - describe('when context has not been injected since last user message', () => { - let dataHandler: jest.Mock; - - beforeEach(async () => { - client = createClient(); - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - functionClientMock.hasFunction.mockReturnValue(true); - functionClientMock.executeFunction.mockImplementationOnce(async () => { - return { - content: [ - { - id: 'my_document', - text: 'My document', - }, - ], - }; - }); - - const stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - persist: false, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await waitForNextWrite(stream); - - await llmSimulator.next({ - content: 'Hello', - }); - - await llmSimulator.complete(); - - await finished(stream); - }); - - it('executes the context function', async () => { - expect(functionClientMock.executeFunction).toHaveBeenCalledWith( - expect.objectContaining({ name: CONTEXT_FUNCTION_NAME }) - ); - }); - - it('appends the context request message', async () => { - expect(JSON.parse(dataHandler.mock.calls[0])).toEqual({ - type: StreamingChatResponseEventType.MessageAdd, - id: expect.any(String), - message: { - '@timestamp': expect.any(String), - message: { - content: '', - role: MessageRole.Assistant, - function_call: { - name: CONTEXT_FUNCTION_NAME, - trigger: MessageRole.Assistant, - }, - }, - }, - }); - }); - }); - - describe('when the function response exceeds the max no of tokens for one', () => { - let stream: Readable; - - let dataHandler: jest.Mock; - - beforeEach(async () => { - client = createClient(); - - let functionResponsePromiseResolve: Function | undefined; - - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - functionClientMock.getFunctions.mockImplementation(() => [ - { - definition: { - name: 'get_top_alerts', - contexts: ['core'], - description: '', - parameters: {}, - }, - respond: async () => { - return { content: '' }; - }, - }, - ]); - - functionClientMock.hasFunction.mockImplementation((name) => name === 'get_top_alerts'); - - functionClientMock.executeFunction.mockImplementation(() => { - return new Promise((resolve) => { - functionResponsePromiseResolve = resolve; - }); - }); - - stream = observableIntoStream( - await client.complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('How many alerts do I have?')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: true, - }) - ); - - dataHandler = jest.fn(); - - stream.on('data', dataHandler); - - await nextTick(); - - await llmSimulator.chunk({ function_call: { name: 'get_top_alerts' } }); - await llmSimulator.next({ content: 'done' }); - await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); - await llmSimulator.complete(); - - await waitFor(() => functionResponsePromiseResolve !== undefined); - - functionResponsePromiseResolve!({ - content: repeat('word ', 10000), - }); - - await waitFor(() => inferenceClientMock.chatComplete.mock.calls.length > 1); - - await llmSimulator.next({ content: 'Looks like this was truncated' }); - - await llmSimulator.complete(); - - await finished(stream); - }); - - it('truncates the message', () => { - const body = inferenceClientMock.chatComplete.mock.lastCall![0]; - const parsed = last(body.messages); - - expect(parsed).toEqual({ - role: 'tool', - response: { - message: 'Function response exceeded the maximum length allowed and was truncated', - truncated: expect.any(String), - }, - toolCallId: expect.any(String), - }); - - expect((parsed as any).response.truncated.includes('word ')).toBe(true); - }); - }); - - it('Adds the default language to the system prompt', async () => { - client = createClient(); - const chatSpy = jest.spyOn(client, 'chat'); - - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - client - .complete({ - connectorId: 'foo', - messages: [system('This is a system message'), user('A user message to cause completion')], - functionClient: functionClientMock, - signal: new AbortController().signal, - title: 'My predefined title', - persist: false, - }) - .subscribe(() => {}); // To trigger call to chat - await nextTick(); - - expect(chatSpy.mock.calls[0][1].messages[0].message.content).toEqual( - EXPECTED_STORED_SYSTEM_MESSAGE - ); - }); - - describe('when executing an action', () => { - let completePromise: Promise<Message[]>; - - beforeEach(async () => { - client = createClient(); - - inferenceClientMock.chatComplete.mockImplementationOnce(() => { - return new Observable((subscriber) => { - llmSimulator = createLlmSimulator(subscriber); - }); - }); - - const complete$ = await client.complete({ - connectorId: 'foo', - messages: [ - system('This is a system message'), - user('Can you call the my_action function?'), - ], - functionClient: new ChatFunctionClient([ - { - actions: [ - { - name: 'my_action', - description: 'My action description', - parameters: { - type: 'object', - properties: { - foo: { - type: 'string', - }, - }, - required: ['foo'], - }, - }, - ], - }, - ]), - signal: new AbortController().signal, - title: 'My predefined title', - persist: false, - }); - - const messages: Message[] = []; - - completePromise = new Promise<Message[]>((resolve, reject) => { - complete$.subscribe({ - next: (event) => { - if (event.type === StreamingChatResponseEventType.MessageAdd) { - messages.push(event.message); - } - }, - complete: () => resolve(messages), - }); - }); - }); - - describe('and validation succeeds', () => { - beforeEach(async () => { - await llmSimulator.chunk({ - function_call: { name: 'my_action', arguments: JSON.stringify({ foo: 'bar' }) }, - }); - await llmSimulator.next({ content: 'content' }); - await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); - await llmSimulator.complete(); - }); - - it('completes the observable function request being the last event', async () => { - const messages = await completePromise; - expect(messages.length).toBe(1); - - expect(messages[0].message.function_call).toEqual({ - name: 'my_action', - arguments: JSON.stringify({ foo: 'bar' }), - trigger: MessageRole.Assistant, - }); - }); - }); - - describe.skip('and validation fails', () => { - beforeEach(async () => { - await llmSimulator.chunk({ - function_call: { name: 'my_action', arguments: JSON.stringify({ bar: 'foo' }) }, - }); - - await waitFor(() => - inferenceClientMock.chatComplete.mock.calls.length === 3 - ? Promise.resolve() - : llmSimulator.error(new Error('Waiting until execute is called again')) - ); - - await llmSimulator.next({ - content: 'Looks like the function call failed', - }); - await llmSimulator.tokenCount({ completion: 0, prompt: 0, total: 0 }); - - await llmSimulator.complete(); - }); - - it('appends a function response error and sends it back to the LLM', async () => { - const messages = await completePromise; - expect(messages.length).toBe(2); - - expect(messages[0].message.function_call?.name).toBe('my_action'); - - expect(messages[1].message.name).toBe('my_action'); - - expect(JSON.parse(messages[1].message.content ?? '{}')).toHaveProperty('error'); - - expect(messages[2].message.content).toBe('Looks like the function call failed'); - }); - }); - }); -}); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts deleted file mode 100644 index 688bd7a2ec86..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/client/index.ts +++ /dev/null @@ -1,755 +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 { SearchHit } from '@elastic/elasticsearch/lib/api/types'; -import { notFound } from '@hapi/boom'; -import type { ActionsClient } from '@kbn/actions-plugin/server'; -import type { CoreSetup, ElasticsearchClient, IUiSettingsClient } from '@kbn/core/server'; -import type { Logger } from '@kbn/logging'; -import type { PublicMethodsOf } from '@kbn/utility-types'; -import { context } from '@opentelemetry/api'; -import { last, merge, omit } from 'lodash'; -import { - catchError, - combineLatest, - defer, - filter, - forkJoin, - from, - map, - merge as mergeOperator, - Observable, - of, - shareReplay, - switchMap, - tap, - throwError, -} from 'rxjs'; -import { v4 } from 'uuid'; -import type { AssistantScope } from '@kbn/ai-assistant-common'; -import type { InferenceClient } from '@kbn/inference-plugin/server'; -import { ToolChoiceType } from '@kbn/inference-common'; - -import { resourceNames } from '..'; -import { - ChatCompletionChunkEvent, - ChatCompletionMessageEvent, - ChatCompletionErrorEvent, - ConversationCreateEvent, - ConversationUpdateEvent, - createConversationNotFoundError, - StreamingChatResponseEventType, - TokenCountEvent, - type StreamingChatResponseEvent, -} from '../../../common/conversation_complete'; -import { convertMessagesForInference } from '../../../common/convert_messages_for_inference'; -import { CompatibleJSONSchema } from '../../../common/functions/types'; -import { - type AdHocInstruction, - type Conversation, - type ConversationCreateRequest, - type ConversationUpdateRequest, - type KnowledgeBaseEntry, - type Message, - KnowledgeBaseType, - KnowledgeBaseEntryRole, - MessageRole, -} from '../../../common/types'; -import { withoutTokenCountEvents } from '../../../common/utils/without_token_count_events'; -import { CONTEXT_FUNCTION_NAME } from '../../functions/context'; -import type { ChatFunctionClient } from '../chat_function_client'; -import { KnowledgeBaseService, RecalledEntry } from '../knowledge_base_service'; -import { getAccessQuery } from '../util/get_access_query'; -import { getSystemMessageFromInstructions } from '../util/get_system_message_from_instructions'; -import { replaceSystemMessage } from '../util/replace_system_message'; -import { failOnNonExistingFunctionCall } from './operators/fail_on_non_existing_function_call'; -import { getContextFunctionRequestIfNeeded } from './get_context_function_request_if_needed'; -import { LangTracer } from './instrumentation/lang_tracer'; -import { continueConversation } from './operators/continue_conversation'; -import { convertInferenceEventsToStreamingEvents } from './operators/convert_inference_events_to_streaming_events'; -import { extractMessages } from './operators/extract_messages'; -import { extractTokenCount } from './operators/extract_token_count'; -import { getGeneratedTitle } from './operators/get_generated_title'; -import { instrumentAndCountTokens } from './operators/instrument_and_count_tokens'; -import { - runSemanticTextKnowledgeBaseMigration, - scheduleSemanticTextMigration, -} from '../task_manager_definitions/register_migrate_knowledge_base_entries_task'; -import { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; -import { ObservabilityAIAssistantConfig } from '../../config'; - -const MAX_FUNCTION_CALLS = 8; - -export class ObservabilityAIAssistantClient { - constructor( - private readonly dependencies: { - config: ObservabilityAIAssistantConfig; - core: CoreSetup<ObservabilityAIAssistantPluginStartDependencies>; - actionsClient: PublicMethodsOf<ActionsClient>; - uiSettingsClient: IUiSettingsClient; - namespace: string; - esClient: { - asInternalUser: ElasticsearchClient; - asCurrentUser: ElasticsearchClient; - }; - inferenceClient: InferenceClient; - logger: Logger; - user?: { - id?: string; - name: string; - }; - knowledgeBaseService: KnowledgeBaseService; - scopes: AssistantScope[]; - } - ) {} - - private getConversationWithMetaFields = async ( - conversationId: string - ): Promise<SearchHit<Conversation> | undefined> => { - const response = await this.dependencies.esClient.asInternalUser.search<Conversation>({ - index: resourceNames.aliases.conversations, - query: { - bool: { - filter: [ - ...getAccessQuery({ - user: this.dependencies.user, - namespace: this.dependencies.namespace, - }), - { term: { 'conversation.id': conversationId } }, - ], - }, - }, - size: 1, - terminate_after: 1, - }); - - return response.hits.hits[0]; - }; - - private getConversationUpdateValues = (lastUpdated: string) => { - return { - conversation: { - last_updated: lastUpdated, - }, - user: this.dependencies.user, - namespace: this.dependencies.namespace, - }; - }; - - get = async (conversationId: string): Promise<Conversation> => { - const conversation = await this.getConversationWithMetaFields(conversationId); - - if (!conversation) { - throw notFound(); - } - return conversation._source!; - }; - - delete = async (conversationId: string): Promise<void> => { - const conversation = await this.getConversationWithMetaFields(conversationId); - - if (!conversation) { - throw notFound(); - } - - await this.dependencies.esClient.asInternalUser.delete({ - id: conversation._id!, - index: conversation._index, - refresh: true, - }); - }; - - complete = ({ - functionClient, - connectorId, - simulateFunctionCalling = false, - instructions: adHocInstructions = [], - messages: initialMessages, - signal, - persist, - kibanaPublicUrl, - isPublic, - title: predefinedTitle, - conversationId: predefinedConversationId, - disableFunctions = false, - }: { - messages: Message[]; - connectorId: string; - signal: AbortSignal; - functionClient: ChatFunctionClient; - persist: boolean; - conversationId?: string; - title?: string; - isPublic?: boolean; - kibanaPublicUrl?: string; - instructions?: AdHocInstruction[]; - simulateFunctionCalling?: boolean; - disableFunctions?: - | boolean - | { - except: string[]; - }; - }): Observable<Exclude<StreamingChatResponseEvent, ChatCompletionErrorEvent>> => { - return new LangTracer(context.active()).startActiveSpan( - 'complete', - ({ tracer: completeTracer }) => { - const isConversationUpdate = persist && !!predefinedConversationId; - - const conversationId = persist ? predefinedConversationId || v4() : ''; - - if (persist && !isConversationUpdate && kibanaPublicUrl) { - adHocInstructions.push({ - instruction_type: 'application_instruction', - text: `This conversation will be persisted in Kibana and available at this url: ${ - kibanaPublicUrl + `/app/observabilityAIAssistant/conversations/${conversationId}` - }.`, - }); - } - - const userInstructions$ = from(this.getKnowledgeBaseUserInstructions()).pipe(shareReplay()); - - const registeredAdhocInstructions = functionClient.getAdhocInstructions(); - const allAdHocInstructions = adHocInstructions.concat(registeredAdhocInstructions); - - // from the initial messages, override any system message with - // the one that is based on the instructions (registered, request, kb) - const messagesWithUpdatedSystemMessage$ = userInstructions$.pipe( - map((userInstructions) => { - // this is what we eventually store in the conversation - const messagesWithUpdatedSystemMessage = replaceSystemMessage( - getSystemMessageFromInstructions({ - applicationInstructions: functionClient.getInstructions(), - userInstructions, - adHocInstructions: allAdHocInstructions, - availableFunctionNames: functionClient - .getFunctions() - .map((fn) => fn.definition.name), - }), - initialMessages - ); - - return messagesWithUpdatedSystemMessage; - }), - shareReplay() - ); - - // if it is: - // - a new conversation - // - no predefined title is given - // - we need to store the conversation - // we generate a title - // if not, we complete with an empty string - const title$ = - predefinedTitle || isConversationUpdate || !persist - ? of(predefinedTitle || '').pipe(shareReplay()) - : messagesWithUpdatedSystemMessage$.pipe( - switchMap((messages) => - getGeneratedTitle({ - messages, - logger: this.dependencies.logger, - chat: (name, chatParams) => { - return this.chat(name, { - ...chatParams, - simulateFunctionCalling, - connectorId, - signal, - }); - }, - tracer: completeTracer, - }) - ), - shareReplay() - ); - - // we continue the conversation here, after resolving both the materialized - // messages and the knowledge base instructions - const nextEvents$ = combineLatest([ - messagesWithUpdatedSystemMessage$, - userInstructions$, - ]).pipe( - switchMap(([messagesWithUpdatedSystemMessage, userInstructions]) => { - // if needed, inject a context function request here - const contextRequest = functionClient.hasFunction(CONTEXT_FUNCTION_NAME) - ? getContextFunctionRequestIfNeeded(messagesWithUpdatedSystemMessage) - : undefined; - - return mergeOperator( - // if we have added a context function request, also emit - // the messageAdd event for it, so we can notify the consumer - // and add it to the conversation - ...(contextRequest ? [of(contextRequest)] : []), - continueConversation({ - messages: [ - ...messagesWithUpdatedSystemMessage, - ...(contextRequest ? [contextRequest.message] : []), - ], - chat: (name, chatParams) => { - // inject a chat function with predefined parameters - return this.chat(name, { - ...chatParams, - signal, - simulateFunctionCalling, - connectorId, - }); - }, - // start out with the max number of function calls - functionCallsLeft: MAX_FUNCTION_CALLS, - functionClient, - userInstructions, - adHocInstructions, - signal, - logger: this.dependencies.logger, - disableFunctions, - tracer: completeTracer, - connectorId, - useSimulatedFunctionCalling: simulateFunctionCalling === true, - }) - ); - }), - shareReplay() - ); - - const output$ = mergeOperator( - // get all the events from continuing the conversation - nextEvents$, - // wait until all dependencies have completed - forkJoin([ - messagesWithUpdatedSystemMessage$, - // get just the new messages - nextEvents$.pipe(withoutTokenCountEvents(), extractMessages()), - // count all the token count events emitted during completion - mergeOperator( - nextEvents$, - title$.pipe(filter((value): value is TokenCountEvent => typeof value !== 'string')) - ).pipe(extractTokenCount()), - // get just the title, and drop the token count events - title$.pipe(filter((value): value is string => typeof value === 'string')), - ]).pipe( - switchMap( - ([messagesWithUpdatedSystemMessage, addedMessages, tokenCountResult, title]) => { - const initialMessagesWithAddedMessages = - messagesWithUpdatedSystemMessage.concat(addedMessages); - - const lastMessage = last(initialMessagesWithAddedMessages); - - // if a function request is at the very end, close the stream to consumer - // without persisting or updating the conversation. we need to wait - // on the function response to have a valid conversation - const isFunctionRequest = !!lastMessage?.message.function_call?.name; - - if (!persist || isFunctionRequest) { - return of(); - } - - if (isConversationUpdate) { - return from(this.getConversationWithMetaFields(conversationId)) - .pipe( - switchMap((conversation) => { - if (!conversation) { - return throwError(() => createConversationNotFoundError()); - } - - const persistedTokenCount = conversation._source?.conversation - .token_count ?? { - prompt: 0, - completion: 0, - total: 0, - }; - - return from( - this.update( - conversationId, - - merge( - {}, - - // base conversation without messages - omit(conversation._source, 'messages'), - - // update messages - { messages: initialMessagesWithAddedMessages }, - - // update token count - { - conversation: { - title: title || conversation._source?.conversation.title, - token_count: { - prompt: persistedTokenCount.prompt + tokenCountResult.prompt, - completion: - persistedTokenCount.completion + tokenCountResult.completion, - total: persistedTokenCount.total + tokenCountResult.total, - }, - }, - } - ) - ) - ); - }) - ) - .pipe( - map((conversation): ConversationUpdateEvent => { - return { - conversation: conversation.conversation, - type: StreamingChatResponseEventType.ConversationUpdate, - }; - }) - ); - } - - return from( - this.create({ - '@timestamp': new Date().toISOString(), - conversation: { - title, - id: conversationId, - token_count: tokenCountResult, - }, - public: !!isPublic, - labels: {}, - numeric_labels: {}, - messages: initialMessagesWithAddedMessages, - }) - ).pipe( - map((conversation): ConversationCreateEvent => { - return { - conversation: conversation.conversation, - type: StreamingChatResponseEventType.ConversationCreate, - }; - }) - ); - } - ) - ) - ); - - return output$.pipe( - instrumentAndCountTokens('complete'), - withoutTokenCountEvents(), - catchError((error) => { - this.dependencies.logger.error(error); - return throwError(() => error); - }), - tap((event) => { - if (this.dependencies.logger.isLevelEnabled('debug')) { - switch (event.type) { - case StreamingChatResponseEventType.MessageAdd: - this.dependencies.logger.debug( - () => `Added message: ${JSON.stringify(event.message)}` - ); - break; - - case StreamingChatResponseEventType.ConversationCreate: - this.dependencies.logger.debug( - () => `Created conversation: ${JSON.stringify(event.conversation)}` - ); - break; - - case StreamingChatResponseEventType.ConversationUpdate: - this.dependencies.logger.debug( - () => `Updated conversation: ${JSON.stringify(event.conversation)}` - ); - break; - } - } - }), - shareReplay() - ); - } - ); - }; - - chat = ( - name: string, - { - messages, - connectorId, - functions, - functionCall, - signal, - simulateFunctionCalling, - tracer, - }: { - messages: Message[]; - connectorId: string; - functions?: Array<{ name: string; description: string; parameters?: CompatibleJSONSchema }>; - functionCall?: string; - signal: AbortSignal; - simulateFunctionCalling?: boolean; - tracer: LangTracer; - } - ): Observable<ChatCompletionChunkEvent | TokenCountEvent | ChatCompletionMessageEvent> => { - const tools = functions?.reduce((acc, fn) => { - acc[fn.name] = { - description: fn.description, - schema: fn.parameters, - }; - return acc; - }, {} as Record<string, { description: string; schema: any }>); - - const chatComplete$ = defer(() => - this.dependencies.inferenceClient.chatComplete({ - connectorId, - stream: true, - messages: convertMessagesForInference( - messages.filter((message) => message.message.role !== MessageRole.System) - ), - functionCalling: simulateFunctionCalling ? 'simulated' : 'native', - toolChoice: functionCall - ? { - function: functionCall, - } - : ToolChoiceType.auto, - tools, - }) - ).pipe( - convertInferenceEventsToStreamingEvents(), - instrumentAndCountTokens(name), - failOnNonExistingFunctionCall({ functions }), - tap((event) => { - if ( - event.type === StreamingChatResponseEventType.ChatCompletionChunk && - this.dependencies.logger.isLevelEnabled('trace') - ) { - this.dependencies.logger.trace(`Received chunk: ${JSON.stringify(event.message)}`); - } - }), - shareReplay() - ); - - return chatComplete$; - }; - - find = async (options?: { query?: string }): Promise<{ conversations: Conversation[] }> => { - const response = await this.dependencies.esClient.asInternalUser.search<Conversation>({ - index: resourceNames.aliases.conversations, - allow_no_indices: true, - query: { - bool: { - filter: [ - ...getAccessQuery({ - user: this.dependencies.user, - namespace: this.dependencies.namespace, - }), - ], - }, - }, - sort: { - '@timestamp': 'desc', - }, - size: 100, - }); - - return { - conversations: response.hits.hits.map((hit) => hit._source!), - }; - }; - - update = async ( - conversationId: string, - conversation: ConversationUpdateRequest - ): Promise<Conversation> => { - const persistedConversation = await this.getConversationWithMetaFields(conversationId); - - if (!persistedConversation) { - throw notFound(); - } - - const updatedConversation: Conversation = merge( - {}, - conversation, - this.getConversationUpdateValues(new Date().toISOString()) - ); - - await this.dependencies.esClient.asInternalUser.update({ - id: persistedConversation._id!, - index: persistedConversation._index, - doc: updatedConversation, - refresh: true, - }); - - return updatedConversation; - }; - - setTitle = async ({ conversationId, title }: { conversationId: string; title: string }) => { - const document = await this.getConversationWithMetaFields(conversationId); - if (!document) { - throw notFound(); - } - - const conversation = await this.get(conversationId); - - if (!conversation) { - throw notFound(); - } - - const updatedConversation: Conversation = merge( - {}, - conversation, - { conversation: { title } }, - this.getConversationUpdateValues(new Date().toISOString()) - ); - - await this.dependencies.esClient.asInternalUser.update({ - id: document._id!, - index: document._index, - doc: { conversation: { title } }, - refresh: true, - }); - - return updatedConversation; - }; - - create = async (conversation: ConversationCreateRequest): Promise<Conversation> => { - const now = new Date().toISOString(); - - const createdConversation: Conversation = merge( - {}, - conversation, - { - '@timestamp': now, - conversation: { id: conversation.conversation.id || v4() }, - }, - this.getConversationUpdateValues(now) - ); - - await this.dependencies.esClient.asInternalUser.index({ - index: resourceNames.aliases.conversations, - document: createdConversation, - refresh: true, - }); - - return createdConversation; - }; - - recall = async ({ - queries, - categories, - }: { - queries: Array<{ text: string; boost?: number }>; - categories?: string[]; - }): Promise<RecalledEntry[]> => { - return ( - this.dependencies.knowledgeBaseService?.recall({ - namespace: this.dependencies.namespace, - user: this.dependencies.user, - queries, - categories, - esClient: this.dependencies.esClient, - uiSettingsClient: this.dependencies.uiSettingsClient, - }) || [] - ); - }; - - getKnowledgeBaseStatus = () => { - return this.dependencies.knowledgeBaseService.getStatus(); - }; - - setupKnowledgeBase = async (modelId: string | undefined) => { - const { esClient, core, logger, knowledgeBaseService } = this.dependencies; - - // setup the knowledge base - const res = await knowledgeBaseService.setup(esClient, modelId); - - core - .getStartServices() - .then(([_, pluginsStart]) => { - logger.debug('Schedule semantic text migration task'); - return scheduleSemanticTextMigration(pluginsStart); - }) - .catch((error) => { - logger.error(`Failed to run semantic text migration task: ${error}`); - }); - - return res; - }; - - resetKnowledgeBase = () => { - const { esClient } = this.dependencies; - return this.dependencies.knowledgeBaseService.reset(esClient); - }; - - migrateKnowledgeBaseToSemanticText = () => { - return runSemanticTextKnowledgeBaseMigration({ - esClient: this.dependencies.esClient, - logger: this.dependencies.logger, - config: this.dependencies.config, - }); - }; - - addUserInstruction = async ({ - entry, - }: { - entry: Omit< - KnowledgeBaseEntry, - '@timestamp' | 'confidence' | 'is_correction' | 'type' | 'role' - >; - }): Promise<void> => { - // for now we want to limit the number of user instructions to 1 per user - // if a user instruction already exists for the user, we get the id and update it - this.dependencies.logger.debug('Adding user instruction entry'); - const existingId = await this.dependencies.knowledgeBaseService.getPersonalUserInstructionId({ - isPublic: entry.public, - namespace: this.dependencies.namespace, - user: this.dependencies.user, - }); - - if (existingId) { - entry.id = existingId; - this.dependencies.logger.debug(`Updating user instruction with id "${existingId}"`); - } - - return this.dependencies.knowledgeBaseService.addEntry({ - namespace: this.dependencies.namespace, - user: this.dependencies.user, - entry: { - ...entry, - confidence: 'high', - is_correction: false, - type: KnowledgeBaseType.UserInstruction, - labels: {}, - role: KnowledgeBaseEntryRole.UserEntry, - }, - }); - }; - - addKnowledgeBaseEntry = async ({ - entry, - }: { - entry: Omit<KnowledgeBaseEntry, '@timestamp' | 'type'>; - }): Promise<void> => { - return this.dependencies.knowledgeBaseService.addEntry({ - namespace: this.dependencies.namespace, - user: this.dependencies.user, - entry: { - ...entry, - type: KnowledgeBaseType.Contextual, - }, - }); - }; - - getKnowledgeBaseEntries = async ({ - query, - sortBy, - sortDirection, - }: { - query: string; - sortBy: string; - sortDirection: 'asc' | 'desc'; - }) => { - return this.dependencies.knowledgeBaseService.getEntries({ query, sortBy, sortDirection }); - }; - - deleteKnowledgeBaseEntry = async (id: string) => { - return this.dependencies.knowledgeBaseService.deleteEntry({ id }); - }; - - getKnowledgeBaseUserInstructions = async () => { - return this.dependencies.knowledgeBaseService.getUserInstructions( - this.dependencies.namespace, - this.dependencies.user - ); - }; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts deleted file mode 100644 index 1cf1cdc326fd..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/service/knowledge_base_service/index.ts +++ /dev/null @@ -1,445 +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 { serverUnavailable } from '@hapi/boom'; -import type { CoreSetup, ElasticsearchClient, IUiSettingsClient } from '@kbn/core/server'; -import type { Logger } from '@kbn/logging'; -import { orderBy } from 'lodash'; -import { encode } from 'gpt-tokenizer'; -import { resourceNames } from '..'; -import { - Instruction, - KnowledgeBaseEntry, - KnowledgeBaseEntryRole, - KnowledgeBaseType, -} from '../../../common/types'; -import { getAccessQuery } from '../util/get_access_query'; -import { getCategoryQuery } from '../util/get_category_query'; -import { - createInferenceEndpoint, - deleteInferenceEndpoint, - getElserModelStatus, - isInferenceEndpointMissingOrUnavailable, -} from '../inference_endpoint'; -import { recallFromSearchConnectors } from './recall_from_search_connectors'; -import { ObservabilityAIAssistantPluginStartDependencies } from '../../types'; -import { ObservabilityAIAssistantConfig } from '../../config'; - -interface Dependencies { - core: CoreSetup<ObservabilityAIAssistantPluginStartDependencies>; - esClient: { - asInternalUser: ElasticsearchClient; - }; - logger: Logger; - config: ObservabilityAIAssistantConfig; -} - -export interface RecalledEntry { - id: string; - text: string; - score: number | null; - is_correction?: boolean; - labels?: Record<string, string>; -} - -function throwKnowledgeBaseNotReady(body: any) { - throw serverUnavailable(`Knowledge base is not ready yet`, body); -} - -export class KnowledgeBaseService { - constructor(private readonly dependencies: Dependencies) {} - - async setup( - esClient: { - asCurrentUser: ElasticsearchClient; - asInternalUser: ElasticsearchClient; - }, - modelId: string | undefined - ) { - await deleteInferenceEndpoint({ esClient }).catch((e) => {}); // ensure existing inference endpoint is deleted - return createInferenceEndpoint({ esClient, logger: this.dependencies.logger, modelId }); - } - - async reset(esClient: { asCurrentUser: ElasticsearchClient }) { - try { - await deleteInferenceEndpoint({ esClient }); - } catch (error) { - if (isInferenceEndpointMissingOrUnavailable(error)) { - return; - } - throw error; - } - } - - private async recallFromKnowledgeBase({ - queries, - categories, - namespace, - user, - }: { - queries: Array<{ text: string; boost?: number }>; - categories?: string[]; - namespace: string; - user?: { name: string }; - }): Promise<RecalledEntry[]> { - const response = await this.dependencies.esClient.asInternalUser.search< - Pick<KnowledgeBaseEntry, 'text' | 'is_correction' | 'labels' | 'title'> & { doc_id?: string } - >({ - index: [resourceNames.aliases.kb], - query: { - bool: { - should: queries.map(({ text, boost = 1 }) => ({ - semantic: { - field: 'semantic_text', - query: text, - boost, - }, - })), - filter: [ - ...getAccessQuery({ - user, - namespace, - }), - ...getCategoryQuery({ categories }), - - // exclude user instructions - { bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } } }, - ], - }, - }, - size: 20, - _source: { - includes: ['text', 'is_correction', 'labels', 'doc_id', 'title'], - }, - }); - - return response.hits.hits.map((hit) => ({ - text: hit._source?.text!, - is_correction: hit._source?.is_correction, - labels: hit._source?.labels, - title: hit._source?.title ?? hit._source?.doc_id, // use `doc_id` as fallback title for backwards compatibility - score: hit._score!, - id: hit._id!, - })); - } - - recall = async ({ - user, - queries, - categories, - namespace, - esClient, - uiSettingsClient, - }: { - queries: Array<{ text: string; boost?: number }>; - categories?: string[]; - user?: { name: string }; - namespace: string; - esClient: { asCurrentUser: ElasticsearchClient; asInternalUser: ElasticsearchClient }; - uiSettingsClient: IUiSettingsClient; - }): Promise<RecalledEntry[]> => { - if (!this.dependencies.config.enableKnowledgeBase) { - return []; - } - - this.dependencies.logger.debug( - () => `Recalling entries from KB for queries: "${JSON.stringify(queries)}"` - ); - - const [documentsFromKb, documentsFromConnectors] = await Promise.all([ - this.recallFromKnowledgeBase({ - user, - queries, - categories, - namespace, - }).catch((error) => { - if (isInferenceEndpointMissingOrUnavailable(error)) { - throwKnowledgeBaseNotReady(error.body); - } - throw error; - }), - recallFromSearchConnectors({ - esClient, - uiSettingsClient, - queries, - core: this.dependencies.core, - logger: this.dependencies.logger, - }).catch((error) => { - this.dependencies.logger.debug('Error getting data from search indices'); - this.dependencies.logger.debug(error); - return []; - }), - ]); - - this.dependencies.logger.debug( - `documentsFromKb: ${JSON.stringify(documentsFromKb.slice(0, 5), null, 2)}` - ); - this.dependencies.logger.debug( - `documentsFromConnectors: ${JSON.stringify(documentsFromConnectors.slice(0, 5), null, 2)}` - ); - - const sortedEntries = orderBy( - documentsFromKb.concat(documentsFromConnectors), - 'score', - 'desc' - ).slice(0, 20); - - const MAX_TOKENS = 4000; - - let tokenCount = 0; - - const returnedEntries: RecalledEntry[] = []; - - for (const entry of sortedEntries) { - returnedEntries.push(entry); - tokenCount += encode(entry.text).length; - if (tokenCount >= MAX_TOKENS) { - break; - } - } - - const droppedEntries = sortedEntries.length - returnedEntries.length; - if (droppedEntries > 0) { - this.dependencies.logger.info(`Dropped ${droppedEntries} entries because of token limit`); - } - - return returnedEntries; - }; - - getUserInstructions = async ( - namespace: string, - user?: { name: string } - ): Promise<Array<Instruction & { public?: boolean }>> => { - if (!this.dependencies.config.enableKnowledgeBase) { - return []; - } - try { - const response = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ - index: resourceNames.aliases.kb, - query: { - bool: { - filter: [ - { - term: { - type: KnowledgeBaseType.UserInstruction, - }, - }, - ...getAccessQuery({ user, namespace }), - ], - }, - }, - size: 500, - _source: ['id', 'text', 'public'], - }); - - return response.hits.hits.map((hit) => ({ - id: hit._id!, - text: hit._source?.text ?? '', - public: hit._source?.public, - })); - } catch (error) { - this.dependencies.logger.error('Failed to load instructions from knowledge base'); - this.dependencies.logger.error(error); - return []; - } - }; - - getEntries = async ({ - query, - sortBy, - sortDirection, - }: { - query?: string; - sortBy?: string; - sortDirection?: 'asc' | 'desc'; - }): Promise<{ entries: KnowledgeBaseEntry[] }> => { - if (!this.dependencies.config.enableKnowledgeBase) { - return { entries: [] }; - } - try { - const response = await this.dependencies.esClient.asInternalUser.search< - KnowledgeBaseEntry & { doc_id?: string } - >({ - index: resourceNames.aliases.kb, - query: { - bool: { - filter: [ - // filter by search query - ...(query - ? [{ query_string: { query: `${query}*`, fields: ['doc_id', 'title'] } }] - : []), - { - // exclude user instructions - bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } }, - }, - ], - }, - }, - sort: - sortBy === 'title' - ? [ - { ['title.keyword']: { order: sortDirection } }, - { doc_id: { order: sortDirection } }, // sort by doc_id for backwards compatibility - ] - : [{ [String(sortBy)]: { order: sortDirection } }], - size: 500, - _source: { - includes: [ - 'title', - 'doc_id', - 'text', - 'is_correction', - 'labels', - 'confidence', - 'public', - '@timestamp', - 'role', - 'user.name', - 'type', - ], - }, - }); - - return { - entries: response.hits.hits.map((hit) => ({ - ...hit._source!, - title: hit._source!.title ?? hit._source!.doc_id, // use `doc_id` as fallback title for backwards compatibility - role: hit._source!.role ?? KnowledgeBaseEntryRole.UserEntry, - score: hit._score, - id: hit._id!, - })), - }; - } catch (error) { - if (isInferenceEndpointMissingOrUnavailable(error)) { - throwKnowledgeBaseNotReady(error.body); - } - throw error; - } - }; - - getPersonalUserInstructionId = async ({ - isPublic, - user, - namespace, - }: { - isPublic: boolean; - user?: { name: string; id?: string }; - namespace?: string; - }) => { - if (!this.dependencies.config.enableKnowledgeBase) { - return null; - } - const res = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ - index: resourceNames.aliases.kb, - query: { - bool: { - filter: [ - { term: { type: KnowledgeBaseType.UserInstruction } }, - { term: { public: isPublic } }, - ...getAccessQuery({ user, namespace }), - ], - }, - }, - size: 1, - _source: false, - }); - - return res.hits.hits[0]?._id; - }; - - getUuidFromDocId = async ({ - docId, - user, - namespace, - }: { - docId: string; - user?: { name: string; id?: string }; - namespace?: string; - }) => { - const query = { - bool: { - filter: [ - { term: { doc_id: docId } }, - - // exclude user instructions - { bool: { must_not: { term: { type: KnowledgeBaseType.UserInstruction } } } }, - - // restrict access to user's own entries - ...getAccessQuery({ user, namespace }), - ], - }, - }; - - const response = await this.dependencies.esClient.asInternalUser.search<KnowledgeBaseEntry>({ - size: 1, - index: resourceNames.aliases.kb, - query, - _source: false, - }); - - return response.hits.hits[0]?._id; - }; - - addEntry = async ({ - entry: { id, ...doc }, - user, - namespace, - }: { - entry: Omit<KnowledgeBaseEntry, '@timestamp'>; - user?: { name: string; id?: string }; - namespace?: string; - }): Promise<void> => { - if (!this.dependencies.config.enableKnowledgeBase) { - return; - } - - try { - await this.dependencies.esClient.asInternalUser.index({ - index: resourceNames.aliases.kb, - id, - document: { - '@timestamp': new Date().toISOString(), - ...doc, - ...(doc.text ? { semantic_text: doc.text } : {}), - user, - namespace, - }, - refresh: 'wait_for', - }); - } catch (error) { - if (isInferenceEndpointMissingOrUnavailable(error)) { - throwKnowledgeBaseNotReady(error.body); - } - throw error; - } - }; - - deleteEntry = async ({ id }: { id: string }): Promise<void> => { - try { - await this.dependencies.esClient.asInternalUser.delete({ - index: resourceNames.aliases.kb, - id, - refresh: 'wait_for', - }); - - return Promise.resolve(); - } catch (error) { - if (isInferenceEndpointMissingOrUnavailable(error)) { - throwKnowledgeBaseNotReady(error.body); - } - throw error; - } - }; - - getStatus = async () => { - return getElserModelStatus({ - esClient: this.dependencies.esClient, - logger: this.dependencies.logger, - config: this.dependencies.config, - }); - }; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts deleted file mode 100644 index ece417d968a1..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/server/types.ts +++ /dev/null @@ -1,67 +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 { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; -import type { - PluginSetupContract as ActionsPluginSetup, - PluginStartContract as ActionsPluginStart, -} from '@kbn/actions-plugin/server'; -import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; -import type { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import type { - DataViewsServerPluginSetup, - DataViewsServerPluginStart, -} from '@kbn/data-views-plugin/server'; -import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; -import type { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/server'; -import type { RuleRegistryPluginStartContract } from '@kbn/rule-registry-plugin/server'; -import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; -import type { InferenceServerStart } from '@kbn/inference-plugin/server'; -import type { ObservabilityAIAssistantService } from './service'; - -export interface ObservabilityAIAssistantServerSetup { - /** - * Returns a Observability AI Assistant service instance - */ - service: ObservabilityAIAssistantService; -} - -export interface ObservabilityAIAssistantServerStart { - /** - * Returns a Observability AI Assistant service instance - */ - service: ObservabilityAIAssistantService; -} - -export interface ObservabilityAIAssistantPluginSetupDependencies { - actions: ActionsPluginSetup; - security: SecurityPluginSetup; - features: FeaturesPluginSetup; - taskManager: TaskManagerSetupContract; - dataViews: DataViewsServerPluginSetup; - licensing: LicensingPluginSetup; - cloud?: CloudSetup; - serverless?: ServerlessPluginSetup; - alerting: AlertingServerSetup; -} - -export interface ObservabilityAIAssistantPluginStartDependencies { - actions: ActionsPluginStart; - security: SecurityPluginStart; - features: FeaturesPluginStart; - taskManager: TaskManagerStartContract; - dataViews: DataViewsServerPluginStart; - licensing: LicensingPluginStart; - ruleRegistry: RuleRegistryPluginStartContract; - cloud?: CloudStart; - serverless?: ServerlessPluginStart; - alerting: AlertingServerStart; - inference: InferenceServerStart; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json b/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json deleted file mode 100644 index 77b81c9c7288..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant/tsconfig.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "public/**/*", - "scripts/**/*", - "typings/**/*", - "public/**/*.json", - "server/**/*" - ], - "kbn_references": [ - "@kbn/i18n", - "@kbn/logging", - "@kbn/kibana-utils-plugin", - "@kbn/core-analytics-browser", - "@kbn/core", - "@kbn/server-route-repository", - "@kbn/server-route-repository-client", - "@kbn/actions-plugin", - "@kbn/licensing-plugin", - "@kbn/std", - "@kbn/utility-types-jest", - "@kbn/kibana-react-plugin", - "@kbn/shared-ux-utility", - "@kbn/security-plugin", - "@kbn/config-schema", - "@kbn/utility-types", - "@kbn/data-views-plugin", - "@kbn/io-ts-utils", - "@kbn/rule-registry-plugin", - "@kbn/alerting-plugin", - "@kbn/spaces-plugin", - "@kbn/task-manager-plugin", - "@kbn/core-elasticsearch-server", - "@kbn/core-ui-settings-server", - "@kbn/apm-utils", - "@kbn/features-plugin", - "@kbn/cloud-plugin", - "@kbn/serverless", - "@kbn/core-elasticsearch-server", - "@kbn/core-ui-settings-server", - "@kbn/management-settings-ids", - "@kbn/ai-assistant-common", - "@kbn/inference-common", - "@kbn/core-lifecycle-server", - "@kbn/server-route-repository-utils", - "@kbn/inference-plugin" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/jest.config.js b/x-pack/plugins/observability_solution/observability_ai_assistant_app/jest.config.js deleted file mode 100644 index 7e3fb9e75044..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_app/public', - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_app/common', - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_app/server', - ], - setupFiles: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/jest_setup.js', - ], - collectCoverage: true, - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_app/{common,public,server}/**/*.{js,ts,tsx}', - ], - - coverageReporters: ['html'], -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/kibana.jsonc b/x-pack/plugins/observability_solution/observability_ai_assistant_app/kibana.jsonc deleted file mode 100644 index 957ca0272c08..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/kibana.jsonc +++ /dev/null @@ -1,47 +0,0 @@ -{ - "type": "plugin", - "id": "@kbn/observability-ai-assistant-app-plugin", - "owner": [ - "@elastic/obs-ai-assistant" - ], - "group": "observability", - "visibility": "private", - "plugin": { - "id": "observabilityAIAssistantApp", - "browser": true, - "server": true, - "configPath": [ - "xpack", - "observabilityAIAssistantApp" - ], - "requiredPlugins": [ - "aiAssistantManagementSelection", - "observabilityAIAssistant", - "observabilityShared", - "observability", - "actions", - "data", - "dataViews", - "lens", - "ruleRegistry", - "uiActions", - "triggersActionsUi", - "share", - "licensing", - "ml", - "alerting", - "features", - "inference", - "logsDataAccess", - "llmTasks" - ], - "optionalPlugins": [ - "cloud" - ], - "requiredBundles": [ - "kibanaReact", - "esqlDataGrid" - ], - "extraPublicDirs": [] - } -} \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/charts/spark_plot.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/charts/spark_plot.tsx deleted file mode 100644 index ddb57a127fe1..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/charts/spark_plot.tsx +++ /dev/null @@ -1,108 +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 { - BarSeries, - Chart, - CurveType, - LineSeries, - PartialTheme, - ScaleType, - Settings, - Tooltip, - LineAnnotation, - AnnotationDomainType, - Position, -} from '@elastic/charts'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { useChartTheme } from '../../hooks/use_chart_theme'; - -export function SparkPlot({ - type, - timeseries, - annotations, -}: { - type: 'line' | 'bar'; - timeseries: Array<{ x: number; y: number | null }>; - annotations?: Array<{ - id: string; - x: number; - color: string; - icon: React.ReactNode; - label: string; - }>; -}) { - const defaultChartTheme = useChartTheme(); - - const sparkplotChartTheme: PartialTheme = { - chartMargins: { left: 0, right: 0, top: 0, bottom: 0 }, - chartPaddings: { - top: 12, - bottom: 12, - }, - lineSeriesStyle: { - point: { opacity: 0 }, - }, - areaSeriesStyle: { - point: { opacity: 0 }, - }, - }; - - return ( - <Chart - size={{ - width: 128, - height: 64, - }} - > - <Settings - theme={[sparkplotChartTheme, ...defaultChartTheme.theme]} - baseTheme={defaultChartTheme.baseTheme} - showLegend={false} - locale={i18n.getLocale()} - /> - <Tooltip type="none" /> - {type && type === 'bar' ? ( - <BarSeries - id="Sparkbar" - xScaleType={ScaleType.Linear} - yScaleType={ScaleType.Linear} - xAccessor="x" - yAccessors={['y']} - data={timeseries} - /> - ) : ( - <LineSeries - id="Sparkline" - xScaleType={ScaleType.Time} - yScaleType={ScaleType.Linear} - xAccessor={'x'} - yAccessors={['y']} - data={timeseries} - curve={CurveType.CURVE_MONOTONE_X} - /> - )} - {annotations?.map((annotation) => { - return ( - <LineAnnotation - id={annotation.id} - dataValues={[{ dataValue: annotation.x, header: annotation.label }]} - domainType={AnnotationDomainType.XDomain} - marker={annotation.icon} - markerPosition={Position.Bottom} - style={{ - line: { - strokeWidth: 2, - stroke: annotation.color, - }, - }} - /> - ); - })} - </Chart> - ); -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/index.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/index.ts deleted file mode 100644 index 5de1c30de7c4..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; -import { ConfigSchema, ObservabilityAIAssistantAppPlugin } from './plugin'; -import type { - ObservabilityAIAssistantAppPluginSetupDependencies, - ObservabilityAIAssistantAppPluginStartDependencies, - ObservabilityAIAssistantAppPublicSetup, - ObservabilityAIAssistantAppPublicStart, -} from './types'; - -export const plugin: PluginInitializer< - ObservabilityAIAssistantAppPublicSetup, - ObservabilityAIAssistantAppPublicStart, - ObservabilityAIAssistantAppPluginSetupDependencies, - ObservabilityAIAssistantAppPluginStartDependencies -> = (pluginInitializerContext: PluginInitializerContext<ConfigSchema>) => - new ObservabilityAIAssistantAppPlugin(pluginInitializerContext); diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx deleted file mode 100644 index cd1285b0017c..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/plugin.tsx +++ /dev/null @@ -1,143 +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 ReactDOM from 'react-dom'; -import { - type AppMountParameters, - DEFAULT_APP_CATEGORIES, - type CoreSetup, - type CoreStart, - type Plugin, - type PluginInitializerContext, -} from '@kbn/core/public'; -import type { Logger } from '@kbn/logging'; -import { i18n } from '@kbn/i18n'; -import { AI_ASSISTANT_APP_ID } from '@kbn/deeplinks-observability'; -import { createAppService, AIAssistantAppService } from '@kbn/ai-assistant'; -import type { - ObservabilityAIAssistantAppPluginSetupDependencies, - ObservabilityAIAssistantAppPluginStartDependencies, - ObservabilityAIAssistantAppPublicSetup, - ObservabilityAIAssistantAppPublicStart, -} from './types'; -import { getObsAIAssistantConnectorType } from './rule_connector'; -import { NavControlInitiator } from './components/nav_control/lazy_nav_control'; - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ConfigSchema {} - -export class ObservabilityAIAssistantAppPlugin - implements - Plugin< - ObservabilityAIAssistantAppPublicSetup, - ObservabilityAIAssistantAppPublicStart, - ObservabilityAIAssistantAppPluginSetupDependencies, - ObservabilityAIAssistantAppPluginStartDependencies - > -{ - logger: Logger; - appService: AIAssistantAppService | undefined; - isServerless: boolean; - - constructor(context: PluginInitializerContext<ConfigSchema>) { - this.logger = context.logger.get(); - this.isServerless = context.env.packageInfo.buildFlavor === 'serverless'; - } - - setup( - coreSetup: CoreSetup, - _: ObservabilityAIAssistantAppPluginSetupDependencies - ): ObservabilityAIAssistantAppPublicSetup { - coreSetup.application.register({ - id: AI_ASSISTANT_APP_ID, - title: i18n.translate('xpack.observabilityAiAssistant.appTitle', { - defaultMessage: 'Observability AI Assistant', - }), - euiIconType: 'logoObservability', - appRoute: '/app/observabilityAIAssistant', - category: DEFAULT_APP_CATEGORIES.observability, - visibleIn: [], - deepLinks: [ - { - id: 'conversations', - title: i18n.translate('xpack.observabilityAiAssistant.conversationsDeepLinkTitle', { - defaultMessage: 'Conversations', - }), - path: '/conversations/new', - }, - ], - mount: async (appMountParameters: AppMountParameters<unknown>) => { - // Load application bundle and Get start services - const [{ Application }, [coreStart, pluginsStart]] = await Promise.all([ - import('./application'), - coreSetup.getStartServices() as Promise< - [CoreStart, ObservabilityAIAssistantAppPluginStartDependencies, unknown] - >, - ]); - - ReactDOM.render( - <Application - {...appMountParameters} - service={this.appService!} - coreStart={coreStart} - pluginsStart={pluginsStart as ObservabilityAIAssistantAppPluginStartDependencies} - />, - appMountParameters.element - ); - - return () => { - ReactDOM.unmountComponentAtNode(appMountParameters.element); - }; - }, - }); - - return {}; - } - - start( - coreStart: CoreStart, - pluginsStart: ObservabilityAIAssistantAppPluginStartDependencies - ): ObservabilityAIAssistantAppPublicStart { - const appService = (this.appService = createAppService({ - pluginsStart, - })); - const isEnabled = appService.isEnabled(); - if (isEnabled) { - coreStart.chrome.navControls.registerRight({ - mount: (element) => { - ReactDOM.render( - <NavControlInitiator - appService={appService} - coreStart={coreStart} - pluginsStart={pluginsStart} - isServerless={this.isServerless} - />, - element, - () => {} - ); - - return () => {}; - }, - // right before the user profile - order: 1001, - }); - } - - const service = pluginsStart.observabilityAIAssistant.service; - - service.register(async ({ registerRenderFunction }) => { - const { registerFunctions } = await import('./functions'); - - await registerFunctions({ pluginsStart, registerRenderFunction }); - }); - - pluginsStart.triggersActionsUi.actionTypeRegistry.register( - getObsAIAssistantConnectorType(service) - ); - return {}; - } -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/types.ts deleted file mode 100644 index 398ef5f3afe4..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/types.ts +++ /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 type { LensPublicSetup, LensPublicStart } from '@kbn/lens-plugin/public'; -import type { - DataViewsPublicPluginSetup, - DataViewsPublicPluginStart, -} from '@kbn/data-views-plugin/public'; -import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; -import type { - ObservabilityAIAssistantPublicSetup, - ObservabilityAIAssistantPublicStart, -} from '@kbn/observability-ai-assistant-plugin/public'; -import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; -import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/public'; -import type { - ObservabilitySharedPluginSetup, - ObservabilitySharedPluginStart, -} from '@kbn/observability-shared-plugin/public'; -import type { MlPluginSetup, MlPluginStart } from '@kbn/ml-plugin/public'; -import type { - TriggersAndActionsUIPublicPluginSetup, - TriggersAndActionsUIPublicPluginStart, -} from '@kbn/triggers-actions-ui-plugin/public'; -import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; -import type { - AIAssistantManagementSelectionPluginPublicStart, - AIAssistantManagementSelectionPluginPublicSetup, -} from '@kbn/ai-assistant-management-plugin/public'; - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityAIAssistantAppPublicStart {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityAIAssistantAppPublicSetup {} - -export interface ObservabilityAIAssistantAppPluginStartDependencies { - licensing: LicensingPluginStart; - share: SharePluginStart; - lens: LensPublicStart; - dataViews: DataViewsPublicPluginStart; - uiActions: UiActionsStart; - observabilityAIAssistant: ObservabilityAIAssistantPublicStart; - observabilityShared: ObservabilitySharedPluginStart; - ml: MlPluginStart; - triggersActionsUi: TriggersAndActionsUIPublicPluginStart; - data: DataPublicPluginStart; - aiAssistantManagementSelection: AIAssistantManagementSelectionPluginPublicStart; -} - -export interface ObservabilityAIAssistantAppPluginSetupDependencies { - licensing: LicensingPluginSetup; - share: SharePluginSetup; - lens: LensPublicSetup; - dataViews: DataViewsPublicPluginSetup; - uiActions: UiActionsSetup; - observabilityAIAssistant: ObservabilityAIAssistantPublicSetup; - observabilityShared: ObservabilitySharedPluginSetup; - ml: MlPluginSetup; - triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; - aiAssistantManagementSelection: AIAssistantManagementSelectionPluginPublicSetup; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/README.md b/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/README.md deleted file mode 100644 index 0e5bc22fe7c7..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/README.md +++ /dev/null @@ -1,37 +0,0 @@ -# Observability AI Assistant Evaluation Framework - -## Overview - -This tool is developed for our team working on the Elastic Observability platform, specifically focusing on evaluating the Observability AI Assistant. It simplifies scripting and evaluating various scenarios with the Large Language Model (LLM) integration. - -## Setup requirements - -- An Elasticsearch instance -- A Kibana instance -- At least one .gen-ai connector set up - -## Running evaluations - -Run the tool using: - -`$ node x-pack/plugins/observability_solution/observability_ai_assistant/scripts/evaluation/index.js` - -This will evaluate all existing scenarios, and write the evaluation results to the terminal. - -### Configuration - -#### Kibana and Elasticsearch - -By default, the tool will look for a Kibana instance running locally (at `http://localhost:5601`, which is the default address for running Kibana in development mode). It will also attempt to read the Kibana config file for the Elasticsearch address & credentials. If you want to override these settings, use `--kibana` and `--es`. Only basic auth is supported, e.g. `--kibana http://username:password@localhost:5601`. If you want to use a specific space, use `--spaceId` - -#### Connector - -Use `--connectorId` to specify a `.gen-ai` or `.bedrock` connector to use. If none are given, it will prompt you to select a connector based on the ones that are available. If only a single supported connector is found, it will be used without prompting. - -#### Persisting conversations - -By default, completed conversations are not persisted. If you do want to persist them, for instance for reviewing purposes, set the `--persist` flag to store them. This will also generate a clickable link in the output of the evaluation that takes you to the conversation. - -If you want to clear conversations on startup, use the `--clear` flag. This only works when `--persist` is enabled. If `--spaceId` is set, only conversations for the current space will be cleared. - -When storing conversations, the name of the scenario is used as a title. Set the `--autoTitle` flag to have the LLM generate a title for you. diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.ts deleted file mode 100644 index fca94a8d57d0..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import path from 'path'; -import fs from 'fs'; -import yaml from 'js-yaml'; -import { identity, pickBy } from 'lodash'; - -export type KibanaConfig = ReturnType<typeof readKibanaConfig>; - -export const readKibanaConfig = () => { - const kibanaConfigDir = path.join(__filename, '../../../../../../../config'); - const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml'); - const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml'); - - const loadedKibanaConfig = (yaml.load( - fs.readFileSync(fs.existsSync(kibanaDevConfig) ? kibanaDevConfig : kibanaConfig, 'utf8') - ) || {}) as {}; - - const cliEsCredentials = pickBy( - { - 'elasticsearch.username': process.env.ELASTICSEARCH_USERNAME, - 'elasticsearch.password': process.env.ELASTICSEARCH_PASSWORD, - 'elasticsearch.hosts': process.env.ELASTICSEARCH_HOST, - }, - identity - ) as { - 'elasticsearch.username'?: string; - 'elasticsearch.password'?: string; - 'elasticsearch.hosts'?: string; - }; - - return { - 'elasticsearch.hosts': 'http://localhost:9200', - 'elasticsearch.username': 'elastic', - 'elasticsearch.password': 'changeme', - ...loadedKibanaConfig, - ...cliEsCredentials, - }; -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/types.ts b/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/types.ts deleted file mode 100644 index 0a3fc6d9dc12..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/types.ts +++ /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 { - PluginSetupContract as ActionsPluginSetup, - PluginStartContract as ActionsPluginStart, -} from '@kbn/actions-plugin/server'; -import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; -import type { - DataViewsServerPluginSetup, - DataViewsServerPluginStart, -} from '@kbn/data-views-plugin/server'; -import type { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; -import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; -import type { - ObservabilityAIAssistantServerSetup, - ObservabilityAIAssistantServerStart, -} from '@kbn/observability-ai-assistant-plugin/server'; -import type { - RuleRegistryPluginSetupContract, - RuleRegistryPluginStartContract, -} from '@kbn/rule-registry-plugin/server'; -import type { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/server'; -import type { - TaskManagerSetupContract, - TaskManagerStartContract, -} from '@kbn/task-manager-plugin/server'; -import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; -import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; -import type { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; -import type { InferenceServerStart, InferenceServerSetup } from '@kbn/inference-plugin/server'; -import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/server'; -import type { LlmTasksPluginStart } from '@kbn/llm-tasks-plugin/server'; - -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityAIAssistantAppServerStart {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface ObservabilityAIAssistantAppServerSetup {} - -export interface ObservabilityAIAssistantAppPluginStartDependencies { - observabilityAIAssistant: ObservabilityAIAssistantServerStart; - ruleRegistry: RuleRegistryPluginStartContract; - alerting: AlertingServerStart; - licensing: LicensingPluginStart; - actions: ActionsPluginStart; - security: SecurityPluginStart; - features: FeaturesPluginStart; - taskManager: TaskManagerStartContract; - dataViews: DataViewsServerPluginStart; - cloud?: CloudStart; - serverless?: ServerlessPluginStart; - inference: InferenceServerStart; - logsDataAccess: LogsDataAccessPluginStart; - llmTasks: LlmTasksPluginStart; -} - -export interface ObservabilityAIAssistantAppPluginSetupDependencies { - observabilityAIAssistant: ObservabilityAIAssistantServerSetup; - ruleRegistry: RuleRegistryPluginSetupContract; - alerting: AlertingServerSetup; - licensing: LicensingPluginSetup; - actions: ActionsPluginSetup; - security: SecurityPluginSetup; - features: FeaturesPluginSetup; - taskManager: TaskManagerSetupContract; - dataViews: DataViewsServerPluginSetup; - observability: ObservabilityPluginSetup; - cloud?: CloudSetup; - serverless?: ServerlessPluginSetup; - inference: InferenceServerSetup; -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/tsconfig.json b/x-pack/plugins/observability_solution/observability_ai_assistant_app/tsconfig.json deleted file mode 100644 index e0a520fb574c..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/tsconfig.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "public/**/*", - "scripts/**/*", - "typings/**/*", - "public/**/*.json", - "server/**/*" - ], - "kbn_references": [ - "@kbn/es-types", - "@kbn/observability-ai-assistant-plugin", - "@kbn/field-formats-plugin", - "@kbn/core", - "@kbn/typed-react-router-config", - "@kbn/i18n", - "@kbn/management-settings-ids", - "@kbn/triggers-actions-ui-plugin", - "@kbn/shared-ux-utility", - "@kbn/data-views-plugin", - "@kbn/lens-embeddable-utils", - "@kbn/lens-plugin", - "@kbn/expressions-plugin", - "@kbn/ui-actions-plugin", - "@kbn/esql-utils", - "@kbn/visualization-utils", - "@kbn/ai-assistant-management-plugin", - "@kbn/kibana-react-plugin", - "@kbn/licensing-plugin", - "@kbn/logging", - "@kbn/deeplinks-observability", - "@kbn/share-plugin", - "@kbn/observability-shared-plugin", - "@kbn/ml-plugin", - "@kbn/data-plugin", - "@kbn/react-kibana-context-theme", - "@kbn/shared-ux-link-redirect-app", - "@kbn/dev-cli-runner", - "@kbn/tooling-log", - "@kbn/babel-register", - "@kbn/expect", - "@kbn/apm-synthtrace-client", - "@kbn/alerting-plugin", - "@kbn/apm-synthtrace", - "@kbn/esql-datagrid", - "@kbn/alerting-comparators", - "@kbn/core-lifecycle-browser", - "@kbn/inference-plugin", - "@kbn/ai-assistant", - "@kbn/apm-utils", - "@kbn/config-schema", - "@kbn/es-query", - "@kbn/rule-registry-plugin", - "@kbn/esql-validation-autocomplete", - "@kbn/esql-ast", - "@kbn/field-types", - "@kbn/security-plugin", - "@kbn/observability-plugin", - "@kbn/actions-plugin", - "@kbn/stack-connectors-plugin", - "@kbn/features-plugin", - "@kbn/serverless", - "@kbn/task-manager-plugin", - "@kbn/cloud-plugin", - "@kbn/logs-data-access-plugin", - "@kbn/ai-assistant-common", - "@kbn/inference-common", - "@kbn/llm-tasks-plugin", - "@kbn/product-doc-common", - ], - "exclude": [ - "target/**/*" - ] -} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/jest.config.js b/x-pack/plugins/observability_solution/observability_ai_assistant_management/jest.config.js deleted file mode 100644 index bbe2bd0b6266..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_management/jest.config.js +++ /dev/null @@ -1,16 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_management'], - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/observability_ai_assistant_management/{common,public,server}/**/*.{js,ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/tsconfig.json b/x-pack/plugins/observability_solution/observability_ai_assistant_management/tsconfig.json deleted file mode 100644 index 7b78d52c6480..000000000000 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_management/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/home-plugin", - "@kbn/kibana-react-plugin", - "@kbn/management-plugin", - "@kbn/i18n", - "@kbn/i18n-react", - "@kbn/typed-react-router-config", - "@kbn/core-chrome-browser", - "@kbn/observability-ai-assistant-plugin", - "@kbn/serverless", - "@kbn/management-settings-components-field-row", - "@kbn/observability-shared-plugin", - "@kbn/config-schema", - "@kbn/core-ui-settings-common", - "@kbn/logs-data-access-plugin", - "@kbn/core-plugins-browser", - "@kbn/ai-assistant", - "@kbn/core-plugins-server", - "@kbn/product-doc-base-plugin" - ], - "exclude": [ - "target/**/*" - ] -} diff --git a/x-pack/plugins/observability_solution/observability_onboarding/e2e/kibana.jsonc b/x-pack/plugins/observability_solution/observability_onboarding/e2e/kibana.jsonc index 655ccc396d3f..033d72a02427 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/e2e/kibana.jsonc +++ b/x-pack/plugins/observability_solution/observability_onboarding/e2e/kibana.jsonc @@ -1,10 +1,7 @@ { "type": "test-helper", "id": "@kbn/observability-onboarding-e2e", - "owner": [ - "@elastic/obs-ux-logs-team", - "@elastic/obs-ux-onboarding-team" - ], + "owner": ["@elastic/obs-ux-logs-team"], "group": "observability", "visibility": "private", "devOnly": true diff --git a/x-pack/plugins/observability_solution/observability_onboarding/kibana.jsonc b/x-pack/plugins/observability_solution/observability_onboarding/kibana.jsonc index 8c24f5376a4b..b1c3856839f9 100644 --- a/x-pack/plugins/observability_solution/observability_onboarding/kibana.jsonc +++ b/x-pack/plugins/observability_solution/observability_onboarding/kibana.jsonc @@ -1,10 +1,7 @@ { "type": "plugin", "id": "@kbn/observability-onboarding-plugin", - "owner": [ - "@elastic/obs-ux-logs-team", - "@elastic/obs-ux-onboarding-team" - ], + "owner": ["@elastic/obs-ux-logs-team"], "group": "observability", "visibility": "private", "plugin": { diff --git a/x-pack/plugins/observability_solution/observability_shared/typings/common.ts b/x-pack/plugins/observability_solution/observability_shared/typings/common.ts index 83ad51daf0b2..6e7340700259 100644 --- a/x-pack/plugins/observability_solution/observability_shared/typings/common.ts +++ b/x-pack/plugins/observability_solution/observability_shared/typings/common.ts @@ -13,7 +13,6 @@ export type ObservabilityApp = | 'uptime' | 'synthetics' | 'observability-overview' - | 'stack_monitoring' | 'ux' | 'fleet' | 'profiling' diff --git a/x-pack/plugins/observability_solution/profiling/e2e/cypress_test_runner.ts b/x-pack/plugins/observability_solution/profiling/e2e/cypress_test_runner.ts index 44317da9c662..1ba633c2d054 100644 --- a/x-pack/plugins/observability_solution/profiling/e2e/cypress_test_runner.ts +++ b/x-pack/plugins/observability_solution/profiling/e2e/cypress_test_runner.ts @@ -13,6 +13,10 @@ import { FtrProviderContext } from './ftr_provider_context'; import { loadProfilingData } from './load_profiling_data'; import { setupProfilingResources } from './setup_profiling_resources'; +const DEFAULT_HEADERS = { + 'kbn-xsrf': true, + 'x-elastic-internal-origin': 'Kibana', +}; export async function cypressTestRunner({ ftrProviderContext: { getService }, cypressExecution, @@ -42,11 +46,11 @@ export async function cypressTestRunner({ }); // Ensure Fleet setup is complete - await axios.post(`${kibanaUrlWithAuth}/api/fleet/setup`, {}, { headers: { 'kbn-xsrf': true } }); + await axios.post(`${kibanaUrlWithAuth}/api/fleet/setup`, {}, { headers: DEFAULT_HEADERS }); const profilingResources = await axios.get<{ has_setup: boolean; has_data: boolean }>( `${kibanaUrlWithAuth}/internal/profiling/setup/es_resources`, - { headers: { 'kbn-xsrf': true } } + { headers: DEFAULT_HEADERS } ); // Only runs the setup once. This is useful when runing the tests with --times args diff --git a/x-pack/plugins/observability_solution/profiling/e2e/setup_profiling_resources.ts b/x-pack/plugins/observability_solution/profiling/e2e/setup_profiling_resources.ts index 87f542d449f8..e139b351d3a5 100644 --- a/x-pack/plugins/observability_solution/profiling/e2e/setup_profiling_resources.ts +++ b/x-pack/plugins/observability_solution/profiling/e2e/setup_profiling_resources.ts @@ -17,7 +17,7 @@ export async function setupProfilingResources({ await axios.post( `${kibanaUrlWithAuth}/internal/profiling/setup/es_resources`, {}, - { headers: { 'kbn-xsrf': true } } + { headers: { 'kbn-xsrf': true, 'x-elastic-internal-origin': 'Kibana' } } ); // eslint-disable-next-line no-console console.log('[Done] Setting up Universal profiling resources.'); diff --git a/x-pack/plugins/observability_solution/profiling/public/index.tsx b/x-pack/plugins/observability_solution/profiling/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/profiling/public/index.tsx rename to x-pack/plugins/observability_solution/profiling/public/index.ts diff --git a/x-pack/plugins/observability_solution/profiling/public/plugin.ts b/x-pack/plugins/observability_solution/profiling/public/plugin.ts new file mode 100644 index 000000000000..752b9c92a219 --- /dev/null +++ b/x-pack/plugins/observability_solution/profiling/public/plugin.ts @@ -0,0 +1,185 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + AppMountParameters, + AppUpdater, + CoreSetup, + CoreStart, + DEFAULT_APP_CATEGORIES, + Plugin, +} from '@kbn/core/public'; +import { i18n } from '@kbn/i18n'; +import { NavigationSection } from '@kbn/observability-shared-plugin/public'; +import type { Location } from 'history'; +import { BehaviorSubject, combineLatest, from, map, take } from 'rxjs'; +import { OBLT_PROFILING_APP_ID } from '@kbn/deeplinks-observability'; +import { registerEmbeddables } from './embeddables/register_embeddables'; +import { getServices } from './services'; +import type { ProfilingPluginPublicSetupDeps, ProfilingPluginPublicStartDeps } from './types'; +import { ProfilingEmbeddablesDependencies } from './embeddables/profiling_embeddable_provider'; + +export type ProfilingPluginSetup = void; +export type ProfilingPluginStart = void; + +export class ProfilingPlugin + implements + Plugin< + ProfilingPluginSetup, + ProfilingPluginStart, + ProfilingPluginPublicSetupDeps, + ProfilingPluginPublicStartDeps + > +{ + public setup( + coreSetup: CoreSetup<ProfilingPluginPublicStartDeps>, + pluginsSetup: ProfilingPluginPublicSetupDeps + ) { + // Register an application into the side navigation menu + const links = [ + { + id: 'stacktraces', + title: i18n.translate('xpack.profiling.navigation.stacktracesLinkLabel', { + defaultMessage: 'Stacktraces', + }), + path: '/stacktraces', + }, + { + id: 'flamegraphs', + title: i18n.translate('xpack.profiling.navigation.flameGraphsLinkLabel', { + defaultMessage: 'Flamegraphs', + }), + path: '/flamegraphs', + }, + { + id: 'functions', + title: i18n.translate('xpack.profiling.navigation.functionsLinkLabel', { + defaultMessage: 'Functions', + }), + path: '/functions', + }, + ]; + + const kuerySubject = new BehaviorSubject<string>(''); + const appUpdater$ = new BehaviorSubject<AppUpdater>(() => ({})); + + const section$ = combineLatest([from(coreSetup.getStartServices()), kuerySubject]).pipe( + map(([[coreStart], kuery]) => { + if (coreStart.application.capabilities.profiling.show) { + let isSidebarEnabled = true; + coreStart.chrome + .getChromeStyle$() + .pipe(take(1)) + .subscribe((style) => (isSidebarEnabled = style === 'classic')); + + if (isSidebarEnabled) { + // classic navigation + const sections: NavigationSection[] = [ + { + label: i18n.translate('xpack.profiling.navigation.sectionLabel', { + defaultMessage: 'Universal Profiling', + }), + entries: links.map((link) => { + return { + app: OBLT_PROFILING_APP_ID, + label: link.title, + path: kuery ? `${link.path}?kuery=${kuery}` : link.path, + matchPath: (path) => { + return path.startsWith(link.path); + }, + }; + }), + sortKey: 700, + }, + ]; + return sections; + } else { + // solution navigation + appUpdater$.next(() => ({ + deepLinks: links.map((link) => ({ + ...link, + path: kuery ? `${link.path}?kuery=${encodeURIComponent(kuery)}` : link.path, + })), + })); + } + } + return []; + }) + ); + + pluginsSetup.observabilityShared.navigation.registerSections(section$); + + const profilingFetchServices = getServices(); + + coreSetup.application.register({ + id: OBLT_PROFILING_APP_ID, + title: 'Universal Profiling', + euiIconType: 'logoObservability', + appRoute: '/app/profiling', + category: DEFAULT_APP_CATEGORIES.observability, + deepLinks: links, + updater$: appUpdater$, + async mount({ element, history, theme$, setHeaderActionMenu }: AppMountParameters) { + const [coreStart, pluginsStart] = await coreSetup.getStartServices(); + + const { renderApp } = await import('./app'); + + function pushKueryToSubject(location: Location) { + const query = new URLSearchParams(location.search); + kuerySubject.next(query.get('kuery') ?? ''); + } + + pushKueryToSubject(history.location); + + history.listen(pushKueryToSubject); + + const unmount = renderApp( + { + profilingFetchServices, + coreStart, + coreSetup, + pluginsStart, + pluginsSetup, + history, + theme$, + setHeaderActionMenu, + }, + element + ); + + return () => { + unmount(); + kuerySubject.next(''); + }; + }, + }); + + const getProfilingEmbeddableDependencies = + async (): Promise<ProfilingEmbeddablesDependencies> => { + const [coreStart, pluginsStart] = await coreSetup.getStartServices(); + return { + coreStart, + coreSetup, + pluginsStart, + pluginsSetup, + profilingFetchServices, + }; + }; + + getProfilingEmbeddableDependencies().then((deps) => { + registerEmbeddables(deps); + }); + + return {}; + } + + public start(core: CoreStart) { + return {}; + } + + public stop() {} +} diff --git a/x-pack/plugins/observability_solution/profiling/public/plugin.tsx b/x-pack/plugins/observability_solution/profiling/public/plugin.tsx deleted file mode 100644 index fca4f8dcb4c6..000000000000 --- a/x-pack/plugins/observability_solution/profiling/public/plugin.tsx +++ /dev/null @@ -1,165 +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 { - AppMountParameters, - CoreSetup, - CoreStart, - DEFAULT_APP_CATEGORIES, - Plugin, -} from '@kbn/core/public'; -import { i18n } from '@kbn/i18n'; -import { NavigationSection } from '@kbn/observability-shared-plugin/public'; -import type { Location } from 'history'; -import { BehaviorSubject, combineLatest, from, map } from 'rxjs'; -import { OBLT_PROFILING_APP_ID } from '@kbn/deeplinks-observability'; -import { registerEmbeddables } from './embeddables/register_embeddables'; -import { getServices } from './services'; -import type { ProfilingPluginPublicSetupDeps, ProfilingPluginPublicStartDeps } from './types'; -import { ProfilingEmbeddablesDependencies } from './embeddables/profiling_embeddable_provider'; - -export type ProfilingPluginSetup = void; -export type ProfilingPluginStart = void; - -export class ProfilingPlugin - implements - Plugin< - ProfilingPluginSetup, - ProfilingPluginStart, - ProfilingPluginPublicSetupDeps, - ProfilingPluginPublicStartDeps - > -{ - public setup( - coreSetup: CoreSetup<ProfilingPluginPublicStartDeps>, - pluginsSetup: ProfilingPluginPublicSetupDeps - ) { - // Register an application into the side navigation menu - const links = [ - { - id: 'stacktraces', - title: i18n.translate('xpack.profiling.navigation.stacktracesLinkLabel', { - defaultMessage: 'Stacktraces', - }), - path: '/stacktraces', - }, - { - id: 'flamegraphs', - title: i18n.translate('xpack.profiling.navigation.flameGraphsLinkLabel', { - defaultMessage: 'Flamegraphs', - }), - path: '/flamegraphs', - }, - { - id: 'functions', - title: i18n.translate('xpack.profiling.navigation.functionsLinkLabel', { - defaultMessage: 'Functions', - }), - path: '/functions', - }, - ]; - - const kuerySubject = new BehaviorSubject<string>(''); - - const section$ = combineLatest([from(coreSetup.getStartServices()), kuerySubject]).pipe( - map(([[coreStart], kuery]) => { - if (coreStart.application.capabilities.profiling.show) { - const sections: NavigationSection[] = [ - { - label: i18n.translate('xpack.profiling.navigation.sectionLabel', { - defaultMessage: 'Universal Profiling', - }), - entries: links.map((link) => { - return { - app: OBLT_PROFILING_APP_ID, - label: link.title, - path: `${link.path}?kuery=${kuery ?? ''}`, - matchPath: (path) => { - return path.startsWith(link.path); - }, - }; - }), - sortKey: 700, - }, - ]; - return sections; - } - return []; - }) - ); - - pluginsSetup.observabilityShared.navigation.registerSections(section$); - - const profilingFetchServices = getServices(); - - coreSetup.application.register({ - id: OBLT_PROFILING_APP_ID, - title: 'Universal Profiling', - euiIconType: 'logoObservability', - appRoute: '/app/profiling', - category: DEFAULT_APP_CATEGORIES.observability, - deepLinks: links, - async mount({ element, history, theme$, setHeaderActionMenu }: AppMountParameters) { - const [coreStart, pluginsStart] = await coreSetup.getStartServices(); - - const { renderApp } = await import('./app'); - - function pushKueryToSubject(location: Location) { - const query = new URLSearchParams(location.search); - kuerySubject.next(query.get('kuery') ?? ''); - } - - pushKueryToSubject(history.location); - - history.listen(pushKueryToSubject); - - const unmount = renderApp( - { - profilingFetchServices, - coreStart, - coreSetup, - pluginsStart, - pluginsSetup, - history, - theme$, - setHeaderActionMenu, - }, - element - ); - - return () => { - unmount(); - kuerySubject.next(''); - }; - }, - }); - - const getProfilingEmbeddableDependencies = - async (): Promise<ProfilingEmbeddablesDependencies> => { - const [coreStart, pluginsStart] = await coreSetup.getStartServices(); - return { - coreStart, - coreSetup, - pluginsStart, - pluginsSetup, - profilingFetchServices, - }; - }; - - getProfilingEmbeddableDependencies().then((deps) => { - registerEmbeddables(deps); - }); - - return {}; - } - - public start(core: CoreStart) { - return {}; - } - - public stop() {} -} diff --git a/x-pack/plugins/observability_solution/slo/dev_docs/slo.md b/x-pack/plugins/observability_solution/slo/dev_docs/slo.md index a12f8822fc9e..6286c47f2447 100644 --- a/x-pack/plugins/observability_solution/slo/dev_docs/slo.md +++ b/x-pack/plugins/observability_solution/slo/dev_docs/slo.md @@ -8,7 +8,7 @@ Starting in 8.8, SLO is enabled by default. SLO is GA since 8.12 1. Data generation > [!TIP] -> The following commands uses [kbn-data-forge](../../../../packages/kbn-data-forge/README.md) to generate some data for developping or testing SLOs +> The following commands uses [kbn-data-forge](../../../../platform/packages/shared/kbn-data-forge/README.md) to generate some data for developping or testing SLOs Basic command to generate 7 days of data with a couple of services: ```sh diff --git a/x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx b/x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx index 5310bffb03d9..a859c789b4e3 100644 --- a/x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx +++ b/x-pack/plugins/observability_solution/slo/e2e/page_objects/slo_app.tsx @@ -7,7 +7,7 @@ import { Page } from '@elastic/synthetics'; import { loginPageProvider } from '@kbn/synthetics-e2e/page_objects/login'; import { utilsPageProvider } from '@kbn/synthetics-e2e/page_objects/utils'; -import { recordVideo } from '@kbn/synthetics-e2e/helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; export function sloAppPageProvider({ page, kibanaUrl }: { page: Page; kibanaUrl: string }) { page.setDefaultTimeout(60 * 1000); diff --git a/x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts b/x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts index 642b7ef4cff2..0d32aae207e4 100644 --- a/x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts +++ b/x-pack/plugins/observability_solution/slo/e2e/synthetics_run.ts @@ -5,7 +5,7 @@ * 2.0. */ import { FtrConfigProviderContext } from '@kbn/test'; -import { SyntheticsRunner, argv } from '@kbn/synthetics-e2e'; +import { SyntheticsRunner, argv } from '@kbn/observability-synthetics-test-data'; const { headless, grep, bail: pauseOnError } = argv; diff --git a/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json b/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json index 6c4be7e101a0..68203a4db601 100644 --- a/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json +++ b/x-pack/plugins/observability_solution/slo/e2e/tsconfig.json @@ -12,5 +12,6 @@ "@kbn/ftr-common-functional-services", "@kbn/data-forge", "@kbn/synthetics-e2e", + "@kbn/observability-synthetics-test-data", ] } diff --git a/x-pack/plugins/observability_solution/slo/server/client/index.ts b/x-pack/plugins/observability_solution/slo/server/client/index.ts new file mode 100644 index 000000000000..277aeb71399b --- /dev/null +++ b/x-pack/plugins/observability_solution/slo/server/client/index.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 type { + ElasticsearchClient, + KibanaRequest, + SavedObjectsClientContract, +} from '@kbn/core/server'; +import { castArray, once } from 'lodash'; +import { getListOfSummaryIndices, getSloSettings } from '../services/slo_settings'; + +export interface SloClient { + getSummaryIndices(): Promise<string[]>; +} + +export function getSloClientWithRequest({ + esClient, + soClient, +}: { + request: KibanaRequest; + esClient: ElasticsearchClient; + soClient: SavedObjectsClientContract; +}): SloClient { + const getListOfSummaryIndicesOnce = once(async () => { + const settings = await getSloSettings(soClient); + + const { indices } = await getListOfSummaryIndices(esClient, settings); + + return castArray(indices); + }); + + return { + getSummaryIndices: async () => { + return await getListOfSummaryIndicesOnce(); + }, + }; +} diff --git a/x-pack/plugins/observability_solution/slo/server/index.ts b/x-pack/plugins/observability_solution/slo/server/index.ts index 76806ac4d16c..b38956141137 100644 --- a/x-pack/plugins/observability_solution/slo/server/index.ts +++ b/x-pack/plugins/observability_solution/slo/server/index.ts @@ -16,6 +16,10 @@ export async function plugin(ctx: PluginInitializerContext<SLOConfig>) { return new SLOPlugin(ctx); } +export type { SloClient } from './client'; + +export type { SLOServerSetup, SLOServerStart } from './types'; + export const config: PluginConfigDescriptor<SLOConfig> = { schema: configSchema, exposeToBrowser: { diff --git a/x-pack/plugins/observability_solution/slo/server/plugin.ts b/x-pack/plugins/observability_solution/slo/server/plugin.ts index 99cd4a2230a9..e7b25fe06ef3 100644 --- a/x-pack/plugins/observability_solution/slo/server/plugin.ts +++ b/x-pack/plugins/observability_solution/slo/server/plugin.ts @@ -9,6 +9,7 @@ import { CoreSetup, CoreStart, DEFAULT_APP_CATEGORIES, + KibanaRequest, Logger, Plugin, PluginInitializerContext, @@ -36,6 +37,7 @@ import type { SLOServerSetup, SLOServerStart, } from './types'; +import { getSloClientWithRequest } from './client'; const sloRuleTypes = [SLO_BURN_RATE_RULE_TYPE_ID]; @@ -179,6 +181,14 @@ export class SLOPlugin ?.start(plugins.taskManager, internalSoClient, internalEsClient) .catch(() => {}); - return {}; + return { + getSloClientWithRequest: (request: KibanaRequest) => { + return getSloClientWithRequest({ + request, + soClient: core.savedObjects.getScopedClient(request), + esClient: internalEsClient, + }); + }, + }; } } diff --git a/x-pack/plugins/observability_solution/slo/server/types.ts b/x-pack/plugins/observability_solution/slo/server/types.ts index 9a4054782018..5ec6e2c51e90 100644 --- a/x-pack/plugins/observability_solution/slo/server/types.ts +++ b/x-pack/plugins/observability_solution/slo/server/types.ts @@ -21,14 +21,17 @@ import { TaskManagerStartContract, } from '@kbn/task-manager-plugin/server'; import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; +import type { KibanaRequest } from '@kbn/core/server'; +import type { SloClient } from './client'; export type { SLOConfig } from '../common/config'; // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface SLOServerSetup {} -// eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface SLOServerStart {} +export interface SLOServerStart { + getSloClientWithRequest: (request: KibanaRequest) => SloClient; +} export interface SLOPluginSetupDependencies { alerting: AlertingServerSetup; diff --git a/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh deleted file mode 100755 index 58c2c88a8d83..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -UUID="$(cat /proc/sys/kernel/random/uuid)" -export UUID - -node x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/observability_solution/synthetics/README.md b/x-pack/plugins/observability_solution/synthetics/README.md deleted file mode 100644 index bdc078e8607d..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# Uptime Monitoring - -## Purpose - -The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening -in their infrastructure. - -## Layout - -There are three sections to the app, `common`, `public`, and `server`. - -### common - -Contains runtime types types, constants and a few other files. - -Notably, we use `io-ts`/`fp-ts` functions and types to help provide -additional runtime safety for our API requests/responses. - -### public - -We use Redux and associated tools for managing our app state. Components come in the usual `connect`ed and -presentational varieties. - -The `lib` directory controls bootstrapping code and adapter types. - -There is a `pages` directory; each view gets its own page component. - -The principal structure of the app is stored in `uptime_app.tsx`. - -### server - -The `lib` directory contains `adapters`, which are connections to external resources like Kibana -Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide -functionality via adapters. - -The `requests` directory contains functions responsible for querying Elasticsearch and parsing its -responses. - -There's also a `rest_api` folder that defines the structure of the RESTful API endpoints. - -## Testing - -### Unit tests - -Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing - -``` -yarn test:jest x-pack/plugins/observability_solution/synthetics -``` - -### Functional tests - -In one shell, from **~/kibana/x-pack**: -`node scripts/functional_tests_server.js` - -In another shell, from **~kibana/x-pack**: -`node ../scripts/functional_test_runner.js --grep="{TEST_NAME}"`. - -#### API tests - -If instead you need to run API tests, start up the test server and then in another shell, from **~kibana/x-pack**: -`node ../scripts/functional_test_runner.js --config test/api_integration/config.ts --grep="{TEST_NAME}"`. - -You can update snapshots by prefixing the runner command with `env UPDATE_UPTIME_FIXTURES=1` - -You can access the functional test server's Kibana at `http://localhost:5620/`. - -You can login with username `elastic` and password `changeme` by default. - -If you want to freeze a UI or API test you can include an async call like `await new Promise(r => setTimeout(r, 1000 * 60))` -to freeze the execution for 60 seconds if you need to click around or check things in the state that is loaded. - -#### Running --ssl tests - -Some of our tests require there to be an SSL connection between Kibana and Elasticsearch. - -We can run these tests like described above, but with some special config. - -`node scripts/functional_tests_server.js --config=test/functional_with_es_ssl/config.ts` - -`node scripts/functional_test_runner.js --config=test/functional_with_es_ssl/config.ts` - -#### Running accessibility tests - -We maintain a suite of Accessibility tests (you may see them referred to elsewhere as `a11y` tests). - -These tests render each of our pages and ensure that the inputs and other elements contain the -attributes necessary to ensure all users are able to make use of Kibana (for example, users relying -on screen readers). - -The commands for running these tests are very similar to the other functional tests described above. - -From the `~/x-pack` directory: - -Start the server: `node scripts/functional_tests_server --config test/accessibility/config.ts` - -Run the uptime `a11y` tests: `node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=uptime` diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/README.md b/x-pack/plugins/observability_solution/synthetics/e2e/README.md deleted file mode 100644 index e8bf7414b70d..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## How to run these tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From the same directory you can now run `node e2e.js --runner`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. - - -## Uptime App Tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From the same directory you can now run `node node uptime_e2e.js --runner`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/config.ts b/x-pack/plugins/observability_solution/synthetics/e2e/config.ts deleted file mode 100644 index 8e1e97e5c1d3..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/config.ts +++ /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 { FtrConfigProviderContext } from '@kbn/test'; -import { CA_CERT_PATH } from '@kbn/dev-utils'; -import { get } from 'lodash'; -import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; -import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; - -import { readKibanaConfig } from './tasks/read_kibana_config'; -const MANIFEST_KEY = 'xpack.uptime.service.manifestUrl'; -const SERVICE_PASSWORD = 'xpack.uptime.service.password'; -const SERVICE_USERNAME = 'xpack.uptime.service.username'; - -async function config({ readConfigFile }: FtrConfigProviderContext) { - const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('@kbn/test-suites-src/common/config') - ); - const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('@kbn/test-suites-xpack/functional/config.base') - ); - - const kibanaConfig = readKibanaConfig(); - - const manifestUrl = process.env.SYNTHETICS_SERVICE_MANIFEST ?? get(kibanaConfig, MANIFEST_KEY); - const serviceUsername = - process.env.SYNTHETICS_SERVICE_USERNAME ?? get(kibanaConfig, SERVICE_USERNAME); - const servicePassword = - process.env.SYNTHETICS_SERVICE_PASSWORD ?? get(kibanaConfig, SERVICE_PASSWORD); - - return { - ...kibanaCommonTestsConfig.getAll(), - - services: { - ...commonFunctionalServices, - ...commonFunctionalUIServices, - }, - - esTestCluster: { - ...xpackFunctionalTestsConfig.get('esTestCluster'), - serverArgs: [ - ...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'), - // define custom es server here - // API Keys is enabled at the top level - 'xpack.security.enabled=true', - 'xpack.ml.enabled=false', - ], - }, - - kbnTestServer: { - ...xpackFunctionalTestsConfig.get('kbnTestServer'), - sourceArgs: process.env.WATCH_ENABLED - ? [] - : [...xpackFunctionalTestsConfig.get('kbnTestServer.sourceArgs'), '--no-watch'], - serverArgs: [ - ...xpackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), - '--csp.strict=false', - '--home.disableWelcomeScreen=true', - '--csp.warnLegacyBrowsers=false', - // define custom kibana server args here - `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, - // `--elasticsearch.ignoreVersionMismatch=${process.env.CI ? 'false' : 'true'}`, - `--elasticsearch.username=kibana_system`, - `--elasticsearch.password=changeme`, - '--xpack.reporting.enabled=false', - `--xpack.uptime.service.manifestUrl=${manifestUrl}`, - `--xpack.uptime.service.username=${ - process.env.SYNTHETICS_REMOTE_ENABLED - ? serviceUsername - : 'localKibanaIntegrationTestsUser' - }`, - `--xpack.uptime.service.password=${servicePassword}`, - '--uiSettings.overrides.observability:enableLegacyUptimeApp=true', - ], - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default config; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/test_reporter.ts b/x-pack/plugins/observability_solution/synthetics/e2e/helpers/test_reporter.ts deleted file mode 100644 index 198a038ec027..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/test_reporter.ts +++ /dev/null @@ -1,229 +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 { Journey, Step } from '@elastic/synthetics/dist/dsl'; -import { Reporter, ReporterOptions } from '@elastic/synthetics'; -import { - JourneyEndResult, - JourneyStartResult, - StepEndResult, -} from '@elastic/synthetics/dist/common_types'; - -import { yellow, green, cyan, red, bold } from 'chalk'; - -// eslint-disable-next-line no-console -const log = console.log; - -import { performance } from 'perf_hooks'; -import * as fs from 'fs'; -import { gatherScreenshots } from '@elastic/synthetics/dist/reporters/json'; -import { CACHE_PATH } from '@elastic/synthetics/dist/helpers'; -import { join } from 'path'; - -function renderError(error: any) { - let output = ''; - const outer = indent(''); - const inner = indent(outer); - const container = outer + '---\n'; - output += container; - let stack = error.stack; - if (stack) { - output += inner + 'stack: |-\n'; - stack = rewriteErrorStack(stack, findPWLogsIndexes(stack)); - const lines = String(stack).split('\n'); - for (const line of lines) { - output += inner + ' ' + line + '\n'; - } - } - output += container; - return red(output); -} - -function renderDuration(durationMs: number) { - return Number(durationMs).toFixed(0); -} - -export class TestReporter implements Reporter { - metrics = { - succeeded: 0, - failed: 0, - skipped: 0, - }; - - journeys: Map<string, Array<StepEndResult & { name: string }>> = new Map(); - - constructor(options: ReporterOptions = {}) {} - - onJourneyStart(journey: Journey, {}: JourneyStartResult) { - if (process.env.CI) { - this.write(`\n--- Journey: ${journey.name}`); - } else { - this.write(bold(`\n Journey: ${journey.name}`)); - } - } - - onStepEnd(journey: Journey, step: Step, result: StepEndResult) { - const { status, end, start, error } = result; - const message = `${symbols[status]} Step: '${step.name}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - this.metrics[status]++; - if (!this.journeys.has(journey.name)) { - this.journeys.set(journey.name, []); - } - this.journeys.get(journey.name)?.push({ name: step.name, ...result }); - } - - async onJourneyEnd(journey: Journey, { error, start, end, status }: JourneyEndResult) { - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - if (total === 0 && error) { - this.write(renderError(error)); - } - const message = `${symbols[status]} Took (${renderDuration(end - start)} seconds)`; - this.write(message); - - await fs.promises.mkdir('.journeys/failed_steps', { recursive: true }); - - await gatherScreenshots(join(CACHE_PATH, 'screenshots'), async (screenshot) => { - const { data, step } = screenshot; - - if (status === 'failed') { - await (async () => { - await fs.promises.writeFile(join('.journeys/failed_steps/', `${step.name}.jpg`), data, { - encoding: 'base64', - }); - })(); - } - }); - } - - onEnd() { - const failedJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.some((step) => step.status === 'failed') - ); - - if (failedJourneys.length > 0) { - failedJourneys.forEach(([journeyName, steps]) => { - if (process.env.CI) { - const name = red(`Journey: ${journeyName} 🥵`); - this.write(`\n+++ ${name}`); - steps.forEach((stepResult) => { - const { status, end, start, error, name: stepName } = stepResult; - const message = `${symbols[status]} Step: '${stepName}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - }); - } - }); - } - - const successfulJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.every((step) => step.status === 'succeeded') - ); - - successfulJourneys.forEach(([journeyName, steps]) => { - try { - fs.unlinkSync('.journeys/videos/' + journeyName + '.webm'); - } catch (e) { - // eslint-disable-next-line no-console - console.log( - 'Failed to delete video file for path ' + '.journeys/videos/' + journeyName + '.webm' - ); - } - }); - - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - - let message = '\n'; - if (total === 0) { - message = 'No tests found!'; - message += ` (${renderDuration(now())} ms) \n`; - this.write(message); - return; - } - - message += succeeded > 0 ? green(` ${succeeded} passed`) : ''; - message += failed > 0 ? red(` ${failed} failed`) : ''; - message += skipped > 0 ? cyan(` ${skipped} skipped`) : ''; - message += ` (${renderDuration(now() / 1000)} seconds) \n`; - this.write(message); - } - - write(message: any) { - if (typeof message === 'object') { - message = JSON.stringify(message); - } - log(message + '\n'); - } -} - -const SEPARATOR = '\n'; - -function indent(lines: string, tab = ' ') { - return lines.replace(/^/gm, tab); -} - -const NO_UTF8_SUPPORT = process.platform === 'win32'; -const symbols = { - warning: yellow(NO_UTF8_SUPPORT ? '!' : '⚠'), - skipped: cyan('-'), - progress: cyan('>'), - succeeded: green(NO_UTF8_SUPPORT ? 'ok' : '✓'), - failed: red(NO_UTF8_SUPPORT ? 'x' : '✖'), -}; - -function now() { - return performance.now(); -} - -function findPWLogsIndexes(msgOrStack: string): [number, number] { - let startIndex = 0; - let endIndex = 0; - if (!msgOrStack) { - return [startIndex, endIndex]; - } - const lines = String(msgOrStack).split(SEPARATOR); - const logStart = /[=]{3,} logs [=]{3,}/; - const logEnd = /[=]{10,}/; - lines.forEach((line, index) => { - if (logStart.test(line)) { - startIndex = index; - } else if (logEnd.test(line)) { - endIndex = index; - } - }); - return [startIndex, endIndex]; -} - -function rewriteErrorStack(stack: string, indexes: [number, number]) { - const [start, end] = indexes; - /** - * Do not rewrite if its not a playwright error - */ - if (start === 0 && end === 0) { - return stack; - } - const linesToKeep = start + 3; - if (start > 0 && linesToKeep < end) { - const lines = stack.split(SEPARATOR); - return lines - .slice(0, linesToKeep) - .concat(...lines.slice(end)) - .join(SEPARATOR); - } - return stack; -} diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/index.ts b/x-pack/plugins/observability_solution/synthetics/e2e/index.ts deleted file mode 100644 index f0e9b5e8b760..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export { SyntheticsRunner } from './helpers/synthetics_runner'; -export { argv } from './helpers/parse_args_params'; -export { loginPageProvider } from './page_objects/login'; -export { utilsPageProvider } from './page_objects/utils'; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts b/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts deleted file mode 100644 index 3624c03c5f1f..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/synthetics_run.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { FtrConfigProviderContext } from '@kbn/test'; -import path from 'path'; -import { argv } from '../helpers/parse_args_params'; -import { SyntheticsRunner } from '../helpers/synthetics_runner'; - -const { headless, grep, bail: pauseOnError } = argv; - -async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { - const kibanaConfig = await readConfigFile(require.resolve('../config.ts')); - return { - ...kibanaConfig.getAll(), - testRunner: async ({ getService }: any) => { - const syntheticsRunner = new SyntheticsRunner(getService, { - headless, - match: grep, - pauseOnError, - }); - - await syntheticsRunner.setup(); - const fixturesDir = path.join(__dirname, '../fixtures/es_archiver/'); - - await syntheticsRunner.loadTestData(fixturesDir, [ - 'synthetics_data', - 'full_heartbeat', - 'browser', - ]); - - await syntheticsRunner.loadTestFiles(async () => { - require('./journeys'); - }); - - await syntheticsRunner.run(); - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default runE2ETests; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/tasks/es_archiver.ts b/x-pack/plugins/observability_solution/synthetics/e2e/tasks/es_archiver.ts deleted file mode 100644 index bbb66b19f5a5..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/tasks/es_archiver.ts +++ /dev/null @@ -1,37 +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 Path from 'path'; -import { execSync } from 'child_process'; - -const ES_ARCHIVE_DIR = './fixtures/es_archiver'; - -// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https -const NODE_TLS_REJECT_UNAUTHORIZED = '1'; - -export const esArchiverLoad = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../scripts/es_archiver load "${path}" --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverUnload = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../scripts/es_archiver unload "${path}" --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverResetKibana = () => { - execSync( - `node ../../../../scripts/es_archiver empty-kibana-index --config ../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json deleted file mode 100644 index 7584c000a76f..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/e2e/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "exclude": ["tmp", "target/**/*"], - "include": ["**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": ["node"], - "isolatedModules": false - }, - "kbn_references": [ - "@kbn/test", - "@kbn/dev-utils", - "@kbn/ux-plugin/e2e", - "@kbn/ftr-common-functional-services", - "@kbn/apm-plugin", - "@kbn/es-archiver", - "@kbn/synthetics-plugin", - "@kbn/repo-info", - "@kbn/observability-synthetics-test-data", - "@kbn/ftr-common-functional-ui-services" - ] -} diff --git a/x-pack/plugins/observability_solution/synthetics/jest.config.js b/x-pack/plugins/observability_solution/synthetics/jest.config.js deleted file mode 100644 index 1ae53b847be2..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/synthetics'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/observability_solution/synthetics', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/synthetics/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/query_monitor_status.ts b/x-pack/plugins/observability_solution/synthetics/server/queries/query_monitor_status.ts deleted file mode 100644 index 5ccb33fb491f..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/server/queries/query_monitor_status.ts +++ /dev/null @@ -1,300 +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 times from 'lodash/times'; -import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; -import { cloneDeep, intersection } from 'lodash'; -import { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; -import { MsearchMultisearchBody } from '@elastic/elasticsearch/lib/api/types'; - -import { isStatusEnabled } from '../../common/runtime_types/monitor_management/alert_config'; -import { FINAL_SUMMARY_FILTER } from '../../common/constants/client_defaults'; -import { - ConfigKey, - EncryptedSyntheticsMonitorAttributes, - OverviewPing, - OverviewStatus, - OverviewStatusMetaData, -} from '../../common/runtime_types'; -import { createEsParams, SyntheticsEsClient } from '../lib'; - -const DEFAULT_MAX_ES_BUCKET_SIZE = 10000; - -const fields = [ - '@timestamp', - 'summary', - 'monitor', - 'observer', - 'config_id', - 'error', - 'agent', - 'url', - 'state', - 'tags', -]; - -const getStatusQuery = ({ - idSize, - idsToQuery, - range, - monitorLocationIds, -}: { - idSize: number; - monitorLocationIds: string[]; - range: { from: string; to: string }; - idsToQuery: string[]; -}) => { - const params = createEsParams({ - body: { - size: 0, - query: { - bool: { - filter: [ - FINAL_SUMMARY_FILTER, - { - range: { - '@timestamp': { - gte: range.from, - lte: range.to, - }, - }, - }, - { - terms: { - 'monitor.id': idsToQuery, - }, - }, - ] as QueryDslQueryContainer[], - }, - }, - aggs: { - id: { - terms: { - field: 'monitor.id', - size: idSize, - }, - aggs: { - location: { - terms: { - field: 'observer.name', - size: monitorLocationIds.length || 100, - }, - aggs: { - status: { - top_hits: { - size: 1, - sort: [ - { - '@timestamp': { - order: 'desc', - }, - }, - ], - _source: { - includes: fields, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }); - - if (monitorLocationIds.length > 0) { - params.body.query?.bool?.filter.push({ - terms: { - 'observer.name': monitorLocationIds, - }, - }); - } - return params; -}; - -type StatusQueryParams = ReturnType<typeof getStatusQuery>; -type OverviewStatusResponse = Omit< - OverviewStatus, - | 'disabledCount' - | 'allMonitorsCount' - | 'disabledMonitorsCount' - | 'projectMonitorsCount' - | 'disabledMonitorQueryIds' - | 'allIds' ->; - -export async function queryMonitorStatus({ - esClient, - monitorLocationIds, - range, - monitorQueryIds, - monitorLocationsMap, - monitorQueryIdToConfigIdMap, - monitors, -}: { - esClient: SyntheticsEsClient; - monitorLocationIds: string[]; - range: { from: string; to: string }; - monitorQueryIds: string[]; - monitorLocationsMap: Record<string, string[]>; - monitorQueryIdToConfigIdMap: Record<string, string>; - monitors: Array<SavedObjectsFindResult<EncryptedSyntheticsMonitorAttributes>>; -}): Promise<OverviewStatusResponse> { - const idSize = Math.trunc(DEFAULT_MAX_ES_BUCKET_SIZE / monitorLocationIds.length || 1); - const pageCount = Math.ceil(monitorQueryIds.length / idSize); - let up = 0; - let down = 0; - const upConfigs: Record<string, OverviewStatusMetaData> = {}; - const downConfigs: Record<string, OverviewStatusMetaData> = {}; - const monitorsWithoutData = new Map(Object.entries(cloneDeep(monitorLocationsMap))); - const pendingConfigs: Record<string, OverviewStatusMetaData> = {}; - const disabledConfigs: Record<string, OverviewStatusMetaData> = {}; - - monitors - .filter((monitor) => !monitor.attributes[ConfigKey.ENABLED]) - .forEach((monitor) => { - const monitorQueryId = monitor.attributes[ConfigKey.MONITOR_QUERY_ID]; - monitor.attributes[ConfigKey.LOCATIONS]?.forEach((location) => { - disabledConfigs[`${monitorQueryIdToConfigIdMap[monitorQueryId]}-${location.id}`] = { - configId: `${monitorQueryIdToConfigIdMap[monitorQueryId]}`, - monitorQueryId, - status: 'disabled', - locationId: location.id, - locationLabel: location.label, - ...getMonitorMeta(monitor), - }; - }); - }); - - const queries: MsearchMultisearchBody[] = times(pageCount).map((i) => { - const idsToQuery = (monitorQueryIds as string[]).slice(i * idSize, i * idSize + idSize); - return getStatusQuery({ - idSize, - monitorLocationIds, - range, - idsToQuery, - }).body; - }); - - if (queries.length) { - const { responses } = await esClient.msearch<StatusQueryParams, OverviewPing>( - queries, - 'getCurrentStatusOverview' - ); - - responses.forEach((result) => { - result.aggregations?.id.buckets.forEach(({ location, key: queryId }) => { - const locationSummaries = location.buckets.map(({ status, key: locationName }) => { - const ping = status.hits.hits[0]._source; - return { location: locationName, ping }; - }); - - const monitor = monitors.find((m) => m.attributes[ConfigKey.MONITOR_QUERY_ID] === queryId)!; - - // discard any locations that are not in the monitorLocationsMap for the given monitor as well as those which are - // in monitorLocationsMap but not in listOfLocations - const monLocations = monitorLocationsMap?.[queryId]; - const monQueriedLocations = intersection(monLocations, monitorLocationIds); - monQueriedLocations?.forEach((monLocation) => { - const locationSummary = locationSummaries.find( - (summary) => summary.location === monLocation - ); - - if (locationSummary) { - const { ping } = locationSummary; - const downCount = ping.summary?.down ?? 0; - const upCount = ping.summary?.up ?? 0; - const configId = ping.config_id; - const monitorQueryId = ping.monitor.id; - - const meta = { - ping, - configId, - monitorQueryId, - locationId: monLocation, - timestamp: ping['@timestamp'], - locationLabel: ping.observer.geo!.name!, - ...getMonitorMeta(monitor), - }; - - if (downCount > 0) { - down += 1; - downConfigs[`${configId}-${monLocation}`] = { - ...meta, - status: 'down', - }; - } else if (upCount > 0) { - up += 1; - upConfigs[`${configId}-${monLocation}`] = { - ...meta, - status: 'up', - }; - } - const monitorsMissingData = monitorsWithoutData.get(monitorQueryId) || []; - monitorsWithoutData.set( - monitorQueryId, - monitorsMissingData?.filter((loc) => loc !== monLocation) - ); - if (!monitorsWithoutData.get(monitorQueryId)?.length) { - monitorsWithoutData.delete(monitorQueryId); - } - } - }); - }); - }); - } - - // identify the remaining monitors without data, to determine pending monitors - for (const [queryId, locs] of monitorsWithoutData) { - const monitor = monitors.find((m) => m.attributes[ConfigKey.MONITOR_QUERY_ID] === queryId)!; - locs.forEach((loc) => { - pendingConfigs[`${monitorQueryIdToConfigIdMap[queryId]}-${loc}`] = { - configId: `${monitorQueryIdToConfigIdMap[queryId]}`, - monitorQueryId: queryId, - status: 'unknown', - locationId: loc, - locationLabel: monitor.attributes[ConfigKey.LOCATIONS]?.find( - (location) => location.id === loc - )?.label!, - name: monitor.attributes[ConfigKey.NAME], - schedule: monitor.attributes[ConfigKey.SCHEDULE].number, - tags: monitor.attributes[ConfigKey.TAGS], - isEnabled: monitor.attributes[ConfigKey.ENABLED], - type: monitor.attributes[ConfigKey.MONITOR_TYPE], - projectId: monitor.attributes[ConfigKey.PROJECT_ID], - isStatusAlertEnabled: isStatusEnabled(monitor.attributes[ConfigKey.ALERT_CONFIG]), - updated_at: monitor.updated_at, - }; - }); - } - - return { - up, - down, - pending: Object.values(pendingConfigs).length, - upConfigs, - downConfigs, - pendingConfigs, - enabledMonitorQueryIds: monitorQueryIds, - disabledConfigs, - }; -} - -const getMonitorMeta = (monitor: SavedObjectsFindResult<EncryptedSyntheticsMonitorAttributes>) => { - return { - name: monitor.attributes[ConfigKey.NAME], - schedule: monitor.attributes[ConfigKey.SCHEDULE].number, - tags: monitor.attributes[ConfigKey.TAGS], - isEnabled: monitor.attributes[ConfigKey.ENABLED], - type: monitor.attributes[ConfigKey.MONITOR_TYPE], - projectId: monitor.attributes[ConfigKey.PROJECT_ID], - isStatusAlertEnabled: isStatusEnabled(monitor.attributes[ConfigKey.ALERT_CONFIG]), - updated_at: monitor.updated_at, - spaceId: monitor.namespaces?.[0], - }; -}; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.test.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.test.ts deleted file mode 100644 index a3ddc0079d46..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.test.ts +++ /dev/null @@ -1,1291 +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 { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; -import { savedObjectsClientMock } from '@kbn/core-saved-objects-api-server-mocks'; -import { periodToMs } from './overview_status'; -import { queryMonitorStatus } from '../../queries/query_monitor_status'; -import { getStatus } from './overview_status'; -import times from 'lodash/times'; -import * as monitorsFns from '../../saved_objects/synthetics_monitor/get_all_monitors'; -import { EncryptedSyntheticsMonitorAttributes } from '../../../common/runtime_types'; -import { RouteContext } from '../types'; -import { getUptimeESMockClient } from '../../queries/test_helpers'; - -import * as commonLibs from '../common'; -import { SyntheticsServerSetup } from '../../types'; -import { mockEncryptedSO } from '../../synthetics_service/utils/mocks'; -import { savedObjectsServiceMock } from '@kbn/core-saved-objects-server-mocks'; -import { loggerMock } from '@kbn/logging-mocks'; -import * as allLocationsFn from '../../synthetics_service/get_all_locations'; -const allLocations: any = [ - { - id: 'us_central_qa', - label: 'US Central QA', - }, - { - id: 'us_central', - label: 'North America - US Central', - }, -]; -jest.spyOn(allLocationsFn, 'getAllLocations').mockResolvedValue({ - publicLocations: allLocations, - privateLocations: [], - allLocations, -}); - -jest.mock('../../saved_objects/synthetics_monitor/get_all_monitors', () => ({ - ...jest.requireActual('../../saved_objects/synthetics_monitor/get_all_monitors'), - getAllMonitors: jest.fn(), -})); - -jest.spyOn(commonLibs, 'getMonitors').mockResolvedValue({ - per_page: 10, - saved_objects: [ - { - id: 'mon-1', - attributes: { - enabled: false, - locations: [{ id: 'us-east1' }, { id: 'us-west1' }, { id: 'japan' }], - }, - }, - { - id: 'mon-2', - attributes: { - enabled: true, - locations: [{ id: 'us-east1' }, { id: 'us-west1' }, { id: 'japan' }], - schedule: { - number: '10', - unit: 'm', - }, - }, - }, - ], -} as any); - -describe('current status route', () => { - const logger = loggerMock.create(); - - const serverMock: SyntheticsServerSetup = { - logger, - config: { - service: { - username: 'dev', - password: '12345', - manifestUrl: 'http://localhost:8080/api/manifest', - }, - }, - spaces: { - spacesService: { - getSpaceId: jest.fn().mockReturnValue('test-space'), - }, - }, - encryptedSavedObjects: mockEncryptedSO(), - coreStart: { - savedObjects: savedObjectsServiceMock.createStartContract(), - }, - } as unknown as SyntheticsServerSetup; - - describe('periodToMs', () => { - it('returns 0 for unsupported unit type', () => { - // @ts-expect-error Providing invalid value to test handler in function - expect(periodToMs({ number: '10', unit: 'rad' })).toEqual(0); - }); - it('converts seconds', () => { - expect(periodToMs({ number: '10', unit: 's' })).toEqual(10_000); - }); - it('converts minutes', () => { - expect(periodToMs({ number: '1', unit: 'm' })).toEqual(60_000); - }); - it('converts hours', () => { - expect(periodToMs({ number: '1', unit: 'h' })).toEqual(3_600_000); - }); - }); - - const testMonitors = [ - { - attributes: { - id: 'id1', - type: 'browser', - enabled: true, - name: 'test monitor 1', - project_id: 'project-id', - tags: ['tag-1', 'tag-2'], - schedule: { - number: '1', - unit: 'm', - }, - }, - }, - { - attributes: { - id: 'id2', - enabled: true, - type: 'browser', - name: 'test monitor 2', - project_id: 'project-id', - tags: ['tag-1', 'tag-2'], - schedule: { - number: '1', - unit: 'm', - }, - }, - }, - ]; - - describe('queryMonitorStatus', () => { - it('parses expected agg fields', async () => { - const { esClient, syntheticsEsClient } = getUptimeESMockClient(); - esClient.msearch.mockResponseOnce({ - responses: [ - getEsResponse([ - { - key: 'id1', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:08:16.724Z', - monitor: { - status: 'up', - id: 'id1', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id1', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - { - key: 'id2', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:09:16.724Z', - monitor: { - status: 'up', - id: 'id2', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - { - key: 'Europe - Germany', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:19:16.724Z', - monitor: { - status: 'down', - id: 'id2', - }, - summary: { - down: 1, - up: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Europe - Germany', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - ]), - ], - took: 605, - }); - expect( - await queryMonitorStatus({ - esClient: syntheticsEsClient, - monitorLocationIds: ['Europe - Germany', 'Asia/Pacific - Japan'], - range: { from: 'now-1d', to: 'now' }, - monitorQueryIds: ['id1', 'id2'], - monitorLocationsMap: { - id1: ['Asia/Pacific - Japan'], - id2: ['Europe - Germany', 'Asia/Pacific - Japan'], - }, - monitorQueryIdToConfigIdMap: { - id1: 'id1', - id2: 'id2', - }, - monitors: testMonitors as any, - }) - ).toMatchInlineSnapshot(` - Object { - "disabledConfigs": Object {}, - "down": 1, - "downConfigs": Object { - "id2-Europe - Germany": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Europe - Germany", - "locationLabel": "Europe - Germany", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:19:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "down", - }, - "observer": Object { - "geo": Object { - "name": "Europe - Germany", - }, - }, - "summary": Object { - "down": 1, - "up": 0, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "down", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:19:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - "enabledMonitorQueryIds": Array [ - "id1", - "id2", - ], - "pending": 0, - "pendingConfigs": Object {}, - "up": 2, - "upConfigs": Object { - "id1-Asia/Pacific - Japan": Object { - "configId": "id1", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id1", - "name": "test monitor 1", - "ping": Object { - "@timestamp": "2022-09-15T16:08:16.724Z", - "config_id": "id1", - "monitor": Object { - "id": "id1", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:08:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - "id2-Asia/Pacific - Japan": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:09:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:09:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - } - `); - }); - - it('handles limits with multiple requests', async () => { - const { esClient, syntheticsEsClient } = getUptimeESMockClient(); - esClient.msearch.mockResponseOnce({ - responses: [ - getEsResponse([ - { - key: 'id1', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:08:16.724Z', - monitor: { - status: 'up', - id: 'id1', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id1', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - { - key: 'id2', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:09:16.724Z', - monitor: { - status: 'up', - id: 'id2', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - { - key: 'Europe - Germany', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:19:16.724Z', - monitor: { - status: 'down', - id: 'id2', - }, - summary: { - up: 0, - down: 1, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Europe - Germany', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - ]), - ], - took: 605, - }); - - /** - * By passing the function a location count of 10k, it forces the query to paginate once, - * so we are able to test that the function properly iterates through a "large" list of IDs/locations. - * - * The expectation here is we will send the test client two separate "requests", one for each of the two IDs. - */ - const concernedLocations = [ - 'Asia/Pacific - Japan', - 'Europe - Germany', - 'Asia/Pacific - Japan', - ]; - expect( - await queryMonitorStatus({ - esClient: syntheticsEsClient, - monitorLocationIds: [ - ...concernedLocations, - ...times(9997).map((n) => 'Europe - Germany' + n), - ], - - range: { from: 'now-24h', to: 'now' }, - monitorQueryIds: ['id1', 'id2'], - monitorLocationsMap: { - id1: [concernedLocations[0]], - id2: [concernedLocations[1], concernedLocations[2]], - }, - monitorQueryIdToConfigIdMap: { - id1: 'id1', - id2: 'id2', - }, - monitors: testMonitors as any, - }) - ).toMatchInlineSnapshot(` - Object { - "disabledConfigs": Object {}, - "down": 1, - "downConfigs": Object { - "id2-Europe - Germany": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Europe - Germany", - "locationLabel": "Europe - Germany", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:19:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "down", - }, - "observer": Object { - "geo": Object { - "name": "Europe - Germany", - }, - }, - "summary": Object { - "down": 1, - "up": 0, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "down", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:19:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - "enabledMonitorQueryIds": Array [ - "id1", - "id2", - ], - "pending": 0, - "pendingConfigs": Object {}, - "up": 2, - "upConfigs": Object { - "id1-Asia/Pacific - Japan": Object { - "configId": "id1", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id1", - "name": "test monitor 1", - "ping": Object { - "@timestamp": "2022-09-15T16:08:16.724Z", - "config_id": "id1", - "monitor": Object { - "id": "id1", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:08:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - "id2-Asia/Pacific - Japan": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:09:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:09:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - } - `); - expect(esClient.msearch).toHaveBeenCalledTimes(1); - // These assertions are to ensure that we are paginating through the IDs we use for filtering - expect( - // @ts-expect-error mock search is not lining up with expected type - esClient.msearch.mock.calls[0][0].searches[1].query.bool.filter[2].terms['monitor.id'] - ).toEqual(['id1']); - expect( - // @ts-expect-error mock search is not lining up with expected type - esClient.msearch.mock.calls[0][0].searches[3].query.bool.filter[2].terms['monitor.id'] - ).toEqual(['id2']); - }); - - it('handles pending configs', async () => { - const { esClient, syntheticsEsClient } = getUptimeESMockClient(); - esClient.msearch.mockResponseOnce({ - responses: [ - getEsResponse([ - { - key: 'id1', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:08:16.724Z', - monitor: { - status: 'up', - id: 'id1', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id1', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - { - key: 'id2', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:09:16.724Z', - monitor: { - status: 'up', - id: 'id2', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - { - key: 'Europe - Germany', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:19:16.724Z', - monitor: { - status: 'down', - id: 'id2', - }, - summary: { - down: 1, - up: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Europe - Germany', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - ]), - ], - took: 605, - }); - expect( - await queryMonitorStatus({ - esClient: syntheticsEsClient, - monitorLocationIds: ['Europe - Germany', 'Asia/Pacific - Japan'], - range: { from: 'now-12h', to: 'now' }, - monitorQueryIds: ['id1', 'id2', 'project-monitor-id', 'id4'], - monitorLocationsMap: { - id1: ['Asia/Pacific - Japan'], - id2: ['Europe - Germany', 'Asia/Pacific - Japan'], - 'project-monitor-id': ['Europe - Germany', 'Asia/Pacific - Japan'], - id4: ['Europe - Germany', 'Asia/Pacific - Japan'], - }, - monitorQueryIdToConfigIdMap: { - id1: 'id1', - id2: 'id2', - 'project-monitor-id': 'id3', - id4: 'id4', - }, - monitors: [ - ...testMonitors, - { - attributes: { - id: 'id4', - enabled: true, - type: 'browser', - name: 'test monitor 4', - project_id: 'project-id', - tags: ['tag-1', 'tag-2'], - schedule: { - number: '1', - unit: 'm', - }, - }, - }, - { - attributes: { - id: 'project-monitor-id', - enabled: true, - type: 'browser', - name: 'test monitor 3', - project_id: 'project-id', - tags: ['tag-1', 'tag-2'], - schedule: { - number: '1', - unit: 'm', - }, - }, - }, - ] as any, - }) - ).toMatchInlineSnapshot(` - Object { - "disabledConfigs": Object {}, - "down": 1, - "downConfigs": Object { - "id2-Europe - Germany": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Europe - Germany", - "locationLabel": "Europe - Germany", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:19:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "down", - }, - "observer": Object { - "geo": Object { - "name": "Europe - Germany", - }, - }, - "summary": Object { - "down": 1, - "up": 0, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "down", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:19:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - "enabledMonitorQueryIds": Array [ - "id1", - "id2", - "project-monitor-id", - "id4", - ], - "pending": 4, - "pendingConfigs": Object { - "id3-Asia/Pacific - Japan": Object { - "configId": "id3", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": undefined, - "monitorQueryId": "project-monitor-id", - "name": "test monitor 3", - "projectId": "project-id", - "schedule": "1", - "status": "unknown", - "tags": Array [ - "tag-1", - "tag-2", - ], - "type": "browser", - "updated_at": undefined, - }, - "id3-Europe - Germany": Object { - "configId": "id3", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Europe - Germany", - "locationLabel": undefined, - "monitorQueryId": "project-monitor-id", - "name": "test monitor 3", - "projectId": "project-id", - "schedule": "1", - "status": "unknown", - "tags": Array [ - "tag-1", - "tag-2", - ], - "type": "browser", - "updated_at": undefined, - }, - "id4-Asia/Pacific - Japan": Object { - "configId": "id4", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": undefined, - "monitorQueryId": "id4", - "name": "test monitor 4", - "projectId": "project-id", - "schedule": "1", - "status": "unknown", - "tags": Array [ - "tag-1", - "tag-2", - ], - "type": "browser", - "updated_at": undefined, - }, - "id4-Europe - Germany": Object { - "configId": "id4", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Europe - Germany", - "locationLabel": undefined, - "monitorQueryId": "id4", - "name": "test monitor 4", - "projectId": "project-id", - "schedule": "1", - "status": "unknown", - "tags": Array [ - "tag-1", - "tag-2", - ], - "type": "browser", - "updated_at": undefined, - }, - }, - "up": 2, - "upConfigs": Object { - "id1-Asia/Pacific - Japan": Object { - "configId": "id1", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id1", - "name": "test monitor 1", - "ping": Object { - "@timestamp": "2022-09-15T16:08:16.724Z", - "config_id": "id1", - "monitor": Object { - "id": "id1", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:08:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - "id2-Asia/Pacific - Japan": Object { - "configId": "id2", - "isEnabled": true, - "isStatusAlertEnabled": false, - "locationId": "Asia/Pacific - Japan", - "locationLabel": "Asia/Pacific - Japan", - "monitorQueryId": "id2", - "name": "test monitor 2", - "ping": Object { - "@timestamp": "2022-09-15T16:09:16.724Z", - "config_id": "id2", - "monitor": Object { - "id": "id2", - "status": "up", - }, - "observer": Object { - "geo": Object { - "name": "Asia/Pacific - Japan", - }, - }, - "summary": Object { - "down": 0, - "up": 1, - }, - }, - "projectId": "project-id", - "schedule": "1", - "spaceId": undefined, - "status": "up", - "tags": Array [ - "tag-1", - "tag-2", - ], - "timestamp": "2022-09-15T16:09:16.724Z", - "type": "browser", - "updated_at": undefined, - }, - }, - } - `); - }); - }); - - describe('getStatus', () => { - it.each([ - [['US Central QA'], 1], - [['North America - US Central'], 1], - [['North America - US Central', 'US Central QA'], 2], - [undefined, 2], - ])('handles disabled count when using location filters', async (locations, disabledCount) => { - jest.spyOn(monitorsFns, 'getAllMonitors').mockResolvedValue([ - { - type: 'synthetics-monitor', - id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', - attributes: { - enabled: false, - schedule: { - number: '3', - unit: 'm', - }, - config_id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', - locations: [ - { - color: 'default', - isServiceManaged: true, - label: 'US Central QA', - id: 'us_central_qa', - }, - { - isServiceManaged: true, - label: 'North America - US Central', - id: 'us_central', - }, - ], - origin: 'project', - id: 'a-test2-default', - }, - references: [], - migrationVersion: { - 'synthetics-monitor': '8.6.0', - }, - coreMigrationVersion: '8.0.0', - updated_at: '2023-02-28T14:31:37.641Z', - created_at: '2023-02-28T14:31:37.641Z', - version: 'Wzg0MzkzLDVd', - namespaces: ['default'], - score: null, - sort: ['a', 3013], - } as unknown as SavedObjectsFindResult<EncryptedSyntheticsMonitorAttributes>, - ]); - const { esClient, syntheticsEsClient } = getUptimeESMockClient(); - esClient.msearch.mockResponseOnce({ - responses: [ - getEsResponse([ - { - key: 'id1', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:08:16.724Z', - monitor: { - status: 'up', - id: 'id1', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id1', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - { - key: 'id2', - location: { - buckets: [ - { - key: 'Asia/Pacific - Japan', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:09:16.724Z', - monitor: { - status: 'up', - id: 'id2', - }, - summary: { - up: 1, - down: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Asia/Pacific - Japan', - }, - }, - }, - }, - ], - }, - }, - }, - { - key: 'Europe - Germany', - status: { - hits: { - hits: [ - { - _source: { - '@timestamp': '2022-09-15T16:19:16.724Z', - monitor: { - status: 'down', - id: 'id2', - }, - summary: { - down: 1, - up: 0, - }, - config_id: 'id2', - observer: { - geo: { - name: 'Europe - Germany', - }, - }, - }, - }, - ], - }, - }, - }, - ], - }, - }, - ]), - ], - took: 605, - }); - const result = await getStatus( - { - syntheticsEsClient, - savedObjectsClient: savedObjectsClientMock.create(), - server: serverMock, - } as unknown as RouteContext, - { - locations, - } - ); - expect(result).toEqual( - expect.objectContaining({ - disabledCount, - }) - ); - }); - - it.each([ - [['US Central QA'], 1], - [['North America - US Central'], 1], - [['North America - US Central', 'US Central QA'], 2], - [undefined, 2], - ])('handles pending count when using location filters', async (locations, pending) => { - jest.spyOn(monitorsFns, 'getAllMonitors').mockResolvedValue([ - { - type: 'synthetics-monitor', - id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', - attributes: { - enabled: true, - schedule: { - number: '3', - unit: 'm', - }, - config_id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', - locations: [ - { - color: 'default', - isServiceManaged: true, - label: 'US Central QA', - id: 'us_central_qa', - }, - { - isServiceManaged: true, - label: 'North America - US Central', - id: 'us_central', - }, - ], - origin: 'project', - id: 'a-test2-default', - }, - references: [], - migrationVersion: { - 'synthetics-monitor': '8.6.0', - }, - coreMigrationVersion: '8.0.0', - updated_at: '2023-02-28T14:31:37.641Z', - created_at: '2023-02-28T14:31:37.641Z', - version: 'Wzg0MzkzLDVd', - namespaces: ['default'], - score: null, - sort: ['a', 3013], - } as unknown as SavedObjectsFindResult<EncryptedSyntheticsMonitorAttributes>, - ]); - const { esClient, syntheticsEsClient } = getUptimeESMockClient(); - esClient.msearch.mockResponseOnce({ responses: [getEsResponse([])], took: 605 }); - expect( - await getStatus( - { - syntheticsEsClient, - savedObjectsClient: savedObjectsClientMock.create(), - } as unknown as RouteContext, - { - locations, - } - ) - ).toEqual( - expect.objectContaining({ - pending, - }) - ); - }); - }); -}); - -function getEsResponse(buckets: any[]) { - return { - took: 605, - timed_out: false, - _shards: { - total: 3, - successful: 3, - skipped: 0, - failed: 0, - }, - hits: { - hits: [], - }, - aggregations: { - id: { - buckets, - }, - }, - }; -} diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.ts deleted file mode 100644 index 8fa52f98592c..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_status/overview_status.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 { intersection } from 'lodash'; -import datemath, { Unit } from '@kbn/datemath'; -import moment from 'moment'; -import { RouteContext, SyntheticsRestApiRouteFactory } from '../types'; -import { ConfigKey, OverviewStatusState } from '../../../common/runtime_types'; -import { - getAllMonitors, - processMonitors, -} from '../../saved_objects/synthetics_monitor/get_all_monitors'; -import { queryMonitorStatus } from '../../queries/query_monitor_status'; -import { SYNTHETICS_API_URLS } from '../../../common/constants'; -import { getMonitorFilters, OverviewStatusSchema, OverviewStatusQuery } from '../common'; - -/** - * Helper function that converts a monitor's schedule to a value to use to generate - * an appropriate look-back window for snapshot count. - * @param schedule a number/unit pair that represents how often a configured monitor runs - * @returns schedule interval in ms - */ -export function periodToMs(schedule: { number: string; unit: Unit }) { - if (Object.keys(datemath.unitsMap).indexOf(schedule.unit) === -1) return 0; - - return parseInt(schedule.number, 10) * datemath.unitsMap[schedule.unit].base; -} - -/** - * Multi-stage function that first queries all the user's saved object monitor configs. - * - * Subsequently, fetch the status for each monitor per location in the data streams. - * @returns The counts of up/down/disabled monitor by location, and a map of each monitor:location status. - */ -export async function getStatus(context: RouteContext, params: OverviewStatusQuery) { - const { syntheticsEsClient, savedObjectsClient } = context; - - const { query, scopeStatusByLocation = true, showFromAllSpaces } = params; - - /** - * Walk through all monitor saved objects, bucket IDs by disabled/enabled status. - * - * Track max period to make sure the snapshot query should reach back far enough to catch - * latest ping for all enabled monitors. - */ - - const { filtersStr, locationFilter: queryLocations } = await getMonitorFilters({ - ...params, - context, - }); - - const allMonitors = await getAllMonitors({ - soClient: savedObjectsClient, - showFromAllSpaces, - search: query ? `${query}*` : undefined, - filter: filtersStr, - fields: [ - ConfigKey.ENABLED, - ConfigKey.LOCATIONS, - ConfigKey.MONITOR_QUERY_ID, - ConfigKey.CONFIG_ID, - ConfigKey.SCHEDULE, - ConfigKey.MONITOR_SOURCE_TYPE, - ConfigKey.MONITOR_TYPE, - ConfigKey.NAME, - ConfigKey.TAGS, - ConfigKey.PROJECT_ID, - ConfigKey.ALERT_CONFIG, - ], - }); - - const { - enabledMonitorQueryIds, - disabledMonitorQueryIds, - allIds, - disabledCount, - maxPeriod, - monitorLocationIds, - monitorLocationsMap, - disabledMonitorsCount, - projectMonitorsCount, - monitorQueryIdToConfigIdMap, - } = processMonitors(allMonitors, queryLocations); - - // Account for locations filter - const listOfLocationAfterFilter = - queryLocations && scopeStatusByLocation - ? intersection(monitorLocationIds, queryLocations) - : monitorLocationIds; - - const range = { - from: moment().subtract(maxPeriod, 'milliseconds').subtract(20, 'minutes').toISOString(), - to: 'now', - }; - - const { up, down, pending, upConfigs, downConfigs, pendingConfigs, disabledConfigs } = - await queryMonitorStatus({ - range, - monitors: allMonitors, - monitorLocationsMap, - monitorQueryIdToConfigIdMap, - esClient: syntheticsEsClient, - monitorLocationIds: listOfLocationAfterFilter, - monitorQueryIds: enabledMonitorQueryIds, - }); - - return { - allIds, - allMonitorsCount: allMonitors.length, - disabledMonitorsCount, - projectMonitorsCount, - enabledMonitorQueryIds, - disabledMonitorQueryIds, - disabledCount, - up, - down, - pending, - upConfigs, - downConfigs, - pendingConfigs, - disabledConfigs, - }; -} - -export const createGetCurrentStatusRoute: SyntheticsRestApiRouteFactory = () => ({ - method: 'GET', - path: SYNTHETICS_API_URLS.OVERVIEW_STATUS, - validate: { - query: OverviewStatusSchema, - }, - handler: async (routeContext): Promise<OverviewStatusState> => { - const { request } = routeContext; - - const params = request.query as OverviewStatusQuery; - return await getStatus(routeContext, params); - }, -}); diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_route_wrapper.ts b/x-pack/plugins/observability_solution/synthetics/server/synthetics_route_wrapper.ts deleted file mode 100644 index da3887ac94d5..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_route_wrapper.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; -import { isEmpty } from 'lodash'; -import { isKibanaResponse } from '@kbn/core-http-server'; -import { isTestUser, SyntheticsEsClient } from './lib'; -import { checkIndicesReadPrivileges } from './synthetics_service/authentication/check_has_privilege'; -import { SYNTHETICS_INDEX_PATTERN } from '../common/constants'; -import { syntheticsServiceApiKey } from './saved_objects/service_api_key'; -import { SyntheticsRouteWrapper } from './routes/types'; - -export const syntheticsRouteWrapper: SyntheticsRouteWrapper = ( - uptimeRoute, - server, - syntheticsMonitorClient -) => ({ - ...uptimeRoute, - options: { - ...(uptimeRoute.options ?? {}), - }, - security: { - authz: { - requiredPrivileges: [ - 'uptime-read', - ...(uptimeRoute.requiredPrivileges ?? []), - ...(uptimeRoute?.writeAccess ? ['uptime-write'] : []), - ], - }, - }, - handler: async (context, request, response) => { - const { elasticsearch, savedObjects, uiSettings } = await context.core; - - const { client: esClient } = elasticsearch; - const savedObjectsClient = savedObjects.getClient({ - includedHiddenTypes: [syntheticsServiceApiKey.name], - }); - - // specifically needed for the synthetics service api key generation - server.authSavedObjectsClient = savedObjectsClient; - - const syntheticsEsClient = new SyntheticsEsClient(savedObjectsClient, esClient.asCurrentUser, { - request, - uiSettings, - isDev: Boolean(server.isDev) && !isTestUser(server), - heartbeatIndices: SYNTHETICS_INDEX_PATTERN, - }); - - server.syntheticsEsClient = syntheticsEsClient; - - const spaceId = server.spaces?.spacesService.getSpaceId(request) ?? DEFAULT_SPACE_ID; - - try { - const res = await uptimeRoute.handler({ - syntheticsEsClient, - savedObjectsClient, - context, - request, - response, - server, - spaceId, - syntheticsMonitorClient, - }); - if (isKibanaResponse(res)) { - return res; - } - - const inspectData = await syntheticsEsClient.getInspectData(uptimeRoute.path); - - if (Array.isArray(res)) { - if (isEmpty(inspectData)) { - return response.ok({ - body: res, - }); - } else { - return response.ok({ - body: { - result: res, - ...inspectData, - }, - }); - } - } - - return response.ok({ - body: { - ...res, - ...(await syntheticsEsClient.getInspectData(uptimeRoute.path)), - }, - }); - } catch (e) { - if (e.statusCode === 403) { - const privileges = await checkIndicesReadPrivileges(syntheticsEsClient); - if (!privileges.has_all_requested) { - return response.forbidden({ - body: { - message: - 'MissingIndicesPrivileges: You do not have permission to read from the synthetics-* indices. Please contact your administrator.', - }, - }); - } - } - server.logger.error(e); - throw e; - } - }, -}); diff --git a/x-pack/plugins/observability_solution/synthetics/tsconfig.json b/x-pack/plugins/observability_solution/synthetics/tsconfig.json deleted file mode 100644 index c82f6a5c3036..000000000000 --- a/x-pack/plugins/observability_solution/synthetics/tsconfig.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "__mocks__/**/*", - "common/**/*", - "scripts/**/*", - "public/**/*", - "server/**/*", - "../../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/alerting-plugin", - "@kbn/ml-plugin", - "@kbn/triggers-actions-ui-plugin", - "@kbn/observability-plugin", - "@kbn/fleet-plugin", - "@kbn/unified-search-plugin", - "@kbn/i18n", - "@kbn/core", - "@kbn/config-schema", - "@kbn/server-http-tools", - "@kbn/datemath", - "@kbn/share-plugin", - "@kbn/discover-plugin", - "@kbn/home-plugin", - "@kbn/embeddable-plugin", - "@kbn/data-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/inspector-plugin", - "@kbn/cases-plugin", - "@kbn/cloud-plugin", - "@kbn/data-views-plugin", - "@kbn/spaces-plugin", - "@kbn/core-doc-links-browser", - "@kbn/usage-collection-plugin", - "@kbn/kibana-react-plugin", - "@kbn/i18n-react", - "@kbn/securitysolution-io-ts-utils", - "@kbn/es-query", - "@kbn/stack-connectors-plugin", - "@kbn/rule-data-utils", - "@kbn/core-http-browser", - "@kbn/core-notifications-browser", - "@kbn/rison", - "@kbn/licensing-plugin", - "@kbn/rule-registry-plugin", - "@kbn/encrypted-saved-objects-plugin", - "@kbn/security-plugin", - "@kbn/logging-mocks", - "@kbn/task-manager-plugin", - "@kbn/es-types", - "@kbn/core-http-server-mocks", - "@kbn/utility-types", - "@kbn/telemetry-plugin", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/core-saved-objects-api-server", - "@kbn/core-saved-objects-common", - "@kbn/features-plugin", - "@kbn/bfetch-plugin", - "@kbn/actions-plugin", - "@kbn/core-elasticsearch-server", - "@kbn/core-saved-objects-api-server-mocks", - "@kbn/core-saved-objects-server", - "@kbn/shared-ux-prompt-not-found", - "@kbn/logging", - "@kbn/shared-ux-router", - "@kbn/alerts-as-data-utils", - "@kbn/exploratory-view-plugin", - "@kbn/observability-shared-plugin", - "@kbn/core-http-server", - "@kbn/std", - "@kbn/core-saved-objects-server-mocks", - "@kbn/shared-ux-page-kibana-template", - "@kbn/observability-ai-assistant-plugin", - "@kbn/unified-doc-viewer-plugin", - "@kbn/code-editor", - "@kbn/code-editor-mock", - "@kbn/securitysolution-io-ts-types", - "@kbn/shared-ux-link-redirect-app", - "@kbn/serverless", - "@kbn/repo-info", - "@kbn/index-management-plugin", - "@kbn/license-management-plugin", - "@kbn/react-kibana-mount", - "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme", - "@kbn/search-types", - "@kbn/core-lifecycle-browser", - "@kbn/ui-actions-browser", - "@kbn/presentation-publishing", - "@kbn/presentation-containers", - "@kbn/ui-actions-plugin", - "@kbn/presentation-util-plugin", - "@kbn/core-application-browser", - "@kbn/dashboard-plugin", - "@kbn/search-types", - "@kbn/slo-schema", - "@kbn/alerting-types", - "@kbn/babel-register", - "@kbn/slo-plugin", - "@kbn/ebt-tools", - "@kbn/alerting-types", - "@kbn/core-chrome-browser", - "@kbn/core-rendering-browser", - "@kbn/index-lifecycle-management-common-shared", - "@kbn/core-http-server-utils" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh deleted file mode 100755 index 58c2c88a8d83..000000000000 --- a/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -UUID="$(cat /proc/sys/kernel/random/uuid)" -export UUID - -node x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/observability_solution/uptime/README.md b/x-pack/plugins/observability_solution/uptime/README.md deleted file mode 100644 index bdc078e8607d..000000000000 --- a/x-pack/plugins/observability_solution/uptime/README.md +++ /dev/null @@ -1,97 +0,0 @@ -# Uptime Monitoring - -## Purpose - -The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening -in their infrastructure. - -## Layout - -There are three sections to the app, `common`, `public`, and `server`. - -### common - -Contains runtime types types, constants and a few other files. - -Notably, we use `io-ts`/`fp-ts` functions and types to help provide -additional runtime safety for our API requests/responses. - -### public - -We use Redux and associated tools for managing our app state. Components come in the usual `connect`ed and -presentational varieties. - -The `lib` directory controls bootstrapping code and adapter types. - -There is a `pages` directory; each view gets its own page component. - -The principal structure of the app is stored in `uptime_app.tsx`. - -### server - -The `lib` directory contains `adapters`, which are connections to external resources like Kibana -Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide -functionality via adapters. - -The `requests` directory contains functions responsible for querying Elasticsearch and parsing its -responses. - -There's also a `rest_api` folder that defines the structure of the RESTful API endpoints. - -## Testing - -### Unit tests - -Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing - -``` -yarn test:jest x-pack/plugins/observability_solution/synthetics -``` - -### Functional tests - -In one shell, from **~/kibana/x-pack**: -`node scripts/functional_tests_server.js` - -In another shell, from **~kibana/x-pack**: -`node ../scripts/functional_test_runner.js --grep="{TEST_NAME}"`. - -#### API tests - -If instead you need to run API tests, start up the test server and then in another shell, from **~kibana/x-pack**: -`node ../scripts/functional_test_runner.js --config test/api_integration/config.ts --grep="{TEST_NAME}"`. - -You can update snapshots by prefixing the runner command with `env UPDATE_UPTIME_FIXTURES=1` - -You can access the functional test server's Kibana at `http://localhost:5620/`. - -You can login with username `elastic` and password `changeme` by default. - -If you want to freeze a UI or API test you can include an async call like `await new Promise(r => setTimeout(r, 1000 * 60))` -to freeze the execution for 60 seconds if you need to click around or check things in the state that is loaded. - -#### Running --ssl tests - -Some of our tests require there to be an SSL connection between Kibana and Elasticsearch. - -We can run these tests like described above, but with some special config. - -`node scripts/functional_tests_server.js --config=test/functional_with_es_ssl/config.ts` - -`node scripts/functional_test_runner.js --config=test/functional_with_es_ssl/config.ts` - -#### Running accessibility tests - -We maintain a suite of Accessibility tests (you may see them referred to elsewhere as `a11y` tests). - -These tests render each of our pages and ensure that the inputs and other elements contain the -attributes necessary to ensure all users are able to make use of Kibana (for example, users relying -on screen readers). - -The commands for running these tests are very similar to the other functional tests described above. - -From the `~/x-pack` directory: - -Start the server: `node scripts/functional_tests_server --config test/accessibility/config.ts` - -Run the uptime `a11y` tests: `node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=uptime` diff --git a/x-pack/plugins/observability_solution/uptime/e2e/README.md b/x-pack/plugins/observability_solution/uptime/e2e/README.md deleted file mode 100644 index eaca49c55837..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/README.md +++ /dev/null @@ -1,32 +0,0 @@ -## How to run these tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From the same directory you can now run `node e2e.js --runner`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. - - -## Uptime App Tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/uptime/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From the same directory you can now run `node uptime_e2e.js --runner`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/uptime/e2e/config.ts b/x-pack/plugins/observability_solution/uptime/e2e/config.ts deleted file mode 100644 index 4f3e86eeb35e..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/config.ts +++ /dev/null @@ -1,79 +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 { FtrConfigProviderContext } from '@kbn/test'; -import { CA_CERT_PATH } from '@kbn/dev-utils'; -import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; -import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; -import { readKibanaConfig } from './tasks/read_kibana_config'; -const MANIFEST_KEY = 'xpack.uptime.service.manifestUrl'; -const SERVICE_PASSWORD = 'xpack.uptime.service.password'; -const SERVICE_USERNAME = 'xpack.uptime.service.username'; - -async function config({ readConfigFile }: FtrConfigProviderContext) { - const kibanaCommonTestsConfig = await readConfigFile( - require.resolve('@kbn/test-suites-src/common/config') - ); - const xpackFunctionalTestsConfig = await readConfigFile( - require.resolve('@kbn/test-suites-xpack/functional/config.base') - ); - - const kibanaConfig = readKibanaConfig(); - - const manifestUrl = process.env.SYNTHETICS_SERVICE_MANIFEST ?? kibanaConfig[MANIFEST_KEY]; - const serviceUsername = process.env.SYNTHETICS_SERVICE_USERNAME ?? kibanaConfig[SERVICE_USERNAME]; - const servicePassword = process.env.SYNTHETICS_SERVICE_PASSWORD ?? kibanaConfig[SERVICE_PASSWORD]; - - return { - ...kibanaCommonTestsConfig.getAll(), - - services: { - ...commonFunctionalServices, - ...commonFunctionalUIServices, - }, - - esTestCluster: { - ...xpackFunctionalTestsConfig.get('esTestCluster'), - serverArgs: [ - ...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'), - // define custom es server here - // API Keys is enabled at the top level - 'xpack.security.enabled=true', - ], - }, - - kbnTestServer: { - ...xpackFunctionalTestsConfig.get('kbnTestServer'), - sourceArgs: process.env.WATCH_ENABLED - ? [] - : [...xpackFunctionalTestsConfig.get('kbnTestServer.sourceArgs'), '--no-watch'], - serverArgs: [ - ...xpackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), - '--csp.strict=false', - '--home.disableWelcomeScreen=true', - '--csp.warnLegacyBrowsers=false', - // define custom kibana server args here - `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, - // `--elasticsearch.ignoreVersionMismatch=${process.env.CI ? 'false' : 'true'}`, - `--elasticsearch.username=kibana_system`, - `--elasticsearch.password=changeme`, - '--xpack.reporting.enabled=false', - `--xpack.uptime.service.manifestUrl=${manifestUrl}`, - `--xpack.uptime.service.username=${ - process.env.SYNTHETICS_REMOTE_ENABLED - ? serviceUsername - : 'localKibanaIntegrationTestsUser' - }`, - `--xpack.uptime.service.password=${servicePassword}`, - '--uiSettings.overrides.observability:enableLegacyUptimeApp=true', - ], - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default config; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/parse_args_params.ts b/x-pack/plugins/observability_solution/uptime/e2e/helpers/parse_args_params.ts deleted file mode 100644 index a69cae912dfe..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/helpers/parse_args_params.ts +++ /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 yargs from 'yargs'; - -const { argv } = yargs(process.argv.slice(2)) - .option('headless', { - default: true, - type: 'boolean', - description: 'Start in headless mode', - }) - .option('bail', { - default: false, - type: 'boolean', - description: 'Pause on error', - }) - .option('grep', { - default: undefined, - type: 'string', - description: 'run only journeys with a name or tags that matches the glob', - }) - .help(); - -export { argv }; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/record_video.ts b/x-pack/plugins/observability_solution/uptime/e2e/helpers/record_video.ts deleted file mode 100644 index 23bcdfb643e7..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/helpers/record_video.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import fs from 'fs'; -import Runner from '@elastic/synthetics/dist/core/runner'; -import { after, Page } from '@elastic/synthetics'; - -const SYNTHETICS_RUNNER = Symbol.for('SYNTHETICS_RUNNER'); - -// @ts-ignore -export const runner: Runner = global[SYNTHETICS_RUNNER]; - -export const recordVideo = (page: Page, postfix = '') => { - after(async () => { - try { - const videoFilePath = await page.video()?.path(); - const pathToVideo = videoFilePath?.replace('.journeys/videos/', '').replace('.webm', ''); - const newVideoPath = videoFilePath?.replace( - pathToVideo!, - postfix ? runner.currentJourney!.name + `-${postfix}` : runner.currentJourney!.name - ); - fs.renameSync(videoFilePath!, newVideoPath!); - } catch (e) { - // eslint-disable-next-line no-console - console.log('Error while renaming video file', e); - } - }); -}; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/synthetics_runner.ts b/x-pack/plugins/observability_solution/uptime/e2e/helpers/synthetics_runner.ts deleted file mode 100644 index c9d1f485afbf..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/helpers/synthetics_runner.ts +++ /dev/null @@ -1,155 +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. - */ - -/* eslint-disable no-console */ - -import Url from 'url'; -import { run as syntheticsRun } from '@elastic/synthetics'; -import { PromiseType } from 'utility-types'; -import { createApmUsers } from '@kbn/apm-plugin/server/test_helpers/create_apm_users/create_apm_users'; - -import { EsArchiver } from '@kbn/es-archiver'; -import { esArchiverUnload } from '../tasks/es_archiver'; -import { TestReporter } from './test_reporter'; - -export interface ArgParams { - headless: boolean; - match?: string; - pauseOnError: boolean; -} - -export class SyntheticsRunner { - public getService: any; - public kibanaUrl: string; - private elasticsearchUrl: string; - - public testFilesLoaded: boolean = false; - - public params: ArgParams; - - private loadTestFilesCallback?: (reload?: boolean) => Promise<void>; - - constructor(getService: any, params: ArgParams) { - this.getService = getService; - this.kibanaUrl = this.getKibanaUrl(); - this.elasticsearchUrl = this.getElasticsearchUrl(); - this.params = params; - } - - async setup() { - await this.createTestUsers(); - } - - async createTestUsers() { - await createApmUsers({ - elasticsearch: { node: this.elasticsearchUrl, username: 'elastic', password: 'changeme' }, - kibana: { hostname: this.kibanaUrl }, - }); - } - - async loadTestFiles(callback: (reload?: boolean) => Promise<void>, reload = false) { - console.log('Loading test files'); - await callback(reload); - this.loadTestFilesCallback = callback; - this.testFilesLoaded = true; - console.log('Successfully loaded test files'); - } - - async loadTestData(e2eDir: string, dataArchives: string[]) { - try { - console.log('Loading esArchiver...'); - - const esArchiver: EsArchiver = this.getService('esArchiver'); - - const promises = dataArchives.map((archive) => { - if (archive === 'synthetics_data') { - return esArchiver.load(e2eDir + archive, { - docsOnly: true, - skipExisting: true, - }); - } - return esArchiver.load(e2eDir + archive, { skipExisting: true }); - }); - - await Promise.all([...promises]); - } catch (e) { - console.log(e); - } - } - - getKibanaUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.kibana.protocol'), - hostname: config.get('servers.kibana.hostname'), - port: config.get('servers.kibana.port'), - }); - } - - getElasticsearchUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.elasticsearch.protocol'), - hostname: config.get('servers.elasticsearch.hostname'), - port: config.get('servers.elasticsearch.port'), - }); - } - - async run() { - if (!this.testFilesLoaded) { - throw new Error('Test files not loaded'); - } - const { headless, match, pauseOnError } = this.params; - const noOfRuns = process.env.NO_OF_RUNS ? Number(process.env.NO_OF_RUNS) : 1; - console.log(`Running ${noOfRuns} times`); - let results: PromiseType<ReturnType<typeof syntheticsRun>> = {}; - for (let i = 0; i < noOfRuns; i++) { - results = await syntheticsRun({ - params: { kibanaUrl: this.kibanaUrl, getService: this.getService }, - playwrightOptions: { - headless, - chromiumSandbox: false, - timeout: 60 * 1000, - viewport: { - height: 900, - width: 1600, - }, - recordVideo: { - dir: '.journeys/videos', - }, - }, - grepOpts: { match: match === 'undefined' ? '' : match }, - pauseOnError, - screenshots: 'only-on-failure', - reporter: TestReporter, - }); - if (noOfRuns > 1) { - // need to reload again since runner resets the journeys - await this.loadTestFiles(this.loadTestFilesCallback!, true); - } - } - - await this.assertResults(results); - } - - assertResults(results: PromiseType<ReturnType<typeof syntheticsRun>>) { - Object.entries(results).forEach(([_journey, result]) => { - if (result.status !== 'succeeded') { - process.exitCode = 1; - process.exit(); - } - }); - } - - cleanUp() { - console.log('Removing esArchiver...'); - esArchiverUnload('full_heartbeat'); - esArchiverUnload('browser'); - } -} diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/test_reporter.ts b/x-pack/plugins/observability_solution/uptime/e2e/helpers/test_reporter.ts deleted file mode 100644 index 198a038ec027..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/helpers/test_reporter.ts +++ /dev/null @@ -1,229 +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 { Journey, Step } from '@elastic/synthetics/dist/dsl'; -import { Reporter, ReporterOptions } from '@elastic/synthetics'; -import { - JourneyEndResult, - JourneyStartResult, - StepEndResult, -} from '@elastic/synthetics/dist/common_types'; - -import { yellow, green, cyan, red, bold } from 'chalk'; - -// eslint-disable-next-line no-console -const log = console.log; - -import { performance } from 'perf_hooks'; -import * as fs from 'fs'; -import { gatherScreenshots } from '@elastic/synthetics/dist/reporters/json'; -import { CACHE_PATH } from '@elastic/synthetics/dist/helpers'; -import { join } from 'path'; - -function renderError(error: any) { - let output = ''; - const outer = indent(''); - const inner = indent(outer); - const container = outer + '---\n'; - output += container; - let stack = error.stack; - if (stack) { - output += inner + 'stack: |-\n'; - stack = rewriteErrorStack(stack, findPWLogsIndexes(stack)); - const lines = String(stack).split('\n'); - for (const line of lines) { - output += inner + ' ' + line + '\n'; - } - } - output += container; - return red(output); -} - -function renderDuration(durationMs: number) { - return Number(durationMs).toFixed(0); -} - -export class TestReporter implements Reporter { - metrics = { - succeeded: 0, - failed: 0, - skipped: 0, - }; - - journeys: Map<string, Array<StepEndResult & { name: string }>> = new Map(); - - constructor(options: ReporterOptions = {}) {} - - onJourneyStart(journey: Journey, {}: JourneyStartResult) { - if (process.env.CI) { - this.write(`\n--- Journey: ${journey.name}`); - } else { - this.write(bold(`\n Journey: ${journey.name}`)); - } - } - - onStepEnd(journey: Journey, step: Step, result: StepEndResult) { - const { status, end, start, error } = result; - const message = `${symbols[status]} Step: '${step.name}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - this.metrics[status]++; - if (!this.journeys.has(journey.name)) { - this.journeys.set(journey.name, []); - } - this.journeys.get(journey.name)?.push({ name: step.name, ...result }); - } - - async onJourneyEnd(journey: Journey, { error, start, end, status }: JourneyEndResult) { - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - if (total === 0 && error) { - this.write(renderError(error)); - } - const message = `${symbols[status]} Took (${renderDuration(end - start)} seconds)`; - this.write(message); - - await fs.promises.mkdir('.journeys/failed_steps', { recursive: true }); - - await gatherScreenshots(join(CACHE_PATH, 'screenshots'), async (screenshot) => { - const { data, step } = screenshot; - - if (status === 'failed') { - await (async () => { - await fs.promises.writeFile(join('.journeys/failed_steps/', `${step.name}.jpg`), data, { - encoding: 'base64', - }); - })(); - } - }); - } - - onEnd() { - const failedJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.some((step) => step.status === 'failed') - ); - - if (failedJourneys.length > 0) { - failedJourneys.forEach(([journeyName, steps]) => { - if (process.env.CI) { - const name = red(`Journey: ${journeyName} 🥵`); - this.write(`\n+++ ${name}`); - steps.forEach((stepResult) => { - const { status, end, start, error, name: stepName } = stepResult; - const message = `${symbols[status]} Step: '${stepName}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - }); - } - }); - } - - const successfulJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.every((step) => step.status === 'succeeded') - ); - - successfulJourneys.forEach(([journeyName, steps]) => { - try { - fs.unlinkSync('.journeys/videos/' + journeyName + '.webm'); - } catch (e) { - // eslint-disable-next-line no-console - console.log( - 'Failed to delete video file for path ' + '.journeys/videos/' + journeyName + '.webm' - ); - } - }); - - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - - let message = '\n'; - if (total === 0) { - message = 'No tests found!'; - message += ` (${renderDuration(now())} ms) \n`; - this.write(message); - return; - } - - message += succeeded > 0 ? green(` ${succeeded} passed`) : ''; - message += failed > 0 ? red(` ${failed} failed`) : ''; - message += skipped > 0 ? cyan(` ${skipped} skipped`) : ''; - message += ` (${renderDuration(now() / 1000)} seconds) \n`; - this.write(message); - } - - write(message: any) { - if (typeof message === 'object') { - message = JSON.stringify(message); - } - log(message + '\n'); - } -} - -const SEPARATOR = '\n'; - -function indent(lines: string, tab = ' ') { - return lines.replace(/^/gm, tab); -} - -const NO_UTF8_SUPPORT = process.platform === 'win32'; -const symbols = { - warning: yellow(NO_UTF8_SUPPORT ? '!' : '⚠'), - skipped: cyan('-'), - progress: cyan('>'), - succeeded: green(NO_UTF8_SUPPORT ? 'ok' : '✓'), - failed: red(NO_UTF8_SUPPORT ? 'x' : '✖'), -}; - -function now() { - return performance.now(); -} - -function findPWLogsIndexes(msgOrStack: string): [number, number] { - let startIndex = 0; - let endIndex = 0; - if (!msgOrStack) { - return [startIndex, endIndex]; - } - const lines = String(msgOrStack).split(SEPARATOR); - const logStart = /[=]{3,} logs [=]{3,}/; - const logEnd = /[=]{10,}/; - lines.forEach((line, index) => { - if (logStart.test(line)) { - startIndex = index; - } else if (logEnd.test(line)) { - endIndex = index; - } - }); - return [startIndex, endIndex]; -} - -function rewriteErrorStack(stack: string, indexes: [number, number]) { - const [start, end] = indexes; - /** - * Do not rewrite if its not a playwright error - */ - if (start === 0 && end === 0) { - return stack; - } - const linesToKeep = start + 3; - if (start > 0 && linesToKeep < end) { - const lines = stack.split(SEPARATOR); - return lines - .slice(0, linesToKeep) - .concat(...lines.slice(end)) - .join(SEPARATOR); - } - return stack; -} diff --git a/x-pack/plugins/observability_solution/uptime/e2e/tasks/es_archiver.ts b/x-pack/plugins/observability_solution/uptime/e2e/tasks/es_archiver.ts deleted file mode 100644 index 8415de3a385b..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/tasks/es_archiver.ts +++ /dev/null @@ -1,37 +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 Path from 'path'; -import { execSync } from 'child_process'; - -const ES_ARCHIVE_DIR = './fixtures/es_archiver'; - -// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https -const NODE_TLS_REJECT_UNAUTHORIZED = '1'; - -export const esArchiverLoad = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../../scripts/es_archiver load "${path}" --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverUnload = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../../scripts/es_archiver unload "${path}" --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverResetKibana = () => { - execSync( - `node ../../../../../scripts/es_archiver empty-kibana-index --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts b/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.ts deleted file mode 100644 index b892454b12c9..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/tasks/read_kibana_config.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 path from 'path'; -import fs from 'fs'; -import yaml from 'js-yaml'; - -export type KibanaConfig = ReturnType<typeof readKibanaConfig>; - -export const readKibanaConfig = () => { - const kibanaConfigDir = path.join(__filename, '../../../../../../../config'); - const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml'); - const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml'); - - return (yaml.load( - fs.readFileSync(fs.existsSync(kibanaDevConfig) ? kibanaDevConfig : kibanaConfig, 'utf8') - ) || {}) as Record<string, string>; -}; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json b/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json deleted file mode 100644 index 2ad789f1e88d..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "exclude": ["tmp", "target/**/*"], - "include": ["**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": ["node"], - "isolatedModules": false - }, - "kbn_references": [ - "@kbn/test", - "@kbn/dev-utils", - "@kbn/ux-plugin/e2e", - "@kbn/ftr-common-functional-services", - "@kbn/apm-plugin", - "@kbn/es-archiver", - "@kbn/ftr-common-functional-ui-services" - ] -} diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/step_duration.journey.ts b/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/step_duration.journey.ts deleted file mode 100644 index 2dc781fcbf90..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/step_duration.journey.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { journey, step, expect } from '@elastic/synthetics'; -import { RetryService } from '@kbn/ftr-common-functional-services'; -import { recordVideo } from '../../helpers/record_video'; -import { loginPageProvider } from '../../page_objects/login'; - -journey('StepsDuration', async ({ page, params }) => { - recordVideo(page); - - const retry: RetryService = params.getService('retry'); - - const login = loginPageProvider({ page }); - - const queryParams = new URLSearchParams({ - dateRangeStart: '2021-11-21T22:06:06.502Z', - dateRangeEnd: '2021-11-21T22:10:08.203Z', - }).toString(); - - const baseUrl = `${params.kibanaUrl}/app/uptime`; - - step('Go to uptime', async () => { - await page.goto(`${baseUrl}?${queryParams}`, { - waitUntil: 'networkidle', - }); - await login.loginToKibana(); - }); - - step('Go to monitor details', async () => { - await page.click('text="test-monitor - inline"'); - expect(page.url()).toBe(`${baseUrl}/monitor/dGVzdC1tb25pdG9yLWlubGluZQ==/?${queryParams}`); - }); - - step('Go to journey details', async () => { - await page.click('text=18 seconds'); - expect(page.url()).toBe(`${baseUrl}/journey/9f217c22-4b17-11ec-b976-aa665a54da40/steps`); - }); - - step('Check for monitor duration', async () => { - await retry.tryForTime(90 * 1000, async () => { - await page.click('text="6 Steps - 3 succeeded"'); - await page.waitForTimeout(2 * 1000); - await page.hover('text=8.9 sec'); - await page.waitForSelector('text=Explore'); - expect(await page.$('text=Explore')).toBeTruthy(); - await page.waitForSelector('text=area chart'); - expect(await page.$('text=area chart')).toBeTruthy(); - }); - }); -}); diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.ts b/x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.ts deleted file mode 100644 index b457a5b1e104..000000000000 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/synthetics_run.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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ -import { FtrConfigProviderContext } from '@kbn/test'; -import path from 'path'; -import { argv } from '../helpers/parse_args_params'; -import { SyntheticsRunner } from '../helpers/synthetics_runner'; - -const { headless, grep, bail: pauseOnError } = argv; - -async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { - const kibanaConfig = await readConfigFile(require.resolve('../config.ts')); - return { - ...kibanaConfig.getAll(), - testRunner: async ({ getService }: any) => { - const syntheticsRunner = new SyntheticsRunner(getService, { - headless, - match: grep, - pauseOnError, - }); - - await syntheticsRunner.setup(); - const fixturesDir = path.join(__dirname, '../fixtures/es_archiver/'); - - await syntheticsRunner.loadTestData(fixturesDir, [ - 'synthetics_data', - 'full_heartbeat', - 'browser', - ]); - - await syntheticsRunner.loadTestFiles(async (reload) => { - if (reload) { - const dirPath = require.resolve('./journeys').replace('index.ts', ''); - Object.keys(require.cache).forEach(function (key) { - if (key.startsWith(dirPath)) { - delete require.cache[key]; - } - }); - } - require(path.join(__dirname, './journeys')); - }); - - await syntheticsRunner.run(); - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default runE2ETests; diff --git a/x-pack/plugins/observability_solution/uptime/jest.config.js b/x-pack/plugins/observability_solution/uptime/jest.config.js deleted file mode 100644 index 639e28679355..000000000000 --- a/x-pack/plugins/observability_solution/uptime/jest.config.js +++ /dev/null @@ -1,18 +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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../..', - roots: ['<rootDir>/x-pack/plugins/observability_solution/uptime'], - coverageDirectory: - '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/observability_solution/uptime', - coverageReporters: ['text', 'html'], - collectCoverageFrom: [ - '<rootDir>/x-pack/plugins/observability_solution/uptime/{common,public,server}/**/*.{ts,tsx}', - ], -}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts deleted file mode 100644 index b6d250a2cb70..000000000000 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useFetcher } from '@kbn/observability-shared-plugin/public'; -import { useGenerateUpdatedKueryString } from '../../../../hooks'; -import { fetchSnapshotCount } from '../../../../state/api'; - -export const useSnapShotCount = ({ query, filters }: { query: string; filters?: [] | string }) => { - const parsedFilters = - filters === undefined || typeof filters === 'string' - ? '' - : JSON.stringify(Array.from(Object.entries(filters))); - - const [esKuery, error] = useGenerateUpdatedKueryString(query, parsedFilters, undefined, true); - - const { data, loading } = useFetcher( - () => - fetchSnapshotCount({ - dateRangeStart: 'now-24h', - dateRangeEnd: 'now', - filters: error ? undefined : esKuery, - }), - // FIXME: Dario thinks there is a better way to do this but - // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps - [esKuery, query] - ); - - return { count: data || { total: 0, up: 0, down: 0 }, loading }; -}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.tsx deleted file mode 100644 index ac7e20db41b1..000000000000 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useState, useEffect } from 'react'; -import { EuiSpacer } from '@elastic/eui'; -import { useFetcher } from '@kbn/observability-shared-plugin/public'; -import { useSelector } from 'react-redux'; -import { getHasIntegrationMonitors } from '../../../state/api/has_integration_monitors'; -import { monitorListSelector } from '../../../state/selectors'; -import { IntegrationDeprecationCallout } from './integration_deprecation_callout'; - -export const INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY = - 'SYNTHETICS_INTEGRATION_DEPRECATION_HAS_BEEN_DISMISSED'; - -export const IntegrationDeprecation = () => { - const monitorList = useSelector(monitorListSelector); - const noticeHasBeenDismissed = - window.sessionStorage.getItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY) === 'true'; - const { data, loading } = useFetcher(() => { - // load it when list is loaded - if (!noticeHasBeenDismissed && monitorList.isLoaded) { - return getHasIntegrationMonitors(); - } - return undefined; - // FIXME: Dario thinks there is a better way to do this but - // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [monitorList.isLoaded]); - const hasIntegrationMonitors = !loading && data && data.hasIntegrationMonitors; - const [shouldShowNotice, setShouldShowNotice] = useState( - Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed) - ); - - const handleDismissDeprecationNotice = () => { - window.sessionStorage.setItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY, 'true'); - setShouldShowNotice(false); - }; - - useEffect(() => { - setShouldShowNotice(Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed)); - }, [hasIntegrationMonitors, noticeHasBeenDismissed]); - - return shouldShowNotice ? ( - <> - <IntegrationDeprecationCallout - handleDismissDeprecationNotice={handleDismissDeprecationNotice} - /> - <EuiSpacer size="s" /> - </> - ) : null; -}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts deleted file mode 100644 index 15ffd98c739c..000000000000 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { useContext } from 'react'; -import { useSelector } from 'react-redux'; -import { useFetcher } from '@kbn/observability-shared-plugin/public'; -import { useGetUrlParams } from '../../../hooks'; -import { esKuerySelector } from '../../../state/selectors'; -import { UptimeRefreshContext } from '../../../contexts'; -import { fetchSnapshotCount } from '../../../state/api'; - -export const useSnapShotCount = () => { - const { dateRangeStart, dateRangeEnd, query } = useGetUrlParams(); - - const { lastRefresh } = useContext(UptimeRefreshContext); - - const esKuery = useSelector(esKuerySelector); - - const { data, loading } = useFetcher( - () => fetchSnapshotCount({ query, dateRangeStart, dateRangeEnd, filters: esKuery }), - // FIXME: Dario thinks there is a better way to do this but - // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps - [dateRangeStart, dateRangeEnd, esKuery, lastRefresh, query] - ); - - return { count: data || { total: 0, up: 0, down: 0 }, loading }; -}; diff --git a/x-pack/plugins/observability_solution/uptime/tsconfig.json b/x-pack/plugins/observability_solution/uptime/tsconfig.json deleted file mode 100644 index 1d60bc456170..000000000000 --- a/x-pack/plugins/observability_solution/uptime/tsconfig.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "scripts/**/*", - "public/**/*", - "public/legacy_uptime/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", - "server/**/*", - "server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json", - "../../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/config-schema", - "@kbn/i18n", - "@kbn/fleet-plugin", - "@kbn/alerting-plugin", - "@kbn/datemath", - "@kbn/stack-connectors-plugin", - "@kbn/triggers-actions-ui-plugin", - "@kbn/kibana-react-plugin", - "@kbn/observability-shared-plugin", - "@kbn/observability-plugin", - "@kbn/i18n-react", - "@kbn/shared-ux-page-kibana-template", - "@kbn/test-jest-helpers", - "@kbn/ml-anomaly-utils", - "@kbn/exploratory-view-plugin", - "@kbn/ml-plugin", - "@kbn/rison", - "@kbn/shared-ux-router", - "@kbn/unified-search-plugin", - "@kbn/core-http-browser", - "@kbn/es-query", - "@kbn/data-views-plugin", - "@kbn/ui-theme", - "@kbn/rule-data-utils", - "@kbn/kibana-utils-plugin", - "@kbn/data-plugin", - "@kbn/ml-error-utils", - "@kbn/core-http-browser-mocks", - "@kbn/securitysolution-io-ts-utils", - "@kbn/share-plugin", - "@kbn/discover-plugin", - "@kbn/home-plugin", - "@kbn/embeddable-plugin", - "@kbn/inspector-plugin", - "@kbn/cases-plugin", - "@kbn/cloud-plugin", - "@kbn/spaces-plugin", - "@kbn/core-doc-links-browser", - "@kbn/usage-collection-plugin", - "@kbn/core-application-browser", - "@kbn/encrypted-saved-objects-plugin", - "@kbn/task-manager-plugin", - "@kbn/features-plugin", - "@kbn/rule-registry-plugin", - "@kbn/security-plugin", - "@kbn/bfetch-plugin", - "@kbn/alerts-as-data-utils", - "@kbn/std", - "@kbn/utility-types", - "@kbn/licensing-plugin", - "@kbn/es-types", - "@kbn/safer-lodash-set", - "@kbn/core-elasticsearch-client-server-mocks", - "@kbn/core-http-server", - "@kbn/actions-plugin", - "@kbn/core-saved-objects-server", - "@kbn/observability-ai-assistant-plugin", - "@kbn/shared-ux-link-redirect-app", - "@kbn/repo-info", - "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme", - "@kbn/react-kibana-mount", - "@kbn/deeplinks-observability", - "@kbn/ebt-tools", - "@kbn/core-rendering-browser", - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh b/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh deleted file mode 100644 index f358969a3ff8..000000000000 --- a/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -UUID="$(cat /proc/sys/kernel/random/uuid)" -export UUID - -node x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/observability_solution/ux/e2e/README.md b/x-pack/plugins/observability_solution/ux/e2e/README.md deleted file mode 100644 index 60c6d2f643b7..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/README.md +++ /dev/null @@ -1,15 +0,0 @@ -## How to run these tests - -These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated -script for standing up the test server. - -### Start the server - -From `~/x-pack/plugins/observability_solution/ux/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you -with an example run command when it finishes. - -### Run the tests - -From this directory, `~/x-pack/plugins/observability_solution/ux/e2e`, you can now run `node ../../../../../scripts/functional_test_runner --config synthetics_run.ts`. - -In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/ux/e2e/helpers/parse_args_params.ts b/x-pack/plugins/observability_solution/ux/e2e/helpers/parse_args_params.ts deleted file mode 100644 index 41100ba2ec29..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/helpers/parse_args_params.ts +++ /dev/null @@ -1,33 +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 yargs from 'yargs'; - -const { argv } = yargs(process.argv.slice(2)) - .option('headless', { - default: true, - type: 'boolean', - description: 'Start in headless mode', - }) - .option('bail', { - default: false, - type: 'boolean', - description: 'Pause on error', - }) - .option('watch', { - default: false, - type: 'boolean', - description: 'Runs the server in watch mode, restarting on changes', - }) - .option('grep', { - default: undefined, - type: 'string', - description: 'run only journeys with a name or tags that matches the glob', - }) - .help(); - -export { argv }; diff --git a/x-pack/plugins/observability_solution/ux/e2e/helpers/record_video.ts b/x-pack/plugins/observability_solution/ux/e2e/helpers/record_video.ts deleted file mode 100644 index 23bcdfb643e7..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/helpers/record_video.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import fs from 'fs'; -import Runner from '@elastic/synthetics/dist/core/runner'; -import { after, Page } from '@elastic/synthetics'; - -const SYNTHETICS_RUNNER = Symbol.for('SYNTHETICS_RUNNER'); - -// @ts-ignore -export const runner: Runner = global[SYNTHETICS_RUNNER]; - -export const recordVideo = (page: Page, postfix = '') => { - after(async () => { - try { - const videoFilePath = await page.video()?.path(); - const pathToVideo = videoFilePath?.replace('.journeys/videos/', '').replace('.webm', ''); - const newVideoPath = videoFilePath?.replace( - pathToVideo!, - postfix ? runner.currentJourney!.name + `-${postfix}` : runner.currentJourney!.name - ); - fs.renameSync(videoFilePath!, newVideoPath!); - } catch (e) { - // eslint-disable-next-line no-console - console.log('Error while renaming video file', e); - } - }); -}; diff --git a/x-pack/plugins/observability_solution/ux/e2e/helpers/synthetics_runner.ts b/x-pack/plugins/observability_solution/ux/e2e/helpers/synthetics_runner.ts deleted file mode 100644 index e191d5fc101f..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/helpers/synthetics_runner.ts +++ /dev/null @@ -1,159 +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. - */ - -/* eslint-disable no-console */ - -import Url from 'url'; -import { run as syntheticsRun } from '@elastic/synthetics'; -import { PromiseType } from 'utility-types'; -import { createApmUsers } from '@kbn/apm-plugin/server/test_helpers/create_apm_users/create_apm_users'; - -import { EsArchiver } from '@kbn/es-archiver'; -import { esArchiverUnload } from '../tasks/es_archiver'; -import { TestReporter } from './test_reporter'; - -export interface ArgParams { - headless: boolean; - match?: string; - pauseOnError: boolean; -} - -export class SyntheticsRunner { - public getService: any; - public kibanaUrl: string; - private elasticsearchUrl: string; - - public testFilesLoaded: boolean = false; - - public params: ArgParams; - - private loadTestFilesCallback?: (reload?: boolean) => Promise<void>; - - constructor(getService: any, params: ArgParams) { - this.getService = getService; - this.kibanaUrl = this.getKibanaUrl(); - this.elasticsearchUrl = this.getElasticsearchUrl(); - this.params = params; - } - - async setup() { - await this.createTestUsers(); - } - - async createTestUsers() { - await createApmUsers({ - elasticsearch: { - node: this.elasticsearchUrl, - username: 'elastic', - password: 'changeme', - }, - kibana: { hostname: this.kibanaUrl }, - }); - } - - async loadTestFiles(callback: (reload?: boolean) => Promise<void>, reload = false) { - console.log('Loading test files'); - await callback(reload); - this.loadTestFilesCallback = callback; - this.testFilesLoaded = true; - console.log('Successfully loaded test files'); - } - - async loadTestData(e2eDir: string, dataArchives: string[]) { - try { - console.log('Loading esArchiver...'); - - const esArchiver: EsArchiver = this.getService('esArchiver'); - - const promises = dataArchives.map((archive) => { - if (archive === 'synthetics_data') { - return esArchiver.load(e2eDir + archive, { - docsOnly: true, - skipExisting: true, - }); - } - return esArchiver.load(e2eDir + archive, { skipExisting: true }); - }); - - await Promise.all([...promises]); - } catch (e) { - console.log(e); - } - } - - getKibanaUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.kibana.protocol'), - hostname: config.get('servers.kibana.hostname'), - port: config.get('servers.kibana.port'), - }); - } - - getElasticsearchUrl() { - const config = this.getService('config'); - - return Url.format({ - protocol: config.get('servers.elasticsearch.protocol'), - hostname: config.get('servers.elasticsearch.hostname'), - port: config.get('servers.elasticsearch.port'), - }); - } - - async run() { - if (!this.testFilesLoaded) { - throw new Error('Test files not loaded'); - } - const { headless, match, pauseOnError } = this.params; - const noOfRuns = process.env.NO_OF_RUNS ? Number(process.env.NO_OF_RUNS) : 1; - console.log(`Running ${noOfRuns} times`); - let results: PromiseType<ReturnType<typeof syntheticsRun>> = {}; - for (let i = 0; i < noOfRuns; i++) { - results = await syntheticsRun({ - params: { kibanaUrl: this.kibanaUrl, getService: this.getService }, - playwrightOptions: { - headless, - chromiumSandbox: false, - timeout: 60 * 1000, - viewport: { - height: 900, - width: 1600, - }, - recordVideo: { - dir: '.journeys/videos', - }, - }, - grepOpts: { match: match === 'undefined' ? '' : match }, - pauseOnError, - screenshots: 'only-on-failure', - reporter: TestReporter, - }); - if (noOfRuns > 1) { - // need to reload again since runner resets the journeys - await this.loadTestFiles(this.loadTestFilesCallback!, true); - } - } - - await this.assertResults(results); - } - - assertResults(results: PromiseType<ReturnType<typeof syntheticsRun>>) { - Object.entries(results).forEach(([_journey, result]) => { - if (result.status !== 'succeeded') { - process.exitCode = 1; - process.exit(); - } - }); - } - - cleanUp() { - console.log('Removing esArchiver...'); - esArchiverUnload('full_heartbeat'); - esArchiverUnload('browser'); - } -} diff --git a/x-pack/plugins/observability_solution/ux/e2e/helpers/test_reporter.ts b/x-pack/plugins/observability_solution/ux/e2e/helpers/test_reporter.ts deleted file mode 100644 index 198a038ec027..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/helpers/test_reporter.ts +++ /dev/null @@ -1,229 +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 { Journey, Step } from '@elastic/synthetics/dist/dsl'; -import { Reporter, ReporterOptions } from '@elastic/synthetics'; -import { - JourneyEndResult, - JourneyStartResult, - StepEndResult, -} from '@elastic/synthetics/dist/common_types'; - -import { yellow, green, cyan, red, bold } from 'chalk'; - -// eslint-disable-next-line no-console -const log = console.log; - -import { performance } from 'perf_hooks'; -import * as fs from 'fs'; -import { gatherScreenshots } from '@elastic/synthetics/dist/reporters/json'; -import { CACHE_PATH } from '@elastic/synthetics/dist/helpers'; -import { join } from 'path'; - -function renderError(error: any) { - let output = ''; - const outer = indent(''); - const inner = indent(outer); - const container = outer + '---\n'; - output += container; - let stack = error.stack; - if (stack) { - output += inner + 'stack: |-\n'; - stack = rewriteErrorStack(stack, findPWLogsIndexes(stack)); - const lines = String(stack).split('\n'); - for (const line of lines) { - output += inner + ' ' + line + '\n'; - } - } - output += container; - return red(output); -} - -function renderDuration(durationMs: number) { - return Number(durationMs).toFixed(0); -} - -export class TestReporter implements Reporter { - metrics = { - succeeded: 0, - failed: 0, - skipped: 0, - }; - - journeys: Map<string, Array<StepEndResult & { name: string }>> = new Map(); - - constructor(options: ReporterOptions = {}) {} - - onJourneyStart(journey: Journey, {}: JourneyStartResult) { - if (process.env.CI) { - this.write(`\n--- Journey: ${journey.name}`); - } else { - this.write(bold(`\n Journey: ${journey.name}`)); - } - } - - onStepEnd(journey: Journey, step: Step, result: StepEndResult) { - const { status, end, start, error } = result; - const message = `${symbols[status]} Step: '${step.name}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - this.metrics[status]++; - if (!this.journeys.has(journey.name)) { - this.journeys.set(journey.name, []); - } - this.journeys.get(journey.name)?.push({ name: step.name, ...result }); - } - - async onJourneyEnd(journey: Journey, { error, start, end, status }: JourneyEndResult) { - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - if (total === 0 && error) { - this.write(renderError(error)); - } - const message = `${symbols[status]} Took (${renderDuration(end - start)} seconds)`; - this.write(message); - - await fs.promises.mkdir('.journeys/failed_steps', { recursive: true }); - - await gatherScreenshots(join(CACHE_PATH, 'screenshots'), async (screenshot) => { - const { data, step } = screenshot; - - if (status === 'failed') { - await (async () => { - await fs.promises.writeFile(join('.journeys/failed_steps/', `${step.name}.jpg`), data, { - encoding: 'base64', - }); - })(); - } - }); - } - - onEnd() { - const failedJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.some((step) => step.status === 'failed') - ); - - if (failedJourneys.length > 0) { - failedJourneys.forEach(([journeyName, steps]) => { - if (process.env.CI) { - const name = red(`Journey: ${journeyName} 🥵`); - this.write(`\n+++ ${name}`); - steps.forEach((stepResult) => { - const { status, end, start, error, name: stepName } = stepResult; - const message = `${symbols[status]} Step: '${stepName}' ${status} (${renderDuration( - (end - start) * 1000 - )} ms)`; - this.write(indent(message)); - if (error) { - this.write(renderError(error)); - } - }); - } - }); - } - - const successfulJourneys = Array.from(this.journeys.entries()).filter(([, steps]) => - steps.every((step) => step.status === 'succeeded') - ); - - successfulJourneys.forEach(([journeyName, steps]) => { - try { - fs.unlinkSync('.journeys/videos/' + journeyName + '.webm'); - } catch (e) { - // eslint-disable-next-line no-console - console.log( - 'Failed to delete video file for path ' + '.journeys/videos/' + journeyName + '.webm' - ); - } - }); - - const { failed, succeeded, skipped } = this.metrics; - const total = failed + succeeded + skipped; - - let message = '\n'; - if (total === 0) { - message = 'No tests found!'; - message += ` (${renderDuration(now())} ms) \n`; - this.write(message); - return; - } - - message += succeeded > 0 ? green(` ${succeeded} passed`) : ''; - message += failed > 0 ? red(` ${failed} failed`) : ''; - message += skipped > 0 ? cyan(` ${skipped} skipped`) : ''; - message += ` (${renderDuration(now() / 1000)} seconds) \n`; - this.write(message); - } - - write(message: any) { - if (typeof message === 'object') { - message = JSON.stringify(message); - } - log(message + '\n'); - } -} - -const SEPARATOR = '\n'; - -function indent(lines: string, tab = ' ') { - return lines.replace(/^/gm, tab); -} - -const NO_UTF8_SUPPORT = process.platform === 'win32'; -const symbols = { - warning: yellow(NO_UTF8_SUPPORT ? '!' : '⚠'), - skipped: cyan('-'), - progress: cyan('>'), - succeeded: green(NO_UTF8_SUPPORT ? 'ok' : '✓'), - failed: red(NO_UTF8_SUPPORT ? 'x' : '✖'), -}; - -function now() { - return performance.now(); -} - -function findPWLogsIndexes(msgOrStack: string): [number, number] { - let startIndex = 0; - let endIndex = 0; - if (!msgOrStack) { - return [startIndex, endIndex]; - } - const lines = String(msgOrStack).split(SEPARATOR); - const logStart = /[=]{3,} logs [=]{3,}/; - const logEnd = /[=]{10,}/; - lines.forEach((line, index) => { - if (logStart.test(line)) { - startIndex = index; - } else if (logEnd.test(line)) { - endIndex = index; - } - }); - return [startIndex, endIndex]; -} - -function rewriteErrorStack(stack: string, indexes: [number, number]) { - const [start, end] = indexes; - /** - * Do not rewrite if its not a playwright error - */ - if (start === 0 && end === 0) { - return stack; - } - const linesToKeep = start + 3; - if (start > 0 && linesToKeep < end) { - const lines = stack.split(SEPARATOR); - return lines - .slice(0, linesToKeep) - .concat(...lines.slice(end)) - .join(SEPARATOR); - } - return stack; -} diff --git a/x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts b/x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts deleted file mode 100644 index 7c7581b10e6a..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/synthetics_run.ts +++ /dev/null @@ -1,40 +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 { FtrConfigProviderContext } from '@kbn/test'; -import path from 'path'; -import { argv } from './helpers/parse_args_params'; -import { SyntheticsRunner } from './helpers/synthetics_runner'; - -const { headless, grep, bail: pauseOnError } = argv; - -async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { - const kibanaConfig = await readConfigFile(require.resolve('@kbn/synthetics-e2e/config')); - - return { - ...kibanaConfig.getAll(), - testRunner: async ({ getService }: any) => { - const syntheticsRunner = new SyntheticsRunner(getService, { - headless, - match: grep, - pauseOnError, - }); - - await syntheticsRunner.setup(); - - const fixturesDir = path.join(__dirname, '../e2e/fixtures/'); - - await syntheticsRunner.loadTestData(fixturesDir, ['rum_8.0.0', 'rum_test_data']); - await syntheticsRunner.loadTestFiles(async () => { - require('./journeys'); - }); - await syntheticsRunner.run(); - }, - }; -} - -// eslint-disable-next-line import/no-default-export -export default runE2ETests; diff --git a/x-pack/plugins/observability_solution/ux/e2e/tasks/es_archiver.ts b/x-pack/plugins/observability_solution/ux/e2e/tasks/es_archiver.ts deleted file mode 100644 index 8415de3a385b..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/tasks/es_archiver.ts +++ /dev/null @@ -1,37 +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 Path from 'path'; -import { execSync } from 'child_process'; - -const ES_ARCHIVE_DIR = './fixtures/es_archiver'; - -// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https -const NODE_TLS_REJECT_UNAUTHORIZED = '1'; - -export const esArchiverLoad = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../../scripts/es_archiver load "${path}" --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverUnload = (folder: string) => { - const path = Path.join(ES_ARCHIVE_DIR, folder); - execSync( - `node ../../../../../scripts/es_archiver unload "${path}" --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; - -export const esArchiverResetKibana = () => { - execSync( - `node ../../../../../scripts/es_archiver empty-kibana-index --config ../../../../test/functional/config.base.js`, - { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } - ); -}; diff --git a/x-pack/plugins/observability_solution/ux/e2e/tsconfig.json b/x-pack/plugins/observability_solution/ux/e2e/tsconfig.json deleted file mode 100644 index 93a315a3e7a6..000000000000 --- a/x-pack/plugins/observability_solution/ux/e2e/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../../../tsconfig.base.json", - "exclude": ["tmp", "target/**/*"], - "include": ["./**/*"], - "compilerOptions": { - "outDir": "target/types", - "types": ["node"] - }, - "kbn_references": ["@kbn/test", "@kbn/apm-plugin", "@kbn/es-archiver"] -} diff --git a/x-pack/plugins/observability_solution/ux/jest.config.js b/x-pack/plugins/observability_solution/ux/jest.config.js deleted file mode 100644 index b83d3a7ba545..000000000000 --- a/x-pack/plugins/observability_solution/ux/jest.config.js +++ /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; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -const path = require('path'); - -module.exports = { - preset: '@kbn/test', - rootDir: path.resolve(__dirname, '../../../..'), - roots: ['<rootDir>/x-pack/plugins/observability_solution/ux'], -}; diff --git a/x-pack/plugins/observability_solution/ux/kibana.jsonc b/x-pack/plugins/observability_solution/ux/kibana.jsonc deleted file mode 100644 index f2770a896d89..000000000000 --- a/x-pack/plugins/observability_solution/ux/kibana.jsonc +++ /dev/null @@ -1,49 +0,0 @@ -{ - "type": "plugin", - "id": "@kbn/ux-plugin", - "owner": [ - "@elastic/obs-ux-infra_services-team" - ], - "group": "observability", - "visibility": "private", - "plugin": { - "id": "ux", - "browser": true, - "server": true, - "configPath": [ - "xpack", - "ux" - ], - "requiredPlugins": [ - "features", - "data", - "dataViews", - "exploratoryView", - "licensing", - "triggersActionsUi", - "observabilityShared", - "embeddable", - "inspector", - "apm" - ], - "optionalPlugins": [ - "cloud", - "usageCollection", - "taskManager", - "actions", - "alerts", - "observability", - "security", - "maps", - "lens", - "observabilityAIAssistant", - "spaces" - ], - "requiredBundles": [ - "kibanaReact", - "exploratoryView", - "observability", - "maps" - ] - } -} \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/ux/readme.md b/x-pack/plugins/observability_solution/ux/readme.md deleted file mode 100644 index e03da5df05ee..000000000000 --- a/x-pack/plugins/observability_solution/ux/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Documentation for UX UI developers - -https://docs.elastic.dev/kibana-dev-docs/welcome - -## Running E2E Tests - -The tests are managed via the `scripts/e2e.js` file. This script accepts numerous options. - -From the Kibana root you can run `node x-pack/plugins/observability_solution/ux/scripts/e2e.js` to simply stand up the stack, load data, and run the tests. - -If you are developing a new test, it is better to stand up the stack in one shell and load data/run tests in a second session. You can do this by running: - -- `node ./x-pack/plugins/observability_solution/ux/scripts/e2e.js --server` -- `node ./x-pack/plugins/observability_solution/ux/scripts/e2e.js --runner`, you can also specify `--grep "{TEST_NAME}"` to run a specific series of tests diff --git a/x-pack/plugins/observability_solution/ux/tsconfig.json b/x-pack/plugins/observability_solution/ux/tsconfig.json deleted file mode 100644 index b27a700aa9b1..000000000000 --- a/x-pack/plugins/observability_solution/ux/tsconfig.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "extends": "../../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../../typings/**/*", - "common/**/*", - "public/**/*", - "server/**/*", - "typings/**/*", - "public/**/*.json" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/embeddable-plugin", - "@kbn/home-plugin", - "@kbn/inspector-plugin", - "@kbn/kibana-react-plugin", - "@kbn/apm-plugin", - "@kbn/features-plugin", - "@kbn/licensing-plugin", - "@kbn/maps-plugin", - "@kbn/observability-plugin", - "@kbn/lens-plugin", - "@kbn/i18n", - "@kbn/io-ts-utils", - "@kbn/data-views-plugin", - "@kbn/core-http-browser", - "@kbn/datemath", - "@kbn/ui-theme", - "@kbn/typed-react-router-config", - "@kbn/utility-types", - "@kbn/server-route-repository", - "@kbn/es-types", - "@kbn/shared-ux-page-kibana-template", - "@kbn/i18n-react", - "@kbn/es-query", - "@kbn/exploratory-view-plugin", - "@kbn/observability-shared-plugin", - "@kbn/shared-ux-router", - "@kbn/observability-ai-assistant-plugin", - "@kbn/config-schema", - "@kbn/shared-ux-link-redirect-app", - "@kbn/apm-data-view", - "@kbn/spaces-plugin", - "@kbn/deeplinks-observability", - "@kbn/react-kibana-context-render", - "@kbn/react-kibana-context-theme", - "@kbn/search-types", - "@kbn/server-route-repository-utils", - "@kbn/core-chrome-browser" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx b/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx index cde4049a3a82..4da2bc484105 100644 --- a/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx +++ b/x-pack/plugins/saved_objects_tagging/public/management/components/table.tsx @@ -6,10 +6,16 @@ */ import React, { FC, ReactNode } from 'react'; -import { EuiInMemoryTable, EuiBasicTableColumn, EuiLink, Query, EuiIconTip } from '@elastic/eui'; +import { + EuiInMemoryTable, + EuiBasicTableColumn, + EuiLink, + Query, + EuiIconTip, + useEuiTheme, +} from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { TagsCapabilities } from '../../../common'; import type { TagWithRelations } from '../../../common/types'; import { TagBadge } from '../../components'; @@ -59,6 +65,7 @@ export const TagTable: FC<TagTableProps> = ({ actionBar, actions, }) => { + const { euiTheme } = useEuiTheme(); const columns: Array<EuiBasicTableColumn<TagWithRelations>> = [ { field: 'name', @@ -72,7 +79,7 @@ export const TagTable: FC<TagTableProps> = ({ <> <TagBadge tag={tag} /> {tag.managed && ( - <div css={{ marginLeft: euiThemeVars.euiSizeS }}> + <div css={{ marginLeft: euiTheme.size.s }}> <EuiIconTip type="lock" content="This tag is managed by Elastic and cannot be deleted, edited, or assigned to objects." diff --git a/x-pack/plugins/saved_objects_tagging/tsconfig.json b/x-pack/plugins/saved_objects_tagging/tsconfig.json index b5202917aa4e..b40ffe7f3fa8 100644 --- a/x-pack/plugins/saved_objects_tagging/tsconfig.json +++ b/x-pack/plugins/saved_objects_tagging/tsconfig.json @@ -22,7 +22,6 @@ "@kbn/config-schema", "@kbn/ebt-tools", "@kbn/core-notifications-browser", - "@kbn/ui-theme", "@kbn/react-kibana-context-render", "@kbn/react-kibana-mount", "@kbn/core-lifecycle-browser", diff --git a/x-pack/plugins/search_assistant/kibana.jsonc b/x-pack/plugins/search_assistant/kibana.jsonc index d84d928b7a8b..3c20e59ccc9a 100644 --- a/x-pack/plugins/search_assistant/kibana.jsonc +++ b/x-pack/plugins/search_assistant/kibana.jsonc @@ -16,6 +16,7 @@ "requiredPlugins": [ "actions", "licensing", + "ml", // necessary for assistant's use of knowledge base in assistant package "observabilityAIAssistant", "triggersActionsUi", "share" diff --git a/x-pack/plugins/search_connectors/kibana.jsonc b/x-pack/plugins/search_connectors/kibana.jsonc index 6290b9692b38..45ae79ec2cb5 100644 --- a/x-pack/plugins/search_connectors/kibana.jsonc +++ b/x-pack/plugins/search_connectors/kibana.jsonc @@ -3,7 +3,7 @@ "id": "@kbn/search-connectors-plugin", "owner": "@elastic/search-kibana", // TODO this is currently used from Observability too, must be refactored before solution-specific builds - // see x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx + // see x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx // cc sphilipse "group": "search", "visibility": "private", diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.test.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.test.tsx index f5f4a0b7e8bd..7c807ac223ea 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.test.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.test.tsx @@ -40,20 +40,20 @@ describe('Delete Action', () => { it('renders', () => { render(<Wrapper item={mockItem} />); - expect(screen.getByTestId('inferenceUIDeleteAction')).toBeEnabled(); + expect(screen.getByTestId(/inferenceUIDeleteAction/)).toBeEnabled(); }); it('disable the delete action for preconfigured endpoint', () => { const preconfiguredMockItem = { ...mockItem, endpoint: '.multilingual-e5-small-elasticsearch' }; render(<Wrapper item={preconfiguredMockItem} />); - expect(screen.getByTestId('inferenceUIDeleteAction')).toBeDisabled(); + expect(screen.getByTestId(/inferenceUIDeleteAction/)).toBeDisabled(); }); it('loads confirm delete modal', () => { render(<Wrapper item={mockItem} />); - fireEvent.click(screen.getByTestId('inferenceUIDeleteAction')); + fireEvent.click(screen.getByTestId(/inferenceUIDeleteAction/)); expect(screen.getByTestId('deleteModalForInferenceUI')).toBeInTheDocument(); }); }); diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.tsx index fb31aeb31dca..5ab456e3694f 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_actions/actions/delete/delete_action.tsx @@ -33,6 +33,9 @@ export const DeleteAction: React.FC<DeleteActionProps> = ({ selectedEndpoint }) }); }; + const isPreconfigured = isEndpointPreconfigured(selectedEndpoint.endpoint); + const testSubj = `inferenceUIDeleteAction-${isPreconfigured ? 'preconfigured' : 'user-defined'}`; + return ( <> <EuiButtonIcon @@ -40,8 +43,8 @@ export const DeleteAction: React.FC<DeleteActionProps> = ({ selectedEndpoint }) defaultMessage: 'Delete inference endpoint {selectedEndpointName}', values: { selectedEndpointName: selectedEndpoint.endpoint }, })} - data-test-subj="inferenceUIDeleteAction" - disabled={isEndpointPreconfigured(selectedEndpoint.endpoint)} + data-test-subj={testSubj} + disabled={isPreconfigured} key="delete" iconType="trash" color="danger" diff --git a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.test.tsx b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.test.tsx index 60fb799074f1..b156c39d45f1 100644 --- a/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.test.tsx +++ b/x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/tabular_page.test.tsx @@ -127,7 +127,7 @@ describe('When the tabular page is loaded', () => { it('should only disable delete action for preconfigured endpoints', () => { render(<TabularPage inferenceEndpoints={inferenceEndpoints} />); - const deleteActions = screen.getAllByTestId('inferenceUIDeleteAction'); + const deleteActions = screen.getAllByTestId(/inferenceUIDeleteAction/); expect(deleteActions[0]).toBeDisabled(); expect(deleteActions[1]).toBeDisabled(); diff --git a/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts b/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts index 45c6e4c02ace..bb9789442c18 100644 --- a/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts +++ b/x-pack/plugins/search_solution/search_navigation/public/classic_navigation.test.ts @@ -15,23 +15,23 @@ describe('classicNavigationFactory', function () { const mockedNavLinks: Array<Partial<ChromeNavLink>> = [ { id: 'enterpriseSearch', - url: '/app/enterprise_search/overview', + url: '/app/elasticsearch/overview', title: 'Overview', }, { id: 'enterpriseSearchContent:searchIndices', title: 'Indices', - url: '/app/enterprise_search/content/search_indices', + url: '/app/elasticsearch/content/search_indices', }, { id: 'enterpriseSearchContent:connectors', title: 'Connectors', - url: '/app/enterprise_search/content/connectors', + url: '/app/elasticsearch/content/connectors', }, { id: 'enterpriseSearchContent:webCrawlers', title: 'Web Crawlers', - url: '/app/enterprise_search/content/crawlers', + url: '/app/elasticsearch/content/crawlers', }, ]; const mockedCoreStart = { @@ -69,7 +69,7 @@ describe('classicNavigationFactory', function () { icon: 'logoEnterpriseSearch', items: [ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Overview', @@ -82,7 +82,7 @@ describe('classicNavigationFactory', function () { it('will set isSelected', () => { mockHistory.location.pathname = '/overview'; - mockHistory.createHref.mockReturnValue('/app/enterprise_search/overview'); + mockHistory.createHref.mockReturnValue('/app/elasticsearch/overview'); const items: ClassicNavItem[] = [ { @@ -96,7 +96,7 @@ describe('classicNavigationFactory', function () { const solutionNav = classicNavigationFactory(items, core, history); expect(solutionNav!.items).toEqual([ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: true, name: 'Overview', @@ -132,14 +132,14 @@ describe('classicNavigationFactory', function () { id: 'searchContent', items: [ { - href: '/app/enterprise_search/content/search_indices', + href: '/app/elasticsearch/content/search_indices', id: 'searchIndices', isSelected: false, name: 'Indices', onClick: expect.any(Function), }, { - href: '/app/enterprise_search/content/connectors', + href: '/app/elasticsearch/content/connectors', id: 'searchConnectors', isSelected: false, name: 'Connectors', @@ -163,7 +163,7 @@ describe('classicNavigationFactory', function () { const solutionNav = classicNavigationFactory(items, core, history); expect(solutionNav!.items).toEqual([ { - href: '/app/enterprise_search/content/search_indices', + href: '/app/elasticsearch/content/search_indices', id: 'searchIndices', isSelected: false, name: 'Index Management', @@ -190,7 +190,7 @@ describe('classicNavigationFactory', function () { const solutionNav = classicNavigationFactory(items, core, history); expect(solutionNav!.items).toEqual([ { - href: '/app/enterprise_search/overview', + href: '/app/elasticsearch/overview', id: 'unit-test', isSelected: false, name: 'Overview', diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx index ec0c12aa3bc1..7a20eaf3eff1 100644 --- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx +++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.test.tsx @@ -414,14 +414,14 @@ describe('useUserProfileForm', () => { expect(testWrapper.exists('EuiBadgeGroup[data-test-subj="remainingRoles"]')).toBeFalsy(); }); - it('should display a popover for users with more than one role', () => { + it('should display a popover for users with more than three roles', () => { const data: UserProfileData = {}; const nonCloudUser = mockAuthenticatedUser({ elastic_cloud_user: false }); coreStart.settings.client.get.mockReturnValue(false); coreStart.settings.client.isOverridden.mockReturnValue(true); - nonCloudUser.roles = [...nonCloudUser.roles, 'user-role-1', 'user-role-2']; + nonCloudUser.roles = [...nonCloudUser.roles, 'user-role-1', 'user-role-2', 'user-role-3']; const testWrapper = mount( <Providers services={coreStart} @@ -436,7 +436,7 @@ describe('useUserProfileForm', () => { </Providers> ); - const extraRoles = nonCloudUser.roles.splice(1); + const extraRoles = nonCloudUser.roles.splice(3); const userRolesExpandButton = testWrapper.find( 'EuiButtonEmpty[data-test-subj="userRolesExpand"]' diff --git a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx index 30102964b343..6d2fd7344850 100644 --- a/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx +++ b/x-pack/plugins/security/public/account_management/user_profile/user_profile.tsx @@ -22,9 +22,12 @@ import { EuiIconTip, EuiKeyPadMenu, EuiKeyPadMenuItem, + EuiPageHeaderSection, EuiPopover, EuiSpacer, EuiText, + EuiTextTruncate, + EuiTitle, EuiToolTip, useEuiTheme, useGeneratedHtmlId, @@ -72,6 +75,28 @@ const formRowCSS = css` } `; +const pageHeaderCSS = css` + max-width: 1248px; + margin: auto; + border-bottom: none; +`; + +const pageTitleCSS = css` + min-width: 120px; +`; + +const rightSideItemsCSS = css` + justify-content: flex-start; + + @include euiBreakpoint('m') { + justify-content: flex-end; + } +`; + +const rightSideItemCSS = css` + min-width: 160px; +`; + export interface UserProfileProps { user: AuthenticatedUser; data?: UserProfileData; @@ -607,14 +632,13 @@ function UserPasswordEditor({ } const UserRoles: FunctionComponent<UserRoleProps> = ({ user }) => { - const { euiTheme } = useEuiTheme(); const [isPopoverOpen, setIsPopoverOpen] = useState(false); const onButtonClick = () => setIsPopoverOpen((isOpen) => !isOpen); const closePopover = () => setIsPopoverOpen(false); - const [firstRole] = user.roles; - const remainingRoles = user.roles.slice(1); + const firstThreeRoles = user.roles.slice(0, 3); + const remainingRoles = user.roles.slice(3); const renderMoreRoles = () => { const button = ( @@ -653,16 +677,13 @@ const UserRoles: FunctionComponent<UserRoleProps> = ({ user }) => { return ( <> - <div - style={{ - maxWidth: euiTheme.breakpoint.m / 6, - display: 'inline-block', - }} - > - <EuiBadge key={firstRole} color="hollow" data-test-subj={`role${firstRole}`}> - {firstRole} - </EuiBadge> - </div> + <EuiBadgeGroup gutterSize="xs" data-test-subj="displayedRoles"> + {firstThreeRoles.map((role) => ( + <EuiBadge key={role} color="hollow" data-test-subj={`role${role}`}> + {role} + </EuiBadge> + ))} + </EuiBadgeGroup> {remainingRoles.length ? renderMoreRoles() : null} </> ); @@ -693,7 +714,9 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data }) defaultMessage="Username" /> ), - description: user.username as string | undefined | JSX.Element, + description: + user.username && + ((<EuiTextTruncate text={user.username} />) as string | undefined | JSX.Element), helpText: ( <FormattedMessage id="xpack.security.accountManagement.userProfile.usernameHelpText" @@ -712,7 +735,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data }) defaultMessage="Full name" /> ), - description: user.full_name, + description: user.full_name && <EuiTextTruncate text={user.full_name} />, helpText: ( <FormattedMessage id="xpack.security.accountManagement.userProfile.fullNameHelpText" @@ -729,7 +752,7 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data }) defaultMessage="Email address" /> ), - description: user.email, + description: user.email && <EuiTextTruncate text={user.email} />, helpText: ( <FormattedMessage id="xpack.security.accountManagement.userProfile.emailHelpText" @@ -778,48 +801,61 @@ export const UserProfile: FunctionComponent<UserProfileProps> = ({ user, data }) /> ) : null} - <KibanaPageTemplate className="eui-fullHeight" restrictWidth={1000}> - <KibanaPageTemplate.Header - pageTitle={ - <FormattedMessage - id="xpack.security.accountManagement.userProfile.title" - defaultMessage="Profile" - /> - } - id={titleId} - rightSideItems={rightSideItems.reverse().map((item) => ( - <EuiDescriptionList - textStyle="reverse" - listItems={[ - { - title: ( - <EuiText color={euiTheme.colors.darkestShade} size="s"> - <EuiFlexGroup responsive={false} alignItems="center" gutterSize="none"> - <EuiFlexItem grow={false}>{item.title}</EuiFlexItem> - <EuiFlexItem grow={false} style={{ marginLeft: '0.33em' }}> - <EuiIconTip type="questionInCircle" content={item.helpText} /> - </EuiFlexItem> - </EuiFlexGroup> - </EuiText> - ), - description: ( - <span data-test-subj={item.testSubj}> - {item.description || ( - <EuiText color={euiTheme.colors.disabledText} size="s"> - <FormattedMessage - id="xpack.security.accountManagement.userProfile.noneProvided" - defaultMessage="None provided" - /> + <KibanaPageTemplate className="eui-fullHeight" restrictWidth={true}> + <KibanaPageTemplate.Header id={titleId} css={pageHeaderCSS}> + <EuiPageHeaderSection> + <EuiTitle size="l" css={pageTitleCSS}> + <h1> + <FormattedMessage + id="xpack.security.accountManagement.userProfile.title" + defaultMessage="Profile" + /> + </h1> + </EuiTitle> + </EuiPageHeaderSection> + <EuiPageHeaderSection> + <EuiFlexGroup alignItems="flexStart" css={rightSideItemsCSS}> + {rightSideItems.map((item) => ( + <EuiDescriptionList + key={item.testSubj} + textStyle="reverse" + css={rightSideItemCSS} + listItems={[ + { + title: ( + <EuiText color={euiTheme.colors.darkestShade} size="s"> + <EuiFlexGroup + responsive={false} + alignItems="center" + gutterSize="none" + > + <EuiFlexItem grow={false}>{item.title}</EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiIconTip type="questionInCircle" content={item.helpText} /> + </EuiFlexItem> + </EuiFlexGroup> </EuiText> - )} - </span> - ), - }, - ]} - compressed - /> - ))} - /> + ), + description: ( + <span data-test-subj={item.testSubj}> + {item.description || ( + <EuiText color={euiTheme.colors.textDisabled} size="s"> + <FormattedMessage + id="xpack.security.accountManagement.userProfile.noneProvided" + defaultMessage="None provided" + /> + </EuiText> + )} + </span> + ), + }, + ]} + compressed + /> + ))} + </EuiFlexGroup> + </EuiPageHeaderSection> + </KibanaPageTemplate.Header> <KibanaPageTemplate.Section> <Form aria-labelledby={titleId}> <UserDetailsEditor user={user} /> diff --git a/x-pack/plugins/security/server/authorization/api_authorization.test.ts b/x-pack/plugins/security/server/authorization/api_authorization.test.ts index 0181c98d6f1b..d2db2a535b1d 100644 --- a/x-pack/plugins/security/server/authorization/api_authorization.test.ts +++ b/x-pack/plugins/security/server/authorization/api_authorization.test.ts @@ -20,7 +20,11 @@ import { authorizationMock } from './index.mock'; describe('initAPIAuthorization', () => { test(`protected route when "mode.useRbacForRequest()" returns false continues`, async () => { const mockHTTPSetup = coreMock.createSetup().http; - const mockAuthz = authorizationMock.create(); + const mockAuthz = { + ...authorizationMock.create(), + getCurrentUser: jest.fn(), + getSecurityConfig: jest.fn(), + }; initAPIAuthorization(mockHTTPSetup, mockAuthz, loggingSystemMock.create().get()); const [[postAuthHandler]] = mockHTTPSetup.registerOnPostAuth.mock.calls; @@ -44,7 +48,11 @@ describe('initAPIAuthorization', () => { test(`unprotected route when "mode.useRbacForRequest()" returns true continues`, async () => { const mockHTTPSetup = coreMock.createSetup().http; - const mockAuthz = authorizationMock.create(); + const mockAuthz = { + ...authorizationMock.create(), + getCurrentUser: jest.fn(), + getSecurityConfig: jest.fn(), + }; initAPIAuthorization(mockHTTPSetup, mockAuthz, loggingSystemMock.create().get()); const [[postAuthHandler]] = mockHTTPSetup.registerOnPostAuth.mock.calls; @@ -68,7 +76,11 @@ describe('initAPIAuthorization', () => { test(`protected route when "mode.useRbacForRequest()" returns true and user is authorized continues`, async () => { const mockHTTPSetup = coreMock.createSetup().http; - const mockAuthz = authorizationMock.create({ version: '1.0.0-zeta1' }); + const mockAuthz = { + ...authorizationMock.create({ version: '1.0.0-zeta1' }), + getCurrentUser: jest.fn(), + getSecurityConfig: jest.fn(), + }; initAPIAuthorization(mockHTTPSetup, mockAuthz, loggingSystemMock.create().get()); const [[postAuthHandler]] = mockHTTPSetup.registerOnPostAuth.mock.calls; @@ -105,7 +117,11 @@ describe('initAPIAuthorization', () => { test(`protected route when "mode.useRbacForRequest()" returns true and user isn't authorized responds with a 403`, async () => { const mockHTTPSetup = coreMock.createSetup().http; - const mockAuthz = authorizationMock.create({ version: '1.0.0-zeta1' }); + const mockAuthz = { + ...authorizationMock.create({ version: '1.0.0-zeta1' }), + getCurrentUser: jest.fn(), + getSecurityConfig: jest.fn(), + }; initAPIAuthorization(mockHTTPSetup, mockAuthz, loggingSystemMock.create().get()); const [[postAuthHandler]] = mockHTTPSetup.registerOnPostAuth.mock.calls; @@ -146,8 +162,10 @@ describe('initAPIAuthorization', () => { { security, kibanaPrivilegesResponse, + kibanaCurrentUserResponse, kibanaPrivilegesRequestActions, asserts, + esXpackSecurityUsageResponse, }: { security?: RouteSecurity; kibanaPrivilegesResponse?: { @@ -155,6 +173,10 @@ describe('initAPIAuthorization', () => { hasAllRequested?: boolean; }; kibanaPrivilegesRequestActions?: string[]; + kibanaCurrentUserResponse?: { operator: boolean }; + esXpackSecurityUsageResponse?: { + operator_privileges: { enabled: boolean; available: boolean }; + }; asserts: { forbidden?: boolean; authzResult?: Record<string, boolean>; @@ -164,7 +186,11 @@ describe('initAPIAuthorization', () => { ) => { test(description, async () => { const mockHTTPSetup = coreMock.createSetup().http; - const mockAuthz = authorizationMock.create({ version: '1.0.0-zeta1' }); + const mockAuthz = { + ...authorizationMock.create({ version: '1.0.0-zeta1' }), + getCurrentUser: jest.fn(), + getSecurityConfig: jest.fn(), + }; initAPIAuthorization(mockHTTPSetup, mockAuthz, loggingSystemMock.create().get()); const [[postAuthHandler]] = mockHTTPSetup.registerOnPostAuth.mock.calls; @@ -185,6 +211,8 @@ describe('initAPIAuthorization', () => { const mockPostAuthToolkit = httpServiceMock.createOnPostAuthToolkit(); const mockCheckPrivileges = jest.fn().mockReturnValue(kibanaPrivilegesResponse); + mockAuthz.getCurrentUser.mockReturnValue(kibanaCurrentUserResponse); + mockAuthz.getSecurityConfig.mockResolvedValue(esXpackSecurityUsageResponse); mockAuthz.mode.useRbacForRequest.mockReturnValue(true); mockAuthz.checkPrivilegesDynamicallyWithRequest.mockImplementation((request) => { // hapi conceals the actual "request" from us, so we make sure that the headers are passed to @@ -356,28 +384,77 @@ describe('initAPIAuthorization', () => { ); testSecurityConfig( - `protected route returns forbidden if user has allRequired AND NONE of anyRequired privileges requested`, + `protected route returns "authzResult" if user has operator privileges requested and user is operator`, { security: { authz: { - requiredPrivileges: [ - { - allRequired: ['privilege1'], - anyRequired: ['privilege2', 'privilege3'], - }, - ], + requiredPrivileges: [ReservedPrivilegesSet.operator], + }, + }, + kibanaCurrentUserResponse: { operator: true }, + esXpackSecurityUsageResponse: { operator_privileges: { enabled: true, available: true } }, + asserts: { + authzResult: { + operator: true, + }, + }, + } + ); + + testSecurityConfig( + `protected route returns "authzResult" if user has requested operator privileges and operator privileges are disabled`, + { + security: { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator, 'privilege1'], }, }, - kibanaPrivilegesRequestActions: ['privilege1', 'privilege2', 'privilege3'], kibanaPrivilegesResponse: { privileges: { - kibana: [ - { privilege: 'api:privilege1', authorized: true }, - { privilege: 'api:privilege2', authorized: false }, - { privilege: 'api:privilege3', authorized: false }, - ], + kibana: [{ privilege: 'api:privilege1', authorized: true }], + }, + }, + kibanaCurrentUserResponse: { operator: false }, + esXpackSecurityUsageResponse: { operator_privileges: { enabled: false, available: false } }, + asserts: { + authzResult: { + privilege1: true, + }, + }, + } + ); + + testSecurityConfig( + `protected route returns forbidden if user operator privileges are disabled and user doesn't have additional privileges granted`, + { + security: { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator, 'privilege1'], + }, + }, + kibanaPrivilegesResponse: { + privileges: { + kibana: [{ privilege: 'api:privilege1', authorized: false }], + }, + }, + kibanaCurrentUserResponse: { operator: false }, + esXpackSecurityUsageResponse: { operator_privileges: { enabled: false, available: false } }, + asserts: { + forbidden: true, + }, + } + ); + + testSecurityConfig( + `protected route returns forbidden if user has operator privileges requested and user is not operator`, + { + security: { + authz: { + requiredPrivileges: [ReservedPrivilegesSet.operator], }, }, + esXpackSecurityUsageResponse: { operator_privileges: { enabled: true, available: true } }, + kibanaCurrentUserResponse: { operator: false }, asserts: { forbidden: true, }, diff --git a/x-pack/plugins/security/server/authorization/api_authorization.ts b/x-pack/plugins/security/server/authorization/api_authorization.ts index 888d74e7d7bb..dbfc8d03000e 100644 --- a/x-pack/plugins/security/server/authorization/api_authorization.ts +++ b/x-pack/plugins/security/server/authorization/api_authorization.ts @@ -5,17 +5,22 @@ * 2.0. */ +import { ReservedPrivilegesSet } from '@kbn/core/server'; import type { AuthzDisabled, AuthzEnabled, HttpServiceSetup, + KibanaRequest, Logger, Privilege, PrivilegeSet, RouteAuthz, } from '@kbn/core/server'; -import { ReservedPrivilegesSet } from '@kbn/core/server'; -import type { AuthorizationServiceSetup } from '@kbn/security-plugin-types-server'; +import type { AuthenticatedUser } from '@kbn/security-plugin-types-common'; +import type { + AuthorizationServiceSetup, + EsSecurityConfig, +} from '@kbn/security-plugin-types-server'; import type { RecursiveReadonly } from '@kbn/utility-types'; import { API_OPERATION_PREFIX, SUPERUSER_PRIVILEGES } from '../../common/constants'; @@ -28,6 +33,11 @@ const isReservedPrivilegeSet = (privilege: string): privilege is ReservedPrivile return Object.hasOwn(ReservedPrivilegesSet, privilege); }; +interface InitApiAuthorization extends AuthorizationServiceSetup { + getCurrentUser: (request: KibanaRequest) => AuthenticatedUser | null; + getSecurityConfig: () => Promise<EsSecurityConfig>; +} + export function initAPIAuthorization( http: HttpServiceSetup, { @@ -35,7 +45,9 @@ export function initAPIAuthorization( checkPrivilegesDynamicallyWithRequest, checkPrivilegesWithRequest, mode, - }: AuthorizationServiceSetup, + getCurrentUser, + getSecurityConfig, + }: InitApiAuthorization, logger: Logger ) { http.registerOnPostAuth(async (request, response, toolkit) => { @@ -52,8 +64,55 @@ export function initAPIAuthorization( } const authz = security.authz as AuthzEnabled; + const normalizeRequiredPrivileges = async ( + privileges: AuthzEnabled['requiredPrivileges'] + ) => { + const hasOperatorPrivileges = privileges.some( + (privilege) => + privilege === ReservedPrivilegesSet.operator || + (typeof privilege === 'object' && + privilege.allRequired?.includes(ReservedPrivilegesSet.operator)) + ); + + // nothing to normalize + if (!hasOperatorPrivileges) { + return privileges; + } + + const securityConfig = await getSecurityConfig(); - const { requestedPrivileges, requestedReservedPrivileges } = authz.requiredPrivileges.reduce( + // nothing to normalize + if (securityConfig.operator_privileges.enabled) { + return privileges; + } + + return privileges.reduce<AuthzEnabled['requiredPrivileges']>((acc, privilege) => { + if (typeof privilege === 'object') { + const operatorPrivilegeIndex = + privilege.allRequired?.findIndex((p) => p === ReservedPrivilegesSet.operator) ?? -1; + + acc.push( + operatorPrivilegeIndex !== -1 + ? { + ...privilege, + // @ts-ignore wrong types for `toSpliced` + allRequired: privilege.allRequired?.toSpliced(operatorPrivilegeIndex, 1), + } + : privilege + ); + } else if (privilege !== ReservedPrivilegesSet.operator) { + acc.push(privilege); + } + + return acc; + }, []); + }; + + // We need to normalize privileges to drop unintended privilege checks. + // Operator privileges check should be only performed if the `operator_privileges` are enabled in config. + const requiredPrivileges = await normalizeRequiredPrivileges(authz.requiredPrivileges); + + const { requestedPrivileges, requestedReservedPrivileges } = requiredPrivileges.reduce( (acc, privilegeEntry) => { const privileges = typeof privilegeEntry === 'object' @@ -97,10 +156,15 @@ export function initAPIAuthorization( const checkSuperuserPrivilegesResponse = await checkPrivilegesWithRequest( request ).globally(SUPERUSER_PRIVILEGES); - kibanaPrivileges[ReservedPrivilegesSet.superuser] = checkSuperuserPrivilegesResponse.hasAllRequested; } + + if (reservedPrivilege === ReservedPrivilegesSet.operator) { + const currentUser = getCurrentUser(request); + + kibanaPrivileges[ReservedPrivilegesSet.operator] = currentUser?.operator ?? false; + } } const hasRequestedPrivilege = (kbPrivilege: Privilege | PrivilegeSet) => { @@ -118,8 +182,8 @@ export function initAPIAuthorization( return kibanaPrivileges[kbPrivilege]; }; - for (const requiredPrivilege of authz.requiredPrivileges) { - if (!hasRequestedPrivilege(requiredPrivilege)) { + for (const privilege of requiredPrivileges) { + if (!hasRequestedPrivilege(privilege)) { const missingPrivileges = Object.keys(kibanaPrivileges).filter( (key) => !kibanaPrivileges[key] ); diff --git a/x-pack/plugins/security/server/authorization/authorization_service.test.ts b/x-pack/plugins/security/server/authorization/authorization_service.test.ts index de3646166d8f..3317fff03bd6 100644 --- a/x-pack/plugins/security/server/authorization/authorization_service.test.ts +++ b/x-pack/plugins/security/server/authorization/authorization_service.test.ts @@ -15,6 +15,7 @@ import { mockRegisterPrivilegesWithCluster, } from './service.test.mocks'; +import type { Client } from '@elastic/elasticsearch'; import { Subject } from 'rxjs'; import { coreMock, elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; @@ -38,6 +39,9 @@ const mockCheckPrivilegesDynamicallyWithRequest = Symbol(); const mockCheckSavedObjectsPrivilegesWithRequest = Symbol(); const mockPrivilegesService = Symbol(); const mockAuthorizationMode = Symbol(); +const mockEsSecurityResponse = { + security: { operator_privileges: { enabled: false, available: false } }, +}; beforeEach(() => { mockCheckPrivilegesFactory.mockReturnValue({ checkPrivilegesWithRequest: mockCheckPrivilegesWithRequest, @@ -59,6 +63,9 @@ afterEach(() => { it(`#setup returns exposed services`, () => { const mockClusterClient = elasticsearchServiceMock.createClusterClient(); + mockClusterClient.asInternalUser.xpack.usage.mockResolvedValue( + mockEsSecurityResponse as Awaited<ReturnType<Client['xpack']['usage']>> + ); const mockGetSpacesService = jest .fn() .mockReturnValue({ getSpaceId: jest.fn(), namespaceToSpaceId: jest.fn() }); @@ -126,6 +133,9 @@ describe('#start', () => { statusSubject = new Subject<OnlineStatusRetryScheduler>(); const mockClusterClient = elasticsearchServiceMock.createClusterClient(); + mockClusterClient.asInternalUser.xpack.usage.mockResolvedValue( + mockEsSecurityResponse as Awaited<ReturnType<Client['xpack']['usage']>> + ); const mockCoreSetup = coreMock.createSetup(); const authorizationService = new AuthorizationService(); @@ -194,6 +204,9 @@ describe('#start', () => { it('#stop unsubscribes from license and ES updates.', async () => { const mockClusterClient = elasticsearchServiceMock.createClusterClient(); + mockClusterClient.asInternalUser.xpack.usage.mockResolvedValue( + mockEsSecurityResponse as Awaited<ReturnType<Client['xpack']['usage']>> + ); const statusSubject = new Subject<OnlineStatusRetryScheduler>(); const mockCoreSetup = coreMock.createSetup(); diff --git a/x-pack/plugins/security/server/authorization/authorization_service.tsx b/x-pack/plugins/security/server/authorization/authorization_service.tsx index c8e036b07679..d58e24d3b84f 100644 --- a/x-pack/plugins/security/server/authorization/authorization_service.tsx +++ b/x-pack/plugins/security/server/authorization/authorization_service.tsx @@ -123,6 +123,14 @@ export class AuthorizationService { this.applicationName ); + const esSecurityConfig = getClusterClient() + .then((client) => + client.asInternalUser.xpack.usage({ + filter_path: 'security.operator_privileges', + }) + ) + .then(({ security }) => security); + const authz = { actions, applicationName: this.applicationName, @@ -168,7 +176,11 @@ export class AuthorizationService { } ); - initAPIAuthorization(http, authz, loggers.get('api-authorization')); + initAPIAuthorization( + http, + { ...authz, getCurrentUser, getSecurityConfig: () => esSecurityConfig }, + loggers.get('api-authorization') + ); initAppAuthorization(http, authz, loggers.get('app-authorization'), features); http.registerOnPreResponse(async (request, preResponse, toolkit) => { diff --git a/x-pack/plugins/security/server/plugin.test.ts b/x-pack/plugins/security/server/plugin.test.ts index 4b9479f51a0f..958e22a3f2dd 100644 --- a/x-pack/plugins/security/server/plugin.test.ts +++ b/x-pack/plugins/security/server/plugin.test.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { Client } from '@elastic/elasticsearch'; import { of } from 'rxjs'; import { ByteSizeValue } from '@kbn/config-schema'; @@ -46,6 +47,13 @@ describe('Security Plugin', () => { mockCoreSetup = coreMock.createSetup({ pluginStartContract: { userProfiles: userProfileServiceMock.createStart() }, }); + + const core = coreMock.createRequestHandlerContext(); + + core.elasticsearch.client.asInternalUser.xpack.usage.mockResolvedValue({ + security: { operator_privileges: { enabled: false, available: false } }, + } as Awaited<ReturnType<Client['xpack']['usage']>>); + mockCoreSetup.http.getServerInfo.mockReturnValue({ hostname: 'localhost', name: 'kibana', @@ -64,6 +72,12 @@ describe('Security Plugin', () => { mockCoreStart = coreMock.createStart(); + mockCoreSetup.getStartServices.mockResolvedValue([ + // @ts-expect-error only mocking the client we use + { elasticsearch: core.elasticsearch }, + mockSetupDependencies.features, + ]); + mockStartDependencies = { features: featuresPluginMock.createStart(), licensing: licensingMock.createStart(), diff --git a/x-pack/plugins/security/server/plugin.ts b/x-pack/plugins/security/server/plugin.ts index afd21a83712a..119dbcef1342 100644 --- a/x-pack/plugins/security/server/plugin.ts +++ b/x-pack/plugins/security/server/plugin.ts @@ -80,7 +80,7 @@ export interface SecurityPluginSetup extends SecurityPluginSetupWithoutDeprecate /** * @deprecated Use `authz` methods from the `SecurityServiceStart` contract instead. */ - authz: AuthorizationServiceSetup; + authz: Omit<AuthorizationServiceSetup, 'getCurrentUser' | 'getSecurityConfig'>; } export interface PluginSetupDependencies { @@ -344,7 +344,7 @@ export class SecurityPlugin return Object.freeze<SecurityPluginSetup>({ audit: this.auditSetup, authc: { - getCurrentUser: (request) => this.getAuthentication().getCurrentUser(request), + getCurrentUser, }, authz: { actions: this.authorizationSetup.actions, diff --git a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts b/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts index 0021aece6745..3ef53e7b7c67 100644 --- a/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts +++ b/x-pack/plugins/security_solution/common/api/detection_engine/prebuilt_rules/perform_rule_upgrade/perform_rule_upgrade_route.ts @@ -115,7 +115,7 @@ export const RuleUpgradeSpecifier = z.object({ export type UpgradeSpecificRulesRequest = z.infer<typeof UpgradeSpecificRulesRequest>; export const UpgradeSpecificRulesRequest = z.object({ mode: z.literal('SPECIFIC_RULES'), - rules: z.array(RuleUpgradeSpecifier), + rules: z.array(RuleUpgradeSpecifier).min(1), pick_version: PickVersionValues.optional(), }); diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/index.ts new file mode 100644 index 000000000000..0d09b1656ba8 --- /dev/null +++ b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/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 './run_script'; diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.ts new file mode 100644 index 000000000000..dfa88941b34e --- /dev/null +++ b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { TypeOf } from '@kbn/config-schema'; +import { schema } from '@kbn/config-schema'; +import { BaseActionRequestSchema } from '../../common/base'; + +const { parameters, ...restBaseSchema } = BaseActionRequestSchema; +const NonEmptyString = schema.string({ + minLength: 1, + validate: (value) => { + if (!value.trim().length) { + return 'Raw cannot be an empty string'; + } + }, +}); +export const RunScriptActionRequestSchema = { + body: schema.object({ + ...restBaseSchema, + parameters: schema.object( + { + /** + * The script to run + */ + Raw: schema.maybe(NonEmptyString), + /** + * The path to the script on the host to run + */ + HostPath: schema.maybe(NonEmptyString), + /** + * The path to the script in the cloud to run + */ + CloudFile: schema.maybe(NonEmptyString), + /** + * The command line to run + */ + CommandLine: schema.maybe(NonEmptyString), + /** + * The max timeout value before the command is killed. Number represents milliseconds + */ + Timeout: schema.maybe(schema.number({ min: 1 })), + }, + { + validate: (params) => { + if (!params.Raw && !params.HostPath && !params.CloudFile) { + return 'At least one of Raw, HostPath, or CloudFile must be provided'; + } + }, + } + ), + }), +}; + +export type RunScriptActionRequestBody = TypeOf<typeof RunScriptActionRequestSchema.body>; diff --git a/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml new file mode 100644 index 000000000000..228070e1d027 --- /dev/null +++ b/x-pack/plugins/security_solution/common/api/endpoint/actions/response_actions/run_script/run_script.yaml @@ -0,0 +1,74 @@ +openapi: 3.0.0 +info: + title: RunScript Action Schema + version: '2023-10-31' +paths: + /api/endpoint/action/runscript: + post: + summary: Run a script + operationId: RunScriptAction + description: Run a shell command on an endpoint. + x-codegen-enabled: true + x-labels: [ ess, serverless ] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RunScriptRouteRequestBody' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '../../../model/schema/common.schema.yaml#/components/schemas/SuccessResponse' + +components: + schemas: + RunScriptRouteRequestBody: + allOf: + - $ref: '../../../model/schema/common.schema.yaml#/components/schemas/BaseActionSchema' + - type: object + required: + - parameters + properties: + parameters: + oneOf: + - type: object + properties: + Raw: + type: string + minLength: 1 + description: Raw script content. + required: + - Raw + - type: object + properties: + HostPath: + type: string + minLength: 1 + description: Absolute or relative path of script on host machine. + required: + - HostPath + - type: object + properties: + CloudFile: + type: string + minLength: 1 + description: Script name in cloud storage. + required: + - CloudFile + - type: object + properties: + CommandLine: + type: string + minLength: 1 + description: Command line arguments. + required: + - CommandLine + properties: + Timeout: + type: integer + minimum: 1 + description: Timeout in seconds. diff --git a/x-pack/plugins/security_solution/common/api/endpoint/index.ts b/x-pack/plugins/security_solution/common/api/endpoint/index.ts index 5917101be93a..af2df1d1ce09 100644 --- a/x-pack/plugins/security_solution/common/api/endpoint/index.ts +++ b/x-pack/plugins/security_solution/common/api/endpoint/index.ts @@ -24,6 +24,7 @@ export * from './actions/response_actions/get_file'; export * from './actions/response_actions/execute'; export * from './actions/response_actions/upload'; export * from './actions/response_actions/scan'; +export * from './actions/response_actions/run_script'; export * from './metadata'; diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts new file mode 100644 index 000000000000..19e64986b822 --- /dev/null +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +/* + * NOTICE: Do not edit this file manually. + * This file is automatically generated by the OpenAPI Generator, @kbn/openapi-generator. + * + * info: + * title: Risk Scoring API + * version: 2023-10-31 + */ + +import { z } from '@kbn/zod'; + +export type ConfigureRiskEngineSavedObjectErrorResponse = z.infer< + typeof ConfigureRiskEngineSavedObjectErrorResponse +>; +export const ConfigureRiskEngineSavedObjectErrorResponse = z.object({ + risk_engine_saved_object_configured: z.boolean(), + errors: z.array( + z.object({ + seq: z.number().int(), + error: z.string(), + }) + ), +}); + +export type ConfigureRiskEngineSavedObjectRequestBody = z.infer< + typeof ConfigureRiskEngineSavedObjectRequestBody +>; +export const ConfigureRiskEngineSavedObjectRequestBody = z.object({ + exclude_alert_statuses: z.array(z.string()).optional(), + range: z + .object({ + start: z.string().optional(), + end: z.string().optional(), + }) + .optional(), + exclude_alert_tags: z.array(z.string()).optional(), +}); +export type ConfigureRiskEngineSavedObjectRequestBodyInput = z.input< + typeof ConfigureRiskEngineSavedObjectRequestBody +>; + +export type ConfigureRiskEngineSavedObjectResponse = z.infer< + typeof ConfigureRiskEngineSavedObjectResponse +>; +export const ConfigureRiskEngineSavedObjectResponse = z.object({ + risk_engine_saved_object_configured: z.boolean().optional(), +}); diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml new file mode 100644 index 000000000000..4c9a1cf1f369 --- /dev/null +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.schema.yaml @@ -0,0 +1,81 @@ +openapi: 3.0.0 +info: + version: '2023-10-31' + title: Risk Scoring API + description: These APIs allow the consumer to configure the Risk Engine Saved Object. +paths: + /api/risk_score/engine/saved_object/configure: + patch: + x-labels: [ess, serverless] + x-codegen-enabled: true + operationId: ConfigureRiskEngineSavedObject + summary: Configure the Risk Engine Saved Object + description: Configuring the Risk Engine Saved Object + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + exclude_alert_statuses: + type: array + items: + type: string + range: + type: object + properties: + start: + type: string + end: + type: string + exclude_alert_tags: + type: array + items: + type: string + responses: + '200': + description: Successful response + content: + application/json: + schema: + type: object + properties: + risk_engine_saved_object_configured: + type: boolean + '400': + description: Task manager is unavailable + content: + application/json: + schema: + $ref: '../common/common.schema.yaml#/components/schemas/TaskManagerUnavailableResponse' + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/ConfigureRiskEngineSavedObjectErrorResponse' + +components: + schemas: + ConfigureRiskEngineSavedObjectErrorResponse: + type: object + required: + - risk_engine_saved_object_configured + - errors + properties: + risk_engine_saved_object_configured: + type: boolean + example: false + errors: + type: array + items: + type: object + required: + - seq + - error + properties: + seq: + type: integer + error: + type: string diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts index 21dc89544c8d..98d62fd1b5a9 100644 --- a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/index.ts @@ -16,3 +16,4 @@ export * from './preview_route.gen'; export * from './entity_calculation_route.gen'; export * from './get_risk_engine_privileges.gen'; export * from './engine_cleanup_route.gen'; +export * from './engine_configure_saved_object_route.gen'; diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts index c58d2c02d562..1b410a143683 100644 --- a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.gen.ts @@ -58,9 +58,11 @@ export const RiskScoresPreviewRequest = z.object({ /** * A list of alert statuses to exclude from the risk score calculation. If unspecified, all alert statuses are included. */ - excludeAlertStatuses: z - .array(z.enum(['open', 'closed', 'in-progress', 'acknowledged'])) - .optional(), + exclude_alert_statuses: z.array(z.string()).optional(), + /** + * A list of alert tags to exclude from the risk score calculation. If unspecified, all alert tags are included. + */ + exclude_alert_tags: z.array(z.string()).optional(), }); export type RiskScoresPreviewResponse = z.infer<typeof RiskScoresPreviewResponse>; diff --git a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml index a634a1a75975..45d40a057f22 100644 --- a/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml +++ b/x-pack/plugins/security_solution/common/api/entity_analytics/risk_engine/preview_route.schema.yaml @@ -58,16 +58,16 @@ components: description: Defines the time period over which scores will be evaluated. If unspecified, a range of `[now, now-30d]` will be used. weights: $ref: '../common/common.schema.yaml#/components/schemas/RiskScoreWeights' - excludeAlertStatuses: + exclude_alert_statuses: description: A list of alert statuses to exclude from the risk score calculation. If unspecified, all alert statuses are included. type: array items: type: string - enum: - - open - - closed - - in-progress - - acknowledged + exclude_alert_tags: + description: A list of alert tags to exclude from the risk score calculation. If unspecified, all alert tags are included. + type: array + items: + type: string RiskScoresPreviewResponse: diff --git a/x-pack/plugins/security_solution/common/api/model/primitives.gen.ts b/x-pack/plugins/security_solution/common/api/model/primitives.gen.ts index ed3174434cb3..393cfe7a21c5 100644 --- a/x-pack/plugins/security_solution/common/api/model/primitives.gen.ts +++ b/x-pack/plugins/security_solution/common/api/model/primitives.gen.ts @@ -15,15 +15,13 @@ */ import { z } from '@kbn/zod'; +import { isNonEmptyString } from '@kbn/zod-helpers'; /** - * A string that is not empty and does not contain only whitespace + * A string that does not contain only whitespace characters */ export type NonEmptyString = z.infer<typeof NonEmptyString>; -export const NonEmptyString = z - .string() - .min(1) - .regex(/^(?! *$).+$/); +export const NonEmptyString = z.string().min(1).superRefine(isNonEmptyString); /** * A universally unique identifier diff --git a/x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml b/x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml index 177ad2ed30ec..2d4e184928fc 100644 --- a/x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml +++ b/x-pack/plugins/security_solution/common/api/model/primitives.schema.yaml @@ -8,9 +8,9 @@ components: schemas: NonEmptyString: type: string - pattern: ^(?! *$).+$ + format: nonempty minLength: 1 - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters UUID: type: string diff --git a/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts b/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts index b5d72fc1ef20..fa315e3c421a 100644 --- a/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts +++ b/x-pack/plugins/security_solution/common/api/quickstart_client.gen.ts @@ -276,6 +276,10 @@ import type { GetEntityStoreStatusResponse, } from './entity_analytics/entity_store/status.gen'; import type { CleanUpRiskEngineResponse } from './entity_analytics/risk_engine/engine_cleanup_route.gen'; +import type { + ConfigureRiskEngineSavedObjectRequestBodyInput, + ConfigureRiskEngineSavedObjectResponse, +} from './entity_analytics/risk_engine/engine_configure_saved_object_route.gen'; import type { DisableRiskEngineResponse } from './entity_analytics/risk_engine/engine_disable_route.gen'; import type { EnableRiskEngineResponse } from './entity_analytics/risk_engine/engine_enable_route.gen'; import type { InitRiskEngineResponse } from './entity_analytics/risk_engine/engine_init_route.gen'; @@ -368,6 +372,8 @@ import type { GetRuleMigrationResourcesRequestQueryInput, GetRuleMigrationResourcesRequestParamsInput, GetRuleMigrationResourcesResponse, + GetRuleMigrationResourcesMissingRequestParamsInput, + GetRuleMigrationResourcesMissingResponse, GetRuleMigrationStatsRequestParamsInput, GetRuleMigrationStatsResponse, GetRuleMigrationTranslationStatsRequestParamsInput, @@ -600,6 +606,22 @@ If asset criticality records already exist for the specified entities, those rec }) .catch(catchAxiosErrorFormatAndThrow); } + /** + * Configuring the Risk Engine Saved Object + */ + async configureRiskEngineSavedObject(props: ConfigureRiskEngineSavedObjectProps) { + this.log.info(`${new Date().toISOString()} Calling API ConfigureRiskEngineSavedObject`); + return this.kbnClient + .request<ConfigureRiskEngineSavedObjectResponse>({ + path: '/api/risk_score/engine/saved_object/configure', + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '2023-10-31', + }, + method: 'PATCH', + body: props.body, + }) + .catch(catchAxiosErrorFormatAndThrow); + } /** * Copies and returns a timeline or timeline template. @@ -1471,6 +1493,24 @@ finalize it. }) .catch(catchAxiosErrorFormatAndThrow); } + /** + * Identifies missing resources from all the rules of an existing SIEM rules migration + */ + async getRuleMigrationResourcesMissing(props: GetRuleMigrationResourcesMissingProps) { + this.log.info(`${new Date().toISOString()} Calling API GetRuleMigrationResourcesMissing`); + return this.kbnClient + .request<GetRuleMigrationResourcesMissingResponse>({ + path: replaceParams( + '/internal/siem_migrations/rules/{migration_id}/resources/missing', + props.params + ), + headers: { + [ELASTIC_HTTP_VERSION_HEADER]: '1', + }, + method: 'GET', + }) + .catch(catchAxiosErrorFormatAndThrow); + } /** * Retrieves the stats of a SIEM rules migration using the migration id provided */ @@ -2275,6 +2315,9 @@ export interface BulkUpsertAssetCriticalityRecordsProps { export interface CleanDraftTimelinesProps { body: CleanDraftTimelinesRequestBodyInput; } +export interface ConfigureRiskEngineSavedObjectProps { + body: ConfigureRiskEngineSavedObjectRequestBodyInput; +} export interface CopyTimelineProps { body: CopyTimelineRequestBodyInput; } @@ -2423,6 +2466,9 @@ export interface GetRuleMigrationResourcesProps { query: GetRuleMigrationResourcesRequestQueryInput; params: GetRuleMigrationResourcesRequestParamsInput; } +export interface GetRuleMigrationResourcesMissingProps { + params: GetRuleMigrationResourcesMissingRequestParamsInput; +} export interface GetRuleMigrationStatsProps { params: GetRuleMigrationStatsRequestParamsInput; } diff --git a/x-pack/plugins/security_solution/common/constants.ts b/x-pack/plugins/security_solution/common/constants.ts index 265af5a47e1f..3818813d94a7 100644 --- a/x-pack/plugins/security_solution/common/constants.ts +++ b/x-pack/plugins/security_solution/common/constants.ts @@ -282,8 +282,6 @@ export const PINNED_EVENT_URL = '/api/pinned_event' as const; export const SOURCERER_API_URL = '/internal/security_solution/sourcerer' as const; export const RISK_SCORE_INDEX_STATUS_API_URL = '/internal/risk_score/index_status' as const; -export const EVENT_GRAPH_VISUALIZATION_API = '/internal/cloud_security_posture/graph' as const; - /** * Default signals index key for kibana.dev.yml */ diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts index 1c15a07e765f..2e012a6462dd 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable.ts @@ -118,7 +118,7 @@ const extractDiffableCommonFields = ( version: rule.version, // Main domain fields - name: rule.name, + name: rule.name.trim(), tags: rule.tags ?? [], description: rule.description, severity: rule.severity, diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.test.ts new file mode 100644 index 000000000000..03dc7ecbe533 --- /dev/null +++ b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.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 { KqlQueryType } from '../../../api/detection_engine'; +import { + extractRuleEqlQuery, + extractRuleEsqlQuery, + extractRuleKqlQuery, +} from './extract_rule_data_query'; + +describe('extract rule data queries', () => { + describe('extractRuleKqlQuery', () => { + it('extracts a trimmed version of the query field for inline query types', () => { + const extractedKqlQuery = extractRuleKqlQuery('\nevent.kind:alert\n', 'kuery', [], undefined); + + expect(extractedKqlQuery).toEqual({ + type: KqlQueryType.inline_query, + query: 'event.kind:alert', + language: 'kuery', + filters: [], + }); + }); + }); + + describe('extractRuleEqlQuery', () => { + it('extracts a trimmed version of the query field', () => { + const extractedEqlQuery = extractRuleEqlQuery({ + query: '\n\nquery where true\n\n', + language: 'eql', + filters: [], + eventCategoryOverride: undefined, + timestampField: undefined, + tiebreakerField: undefined, + }); + + expect(extractedEqlQuery).toEqual({ + query: 'query where true', + language: 'eql', + filters: [], + event_category_override: undefined, + timestamp_field: undefined, + tiebreaker_field: undefined, + }); + }); + }); + + describe('extractRuleEsqlQuery', () => { + it('extracts a trimmed version of the query field', () => { + const extractedEsqlQuery = extractRuleEsqlQuery('\nFROM * where true\t\n', 'esql'); + + expect(extractedEsqlQuery).toEqual({ + query: 'FROM * where true', + language: 'esql', + }); + }); + }); +}); diff --git a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts index 99bb27b99357..04460dd0cad7 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/prebuilt_rules/diff/extract_rule_data_query.ts @@ -46,7 +46,7 @@ export const extractInlineKqlQuery = ( ): InlineKqlQuery => { return { type: KqlQueryType.inline_query, - query: query ?? '', + query: query?.trim() ?? '', language: language ?? 'kuery', filters: filters ?? [], }; @@ -63,7 +63,7 @@ interface ExtractRuleEqlQueryParams { export const extractRuleEqlQuery = (params: ExtractRuleEqlQueryParams): RuleEqlQuery => { return { - query: params.query, + query: params.query.trim(), language: params.language, filters: params.filters ?? [], event_category_override: params.eventCategoryOverride, @@ -77,7 +77,7 @@ export const extractRuleEsqlQuery = ( language: EsqlQueryLanguage ): RuleEsqlQuery => { return { - query, + query: query.trim(), language, }; }; diff --git a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts b/x-pack/plugins/security_solution/common/endpoint/types/actions.ts index 061182d5075a..131a8d0c6df5 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/actions.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/actions.ts @@ -96,6 +96,11 @@ export interface ResponseActionScanOutputContent { code: string; } +export interface ResponseActionRunScriptOutputContent { + output: string; + code: string; +} + export const ActivityLogItemTypes = { ACTION: 'action' as const, RESPONSE: 'response' as const, @@ -216,13 +221,29 @@ export interface ResponseActionScanParameters { path: string; } +// Currently reflecting CrowdStrike's RunScript parameters +interface ActionsRunScriptParametersBase { + Raw?: string; + HostPath?: string; + CloudFile?: string; + CommandLine?: string; + Timeout?: number; +} + +// Enforce at least one of the script parameters is required +export type ResponseActionRunScriptParameters = AtLeastOne< + ActionsRunScriptParametersBase, + 'Raw' | 'HostPath' | 'CloudFile' +>; + export type EndpointActionDataParameterTypes = | undefined | ResponseActionParametersWithProcessData | ResponseActionsExecuteParameters | ResponseActionGetFileParameters | ResponseActionUploadParameters - | ResponseActionScanParameters; + | ResponseActionScanParameters + | ResponseActionRunScriptParameters; /** Output content of the different response actions */ export type EndpointActionResponseDataOutput = @@ -233,7 +254,8 @@ export type EndpointActionResponseDataOutput = | GetProcessesActionOutputContent | SuspendProcessActionOutputContent | KillProcessActionOutputContent - | ResponseActionScanOutputContent; + | ResponseActionScanOutputContent + | ResponseActionRunScriptOutputContent; /** * The data stored with each Response Action under `EndpointActions.data` property @@ -571,3 +593,7 @@ export interface ResponseActionUploadOutputContent { /** The free space available (after saving the file) of the drive where the file was saved to, In Bytes */ disk_free_space: number; } + +type AtLeastOne<T, K extends keyof T = keyof T> = K extends keyof T + ? Required<Pick<T, K>> & Partial<Omit<T, K>> + : never; diff --git a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts b/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts index 0eda694aed24..9d71e984021f 100644 --- a/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts +++ b/x-pack/plugins/security_solution/common/entity_analytics/risk_engine/constants.ts @@ -17,6 +17,8 @@ export const RISK_ENGINE_SETTINGS_URL = `${RISK_ENGINE_URL}/settings` as const; export const PUBLIC_RISK_ENGINE_URL = `${PUBLIC_RISK_SCORE_URL}/engine` as const; export const RISK_ENGINE_SCHEDULE_NOW_URL = `${RISK_ENGINE_URL}/schedule_now` as const; export const RISK_ENGINE_CLEANUP_URL = `${PUBLIC_RISK_ENGINE_URL}/dangerously_delete_data` as const; +export const RISK_ENGINE_CONFIGURE_SO_URL = + `${PUBLIC_RISK_ENGINE_URL}/saved_object/configure` as const; type ClusterPrivilege = 'manage_index_templates' | 'manage_transform'; export const RISK_ENGINE_REQUIRED_ES_CLUSTER_PRIVILEGES = [ diff --git a/x-pack/plugins/security_solution/common/experimental_features.ts b/x-pack/plugins/security_solution/common/experimental_features.ts index 03412c7ff4b2..428a48cf4b7b 100644 --- a/x-pack/plugins/security_solution/common/experimental_features.ts +++ b/x-pack/plugins/security_solution/common/experimental_features.ts @@ -246,7 +246,7 @@ export const allowedExperimentalValues = Object.freeze({ /** * Enables the Service Entity Store. The Entity Store feature will install the service engine by default. */ - serviceEntityStoreEnabled: true, + serviceEntityStoreEnabled: false, /** * Enables the siem migrations feature @@ -258,6 +258,11 @@ export const allowedExperimentalValues = Object.freeze({ */ defendInsights: false, + /** + * Enables flyout history and new preview navigation + */ + newExpandableFlyoutNavigationEnabled: false, + /** * Enables CrowdStrike's RunScript RTR command */ diff --git a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts b/x-pack/plugins/security_solution/common/siem_migrations/constants.ts index e947dda4bbcc..531669608ed8 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/constants.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/constants.ts @@ -27,6 +27,8 @@ export const SIEM_RULE_MIGRATIONS_PREBUILT_RULES_PATH = `${SIEM_RULE_MIGRATION_PATH}/prebuilt_rules` as const; export const SIEM_RULE_MIGRATION_RESOURCES_PATH = `${SIEM_RULE_MIGRATION_PATH}/resources` as const; +export const SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH = + `${SIEM_RULE_MIGRATION_RESOURCES_PATH}/missing` as const; export enum SiemMigrationTaskStatus { READY = 'ready', diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts index 95a81d4436d8..47c06e1e02c7 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.gen.ts @@ -17,11 +17,8 @@ import { z } from '@kbn/zod'; import { ArrayFromString } from '@kbn/zod-helpers'; -import { NonEmptyString } from '../../../../api/model/primitives.gen'; import { - ElasticRulePartial, - RuleMigrationTranslationResult, - RuleMigrationComments, + UpdateRuleMigrationData, RuleMigrationTaskStats, OriginalRule, RuleMigration, @@ -31,6 +28,7 @@ import { RuleMigrationResourceType, RuleMigrationResource, } from '../../rule_migration.gen'; +import { NonEmptyString } from '../../../../api/model/primitives.gen'; import { ConnectorId, LangSmithOptions } from '../../common.gen'; export type CreateRuleMigrationRequestParams = z.infer<typeof CreateRuleMigrationRequestParams>; @@ -62,6 +60,7 @@ export const GetRuleMigrationRequestQuery = z.object({ sort_field: NonEmptyString.optional(), sort_direction: z.enum(['asc', 'desc']).optional(), search_term: z.string().optional(), + ids: ArrayFromString(NonEmptyString).optional(), }); export type GetRuleMigrationRequestQueryInput = z.input<typeof GetRuleMigrationRequestQuery>; @@ -103,6 +102,8 @@ export type GetRuleMigrationResourcesRequestQuery = z.infer< export const GetRuleMigrationResourcesRequestQuery = z.object({ type: RuleMigrationResourceType.optional(), names: ArrayFromString(z.string()).optional(), + from: z.coerce.number().optional(), + size: z.coerce.number().optional(), }); export type GetRuleMigrationResourcesRequestQueryInput = z.input< typeof GetRuleMigrationResourcesRequestQuery @@ -121,6 +122,24 @@ export type GetRuleMigrationResourcesRequestParamsInput = z.input< export type GetRuleMigrationResourcesResponse = z.infer<typeof GetRuleMigrationResourcesResponse>; export const GetRuleMigrationResourcesResponse = z.array(RuleMigrationResource); +export type GetRuleMigrationResourcesMissingRequestParams = z.infer< + typeof GetRuleMigrationResourcesMissingRequestParams +>; +export const GetRuleMigrationResourcesMissingRequestParams = z.object({ + migration_id: NonEmptyString, +}); +export type GetRuleMigrationResourcesMissingRequestParamsInput = z.input< + typeof GetRuleMigrationResourcesMissingRequestParams +>; + +/** + * The identified resources missing + */ +export type GetRuleMigrationResourcesMissingResponse = z.infer< + typeof GetRuleMigrationResourcesMissingResponse +>; +export const GetRuleMigrationResourcesMissingResponse = z.array(RuleMigrationResourceData); + export type GetRuleMigrationStatsRequestParams = z.infer<typeof GetRuleMigrationStatsRequestParams>; export const GetRuleMigrationStatsRequestParams = z.object({ migration_id: NonEmptyString, @@ -231,26 +250,7 @@ export const StopRuleMigrationResponse = z.object({ }); export type UpdateRuleMigrationRequestBody = z.infer<typeof UpdateRuleMigrationRequestBody>; -export const UpdateRuleMigrationRequestBody = z.array( - z.object({ - /** - * The rule migration id - */ - id: NonEmptyString, - /** - * The migrated elastic rule attributes to update. - */ - elastic_rule: ElasticRulePartial.optional(), - /** - * The rule translation result. - */ - translation_result: RuleMigrationTranslationResult.optional(), - /** - * The comments for the migration including a summary from the LLM in markdown. - */ - comments: RuleMigrationComments.optional(), - }) -); +export const UpdateRuleMigrationRequestBody = z.array(UpdateRuleMigrationData); export type UpdateRuleMigrationRequestBodyInput = z.input<typeof UpdateRuleMigrationRequestBody>; export type UpdateRuleMigrationResponse = z.infer<typeof UpdateRuleMigrationResponse>; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml index b7e495e2ea89..69e43b57dabd 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml @@ -20,22 +20,7 @@ paths: schema: type: array items: - type: object - required: - - id - properties: - id: - description: The rule migration id - $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' - elastic_rule: - description: The migrated elastic rule attributes to update. - $ref: '../../rule_migration.schema.yaml#/components/schemas/ElasticRulePartial' - translation_result: - description: The rule translation result. - $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationTranslationResult' - comments: - description: The comments for the migration including a summary from the LLM in markdown. - $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationComments' + $ref: '../../rule_migration.schema.yaml#/components/schemas/UpdateRuleMigrationData' responses: 200: description: Indicates rules migrations have been updated correctly. @@ -151,6 +136,14 @@ paths: required: false schema: type: string + - name: ids + in: query + required: false + schema: + type: array + items: + description: The rule migration id + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' responses: 200: @@ -473,6 +466,16 @@ paths: description: The names of the resource to retrieve items: type: string + - name: from + in: query + required: false + schema: + type: number + - name: size + in: query + required: false + schema: + type: number responses: 200: description: Indicates migration resources have been retrieved correctly @@ -482,3 +485,31 @@ paths: type: array items: $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationResource' + + /internal/siem_migrations/rules/{migration_id}/resources/missing: + get: + summary: Gets missing rule migration resources for a migration + operationId: GetRuleMigrationResourcesMissing + x-codegen-enabled: true + x-internal: true + description: Identifies missing resources from all the rules of an existing SIEM rules migration + tags: + - SIEM Rule Migrations + - Resources + parameters: + - name: migration_id + in: path + required: true + schema: + description: The migration id to attach the resources + $ref: '../../../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + responses: + 200: + description: Indicates missing migration resources have been retrieved correctly + content: + application/json: + schema: + type: array + description: The identified resources missing + items: + $ref: '../../rule_migration.schema.yaml#/components/schemas/RuleMigrationResourceData' diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts index c6d0959cc10c..f55b87f7af70 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/common.gen.ts @@ -15,6 +15,13 @@ */ import { z } from '@kbn/zod'; +import { isNonEmptyString } from '@kbn/zod-helpers'; + +/** + * A string that does not contain only whitespace characters + */ +export type NonEmptyString = z.infer<typeof NonEmptyString>; +export const NonEmptyString = z.string().min(1).superRefine(isNonEmptyString); /** * The GenAI connector id to use. diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml index 14a5160427f8..9e15bd857c72 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/common.schema.yaml @@ -6,6 +6,11 @@ paths: {} components: x-codegen-enabled: true schemas: + NonEmptyString: + type: string + format: nonempty + minLength: 1 + description: A string that does not contain only whitespace characters ConnectorId: type: string description: The GenAI connector id to use. diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts index 60220bf054a1..d9c33ebbdf70 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.gen.ts @@ -103,9 +103,9 @@ export const ElasticRule = z.object({ */ prebuilt_rule_id: NonEmptyString.optional(), /** - * The Elastic integration IDs related to the rule. + * The Elastic integration ID found to be most relevant to the splunk rule. */ - integration_ids: z.array(z.string()).optional(), + integration_id: z.string().optional(), /** * The Elastic rule id installed as a result. */ @@ -303,6 +303,29 @@ export const RuleMigrationTranslationStats = z.object({ }), }); +/** + * The rule migration data object for rule update operation + */ +export type UpdateRuleMigrationData = z.infer<typeof UpdateRuleMigrationData>; +export const UpdateRuleMigrationData = z.object({ + /** + * The rule migration id + */ + id: NonEmptyString, + /** + * The migrated elastic rule attributes to update. + */ + elastic_rule: ElasticRulePartial.optional(), + /** + * The rule translation result. + */ + translation_result: RuleMigrationTranslationResult.optional(), + /** + * The comments for the migration including a summary from the LLM in markdown. + */ + comments: RuleMigrationComments.optional(), +}); + /** * The type of the rule migration resource. */ @@ -324,7 +347,7 @@ export const RuleMigrationResourceData = z.object({ /** * The resource content value. */ - content: z.string(), + content: z.string().optional(), /** * The resource arbitrary metadata. */ diff --git a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml index e13e9b1d0ed7..6fce9f0d51f5 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml +++ b/x-pack/plugins/security_solution/common/siem_migrations/model/rule_migration.schema.yaml @@ -83,11 +83,9 @@ components: prebuilt_rule_id: description: The Elastic prebuilt rule id matched. $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' - integration_ids: - type: array - items: - type: string - description: The Elastic integration IDs related to the rule. + integration_id: + type: string + description: The Elastic integration ID found to be most relevant to the splunk rule. id: description: The Elastic rule id installed as a result. $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' @@ -276,6 +274,25 @@ components: items: type: string + UpdateRuleMigrationData: + type: object + description: The rule migration data object for rule update operation + required: + - id + properties: + id: + description: The rule migration id + $ref: '../../../common/api/model/primitives.schema.yaml#/components/schemas/NonEmptyString' + elastic_rule: + description: The migrated elastic rule attributes to update. + $ref: '#/components/schemas/ElasticRulePartial' + translation_result: + description: The rule translation result. + $ref: '#/components/schemas/RuleMigrationTranslationResult' + comments: + description: The comments for the migration including a summary from the LLM in markdown. + $ref: '#/components/schemas/RuleMigrationComments' + ## Rule migration resources RuleMigrationResourceType: @@ -291,7 +308,6 @@ components: required: - type - name - - content properties: type: $ref: '#/components/schemas/RuleMigrationResourceType' diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts index ffe4b3aca407..8ec7adf050bf 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/index.ts @@ -5,18 +5,72 @@ * 2.0. */ -import type { OriginalRule, OriginalRuleVendor } from '../../model/rule_migration.gen'; -import type { QueryResourceIdentifier, RuleResourceCollection } from './types'; -import { splResourceIdentifier } from './splunk_identifier'; +import type { + OriginalRule, + OriginalRuleVendor, + RuleMigrationResourceData, +} from '../../model/rule_migration.gen'; +import type { ResourceIdentifiers, RuleResource } from './types'; +import { splResourceIdentifiers } from './splunk'; -export const getRuleResourceIdentifier = (rule: OriginalRule): QueryResourceIdentifier => { - return ruleResourceIdentifiers[rule.vendor]; +const ruleResourceIdentifiers: Record<OriginalRuleVendor, ResourceIdentifiers> = { + splunk: splResourceIdentifiers, }; -export const identifyRuleResources = (rule: OriginalRule): RuleResourceCollection => { - return getRuleResourceIdentifier(rule)(rule.query); +export const getRuleResourceIdentifier = (vendor: OriginalRuleVendor): ResourceIdentifiers => { + return ruleResourceIdentifiers[vendor]; }; -const ruleResourceIdentifiers: Record<OriginalRuleVendor, QueryResourceIdentifier> = { - splunk: splResourceIdentifier, -}; +export class ResourceIdentifier { + private identifiers: ResourceIdentifiers; + + constructor(vendor: OriginalRuleVendor) { + // The constructor may need query_language as an argument for other vendors + this.identifiers = ruleResourceIdentifiers[vendor]; + } + + public fromOriginalRule(originalRule: OriginalRule): RuleResource[] { + return this.identifiers.fromOriginalRule(originalRule); + } + + public fromResource(resource: RuleMigrationResourceData): RuleResource[] { + return this.identifiers.fromResource(resource); + } + + public fromOriginalRules(originalRules: OriginalRule[]): RuleResource[] { + const lists = new Set<string>(); + const macros = new Set<string>(); + originalRules.forEach((rule) => { + const resources = this.identifiers.fromOriginalRule(rule); + resources.forEach((resource) => { + if (resource.type === 'macro') { + macros.add(resource.name); + } else if (resource.type === 'list') { + lists.add(resource.name); + } + }); + }); + return [ + ...Array.from(macros).map<RuleResource>((name) => ({ type: 'macro', name })), + ...Array.from(lists).map<RuleResource>((name) => ({ type: 'list', name })), + ]; + } + + public fromResources(resources: RuleMigrationResourceData[]): RuleResource[] { + const lists = new Set<string>(); + const macros = new Set<string>(); + resources.forEach((resource) => { + this.identifiers.fromResource(resource).forEach((identifiedResource) => { + if (identifiedResource.type === 'macro') { + macros.add(identifiedResource.name); + } else if (identifiedResource.type === 'list') { + lists.add(identifiedResource.name); + } + }); + }); + return [ + ...Array.from(macros).map<RuleResource>((name) => ({ type: 'macro', name })), + ...Array.from(lists).map<RuleResource>((name) => ({ type: 'list', name })), + ]; + } +} diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts new file mode 100644 index 000000000000..a16c328da947 --- /dev/null +++ b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { ResourceIdentifiers } from '../types'; +import { splResourceIdentifier } from './splunk_identifier'; + +export const splResourceIdentifiers: ResourceIdentifiers = { + fromOriginalRule: (originalRule) => splResourceIdentifier(originalRule.query), + fromResource: (resource) => { + if (resource.type === 'macro' && resource.content) { + return splResourceIdentifier(resource.content); + } + return []; + }, +}; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.test.ts new file mode 100644 index 000000000000..5d144e5b8a38 --- /dev/null +++ b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.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 { splResourceIdentifier } from './splunk_identifier'; + +describe('splResourceIdentifier', () => { + it('should extract macros correctly', () => { + const query = + '`macro_zero`, `macro_one(arg1)`, some search command `macro_two(arg1, arg2)` another command `macro_three(arg1, arg2, arg3)`'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_zero' }, + { type: 'macro', name: 'macro_one(1)' }, + { type: 'macro', name: 'macro_two(2)' }, + { type: 'macro', name: 'macro_three(3)' }, + ]); + }); + + it('should extract macros with double quotes parameters correctly', () => { + const query = '| `macro_one("90","2")` | `macro_two("20")`'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one(2)' }, + { type: 'macro', name: 'macro_two(1)' }, + ]); + }); + + it('should extract macros with single quotes parameters correctly', () => { + const query = "| `macro_one('90','2')` | `macro_two('20')`"; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one(2)' }, + { type: 'macro', name: 'macro_two(1)' }, + ]); + }); + + it('should extract lookup tables correctly', () => { + const query = + 'search ... | lookup my_lookup_table field AS alias OUTPUT new_field | lookup other_lookup_list | lookup third_lookup'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'list', name: 'my_lookup_table' }, + { type: 'list', name: 'other_lookup_list' }, + { type: 'list', name: 'third_lookup' }, + ]); + }); + + it('should extract both macros and lookup tables correctly', () => { + const query = + '`macro_one` some search command | lookup my_lookup_table field AS alias OUTPUT new_field | lookup other_lookup_list | lookup third_lookup'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one' }, + { type: 'list', name: 'my_lookup_table' }, + { type: 'list', name: 'other_lookup_list' }, + { type: 'list', name: 'third_lookup' }, + ]); + }); + + it('should extract lookup correctly when there are modifiers', () => { + const query = + 'lookup my_lookup_1 field AS alias OUTPUT new_field | lookup local=true my_lookup_2 | lookup update=true my_lookup_3 | lookup local=true update=true my_lookup_4 | lookup update=false local=true my_lookup_5'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'list', name: 'my_lookup_1' }, + { type: 'list', name: 'my_lookup_2' }, + { type: 'list', name: 'my_lookup_3' }, + { type: 'list', name: 'my_lookup_4' }, + { type: 'list', name: 'my_lookup_5' }, + ]); + }); + + it('should return empty arrays if no macros or lookup tables are found', () => { + const query = 'search | stats count'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([]); + }); + + it('should handle queries with both macros and lookup tables mixed with other commands', () => { + const query = + 'search `macro_one` | `my_lookup_table` field AS alias myfakelookup new_field | lookup real_lookup_list | `third_macro`'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one' }, + { type: 'macro', name: 'my_lookup_table' }, + { type: 'macro', name: 'third_macro' }, + { type: 'list', name: 'real_lookup_list' }, + ]); + }); + + it('should ignore macros or lookup tables inside string literals with double quotes', () => { + const query = + '`macro_one` | lookup my_lookup_table | search title="`macro_two` and lookup another_table"'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one' }, + { type: 'list', name: 'my_lookup_table' }, + ]); + }); + + it('should ignore macros or lookup tables inside string literals with single quotes', () => { + const query = + "`macro_one` | lookup my_lookup_table | search title='`macro_two` and lookup another_table'"; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one' }, + { type: 'list', name: 'my_lookup_table' }, + ]); + }); + + it('should ignore macros or lookup tables inside comments wrapped by ```', () => { + const query = + '`macro_one` ```this is a comment with `macro_two` and lookup another_table``` | lookup my_lookup_table ```this is another comment```'; + + const result = splResourceIdentifier(query); + expect(result).toEqual([ + { type: 'macro', name: 'macro_one' }, + { type: 'list', name: 'my_lookup_table' }, + ]); + }); +}); diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.ts new file mode 100644 index 000000000000..2ecc43321b11 --- /dev/null +++ b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk/splunk_identifier.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. + */ + +/** + * Important: + * This library uses regular expressions that are executed against arbitrary user input, they need to be safe from ReDoS attacks. + * Please make sure to test all regular expressions them before using them. + * At the time of writing, this tool can be used to test it: https://devina.io/redos-checker + */ + +import type { ResourceIdentifier, RuleResource } from '../types'; + +const listRegex = /\b(?:lookup)\s+([\w-]+)\b/g; // Captures only the lookup name +const macrosRegex = /`([\w-]+)(?:\(([^`]*?)\))?`/g; // Captures only the macro name and arguments + +export const splResourceIdentifier: ResourceIdentifier = (input) => { + // sanitize the query to avoid mismatching macro and list names inside comments or literal strings + const sanitizedInput = sanitizeInput(input); + + const resources: RuleResource[] = []; + let macroMatch; + while ((macroMatch = macrosRegex.exec(sanitizedInput)) !== null) { + const macroName = macroMatch[1] as string; + const args = macroMatch[2] as string; // This captures the content inside the parentheses + const argCount = args ? args.split(',').length : 0; // Count arguments if present + const macroWithArgs = argCount > 0 ? `${macroName}(${argCount})` : macroName; + resources.push({ type: 'macro', name: macroWithArgs }); + } + + let listMatch; + while ((listMatch = listRegex.exec(sanitizedInput)) !== null) { + resources.push({ type: 'list', name: listMatch[1] }); + } + + return resources; +}; + +// Comments should be removed before processing the query to avoid matching macro and list names inside them +const commentRegex = /```.*?```/g; +// Literal strings should be replaced with a placeholder to avoid matching macro and list names inside them +const doubleQuoteStrRegex = /".*?"/g; +const singleQuoteStrRegex = /'.*?'/g; +// lookup operator can have modifiers like local=true or update=false before the lookup name, we need to remove them +const lookupModifiers = /\blookup\b\s+((local|update)=\s*(?:true|false)\s*)+/gi; + +const sanitizeInput = (query: string) => { + return query + .replaceAll(commentRegex, '') + .replaceAll(doubleQuoteStrRegex, '"literal"') + .replaceAll(singleQuoteStrRegex, "'literal'") + .replaceAll(lookupModifiers, 'lookup '); +}; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.test.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.test.ts deleted file mode 100644 index 2fa3be223aa6..000000000000 --- a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.test.ts +++ /dev/null @@ -1,89 +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 { splResourceIdentifier } from './splunk_identifier'; - -describe('splResourceIdentifier', () => { - it('should extract macros correctly', () => { - const query = - '`macro_zero`, `macro_one(arg1)`, some search command `macro_two(arg1, arg2)` another command `macro_three(arg1, arg2, arg3)`'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_zero', 'macro_one(1)', 'macro_two(2)', 'macro_three(3)']); - expect(result.list).toEqual([]); - }); - - it('should extract lookup tables correctly', () => { - const query = - 'search ... | lookup my_lookup_table field AS alias OUTPUT new_field | inputlookup other_lookup_list | lookup third_lookup'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual([]); - expect(result.list).toEqual(['my_lookup_table', 'other_lookup_list', 'third_lookup']); - }); - - it('should extract both macros and lookup tables correctly', () => { - const query = - '`macro_one` some search command | lookup my_lookup_table field AS alias OUTPUT new_field | inputlookup other_lookup_list | lookup third_lookup'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_one']); - expect(result.list).toEqual(['my_lookup_table', 'other_lookup_list', 'third_lookup']); - }); - - it('should return empty arrays if no macros or lookup tables are found', () => { - const query = 'search | stats count'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual([]); - expect(result.list).toEqual([]); - }); - - it('should handle queries with both macros and lookup tables mixed with other commands', () => { - const query = - 'search `macro_one` | `my_lookup_table` field AS alias myfakelookup new_field | inputlookup real_lookup_list | `third_macro`'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_one', 'my_lookup_table', 'third_macro']); - expect(result.list).toEqual(['real_lookup_list']); - }); - - it('should ignore macros or lookup tables inside string literals with double quotes', () => { - const query = - '`macro_one` | lookup my_lookup_table | search title="`macro_two` and lookup another_table"'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_one']); - expect(result.list).toEqual(['my_lookup_table']); - }); - - it('should ignore macros or lookup tables inside string literals with single quotes', () => { - const query = - "`macro_one` | lookup my_lookup_table | search title='`macro_two` and lookup another_table'"; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_one']); - expect(result.list).toEqual(['my_lookup_table']); - }); - - it('should ignore macros or lookup tables inside comments wrapped by ```', () => { - const query = - '`macro_one` | ```this is a comment with `macro_two` and lookup another_table``` lookup my_lookup_table'; - - const result = splResourceIdentifier(query); - - expect(result.macro).toEqual(['macro_one']); - expect(result.list).toEqual(['my_lookup_table']); - }); -}); diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.ts deleted file mode 100644 index fa46fff941c6..000000000000 --- a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/splunk_identifier.ts +++ /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. - */ - -/** - * Important: - * This library uses regular expressions that are executed against arbitrary user input, they need to be safe from ReDoS attacks. - * Please make sure to test them before using them in production. - * At the time of writing, this tool can be used to test it: https://devina.io/redos-checker - */ - -import type { QueryResourceIdentifier } from './types'; - -const listRegex = /\b(?:lookup|inputlookup)\s+([\w-]+)\b/g; // Captures only the lookup table name -const macrosRegex = /`([\w-]+)(?:\(([^`]*?)\))?`/g; // Captures only the macro name and arguments - -const commentRegex = /```.*```/g; -const doubleQuoteStrRegex = /".*"/g; -const singleQuoteStrRegex = /'.*'/g; - -export const splResourceIdentifier: QueryResourceIdentifier = (query) => { - // sanitize the query to avoid mismatching macro and list names inside comments or literal strings - const sanitizedQuery = query - .replaceAll(commentRegex, '') - .replaceAll(doubleQuoteStrRegex, '"literal"') - .replaceAll(singleQuoteStrRegex, "'literal'"); - - const macro = []; - let macroMatch; - while ((macroMatch = macrosRegex.exec(sanitizedQuery)) !== null) { - const macroName = macroMatch[1]; - const args = macroMatch[2]; // This captures the content inside the parentheses - const argCount = args ? args.split(',').length : 0; // Count arguments if present - const macroWithArgs = argCount > 0 ? `${macroName}(${argCount})` : macroName; - macro.push(macroWithArgs); - } - - const list = []; - let listMatch; - while ((listMatch = listRegex.exec(sanitizedQuery)) !== null) { - list.push(listMatch[1]); - } - - return { macro, list }; -}; diff --git a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts index 93f6f3ad3db1..70c6e3b72124 100644 --- a/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts +++ b/x-pack/plugins/security_solution/common/siem_migrations/rules/resources/types.ts @@ -5,7 +5,19 @@ * 2.0. */ -import type { RuleMigrationResourceType } from '../../model/rule_migration.gen'; +import type { + OriginalRule, + RuleMigrationResourceData, + RuleMigrationResourceType, +} from '../../model/rule_migration.gen'; -export type RuleResourceCollection = Record<RuleMigrationResourceType, string[]>; -export type QueryResourceIdentifier = (query: string) => RuleResourceCollection; +export interface RuleResource { + type: RuleMigrationResourceType; + name: string; +} +export type ResourceIdentifier = (input: string) => RuleResource[]; + +export interface ResourceIdentifiers { + fromOriginalRule: (originalRule: OriginalRule) => RuleResource[]; + fromResource: (resource: RuleMigrationResourceData) => RuleResource[]; +} diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml index 55514516f43d..6c865ab356c1 100644 --- a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_detections_api_2023_10_31.bundled.schema.yaml @@ -1,9 +1,11 @@ openapi: 3.0.3 info: 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. + Use the detections APIs to create and manage detection rules. Detection + rules search events and external alerts sent to Elastic Security and + generate detection alerts from any hits. Alerts are displayed on the + **Alerts** page and can be assigned and triaged, using the alert status to + mark them as open, closed, or acknowledged. title: Security Detections API (Elastic Cloud and self-hosted) version: '2023-10-31' servers: @@ -4186,9 +4188,9 @@ components: - severity - $ref: '#/components/schemas/NewTermsRuleCreateFields' NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NormalizedRuleAction: additionalProperties: false @@ -7110,9 +7112,21 @@ components: security: - BasicAuth: [] tags: - - 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. + - description: > + Use the detections APIs to create and manage detection rules. Detection + rules search events and external alerts sent to Elastic Security and + generate detection alerts from any hits. Alerts are displayed on the + **Alerts** page and can be assigned and triaged, using the alert status to + mark them as open, closed, or acknowledged. + + > warn + + > If the API key used for authorization has different privileges than the + key that created or most recently updated a rule, the rule behavior might + change. + + + > If the API key that created a rule is deleted, or the user that created + the rule becomes inactive, the rule will stop running. name: Security Detections API x-displayName: Security detections diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml index 585dec4f3074..62d604ec727d 100644 --- a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml @@ -706,9 +706,9 @@ components: required: - hostStatuses NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NoParametersRequestSchema: type: object diff --git a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml index 9a0c456e5efe..1db469620f68 100644 --- a/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/ess/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml @@ -646,6 +646,58 @@ paths: summary: Cleanup the Risk Engine tags: - Security Entity Analytics API + /api/risk_score/engine/saved_object/configure: + patch: + description: Configuring the Risk Engine Saved Object + operationId: ConfigureRiskEngineSavedObject + requestBody: + content: + application/json: + schema: + type: object + properties: + exclude_alert_statuses: + items: + type: string + type: array + exclude_alert_tags: + items: + type: string + type: array + range: + type: object + properties: + end: + type: string + start: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + type: object + properties: + risk_engine_saved_object_configured: + type: boolean + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskManagerUnavailableResponse' + description: Task manager is unavailable + default: + content: + application/json: + schema: + $ref: >- + #/components/schemas/ConfigureRiskEngineSavedObjectErrorResponse + description: Unexpected error + summary: Configure the Risk Engine Saved Object + tags: + - Security Entity Analytics API /api/risk_score/engine/schedule_now: post: description: >- @@ -798,6 +850,27 @@ components: required: - cleanup_successful - errors + ConfigureRiskEngineSavedObjectErrorResponse: + type: object + properties: + errors: + items: + type: object + properties: + error: + type: string + seq: + type: integer + required: + - seq + - error + type: array + risk_engine_saved_object_configured: + example: false + type: boolean + required: + - risk_engine_saved_object_configured + - errors CreateAssetCriticalityRecord: allOf: - $ref: '#/components/schemas/AssetCriticalityRecordIdParts' diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml index 58456e71140a..583944c5b343 100644 --- a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_detections_api_2023_10_31.bundled.schema.yaml @@ -1,9 +1,11 @@ openapi: 3.0.3 info: 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. + Use the detections APIs to create and manage detection rules. Detection + rules search events and external alerts sent to Elastic Security and + generate detection alerts from any hits. Alerts are displayed on the + **Alerts** page and can be assigned and triaged, using the alert status to + mark them as open, closed, or acknowledged. title: Security Detections API (Elastic Cloud Serverless) version: '2023-10-31' servers: @@ -3335,9 +3337,9 @@ components: - severity - $ref: '#/components/schemas/NewTermsRuleCreateFields' NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NormalizedRuleAction: additionalProperties: false @@ -6252,9 +6254,21 @@ components: security: - BasicAuth: [] tags: - - 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. + - description: > + Use the detections APIs to create and manage detection rules. Detection + rules search events and external alerts sent to Elastic Security and + generate detection alerts from any hits. Alerts are displayed on the + **Alerts** page and can be assigned and triaged, using the alert status to + mark them as open, closed, or acknowledged. + + > warn + + > If the API key used for authorization has different privileges than the + key that created or most recently updated a rule, the rule behavior might + change. + + + > If the API key that created a rule is deleted, or the user that created + the rule becomes inactive, the rule will stop running. name: Security Detections API x-displayName: Security detections diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml index ded6f6558b01..ee89d61a58b5 100644 --- a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_endpoint_management_api_2023_10_31.bundled.schema.yaml @@ -706,9 +706,9 @@ components: required: - hostStatuses NonEmptyString: - description: A string that is not empty and does not contain only whitespace + description: A string that does not contain only whitespace characters + format: nonempty minLength: 1 - pattern: ^(?! *$).+$ type: string NoParametersRequestSchema: type: object diff --git a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml index 356a63567c40..184eb912ad7d 100644 --- a/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml +++ b/x-pack/plugins/security_solution/docs/openapi/serverless/security_solution_entity_analytics_api_2023_10_31.bundled.schema.yaml @@ -646,6 +646,58 @@ paths: summary: Cleanup the Risk Engine tags: - Security Entity Analytics API + /api/risk_score/engine/saved_object/configure: + patch: + description: Configuring the Risk Engine Saved Object + operationId: ConfigureRiskEngineSavedObject + requestBody: + content: + application/json: + schema: + type: object + properties: + exclude_alert_statuses: + items: + type: string + type: array + exclude_alert_tags: + items: + type: string + type: array + range: + type: object + properties: + end: + type: string + start: + type: string + required: true + responses: + '200': + content: + application/json: + schema: + type: object + properties: + risk_engine_saved_object_configured: + type: boolean + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/TaskManagerUnavailableResponse' + description: Task manager is unavailable + default: + content: + application/json: + schema: + $ref: >- + #/components/schemas/ConfigureRiskEngineSavedObjectErrorResponse + description: Unexpected error + summary: Configure the Risk Engine Saved Object + tags: + - Security Entity Analytics API /api/risk_score/engine/schedule_now: post: description: >- @@ -798,6 +850,27 @@ components: required: - cleanup_successful - errors + ConfigureRiskEngineSavedObjectErrorResponse: + type: object + properties: + errors: + items: + type: object + properties: + error: + type: string + seq: + type: integer + required: + - seq + - error + type: array + risk_engine_saved_object_configured: + example: false + type: boolean + required: + - risk_engine_saved_object_configured + - errors CreateAssetCriticalityRecord: allOf: - $ref: '#/components/schemas/AssetCriticalityRecordIdParts' diff --git a/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png b/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png index a1f9cca5a34a..74623e69af0c 100644 Binary files a/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png and b/x-pack/plugins/security_solution/docs/siem_migration/img/agent_graph.png differ diff --git a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx index 9aa3491218f8..1293ddff34f7 100644 --- a/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx +++ b/x-pack/plugins/security_solution/public/assistant/get_comments/stream/use_stream.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useStream } from './use_stream'; const refetchCurrentConversation = jest.fn(); @@ -49,7 +49,7 @@ describe.skip('useStream', () => { }); it('Should stream response. isLoading/isStreaming are true while streaming, isLoading/isStreaming are false when streaming completes', async () => { - const { result, waitFor } = renderHook(() => useStream(defaultProps)); + const { result } = renderHook(() => useStream(defaultProps)); expect(reader).toHaveBeenCalledTimes(1); await waitFor(() => { expect(result.current).toEqual({ @@ -107,7 +107,7 @@ describe.skip('useStream', () => { releaseLock: jest.fn(), closed: jest.fn().mockResolvedValue(true), } as unknown as ReadableStreamDefaultReader<Uint8Array>; - const { result, waitForNextUpdate } = renderHook(() => + const { result } = renderHook(() => useStream({ ...defaultProps, reader: errorReader, @@ -115,7 +115,7 @@ describe.skip('useStream', () => { ); expect(result.current.error).toBeUndefined(); - await waitForNextUpdate(); + await waitFor(() => new Promise((resolve) => resolve(null))); expect(result.current.error).toBe(errorMessage); expect(result.current.isLoading).toBe(false); diff --git a/x-pack/plugins/security_solution/public/assistant/overlay.test.tsx b/x-pack/plugins/security_solution/public/assistant/overlay.test.tsx index ca90d72b3715..eb9adf234e9f 100644 --- a/x-pack/plugins/security_solution/public/assistant/overlay.test.tsx +++ b/x-pack/plugins/security_solution/public/assistant/overlay.test.tsx @@ -22,7 +22,14 @@ jest.mock('@kbn/elastic-assistant', () => ({ jest.mock('../common/hooks/use_experimental_features'); describe('AssistantOverlay', () => { - const queryClient = new QueryClient(); + const queryClient = new QueryClient({ + defaultOptions: { + queries: { + cacheTime: Infinity, + retry: false, + }, + }, + }); beforeEach(() => { jest.clearAllMocks(); diff --git a/x-pack/plugins/security_solution/public/assistant/provider.test.tsx b/x-pack/plugins/security_solution/public/assistant/provider.test.tsx index a96623b8567a..5108fb259cfb 100644 --- a/x-pack/plugins/security_solution/public/assistant/provider.test.tsx +++ b/x-pack/plugins/security_solution/public/assistant/provider.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { httpServiceMock, type HttpSetupMock } from '@kbn/core-http-browser-mocks'; import type { Storage } from '@kbn/kibana-utils-plugin/public'; import { createConversations } from './provider'; @@ -166,47 +166,43 @@ describe('createConversations', () => { }); it('should call bulk conversations with the transformed conversations from the local storage', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => - createConversations( - coreMock.createStart().notifications, - http, - mockStorage as unknown as Storage - ) - ); - await waitForNextUpdate(); - expect(http.fetch.mock.calls[0][0]).toBe( - '/internal/elastic_assistant/current_user/conversations/_bulk_action' - ); - expect( - http.fetch.mock.calls[0].length > 1 - ? // eslint-disable-next-line @typescript-eslint/no-explicit-any - JSON.parse((http.fetch.mock.calls[0] as any[])[1]?.body).create.length - : 0 - ).toBe(2); - }); + renderHook(() => + createConversations( + coreMock.createStart().notifications, + http, + mockStorage as unknown as Storage + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + expect(http.fetch.mock.calls[0][0]).toBe( + '/internal/elastic_assistant/current_user/conversations/_bulk_action' + ); + expect( + http.fetch.mock.calls[0].length > 1 + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + JSON.parse((http.fetch.mock.calls[0] as any[])[1]?.body).create.length + : 0 + ).toBe(2); }); it('should add missing actionTypeId to apiConfig', async () => { - await act(async () => { - const { waitForNextUpdate } = renderHook(() => - createConversations( - coreMock.createStart().notifications, - http, - mockStorage as unknown as Storage - ) - ); - await waitForNextUpdate(); - expect(http.fetch.mock.calls[0][0]).toBe( - '/internal/elastic_assistant/current_user/conversations/_bulk_action' - ); - const createdConversations = - http.fetch.mock.calls[0].length > 1 - ? // eslint-disable-next-line @typescript-eslint/no-explicit-any - JSON.parse((http.fetch.mock.calls[0] as any[])[1]?.body)?.create - : []; - expect(createdConversations[0].apiConfig.actionTypeId).toEqual('.bedrock'); - expect(createdConversations[1].apiConfig.actionTypeId).toEqual('.gen-ai'); - }); + renderHook(() => + createConversations( + coreMock.createStart().notifications, + http, + mockStorage as unknown as Storage + ) + ); + await waitFor(() => new Promise((resolve) => resolve(null))); + expect(http.fetch.mock.calls[0][0]).toBe( + '/internal/elastic_assistant/current_user/conversations/_bulk_action' + ); + const createdConversations = + http.fetch.mock.calls[0].length > 1 + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + JSON.parse((http.fetch.mock.calls[0] as any[])[1]?.body)?.create + : []; + expect(createdConversations[0].apiConfig.actionTypeId).toEqual('.bedrock'); + expect(createdConversations[1].apiConfig.actionTypeId).toEqual('.gen-ai'); }); }); diff --git a/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx b/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx index b90db333742a..269d09bfed0f 100644 --- a/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx +++ b/x-pack/plugins/security_solution/public/assistant/use_assistant_telemetry/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useAssistantTelemetry } from '.'; import { BASE_SECURITY_CONVERSATIONS } from '../content/conversations'; import { createTelemetryServiceMock } from '../../common/lib/telemetry/telemetry_service.mock'; diff --git a/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx b/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx index 99836af47a7a..d93430e1552d 100644 --- a/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx +++ b/x-pack/plugins/security_solution/public/assistant/use_conversation_store/index.test.tsx @@ -4,7 +4,8 @@ * 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 { renderHook } from '@testing-library/react'; import { useBaseConversations } from '.'; import { useLinkAuthorized } from '../../common/links'; import { useKibana as mockUseKibana } from '../../common/lib/kibana/__mocks__'; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx index 7ecb82473967..b9e5aadb018a 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_case/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { useAddToNewCase } from '.'; import { TestProviders } from '../../../../../../common/mock'; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx index e84b7973208f..fd91ff132f20 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/actions/use_add_to_existing_case/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { useAddToExistingCase } from '.'; import { useKibana } from '../../../../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts index 86f243e9445f..4d7d7316a9c9 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/results/attack_discovery_panel/view_in_ai_assistant/use_view_in_ai_assistant.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useAssistantOverlay } from '@kbn/elastic-assistant'; import { useAssistantAvailability } from '../../../../../assistant/use_assistant_availability'; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx b/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx index a476aead1903..a21ff89827d4 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/index.test.tsx @@ -7,7 +7,7 @@ import { useLoadConnectors } from '@kbn/elastic-assistant'; import { useFetchAnonymizationFields } from '@kbn/elastic-assistant/impl/assistant/api/anonymization_fields/use_fetch_anonymization_fields'; -import { renderHook, act } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import React from 'react'; import { useKibana } from '../../../common/lib/kibana'; diff --git a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx b/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx index c243138d9ef5..8d161657ae04 100644 --- a/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx +++ b/x-pack/plugins/security_solution/public/attack_discovery/pages/use_attack_discovery/use_poll_api/use_poll_api.test.tsx @@ -7,7 +7,7 @@ import type { HttpSetupMock } from '@kbn/core-http-browser-mocks'; import { coreMock } from '@kbn/core/public/mocks'; -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import { attackDiscoveryStatus, usePollApi } from './use_poll_api'; import moment from 'moment/moment'; import { kibanaMock } from '../../../../common/mock'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx index 83aa6a114362..fa7f9a8952ca 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.test.tsx @@ -419,7 +419,8 @@ describe('StepDefineRule', () => { }); }); - describe('related integrations', () => { + // FLAKY: https://github.com/elastic/kibana/issues/199648 + describe.skip('related integrations', () => { beforeEach(() => { fleetIntegrationsApi.fetchAllIntegrations.mockResolvedValue({ integrations: [ diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts index 51d9c145a97b..d85766587867 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_all_esql_rule_fields.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook, act } from '@testing-library/react-hooks'; +import { renderHook, act } from '@testing-library/react'; import type { DataViewFieldBase } from '@kbn/es-query'; import { useQuery } from '@tanstack/react-query'; import { useAllEsqlRuleFields } from './use_all_esql_rule_fields'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts index eabd2050e7ba..3d29970ad054 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_creation_ui/hooks/use_esql_index.test.ts @@ -4,7 +4,8 @@ * 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 { renderHook } from '@testing-library/react'; import { useEsqlIndex } from './use_esql_index'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx index 8862c626ea6e..55b10a34333a 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/flyout_components/add_to_rules_table/use_add_to_rules_table.test.tsx @@ -6,8 +6,7 @@ */ import React from 'react'; -import { fireEvent, render as rTLRender, waitFor, act } from '@testing-library/react'; -import { renderHook } from '@testing-library/react-hooks'; +import { fireEvent, render as rTLRender, waitFor, act, renderHook } from '@testing-library/react'; import type { EuiTableFieldDataColumnType } from '@elastic/eui'; import type { Rule } from '../../../../rule_management/logic/types'; import { getRulesSchemaMock } from '../../../../../../common/api/detection_engine/model/rule_schema/mocks'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts index 4c0df5f03e09..92a5e60bb559 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/components/value_with_space_warning/__tests__/use_value_with_space_warning.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useValueWithSpaceWarning } from '../use_value_with_space_warning'; describe('useValueWithSpaceWarning', () => { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx index 6cca3e02e322..8ec41f5cb70f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_exceptions/logic/use_fetch_or_create_rule_exception_list.test.tsx @@ -5,8 +5,8 @@ * 2.0. */ -import type { RenderHookResult } from '@testing-library/react-hooks'; -import { act, renderHook } from '@testing-library/react-hooks'; +import type { RenderHookResult } from '@testing-library/react'; +import { waitFor, renderHook } from '@testing-library/react'; import { coreMock } from '@kbn/core/public/mocks'; import * as rulesApi from '../../rule_management/api/api'; @@ -40,8 +40,8 @@ describe('useFetchOrCreateRuleExceptionList', () => { let render: ( listType?: UseFetchOrCreateRuleExceptionListProps['exceptionListType'] ) => RenderHookResult< - UseFetchOrCreateRuleExceptionListProps, - ReturnUseFetchOrCreateRuleExceptionList + ReturnUseFetchOrCreateRuleExceptionList, + UseFetchOrCreateRuleExceptionListProps >; const onError = jest.fn(); const onSuccess = jest.fn(); @@ -94,15 +94,14 @@ describe('useFetchOrCreateRuleExceptionList', () => { .mockResolvedValue(detectionExceptionList); render = (listType = detectionListType) => - renderHook<UseFetchOrCreateRuleExceptionListProps, ReturnUseFetchOrCreateRuleExceptionList>( - () => - useFetchOrCreateRuleExceptionList({ - http: mockKibanaHttpService, - ruleId, - exceptionListType: listType, - onError, - onSuccess, - }) + renderHook(() => + useFetchOrCreateRuleExceptionList({ + http: mockKibanaHttpService, + ruleId, + exceptionListType: listType, + onError, + onSuccess, + }) ); }); @@ -111,20 +110,17 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('initializes hook', async () => { - const { result, waitForNextUpdate } = render(); + const { result } = render(); // Should set isLoading to true while fetching expect(result.current).toEqual([true, null]); - await waitForNextUpdate(); - expect(result.current).toEqual([false, detectionExceptionList]); + await waitFor(() => expect(result.current).toEqual([false, detectionExceptionList])); }); it('fetches the rule with the given ruleId', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); + render(); + await waitFor(() => { expect(fetchRuleById).toHaveBeenCalledTimes(1); expect(fetchRuleById).toHaveBeenCalledWith({ id: ruleId, @@ -141,78 +137,48 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('does not fetch the exceptions lists', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(fetchExceptionListById).not.toHaveBeenCalled(); - }); + render(); + await waitFor(() => expect(fetchExceptionListById).not.toHaveBeenCalled()); }); + it('should create a new exception list', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(addExceptionList).toHaveBeenCalledTimes(1); - }); + render(); + await waitFor(() => expect(addExceptionList).toHaveBeenCalledTimes(1)); }); it('should update the rule', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(patchRule).toHaveBeenCalledTimes(1); - }); + render(); + await waitFor(() => expect(patchRule).toHaveBeenCalledTimes(1)); }); it('invokes onSuccess', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(onSuccess).toHaveBeenCalledWith(false); - }); + render(); + await waitFor(() => expect(onSuccess).toHaveBeenCalledWith(false)); }); }); describe("when the rule has exception list references and 'detection' is passed in", () => { it('fetches the exceptions lists', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(fetchExceptionListById).toHaveBeenCalledTimes(2); - }); + render(); + await waitFor(() => expect(fetchExceptionListById).toHaveBeenCalledTimes(2)); }); + it('does not create a new exception list', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(addExceptionList).not.toHaveBeenCalled(); - }); + render(); + await waitFor(() => expect(addExceptionList).not.toHaveBeenCalled()); }); + it('does not update the rule', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(patchRule).not.toHaveBeenCalled(); - }); + render(); + await waitFor(() => expect(patchRule).not.toHaveBeenCalled()); }); + it('should set the exception list to be the fetched list', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current[1]).toEqual(detectionExceptionList); - }); + const { result } = render(); + await waitFor(() => expect(result.current[1]).toEqual(detectionExceptionList)); }); + it('invokes onSuccess indicating', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(onSuccess).toHaveBeenCalledWith(false); - }); + render(); + await waitFor(() => expect(onSuccess).toHaveBeenCalledWith(false)); }); describe("but the rule does not have a reference to 'detection' type exception list", () => { @@ -223,30 +189,16 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('should create a new exception list', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(addExceptionList).toHaveBeenCalledTimes(1); - }); + render(); + await waitFor(() => expect(addExceptionList).toHaveBeenCalledTimes(1)); }); it('should update the rule', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(patchRule).toHaveBeenCalledTimes(1); - }); + render(); + await waitFor(() => expect(patchRule).toHaveBeenCalledTimes(1)); }); it('should set the exception list to be the newly created list', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current[1]).toEqual(newDetectionExceptionList); - }); + const { result } = render(); + await waitFor(() => expect(result.current[1]).toEqual(newDetectionExceptionList)); }); }); }); @@ -263,34 +215,20 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('fetches the exceptions lists', async () => { - await act(async () => { - const { waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(fetchExceptionListById).toHaveBeenCalledTimes(2); - }); + render(endpointListType); + await waitFor(() => expect(fetchExceptionListById).toHaveBeenCalledTimes(2)); }); it('does not create a new exception list', async () => { - await act(async () => { - const { waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - expect(addExceptionList).not.toHaveBeenCalled(); - }); + render(endpointListType); + await waitFor(() => expect(addExceptionList).not.toHaveBeenCalled()); }); it('does not update the rule', async () => { - await act(async () => { - const { waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - expect(patchRule).not.toHaveBeenCalled(); - }); + render(endpointListType); + await waitFor(() => expect(patchRule).not.toHaveBeenCalled()); }); it('should set the exception list to be the fetched list', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current[1]).toEqual(endpointExceptionList); - }); + const { result } = render(endpointListType); + await waitFor(() => expect(result.current[1]).toEqual(endpointExceptionList)); }); describe("but the rule does not have a reference to 'endpoint' type exception list", () => { @@ -301,30 +239,16 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('should create a new exception list', async () => { - await act(async () => { - const { waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(addEndpointExceptionList).toHaveBeenCalledTimes(1); - }); + render(endpointListType); + await waitFor(() => expect(addEndpointExceptionList).toHaveBeenCalledTimes(1)); }); it('should update the rule', async () => { - await act(async () => { - const { waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(patchRule).toHaveBeenCalledTimes(1); - }); + render(endpointListType); + await waitFor(() => expect(patchRule).toHaveBeenCalledTimes(1)); }); it('should set the exception list to be the newly created list', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(endpointListType); - await waitForNextUpdate(); - await waitForNextUpdate(); - await waitForNextUpdate(); - expect(result.current[1]).toEqual(newEndpointExceptionList); - }); + const { result } = render(endpointListType); + await waitFor(() => expect(result.current[1]).toEqual(newEndpointExceptionList)); }); }); }); @@ -335,37 +259,26 @@ describe('useFetchOrCreateRuleExceptionList', () => { }); it('exception list should be null', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(result.current[1]).toBeNull(); - }); + const { result } = render(); + await waitFor(() => expect(result.current[1]).toBeNull()); }); it('isLoading should be false', async () => { - await act(async () => { - const { result, waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(result.current[0]).toEqual(false); - }); + const { result } = render(); + await waitFor(() => expect(result.current[0]).toEqual(false)); }); it('should call error callback', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - await waitForNextUpdate(); + render(); + await waitFor(() => { expect(onError).toHaveBeenCalledTimes(1); expect(onError).toHaveBeenCalledWith(error, null, null); }); }); it('does not call onSuccess', async () => { - await act(async () => { - const { waitForNextUpdate } = render(); - await waitForNextUpdate(); - expect(onSuccess).not.toHaveBeenCalled(); - }); + render(); + await waitFor(() => expect(onSuccess).not.toHaveBeenCalled()); }); }); }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx index 6c641ceb2ad9..e67e479c3825 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/api/hooks/use_schedule_rule_run_mutation.test.tsx @@ -7,7 +7,7 @@ import moment from 'moment'; -import { act } from '@testing-library/react-hooks'; +import { act } from '@testing-library/react'; import { useScheduleRuleRunMutation } from './use_schedule_rule_run_mutation'; import { renderMutation } from '../../../../management/hooks/test_utils'; import { scheduleRuleRunMock } from '../../logic/__mocks__/mock'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx index ce70bc08bd72..d20d8e8e7642 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_gaps/logic/use_schedule_rule_run.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { act, renderHook } from '@testing-library/react-hooks'; +import { renderHook, act, waitFor } from '@testing-library/react'; import moment from 'moment'; import { useKibana } from '../../../common/lib/kibana'; import { useKibana as mockUseKibana } from '../../../common/lib/kibana/__mocks__'; @@ -41,7 +41,7 @@ describe('When using the `useScheduleRuleRun()` hook', () => { }); it('should send schedule rule run request', async () => { - const { result, waitFor } = renderHook(() => useScheduleRuleRun(), { + const { result } = renderHook(() => useScheduleRuleRun(), { wrapper: TestProviders, }); @@ -50,20 +50,18 @@ describe('When using the `useScheduleRuleRun()` hook', () => { result.current.scheduleRuleRun({ ruleIds: ['rule-1'], timeRange }); }); - await waitFor(() => { - return mockUseScheduleRuleRunMutation.mock.calls.length > 0; - }); - - expect(mockUseScheduleRuleRunMutation).toHaveBeenCalledWith( - expect.objectContaining({ - ruleIds: ['rule-1'], - timeRange, - }) + await waitFor(() => + expect(mockUseScheduleRuleRunMutation).toHaveBeenCalledWith( + expect.objectContaining({ + ruleIds: ['rule-1'], + timeRange, + }) + ) ); }); it('should call reportEvent with success status on success', async () => { - const { result, waitFor } = renderHook(() => useScheduleRuleRun(), { + const { result } = renderHook(() => useScheduleRuleRun(), { wrapper: TestProviders, }); @@ -74,22 +72,20 @@ describe('When using the `useScheduleRuleRun()` hook', () => { result.current.scheduleRuleRun({ ruleIds: ['rule-1'], timeRange }); }); - await waitFor(() => { - return mockUseScheduleRuleRunMutation.mock.calls.length > 0; - }); - - expect(mockedUseKibana.services.telemetry.reportEvent).toHaveBeenCalledWith( - ManualRuleRunEventTypes.ManualRuleRunExecute, - { - rangeInMs: timeRange.endDate.diff(timeRange.startDate), - status: 'success', - rulesCount: 1, - } + await waitFor(() => + expect(mockedUseKibana.services.telemetry.reportEvent).toHaveBeenCalledWith( + ManualRuleRunEventTypes.ManualRuleRunExecute, + { + rangeInMs: timeRange.endDate.diff(timeRange.startDate), + status: 'success', + rulesCount: 1, + } + ) ); }); it('should call reportEvent with error status on failure', async () => { - const { result, waitFor } = renderHook(() => useScheduleRuleRun(), { + const { result } = renderHook(() => useScheduleRuleRun(), { wrapper: TestProviders, }); @@ -100,17 +96,15 @@ describe('When using the `useScheduleRuleRun()` hook', () => { result.current.scheduleRuleRun({ ruleIds: ['rule-1'], timeRange }); }); - await waitFor(() => { - return mockUseScheduleRuleRunMutation.mock.calls.length > 0; - }); - - expect(mockedUseKibana.services.telemetry.reportEvent).toHaveBeenCalledWith( - ManualRuleRunEventTypes.ManualRuleRunExecute, - { - rangeInMs: timeRange.endDate.diff(timeRange.startDate), - status: 'error', - rulesCount: 1, - } + await waitFor(() => + expect(mockedUseKibana.services.telemetry.reportEvent).toHaveBeenCalledWith( + ManualRuleRunEventTypes.ManualRuleRunExecute, + { + rangeInMs: timeRange.endDate.diff(timeRange.startDate), + status: 'error', + rulesCount: 1, + } + ) ); }); }); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx index 7c7125a36dc5..3425779926f7 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/rule_details_flyout.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import type { FC, PropsWithChildren } from 'react'; +import type { FC, PropsWithChildren, ReactNode } from 'react'; import React, { useMemo, useState, useEffect } from 'react'; import styled from 'styled-components'; import { css } from '@emotion/css'; @@ -107,6 +107,7 @@ export const TabContentPadding: FC<PropsWithChildren<unknown>> = ({ children }) interface RuleDetailsFlyoutProps { rule: RuleResponse; + subHeader?: ReactNode; ruleActions?: React.ReactNode; size?: EuiFlyoutProps['size']; extraTabs?: EuiTabbedContentTab[]; @@ -115,15 +116,16 @@ interface RuleDetailsFlyoutProps { closeFlyout: () => void; } -export const RuleDetailsFlyout = ({ +export function RuleDetailsFlyout({ rule, ruleActions, + subHeader, size = 'm', extraTabs = [], dataTestSubj, id, closeFlyout, -}: RuleDetailsFlyoutProps) => { +}: RuleDetailsFlyoutProps): JSX.Element { const { expandedOverviewSections, toggleOverviewSection } = useOverviewTabSections(); const overviewTab: EuiTabbedContentTab = useMemo( @@ -202,7 +204,13 @@ export const RuleDetailsFlyout = ({ <EuiTitle size="m"> <h2 id={prebuiltRulesFlyoutTitleId}>{rule.name}</h2> </EuiTitle> - <EuiSpacer size="l" /> + <EuiSpacer size="s" /> + {subHeader && ( + <> + {subHeader} + <EuiSpacer size="s" /> + </> + )} </EuiFlyoutHeader> <StyledEuiFlyoutBody> <ScrollableFlyoutTabbedContent @@ -223,4 +231,4 @@ export const RuleDetailsFlyout = ({ </EuiFlyoutFooter> </EuiFlyout> ); -}; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx new file mode 100644 index 000000000000..d21136531fd0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/action_required.tsx @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiBadge } from '@elastic/eui'; +import * as i18n from './translations'; + +export function ActionRequiredBadge(): JSX.Element { + return <EuiBadge color="danger">{i18n.ACTION_REQUIRED}</EuiBadge>; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.tsx new file mode 100644 index 000000000000..bfe70af03183 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/modified_badge.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 type { ReactNode } from 'react'; +import React from 'react'; +import { EuiBadge, EuiToolTip } from '@elastic/eui'; +import * as i18n from './translations'; + +interface ModifiedBadgeProps { + tooltip?: ReactNode; +} + +export function ModifiedBadge({ tooltip }: ModifiedBadgeProps): JSX.Element { + return ( + <EuiToolTip content={tooltip}> + <EuiBadge color="hollow" iconType="indexEdit" iconSide="left"> + {i18n.MODIFIED} + </EuiBadge> + </EuiToolTip> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx new file mode 100644 index 000000000000..c5498fe04dcf --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/ready_for_upgrade_badge.tsx @@ -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 React from 'react'; +import type { EuiBadgeProps } from '@elastic/eui'; +import { EuiBadge } from '@elastic/eui'; +import * as i18n from './translations'; + +interface ReadyForUpgradeBadgeProps { + color?: EuiBadgeProps['color']; +} + +export function ReadyForUpgradeBadge({ + color = 'success', +}: ReadyForUpgradeBadgeProps): JSX.Element { + return <EuiBadge color={color}>{i18n.READY_FOR_UPDATE}</EuiBadge>; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx new file mode 100644 index 000000000000..db02ce9a3615 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/review_required_badge.tsx @@ -0,0 +1,14 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiBadge } from '@elastic/eui'; +import * as i18n from './translations'; + +export function ReviewRequiredBadge(): JSX.Element { + return <EuiBadge color="warning">{i18n.REVIEW_REQUIRED}</EuiBadge>; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/translations.ts new file mode 100644 index 000000000000..f55b9ad2eef7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/badges/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 READY_FOR_UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.badge.readyForUpdate', + { + defaultMessage: 'Ready for update', + } +); + +export const REVIEW_REQUIRED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.badge.reviewRequired', + { + defaultMessage: 'Review required', + } +); + +export const ACTION_REQUIRED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.badge.actionRequired', + { + defaultMessage: 'Action required', + } +); + +export const MODIFIED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.badge.modified', + { + defaultMessage: 'Modified', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.stories.tsx deleted file mode 100644 index 37ddb71dce9f..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.stories.tsx +++ /dev/null @@ -1,315 +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 { Story } from '@storybook/react'; -import { ComparisonSide } from './comparison_side'; -import type { - ThreeWayDiff, - DiffableAllFields, - RuleKqlQuery, -} from '../../../../../../../common/api/detection_engine'; -import { - ThreeWayDiffOutcome, - ThreeWayMergeOutcome, - ThreeWayDiffConflict, - KqlQueryType, -} from '../../../../../../../common/api/detection_engine'; -export default { - component: ComparisonSide, - title: 'Rule Management/Prebuilt Rules/Upgrade Flyout/ThreeWayDiff/ComparisonSide', - argTypes: { - fieldName: { - control: 'text', - description: 'Field name to compare', - }, - fieldThreeWayDiff: { - control: 'object', - description: 'Field ThreeWayDiff', - }, - resolvedValue: { - control: 'text', - description: 'Resolved value', - }, - }, -}; - -interface TemplateProps<FieldName extends keyof DiffableAllFields> { - fieldName: FieldName; - fieldThreeWayDiff: ThreeWayDiff<DiffableAllFields[FieldName]>; - resolvedValue?: DiffableAllFields[FieldName]; -} - -const Template: Story<TemplateProps<keyof DiffableAllFields>> = (args) => { - return ( - <ComparisonSide - fieldName={args.fieldName} - fieldThreeWayDiff={args.fieldThreeWayDiff} - resolvedValue={args.resolvedValue} - /> - ); -}; - -export const NoBaseVersion = Template.bind({}); -NoBaseVersion.args = { - fieldName: 'rule_name_override', - fieldThreeWayDiff: { - has_base_version: false, - base_version: undefined, - current_version: { - field_name: 'rule.name', - }, - target_version: undefined, - merged_version: undefined, - diff_outcome: ThreeWayDiffOutcome.MissingBaseCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Target, - has_update: true, - conflict: ThreeWayDiffConflict.SOLVABLE, - }, -}; - -export const WithResolvedValue = Template.bind({}); -WithResolvedValue.args = { - fieldName: 'risk_score', - fieldThreeWayDiff: { - has_base_version: true, - base_version: 10, - current_version: 40, - target_version: 20, - merged_version: 40, - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: true, - conflict: ThreeWayDiffConflict.NON_SOLVABLE, - }, - resolvedValue: 35, -}; -WithResolvedValue.argTypes = { - resolvedValue: { - control: 'number', - }, -}; - -/* Optional field becomes defined - was undefined in base version, but was then defined by user in current version */ -export const OptionalFieldBecomesDefined = Template.bind({}); -OptionalFieldBecomesDefined.args = { - fieldName: 'timestamp_override', - fieldThreeWayDiff: { - has_base_version: true, - base_version: undefined, - current_version: { - field_name: 'event.ingested', - fallback_disabled: true, - }, - target_version: undefined, - merged_version: { - field_name: 'event.ingested', - fallback_disabled: true, - }, - diff_outcome: ThreeWayDiffOutcome.CustomizedValueNoUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: false, - conflict: ThreeWayDiffConflict.NONE, - }, -}; - -export const SubfieldsWithLabels = Template.bind({}); - -const subfieldsWithLabelsThreeWayDiff: ThreeWayDiff<RuleKqlQuery> = { - has_base_version: true, - base_version: { - type: KqlQueryType.inline_query, - query: 'event.agent_id_status: *', - language: 'kuery', - filters: [], - }, - current_version: { - type: KqlQueryType.inline_query, - query: 'event.agent_id_status: *', - language: 'kuery', - filters: [], - }, - target_version: { - type: KqlQueryType.saved_query, - saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', - }, - merged_version: { - type: KqlQueryType.saved_query, - saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', - }, - diff_outcome: ThreeWayDiffOutcome.StockValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Target, - has_update: true, - conflict: ThreeWayDiffConflict.NONE, -}; - -SubfieldsWithLabels.args = { - fieldName: 'kql_query', - fieldThreeWayDiff: subfieldsWithLabelsThreeWayDiff, -}; - -/* Field type changes - in this example "kql_query" field was "inline" in base version, but became "saved" in the current version */ -export const FieldTypeChanges = Template.bind({}); - -const fieldTypeChangesThreeWayDiff: ThreeWayDiff<RuleKqlQuery> = { - has_base_version: true, - base_version: { - type: KqlQueryType.inline_query, - query: 'event.agent_id_status: *', - language: 'kuery', - filters: [], - }, - current_version: { - type: KqlQueryType.saved_query, - saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', - }, - target_version: { - type: KqlQueryType.inline_query, - query: 'event.agent_id_status: *', - language: 'kuery', - filters: [], - }, - merged_version: { - type: KqlQueryType.saved_query, - saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', - }, - diff_outcome: ThreeWayDiffOutcome.CustomizedValueNoUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: false, - conflict: ThreeWayDiffConflict.NONE, -}; - -FieldTypeChanges.args = { - fieldName: 'kql_query', - fieldThreeWayDiff: fieldTypeChangesThreeWayDiff, -}; - -export const SingleLineStringSubfieldChanges = Template.bind({}); -SingleLineStringSubfieldChanges.args = { - fieldName: 'name', - fieldThreeWayDiff: { - has_base_version: true, - base_version: 'Prebuilt rule', - current_version: 'Customized prebuilt rule', - target_version: 'Prebuilt rule with new changes', - merged_version: 'Customized prebuilt rule', - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: true, - conflict: ThreeWayDiffConflict.NON_SOLVABLE, - }, -}; - -export const MultiLineStringSubfieldChanges = Template.bind({}); -MultiLineStringSubfieldChanges.args = { - fieldName: 'note', - fieldThreeWayDiff: { - has_base_version: true, - base_version: 'My description.\f\nThis is a second\u2001 line.\f\nThis is a third line.', - current_version: - 'My GREAT description.\f\nThis is a second\u2001 line.\f\nThis is a third line.', - target_version: 'My description.\f\nThis is a second\u2001 line.\f\nThis is a GREAT line.', - merged_version: - 'My GREAT description.\f\nThis is a second\u2001 line.\f\nThis is a GREAT line.', - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Merged, - has_update: true, - conflict: ThreeWayDiffConflict.SOLVABLE, - }, -}; - -export const NumberSubfieldChanges = Template.bind({}); -NumberSubfieldChanges.args = { - fieldName: 'risk_score', - fieldThreeWayDiff: { - has_base_version: true, - base_version: 33, - current_version: 43, - target_version: 53, - merged_version: 43, - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: true, - conflict: ThreeWayDiffConflict.NON_SOLVABLE, - }, -}; - -export const ArraySubfieldChanges = Template.bind({}); -ArraySubfieldChanges.args = { - fieldName: 'tags', - fieldThreeWayDiff: { - has_base_version: true, - base_version: ['one', 'two', 'three'], - current_version: ['two', 'three', 'four', 'five'], - target_version: ['one', 'three', 'four', 'six'], - merged_version: ['three', 'four', 'five', 'six'], - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: true, - conflict: ThreeWayDiffConflict.SOLVABLE, - }, -}; - -export const QuerySubfieldChanges = Template.bind({}); -QuerySubfieldChanges.args = { - fieldName: 'kql_query', - fieldThreeWayDiff: { - has_base_version: true, - base_version: { - type: KqlQueryType.inline_query, - query: - 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"servicePrincipalName"\n', - language: 'kuery', - filters: [], - }, - current_version: { - type: KqlQueryType.inline_query, - query: - 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" or winlog.event_data.OperationType:"%%14675" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"serviceSecondaryName"\n', - language: 'kuery', - filters: [], - }, - target_version: { - type: KqlQueryType.inline_query, - query: - 'event.action:("Directory Service Changes" or "Directory Service Modifications" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"servicePrincipalName"\n', - language: 'kuery', - filters: [], - }, - merged_version: { - type: KqlQueryType.inline_query, - query: - 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" or winlog.event_data.OperationType:"%%14675" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"serviceSecondaryName"\n', - language: 'kuery', - filters: [], - }, - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Current, - has_update: true, - conflict: ThreeWayDiffConflict.NON_SOLVABLE, - }, -}; - -export const SetupGuideSubfieldChanges = Template.bind({}); -SetupGuideSubfieldChanges.args = { - fieldName: 'setup', - fieldThreeWayDiff: { - has_base_version: true, - base_version: - '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".\n- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"\n- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n', - current_version: - '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n- Custom Windows Event Logs\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect.\n- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- The rule is now ready to run.\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for AXT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the AXT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n', - target_version: - '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".\n- Carefully select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"\n- Enter a title for the agent policy in "New agent policy title". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. You can use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n- Good luck!\n', - merged_version: - '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n- Custom Windows Event Logs\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect.\n- Carefully select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- Enter a title for the agent policy in "New agent policy title". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- The rule is now ready to run.\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. You can use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for AXT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the AXT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n- Good luck!\n', - diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, - merge_outcome: ThreeWayMergeOutcome.Merged, - has_update: true, - conflict: ThreeWayDiffConflict.SOLVABLE, - }, -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.tsx deleted file mode 100644 index e5ec6a8dfc54..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side.tsx +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useState } from 'react'; -import { EuiFlexGroup, EuiTitle } from '@elastic/eui'; -import { VersionsPicker } from '../versions_picker/versions_picker'; -import type { Version } from '../versions_picker/constants'; -import { SelectedVersions } from '../versions_picker/constants'; -import { pickFieldValueForVersion } from './utils'; -import type { - DiffableAllFields, - ThreeWayDiff, -} from '../../../../../../../common/api/detection_engine'; -import { getSubfieldChanges } from './get_subfield_changes'; -import { SubfieldChanges } from './subfield_changes'; -import { SideHeader } from '../components/side_header'; -import { ComparisonSideHelpInfo } from './comparison_side_help_info'; -import * as i18n from './translations'; - -interface ComparisonSideProps<FieldName extends keyof DiffableAllFields> { - fieldName: FieldName; - fieldThreeWayDiff: ThreeWayDiff<DiffableAllFields[FieldName]>; - resolvedValue: DiffableAllFields[FieldName]; -} - -export function ComparisonSide<FieldName extends keyof DiffableAllFields>({ - fieldName, - fieldThreeWayDiff, - resolvedValue, -}: ComparisonSideProps<FieldName>) { - const [selectedVersions, setSelectedVersions] = useState<SelectedVersions>( - SelectedVersions.CurrentFinal - ); - - const [oldVersionType, newVersionType] = selectedVersions.split('_') as [Version, Version]; - - const oldFieldValue = pickFieldValueForVersion(oldVersionType, fieldThreeWayDiff, resolvedValue); - - const newFieldValue = pickFieldValueForVersion(newVersionType, fieldThreeWayDiff, resolvedValue); - - const subfieldChanges = getSubfieldChanges(fieldName, oldFieldValue, newFieldValue); - - return ( - <> - <SideHeader> - <EuiFlexGroup direction="row" alignItems="center"> - <EuiTitle size="xxs"> - <h3> - {i18n.TITLE} - <ComparisonSideHelpInfo /> - </h3> - </EuiTitle> - <VersionsPicker - hasBaseVersion={fieldThreeWayDiff.has_base_version} - selectedVersions={selectedVersions} - onChange={setSelectedVersions} - /> - </EuiFlexGroup> - </SideHeader> - <SubfieldChanges fieldName={fieldName} subfieldChanges={subfieldChanges} /> - </> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx index e1eaa9b1e96c..47e5e537f3ab 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/comparison_side_help_info.tsx @@ -9,6 +9,14 @@ import React from 'react'; import useToggle from 'react-use/lib/useToggle'; import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { i18n } from '@kbn/i18n'; +import { TITLE } from './translations'; +import { + BASE_VERSION, + CURRENT_VERSION, + FINAL_VERSION, + TARGET_VERSION, +} from './versions_picker/translations'; /** * Theme doesn't expose width variables. Using provided size variables will require @@ -34,10 +42,64 @@ export function ComparisonSideHelpInfo(): JSX.Element { <EuiPopover button={button} isOpen={isPopoverOpen} closePopover={togglePopover}> <EuiText style={{ width: POPOVER_WIDTH }} size="s"> <FormattedMessage - id="xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText" - defaultMessage="Choose field values used in the upgraded rule. " + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.comparisonSide.upgradeHelpText" + defaultMessage="{title} shows field's JSON diff between prebuilt rule field versions affecting the rule update process. {versions}" + values={{ + title: <strong>{TITLE}</strong>, + versions: ( + <> + <br /> + <ul> + <li> + <strong>{BASE_VERSION}</strong> {'-'} {BASE_VERSION_EXPLANATION} + </li> + <li> + <strong>{CURRENT_VERSION}</strong> {'-'} {CURRENT_VERSION_EXPLANATION} + </li> + <li> + <strong>{TARGET_VERSION}</strong> {'-'} {TARGET_VERSION_EXPLANATION} + </li> + <li> + <strong>{FINAL_VERSION}</strong> {'-'} {FINAL_VERSION_EXPLANATION} + </li> + </ul> + </> + ), + }} /> </EuiText> </EuiPopover> ); } + +const BASE_VERSION_EXPLANATION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.baseVersionExplanation', + { + defaultMessage: 'version originally installed from Elastic prebuilt rules package', + } +); + +const CURRENT_VERSION_EXPLANATION = ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.currentVersionExplanation" + defaultMessage="current version including modification made after prebuilt rule installation. With lack of modifications it matches with {base}." + values={{ + base: <strong>{BASE_VERSION}</strong>, + }} + /> +); + +const TARGET_VERSION_EXPLANATION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.targetVersionExplanation', + { + defaultMessage: 'version coming from a new version of Elastic prebuilt rules package', + } +); + +const FINAL_VERSION_EXPLANATION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.finalVersionExplanation', + { + defaultMessage: + 'version used to the update the rule. Initial value is suggested by the diff algorithm.', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx new file mode 100644 index 000000000000..004b7ff25670 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.stories.tsx @@ -0,0 +1,309 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { Story } from '@storybook/react'; +import { FieldComparisonSide } from './field_comparison_side'; +import type { + ThreeWayDiff, + DiffableAllFields, + RuleKqlQuery, +} from '../../../../../../../common/api/detection_engine'; +import { + ThreeWayDiffOutcome, + ThreeWayMergeOutcome, + ThreeWayDiffConflict, + KqlQueryType, +} from '../../../../../../../common/api/detection_engine'; +export default { + component: FieldComparisonSide, + title: 'Rule Management/Prebuilt Rules/Upgrade Flyout/ThreeWayDiff/ComparisonSide', + argTypes: { + fieldName: { + control: 'text', + description: 'Field name to compare', + }, + fieldThreeWayDiff: { + control: 'object', + description: 'Field ThreeWayDiff', + }, + resolvedValue: { + control: 'text', + description: 'Resolved value', + }, + }, +}; + +interface TemplateProps<FieldName extends keyof DiffableAllFields> { + fieldName: FieldName; + fieldThreeWayDiff: ThreeWayDiff<DiffableAllFields[FieldName]>; + resolvedValue?: DiffableAllFields[FieldName]; +} + +const Template: Story<TemplateProps<keyof DiffableAllFields>> = () => { + return <FieldComparisonSide />; +}; + +export const NoBaseVersion = Template.bind({}); +NoBaseVersion.args = { + fieldName: 'rule_name_override', + fieldThreeWayDiff: { + has_base_version: false, + base_version: undefined, + current_version: { + field_name: 'rule.name', + }, + target_version: undefined, + merged_version: undefined, + diff_outcome: ThreeWayDiffOutcome.MissingBaseCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Target, + has_update: true, + conflict: ThreeWayDiffConflict.SOLVABLE, + }, +}; + +export const WithResolvedValue = Template.bind({}); +WithResolvedValue.args = { + fieldName: 'risk_score', + fieldThreeWayDiff: { + has_base_version: true, + base_version: 10, + current_version: 40, + target_version: 20, + merged_version: 40, + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: true, + conflict: ThreeWayDiffConflict.NON_SOLVABLE, + }, + resolvedValue: 35, +}; +WithResolvedValue.argTypes = { + resolvedValue: { + control: 'number', + }, +}; + +/* Optional field becomes defined - was undefined in base version, but was then defined by user in current version */ +export const OptionalFieldBecomesDefined = Template.bind({}); +OptionalFieldBecomesDefined.args = { + fieldName: 'timestamp_override', + fieldThreeWayDiff: { + has_base_version: true, + base_version: undefined, + current_version: { + field_name: 'event.ingested', + fallback_disabled: true, + }, + target_version: undefined, + merged_version: { + field_name: 'event.ingested', + fallback_disabled: true, + }, + diff_outcome: ThreeWayDiffOutcome.CustomizedValueNoUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: false, + conflict: ThreeWayDiffConflict.NONE, + }, +}; + +export const SubfieldsWithLabels = Template.bind({}); + +const subfieldsWithLabelsThreeWayDiff: ThreeWayDiff<RuleKqlQuery> = { + has_base_version: true, + base_version: { + type: KqlQueryType.inline_query, + query: 'event.agent_id_status: *', + language: 'kuery', + filters: [], + }, + current_version: { + type: KqlQueryType.inline_query, + query: 'event.agent_id_status: *', + language: 'kuery', + filters: [], + }, + target_version: { + type: KqlQueryType.saved_query, + saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', + }, + merged_version: { + type: KqlQueryType.saved_query, + saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', + }, + diff_outcome: ThreeWayDiffOutcome.StockValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Target, + has_update: true, + conflict: ThreeWayDiffConflict.NONE, +}; + +SubfieldsWithLabels.args = { + fieldName: 'kql_query', + fieldThreeWayDiff: subfieldsWithLabelsThreeWayDiff, +}; + +/* Field type changes - in this example "kql_query" field was "inline" in base version, but became "saved" in the current version */ +export const FieldTypeChanges = Template.bind({}); + +const fieldTypeChangesThreeWayDiff: ThreeWayDiff<RuleKqlQuery> = { + has_base_version: true, + base_version: { + type: KqlQueryType.inline_query, + query: 'event.agent_id_status: *', + language: 'kuery', + filters: [], + }, + current_version: { + type: KqlQueryType.saved_query, + saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', + }, + target_version: { + type: KqlQueryType.inline_query, + query: 'event.agent_id_status: *', + language: 'kuery', + filters: [], + }, + merged_version: { + type: KqlQueryType.saved_query, + saved_query_id: 'e355ef26-45f5-40f1-bbb7-5176ecf07d5c', + }, + diff_outcome: ThreeWayDiffOutcome.CustomizedValueNoUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: false, + conflict: ThreeWayDiffConflict.NONE, +}; + +FieldTypeChanges.args = { + fieldName: 'kql_query', + fieldThreeWayDiff: fieldTypeChangesThreeWayDiff, +}; + +export const SingleLineStringSubfieldChanges = Template.bind({}); +SingleLineStringSubfieldChanges.args = { + fieldName: 'name', + fieldThreeWayDiff: { + has_base_version: true, + base_version: 'Prebuilt rule', + current_version: 'Customized prebuilt rule', + target_version: 'Prebuilt rule with new changes', + merged_version: 'Customized prebuilt rule', + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: true, + conflict: ThreeWayDiffConflict.NON_SOLVABLE, + }, +}; + +export const MultiLineStringSubfieldChanges = Template.bind({}); +MultiLineStringSubfieldChanges.args = { + fieldName: 'note', + fieldThreeWayDiff: { + has_base_version: true, + base_version: 'My description.\f\nThis is a second\u2001 line.\f\nThis is a third line.', + current_version: + 'My GREAT description.\f\nThis is a second\u2001 line.\f\nThis is a third line.', + target_version: 'My description.\f\nThis is a second\u2001 line.\f\nThis is a GREAT line.', + merged_version: + 'My GREAT description.\f\nThis is a second\u2001 line.\f\nThis is a GREAT line.', + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Merged, + has_update: true, + conflict: ThreeWayDiffConflict.SOLVABLE, + }, +}; + +export const NumberSubfieldChanges = Template.bind({}); +NumberSubfieldChanges.args = { + fieldName: 'risk_score', + fieldThreeWayDiff: { + has_base_version: true, + base_version: 33, + current_version: 43, + target_version: 53, + merged_version: 43, + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: true, + conflict: ThreeWayDiffConflict.NON_SOLVABLE, + }, +}; + +export const ArraySubfieldChanges = Template.bind({}); +ArraySubfieldChanges.args = { + fieldName: 'tags', + fieldThreeWayDiff: { + has_base_version: true, + base_version: ['one', 'two', 'three'], + current_version: ['two', 'three', 'four', 'five'], + target_version: ['one', 'three', 'four', 'six'], + merged_version: ['three', 'four', 'five', 'six'], + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: true, + conflict: ThreeWayDiffConflict.SOLVABLE, + }, +}; + +export const QuerySubfieldChanges = Template.bind({}); +QuerySubfieldChanges.args = { + fieldName: 'kql_query', + fieldThreeWayDiff: { + has_base_version: true, + base_version: { + type: KqlQueryType.inline_query, + query: + 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"servicePrincipalName"\n', + language: 'kuery', + filters: [], + }, + current_version: { + type: KqlQueryType.inline_query, + query: + 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" or winlog.event_data.OperationType:"%%14675" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"serviceSecondaryName"\n', + language: 'kuery', + filters: [], + }, + target_version: { + type: KqlQueryType.inline_query, + query: + 'event.action:("Directory Service Changes" or "Directory Service Modifications" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"servicePrincipalName"\n', + language: 'kuery', + filters: [], + }, + merged_version: { + type: KqlQueryType.inline_query, + query: + 'event.action:("Directory Service Changes" or "directory-service-object-modified") and event.code:5136 and\n winlog.event_data.OperationType:"%%14674" or winlog.event_data.OperationType:"%%14675" and\n winlog.event_data.ObjectClass:"user" and\n winlog.event_data.AttributeLDAPDisplayName:"serviceSecondaryName"\n', + language: 'kuery', + filters: [], + }, + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Current, + has_update: true, + conflict: ThreeWayDiffConflict.NON_SOLVABLE, + }, +}; + +export const SetupGuideSubfieldChanges = Template.bind({}); +SetupGuideSubfieldChanges.args = { + fieldName: 'setup', + fieldThreeWayDiff: { + has_base_version: true, + base_version: + '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".\n- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"\n- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n', + current_version: + '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n- Custom Windows Event Logs\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect.\n- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- The rule is now ready to run.\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for AXT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the AXT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n', + target_version: + '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".\n- Carefully select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"\n- Enter a title for the agent policy in "New agent policy title". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. You can use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n- Good luck!\n', + merged_version: + '## Setup\n\nThis rule requires data coming in from one of the following integrations:\n- Elastic Defend\n- Auditbeat\n- Custom Windows Event Logs\n\n### Elastic Defend Integration Setup\nElastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.\n\n#### Prerequisite Requirements:\n- Fleet is required for Elastic Defend.\n- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).\n\n#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:\n- Go to the Kibana home page and click "Add integrations".\n- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.\n- Click "Add Elastic Defend".\n- Configure the integration name and optionally add a description.\n- Select the type of environment you want to protect.\n- Carefully select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).\n- Enter a title for the agent policy in "New agent policy title". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.\nFor more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).\n- Click "Save and Continue".\n- The rule is now ready to run.\n- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.\nFor more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).\n\n### Auditbeat Setup\nAuditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. You can use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.\n\n#### The following steps should be executed in order to add the Auditbeat on a Linux System:\n- Elastic provides repositories available for AXT and YUM-based distributions. Note that we provide binary packages, but no source packages.\n- To install the AXT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).\n- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).\n- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).\n- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).\n- Good luck!\n', + diff_outcome: ThreeWayDiffOutcome.CustomizedValueCanUpdate, + merge_outcome: ThreeWayMergeOutcome.Merged, + has_update: true, + conflict: ThreeWayDiffConflict.SOLVABLE, + }, +}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.tsx new file mode 100644 index 000000000000..0b9b37c91e22 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/field_comparison_side.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import { VersionsPicker } from './versions_picker/versions_picker'; +import type { Version } from './versions_picker/constants'; +import { SelectedVersions } from './versions_picker/constants'; +import { FieldUpgradeSideHeader } from '../field_upgrade_side_header'; +import { useFieldUpgradeContext } from '../rule_upgrade/field_upgrade_context'; +import { pickFieldValueForVersion } from './utils'; +import { getSubfieldChanges } from './get_subfield_changes'; +import { SubfieldChanges } from './subfield_changes'; +import { ComparisonSideHelpInfo } from './comparison_side_help_info'; +import * as i18n from './translations'; + +export function FieldComparisonSide(): JSX.Element { + const { fieldName, fieldDiff, finalDiffableRule } = useFieldUpgradeContext(); + const resolvedValue = finalDiffableRule[fieldName]; + + const [selectedVersions, setSelectedVersions] = useState<SelectedVersions>( + SelectedVersions.CurrentFinal + ); + + const [oldVersionType, newVersionType] = selectedVersions.split('_') as [Version, Version]; + + const oldFieldValue = pickFieldValueForVersion(oldVersionType, fieldDiff, resolvedValue); + + const newFieldValue = pickFieldValueForVersion(newVersionType, fieldDiff, resolvedValue); + + const subfieldChanges = getSubfieldChanges(fieldName, oldFieldValue, newFieldValue); + + return ( + <> + <FieldUpgradeSideHeader> + <EuiFlexGroup alignItems="center"> + <EuiFlexItem> + <EuiTitle size="xxs"> + <h3> + {i18n.TITLE} + <ComparisonSideHelpInfo /> + </h3> + </EuiTitle> + </EuiFlexItem> + <EuiFlexItem> + <VersionsPicker + hasBaseVersion={fieldDiff.has_base_version} + selectedVersions={selectedVersions} + onChange={setSelectedVersions} + /> + </EuiFlexItem> + </EuiFlexGroup> + </FieldUpgradeSideHeader> + <SubfieldChanges fieldName={fieldName} subfieldChanges={subfieldChanges} /> + </> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts index c3628d74176c..0ac093b895a7 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/get_subfield_changes/index.ts @@ -28,10 +28,10 @@ import type { SubfieldChanges } from '../types'; * @param newFieldValue - The new value of the field. * @returns - An array of subfield changes. */ -export const getSubfieldChanges = <FieldName extends keyof DiffableAllFields>( - fieldName: FieldName, - oldFieldValue?: DiffableAllFields[FieldName], - newFieldValue?: DiffableAllFields[FieldName] +export const getSubfieldChanges = ( + fieldName: keyof DiffableAllFields, + oldFieldValue: unknown, + newFieldValue: unknown ): SubfieldChanges => { switch (fieldName) { /* diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx index af10edbe1c59..a5d44438f161 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/subfield_changes.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { Fragment } from 'react'; import { EuiHorizontalRule } from '@elastic/eui'; import type { SubfieldChanges } from './types'; import { Subfield } from './subfield'; @@ -28,16 +28,15 @@ export function SubfieldChanges({ fieldName, subfieldChanges }: SubfieldChangesP const shouldShowSeparator = index !== subfieldChanges.length - 1; return ( - <> + <Fragment key={`${fieldName}${change.subfieldName}`}> <Subfield - key={change.subfieldName} fieldName={fieldName} subfieldName={change.subfieldName} oldSubfieldValue={change.oldSubfieldValue} newSubfieldValue={change.newSubfieldValue} /> {shouldShowSeparator ? <EuiHorizontalRule margin="s" size="full" /> : null} - </> + </Fragment> ); })} </> diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts index d0673c460a1d..8f97d3462d35 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/utils.ts @@ -6,11 +6,8 @@ */ import stringify from 'json-stable-stringify'; -import { Version } from '../versions_picker/constants'; -import type { - DiffableAllFields, - ThreeWayDiff, -} from '../../../../../../../common/api/detection_engine'; +import { Version } from './versions_picker/constants'; +import type { ThreeWayDiff } from '../../../../../../../common/api/detection_engine'; /** * Picks the field value for a given version either from a three-way diff object or from a user-set resolved value. @@ -20,11 +17,11 @@ import type { * @param resolvedValue - A value field will be upgraded to. * @returns - The field value for the specified version */ -export function pickFieldValueForVersion<FieldName extends keyof DiffableAllFields>( +export function pickFieldValueForVersion( version: Version, - fieldThreeWayDiff: ThreeWayDiff<DiffableAllFields[FieldName]>, - resolvedValue: DiffableAllFields[FieldName] -): DiffableAllFields[FieldName] | undefined { + fieldThreeWayDiff: ThreeWayDiff<unknown>, + resolvedValue: unknown +): unknown { if (version === Version.Final) { return resolvedValue; } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.ts new file mode 100644 index 000000000000..04d38ed10dce --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/constants.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiSelectOption } from '@elastic/eui'; +import * as i18n from './translations'; + +export enum Version { + Base = 'base', + Current = 'current', + Target = 'target', + Final = 'final', +} + +export enum SelectedVersions { + BaseTarget = 'base_target', + BaseCurrent = 'base_current', + BaseFinal = 'base_final', + CurrentTarget = 'current_target', + CurrentFinal = 'current_final', + TargetFinal = 'target_final', +} + +export const CURRENT_OPTIONS: EuiSelectOption[] = [ + { + value: SelectedVersions.CurrentFinal, + text: i18n.VERSION1_VS_VERSION2(i18n.CURRENT_VERSION, i18n.FINAL_VERSION), + }, + { + value: SelectedVersions.CurrentTarget, + text: i18n.VERSION1_VS_VERSION2(i18n.CURRENT_VERSION, i18n.TARGET_VERSION), + }, +]; + +export const TARGET_OPTIONS: EuiSelectOption[] = [ + { + value: SelectedVersions.TargetFinal, + text: i18n.VERSION1_VS_VERSION2(i18n.TARGET_VERSION, i18n.FINAL_VERSION), + }, +]; + +export const BASE_OPTIONS: EuiSelectOption[] = [ + { + value: SelectedVersions.BaseFinal, + text: i18n.VERSION1_VS_VERSION2(i18n.BASE_VERSION, i18n.FINAL_VERSION), + }, + { + value: SelectedVersions.BaseTarget, + text: i18n.VERSION1_VS_VERSION2(i18n.BASE_VERSION, i18n.TARGET_VERSION), + }, + { + value: SelectedVersions.BaseCurrent, + text: i18n.VERSION1_VS_VERSION2(i18n.BASE_VERSION, i18n.CURRENT_VERSION), + }, +]; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.ts new file mode 100644 index 000000000000..0f63b8be2aa9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/translations.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 { i18n } from '@kbn/i18n'; + +export const BASE_VERSION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.baseVersionLabel', + { + defaultMessage: 'Original', + } +); + +export const CURRENT_VERSION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.currentVersionLabel', + { + defaultMessage: 'Current', + } +); + +export const TARGET_VERSION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.targetVersionLabel', + { + defaultMessage: 'Elastic update', + } +); + +export const FINAL_VERSION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versions.finalVersionLabel', + { + defaultMessage: 'Final', + } +); + +export const VERSION1_VS_VERSION2 = (version1: string, version2: string): string => { + return i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.version1VsVersion2', + { + defaultMessage: '{version1} vs {version2}', + values: { + version1, + version2, + }, + } + ); +}; + +export const VERSION_PICKER_ARIA_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.ariaLabel', + { + defaultMessage: 'Select versions to compare', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.stories.tsx rename to x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.stories.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx similarity index 85% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.tsx rename to x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx index 572e281ff3ae..4710667e0b31 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/comparison_side/versions_picker/versions_picker.tsx @@ -6,6 +6,7 @@ */ import React, { useCallback, useMemo } from 'react'; +import { css } from '@emotion/css'; import { EuiSelect } from '@elastic/eui'; import type { EuiSelectOption } from '@elastic/eui'; import { BASE_OPTIONS, CURRENT_OPTIONS, TARGET_OPTIONS, SelectedVersions } from './constants'; @@ -36,6 +37,7 @@ export function VersionsPicker({ return ( <EuiSelect + className={VERSIONS_PICKER_STYLES} options={options} value={selectedVersions} onChange={handleChange} @@ -43,3 +45,9 @@ export function VersionsPicker({ /> ); } + +const VERSIONS_PICKER_STYLES = css` + // Set min-width a bit wider than default + // to make English text in narrow screens readable + min-width: 220px; +`; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver.tsx deleted file mode 100644 index 6a2ad17f45f2..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver.tsx +++ /dev/null @@ -1,76 +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 { EuiFlexGroup, EuiFlexItem, EuiSpacer, useEuiTheme } from '@elastic/eui'; -import { css } from '@emotion/css'; -import { SplitAccordion } from '../../../../../../common/components/split_accordion'; -import type { - DiffableAllFields, - RuleFieldsDiff, - ThreeWayDiff, -} from '../../../../../../../common/api/detection_engine'; -import { ThreeWayDiffConflict } from '../../../../../../../common/api/detection_engine'; -import type { FieldUpgradeState } from '../../../../model/prebuilt_rule_upgrade'; -import { ComparisonSide } from '../comparison_side/comparison_side'; -import { FinalSide } from '../final_side/final_side'; -import { FieldUpgradeConflictsResolverHeader } from './field_upgrade_conflicts_resolver_header'; -import { useDiffableRuleContext } from '../diffable_rule_context'; -import type { UpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; - -interface FieldUpgradeConflictsResolverProps<FieldName extends UpgradeableDiffableFields> { - fieldName: FieldName; - fieldUpgradeState: FieldUpgradeState; - fieldThreeWayDiff: RuleFieldsDiff[FieldName]; -} - -export function FieldUpgradeConflictsResolver<FieldName extends UpgradeableDiffableFields>({ - fieldName, - fieldUpgradeState, - fieldThreeWayDiff, -}: FieldUpgradeConflictsResolverProps<FieldName>): JSX.Element { - const { euiTheme } = useEuiTheme(); - const hasConflict = fieldThreeWayDiff.conflict !== ThreeWayDiffConflict.NONE; - - const { finalDiffableRule } = useDiffableRuleContext(); - - return ( - <> - <SplitAccordion - header={ - <FieldUpgradeConflictsResolverHeader - fieldName={fieldName} - fieldUpgradeState={fieldUpgradeState} - /> - } - initialIsOpen={hasConflict} - data-test-subj="ruleUpgradePerFieldDiff" - > - <EuiFlexGroup gutterSize="s" alignItems="flexStart"> - <EuiFlexItem grow={1}> - <ComparisonSide - fieldName={fieldName} - fieldThreeWayDiff={fieldThreeWayDiff as ThreeWayDiff<DiffableAllFields[FieldName]>} - resolvedValue={finalDiffableRule[fieldName] as DiffableAllFields[FieldName]} - /> - </EuiFlexItem> - <EuiFlexItem - grow={0} - css={css` - align-self: stretch; - border-right: ${euiTheme.border.thin}; - `} - /> - <EuiFlexItem grow={1}> - <FinalSide fieldName={fieldName} /> - </EuiFlexItem> - </EuiFlexGroup> - </SplitAccordion> - <EuiSpacer size="s" /> - </> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver_header.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver_header.tsx deleted file mode 100644 index a096f025873a..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_conflicts_resolver_header.tsx +++ /dev/null @@ -1,33 +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 { camelCase, startCase } from 'lodash'; -import { EuiFlexGroup, EuiTitle } from '@elastic/eui'; -import { fieldToDisplayNameMap } from '../../diff_components/translations'; -import type { FieldUpgradeState } from '../../../../model/prebuilt_rule_upgrade'; -import { FieldUpgradeStateInfo } from './field_upgrade_state_info'; - -interface FieldUpgradeConflictsResolverHeaderProps { - fieldName: string; - fieldUpgradeState: FieldUpgradeState; -} - -export function FieldUpgradeConflictsResolverHeader({ - fieldName, - fieldUpgradeState, -}: FieldUpgradeConflictsResolverHeaderProps): JSX.Element { - return ( - <EuiFlexGroup direction="row" alignItems="center"> - <EuiTitle data-test-subj="ruleUpgradeFieldDiffLabel" size="xs"> - <h5>{fieldToDisplayNameMap[fieldName] ?? startCase(camelCase(fieldName))}</h5> - </EuiTitle> - - <FieldUpgradeStateInfo state={fieldUpgradeState} /> - </EuiFlexGroup> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/field_upgrade_state_info.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/field_upgrade_state_info.tsx deleted file mode 100644 index c49fc18e2c6b..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/field_upgrade_state_info.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import { EuiIcon, EuiText } from '@elastic/eui'; -import { FieldUpgradeState } from '../../../../../model/prebuilt_rule_upgrade'; -import * as i18n from './translations'; - -interface FieldUpgradeStateInfoProps { - state: FieldUpgradeState; -} - -export function FieldUpgradeStateInfo({ state }: FieldUpgradeStateInfoProps): JSX.Element { - switch (state) { - case FieldUpgradeState.Accepted: - return ( - <> - <EuiText color="success" size="xs"> - <EuiIcon type="checkInCircleFilled" /> -  <strong>{i18n.UPDATE_ACCEPTED}</strong> - {i18n.SEPARATOR} - {i18n.UPDATE_ACCEPTED_DESCRIPTION} - </EuiText> - </> - ); - - case FieldUpgradeState.SolvableConflict: - return ( - <> - <EuiText color="warning" size="xs"> - <EuiIcon type="warning" /> -  <strong>{i18n.SOLVABLE_CONFLICT}</strong> - {i18n.SEPARATOR} - {i18n.SOLVABLE_CONFLICT_DESCRIPTION} - </EuiText> - </> - ); - - case FieldUpgradeState.NonSolvableConflict: - return ( - <> - <EuiText color="danger" size="xs"> - <EuiIcon type="warning" /> -  <strong>{i18n.NON_SOLVABLE_CONFLICT}</strong> - {i18n.SEPARATOR} - {i18n.NON_SOLVABLE_CONFLICT_DESCRIPTION} - </EuiText> - </> - ); - } -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/translations.tsx deleted file mode 100644 index 36349b5029a8..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/translations.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 { i18n } from '@kbn/i18n'; - -export const UPDATE_ACCEPTED = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAccepted', - { - defaultMessage: 'Update accepted', - } -); - -export const UPDATE_ACCEPTED_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.updateAcceptedDescription', - { - defaultMessage: - 'You can still make changes, please review/accept all other conflicts before updating the rule.', - } -); - -export const SOLVABLE_CONFLICT = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflict', - { - defaultMessage: 'Solved conflict', - } -); - -export const SOLVABLE_CONFLICT_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflictDescription', - { - defaultMessage: - 'We have suggested an update for this modified field, please review before accepting.', - } -); - -export const NON_SOLVABLE_CONFLICT = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflict', - { - defaultMessage: 'Solved conflict', - } -); - -export const NON_SOLVABLE_CONFLICT_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflictDescription', - { - defaultMessage: - 'We have suggested an update for this modified field, please review before accepting.', - } -); - -export const SEPARATOR = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.separator', - { - defaultMessage: ' - ', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/index.ts deleted file mode 100644 index 75ff48ff541a..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export * from './rule_upgrade_callout'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/rule_upgrade_callout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/rule_upgrade_callout.tsx deleted file mode 100644 index 8ab267452495..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/rule_upgrade_callout.tsx +++ /dev/null @@ -1,76 +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 { EuiCallOut } from '@elastic/eui'; -import type { RuleUpgradeState } from '../../../../../model/prebuilt_rule_upgrade'; -import { FieldUpgradeState } from '../../../../../model/prebuilt_rule_upgrade'; -import * as i18n from './translations'; - -interface RuleUpgradeCalloutProps { - ruleUpgradeState: RuleUpgradeState; -} - -export function RuleUpgradeCallout({ ruleUpgradeState }: RuleUpgradeCalloutProps): JSX.Element { - const fieldsUpgradeState = ruleUpgradeState.fieldsUpgradeState; - const { numOfNonSolvableConflicts, numOfSolvableConflicts } = useMemo(() => { - let numOfFieldsWithNonSolvableConflicts = 0; - let numOfFieldsWithSolvableConflicts = 0; - - for (const fieldName of Object.keys(fieldsUpgradeState)) { - if (fieldsUpgradeState[fieldName] === FieldUpgradeState.NonSolvableConflict) { - numOfFieldsWithNonSolvableConflicts++; - } - - if (fieldsUpgradeState[fieldName] === FieldUpgradeState.SolvableConflict) { - numOfFieldsWithSolvableConflicts++; - } - } - - return { - numOfNonSolvableConflicts: numOfFieldsWithNonSolvableConflicts, - numOfSolvableConflicts: numOfFieldsWithSolvableConflicts, - }; - }, [fieldsUpgradeState]); - - if (numOfNonSolvableConflicts > 0) { - return ( - <EuiCallOut - title={i18n.RULE_HAS_NON_SOLVABLE_CONFLICTS(numOfNonSolvableConflicts)} - iconType="warning" - color="danger" - size="s" - > - <p>{i18n.RULE_HAS_NON_SOLVABLE_CONFLICTS_DESCRIPTION}</p> - </EuiCallOut> - ); - } - - if (numOfSolvableConflicts > 0) { - return ( - <EuiCallOut - title={i18n.RULE_HAS_SOLVABLE_CONFLICTS(numOfSolvableConflicts)} - iconType="warning" - color="warning" - size="s" - > - <p>{i18n.RULE_HAS_SOLVABLE_CONFLICTS_DESCRIPTION}</p> - </EuiCallOut> - ); - } - - return ( - <EuiCallOut - title={i18n.RULE_IS_READY_FOR_UPGRADE} - iconType="checkInCircleFilled" - color="success" - size="s" - > - <p>{i18n.RULE_IS_READY_FOR_UPGRADE_DESCRIPTION}</p> - </EuiCallOut> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/translations.tsx deleted file mode 100644 index 319884746dbc..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_callout/translations.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 { i18n } from '@kbn/i18n'; - -export const RULE_HAS_NON_SOLVABLE_CONFLICTS = (count: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflicts', - { - values: { count }, - defaultMessage: - '{count} of the fields {count, plural, one {has} other {have}} an unsolved conflict. Please review and modify accordingly.', - } - ); - -export const RULE_HAS_NON_SOLVABLE_CONFLICTS_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasNonSolvableConflictsDescription', - { - defaultMessage: - 'Please provide an input for the unsolved conflict. You can also keep the current without the updates, or accept the Elastic update but lose your modifications.', - } -); - -export const RULE_HAS_SOLVABLE_CONFLICTS = (count: number) => - i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflicts', - { - values: { count }, - defaultMessage: - '{count} of the fields {count, plural, one {has} other {have}} an update conflict, please review the suggested update being updating.', - } - ); - -export const RULE_HAS_SOLVABLE_CONFLICTS_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSolvableConflictsDescription', - { - defaultMessage: - 'Please review the suggested updated version before accepting the update. You can edit and then save the field if you wish to change it.', - } -); - -export const RULE_IS_READY_FOR_UPGRADE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgrade', - { - defaultMessage: 'The update is ready to be applied.', - } -); - -export const RULE_IS_READY_FOR_UPGRADE_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgradeDescription', - { - defaultMessage: 'All conflicts have now been reviewed and solved please update the rule.', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_conflicts_resolver.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_conflicts_resolver.tsx deleted file mode 100644 index 3379cf2ab3e9..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_conflicts_resolver.tsx +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import type { RuleUpgradeState } from '../../../../model/prebuilt_rule_upgrade'; -import { FieldUpgradeConflictsResolver } from './field_upgrade_conflicts_resolver'; -import type { NonUpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; -import { isNonUpgradeableFieldName } from '../../../../model/prebuilt_rule_upgrade/fields'; - -type FieldDiffEntries<FieldsDiff, ExcludedFields extends keyof FieldsDiff = never> = Array< - [ - Exclude<keyof FieldsDiff, ExcludedFields>, - Required<FieldsDiff>[Exclude<keyof FieldsDiff, ExcludedFields>] - ] ->; - -interface RuleUpgradeConflictsResolverProps { - ruleUpgradeState: RuleUpgradeState; -} - -export function RuleUpgradeConflictsResolver({ - ruleUpgradeState, -}: RuleUpgradeConflictsResolverProps): React.ReactNode { - const fieldDiffEntries = Object.entries(ruleUpgradeState.diff.fields) as FieldDiffEntries< - typeof ruleUpgradeState.diff.fields - >; - - const fields = fieldDiffEntries.filter(([fieldName]) => { - return isNonUpgradeableFieldName(fieldName) === false; - }) as FieldDiffEntries<typeof ruleUpgradeState.diff.fields, NonUpgradeableDiffableFields>; - - return fields.map(([fieldName, fieldDiff]) => ( - <FieldUpgradeConflictsResolver - key={fieldName} - fieldName={fieldName} - fieldUpgradeState={ruleUpgradeState.fieldsUpgradeState[fieldName]} - fieldThreeWayDiff={fieldDiff} - /> - )); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_info_bar.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_info_bar.tsx deleted file mode 100644 index 970f04f38327..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/rule_upgrade_info_bar.tsx +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React from 'react'; -import type { RuleUpgradeState } from '../../../../model/prebuilt_rule_upgrade'; -import { - UtilityBar, - UtilityBarGroup, - UtilityBarSection, - UtilityBarText, -} from '../../../../../../common/components/utility_bar'; -import * as i18n from './translations'; - -interface UpgradeInfoBarProps { - ruleUpgradeState: RuleUpgradeState; -} - -export function RuleUpgradeInfoBar({ ruleUpgradeState }: UpgradeInfoBarProps): JSX.Element { - const numOfFieldsWithUpdates = ruleUpgradeState.diff.num_fields_with_updates; - const numOfConflicts = ruleUpgradeState.diff.num_fields_with_conflicts; - - return ( - <UtilityBar> - <UtilityBarSection> - <UtilityBarGroup> - <UtilityBarText dataTestSubj="showingRules"> - {i18n.NUM_OF_FIELDS_WITH_UPDATES(numOfFieldsWithUpdates)} - </UtilityBarText> - </UtilityBarGroup> - <UtilityBarGroup> - <UtilityBarText dataTestSubj="showingRules"> - {i18n.NUM_OF_CONFLICTS(numOfConflicts)} - </UtilityBarText> - </UtilityBarGroup> - </UtilityBarSection> - <UtilityBarSection> - <UtilityBarGroup> - <i18n.RuleUpgradeHelper /> - </UtilityBarGroup> - </UtilityBarSection> - </UtilityBar> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/side_header.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/side_header.tsx deleted file mode 100644 index 574e3f526f85..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/side_header.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import type { PropsWithChildren } from 'react'; -import React from 'react'; -import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, useEuiTheme } from '@elastic/eui'; -import { css } from '@emotion/css'; - -export function SideHeader({ children }: PropsWithChildren<{}>) { - const { euiTheme } = useEuiTheme(); - - return ( - <> - <EuiFlexGroup - alignItems="center" - css={css` - height: ${euiTheme.size.xxl}; - `} - > - <EuiFlexItem>{children}</EuiFlexItem> - </EuiFlexGroup> - <EuiHorizontalRule margin="s" /> - </> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/translations.tsx deleted file mode 100644 index 27172cb98755..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/translations.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 React from 'react'; -import { EuiLink } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { useKibana } from '../../../../../../common/lib/kibana/kibana_react'; - -export const NUM_OF_FIELDS_WITH_UPDATES = (count: number) => ( - <FormattedMessage - id="xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.fieldsWithUpdates" - defaultMessage="Upgrade has {count} {count, plural, one {field} other {fields}}" - values={{ count: <strong>{count}</strong> }} - /> -); - -export const NUM_OF_CONFLICTS = (count: number) => ( - <FormattedMessage - id="xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfConflicts" - defaultMessage="{count} {count, plural, one {conflict} other {conflicts}}" - values={{ count: <strong>{count}</strong> }} - /> -); - -const UPGRADE_RULES_DOCS_LINK = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.updateYourRulesDocsLink', - { - defaultMessage: 'update your rules', - } -); - -export function RuleUpgradeHelper(): JSX.Element { - const { - docLinks: { - links: { - securitySolution: { manageDetectionRules }, - }, - }, - } = useKibana().services; - const manageDetectionRulesSnoozeSection = `${manageDetectionRules}#edit-rules-settings`; - - return ( - <FormattedMessage - id="xpack.securitySolution.detectionEngine.rules.upgradeRules.ruleUpgradeHelper" - defaultMessage="Understand how to {docsLink}." - values={{ - docsLink: ( - <EuiLink href={manageDetectionRulesSnoozeSection} target="_blank"> - {UPGRADE_RULES_DOCS_LINK} - </EuiLink> - ), - }} - /> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/diffable_rule_context.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/diffable_rule_context.tsx deleted file mode 100644 index 4210b394c761..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/diffable_rule_context.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 React, { createContext, useContext } from 'react'; -import type { DiffableRule } from '../../../../../../common/api/detection_engine'; -import { invariant } from '../../../../../../common/utils/invariant'; -import type { SetRuleFieldResolvedValueFn } from '../../../model/prebuilt_rule_upgrade/set_rule_field_resolved_value'; - -interface DiffableRuleContextType { - finalDiffableRule: DiffableRule; - setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; -} - -const DiffableRuleContext = createContext<DiffableRuleContextType | null>(null); - -interface DiffableRuleContextProviderProps { - finalDiffableRule: DiffableRule; - setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; - children: React.ReactNode; -} - -export function DiffableRuleContextProvider({ - finalDiffableRule, - setRuleFieldResolvedValue, - children, -}: DiffableRuleContextProviderProps) { - const contextValue = { - finalDiffableRule, - setRuleFieldResolvedValue, - }; - - return ( - <DiffableRuleContext.Provider value={contextValue}>{children}</DiffableRuleContext.Provider> - ); -} - -export function useDiffableRuleContext() { - const context = useContext(DiffableRuleContext); - - invariant( - context !== null, - 'useDiffableRuleContext must be used inside a DiffableRuleContextProvider' - ); - - return context; -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.tsx new file mode 100644 index 000000000000..8a6c312d74db --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side.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 React from 'react'; +import { FieldEditFormContextProvider } from '../context/field_edit_form_context'; +import { FieldFinalSideContent } from './field_final_side_content'; +import { FieldFinalSideHeader } from './field_final_side_header'; + +export function FieldFinalSide(): JSX.Element { + return ( + <FieldEditFormContextProvider> + <FieldFinalSideHeader /> + <FieldFinalSideContent /> + </FieldEditFormContextProvider> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.tsx new file mode 100644 index 000000000000..66fcee8547d7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_content.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 React from 'react'; +import { EuiButtonEmpty, EuiFlexGroup } from '@elastic/eui'; +import { FieldFinalReadOnly } from '../../final_readonly'; +import { FieldFinalEdit } from '../../final_edit'; +import { assertUnreachable } from '../../../../../../../../common/utility_types'; +import { + FieldFinalSideMode, + useFieldUpgradeContext, +} from '../../rule_upgrade/field_upgrade_context'; +import * as i18n from './translations'; + +export function FieldFinalSideContent(): JSX.Element { + const { rightSideMode, setEditMode, setReadOnlyMode } = useFieldUpgradeContext(); + + switch (rightSideMode) { + case FieldFinalSideMode.Readonly: + return ( + <> + <EuiFlexGroup justifyContent="flexEnd"> + <EuiButtonEmpty iconType="pencil" onClick={setEditMode}> + {i18n.EDIT} + </EuiButtonEmpty> + </EuiFlexGroup> + <FieldFinalReadOnly /> + </> + ); + case FieldFinalSideMode.Edit: + return ( + <> + <EuiFlexGroup justifyContent="flexEnd"> + <EuiButtonEmpty iconType="cross" onClick={setReadOnlyMode}> + {i18n.CANCEL} + </EuiButtonEmpty> + </EuiFlexGroup> + <FieldFinalEdit /> + </> + ); + default: + return assertUnreachable(rightSideMode); + } +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.tsx new file mode 100644 index 000000000000..0e70689b7c9d --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_header.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 { PropsWithChildren } from 'react'; +import React, { useCallback } from 'react'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui'; +import type { DiffableAllFields } from '../../../../../../../../common/api/detection_engine'; +import { FieldUpgradeSideHeader } from '../../field_upgrade_side_header'; +import { assertUnreachable } from '../../../../../../../../common/utility_types'; +import { + FieldFinalSideMode, + useFieldUpgradeContext, +} from '../../rule_upgrade/field_upgrade_context'; +import { useFieldEditFormContext } from '../context/field_edit_form_context'; +import { FieldFinalSideHelpInfo } from './field_final_side_help_info'; +import * as i18n from './translations'; + +export function FieldFinalSideHeader(): JSX.Element { + const { fieldName, hasConflict, rightSideMode, finalDiffableRule, setRuleFieldResolvedValue } = + useFieldUpgradeContext(); + const { form } = useFieldEditFormContext(); + + const handleAccept = useCallback( + () => + setRuleFieldResolvedValue({ + ruleId: finalDiffableRule.rule_id, + fieldName: fieldName as keyof DiffableAllFields, + resolvedValue: finalDiffableRule[fieldName] as DiffableAllFields[typeof fieldName], + }), + [finalDiffableRule, fieldName, setRuleFieldResolvedValue] + ); + const handleSave = useCallback(() => form?.submit(), [form]); + + switch (rightSideMode) { + case FieldFinalSideMode.Readonly: + return ( + <FieldUpgradeSideHeader> + <StaticHeaderContent> + {hasConflict && ( + <EuiButton iconType="checkInCircleFilled" size="s" onClick={handleAccept}> + {i18n.ACCEPT} + </EuiButton> + )} + </StaticHeaderContent> + </FieldUpgradeSideHeader> + ); + case FieldFinalSideMode.Edit: + return ( + <FieldUpgradeSideHeader> + <StaticHeaderContent> + <EuiButton + iconType="checkInCircleFilled" + size="s" + disabled={!form?.isValid} + onClick={handleSave} + > + {hasConflict ? i18n.SAVE_AND_ACCEPT : i18n.SAVE} + </EuiButton> + </StaticHeaderContent> + </FieldUpgradeSideHeader> + ); + default: + return assertUnreachable(rightSideMode); + } +} + +function StaticHeaderContent({ children }: PropsWithChildren<{}>): JSX.Element { + return ( + <EuiFlexGroup alignItems="stretch" justifyContent="center"> + <EuiFlexItem> + <EuiFlexGroup alignItems="center"> + <EuiTitle size="xxs"> + <h3> + {i18n.FINAL_UPDATE} + <FieldFinalSideHelpInfo /> + </h3> + </EuiTitle> + </EuiFlexGroup> + </EuiFlexItem> + <EuiFlexItem grow={false}>{children}</EuiFlexItem> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.tsx new file mode 100644 index 000000000000..e3e0b38da7d6 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/field_final_side_help_info.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import useToggle from 'react-use/lib/useToggle'; +import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; + +/** + * Theme doesn't expose width variables. Using provided size variables will require + * multiplying it by another magic constant. + * + * 320px width looks + * like a [commonly used width in EUI](https://github.com/search?q=repo%3Aelastic%2Feui%20320&type=code). + */ +const POPOVER_WIDTH = 320; + +export function FieldFinalSideHelpInfo(): JSX.Element { + const [isPopoverOpen, togglePopover] = useToggle(false); + + const button = ( + <EuiButtonIcon + iconType="questionInCircle" + onClick={togglePopover} + aria-label="Open help popover" + /> + ); + + return ( + <EuiPopover button={button} isOpen={isPopoverOpen} closePopover={togglePopover}> + <EuiText style={{ width: POPOVER_WIDTH }} size="s"> + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.finalSide.upgradeHelpText" + defaultMessage="Choose field values used in the upgraded rule. " + /> + </EuiText> + </EuiPopover> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_field_edit_component_props.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_field_edit_component_props.ts rename to x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_component_props.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_field_edit_form_wrapper.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx similarity index 81% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_field_edit_form_wrapper.tsx rename to x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx index a5f7eedc6114..ab12f62cfa27 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/rule_field_edit_form_wrapper.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/rule_field_edit_form_wrapper.tsx @@ -6,7 +6,6 @@ */ import React, { useCallback, useEffect } from 'react'; -import { EuiButtonEmpty, EuiFlexGroup } from '@elastic/eui'; import { extractValidationMessages } from '../../../../../../rule_creation/logic/extract_validation_messages'; import type { FormWithWarningsSubmitHandler } from '../../../../../../../common/hooks/use_form_with_warnings'; import { useFormWithWarnings } from '../../../../../../../common/hooks/use_form_with_warnings'; @@ -16,9 +15,8 @@ import type { DiffableAllFields, DiffableRule, } from '../../../../../../../../common/api/detection_engine'; -import { useFinalSideContext } from '../../final_side/final_side_context'; -import { useDiffableRuleContext } from '../../diffable_rule_context'; -import * as i18n from '../../translations'; +import { useFieldUpgradeContext } from '../../rule_upgrade/field_upgrade_context'; +import { useFieldEditFormContext } from '../context/field_edit_form_context'; import type { RuleFieldEditComponentProps } from './rule_field_edit_component_props'; import { useConfirmValidationErrorsModal } from '../../../../../../../common/hooks/use_confirm_validation_errors_modal'; import { @@ -55,8 +53,9 @@ export function RuleFieldEditFormWrapper({ deserializer, serializer, }: RuleFieldEditFormWrapperProps) { - const { fieldName, setReadOnlyMode } = useFinalSideContext(); - const { finalDiffableRule, setRuleFieldResolvedValue } = useDiffableRuleContext(); + const { registerForm } = useFieldEditFormContext(); + const { fieldName, finalDiffableRule, setReadOnlyMode, setRuleFieldResolvedValue } = + useFieldUpgradeContext(); const deserialize = useCallback( (defaultValue: FormData): FormData => @@ -104,6 +103,8 @@ export function RuleFieldEditFormWrapper({ }, }); + useEffect(() => registerForm(form), [registerForm, form]); + // form.isValid has `undefined` value until all fields are dirty. // Run the validation upfront to visualize form validity state. useEffect(() => { @@ -111,24 +112,14 @@ export function RuleFieldEditFormWrapper({ }, [form]); return ( - <> - <EuiFlexGroup justifyContent="flexEnd"> - <EuiButtonEmpty iconType="cross" onClick={setReadOnlyMode}> - {i18n.CANCEL_BUTTON_LABEL} - </EuiButtonEmpty> - <EuiButtonEmpty iconType="save" onClick={form.submit} disabled={!form.isValid}> - {i18n.SAVE_BUTTON_LABEL} - </EuiButtonEmpty> - </EuiFlexGroup> + <Form form={form}> {modal} - <Form form={form}> - <FieldComponent - finalDiffableRule={finalDiffableRule} - setFieldValue={form.setFieldValue} - resetForm={form.reset} - /> - </Form> - </> + <FieldComponent + finalDiffableRule={finalDiffableRule} + setFieldValue={form.setFieldValue} + resetForm={form.reset} + /> + </Form> ); } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.ts new file mode 100644 index 000000000000..4c44629bf426 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/components/translations.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const FINAL_UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.finalUpdate', + { + defaultMessage: 'Final update', + } +); + +export const SAVE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.field.save', + { + defaultMessage: 'Save', + } +); + +export const ACCEPT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.field.accept', + { + defaultMessage: 'Accept', + } +); + +export const SAVE_AND_ACCEPT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.field.saveAndAccept', + { + defaultMessage: 'Save and accept', + } +); + +export const CANCEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.cancelButtonLabel', + { + defaultMessage: 'Cancel', + } +); + +export const EDIT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.editButtonLabel', + { + defaultMessage: 'Edit', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.tsx new file mode 100644 index 000000000000..ba722107e8b9 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/context/field_edit_form_context.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 React, { + createContext, + useContext, + type PropsWithChildren, + useState, + useCallback, + useRef, +} from 'react'; +import type { FormHook } from '../../../../../../../shared_imports'; +import { invariant } from '../../../../../../../../common/utils/invariant'; + +type FieldEditFormCleanUp = () => void; + +interface FieldEditFormContextType { + form: FormHook | undefined; + registerForm: (form: FormHook) => FieldEditFormCleanUp; +} + +const FieldEditFormContext = createContext<FieldEditFormContextType | null>(null); + +/** + * FieldEditFormContext helps to encapsulate form related logic in `field_final_side` folder. + * + * The only purpose is to obtain the recent form handler and provide it for consumers in + * in the `field_final_side` folder. + */ +export function FieldEditFormContextProvider({ children }: PropsWithChildren<{}>) { + // Using reference reduces unnecessary re-renders though we need to re-render children + // whenever something in the form changes like validity state to be able to reflect that changes. + const formRef = useRef<FormHook | undefined>(); + // Setting the state re-renders the component and its children. The state value is ignored since + // we use a ref here. In that case it doesn't re-render components upon form cleanup. In that case + // the edit component disappears and we aren't interested in the form's state anymore. + const [, setForm] = useState<FormHook | undefined>(); + const registerForm = useCallback( + (formToRegister: FormHook) => { + // Guard against subtle bugs. In attempt of using two forms throw an exception. + if (formRef.current) { + throw new Error( + 'Unexpected new form registration while the old one was not cleaned. Do you properly cleanup form by returning registerForm result from useEffect.' + ); + } + + formRef.current = formToRegister; + setForm(formToRegister); + + return () => (formRef.current = undefined); + }, + [formRef, setForm] + ); + + return ( + <FieldEditFormContext.Provider value={{ form: formRef.current, registerForm }}> + {children} + </FieldEditFormContext.Provider> + ); +} + +export function useFieldEditFormContext() { + const context = useContext(FieldEditFormContext); + + invariant( + context !== null, + 'useFieldEditFormContext must be used inside a FieldEditFormProvider' + ); + + return context; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/index.ts new file mode 100644 index 000000000000..bcab35a1c27b --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_final_side/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './components/field_final_side'; +export type * from './components/rule_field_edit_component_props'; +export * from './components/rule_field_edit_form_wrapper'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.tsx new file mode 100644 index 000000000000..3e0e60d3c4ed --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/field_upgrade_side_header.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 type { PropsWithChildren } from 'react'; +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/css'; + +export function FieldUpgradeSideHeader({ children }: PropsWithChildren<{}>) { + const { euiTheme } = useEuiTheme(); + + return ( + <> + <EuiFlexGroup + alignItems="center" + css={css` + height: ${euiTheme.size.xxl}; + `} + > + <EuiFlexItem>{children}</EuiFlexItem> + </EuiFlexGroup> + <EuiHorizontalRule margin="s" /> + </> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx index 3f10ce014d82..0b8668e90a90 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/common_rule_field_edit.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { RuleFieldEditFormWrapper } from './fields/rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../field_final_side'; import type { UpgradeableCommonFields } from '../../../../model/prebuilt_rule_upgrade/fields'; import { BuildingBlockEdit, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.tsx new file mode 100644 index 000000000000..542e9aabcddd --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/field_final_edit.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 React from 'react'; +import { assertUnreachable } from '../../../../../../../common/utility_types'; +import type { + UpgradeableCustomQueryFields, + UpgradeableSavedQueryFields, + UpgradeableThreatMatchFields, + UpgradeableThresholdFields, + UpgradeableNewTermsFields, + UpgradeableEqlFields, + UpgradeableEsqlFields, + UpgradeableMachineLearningFields, +} from '../../../../model/prebuilt_rule_upgrade/fields'; +import { isCommonFieldName } from '../../../../model/prebuilt_rule_upgrade/fields'; +import { useFieldUpgradeContext } from '../rule_upgrade/field_upgrade_context'; +import { CommonRuleFieldEdit } from './common_rule_field_edit'; +import { CustomQueryRuleFieldEdit } from './custom_query_rule_field_edit'; +import { SavedQueryRuleFieldEdit } from './saved_query_rule_field_edit'; +import { ThreatMatchRuleFieldEdit } from './threat_match_rule_field_edit'; +import { ThresholdRuleFieldEdit } from './threshold_rule_field_edit'; +import { NewTermsRuleFieldEdit } from './new_terms_rule_field_edit'; +import { EqlRuleFieldEdit } from './eql_rule_field_edit'; +import { EsqlRuleFieldEdit } from './esql_rule_field_edit'; +import { MachineLearningRuleFieldEdit } from './machine_learning_rule_field_edit'; + +export function FieldFinalEdit(): JSX.Element { + const { + fieldName, + finalDiffableRule: { type: ruleType }, + } = useFieldUpgradeContext(); + + if (isCommonFieldName(fieldName)) { + return <CommonRuleFieldEdit fieldName={fieldName} />; + } + + switch (ruleType) { + case 'query': + return <CustomQueryRuleFieldEdit fieldName={fieldName as UpgradeableCustomQueryFields} />; + case 'saved_query': + return <SavedQueryRuleFieldEdit fieldName={fieldName as UpgradeableSavedQueryFields} />; + case 'eql': + return <EqlRuleFieldEdit fieldName={fieldName as UpgradeableEqlFields} />; + case 'esql': + return <EsqlRuleFieldEdit fieldName={fieldName as UpgradeableEsqlFields} />; + case 'threat_match': + return <ThreatMatchRuleFieldEdit fieldName={fieldName as UpgradeableThreatMatchFields} />; + case 'threshold': + return <ThresholdRuleFieldEdit fieldName={fieldName as UpgradeableThresholdFields} />; + case 'machine_learning': + return ( + <MachineLearningRuleFieldEdit fieldName={fieldName as UpgradeableMachineLearningFields} /> + ); + case 'new_terms': + return <NewTermsRuleFieldEdit fieldName={fieldName as UpgradeableNewTermsFields} />; + default: + return assertUnreachable(ruleType); + } +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx index 6dfd38d5676d..3100e5c21f8b 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_adapter.tsx @@ -11,7 +11,7 @@ import { getTermsAggregationFields } from '../../../../../../../rule_creation_ui import { isEsqlRule, isMlRule } from '../../../../../../../../../common/detection_engine/utils'; import { useAllEsqlRuleFields } from '../../../../../../../rule_creation_ui/hooks'; import { useMLRuleConfig } from '../../../../../../../../common/components/ml/hooks/use_ml_rule_config'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; import { useDiffableRuleDataView } from '../hooks/use_diffable_rule_data_view'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx index f6ed2e5c657c..e01db6f42888 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/alert_suppression/suppression_edit_form.tsx @@ -17,7 +17,7 @@ import { AlertSuppressionDurationType } from '../../../../../../../../detections import { type FormData } from '../../../../../../../../shared_imports'; import { DEFAULT_SUPPRESSION_MISSING_FIELDS_STRATEGY } from '../../../../../../../../../common/detection_engine/constants'; import { type AlertSuppression } from '../../../../../../../../../common/api/detection_engine'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import { AlertSuppressionEditAdapter } from './suppression_edit_adapter'; import { alertSuppressionFormSchema, type AlertSuppressionFormData } from './form_schema'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx index 2f697288221c..7ff2b7fdbd6f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit.tsx @@ -11,7 +11,7 @@ import { css } from '@emotion/css'; import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { DataSourceType } from '../../../../../../../../../common/api/detection_engine/prebuilt_rules'; import { UseMultiFields } from '../../../../../../../../shared_imports'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; import { IndexPatternField } from './index_pattern_edit'; import { DataSourceInfoText } from './data_source_info_text'; import { DataViewField } from './data_view_field'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx index e30b713908a0..ec9e49bb7ab1 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_edit_form.tsx @@ -16,7 +16,7 @@ import { FIELD_TYPES, } from '../../../../../../../../shared_imports'; import { DataSourceType } from '../../../../../../../../../common/api/detection_engine/prebuilt_rules'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import { DataSourceEdit } from './data_source_edit'; import { INDEX_HELPER_TEXT } from '../../../../../../../rule_creation_ui/components/step_define_rule/translations'; import * as i18n from './translations'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx index 9e24fd6c56c7..3562e7de82d6 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/data_source/data_source_type_selector_field.tsx @@ -10,7 +10,7 @@ import type { EuiButtonGroupOptionProps } from '@elastic/eui'; import { EuiButtonGroup } from '@elastic/eui'; import { DataSourceType } from '../../../../../../../../../common/api/detection_engine/prebuilt_rules'; import type { FieldHook } from '../../../../../../../../shared_imports'; -import type { ResetFormFn } from '../rule_field_edit_component_props'; +import type { ResetFormFn } from '../../../field_final_side'; import * as i18n from './translations'; interface DataSourceTypeSelectorFieldProps { diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx index cea9b9308c0d..73e7c553c912 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_adapter.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { DataViewBase } from '@kbn/es-query'; import { EqlQueryEdit } from '../../../../../../../rule_creation/components/eql_query_edit'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; import { useDiffableRuleDataView } from '../hooks/use_diffable_rule_data_view'; export function EqlQueryEditAdapter({ diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx index 4dd953006d39..f357504af76f 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/eql_query/eql_query_edit_form.tsx @@ -10,7 +10,7 @@ import type { Filter } from '@kbn/es-query'; import type { EqlOptions } from '@kbn/timelines-plugin/common'; import type { FieldValueQueryBar } from '../../../../../../../rule_creation_ui/components/query_bar_field'; import type { FormData, FormSchema } from '../../../../../../../../shared_imports'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import { type DiffableRule, RuleEqlQuery, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx index faf43d5b88b2..a3b1faf667d9 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_adapter.tsx @@ -7,8 +7,8 @@ import React from 'react'; import type { DataViewBase } from '@kbn/es-query'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; import { EsqlQueryEdit } from '../../../../../../../rule_creation/components/esql_query_edit'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; import { useDiffableRuleDataView } from '../hooks/use_diffable_rule_data_view'; export function EsqlQueryEditAdapter({ diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx index a156ef747aed..dd482b6962d8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/esql_query/esql_query_edit_form.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { FormData, FormSchema } from '../../../../../../../../shared_imports'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import type { FieldValueQueryBar } from '../../../../../../../rule_creation_ui/components/query_bar_field'; import { type DiffableRule, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx index 27415855adfb..f377e17d8e23 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx @@ -18,7 +18,7 @@ import type { DiffableRule } from '../../../../../../../../../common/api/detecti import type { SetRuleQuery } from '../../../../../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; import { useRuleFromTimeline } from '../../../../../../../../detections/containers/detection_engine/rules/use_rule_from_timeline'; import { useGetSavedQuery } from '../../../../../../../../detections/pages/detection_engine/rules/use_get_saved_query'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; import { useDiffableRuleDataView } from '../hooks/use_diffable_rule_data_view'; export function KqlQueryEdit({ diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx index 98ffc4b6bfdf..a02fa9b9fd9d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit_form.tsx @@ -9,8 +9,8 @@ import React from 'react'; import type { Type } from '@kbn/securitysolution-io-ts-alerting-types'; import type { FormData, FormSchema } from '../../../../../../../../shared_imports'; import { schema } from '../../../../../../../rule_creation_ui/components/step_define_rule/schema'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; import type { FieldValueQueryBar } from '../../../../../../../rule_creation_ui/components/query_bar_field'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import { KqlQueryLanguage, KqlQueryType, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx index af9f9db00cff..0d4be2e421a5 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/threshold_alert_suppression/suppression_edit_form.tsx @@ -13,12 +13,12 @@ import { import { ALERT_SUPPRESSION_DURATION_FIELD_NAME } from '../../../../../../../rule_creation/components/alert_suppression_edit'; import { type FormData } from '../../../../../../../../shared_imports'; import type { ThresholdAlertSuppression } from '../../../../../../../../../common/api/detection_engine'; -import { RuleFieldEditFormWrapper } from '../rule_field_edit_form_wrapper'; +import { RuleFieldEditFormWrapper } from '../../../field_final_side'; import { thresholdAlertSuppressionFormSchema, type ThresholdAlertSuppressionFormData, } from './form_schema'; -import type { RuleFieldEditComponentProps } from '../rule_field_edit_component_props'; +import type { RuleFieldEditComponentProps } from '../../../field_final_side'; export function ThresholdAlertSuppressionEditForm(): JSX.Element { return ( diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/final_edit.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/final_edit.tsx deleted file mode 100644 index 13bc3daa5603..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/final_edit.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 React from 'react'; -import { assertUnreachable } from '../../../../../../../common/utility_types'; -import { useDiffableRuleContext } from '../diffable_rule_context'; -import { CommonRuleFieldEdit } from './common_rule_field_edit'; -import { CustomQueryRuleFieldEdit } from './custom_query_rule_field_edit'; -import { SavedQueryRuleFieldEdit } from './saved_query_rule_field_edit'; -import { ThreatMatchRuleFieldEdit } from './threat_match_rule_field_edit'; -import { ThresholdRuleFieldEdit } from './threshold_rule_field_edit'; -import { NewTermsRuleFieldEdit } from './new_terms_rule_field_edit'; -import type { - UpgradeableCustomQueryFields, - UpgradeableSavedQueryFields, - UpgradeableThreatMatchFields, - UpgradeableThresholdFields, - UpgradeableNewTermsFields, - UpgradeableEqlFields, - UpgradeableEsqlFields, - UpgradeableMachineLearningFields, -} from '../../../../model/prebuilt_rule_upgrade/fields'; -import { isCommonFieldName } from '../../../../model/prebuilt_rule_upgrade/fields'; -import { useFinalSideContext } from '../final_side/final_side_context'; -import { EqlRuleFieldEdit } from './eql_rule_field_edit'; -import { EsqlRuleFieldEdit } from './esql_rule_field_edit'; -import { MachineLearningRuleFieldEdit } from './machine_learning_rule_field_edit'; - -export function FinalEdit() { - const { finalDiffableRule } = useDiffableRuleContext(); - const { type } = finalDiffableRule; - - const { fieldName } = useFinalSideContext(); - - if (isCommonFieldName(fieldName)) { - return <CommonRuleFieldEdit fieldName={fieldName} />; - } - - switch (type) { - case 'query': - return <CustomQueryRuleFieldEdit fieldName={fieldName as UpgradeableCustomQueryFields} />; - case 'saved_query': - return <SavedQueryRuleFieldEdit fieldName={fieldName as UpgradeableSavedQueryFields} />; - case 'eql': - return <EqlRuleFieldEdit fieldName={fieldName as UpgradeableEqlFields} />; - case 'esql': - return <EsqlRuleFieldEdit fieldName={fieldName as UpgradeableEsqlFields} />; - case 'threat_match': - return <ThreatMatchRuleFieldEdit fieldName={fieldName as UpgradeableThreatMatchFields} />; - case 'threshold': - return <ThresholdRuleFieldEdit fieldName={fieldName as UpgradeableThresholdFields} />; - case 'machine_learning': - return ( - <MachineLearningRuleFieldEdit fieldName={fieldName as UpgradeableMachineLearningFields} /> - ); - case 'new_terms': - return <NewTermsRuleFieldEdit fieldName={fieldName as UpgradeableNewTermsFields} />; - default: - return assertUnreachable(type); - } -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/index.ts new file mode 100644 index 000000000000..cc252595beee --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/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 './field_final_edit'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.tsx new file mode 100644 index 000000000000..33abbb479294 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_final_readonly.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useMemo } from 'react'; +import { DiffableCommonFields } from '../../../../../../../common/api/detection_engine'; +import type { + DiffableCustomQueryFields, + DiffableSavedQueryFields, + DiffableEqlFields, + DiffableThreatMatchFields, + DiffableThresholdFields, + DiffableNewTermsFields, + DiffableEsqlFields, + DiffableMachineLearningFields, +} from '../../../../../../../common/api/detection_engine'; +import { assertUnreachable } from '../../../../../../../common/utility_types'; +import { useFieldUpgradeContext } from '../rule_upgrade/field_upgrade_context'; +import { CustomQueryRuleFieldReadOnly } from './custom_query_rule_field_readonly'; +import { SavedQueryRuleFieldReadOnly } from './saved_query_rule_field_readonly'; +import { EqlRuleFieldReadOnly } from './eql_rule_field_readonly'; +import { EsqlRuleFieldReadOnly } from './esql_rule_field_readonly'; +import { ThreatMatchRuleFieldReadOnly } from './threat_match_rule_field_readonly'; +import { ThresholdRuleFieldReadOnly } from './threshold_rule_field_readonly'; +import { MachineLearningRuleFieldReadOnly } from './machine_learning_rule_field_readonly'; +import { NewTermsRuleFieldReadOnly } from './new_terms_rule_field_readonly'; +import { CommonRuleFieldReadOnly } from './common_rule_field_readonly'; + +export function FieldFinalReadOnly(): JSX.Element { + const { fieldName, finalDiffableRule } = useFieldUpgradeContext(); + + const { data: commonField } = useMemo( + () => DiffableCommonFields.keyof().safeParse(fieldName), + [fieldName] + ); + + if (commonField) { + return ( + <CommonRuleFieldReadOnly fieldName={commonField} finalDiffableRule={finalDiffableRule} /> + ); + } + + switch (finalDiffableRule.type) { + case 'query': + return ( + <CustomQueryRuleFieldReadOnly + fieldName={fieldName as keyof DiffableCustomQueryFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'saved_query': + return ( + <SavedQueryRuleFieldReadOnly + fieldName={fieldName as keyof DiffableSavedQueryFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'eql': + return ( + <EqlRuleFieldReadOnly + fieldName={fieldName as keyof DiffableEqlFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'esql': + return ( + <EsqlRuleFieldReadOnly + fieldName={fieldName as keyof DiffableEsqlFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'threat_match': + return ( + <ThreatMatchRuleFieldReadOnly + fieldName={fieldName as keyof DiffableThreatMatchFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'threshold': + return ( + <ThresholdRuleFieldReadOnly + fieldName={fieldName as keyof DiffableThresholdFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'machine_learning': + return ( + <MachineLearningRuleFieldReadOnly + fieldName={fieldName as keyof DiffableMachineLearningFields} + finalDiffableRule={finalDiffableRule} + /> + ); + case 'new_terms': + return ( + <NewTermsRuleFieldReadOnly + fieldName={fieldName as keyof DiffableNewTermsFields} + finalDiffableRule={finalDiffableRule} + /> + ); + default: + return assertUnreachable(finalDiffableRule); + } +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_readonly.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_readonly.tsx deleted file mode 100644 index ecaec5af0f54..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/field_readonly.tsx +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import React, { useMemo } from 'react'; -import { DiffableCommonFields } from '../../../../../../../common/api/detection_engine'; -import type { - DiffableCustomQueryFields, - DiffableSavedQueryFields, - DiffableEqlFields, - DiffableThreatMatchFields, - DiffableThresholdFields, - DiffableNewTermsFields, - DiffableEsqlFields, - DiffableMachineLearningFields, -} from '../../../../../../../common/api/detection_engine'; -import { assertUnreachable } from '../../../../../../../common/utility_types'; -import { CustomQueryRuleFieldReadOnly } from './custom_query_rule_field_readonly'; -import { SavedQueryRuleFieldReadOnly } from './saved_query_rule_field_readonly'; -import { EqlRuleFieldReadOnly } from './eql_rule_field_readonly'; -import { EsqlRuleFieldReadOnly } from './esql_rule_field_readonly'; -import { ThreatMatchRuleFieldReadOnly } from './threat_match_rule_field_readonly'; -import { ThresholdRuleFieldReadOnly } from './threshold_rule_field_readonly'; -import { MachineLearningRuleFieldReadOnly } from './machine_learning_rule_field_readonly'; -import { NewTermsRuleFieldReadOnly } from './new_terms_rule_field_readonly'; -import { CommonRuleFieldReadOnly } from './common_rule_field_readonly'; -import { useDiffableRuleContext } from '../diffable_rule_context'; - -interface FieldReadOnlyProps { - fieldName: string; -} - -export function FieldReadOnly({ fieldName }: FieldReadOnlyProps) { - const { finalDiffableRule } = useDiffableRuleContext(); - - const { data: commonField } = useMemo( - () => DiffableCommonFields.keyof().safeParse(fieldName), - [fieldName] - ); - - if (commonField) { - return ( - <CommonRuleFieldReadOnly fieldName={commonField} finalDiffableRule={finalDiffableRule} /> - ); - } - - switch (finalDiffableRule.type) { - case 'query': - return ( - <CustomQueryRuleFieldReadOnly - fieldName={fieldName as keyof DiffableCustomQueryFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'saved_query': - return ( - <SavedQueryRuleFieldReadOnly - fieldName={fieldName as keyof DiffableSavedQueryFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'eql': - return ( - <EqlRuleFieldReadOnly - fieldName={fieldName as keyof DiffableEqlFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'esql': - return ( - <EsqlRuleFieldReadOnly - fieldName={fieldName as keyof DiffableEsqlFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'threat_match': - return ( - <ThreatMatchRuleFieldReadOnly - fieldName={fieldName as keyof DiffableThreatMatchFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'threshold': - return ( - <ThresholdRuleFieldReadOnly - fieldName={fieldName as keyof DiffableThresholdFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'machine_learning': - return ( - <MachineLearningRuleFieldReadOnly - fieldName={fieldName as keyof DiffableMachineLearningFields} - finalDiffableRule={finalDiffableRule} - /> - ); - case 'new_terms': - return ( - <NewTermsRuleFieldReadOnly - fieldName={fieldName as keyof DiffableNewTermsFields} - finalDiffableRule={finalDiffableRule} - /> - ); - default: - return assertUnreachable(finalDiffableRule); - } -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx index 9aeeee25983d..9cebd044dad6 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/alert_suppression/alert_suppression.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { AlertSuppressionReadOnly } from './alert_suppression'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="alert_suppression" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="alert_suppression" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx index 392187941046..0f7ce369a117 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/anomaly_threshold/anomaly_threshold.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { AnomalyThresholdReadOnly } from './anomaly_threshold'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockMachineLearningRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="anomaly_threshold" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="anomaly_threshold" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx index 6bace209f283..7112e63a313d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/building_block/building_block.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { BuildingBlockReadOnly } from './building_block'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="building_block" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="building_block" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx index d7bf26bc7d9b..93f71afefb90 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/data_source/data_source.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; import { @@ -18,7 +18,7 @@ import { } from '../../storybook/mocks'; export default { - component: FieldReadOnly, + component: FieldFinalReadOnly, title: 'Rule Management/Prebuilt Rules/Upgrade Flyout/ThreeWayDiff/FieldReadOnly/data_source', }; @@ -32,8 +32,9 @@ const Template: Story<TemplateProps> = (args) => { <ThreeWayDiffStorybookProviders kibanaServicesOverrides={args.kibanaServicesOverrides} finalDiffableRule={args.finalDiffableRule} + fieldName="data_source" > - <FieldReadOnly fieldName="data_source" /> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx index 079c327fb29e..de7df1f7fbfb 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/description/description.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { DescriptionReadOnly } from './description'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="description" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="description" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx index 8ee0ac151178..bad23cba21e2 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/eql_query/eql_query.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; import { EqlQueryReadOnly } from './eql_query'; @@ -34,8 +34,9 @@ const Template: Story<TemplateProps> = (args) => { <ThreeWayDiffStorybookProviders kibanaServicesOverrides={args.kibanaServicesOverrides} finalDiffableRule={args.finalDiffableRule} + fieldName="eql_query" > - <FieldReadOnly fieldName="eql_query" /> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx index 70f37106842e..81b692bfc4e9 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/esql_query/esql_query.stories.tsx @@ -7,13 +7,13 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockEsqlRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; export default { - component: FieldReadOnly, + component: FieldFinalReadOnly, title: 'Rule Management/Prebuilt Rules/Upgrade Flyout/ThreeWayDiff/FieldReadOnly/esql_query', }; @@ -23,8 +23,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="esql_query" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="esql_query" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx index a5884b340e32..a3f2defba2ec 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/false_positives/false_positives.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { FalsePositivesReadOnly } from './false_positives'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="false_positives" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="false_positives" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx index 12e0f086ecec..da87cf2c04eb 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/history_window_start/history_window_start.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { HistoryWindowStartReadOnly } from './history_window_start'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockNewTermsRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="history_window_start" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="history_window_start" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx index a32c79076a03..400e7fd5ccba 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/investigation_fields/investigation_fields.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { InvestigationFieldsReadOnly } from './investigation_fields'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="investigation_fields" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="investigation_fields" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx index 16731ec49816..500999fea6c4 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/kql_query/kql_query.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; import { @@ -22,7 +22,7 @@ import { } from '../../storybook/mocks'; export default { - component: FieldReadOnly, + component: FieldFinalReadOnly, title: 'Rule Management/Prebuilt Rules/Upgrade Flyout/ThreeWayDiff/FieldReadOnly/kql_query', }; @@ -36,8 +36,9 @@ const Template: Story<TemplateProps> = (args) => { <ThreeWayDiffStorybookProviders kibanaServicesOverrides={args.kibanaServicesOverrides} finalDiffableRule={args.finalDiffableRule} + fieldName="kql_query" > - <FieldReadOnly fieldName="kql_query" /> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx index ea23aa598410..35d90a26fdfd 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/machine_learning_job_id/machine_learning_job_id.stories.tsx @@ -10,7 +10,7 @@ import { useQueryClient } from '@tanstack/react-query'; import type { Story } from '@storybook/react'; import { MachineLearningJobIdReadOnly } from './machine_learning_job_id'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; import { GET_MODULES_QUERY_KEY } from '../../../../../../../../common/components/ml_popover/hooks/use_fetch_modules_query'; import { GET_RECOGNIZER_QUERY_KEY } from '../../../../../../../../common/components/ml_popover/hooks/use_fetch_recognizer_query'; @@ -64,9 +64,12 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="machine_learning_job_id" + > <MockMlData> - <FieldReadOnly fieldName="machine_learning_job_id" /> + <FieldFinalReadOnly /> </MockMlData> </ThreeWayDiffStorybookProviders> ); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx index 3c7945366a17..6959a5c39164 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/max_signals/max_signals.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { MaxSignalsReadOnly } from './max_signals'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="max_signals" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="max_signals" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx index d97f71b4df0a..137b34f851a2 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/name/name.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { NameReadOnly } from './name'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="name" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="name"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx index f3dc5a1e3da9..0f870562f2a8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/new_terms_fields/new_terms_fields.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { NewTermsFieldsReadOnly } from './new_terms_fields'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockNewTermsRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="new_terms_fields" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="new_terms_fields" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx index 4a62c5e58dc2..9492b797689c 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/note/note.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { NoteReadOnly } from './note'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="note" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="note"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx index ea8ee856099d..d4d0d3241a6b 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/references/references.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { ReferencesReadOnly } from './references'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="references" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="references" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx index b810eaa1fbb8..65f4f50dbfb8 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/related_integrations/related_integrations.stories.tsx @@ -10,7 +10,7 @@ import { useQueryClient } from '@tanstack/react-query'; import type { Story } from '@storybook/react'; import { RelatedIntegrationsReadOnly } from './related_integrations'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; @@ -45,9 +45,12 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="related_integrations" + > <MockRelatedIntegrationsData> - <FieldReadOnly fieldName="related_integrations" /> + <FieldFinalReadOnly /> </MockRelatedIntegrationsData> </ThreeWayDiffStorybookProviders> ); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx index ee926fc7ed56..b3839c953561 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/required_fields/required_fields.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { RequiredFieldsReadOnly } from './required_fields'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -23,8 +23,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="required_fields" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="required_fields" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx index cb640e31090c..c045000018d0 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score/risk_score.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { RiskScoreReadOnly } from './risk_score'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="risk_score" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="risk_score" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx index 90dbe7f981f6..4c7bd4cbba9e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/risk_score_mapping/risk_score_mapping.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { RiskScoreMappingReadOnly } from './risk_score_mapping'; import { mockCustomQueryRule } from '../../storybook/mocks'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="risk_score_mapping" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="risk_score_mapping" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx index d0d596f15af4..0552b9e4f6b4 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_name_override/rule_name_override.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { RuleNameOverrideReadOnly } from './rule_name_override'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="rule_name_override" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="rule_name_override" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx index 30f2170a30f3..cca1dcb9bc21 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/rule_schedule/rule_schedule.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { RuleScheduleReadOnly } from './rule_schedule'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="rule_schedule" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="rule_schedule" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx index 34410c7c6f63..14ba62913053 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/setup/setup.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { SetupReadOnly } from './setup'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="setup" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="setup"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx index b51547d1655e..3d6836295aa9 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity/severity.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { SeverityReadOnly } from './severity'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="severity" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="severity"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx index b4ecb70ce66c..4d3825cc7e4d 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/severity_mapping/severity_mapping.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { SeverityMappingReadOnly } from './severity_mapping'; import { mockCustomQueryRule } from '../../storybook/mocks'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="severity_mapping" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="severity_mapping" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx index c8129dd989d2..f93f5ffd2dad 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/tags/tags.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { TagsReadOnly } from './tags'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="tags" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="tags"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx index de8c15f29e0c..671dc68e1054 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat/threat.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreatReadOnly } from './threat'; import { mockCustomQueryRule } from '../../storybook/mocks'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="threat" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="threat"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx index aeb1b6491bba..6ab55ca01e33 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_index/threat_index.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreatIndexReadOnly } from './threat_index'; import { mockThreatMatchRule } from '../../storybook/mocks'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="threat_index" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="threat_index" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx index bb91b29fffe1..15c547001a27 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_indicator_path/threat_indicator_path.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreatIndicatorPathReadOnly } from './threat_indicator_path'; import { mockThreatMatchRule } from '../../storybook/mocks'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="threat_indicator_path" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="threat_indicator_path" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx index 35c4bba4544a..587be1b02cba 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_mapping/threat_mapping.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreatMappingReadOnly } from './threat_mapping'; import { mockThreatMatchRule } from '../../storybook/mocks'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="threat_mapping" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="threat_mapping" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx index 625226ab4f9f..46e98bbaa798 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threat_query/threat_query.stories.tsx @@ -7,7 +7,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { ThreatQueryReadOnly } from './threat_query'; import { @@ -34,8 +34,9 @@ const Template: Story<TemplateProps> = (args) => { <ThreeWayDiffStorybookProviders kibanaServicesOverrides={args.kibanaServicesOverrides} finalDiffableRule={args.finalDiffableRule} + fieldName="threat_query" > - <FieldReadOnly fieldName="threat_query" /> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx index 0541d5f9a9b4..5270a2af8a63 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/threshold/threshold.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { ThresholdReadOnly } from './threshold'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockThresholdRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="threshold" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="threshold" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx index e4c3a2043ff2..582affc9d192 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timeline_template/timeline_template.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { TimelineTemplateReadOnly } from './timeline_template'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="timeline_template" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="timeline_template" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx index 5828ba156d9d..3d4c5b00005a 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/timestamp_override/timestamp_override.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { TimestampOverrideReadOnly } from './timestamp_override'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -25,8 +25,11 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="timestamp_override" /> + <ThreeWayDiffStorybookProviders + finalDiffableRule={args.finalDiffableRule} + fieldName="timestamp_override" + > + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx index ba252a8a80b8..c57bdf36ce3a 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/fields/type/type.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import type { Story } from '@storybook/react'; import { TypeReadOnly } from './type'; -import { FieldReadOnly } from '../../field_readonly'; +import { FieldFinalReadOnly } from '../../field_final_readonly'; import type { DiffableRule } from '../../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from '../../storybook/mocks'; import { ThreeWayDiffStorybookProviders } from '../../storybook/three_way_diff_storybook_providers'; @@ -24,8 +24,8 @@ interface TemplateProps { const Template: Story<TemplateProps> = (args) => { return ( - <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule}> - <FieldReadOnly fieldName="type" /> + <ThreeWayDiffStorybookProviders finalDiffableRule={args.finalDiffableRule} fieldName="type"> + <FieldFinalReadOnly /> </ThreeWayDiffStorybookProviders> ); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/final_readonly.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/final_readonly.tsx deleted file mode 100644 index 21b8475fe300..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/final_readonly.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 { EuiButtonEmpty } from '@elastic/eui'; -import React from 'react'; -import { FieldReadOnly } from './field_readonly'; -import * as i18n from '../translations'; -import { useFinalSideContext } from '../final_side/final_side_context'; - -export function FinalReadOnly() { - const { setEditMode, fieldName } = useFinalSideContext(); - - return ( - <> - <EuiButtonEmpty iconType="pencil" onClick={setEditMode}> - {i18n.EDIT_BUTTON_LABEL} - </EuiButtonEmpty> - <FieldReadOnly fieldName={fieldName} /> - </> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/index.ts new file mode 100644 index 000000000000..4abd3b839ae2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/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 './field_final_readonly'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx index 722f5ac9f6ad..d961f3d23bef 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_readonly/storybook/three_way_diff_storybook_providers.tsx @@ -13,10 +13,14 @@ import { Provider as ReduxStoreProvider } from 'react-redux'; import type { CoreStart } from '@kbn/core/public'; import type { UpsellingService } from '@kbn/security-solution-upselling/service'; import { createKibanaReactContext } from '@kbn/kibana-react-plugin/public'; +import type { UpgradeableDiffableFields } from '../../../../../model/prebuilt_rule_upgrade/fields'; import { ReactQueryClientProvider } from '../../../../../../../common/containers/query_client/query_client_provider'; import { UpsellingProvider } from '../../../../../../../common/components/upselling_provider'; -import { DiffableRuleContextProvider } from '../../diffable_rule_context'; -import type { DiffableRule } from '../../../../../../../../common/api/detection_engine'; +import { FieldUpgradeContextProvider } from '../../rule_upgrade/field_upgrade_context'; +import type { + DiffableRule, + RuleResponse, +} from '../../../../../../../../common/api/detection_engine'; import { mockCustomQueryRule } from './mocks'; function createKibanaServicesMock(overrides?: Partial<CoreStart>) { @@ -78,29 +82,49 @@ interface StorybookProvidersProps { children: React.ReactNode; kibanaServicesOverrides?: Record<string, unknown>; finalDiffableRule?: DiffableRule; + fieldName: string; } export function ThreeWayDiffStorybookProviders({ children, kibanaServicesOverrides, finalDiffableRule = mockCustomQueryRule(), + fieldName, }: StorybookProvidersProps) { const kibanaServicesMock = createKibanaServicesMock(kibanaServicesOverrides); const KibanaReactContext = createKibanaReactContext(kibanaServicesMock); const store = createMockStore(); + const ruleUpgradeStateMock = { + id: 'test-id', + rule_id: 'test-id', + current_rule: {} as RuleResponse, + target_rule: {} as RuleResponse, + diff: { + fields: {}, + num_fields_with_updates: 0, + num_fields_with_conflicts: 0, + num_fields_with_non_solvable_conflicts: 0, + }, + revision: 1, + finalRule: finalDiffableRule, + hasUnresolvedConflicts: false, + fieldsUpgradeState: {}, + }; + return ( <KibanaReactContext.Provider> <ReactQueryClientProvider> <ReduxStoreProvider store={store}> <UpsellingProvider upsellingService={kibanaServicesMock.upsellingService}> - <DiffableRuleContextProvider - finalDiffableRule={finalDiffableRule} + <FieldUpgradeContextProvider + ruleUpgradeState={ruleUpgradeStateMock} + fieldName={fieldName as UpgradeableDiffableFields} setRuleFieldResolvedValue={setRuleFieldResolvedValueMock} > {children} - </DiffableRuleContextProvider> + </FieldUpgradeContextProvider> </UpsellingProvider> </ReduxStoreProvider> </ReactQueryClientProvider> diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/constants.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/constants.ts deleted file mode 100644 index 6316abcae48a..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/constants.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export enum FinalSideMode { - READONLY = 'readonly', - EDIT = 'edit', -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side.tsx deleted file mode 100644 index 30e3f4461195..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side.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 React from 'react'; -import { EuiTitle } from '@elastic/eui'; -import { SideHeader } from '../components/side_header'; -import { FinalSideHelpInfo } from './final_side_help_info'; -import * as i18n from './translations'; -import { FinalReadOnly } from '../final_readonly/final_readonly'; -import { FinalEdit } from '../final_edit/final_edit'; -import { FinalSideMode } from './constants'; -import type { UpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; -import { assertUnreachable } from '../../../../../../../common/utility_types'; -import { FinalSideContextProvider, useFinalSideContext } from './final_side_context'; - -interface FinalSideProps { - fieldName: UpgradeableDiffableFields; -} - -export function FinalSide({ fieldName }: FinalSideProps): JSX.Element { - return ( - <> - <SideHeader> - <EuiTitle size="xxs"> - <h3> - {i18n.FINAL_UPDATE} - <FinalSideHelpInfo /> - </h3> - </EuiTitle> - </SideHeader> - <FinalSideContextProvider fieldName={fieldName}> - <FinalSideContent /> - </FinalSideContextProvider> - </> - ); -} - -function FinalSideContent(): JSX.Element { - const { mode } = useFinalSideContext(); - - switch (mode) { - case FinalSideMode.READONLY: - return <FinalReadOnly />; - case FinalSideMode.EDIT: - return <FinalEdit />; - default: - return assertUnreachable(mode); - } -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_context.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_context.tsx deleted file mode 100644 index 6beb0535e5e2..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_context.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 React, { createContext, useContext, type PropsWithChildren, useCallback } from 'react'; -import { invariant } from '../../../../../../../common/utils/invariant'; -import { FinalSideMode } from './constants'; -import type { UpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; - -interface FinalSideContextType { - fieldName: UpgradeableDiffableFields; - mode: FinalSideMode; - setReadOnlyMode: () => void; - setEditMode: () => void; -} - -const FinalSideContext = createContext<FinalSideContextType | null>(null); - -interface FinalSideContextProviderProps { - fieldName: UpgradeableDiffableFields; -} - -export function FinalSideContextProvider({ - children, - fieldName, -}: PropsWithChildren<FinalSideContextProviderProps>) { - const [mode, setMode] = React.useState<FinalSideMode>(FinalSideMode.READONLY); - const setReadOnlyMode = useCallback(() => setMode(FinalSideMode.READONLY), []); - const setEditMode = useCallback(() => setMode(FinalSideMode.EDIT), []); - - const contextValue = { - fieldName, - setReadOnlyMode, - setEditMode, - mode, - }; - - return <FinalSideContext.Provider value={contextValue}>{children}</FinalSideContext.Provider>; -} - -export function useFinalSideContext() { - const context = useContext(FinalSideContext); - - invariant(context !== null, 'useFinalSideContext must be used inside a FinalSideContextProvider'); - - return context; -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_help_info.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_help_info.tsx deleted file mode 100644 index 51e0c5097b97..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/final_side_help_info.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 React from 'react'; -import useToggle from 'react-use/lib/useToggle'; -import { EuiPopover, EuiText, EuiButtonIcon } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n-react'; - -/** - * Theme doesn't expose width variables. Using provided size variables will require - * multiplying it by another magic constant. - * - * 320px width looks - * like a [commonly used width in EUI](https://github.com/search?q=repo%3Aelastic%2Feui%20320&type=code). - */ -const POPOVER_WIDTH = 320; - -export function FinalSideHelpInfo(): JSX.Element { - const [isPopoverOpen, togglePopover] = useToggle(false); - - const button = ( - <EuiButtonIcon - iconType="questionInCircle" - onClick={togglePopover} - aria-label="Open help popover" - /> - ); - - return ( - <EuiPopover button={button} isOpen={isPopoverOpen} closePopover={togglePopover}> - <EuiText style={{ width: POPOVER_WIDTH }} size="s"> - <FormattedMessage - id="xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeHelpText" - defaultMessage="Choose field values used in the upgraded rule. " - /> - </EuiText> - </EuiPopover> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/translations.ts deleted file mode 100644 index 8f6a10b5681b..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_side/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 FINAL_UPDATE = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.finalUpdate', - { - defaultMessage: 'Final update', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/index.ts new file mode 100644 index 000000000000..95e6836ca8f0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/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 { RuleUpgrade as RuleUpgradeTab } from './rule_upgrade'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx new file mode 100644 index 000000000000..d7e3e33fcb5f --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiSpacer, useEuiTheme } from '@elastic/eui'; +import { css } from '@emotion/css'; +import { SplitAccordion } from '../../../../../../common/components/split_accordion'; +import { FieldComparisonSide } from '../comparison_side/field_comparison_side'; +import { FieldFinalSide } from '../field_final_side'; +import { FieldUpgradeHeader } from './field_upgrade_header'; +import { useFieldUpgradeContext } from './field_upgrade_context'; + +export function FieldUpgrade(): JSX.Element { + const { euiTheme } = useEuiTheme(); + const { fieldName, fieldUpgradeState, hasConflict } = useFieldUpgradeContext(); + + return ( + <> + <SplitAccordion + header={<FieldUpgradeHeader fieldName={fieldName} fieldUpgradeState={fieldUpgradeState} />} + initialIsOpen={hasConflict} + data-test-subj="ruleUpgradePerFieldDiff" + > + <EuiFlexGroup gutterSize="s" alignItems="flexStart"> + <EuiFlexItem grow={1}> + <FieldComparisonSide /> + </EuiFlexItem> + <EuiFlexItem + grow={0} + css={css` + align-self: stretch; + border-right: ${euiTheme.border.thin}; + `} + /> + <EuiFlexItem grow={1}> + <FieldFinalSide /> + </EuiFlexItem> + </EuiFlexGroup> + </SplitAccordion> + <EuiSpacer size="s" /> + </> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx new file mode 100644 index 000000000000..f88c9fb3e076 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_context.tsx @@ -0,0 +1,167 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { createContext, useContext, useMemo } from 'react'; +import { useBoolean } from '@kbn/react-hooks'; +import type { + DiffableRule, + FieldsDiff, + ThreeWayDiff, +} from '../../../../../../../common/api/detection_engine'; +import { invariant } from '../../../../../../../common/utils/invariant'; +import { convertRuleToDiffable } from '../../../../../../../common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable'; +import type { SetRuleFieldResolvedValueFn } from '../../../../model/prebuilt_rule_upgrade/set_rule_field_resolved_value'; +import type { UpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; +import type { RuleUpgradeState } from '../../../../model/prebuilt_rule_upgrade'; +import { FieldUpgradeStateEnum } from '../../../../model/prebuilt_rule_upgrade'; + +export enum FieldFinalSideMode { + Readonly = 'readonly', + Edit = 'edit', +} + +interface FieldUpgradeContextType { + /** + * Field name of an upgradable field from DiffableRule + */ + fieldName: UpgradeableDiffableFields; + /** + * Field's upgrade state + */ + fieldUpgradeState: FieldUpgradeStateEnum; + /** + * Whether rule has an unresolved conflict. This state is derived from `fieldUpgradeState`. + */ + hasConflict: boolean; + /** + * Field's three way diff + */ + fieldDiff: ThreeWayDiff<unknown>; + /** + * Current final diffable rule including resolved values + */ + finalDiffableRule: DiffableRule; + /** + * Field final side view mode `Readonly` or `Editing` + */ + rightSideMode: FieldFinalSideMode; + /** + * Sets field's resolved value + */ + setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; + /** + * Sets field's right side `readonly` mode + */ + setReadOnlyMode: () => void; + /** + * Sets field's right side `edit` mode + */ + setEditMode: () => void; +} + +const FieldUpgradeContext = createContext<FieldUpgradeContextType | null>(null); + +interface FieldUpgradeContextProviderProps { + ruleUpgradeState: RuleUpgradeState; + fieldName: UpgradeableDiffableFields; + setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; + children: React.ReactNode; +} + +export function FieldUpgradeContextProvider({ + ruleUpgradeState, + fieldName, + setRuleFieldResolvedValue, + children, +}: FieldUpgradeContextProviderProps) { + const { state: fieldUpgradeState } = ruleUpgradeState.fieldsUpgradeState[fieldName]; + const fieldDiff = ruleUpgradeState.diff.fields[fieldName]; + const initialRightSideMode = + fieldUpgradeState === FieldUpgradeStateEnum.NonSolvableConflict + ? FieldFinalSideMode.Edit + : FieldFinalSideMode.Readonly; + + const [editing, { on: setEditMode, off: setReadOnlyMode }] = useBoolean( + initialRightSideMode === FieldFinalSideMode.Edit + ); + + invariant(fieldDiff, `Field diff is not found for ${fieldName}.`); + + const contextValue: FieldUpgradeContextType = useMemo( + () => ({ + fieldName, + fieldUpgradeState, + hasConflict: + fieldUpgradeState === FieldUpgradeStateEnum.SolvableConflict || + fieldUpgradeState === FieldUpgradeStateEnum.NonSolvableConflict, + fieldDiff, + finalDiffableRule: calcFinalDiffableRule(ruleUpgradeState), + rightSideMode: editing ? FieldFinalSideMode.Edit : FieldFinalSideMode.Readonly, + setRuleFieldResolvedValue, + setReadOnlyMode, + setEditMode, + }), + [ + fieldName, + fieldUpgradeState, + fieldDiff, + ruleUpgradeState, + editing, + setRuleFieldResolvedValue, + setReadOnlyMode, + setEditMode, + ] + ); + + return ( + <FieldUpgradeContext.Provider value={contextValue}>{children}</FieldUpgradeContext.Provider> + ); +} + +export function useFieldUpgradeContext() { + const context = useContext(FieldUpgradeContext); + + invariant( + context !== null, + 'useFieldUpgradeContext must be used inside a FieldUpgradeContextProvider' + ); + + return context; +} + +function calcFinalDiffableRule(ruleUpgradeState: RuleUpgradeState): DiffableRule { + const fieldsResolvedValues = Object.entries(ruleUpgradeState.fieldsUpgradeState).reduce< + Record<string, unknown> + >((result, [fieldName, fieldState]) => { + if (fieldState.state === FieldUpgradeStateEnum.Accepted) { + result[fieldName] = fieldState.resolvedValue; + } + + return result; + }, {}); + + return { + ...convertRuleToDiffable(ruleUpgradeState.target_rule), + ...convertRuleFieldsDiffToDiffable(ruleUpgradeState.diff.fields), + ...fieldsResolvedValues, + } as DiffableRule; +} + +/** + * Assembles a `DiffableRule` from rule fields diff `merged_version`s. + */ +function convertRuleFieldsDiffToDiffable( + ruleFieldsDiff: FieldsDiff<Record<string, unknown>> +): Partial<DiffableRule> { + const mergeVersionRule: Record<string, unknown> = {}; + + for (const fieldName of Object.keys(ruleFieldsDiff)) { + mergeVersionRule[fieldName] = ruleFieldsDiff[fieldName].merged_version; + } + + return mergeVersionRule; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.tsx new file mode 100644 index 000000000000..b401f702bd03 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_header.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 React from 'react'; +import { camelCase, startCase } from 'lodash'; +import { EuiFlexGroup, EuiTitle } from '@elastic/eui'; +import { fieldToDisplayNameMap } from '../../diff_components/translations'; +import type { FieldUpgradeStateEnum } from '../../../../model/prebuilt_rule_upgrade'; +import { FieldUpgradeStateInfo } from './field_upgrade_state_info'; + +interface FieldUpgradeHeaderProps { + fieldName: string; + fieldUpgradeState: FieldUpgradeStateEnum; +} + +export function FieldUpgradeHeader({ + fieldName, + fieldUpgradeState, +}: FieldUpgradeHeaderProps): JSX.Element { + return ( + <EuiFlexGroup alignItems="center"> + <EuiTitle data-test-subj="ruleUpgradeFieldDiffLabel" size="xs"> + <h5>{fieldToDisplayNameMap[fieldName] ?? startCase(camelCase(fieldName))}</h5> + </EuiTitle> + + <EuiFlexGroup alignItems="center" gutterSize="s"> + <FieldUpgradeStateInfo state={fieldUpgradeState} /> + </EuiFlexGroup> + </EuiFlexGroup> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.tsx new file mode 100644 index 000000000000..a85cf96cc50d --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/field_upgrade_state_info.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 React, { useMemo } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; +import { assertUnreachable } from '../../../../../../../../common/utility_types'; +import { FieldUpgradeStateEnum } from '../../../../../model/prebuilt_rule_upgrade'; +import { ReadyForUpgradeBadge } from '../../badges/ready_for_upgrade_badge'; +import { ReviewRequiredBadge } from '../../badges/review_required_badge'; +import { ActionRequiredBadge } from '../../badges/action_required'; +import * as i18n from './translations'; + +interface FieldUpgradeStateInfoProps { + state: FieldUpgradeStateEnum; +} + +export function FieldUpgradeStateInfo({ state }: FieldUpgradeStateInfoProps): JSX.Element { + const { color, badge, title, description } = useMemo(() => { + switch (state) { + case FieldUpgradeStateEnum.NoUpdate: + return { + color: 'success', + title: i18n.NO_UPDATE, + description: i18n.NO_UPDATE_DESCRIPTION, + }; + + case FieldUpgradeStateEnum.NoConflict: + return { + color: 'success', + badge: <ReadyForUpgradeBadge />, + title: i18n.NO_CONFLICT, + description: i18n.NO_CONFLICT_DESCRIPTION, + }; + + case FieldUpgradeStateEnum.Accepted: + return { + color: 'success', + badge: <ReadyForUpgradeBadge />, + title: i18n.REVIEWED_AND_ACCEPTED, + }; + + case FieldUpgradeStateEnum.SolvableConflict: + return { + color: 'warning', + badge: <ReviewRequiredBadge />, + title: i18n.SOLVABLE_CONFLICT, + description: i18n.SOLVABLE_CONFLICT_DESCRIPTION, + }; + + case FieldUpgradeStateEnum.NonSolvableConflict: + return { + color: 'danger', + badge: <ActionRequiredBadge />, + title: i18n.NON_SOLVABLE_CONFLICT, + description: i18n.NON_SOLVABLE_CONFLICT_DESCRIPTION, + }; + + default: + return assertUnreachable(state); + } + }, [state]); + + return ( + <EuiText color={color} size="xs"> + <EuiFlexGroup gutterSize="s" alignItems="center"> + <EuiFlexItem grow={false}>{badge}</EuiFlexItem> + <EuiFlexItem grow={false}> + <strong>{title}</strong> + </EuiFlexItem> + + {description && ( + <EuiFlexItem grow={false}> + {i18n.SEPARATOR} {description} + </EuiFlexItem> + )} + </EuiFlexGroup> + </EuiText> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/components/field_upgrade_state_info/index.ts rename to x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/index.ts diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx new file mode 100644 index 000000000000..c3115c6ce092 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/field_upgrade_state_info/translations.tsx @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const NO_UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.noUpdate', + { + defaultMessage: 'No update', + } +); + +export const NO_UPDATE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.noUpdateDescription', + { + defaultMessage: + 'The field was modified after rule installation but does not have Elastic update.', + } +); + +export const NO_CONFLICT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.noConflict', + { + defaultMessage: 'No conflicts', + } +); + +export const NO_CONFLICT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.noConflictDescription', + { + defaultMessage: 'The update has no conflicts and has been applied to the final update.', + } +); + +export const REVIEWED_AND_ACCEPTED = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.reviewedAndAccepted', + { + defaultMessage: 'Reviewed and accepted', + } +); + +export const SOLVABLE_CONFLICT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflict', + { + defaultMessage: 'Solved conflict', + } +); + +export const SOLVABLE_CONFLICT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.solvableConflictDescription', + { + defaultMessage: + 'We have suggested an update for this modified field, please review before accepting.', + } +); + +export const NON_SOLVABLE_CONFLICT = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflict', + { + defaultMessage: 'Unsolved conflict', + } +); + +export const NON_SOLVABLE_CONFLICT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.nonSolvableConflictDescription', + { + defaultMessage: + 'Unable to suggest a merged version for the update. Current version is provided for you to edit.', + } +); + +export const SEPARATOR = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.separator', + { + defaultMessage: ' - ', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/index.ts new file mode 100644 index 000000000000..af2bd34a7b6e --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/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 './rule_upgrade'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.tsx new file mode 100644 index 000000000000..73746f3c4821 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade.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 React, { memo } from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { + FieldUpgradeStateEnum, + type RuleUpgradeState, + type SetRuleFieldResolvedValueFn, +} from '../../../../model/prebuilt_rule_upgrade'; +import type { UpgradeableDiffableFields } from '../../../../model/prebuilt_rule_upgrade/fields'; +import { RuleUpgradeInfoBar } from './rule_upgrade_info_bar'; +import { RuleUpgradeCallout } from './rule_upgrade_callout'; +import { FieldUpgrade } from './field_upgrade'; +import { FieldUpgradeContextProvider } from './field_upgrade_context'; + +interface RuleUpgradeProps { + ruleUpgradeState: RuleUpgradeState; + setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; +} + +export const RuleUpgrade = memo(function RuleUpgrade({ + ruleUpgradeState, + setRuleFieldResolvedValue, +}: RuleUpgradeProps): JSX.Element { + const totalNumOfFields = calcTotalNumOfFields(ruleUpgradeState); + const numOfFieldsWithUpdates = calcNumOfFieldsWithUpdates(ruleUpgradeState); + const numOfSolvableConflicts = calcNumOfSolvableConflicts(ruleUpgradeState); + const numOfNonSolvableConflicts = calcNumOfNonSolvableConflicts(ruleUpgradeState); + const fieldNames = Object.keys( + ruleUpgradeState.fieldsUpgradeState + ) as UpgradeableDiffableFields[]; + + return ( + <> + <EuiSpacer size="s" /> + <RuleUpgradeInfoBar + totalNumOfFields={totalNumOfFields} + numOfFieldsWithUpdates={numOfFieldsWithUpdates} + numOfConflicts={numOfSolvableConflicts + numOfNonSolvableConflicts} + /> + <EuiSpacer size="s" /> + <RuleUpgradeCallout + numOfSolvableConflicts={numOfSolvableConflicts} + numOfNonSolvableConflicts={numOfNonSolvableConflicts} + /> + <EuiSpacer size="s" /> + {fieldNames.map((fieldName) => ( + <FieldUpgradeContextProvider + key={fieldName} + ruleUpgradeState={ruleUpgradeState} + fieldName={fieldName} + setRuleFieldResolvedValue={setRuleFieldResolvedValue} + > + <FieldUpgrade /> + </FieldUpgradeContextProvider> + ))} + </> + ); +}); + +function calcTotalNumOfFields(ruleUpgradeState: RuleUpgradeState): number { + return Object.keys(ruleUpgradeState.fieldsUpgradeState).length; +} + +function calcNumOfFieldsWithUpdates(ruleUpgradeState: RuleUpgradeState): number { + return Object.values(ruleUpgradeState.fieldsUpgradeState).filter( + ({ state }) => state !== FieldUpgradeStateEnum.NoUpdate + ).length; +} + +function calcNumOfSolvableConflicts(ruleUpgradeState: RuleUpgradeState): number { + return Object.values(ruleUpgradeState.fieldsUpgradeState).filter( + ({ state }) => state === FieldUpgradeStateEnum.SolvableConflict + ).length; +} + +function calcNumOfNonSolvableConflicts(ruleUpgradeState: RuleUpgradeState): number { + return Object.values(ruleUpgradeState.fieldsUpgradeState).filter( + ({ state }) => state === FieldUpgradeStateEnum.NonSolvableConflict + ).length; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.tsx new file mode 100644 index 000000000000..3b3c0c7e49e5 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_callout.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 { EuiCallOut } from '@elastic/eui'; +import { ActionRequiredBadge } from '../badges/action_required'; +import { ReviewRequiredBadge } from '../badges/review_required_badge'; +import { ReadyForUpgradeBadge } from '../badges/ready_for_upgrade_badge'; +import * as i18n from './translations'; + +interface RuleUpgradeCalloutProps { + numOfSolvableConflicts: number; + numOfNonSolvableConflicts: number; +} + +export function RuleUpgradeCallout({ + numOfSolvableConflicts, + numOfNonSolvableConflicts, +}: RuleUpgradeCalloutProps): JSX.Element { + if (numOfNonSolvableConflicts > 0) { + return ( + <EuiCallOut + title={ + <> + <strong>{i18n.UPGRADE_STATUS}</strong> +   + <ActionRequiredBadge /> +   + {i18n.RULE_HAS_CONFLICTS(numOfNonSolvableConflicts + numOfSolvableConflicts)} + </> + } + color="danger" + size="s" + > + <p>{i18n.RULE_HAS_HARD_CONFLICTS_DESCRIPTION}</p> + </EuiCallOut> + ); + } + + if (numOfSolvableConflicts > 0) { + return ( + <EuiCallOut + title={ + <> + <strong>{i18n.UPGRADE_STATUS}</strong> +   + <ReviewRequiredBadge /> +   + {i18n.RULE_HAS_CONFLICTS(numOfSolvableConflicts)} + </> + } + color="warning" + size="s" + > + <p>{i18n.RULE_HAS_SOFT_CONFLICTS_DESCRIPTION}</p> + </EuiCallOut> + ); + } + + return ( + <EuiCallOut + title={ + <> + <strong>{i18n.UPGRADE_STATUS}</strong> +   + <ReadyForUpgradeBadge /> + </> + } + color="success" + size="s" + > + <p>{i18n.RULE_IS_READY_FOR_UPGRADE_DESCRIPTION}</p> + </EuiCallOut> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.tsx new file mode 100644 index 000000000000..3520734b2b25 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/rule_upgrade_info_bar.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 React from 'react'; +import { + UtilityBar, + UtilityBarGroup, + UtilityBarSection, + UtilityBarText, +} from '../../../../../../common/components/utility_bar'; +import * as i18n from './translations'; + +interface RuleUpgradeInfoBarProps { + totalNumOfFields: number; + numOfFieldsWithUpdates: number; + numOfConflicts: number; +} + +export function RuleUpgradeInfoBar({ + totalNumOfFields, + numOfFieldsWithUpdates, + numOfConflicts, +}: RuleUpgradeInfoBarProps): JSX.Element { + return ( + <UtilityBar> + <UtilityBarSection> + <UtilityBarGroup> + <UtilityBarText dataTestSubj="showingRules"> + {i18n.TOTAL_NUM_OF_FIELDS(totalNumOfFields)} + </UtilityBarText> + </UtilityBarGroup> + <UtilityBarGroup> + <UtilityBarText dataTestSubj="showingRules"> + {i18n.NUM_OF_FIELDS_WITH_UPDATES(numOfFieldsWithUpdates)} + </UtilityBarText> + </UtilityBarGroup> + <UtilityBarGroup> + <UtilityBarText dataTestSubj="showingRules"> + {i18n.NUM_OF_CONFLICTS(numOfConflicts)} + </UtilityBarText> + </UtilityBarGroup> + </UtilityBarSection> + <UtilityBarSection> + <UtilityBarGroup> + <i18n.RuleUpgradeHelper /> + </UtilityBarGroup> + </UtilityBarSection> + </UtilityBar> + ); +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx new file mode 100644 index 000000000000..4a73f096a271 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade/translations.tsx @@ -0,0 +1,115 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiLink } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { useKibana } from '../../../../../../common/lib/kibana/kibana_react'; + +export const TOTAL_NUM_OF_FIELDS = (count: number) => ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.totalNumOfFieldsWithUpdates" + defaultMessage="{countValue} {count, plural, one {field} other {fields}} for review" + values={{ countValue: <strong>{count}</strong>, count }} + /> +); + +export const NUM_OF_FIELDS_WITH_UPDATES = (count: number) => ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfFieldsWithUpdates" + defaultMessage="{countValue} {count, plural, one {field} other {fields}} in Elastic update" + values={{ countValue: <strong>{count}</strong>, count }} + /> +); + +export const NUM_OF_CONFLICTS = (count: number) => ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.diffTab.numOfConflicts" + defaultMessage="{countValue} {count, plural, one {conflict} other {conflicts}}" + values={{ countValue: <strong>{count}</strong>, count }} + /> +); + +const UPGRADE_RULES_DOCS_LINK = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.updateYourRulesDocsLink', + { + defaultMessage: 'update your rules', + } +); + +export function RuleUpgradeHelper(): JSX.Element { + const { + docLinks: { + links: { + securitySolution: { manageDetectionRules }, + }, + }, + } = useKibana().services; + const manageDetectionRulesUpdateRulesSection = `${manageDetectionRules}#edit-rules-settings`; + + return ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.rules.upgradeRules.ruleUpgradeHelper" + defaultMessage="Understand how to {docsLink}." + values={{ + docsLink: ( + <EuiLink href={manageDetectionRulesUpdateRulesSection} target="_blank"> + {UPGRADE_RULES_DOCS_LINK} + </EuiLink> + ), + }} + /> + ); +} + +export const UPGRADE_STATUS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.upgradeStatusTitle', + { + defaultMessage: 'Update status:', + } +); + +export const RULE_HAS_CONFLICTS = (count: number) => + i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasConflicts', + { + values: { count }, + defaultMessage: + '{count} {count, plural, one {field has a conflict} other {fields have conflicts}}. Please review and provide a final update.', + } + ); + +export const RULE_HAS_SOFT_CONFLICTS_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasSoftConflictsDescription', + { + defaultMessage: + 'Please review and accept conflicts. You can also keep the current version without the updates, or accept the Elastic update but lose your modifications.', + } +); + +export const RULE_HAS_HARD_CONFLICTS_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleHasHardConflictsDescription', + { + defaultMessage: + 'Please provide an input for the conflicts. You can also keep the current version without the updates, or accept the Elastic update but lose your modifications.', + } +); + +export const RULE_IS_READY_FOR_UPGRADE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.fieldUpgradeState.ruleIsReadyForUpgradeDescription', + { + defaultMessage: 'There are no conflicts and the update is ready to be applied.', + } +); + +export const FIELD_MODIFIED_BADGE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeFlyout.fieldModifiedBadgeDescription', + { + defaultMessage: 'The field value was edited and differs from the stock value', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade_conflicts_resolver_tab.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade_conflicts_resolver_tab.tsx deleted file mode 100644 index 95fa407fb7ca..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/rule_upgrade_conflicts_resolver_tab.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 React from 'react'; -import { EuiSpacer } from '@elastic/eui'; -import type { - RuleUpgradeState, - SetRuleFieldResolvedValueFn, -} from '../../../model/prebuilt_rule_upgrade'; -import { RuleUpgradeInfoBar } from './components/rule_upgrade_info_bar'; -import { RuleUpgradeConflictsResolver } from './components/rule_upgrade_conflicts_resolver'; -import { DiffableRuleContextProvider } from './diffable_rule_context'; -import { RuleUpgradeCallout } from './components/rule_upgrade_callout'; - -interface RuleUpgradeConflictsResolverTabProps { - ruleUpgradeState: RuleUpgradeState; - setRuleFieldResolvedValue: SetRuleFieldResolvedValueFn; -} - -export function RuleUpgradeConflictsResolverTab({ - ruleUpgradeState, - setRuleFieldResolvedValue, -}: RuleUpgradeConflictsResolverTabProps): JSX.Element { - return ( - <DiffableRuleContextProvider - finalDiffableRule={ruleUpgradeState.finalRule} - setRuleFieldResolvedValue={setRuleFieldResolvedValue} - > - <EuiSpacer size="s" /> - <RuleUpgradeInfoBar ruleUpgradeState={ruleUpgradeState} /> - <EuiSpacer size="s" /> - <RuleUpgradeCallout ruleUpgradeState={ruleUpgradeState} /> - <EuiSpacer size="s" /> - <RuleUpgradeConflictsResolver ruleUpgradeState={ruleUpgradeState} /> - </DiffableRuleContextProvider> - ); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/translations.ts deleted file mode 100644 index ced733d87ff6..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/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 CANCEL_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.cancelButtonLabel', - { - defaultMessage: 'Cancel', - } -); - -export const SAVE_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.saveButtonLabel', - { - defaultMessage: 'Save', - } -); - -export const EDIT_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.editButtonLabel', - { - defaultMessage: 'Edit', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/constants.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/constants.ts deleted file mode 100644 index 73a7e89a200a..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/constants.ts +++ /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 { EuiSelectOption } from '@elastic/eui'; -import * as i18n from './translations'; - -export enum Version { - Base = 'base', - Current = 'current', - Target = 'target', - Final = 'final', -} - -export enum SelectedVersions { - BaseTarget = 'base_target', - BaseCurrent = 'base_current', - BaseFinal = 'base_final', - CurrentTarget = 'current_target', - CurrentFinal = 'current_final', - TargetFinal = 'target_final', -} - -export const CURRENT_OPTIONS: EuiSelectOption[] = [ - { - value: SelectedVersions.CurrentFinal, - text: i18n.CURRENT_VS_FINAL, - }, - { - value: SelectedVersions.CurrentTarget, - text: i18n.CURRENT_VS_TARGET, - }, -]; - -export const TARGET_OPTIONS: EuiSelectOption[] = [ - { - value: SelectedVersions.TargetFinal, - text: i18n.TARGET_VS_FINAL, - }, -]; - -export const BASE_OPTIONS: EuiSelectOption[] = [ - { - value: SelectedVersions.BaseFinal, - text: i18n.BASE_VS_FINAL, - }, - { - value: SelectedVersions.BaseTarget, - text: i18n.BASE_VS_TARGET, - }, - { - value: SelectedVersions.BaseCurrent, - text: i18n.BASE_VS_CURRENT, - }, -]; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/translations.ts deleted file mode 100644 index 15699edc206e..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/translations.ts +++ /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 { i18n } from '@kbn/i18n'; - -export const BASE_VS_TARGET = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsTargetLabel', - { - defaultMessage: 'Base vs Target', - } -); - -export const BASE_VS_CURRENT = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsCurrentLabel', - { - defaultMessage: 'Base vs Current', - } -); - -export const BASE_VS_FINAL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.baseVsFinalLabel', - { - defaultMessage: 'Base vs Final', - } -); - -export const CURRENT_VS_TARGET = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsTargetLabel', - { - defaultMessage: 'Current vs Target', - } -); - -export const CURRENT_VS_FINAL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.currentVsFinalLabel', - { - defaultMessage: 'Current vs Final', - } -); - -export const TARGET_VS_FINAL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.targetVsFinalLabel', - { - defaultMessage: 'Target vs Final', - } -); - -export const VERSION_PICKER_ARIA_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.versionsPicker.ariaLabel', - { - defaultMessage: 'Select versions to compare', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state.ts deleted file mode 100644 index ae2d8799c0bd..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export enum FieldUpgradeState { - Accepted = 'ACCEPTED', - SolvableConflict = 'SOLVABLE_CONFLICT', - NonSolvableConflict = 'NON_SOLVABLE_CONFLICT', -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.ts new file mode 100644 index 000000000000..0fd522403edc --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum.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 enum FieldUpgradeStateEnum { + NoUpdate = 'NO_UPDATE', + NoConflict = 'NO_CONFLICT', + Accepted = 'ACCEPTED', + SolvableConflict = 'SOLVABLE_CONFLICT', + NonSolvableConflict = 'NON_SOLVABLE_CONFLICT', +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts index fb18061067ff..88522bf55905 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/fields_upgrade_state.ts @@ -5,6 +5,16 @@ * 2.0. */ -import type { FieldUpgradeState } from './field_upgrade_state'; +import type { DiffableAllFields } from '../../../../../common/api/detection_engine'; +import type { FieldUpgradeStateEnum } from './field_upgrade_state_enum'; -export type FieldsUpgradeState = Record<string, FieldUpgradeState>; +export type FieldsUpgradeState = Record< + string, + | { + state: Exclude<FieldUpgradeStateEnum, FieldUpgradeStateEnum.Accepted>; + } + | { + state: FieldUpgradeStateEnum.Accepted; + resolvedValue: DiffableAllFields[keyof DiffableAllFields]; + } +>; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts index 57ee30f308f0..0e5a631fde2e 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/index.ts @@ -5,7 +5,7 @@ * 2.0. */ -export * from './field_upgrade_state'; +export * from './field_upgrade_state_enum'; export * from './fields_upgrade_state'; export * from './rule_upgrade_state'; export * from './rules_upgrade_state'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts index 0c72361bb29d..7cd1f9c9ef84 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management/model/prebuilt_rule_upgrade/rule_upgrade_state.ts @@ -5,23 +5,16 @@ * 2.0. */ -import { - type DiffableRule, - type RuleUpgradeInfoForReview, -} from '../../../../../common/api/detection_engine'; +import { type RuleUpgradeInfoForReview } from '../../../../../common/api/detection_engine'; import type { FieldsUpgradeState } from './fields_upgrade_state'; export interface RuleUpgradeState extends RuleUpgradeInfoForReview { /** - * Rule containing desired values users expect to see in the upgraded rule. + * Stores a record of customizable field names mapped to field upgrade state. */ - finalRule: DiffableRule; + fieldsUpgradeState: FieldsUpgradeState; /** * Indicates whether there are conflicts blocking rule upgrading. */ hasUnresolvedConflicts: boolean; - /** - * Stores a record of field names mapped to field upgrade state. - */ - fieldsUpgradeState: FieldsUpgradeState; } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx index a0a317e72b4c..4e15de4011fa 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/add_prebuilt_rules_table/use_add_prebuilt_rules_table_columns.tsx @@ -55,7 +55,7 @@ export const RULE_NAME_COLUMN: TableColumn = { field: 'name', name: i18n.COLUMN_RULE, render: (value: RuleResponse['name'], rule: RuleResponse) => ( - <RuleName name={value} ruleId={rule.id} /> + <RuleName name={value} ruleId={rule.rule_id} /> ), sortable: true, truncateText: true, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/index.tsx deleted file mode 100644 index 84c0a5a579ba..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/index.tsx +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { EuiConfirmModal } from '@elastic/eui'; -import type { MlSummaryJob } from '@kbn/ml-plugin/common'; -import React, { memo } from 'react'; -import styled from 'styled-components'; -import { rgba } from 'polished'; -import * as i18n from './translations'; - -const JobsUL = styled.ul` - max-height: 200px; - overflow-y: auto; - - &::-webkit-scrollbar { - height: ${({ theme }) => theme.eui.euiScrollBar}; - width: ${({ theme }) => theme.eui.euiScrollBar}; - } - - &::-webkit-scrollbar-thumb { - background-clip: content-box; - background-color: ${({ theme }) => rgba(theme.eui.euiColorDarkShade, 0.5)}; - border: ${({ theme }) => theme.eui.euiScrollBarCorner} solid transparent; - } - - &::-webkit-scrollbar-corner, - &::-webkit-scrollbar-track { - background-color: transparent; - } -`; - -export interface MlJobUpgradeModalProps { - jobs: MlSummaryJob[]; - onCancel: ( - event?: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement> - ) => void; - onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; -} - -const MlJobUpgradeModalComponent = ({ jobs, onCancel, onConfirm }: MlJobUpgradeModalProps) => { - return ( - <EuiConfirmModal - title={i18n.ML_JOB_UPGRADE_MODAL_TITLE} - onCancel={onCancel} - onConfirm={onConfirm} - cancelButtonText={i18n.ML_JOB_UPGRADE_MODAL_CANCEL} - confirmButtonText={i18n.ML_JOB_UPGRADE_MODAL_CONFIRM} - buttonColor="danger" - defaultFocusedButton="confirm" - > - <i18n.MlJobUpgradeModalBody /> - {i18n.ML_JOB_UPGRADE_MODAL_AFFECTED_JOBS} - <JobsUL> - {jobs.map((j) => { - return <li key={j.id}>{j.id}</li>; - })} - </JobsUL> - </EuiConfirmModal> - ); -}; - -export const MlJobUpgradeModal = memo(MlJobUpgradeModalComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/translations.tsx deleted file mode 100644 index caf94e5c1a26..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/ml_job_upgrade_modal/translations.tsx +++ /dev/null @@ -1,70 +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 { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n-react'; -import { MlJobCompatibilityLink } from '../../../../../../../common/components/links_to_docs'; - -export const ML_JOB_UPGRADE_MODAL_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageTitle', - { - defaultMessage: 'ML rule updates may override your existing rules', - } -); - -export const ML_JOB_UPGRADE_MODAL_CANCEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.cancelTitle', - { - defaultMessage: 'Cancel', - } -); - -export const ML_JOB_UPGRADE_MODAL_CONFIRM = i18n.translate( - 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.confirmTitle', - { - defaultMessage: 'Load rules', - } -); - -export const ML_JOB_UPGRADE_MODAL_AFFECTED_JOBS = i18n.translate( - 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.affectedJobsTitle', - { - defaultMessage: 'Affected jobs:', - } -); - -export const MlJobUpgradeModalBody = () => ( - <FormattedMessage - id="xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageBody" - defaultMessage="{summary} Documentation: {docs}" - values={{ - summary: ( - <p> - <FormattedMessage - id="xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageBody.summary" - defaultMessage="New V3 machine learning jobs have been released, - and the latest corresponding prebuilt detection rules now use these - new ML jobs. You're currently running one or more V1/V2 jobs, which - only work with legacy prebuilt rules. To ensure continued coverage using - V1/V2 jobs, you may need to duplicate or create new rules before - updating your Elastic prebuilt detection rules. Check the documentation - below for instructions on how to keep using the V1/V2 jobs, and how to - start using the new V3 jobs." - /> - </p> - ), - docs: ( - <ul> - <li> - <MlJobCompatibilityLink /> - </li> - </ul> - ), - }} - /> -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/index.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/index.tsx deleted file mode 100644 index 0c664398c51f..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/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 { EuiConfirmModal, EuiText } from '@elastic/eui'; -import React, { memo } from 'react'; -import * as i18n from './translations'; - -export interface UpgradeConflictsModalProps { - onCancel: ( - event?: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement> - ) => void; - onConfirm?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void; -} - -const UpgradeConflictsModalComponent = ({ onCancel, onConfirm }: UpgradeConflictsModalProps) => { - return ( - <EuiConfirmModal - title={i18n.UPGRADE_CONFLICTS_MODAL_TITLE} - onCancel={onCancel} - onConfirm={onConfirm} - cancelButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CANCEL} - confirmButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CONFIRM} - buttonColor="primary" - defaultFocusedButton="confirm" - data-test-subj="upgradeConflictsModal" - > - <EuiText>{i18n.UPGRADE_CONFLICTS_MODAL_BODY}</EuiText> - </EuiConfirmModal> - ); -}; - -export const UpgradeConflictsModal = memo(UpgradeConflictsModalComponent); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx index f66fd92a685f..0111ceb40d38 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/rule_type_change_callout.tsx @@ -5,17 +5,28 @@ * 2.0. */ -import { EuiCallOut } from '@elastic/eui'; import React from 'react'; +import { EuiCallOut } from '@elastic/eui'; import { RULE_TYPE_CHANGE_CALLOUT_DESCRIPTION, RULE_TYPE_CHANGE_CALLOUT_TITLE, + RULE_TYPE_CHANGE_WITH_CUSTOMIZATIONS_CALLOUT_DESCRIPTION, } from './translations'; -export const RuleTypeChangeCallout = () => { +interface RuleTypeChangeCalloutProps { + hasCustomizations: boolean; +} + +export function RuleTypeChangeCallout({ + hasCustomizations, +}: RuleTypeChangeCalloutProps): JSX.Element { return ( <EuiCallOut title={RULE_TYPE_CHANGE_CALLOUT_TITLE} color="danger" iconType="warning"> - <p>{RULE_TYPE_CHANGE_CALLOUT_DESCRIPTION}</p> + <p> + {hasCustomizations + ? RULE_TYPE_CHANGE_WITH_CUSTOMIZATIONS_CALLOUT_DESCRIPTION + : RULE_TYPE_CHANGE_CALLOUT_DESCRIPTION} + </p> </EuiCallOut> ); -}; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.ts deleted file mode 100644 index 9a07c1bb6908..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.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 { i18n } from '@kbn/i18n'; - -export const UPDATE_ALL = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeAll', - { - defaultMessage: 'Update all', - } -); - -export const UPDATE_SELECTED_RULES = (numberOfSelectedRules: number) => { - return i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeSelected', - { - defaultMessage: 'Update {numberOfSelectedRules} selected rule(s)', - values: { numberOfSelectedRules }, - } - ); -}; - -export const BULK_UPDATE_BUTTON_TOOLTIP_NO_PERMISSIONS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.noPermissions', - { - defaultMessage: "You don't have permissions to update rules", - } -); - -export const BULK_UPDATE_ALL_RULES_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.allRules.conflicts', - { - defaultMessage: 'All rules have conflicts. Update them individually.', - } -); - -export const BULK_UPDATE_SELECTED_RULES_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.selectedRules.conflicts', - { - defaultMessage: 'All selected rules have conflicts. Update them individually.', - } -); - -export const SEARCH_PLACEHOLDER = i18n.translate( - 'xpack.securitySolution.detectionEngine.rules.upgradeRules.searchBarPlaceholder', - { - defaultMessage: 'Search by rule name', - } -); - -export const UPDATE_BUTTON_LABEL = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleDetails.updateButtonLabel', - { - defaultMessage: 'Update', - } -); -export const UPDATE_ERROR = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleDetails.updateError', - { - defaultMessage: 'Update error', - } -); - -export const UPDATE_FLYOUT_PER_FIELD_TOOLTIP_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleDetails.perFieldTooltip', - { - defaultMessage: 'View changes field by field.', - } -); - -export const UPDATE_FLYOUT_JSON_VIEW_TOOLTIP_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.ruleDetails.jsonViewTooltip', - { - defaultMessage: 'View the latest rule changes in JSON format.', - } -); - -export const RULE_TYPE_CHANGE_CALLOUT_TITLE = i18n.translate( - 'xpack.securitySolution.detectionEngine.upgradeRules.ruleTypeChangeCalloutTitle', - { - defaultMessage: 'Rule type change', - } -); - -export const RULE_TYPE_CHANGE_CALLOUT_DESCRIPTION = i18n.translate( - 'xpack.securitySolution.detectionEngine.upgradeRules.ruleTypeChangeCalloutDescription', - { - defaultMessage: - 'Your customization will be lost at update. Please take note of your customization or clone this rule before updating.', - } -); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.tsx new file mode 100644 index 000000000000..4b9f79e061ce --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/translations.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { ReactNode } from 'react'; + +export const UPDATE_ALL = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeAll', + { + defaultMessage: 'Update all', + } +); + +export const UPDATE_SELECTED_RULES = (numberOfSelectedRules: number) => { + return i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.upgradeSelected', + { + defaultMessage: 'Update {numberOfSelectedRules} selected rule(s)', + values: { numberOfSelectedRules }, + } + ); +}; + +export const BULK_UPDATE_BUTTON_TOOLTIP_NO_PERMISSIONS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.noPermissions', + { + defaultMessage: "You don't have permissions to update rules", + } +); + +export const BULK_UPDATE_ALL_RULES_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.allRules.conflicts', + { + defaultMessage: 'All rules have conflicts. Update them individually.', + } +); + +export const BULK_UPDATE_SELECTED_RULES_BUTTON_TOOLTIP_CONFLICTS = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.bulkButtons.selectedRules.conflicts', + { + defaultMessage: 'All selected rules have conflicts. Update them individually.', + } +); + +export const SEARCH_PLACEHOLDER = i18n.translate( + 'xpack.securitySolution.detectionEngine.rules.upgradeRules.searchBarPlaceholder', + { + defaultMessage: 'Search by rule name', + } +); + +export const UPDATE_BUTTON_LABEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDetails.updateButtonLabel', + { + defaultMessage: 'Update', + } +); +export const UPDATE_ERROR = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDetails.updateError', + { + defaultMessage: 'Update error', + } +); + +export const UPDATE_FLYOUT_PER_FIELD_TOOLTIP_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDetails.perFieldTooltip', + { + defaultMessage: 'View changes field by field.', + } +); + +export const UPDATE_FLYOUT_JSON_VIEW_TOOLTIP_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.ruleDetails.jsonViewTooltip', + { + defaultMessage: 'View the latest rule changes in JSON format.', + } +); + +export const RULE_TYPE_CHANGE_CALLOUT_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.ruleTypeChangeCalloutTitle', + { + defaultMessage: 'Rule type change', + } +); + +export const RULE_TYPE_CHANGE_CALLOUT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.ruleTypeChangeCalloutDescription', + { + defaultMessage: 'Elastic update has rule type changed.', + } +); + +export const RULE_TYPE_CHANGE_WITH_CUSTOMIZATIONS_CALLOUT_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeRules.ruleTypeChangeWithCustomizationCalloutDescription', + { + defaultMessage: + 'Your customization will be lost at update. Please take note of your customization or clone this rule before updating.', + } +); + +export const LAST_UPDATE = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeFlyout.header.lastUpdate', + { + defaultMessage: 'Last update', + } +); + +export const UPDATED_BY_AND_WHEN = (updatedBy: ReactNode, updatedAt: ReactNode) => ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.upgradeFlyout.header.updated" + defaultMessage="{updatedBy} on {updatedAt}" + values={{ updatedBy, updatedAt }} + /> +); + +export const SEVERITY = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeFlyout.header.severity', + { + defaultMessage: 'Severity', + } +); + +export const FIELD_UPDATES = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeFlyout.header.fieldUpdates', + { + defaultMessage: 'Field updates', + } +); + +export const RULE_MODIFIED_BADGE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.detectionEngine.upgradeFlyout.ruleModifiedBadgeDescription', + { + defaultMessage: 'The rule was edited and field values differs from the stock values', + } +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx new file mode 100644 index 000000000000..bab43e55c2e0 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_flyout_subheader.tsx @@ -0,0 +1,85 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { memo } from 'react'; +import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui'; +import { camelCase, startCase } from 'lodash'; +import type { FieldsDiff } from '../../../../../../common/api/detection_engine'; +import { FormattedDate } from '../../../../../common/components/formatted_date'; +import { SeverityBadge } from '../../../../../common/components/severity_badge'; +import { ModifiedBadge } from '../../../../rule_management/components/rule_details/three_way_diff/badges/modified_badge'; +import type { RuleUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade'; +import { fieldToDisplayNameMap } from '../../../../rule_management/components/rule_details/diff_components/translations'; +import * as i18n from './translations'; + +interface UpgradeFlyoutSubHeaderProps { + ruleUpgradeState: RuleUpgradeState; +} + +export const UpgradeFlyoutSubHeader = memo(function UpgradeFlyoutSubHeader({ + ruleUpgradeState, +}: UpgradeFlyoutSubHeaderProps): JSX.Element { + const lastUpdate = ( + <EuiText size="s"> + <strong> + {i18n.LAST_UPDATE} + {':'} + </strong>{' '} + {i18n.UPDATED_BY_AND_WHEN( + ruleUpgradeState.current_rule.updated_by, + <FormattedDate value={ruleUpgradeState.current_rule.updated_at} fieldName="" /> + )} + </EuiText> + ); + + const severity = ( + <EuiFlexGroup gutterSize="xs"> + <EuiText size="s"> + <strong> + {i18n.SEVERITY} + {':'} + </strong> + </EuiText> + <SeverityBadge value={ruleUpgradeState.target_rule.severity} /> + </EuiFlexGroup> + ); + + const customized = ruleUpgradeState.current_rule.rule_source.type === 'external' && + ruleUpgradeState.current_rule.rule_source.is_customized && ( + <ModifiedBadge tooltip={i18n.RULE_MODIFIED_BADGE_DESCRIPTION} /> + ); + + const fieldsDiff: FieldsDiff<Record<string, unknown>> = ruleUpgradeState.diff.fields; + const fieldsNamesWithUpdates = Object.keys(ruleUpgradeState.fieldsUpgradeState).filter( + (fieldName) => fieldsDiff[fieldName].has_update + ); + const fieldUpdates = !fieldsDiff.type && fieldsNamesWithUpdates.length > 0 && ( + <EuiText size="s"> + <strong> + {i18n.FIELD_UPDATES} + {':'} + </strong>{' '} + {fieldsNamesWithUpdates + .map((fieldName) => fieldToDisplayNameMap[fieldName] ?? startCase(camelCase(fieldName))) + .join(', ')} + </EuiText> + ); + + return ( + <> + <EuiFlexGroup alignItems="center" gutterSize="s"> + <EuiFlexItem grow={false}>{lastUpdate}</EuiFlexItem> + <EuiFlexItem grow={false}>{severity}</EuiFlexItem> + </EuiFlexGroup> + <EuiSpacer size="xs" /> + <EuiFlexGroup alignItems="center" gutterSize="s"> + {customized && <EuiFlexItem grow={false}>{customized}</EuiFlexItem>} + <EuiFlexItem grow={false}>{fieldUpdates}</EuiFlexItem> + </EuiFlexGroup> + </> + ); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx index 2437a5e87866..623f36c5ebb1 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table.tsx @@ -15,7 +15,7 @@ import { EuiSkeletonText, EuiSkeletonTitle, } from '@elastic/eui'; -import React, { useMemo, useState } from 'react'; +import React, { useState } from 'react'; import type { RuleUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade'; import * as i18n from '../../../../../detections/pages/detection_engine/rules/translations'; import { RULES_TABLE_INITIAL_PAGE_SIZE, RULES_TABLE_PAGE_SIZE_OPTIONS } from '../constants'; @@ -38,22 +38,17 @@ const NO_ITEMS_MESSAGE = ( * Table Component for displaying rules that have available updates */ export const UpgradePrebuiltRulesTable = React.memo(() => { - const upgradeRulesTableContext = useUpgradePrebuiltRulesTableContext(); - const [selected, setSelected] = useState<RuleUpgradeState[]>([]); - const { state: { - rulesUpgradeState, + ruleUpgradeStates, hasRulesToUpgrade, isLoading, isRefetching, isUpgradingSecurityPackages, }, - } = upgradeRulesTableContext; - const ruleUpgradeStatesArray = useMemo( - () => Object.values(rulesUpgradeState), - [rulesUpgradeState] - ); + } = useUpgradePrebuiltRulesTableContext(); + const [selected, setSelected] = useState<RuleUpgradeState[]>([]); + const rulesColumns = useUpgradePrebuiltRulesTableColumns(); const shouldShowProgress = isUpgradingSecurityPackages || isRefetching; @@ -102,7 +97,7 @@ export const UpgradePrebuiltRulesTable = React.memo(() => { </EuiFlexGroup> <EuiInMemoryTable - items={ruleUpgradeStatesArray} + items={ruleUpgradeStates} sorting pagination={{ initialPageSize: RULES_TABLE_INITIAL_PAGE_SIZE, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx index 8a1d20114965..8184481e25cc 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_buttons.tsx @@ -21,14 +21,14 @@ export const UpgradePrebuiltRulesTableButtons = ({ }: UpgradePrebuiltRulesTableButtonsProps) => { const { state: { - ruleUpgradeInfos, + ruleUpgradeStates, hasRulesToUpgrade, loadingRules, isRefetching, isUpgradingSecurityPackages, isPrebuiltRulesCustomizationEnabled, }, - actions: { upgradeRules }, + actions: { upgradeRules, upgradeAllRules }, } = useUpgradePrebuiltRulesTableContext(); const [{ loading: isUserDataLoading, canUserCRUD }] = useUserData(); const canUserEditRules = canUserCRUD && !isUserDataLoading; @@ -38,10 +38,13 @@ export const UpgradePrebuiltRulesTableButtons = ({ const isRuleUpgrading = loadingRules.length > 0; const isRequestInProgress = isRuleUpgrading || isRefetching || isUpgradingSecurityPackages; + const doAllSelectedRulesHaveConflicts = - isPrebuiltRulesCustomizationEnabled && isAllRuleHaveConflicts(selectedRules); + isPrebuiltRulesCustomizationEnabled && + selectedRules.every(({ hasUnresolvedConflicts }) => hasUnresolvedConflicts); const doAllRulesHaveConflicts = - isPrebuiltRulesCustomizationEnabled && isAllRuleHaveConflicts(ruleUpgradeInfos); + isPrebuiltRulesCustomizationEnabled && + ruleUpgradeStates.every(({ hasUnresolvedConflicts }) => hasUnresolvedConflicts); const { selectedRulesButtonTooltip, allRulesButtonTooltip } = useBulkUpdateButtonsTooltipContent({ canUserEditRules, @@ -55,12 +58,6 @@ export const UpgradePrebuiltRulesTableButtons = ({ [selectedRules, upgradeRules] ); - const upgradeAllRules = useCallback( - // Upgrade all rules, ignoring filter and selection - () => upgradeRules(ruleUpgradeInfos.map((rule) => rule.rule_id)), - [ruleUpgradeInfos, upgradeRules] - ); - return ( <EuiFlexGroup alignItems="center" gutterSize="s" responsive={false} wrap={true}> {shouldDisplayUpgradeSelectedRulesButton ? ( @@ -146,7 +143,3 @@ const useBulkUpdateButtonsTooltipContent = ({ allRulesButtonTooltip: undefined, }; }; - -function isAllRuleHaveConflicts(rules: Array<{ diff: { num_fields_with_conflicts: number } }>) { - return rules.every((rule) => rule.diff.num_fields_with_conflicts > 0); -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx index 6aad29f8b579..751b24f865e6 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/upgrade_prebuilt_rules_table_context.tsx @@ -10,49 +10,40 @@ import type { Dispatch, SetStateAction } from 'react'; import React, { createContext, useCallback, useContext, useMemo, useState } from 'react'; import type { RuleFieldsToUpgrade, - RuleUpgradeInfoForReview, RuleUpgradeSpecifier, } from '../../../../../../common/api/detection_engine'; +import { useIsPrebuiltRulesCustomizationEnabled } from '../../../../rule_management/hooks/use_is_prebuilt_rules_customization_enabled'; +import { useAppToasts } from '../../../../../common/hooks/use_app_toasts'; +import type { RuleUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade'; +import { RuleUpgradeTab } from '../../../../rule_management/components/rule_details/three_way_diff'; +import { PerFieldRuleDiffTab } from '../../../../rule_management/components/rule_details/per_field_rule_diff_tab'; +import { useIsUpgradingSecurityPackages } from '../../../../rule_management/logic/use_upgrade_security_packages'; import type { RuleResponse, RuleSignatureId, } from '../../../../../../common/api/detection_engine/model/rule_schema'; import { invariant } from '../../../../../../common/utils/invariant'; -import { useAppToasts } from '../../../../../common/hooks/use_app_toasts'; -import { PerFieldRuleDiffTab } from '../../../../rule_management/components/rule_details/per_field_rule_diff_tab'; import { TabContentPadding } from '../../../../rule_management/components/rule_details/rule_details_flyout'; -import { RuleDiffTab } from '../../../../rule_management/components/rule_details/rule_diff_tab'; -import { RuleUpgradeConflictsResolverTab } from '../../../../rule_management/components/rule_details/three_way_diff/rule_upgrade_conflicts_resolver_tab'; -import * as ruleDetailsI18n from '../../../../rule_management/components/rule_details/translations'; -import { useIsPrebuiltRulesCustomizationEnabled } from '../../../../rule_management/hooks/use_is_prebuilt_rules_customization_enabled'; import { usePerformUpgradeSpecificRules } from '../../../../rule_management/logic/prebuilt_rules/use_perform_rule_upgrade'; import { usePrebuiltRulesUpgradeReview } from '../../../../rule_management/logic/prebuilt_rules/use_prebuilt_rules_upgrade_review'; -import { useIsUpgradingSecurityPackages } from '../../../../rule_management/logic/use_upgrade_security_packages'; -import type { - RuleUpgradeState, - RulesUpgradeState, -} from '../../../../rule_management/model/prebuilt_rule_upgrade'; -import { FieldUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade/field_upgrade_state'; -import { isNonUpgradeableFieldName } from '../../../../rule_management/model/prebuilt_rule_upgrade/fields'; +import { RuleDiffTab } from '../../../../rule_management/components/rule_details/rule_diff_tab'; +import { FieldUpgradeStateEnum } from '../../../../rule_management/model/prebuilt_rule_upgrade/field_upgrade_state_enum'; import { useRulePreviewFlyout } from '../use_rule_preview_flyout'; -import { MlJobUpgradeModal } from './modals/ml_job_upgrade_modal'; -import { UpgradeConflictsModal } from './modals/upgrade_conflicts_modal'; -import * as i18n from './translations'; import type { UpgradePrebuiltRulesTableFilterOptions } from './use_filter_prebuilt_rules_to_upgrade'; import { useFilterPrebuiltRulesToUpgrade } from './use_filter_prebuilt_rules_to_upgrade'; import { usePrebuiltRulesUpgradeState } from './use_prebuilt_rules_upgrade_state'; -import { useMlJobUpgradeModal, useUpgradeConflictsModal } from './use_upgrade_modals'; +import { useOutdatedMlJobsUpgradeModal } from './use_ml_jobs_upgrade_modal'; +import { useUpgradeWithConflictsModal } from './use_upgrade_with_conflicts_modal'; import { RuleTypeChangeCallout } from './rule_type_change_callout'; +import { UpgradeFlyoutSubHeader } from './upgrade_flyout_subheader'; +import * as ruleDetailsI18n from '../../../../rule_management/components/rule_details/translations'; +import * as i18n from './translations'; export interface UpgradePrebuiltRulesTableState { - /** - * Rule upgrade state (all rules available for upgrade) - */ - ruleUpgradeInfos: RuleUpgradeInfoForReview[]; /** * Rule upgrade state after applying `filterOptions` */ - rulesUpgradeState: RulesUpgradeState; + ruleUpgradeStates: RuleUpgradeState[]; /** * Currently selected table filter */ @@ -101,6 +92,7 @@ export const PREBUILT_RULE_UPDATE_FLYOUT_ANCHOR = 'updatePrebuiltRulePreview'; export interface UpgradePrebuiltRulesTableActions { reFetchRules: () => void; upgradeRules: (ruleIds: RuleSignatureId[]) => void; + upgradeAllRules: () => void; setFilterOptions: Dispatch<SetStateAction<UpgradePrebuiltRulesTableFilterOptions>>; openRulePreview: (ruleId: string) => void; } @@ -146,28 +138,20 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ refetchInterval: false, // Disable automatic refetching since request is expensive keepPreviousData: true, // Use this option so that the state doesn't jump between "success" and "loading" on page change }); - const filteredRuleUpgradeInfos = useFilterPrebuiltRulesToUpgrade({ + const { rulesUpgradeState, setRuleFieldResolvedValue } = + usePrebuiltRulesUpgradeState(ruleUpgradeInfos); + const ruleUpgradeStates = useMemo(() => Object.values(rulesUpgradeState), [rulesUpgradeState]); + const filteredRuleUpgradeStates = useFilterPrebuiltRulesToUpgrade({ filterOptions, - rules: ruleUpgradeInfos, + data: ruleUpgradeStates, }); - const { rulesUpgradeState, setRuleFieldResolvedValue } = - usePrebuiltRulesUpgradeState(filteredRuleUpgradeInfos); const { - isVisible: isLegacyMLJobsModalVisible, - legacyJobsInstalled, + modal: confirmLegacyMlJobsUpgradeModal, confirmLegacyMLJobs, - handleConfirm: handleLegacyMLJobsConfirm, - handleCancel: handleLegacyMLJobsCancel, - loadingJobs, - } = useMlJobUpgradeModal(); - - const { - isVisible: isConflictsModalVisible, - confirmConflictsUpgrade, - handleConfirm: handleConflictsConfirm, - handleCancel: handleConflictsCancel, - } = useUpgradeConflictsModal(); + isLoading: areMlJobsLoading, + } = useOutdatedMlJobsUpgradeModal(); + const { modal: upgradeConflictsModal, confirmConflictsUpgrade } = useUpgradeWithConflictsModal(); const { mutateAsync: upgradeSpecificRulesRequest } = usePerformUpgradeSpecificRules(); @@ -263,6 +247,19 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ [isPrebuiltRulesCustomizationEnabled, upgradeRulesToResolved, upgradeRulesToTarget] ); + const upgradeAllRules = useCallback( + // Upgrade all rules, ignoring filter and selection + () => upgradeRules(ruleUpgradeInfos.map((rule) => rule.rule_id)), + [ruleUpgradeInfos, upgradeRules] + ); + + const subHeaderFactory = useCallback( + (rule: RuleResponse) => + rulesUpgradeState[rule.rule_id] ? ( + <UpgradeFlyoutSubHeader ruleUpgradeState={rulesUpgradeState[rule.rule_id]} /> + ) : null, + [rulesUpgradeState] + ); const ruleActionsFactory = useCallback( (rule: RuleResponse, closeRulePreview: () => void) => { const ruleUpgradeState = rulesUpgradeState[rule.rule_id]; @@ -313,11 +310,19 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ } const hasRuleTypeChange = ruleUpgradeState.diff.fields.type?.has_update ?? false; + const hasCustomizations = + ruleUpgradeState.current_rule.rule_source.type === 'external' && + ruleUpgradeState.current_rule.rule_source.is_customized; const shouldShowRuleTypeChangeCallout = hasRuleTypeChange && isPrebuiltRulesCustomizationEnabled; + let updateTabContent = ( <PerFieldRuleDiffTab - header={shouldShowRuleTypeChangeCallout ? <RuleTypeChangeCallout /> : null} + header={ + shouldShowRuleTypeChangeCallout && ( + <RuleTypeChangeCallout hasCustomizations={hasCustomizations} /> + ) + } ruleDiff={ruleUpgradeState.diff} /> ); @@ -327,7 +332,7 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ // conflicts, only accept the target rule. if (isPrebuiltRulesCustomizationEnabled && !hasRuleTypeChange) { updateTabContent = ( - <RuleUpgradeConflictsResolverTab + <RuleUpgradeTab ruleUpgradeState={ruleUpgradeState} setRuleFieldResolvedValue={setRuleFieldResolvedValue} /> @@ -352,12 +357,12 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ </EuiToolTip> ), content: ( - <TabContentPadding> + <div> <RuleDiffTab oldRule={ruleUpgradeState.current_rule} newRule={ruleUpgradeState.target_rule} /> - </TabContentPadding> + </div> ), }; @@ -366,11 +371,12 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ [rulesUpgradeState, setRuleFieldResolvedValue, isPrebuiltRulesCustomizationEnabled] ); const filteredRules = useMemo( - () => filteredRuleUpgradeInfos.map((rule) => rule.target_rule), - [filteredRuleUpgradeInfos] + () => filteredRuleUpgradeStates.map(({ target_rule: targetRule }) => targetRule), + [filteredRuleUpgradeStates] ); const { rulePreviewFlyout, openRulePreview } = useRulePreviewFlyout({ rules: filteredRules, + subHeaderFactory, ruleActionsFactory, extraTabsFactory, flyoutProps: { @@ -383,22 +389,22 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ () => ({ reFetchRules: refetch, upgradeRules, + upgradeAllRules, setFilterOptions, openRulePreview, }), - [refetch, upgradeRules, openRulePreview] + [refetch, upgradeRules, upgradeAllRules, openRulePreview] ); - const providerValue = useMemo<UpgradePrebuiltRulesContextType>(() => { - return { + const providerValue = useMemo<UpgradePrebuiltRulesContextType>( + () => ({ state: { - ruleUpgradeInfos, - rulesUpgradeState, + ruleUpgradeStates: filteredRuleUpgradeStates, hasRulesToUpgrade: isFetched && ruleUpgradeInfos.length > 0, filterOptions, tags, isFetched, - isLoading: isLoading || loadingJobs, + isLoading: isLoading || areMlJobsLoading, isRefetching, isUpgradingSecurityPackages, loadingRules, @@ -406,39 +412,29 @@ export const UpgradePrebuiltRulesTableContextProvider = ({ isPrebuiltRulesCustomizationEnabled, }, actions, - }; - }, [ - ruleUpgradeInfos, - rulesUpgradeState, - filterOptions, - tags, - isFetched, - isLoading, - loadingJobs, - isRefetching, - isUpgradingSecurityPackages, - loadingRules, - dataUpdatedAt, - actions, - isPrebuiltRulesCustomizationEnabled, - ]); + }), + [ + ruleUpgradeInfos.length, + filteredRuleUpgradeStates, + filterOptions, + tags, + isFetched, + isLoading, + areMlJobsLoading, + isRefetching, + isUpgradingSecurityPackages, + loadingRules, + dataUpdatedAt, + actions, + isPrebuiltRulesCustomizationEnabled, + ] + ); return ( <UpgradePrebuiltRulesTableContext.Provider value={providerValue}> <> - {isLegacyMLJobsModalVisible && ( - <MlJobUpgradeModal - jobs={legacyJobsInstalled} - onCancel={handleLegacyMLJobsCancel} - onConfirm={handleLegacyMLJobsConfirm} - /> - )} - {isConflictsModalVisible && ( - <UpgradeConflictsModal - onCancel={handleConflictsCancel} - onConfirm={handleConflictsConfirm} - /> - )} + {confirmLegacyMlJobsUpgradeModal} + {upgradeConflictsModal} {children} {rulePreviewFlyout} </> @@ -457,21 +453,15 @@ export const useUpgradePrebuiltRulesTableContext = (): UpgradePrebuiltRulesConte }; function constructRuleFieldsToUpgrade(ruleUpgradeState: RuleUpgradeState): RuleFieldsToUpgrade { - const finalRule = ruleUpgradeState.finalRule as Record<string, unknown>; const ruleFieldsToUpgrade: Record<string, unknown> = {}; - for (const fieldName of Object.keys(ruleUpgradeState.fieldsUpgradeState)) { - const fieldUpgradeState = ruleUpgradeState.fieldsUpgradeState[fieldName]; - - if (!isNonUpgradeableFieldName(fieldName) && fieldUpgradeState === FieldUpgradeState.Accepted) { - invariant( - fieldName in finalRule, - `Ready to upgrade field "${fieldName}" is not found in final rule` - ); - + for (const [fieldName, fieldUpgradeState] of Object.entries( + ruleUpgradeState.fieldsUpgradeState + )) { + if (fieldUpgradeState.state === FieldUpgradeStateEnum.Accepted) { ruleFieldsToUpgrade[fieldName] = { pick_version: 'RESOLVED', - resolved_value: finalRule[fieldName], + resolved_value: fieldUpgradeState.resolvedValue, }; } } diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts index b5a0e123d751..a3dd45f8fabc 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_filter_prebuilt_rules_to_upgrade.ts @@ -6,7 +6,7 @@ */ import { useMemo } from 'react'; -import type { RuleUpgradeInfoForReview } from '../../../../../../common/api/detection_engine/prebuilt_rules'; +import type { RuleUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade'; import { RuleCustomizationEnum, type FilterOptions } from '../../../../rule_management/logic/types'; export type UpgradePrebuiltRulesTableFilterOptions = Pick< @@ -14,16 +14,19 @@ export type UpgradePrebuiltRulesTableFilterOptions = Pick< 'filter' | 'tags' | 'ruleSource' >; +interface UseFilterPrebuiltRulesToUpgradeParams { + data: RuleUpgradeState[]; + filterOptions: UpgradePrebuiltRulesTableFilterOptions; +} + export const useFilterPrebuiltRulesToUpgrade = ({ - rules, + data, filterOptions, -}: { - rules: RuleUpgradeInfoForReview[]; - filterOptions: UpgradePrebuiltRulesTableFilterOptions; -}) => { - const filteredRules = useMemo(() => { +}: UseFilterPrebuiltRulesToUpgradeParams): RuleUpgradeState[] => { + return useMemo(() => { const { filter, tags, ruleSource } = filterOptions; - return rules.filter((ruleInfo) => { + + return data.filter((ruleInfo) => { if (filter && !ruleInfo.current_rule.name.toLowerCase().includes(filter.toLowerCase())) { return false; } @@ -53,7 +56,5 @@ export const useFilterPrebuiltRulesToUpgrade = ({ return true; }); - }, [filterOptions, rules]); - - return filteredRules; + }, [filterOptions, data]); }; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/index.ts new file mode 100644 index 000000000000..470224e90a54 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/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 './use_ml_jobs_upgrade_modal'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.tsx new file mode 100644 index 000000000000..37d6a84728ae --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/ml_jobs_upgrade_modal.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, { memo } from 'react'; +import { EuiConfirmModal } from '@elastic/eui'; +import type { MlSummaryJob } from '@kbn/ml-plugin/common'; +import styled from 'styled-components'; +import { rgba } from 'polished'; +import * as i18n from './translations'; + +const JobsUL = styled.ul` + max-height: 200px; + overflow-y: auto; + + &::-webkit-scrollbar { + height: ${({ theme }) => theme.eui.euiScrollBar}; + width: ${({ theme }) => theme.eui.euiScrollBar}; + } + + &::-webkit-scrollbar-thumb { + background-clip: content-box; + background-color: ${({ theme }) => rgba(theme.eui.euiColorDarkShade, 0.5)}; + border: ${({ theme }) => theme.eui.euiScrollBarCorner} solid transparent; + } + + &::-webkit-scrollbar-corner, + &::-webkit-scrollbar-track { + background-color: transparent; + } +`; + +interface OutdatedMlJobsUpgradeModalProps { + jobs: MlSummaryJob[]; + onCancel: () => void; + onConfirm: () => void; +} + +export const OutdatedMlJobsUpgradeModal = memo(function LegacyMlJobsUpgradeModal({ + jobs, + onCancel, + onConfirm, +}: OutdatedMlJobsUpgradeModalProps): JSX.Element { + return ( + <EuiConfirmModal + title={i18n.ML_JOB_UPGRADE_MODAL_TITLE} + onCancel={onCancel} + onConfirm={onConfirm} + cancelButtonText={i18n.ML_JOB_UPGRADE_MODAL_CANCEL} + confirmButtonText={i18n.ML_JOB_UPGRADE_MODAL_CONFIRM} + buttonColor="danger" + defaultFocusedButton="confirm" + > + <i18n.MlJobUpgradeModalBody /> + {i18n.ML_JOB_UPGRADE_MODAL_AFFECTED_JOBS} + <JobsUL> + {jobs.map((j) => { + return <li key={j.id}>{j.id}</li>; + })} + </JobsUL> + </EuiConfirmModal> + ); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx new file mode 100644 index 000000000000..8250591de71c --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/translations.tsx @@ -0,0 +1,70 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { MlJobCompatibilityLink } from '../../../../../../common/components/links_to_docs'; + +export const ML_JOB_UPGRADE_MODAL_TITLE = i18n.translate( + 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageTitle', + { + defaultMessage: 'ML rule updates may override your existing rules', + } +); + +export const ML_JOB_UPGRADE_MODAL_CANCEL = i18n.translate( + 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.cancelTitle', + { + defaultMessage: 'Cancel', + } +); + +export const ML_JOB_UPGRADE_MODAL_CONFIRM = i18n.translate( + 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.confirmTitle', + { + defaultMessage: 'Load rules', + } +); + +export const ML_JOB_UPGRADE_MODAL_AFFECTED_JOBS = i18n.translate( + 'xpack.securitySolution.detectionEngine.mlJobUpgradeModal.affectedJobsTitle', + { + defaultMessage: 'Affected jobs:', + } +); + +export const MlJobUpgradeModalBody = () => ( + <FormattedMessage + id="xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageBody" + defaultMessage="{summary} Documentation: {docs}" + values={{ + summary: ( + <p> + <FormattedMessage + id="xpack.securitySolution.detectionEngine.mlJobUpgradeModal.messageBody.summary" + defaultMessage="New V3 machine learning jobs have been released, + and the latest corresponding prebuilt detection rules now use these + new ML jobs. You're currently running one or more V1/V2 jobs, which + only work with legacy prebuilt rules. To ensure continued coverage using + V1/V2 jobs, you may need to duplicate or create new rules before + updating your Elastic prebuilt detection rules. Check the documentation + below for instructions on how to keep using the V1/V2 jobs, and how to + start using the new V3 jobs." + /> + </p> + ), + docs: ( + <ul> + <li> + <MlJobCompatibilityLink /> + </li> + </ul> + ), + }} + /> +); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.tsx new file mode 100644 index 000000000000..cb4682f49a60 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_ml_jobs_upgrade_modal/use_ml_jobs_upgrade_modal.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 type { ReactNode } from 'react'; +import React, { useCallback } from 'react'; +import { useBoolean } from '@kbn/react-hooks'; +import { useInstalledSecurityJobs } from '../../../../../../common/components/ml/hooks/use_installed_security_jobs'; +import { affectedJobIds } from '../../../../../../../common/machine_learning/affected_job_ids'; +import { useAsyncConfirmation } from '../../rules_table/use_async_confirmation'; +import { OutdatedMlJobsUpgradeModal } from './ml_jobs_upgrade_modal'; + +interface UseOutdatedMlJobsUpgradeModalResult { + modal: ReactNode; + isLoading: boolean; + confirmLegacyMLJobs: () => Promise<boolean>; +} + +export function useOutdatedMlJobsUpgradeModal(): UseOutdatedMlJobsUpgradeModalResult { + const [isVisible, { on: showModal, off: hideModal }] = useBoolean(false); + const { loading, jobs } = useInstalledSecurityJobs(); + const legacyJobsInstalled = jobs.filter((job) => affectedJobIds.includes(job.id)); + const [confirmLegacyMLJobs, confirm, cancel] = useAsyncConfirmation({ + onInit: showModal, + onFinish: hideModal, + }); + + const handleLegacyMLJobsConfirm = useCallback(async () => { + if (legacyJobsInstalled.length > 0) { + return confirmLegacyMLJobs(); + } + + return true; + }, [confirmLegacyMLJobs, legacyJobsInstalled]); + + return { + modal: isVisible && ( + <OutdatedMlJobsUpgradeModal jobs={jobs} onConfirm={confirm} onCancel={cancel} /> + ), + confirmLegacyMLJobs: handleLegacyMLJobsConfirm, + isLoading: loading, + }; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts index b50ca7da1849..81d64b1b3994 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_prebuilt_rules_upgrade_state.ts @@ -12,16 +12,16 @@ import type { FieldsUpgradeState, SetRuleFieldResolvedValueFn, } from '../../../../rule_management/model/prebuilt_rule_upgrade'; -import { FieldUpgradeState } from '../../../../rule_management/model/prebuilt_rule_upgrade'; +import { FieldUpgradeStateEnum } from '../../../../rule_management/model/prebuilt_rule_upgrade'; import { type FieldsDiff, type DiffableAllFields, - type DiffableRule, type RuleUpgradeInfoForReview, ThreeWayDiffConflict, type RuleSignatureId, + NON_UPGRADEABLE_DIFFABLE_FIELDS, } from '../../../../../../common/api/detection_engine'; -import { convertRuleToDiffable } from '../../../../../../common/detection_engine/prebuilt_rules/diff/convert_rule_to_diffable'; +import { assertUnreachable } from '../../../../../../common/utility_types'; type RuleResolvedConflicts = Partial<DiffableAllFields>; type RulesResolvedConflicts = Record<RuleSignatureId, RuleResolvedConflicts>; @@ -54,21 +54,23 @@ export function usePrebuiltRulesUpgradeState( const state: RulesUpgradeState = {}; for (const ruleUpgradeInfo of ruleUpgradeInfos) { + const fieldsUpgradeState = calcFieldsState( + ruleUpgradeInfo.diff.fields, + rulesResolvedConflicts[ruleUpgradeInfo.rule_id] ?? {} + ); + + const hasRuleTypeChange = Boolean(ruleUpgradeInfo.diff.fields.type); + const hasFieldConflicts = Object.values(fieldsUpgradeState).some( + ({ state: fieldState }) => + fieldState === FieldUpgradeStateEnum.SolvableConflict || + fieldState === FieldUpgradeStateEnum.NonSolvableConflict + ); + state[ruleUpgradeInfo.rule_id] = { ...ruleUpgradeInfo, - finalRule: calcFinalDiffableRule( - ruleUpgradeInfo, - rulesResolvedConflicts[ruleUpgradeInfo.rule_id] ?? {} - ), - fieldsUpgradeState: calcFieldsState( - ruleUpgradeInfo.diff.fields, - rulesResolvedConflicts[ruleUpgradeInfo.rule_id] ?? {} - ), + fieldsUpgradeState, hasUnresolvedConflicts: isPrebuiltRulesCustomizationEnabled - ? getUnacceptedConflictsCount( - ruleUpgradeInfo.diff.fields, - rulesResolvedConflicts[ruleUpgradeInfo.rule_id] ?? {} - ) > 0 + ? hasRuleTypeChange || hasFieldConflicts : false, }; } @@ -82,76 +84,49 @@ export function usePrebuiltRulesUpgradeState( }; } -function calcFinalDiffableRule( - ruleUpgradeInfo: RuleUpgradeInfoForReview, - ruleResolvedConflicts: RuleResolvedConflicts -): DiffableRule { - return { - ...convertRuleToDiffable(ruleUpgradeInfo.target_rule), - ...convertRuleFieldsDiffToDiffable(ruleUpgradeInfo.diff.fields), - ...ruleResolvedConflicts, - } as DiffableRule; -} - -/** - * Assembles a `DiffableRule` from rule fields diff `merged_version`s. - */ -function convertRuleFieldsDiffToDiffable( - ruleFieldsDiff: FieldsDiff<Record<string, unknown>> -): Partial<DiffableRule> { - const mergeVersionRule: Record<string, unknown> = {}; - - for (const fieldName of Object.keys(ruleFieldsDiff)) { - mergeVersionRule[fieldName] = ruleFieldsDiff[fieldName].merged_version; - } - - return mergeVersionRule; -} +const NON_UPGRADEABLE_DIFFABLE_FIELDS_SET: Readonly<Set<string>> = new Set( + NON_UPGRADEABLE_DIFFABLE_FIELDS +); function calcFieldsState( - ruleFieldsDiff: FieldsDiff<Record<string, unknown>>, + fieldsDiff: FieldsDiff<Record<string, unknown>>, ruleResolvedConflicts: RuleResolvedConflicts ): FieldsUpgradeState { const fieldsState: FieldsUpgradeState = {}; - for (const fieldName of Object.keys(ruleFieldsDiff)) { - switch (ruleFieldsDiff[fieldName].conflict) { + for (const fieldName of Object.keys(fieldsDiff)) { + if (NON_UPGRADEABLE_DIFFABLE_FIELDS_SET.has(fieldName)) { + // eslint-disable-next-line no-continue + continue; + } + + const fieldDiff = fieldsDiff[fieldName]; + + switch (fieldDiff.conflict) { case ThreeWayDiffConflict.NONE: - fieldsState[fieldName] = FieldUpgradeState.Accepted; + fieldsState[fieldName] = { + state: fieldDiff.has_update + ? FieldUpgradeStateEnum.NoConflict + : FieldUpgradeStateEnum.NoUpdate, + }; break; case ThreeWayDiffConflict.SOLVABLE: - fieldsState[fieldName] = FieldUpgradeState.SolvableConflict; + fieldsState[fieldName] = { state: FieldUpgradeStateEnum.SolvableConflict }; break; case ThreeWayDiffConflict.NON_SOLVABLE: - fieldsState[fieldName] = FieldUpgradeState.NonSolvableConflict; + fieldsState[fieldName] = { state: FieldUpgradeStateEnum.NonSolvableConflict }; break; + + default: + assertUnreachable(fieldDiff.conflict); } } - for (const fieldName of Object.keys(ruleResolvedConflicts)) { - fieldsState[fieldName] = FieldUpgradeState.Accepted; + for (const [fieldName, resolvedValue] of Object.entries(ruleResolvedConflicts)) { + fieldsState[fieldName] = { state: FieldUpgradeStateEnum.Accepted, resolvedValue }; } return fieldsState; } - -function getUnacceptedConflictsCount( - ruleFieldsDiff: FieldsDiff<Record<string, unknown>>, - ruleResolvedConflicts: RuleResolvedConflicts -): number { - const fieldNames = Object.keys(ruleFieldsDiff); - const fieldNamesWithConflict = fieldNames.filter( - (fieldName) => ruleFieldsDiff[fieldName].conflict !== ThreeWayDiffConflict.NONE - ); - const fieldNamesWithConflictSet = new Set(fieldNamesWithConflict); - - for (const resolvedConflictField of Object.keys(ruleResolvedConflicts)) { - if (fieldNamesWithConflictSet.has(resolvedConflictField)) { - fieldNamesWithConflictSet.delete(resolvedConflictField); - } - } - - return fieldNamesWithConflictSet.size; -} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_modals.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_modals.tsx deleted file mode 100644 index 256ccf47c194..000000000000 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_modals.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 { useCallback } from 'react'; -import { useInstalledSecurityJobs } from '../../../../../common/components/ml/hooks/use_installed_security_jobs'; -import { useBoolState } from '../../../../../common/hooks/use_bool_state'; -import { affectedJobIds } from '../../../../../../common/machine_learning/affected_job_ids'; -import { useAsyncConfirmation } from '../rules_table/use_async_confirmation'; - -export const useMlJobUpgradeModal = () => { - const [isVisible, showModal, hideModal] = useBoolState(false); - const { loading: loadingJobs, jobs } = useInstalledSecurityJobs(); - const legacyJobsInstalled = jobs.filter((job) => affectedJobIds.includes(job.id)); - const [confirmLegacyMLJobs, handleConfirm, handleCancel] = useAsyncConfirmation({ - onInit: showModal, - onFinish: hideModal, - }); - - const handleLegacyMLJobsConfirm = useCallback(async () => { - if (legacyJobsInstalled.length > 0) { - return confirmLegacyMLJobs(); - } - return true; - }, [confirmLegacyMLJobs, legacyJobsInstalled]); - - return { - isVisible, - legacyJobsInstalled, - confirmLegacyMLJobs: handleLegacyMLJobsConfirm, - handleConfirm, - handleCancel, - loadingJobs, - }; -}; - -export const useUpgradeConflictsModal = () => { - const [isVisible, showModal, hideModal] = useBoolState(false); - const [confirmConflictsUpgrade, handleConfirm, handleCancel] = useAsyncConfirmation({ - onInit: showModal, - onFinish: hideModal, - }); - - return { - isVisible, - confirmConflictsUpgrade, - handleConfirm, - handleCancel, - }; -}; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx index c2b1f8e3dbe4..919664c100b2 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_prebuilt_rules_table_columns.tsx @@ -59,7 +59,7 @@ const RULE_NAME_COLUMN: TableColumn = { field: 'current_rule.name', name: i18n.COLUMN_RULE, render: (value: RuleUpgradeState['current_rule']['name'], ruleUpgradeState: RuleUpgradeState) => ( - <RuleName name={value} ruleId={ruleUpgradeState.id} /> + <RuleName name={value} ruleId={ruleUpgradeState.rule_id} /> ), sortable: true, truncateText: true, diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/index.ts new file mode 100644 index 000000000000..7a0186468386 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/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 './use_upgrade_modal'; diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/translations.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx similarity index 100% rename from x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/modals/upgrade_conflicts_modal/translations.tsx rename to x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/translations.tsx diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.tsx new file mode 100644 index 000000000000..3374ae5c16b4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/upgrade_modal.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 { EuiConfirmModal, EuiText } from '@elastic/eui'; +import React, { memo } from 'react'; +import * as i18n from './translations'; + +interface UpgradeWithConflictsModalProps { + onCancel: () => void; + onConfirm: () => void; +} + +export const UpgradeWithConflictsModal = memo(function ConfirmUpgradeWithConflictsModal({ + onCancel, + onConfirm, +}: UpgradeWithConflictsModalProps): JSX.Element { + return ( + <EuiConfirmModal + title={i18n.UPGRADE_CONFLICTS_MODAL_TITLE} + onCancel={onCancel} + onConfirm={onConfirm} + cancelButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CANCEL} + confirmButtonText={i18n.UPGRADE_CONFLICTS_MODAL_CONFIRM} + buttonColor="primary" + defaultFocusedButton="confirm" + data-test-subj="confirmUpgradeWithConflictsModal" + > + <EuiText>{i18n.UPGRADE_CONFLICTS_MODAL_BODY}</EuiText> + </EuiConfirmModal> + ); +}); diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.tsx new file mode 100644 index 000000000000..0714ba458d34 --- /dev/null +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/upgrade_prebuilt_rules_table/use_upgrade_with_conflicts_modal/use_upgrade_modal.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 type { ReactNode } from 'react'; +import React from 'react'; +import { useBoolean } from '@kbn/react-hooks'; +import { useAsyncConfirmation } from '../../rules_table/use_async_confirmation'; +import { UpgradeWithConflictsModal } from './upgrade_modal'; + +interface UseUpgradeWithConflictsModalResult { + modal: ReactNode; + confirmConflictsUpgrade: () => Promise<boolean>; +} + +export function useUpgradeWithConflictsModal(): UseUpgradeWithConflictsModalResult { + const [isVisible, { on: showModal, off: hideModal }] = useBoolean(false); + const [confirmConflictsUpgrade, confirm, cancel] = useAsyncConfirmation({ + onInit: showModal, + onFinish: hideModal, + }); + + return { + modal: isVisible && <UpgradeWithConflictsModal onConfirm={confirm} onCancel={cancel} />, + confirmConflictsUpgrade, + }; +} diff --git a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx index d6dcdd0592b8..0c16a5c6ed16 100644 --- a/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx +++ b/x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/components/rules_table/use_rule_preview_flyout.tsx @@ -17,6 +17,7 @@ interface UseRulePreviewFlyoutParams { rules: RuleResponse[]; ruleActionsFactory: (rule: RuleResponse, closeRulePreview: () => void) => ReactNode; extraTabsFactory?: (rule: RuleResponse) => EuiTabbedContentTab[]; + subHeaderFactory?: (rule: RuleResponse) => ReactNode; flyoutProps: RulePreviewFlyoutProps; } @@ -38,10 +39,15 @@ export function useRulePreviewFlyout({ rules, extraTabsFactory, ruleActionsFactory, + subHeaderFactory, flyoutProps, }: UseRulePreviewFlyoutParams): UseRulePreviewFlyoutResult { const [rule, setRuleForPreview] = useState<RuleResponse | undefined>(); const closeRulePreview = useCallback(() => setRuleForPreview(undefined), []); + const subHeader = useMemo( + () => (rule ? subHeaderFactory?.(rule) : null), + [subHeaderFactory, rule] + ); const ruleActions = useMemo( () => rule && ruleActionsFactory(rule, closeRulePreview), [rule, ruleActionsFactory, closeRulePreview] @@ -61,13 +67,14 @@ export function useRulePreviewFlyout({ closeFlyout={closeRulePreview} ruleActions={ruleActions} extraTabs={extraTabs} + subHeader={subHeader} /> ), openRulePreview: useCallback( (ruleId: RuleSignatureId) => { - const ruleToShowInFlyout = rules.find((x) => x.id === ruleId); + const ruleToShowInFlyout = rules.find((x) => x.rule_id === ruleId); - invariant(ruleToShowInFlyout, `Rule with id ${ruleId} not found`); + invariant(ruleToShowInFlyout, `Rule with rule_id ${ruleId} not found`); setRuleForPreview(ruleToShowInFlyout); }, [rules, setRuleForPreview] diff --git a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx index db1cd501bc3f..48ae76514c28 100644 --- a/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx +++ b/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists/use_lists_config.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useKibana } from '../../../../common/lib/kibana'; import { useListsIndex } from './use_lists_index'; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts b/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts index fa33d8fa575b..f30b84127726 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/api/api.ts @@ -45,6 +45,7 @@ import { API_VERSIONS, RISK_ENGINE_CLEANUP_URL, RISK_ENGINE_SCHEDULE_NOW_URL, + RISK_ENGINE_CONFIGURE_SO_URL, } from '../../../common/constants'; import type { SnakeToCamelCase } from '../common/utils'; import { useKibana } from '../../common/lib/kibana/kibana_react'; @@ -298,6 +299,14 @@ export const useEntityAnalyticsRoutes = () => { method: 'DELETE', }); + const updateSavedObjectConfiguration = (params: {}) => { + http.fetch(RISK_ENGINE_CONFIGURE_SO_URL, { + version: API_VERSIONS.public.v1, + method: 'PUT', + body: JSON.stringify(params), + }); + }; + return { fetchRiskScorePreview, fetchRiskEngineStatus, @@ -317,6 +326,7 @@ export const useEntityAnalyticsRoutes = () => { calculateEntityRiskScore, cleanUpRiskEngine, fetchEntitiesList, + updateSavedObjectConfiguration, }; }, [http]); }; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts b/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.ts new file mode 100644 index 000000000000..a45cc8407597 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_configure_risk_engine_saved_object.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 type { UseMutationOptions } from '@tanstack/react-query'; +import { useMutation } from '@tanstack/react-query'; +import type { TaskManagerUnavailableResponse } from '../../../../common/api/entity_analytics/common'; +import { useEntityAnalyticsRoutes } from '../api'; +import type { ConfigureRiskEngineSavedObjectResponse } from '../../../../common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen'; + +interface ConfigureRiskEngineParams { + includeClosedAlerts: boolean; + range: { start: string; end: string }; +} + +export const useConfigureSORiskEngineMutation = ( + options?: UseMutationOptions< + ConfigureRiskEngineSavedObjectResponse, + { body: ConfigureRiskEngineSavedObjectResponse | TaskManagerUnavailableResponse }, + ConfigureRiskEngineParams + > +) => { + const { updateSavedObjectConfiguration } = useEntityAnalyticsRoutes(); + + return useMutation< + ConfigureRiskEngineSavedObjectResponse, + { body: ConfigureRiskEngineSavedObjectResponse | TaskManagerUnavailableResponse }, + ConfigureRiskEngineParams + >(async (params: ConfigureRiskEngineParams) => { + await updateSavedObjectConfiguration({ + exclude_alert_statuses: params.includeClosedAlerts ? [] : ['closed'], + range: params.range, + }); + return { risk_engine_saved_object_configured: true }; + }, options); +}; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts b/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts index 96a445381512..bc488786cff6 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/api/hooks/use_preview_risk_scores.ts @@ -17,11 +17,12 @@ export const useRiskScorePreview = ({ data_view_id: dataViewId, range, filter, + exclude_alert_statuses: excludeAlertStatuses, }: UseRiskScorePreviewParams) => { const { fetchRiskScorePreview } = useEntityAnalyticsRoutes(); return useQuery( - ['POST', 'FETCH_PREVIEW_RISK_SCORE', range, filter], + ['POST', 'FETCH_PREVIEW_RISK_SCORE', range, filter, excludeAlertStatuses], async ({ signal }) => { if (!dataViewId) { return; @@ -49,6 +50,10 @@ export const useRiskScorePreview = ({ params.filter = filter; } + if (excludeAlertStatuses) { + params.exclude_alert_statuses = excludeAlertStatuses; + } + const response = await fetchRiskScorePreview({ signal, params }); return response; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap b/x-pack/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap new file mode 100644 index 000000000000..9115b2f11851 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/__snapshots__/risk_score_configuration_section.test.tsx.snap @@ -0,0 +1,41 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`RiskScoreConfigurationSection renders correctly 1`] = ` +<Fragment> + <EuiFlexGroup + alignItems="center" + > + <div> + <EuiSwitch + checked={false} + data-test-subj="includeClosedAlertsSwitch" + label="Include closed alerts for risk scoring" + onChange={[Function]} + /> + </div> + <Styled(div) /> + <div> + <EuiSuperDatePicker + compressed={false} + end="now" + onTimeChange={[Function]} + showUpdateButton={false} + start="now-30m" + width="auto" + /> + </div> + </EuiFlexGroup> + <EuiSpacer + size="m" + /> + <EuiText + size="s" + > + <p> + Enable this option to factor both open and closed alerts into the risk engine + calculations. Including closed alerts helps provide a more comprehensive risk assessment + based on past incidents, leading to more accurate scoring and insights. + </p> + </EuiText> +</Fragment> +`; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx new file mode 100644 index 000000000000..93a7e0776d92 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.test.tsx @@ -0,0 +1,120 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { RiskScoreConfigurationSection } from './risk_score_configuration_section'; +import { shallow, mount } from 'enzyme'; +import { act } from 'react-dom/test-utils'; +import { EuiSuperDatePicker, EuiSwitch } from '@elastic/eui'; +import * as i18n from '../translations'; +import { useAppToasts } from '../../common/hooks/use_app_toasts'; +import { useConfigureSORiskEngineMutation } from '../api/hooks/use_configure_risk_engine_saved_object'; + +jest.mock('../../common/lib/kibana'); +jest.mock('../../common/hooks/use_app_toasts'); +jest.mock('../api/hooks/use_configure_risk_engine_saved_object'); + +describe('RiskScoreConfigurationSection', () => { + const mockConfigureSO = useConfigureSORiskEngineMutation as jest.Mock; + const defaultProps = { + includeClosedAlerts: false, + setIncludeClosedAlerts: jest.fn(), + from: 'now-30m', + to: 'now', + onDateChange: jest.fn(), + }; + + const mockAddSuccess = jest.fn(); + const mockMutate = jest.fn(); + + beforeEach(() => { + (useAppToasts as jest.Mock).mockReturnValue({ addSuccess: mockAddSuccess }); + mockConfigureSO.mockReturnValue({ mutate: mockMutate }); + }); + + afterEach(() => { + jest.clearAllMocks(); + }); + + it('renders correctly', () => { + const wrapper = shallow(<RiskScoreConfigurationSection {...defaultProps} />); + expect(wrapper).toMatchSnapshot(); + }); + + it('toggles includeClosedAlerts', () => { + const wrapper = mount( + <RiskScoreConfigurationSection {...defaultProps} includeClosedAlerts={true} /> + ); + wrapper.find(EuiSwitch).simulate('click'); + expect(defaultProps.setIncludeClosedAlerts).toHaveBeenCalledWith(true); + }); + + it('calls onDateChange on date change', () => { + const wrapper = mount(<RiskScoreConfigurationSection {...defaultProps} />); + wrapper.find(EuiSuperDatePicker).props().onTimeChange({ start: 'now-30m', end: 'now' }); + expect(defaultProps.onDateChange).toHaveBeenCalledWith({ start: 'now-30m', end: 'now' }); + }); + + it('shows bottom bar when changes are made', async () => { + const wrapper = mount( + <RiskScoreConfigurationSection {...defaultProps} includeClosedAlerts={false} /> + ); + wrapper.find(EuiSwitch).simulate('click'); + wrapper.find(EuiSuperDatePicker).props().onTimeChange({ start: 'now-14m', end: 'now' }); + wrapper.update(); + await new Promise((resolve) => setTimeout(resolve, 0)); // wait for the component to update + expect(wrapper.find('EuiBottomBar').exists()).toBe(true); + }); + + it('saves changes', () => { + const wrapper = mount( + <RiskScoreConfigurationSection {...defaultProps} includeClosedAlerts={true} /> + ); + + // Simulate clicking the switch + const closedAlertsToggle = wrapper.find('button[data-test-subj="includeClosedAlertsSwitch"]'); + expect(closedAlertsToggle.exists()).toBe(true); + closedAlertsToggle.simulate('click'); + + wrapper.update(); + + const saveChangesButton = wrapper.find('button[data-test-subj="riskScoreSaveButton"]'); + expect(saveChangesButton.exists()).toBe(true); + saveChangesButton.simulate('click'); + const callArgs = mockMutate.mock.calls[0][0]; + expect(callArgs).toEqual({ + includeClosedAlerts: true, + range: { start: 'now-30m', end: 'now' }, + }); + }); + + it('shows success toast on save', () => { + const wrapper = mount( + <RiskScoreConfigurationSection {...defaultProps} includeClosedAlerts={true} /> + ); + + act(() => { + wrapper.find('button[data-test-subj="includeClosedAlertsSwitch"]').simulate('click'); + }); + wrapper.update(); + + act(() => { + wrapper.find('button[data-test-subj="riskScoreSaveButton"]').simulate('click'); + }); + + act(() => { + mockMutate.mock.calls[0][1].onSuccess(); + }); + + expect(mockAddSuccess).toHaveBeenCalledWith( + i18n.RISK_ENGINE_SAVED_OBJECT_CONFIGURATION_SUCCESS, + { + toastLifeTimeMs: 5000, + } + ); + }); +}); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx new file mode 100644 index 000000000000..fa0f33e5b604 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_configuration_section.tsx @@ -0,0 +1,199 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React, { useState, useEffect, useRef } from 'react'; +import { + EuiSuperDatePicker, + EuiButton, + EuiText, + EuiFlexGroup, + EuiSwitch, + EuiFlexItem, + EuiBottomBar, + EuiButtonEmpty, + EuiSpacer, + useEuiTheme, +} from '@elastic/eui'; +import useLocalStorage from 'react-use/lib/useLocalStorage'; +import { useAppToasts } from '../../common/hooks/use_app_toasts'; +import * as i18n from '../translations'; +import { useConfigureSORiskEngineMutation } from '../api/hooks/use_configure_risk_engine_saved_object'; +import { getEntityAnalyticsRiskScorePageStyles } from './risk_score_page_styles'; + +export const RiskScoreConfigurationSection = ({ + includeClosedAlerts, + setIncludeClosedAlerts, + from, + to, + onDateChange, +}: { + includeClosedAlerts: boolean; + setIncludeClosedAlerts: (value: boolean) => void; + from: string; + to: string; + onDateChange: ({ start, end }: { start: string; end: string }) => void; +}) => { + const { euiTheme } = useEuiTheme(); + const styles = getEntityAnalyticsRiskScorePageStyles(euiTheme); + const [start, setFrom] = useState(from); + const [end, setTo] = useState(to); + const [isLoading, setIsLoading] = useState(false); + const [showBar, setShowBar] = useState(false); + const { addSuccess } = useAppToasts(); + const initialIncludeClosedAlerts = useRef(includeClosedAlerts); + const initialStart = useRef(from); + const initialEnd = useRef(to); + + const [savedIncludeClosedAlerts, setSavedIncludeClosedAlerts] = useLocalStorage( + 'includeClosedAlerts', + includeClosedAlerts ?? false + ); + const [savedStart, setSavedStart] = useLocalStorage( + 'entityAnalytics:riskScoreConfiguration:fromDate', + from + ); + const [savedEnd, setSavedEnd] = useLocalStorage( + 'entityAnalytics:riskScoreConfiguration:toDate', + to + ); + + useEffect(() => { + if (savedIncludeClosedAlerts !== null && savedIncludeClosedAlerts !== undefined) { + initialIncludeClosedAlerts.current = savedIncludeClosedAlerts; + setIncludeClosedAlerts(savedIncludeClosedAlerts); + } + if (savedStart && savedEnd) { + initialStart.current = savedStart; + initialEnd.current = savedEnd; + setFrom(savedStart); + setTo(savedEnd); + } + }, [savedIncludeClosedAlerts, savedStart, savedEnd, setIncludeClosedAlerts]); + + const onRefresh = ({ start: newStart, end: newEnd }: { start: string; end: string }) => { + setFrom(newStart); + setTo(newEnd); + onDateChange({ start: newStart, end: newEnd }); + checkForChanges(newStart, newEnd, includeClosedAlerts); + }; + + const handleToggle = () => { + const newValue = !includeClosedAlerts; + setIncludeClosedAlerts(newValue); + checkForChanges(start, end, newValue); + }; + + const checkForChanges = (newStart: string, newEnd: string, newIncludeClosedAlerts: boolean) => { + if ( + newStart !== initialStart.current || + newEnd !== initialEnd.current || + newIncludeClosedAlerts !== initialIncludeClosedAlerts.current + ) { + setShowBar(true); + } else { + setShowBar(false); + } + }; + + const { mutate } = useConfigureSORiskEngineMutation(); + + const handleSave = () => { + setIsLoading(true); + mutate( + { + includeClosedAlerts, + range: { start, end }, + }, + { + onSuccess: () => { + setShowBar(false); + addSuccess(i18n.RISK_ENGINE_SAVED_OBJECT_CONFIGURATION_SUCCESS, { + toastLifeTimeMs: 5000, + }); + setIsLoading(false); + + initialStart.current = start; + initialEnd.current = end; + initialIncludeClosedAlerts.current = includeClosedAlerts; + + setSavedIncludeClosedAlerts(includeClosedAlerts); + setSavedStart(start); + setSavedEnd(end); + }, + onError: () => { + setIsLoading(false); + }, + } + ); + }; + + return ( + <> + <EuiFlexGroup alignItems="center"> + <div> + <EuiSwitch + label={i18n.INCLUDE_CLOSED_ALERTS_LABEL} + checked={includeClosedAlerts} + onChange={handleToggle} + data-test-subj="includeClosedAlertsSwitch" + /> + </div> + <styles.VerticalSeparator /> + <div> + <EuiSuperDatePicker + start={start} + end={end} + onTimeChange={onRefresh} + width={'auto'} + compressed={false} + showUpdateButton={false} + /> + </div> + </EuiFlexGroup> + <EuiSpacer size="m" /> + <EuiText size="s"> + <p>{i18n.RISK_ENGINE_INCLUDE_CLOSED_ALERTS_DESCRIPTION}</p> + </EuiText> + {showBar && ( + <EuiBottomBar paddingSize="s" position="fixed"> + <EuiFlexGroup justifyContent="spaceBetween"> + <EuiFlexGroup gutterSize="s" justifyContent="flexEnd"> + <EuiFlexItem grow={false}> + <EuiButtonEmpty + color="text" + size="s" + iconType="cross" + onClick={() => { + setShowBar(false); + setFrom(initialStart.current); + setTo(initialEnd.current); + setIncludeClosedAlerts(initialIncludeClosedAlerts.current); + }} + > + {i18n.DISCARD_CHANGES} + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButton + color="primary" + fill + size="s" + iconType="check" + onClick={handleSave} + isLoading={isLoading} + data-test-subj="riskScoreSaveButton" + > + {i18n.SAVE_CHANGES} + </EuiButton> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexGroup> + </EuiBottomBar> + )} + </> + ); +}; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx index 63ff39ebca7d..547ee0235e77 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_enable_section.tsx @@ -10,11 +10,8 @@ import { EuiFlexGroup, EuiFlexItem, EuiHealth, - EuiHorizontalRule, - EuiLink, EuiSpacer, EuiSwitch, - EuiTitle, EuiLoadingSpinner, EuiBadge, EuiButtonEmpty, @@ -28,8 +25,6 @@ import { EuiCallOut, EuiAccordion, } from '@elastic/eui'; -import { LinkAnchor } from '@kbn/security-solution-navigation/links'; -import { SecurityPageName } from '@kbn/security-solution-navigation'; import type { RiskEngineStatus } from '../../../common/api/entity_analytics/risk_engine/engine_status_route.gen'; import { RiskEngineStatusEnum } from '../../../common/api/entity_analytics/risk_engine/engine_status_route.gen'; import * as i18n from '../translations'; @@ -38,8 +33,6 @@ import { useInitRiskEngineMutation } from '../api/hooks/use_init_risk_engine_mut import { useEnableRiskEngineMutation } from '../api/hooks/use_enable_risk_engine_mutation'; import { useDisableRiskEngineMutation } from '../api/hooks/use_disable_risk_engine_mutation'; import { useAppToasts } from '../../common/hooks/use_app_toasts'; -import { RiskInformationFlyout } from './risk_information'; -import { useOnOpenCloseHandler } from '../../helper_hooks'; import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges'; const MIN_WIDTH_TO_PREVENT_LABEL_FROM_MOVING = '50px'; @@ -144,12 +137,12 @@ const RiskEngineHealth: React.FC<{ currentRiskEngineStatus?: RiskEngineStatus | currentRiskEngineStatus, }) => { if (!currentRiskEngineStatus) { - return <EuiHealth color="subdued">{'-'}</EuiHealth>; + return <EuiHealth color="danger">{'-'}</EuiHealth>; } if (currentRiskEngineStatus === RiskEngineStatusEnum.ENABLED) { return <EuiHealth color="success">{i18n.RISK_SCORE_MODULE_STATUS_ON}</EuiHealth>; } - return <EuiHealth color="subdued">{i18n.RISK_SCORE_MODULE_STATUS_OFF}</EuiHealth>; + return <EuiHealth color="danger">{i18n.RISK_SCORE_MODULE_STATUS_OFF}</EuiHealth>; }; const RiskEngineStatusRow: React.FC<{ @@ -181,7 +174,6 @@ const RiskEngineStatusRow: React.FC<{ data-test-subj="risk-score-switch" checked={currentRiskEngineStatus === RiskEngineStatusEnum.ENABLED} onChange={onSwitchClick} - compressed disabled={btnIsDisabled} aria-describedby={'switchRiskModule'} /> @@ -221,8 +213,6 @@ export const RiskScoreEnableSection: React.FC<{ const closeModal = () => setIsModalVisible(false); const showModal = () => setIsModalVisible(true); - const [isFlyoutVisible, handleOnOpen, handleOnClose] = useOnOpenCloseHandler(); - const isLoading = initRiskEngineMutation.isLoading || enableRiskEngineMutation.isLoading || @@ -254,9 +244,6 @@ export const RiskScoreEnableSection: React.FC<{ return ( <> <> - <EuiTitle> - <h2>{i18n.RISK_SCORE_MODULE_STATUS}</h2> - </EuiTitle> {initRiskEngineMutation.isError && <RiskScoreErrorPanel errors={initRiskEngineErrors} />} {disableRiskEngineMutation.isError && ( <RiskScoreErrorPanel errors={[disableRiskEngineMutation.error.body.message]} /> @@ -273,12 +260,10 @@ export const RiskScoreEnableSection: React.FC<{ isLoading={initRiskEngineMutation.isLoading} closeModal={closeModal} /> - <EuiHorizontalRule margin="s" /> <EuiFlexGroup justifyContent="spaceBetween" alignItems="center"> <EuiFlexItem grow={false}> <EuiFlexGroup gutterSize="s" alignItems={'baseline'}> - {i18n.ENTITY_RISK_SCORING} {isUpdateAvailable && <EuiBadge color="success">{i18n.UPDATE_AVAILABLE}</EuiBadge>} </EuiFlexGroup> </EuiFlexItem> @@ -310,29 +295,9 @@ export const RiskScoreEnableSection: React.FC<{ )} </EuiFlexItem> </EuiFlexGroup> - <EuiHorizontalRule margin="s" /> </EuiFlexItem> </> <EuiSpacer /> - <> - <EuiTitle> - <h2>{i18n.USEFUL_LINKS}</h2> - </EuiTitle> - <EuiSpacer /> - <ul> - <li> - <LinkAnchor id={SecurityPageName.entityAnalytics}>{i18n.EA_DASHBOARD_LINK}</LinkAnchor> - <EuiSpacer size="s" /> - </li> - <li> - <EuiLink onClick={handleOnOpen} data-test-subj="open-risk-information-flyout-trigger"> - {i18n.EA_DOCS_ENTITY_RISK_SCORE} - </EuiLink> - {isFlyoutVisible && <RiskInformationFlyout handleOnClose={handleOnClose} />} - <EuiSpacer size="s" /> - </li> - </ul> - </> </> ); }; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.tsx new file mode 100644 index 000000000000..ea3bae7e8718 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_page_styles.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 styled from '@emotion/styled'; +import type { EuiThemeComputed } from '@elastic/eui'; +interface EntityAnalyticsRiskScorePageStyles { + VerticalSeparator: ReturnType<typeof styled.div>; +} + +export const getEntityAnalyticsRiskScorePageStyles = ( + euiTheme: EuiThemeComputed +): EntityAnalyticsRiskScorePageStyles => ({ + VerticalSeparator: styled.div` + :before { + content: ''; + height: ${euiTheme.size.l}; + border-left: ${euiTheme.border.width.thin} solid ${euiTheme.colors.lightShade}; + } + `, +}); diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx index 9693bf13589a..f818eaf429cd 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_preview_section.tsx @@ -5,11 +5,9 @@ * 2.0. */ -import React, { useState, useCallback, useMemo, useEffect } from 'react'; -import type { DataView } from '@kbn/data-views-plugin/public'; +import React, { useState, useMemo } from 'react'; import { EuiAccordion, - EuiFormRow, EuiPanel, EuiSpacer, EuiTitle, @@ -22,8 +20,7 @@ import { EuiFlexItem, EuiCode, } from '@elastic/eui'; -import type { BoolQuery, TimeRange, Query } from '@kbn/es-query'; -import { buildEsQuery } from '@kbn/es-query'; +import type { BoolQuery } from '@kbn/es-query'; import { FormattedMessage } from '@kbn/i18n-react'; import type { EntityRiskScoreRecord } from '../../../common/api/entity_analytics/common'; import { @@ -33,10 +30,8 @@ import { import { RiskScorePreviewTable } from './risk_score_preview_table'; import * as i18n from '../translations'; import { useRiskScorePreview } from '../api/hooks/use_preview_risk_scores'; -import { useKibana } from '../../common/lib/kibana'; import { SourcererScopeName } from '../../sourcerer/store/model'; import { useSourcererDataView } from '../../sourcerer/containers'; -import { useAppToasts } from '../../common/hooks/use_app_toasts'; import type { RiskEngineMissingPrivilegesResponse } from '../hooks/use_missing_risk_engine_privileges'; import { userHasRiskEngineReadPermissions } from '../common'; interface IRiskScorePreviewPanel { @@ -55,7 +50,10 @@ const getRiskiestScores = (scores: EntityRiskScoreRecord[] = [], field: string) export const RiskScorePreviewSection: React.FC<{ privileges: RiskEngineMissingPrivilegesResponse; -}> = ({ privileges }) => { + includeClosedAlerts: boolean; + from: string; + to: string; +}> = ({ privileges, includeClosedAlerts, from, to }) => { const sectionBody = useMemo(() => { if (privileges.isLoading) { return ( @@ -67,11 +65,11 @@ export const RiskScorePreviewSection: React.FC<{ ); } if (userHasRiskEngineReadPermissions(privileges)) { - return <RiskEnginePreview />; + return <RiskEnginePreview includeClosedAlerts={includeClosedAlerts} from={from} to={to} />; } return <MissingPermissionsCallout />; - }, [privileges]); + }, [privileges, includeClosedAlerts, from, to]); return ( <> @@ -138,65 +136,30 @@ const RiskScorePreviewPanel = ({ ); }; -const RiskEnginePreview = () => { - const [dateRange, setDateRange] = useState<{ from: string; to: string }>({ - from: 'now-24h', - to: 'now', - }); - - const [filters, setFilters] = useState<{ bool: BoolQuery }>({ +const RiskEnginePreview: React.FC<{ includeClosedAlerts: boolean; from: string; to: string }> = ({ + includeClosedAlerts, + from, + to, +}) => { + const [filters] = useState<{ bool: BoolQuery }>({ bool: { must: [], filter: [], should: [], must_not: [] }, }); - const [dataViewsArray, setDataViewsArray] = useState<DataView[]>([]); - - const { - unifiedSearch: { - ui: { SearchBar }, - }, - dataViews, - } = useKibana().services; - - const { addError } = useAppToasts(); - const { sourcererDataView } = useSourcererDataView(SourcererScopeName.detections); const { data, isLoading, refetch, isError } = useRiskScorePreview({ data_view_id: sourcererDataView.title, filter: filters, range: { - start: dateRange.from, - end: dateRange.to, + start: from, + end: to, }, + exclude_alert_statuses: includeClosedAlerts ? [] : ['closed'], }); const hosts = getRiskiestScores(data?.scores.host, 'host.name'); const users = getRiskiestScores(data?.scores.user, 'user.name'); - const onQuerySubmit = useCallback( - (payload: { dateRange: TimeRange; query?: Query }) => { - setDateRange({ - from: payload.dateRange.from, - to: payload.dateRange.to, - }); - try { - const newFilters = buildEsQuery( - undefined, - payload.query ?? { query: '', language: 'kuery' }, - [] - ); - setFilters(newFilters); - } catch (e) { - addError(e, { title: i18n.PREVIEW_QUERY_ERROR_TITLE }); - } - }, - [addError, setDateRange, setFilters] - ); - - useEffect(() => { - dataViews.create(sourcererDataView).then((dataView) => setDataViewsArray([dataView])); - }, [dataViews, sourcererDataView]); - if (isError) { return ( <EuiCallOut @@ -220,23 +183,8 @@ const RiskEnginePreview = () => { return ( <> <EuiText>{i18n.PREVIEW_DESCRIPTION}</EuiText> - <EuiSpacer /> - <EuiFormRow fullWidth data-test-subj="risk-score-preview-search-bar"> - <SearchBar - appName="siem" - isLoading={isLoading} - indexPatterns={dataViewsArray} - dateRangeFrom={dateRange.from} - dateRangeTo={dateRange.to} - onQuerySubmit={onQuerySubmit} - showFilterBar={false} - showDatePicker={true} - displayStyle={'inPage'} - submitButtonStyle={'iconOnly'} - dataTestSubj="risk-score-preview-search-bar-input" - /> - </EuiFormRow> + <EuiSpacer /> <EuiSpacer /> <RiskScorePreviewPanel diff --git a/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.tsx new file mode 100644 index 000000000000..d03dea2679c2 --- /dev/null +++ b/x-pack/plugins/security_solution/public/entity_analytics/components/risk_score_useful_links_section.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 React, { useState } from 'react'; +import { EuiLink, EuiSpacer, EuiTitle } from '@elastic/eui'; +import { LinkAnchor } from '@kbn/security-solution-navigation/links'; +import { SecurityPageName } from '@kbn/security-solution-navigation'; +import styled from '@emotion/styled'; +import { euiThemeVars } from '@kbn/ui-theme'; +import * as i18n from '../translations'; +import { RiskInformationFlyout } from './risk_information'; + +const StyledList = styled.ul` + list-style-type: disc; + padding-left: ${euiThemeVars.euiSizeM}; +`; + +export const RiskScoreUsefulLinksSection = () => { + const [isFlyoutVisible, setIsFlyoutVisible] = useState(false); + + const handleOnOpen = () => setIsFlyoutVisible(true); + const handleOnClose = () => setIsFlyoutVisible(false); + + return ( + <> + <EuiTitle> + <h2>{i18n.USEFUL_LINKS}</h2> + </EuiTitle> + <EuiSpacer /> + <StyledList> + <li> + <LinkAnchor id={SecurityPageName.entityAnalytics}>{i18n.EA_DASHBOARD_LINK}</LinkAnchor> + <EuiSpacer size="s" /> + </li> + <li> + <EuiLink onClick={handleOnOpen} data-test-subj="open-risk-information-flyout-trigger"> + {i18n.EA_DOCS_ENTITY_RISK_SCORE} + </EuiLink> + {isFlyoutVisible && <RiskInformationFlyout handleOnClose={handleOnClose} />} + <EuiSpacer size="s" /> + </li> + </StyledList> + </> + ); +}; diff --git a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx b/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx index ac9dfd9eb8ab..84ce908d94ee 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx +++ b/x-pack/plugins/security_solution/public/entity_analytics/pages/entity_analytics_management_page.tsx @@ -5,38 +5,164 @@ * 2.0. */ -import React from 'react'; -import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem, EuiPageHeader, EuiSpacer } from '@elastic/eui'; - +import React, { useState, useCallback } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiPageHeader, + EuiHorizontalRule, + EuiButton, + EuiText, + useEuiTheme, +} from '@elastic/eui'; +import moment from 'moment'; import { RiskScorePreviewSection } from '../components/risk_score_preview_section'; import { RiskScoreEnableSection } from '../components/risk_score_enable_section'; import { ENTITY_ANALYTICS_RISK_SCORE } from '../../app/translations'; -import { BETA } from '../../common/translations'; import { RiskEnginePrivilegesCallOut } from '../components/risk_engine_privileges_callout'; import { useMissingRiskEnginePrivileges } from '../hooks/use_missing_risk_engine_privileges'; +import { RiskScoreUsefulLinksSection } from '../components/risk_score_useful_links_section'; +import { RiskScoreConfigurationSection } from '../components/risk_score_configuration_section'; +import { useRiskEngineStatus } from '../api/hooks/use_risk_engine_status'; +import { useScheduleNowRiskEngineMutation } from '../api/hooks/use_schedule_now_risk_engine_mutation'; +import { useAppToasts } from '../../common/hooks/use_app_toasts'; +import * as i18n from '../translations'; +import { getEntityAnalyticsRiskScorePageStyles } from '../components/risk_score_page_styles'; + +const TEN_SECONDS = 10000; export const EntityAnalyticsManagementPage = () => { + const { euiTheme } = useEuiTheme(); + const styles = getEntityAnalyticsRiskScorePageStyles(euiTheme); const privileges = useMissingRiskEnginePrivileges(); + const [includeClosedAlerts, setIncludeClosedAlerts] = useState(false); + const [from, setFrom] = useState(localStorage.getItem('dateStart') || 'now-30m'); + const [to, setTo] = useState(localStorage.getItem('dateEnd') || 'now'); + const { data: riskEngineStatus } = useRiskEngineStatus({ + refetchInterval: TEN_SECONDS, + structuralSharing: false, // Force the component to rerender after every Risk Engine Status API call + }); + const currentRiskEngineStatus = riskEngineStatus?.risk_engine_status; + const runEngineEnabled = currentRiskEngineStatus === 'ENABLED'; + const [isLoading, setIsLoading] = useState(false); + const { mutate: scheduleNowRiskEngine } = useScheduleNowRiskEngineMutation(); + const { addSuccess, addError } = useAppToasts(); + + const handleRunEngineClick = async () => { + setIsLoading(true); + try { + scheduleNowRiskEngine(); + + if (!isLoading) { + addSuccess(i18n.RISK_SCORE_ENGINE_RUN_SUCCESS, { toastLifeTimeMs: 5000 }); + } + } catch (error) { + addError(error, { + title: i18n.RISK_SCORE_ENGINE_RUN_FAILURE, + }); + } finally { + setIsLoading(false); + } + }; + + const handleIncludeClosedAlertsToggle = useCallback( + (value: boolean) => { + setIncludeClosedAlerts(value); + }, + [setIncludeClosedAlerts] + ); + + const handleDateChange = ({ start, end }: { start: string; end: string }) => { + setFrom(start); + setTo(end); + localStorage.setItem('dateStart', start); + localStorage.setItem('dateEnd', end); + }; + + const { status, runAt } = riskEngineStatus?.risk_engine_task_status || {}; + + const isRunning = status === 'running' || (!!runAt && new Date(runAt) < new Date()); + + const formatTimeFromNow = (time: string | undefined): string => { + if (!time) { + return ''; + } + return i18n.RISK_ENGINE_NEXT_RUN_TIME(moment(time).fromNow(true)); + }; + + const countDownText = isRunning + ? 'Now running' + : formatTimeFromNow(riskEngineStatus?.risk_engine_task_status?.runAt); + return ( <> <RiskEnginePrivilegesCallOut privileges={privileges} /> <EuiPageHeader pageTitle={ - <EuiFlexGroup> + <EuiFlexGroup alignItems="center" justifyContent="spaceBetween"> + {/* Page Title */} <EuiFlexItem data-test-subj="entityAnalyticsManagementPageTitle" grow={false}> {ENTITY_ANALYTICS_RISK_SCORE} </EuiFlexItem> - <EuiBetaBadge label={BETA} size="s" /> + + {/* Controls Section */} + <EuiFlexItem grow={false}> + <EuiFlexGroup alignItems="center" gutterSize="m"> + {/* Run Engine Section */} + {runEngineEnabled && ( + <> + {/* Run Engine Button */} + <EuiButton + size="s" + iconType="play" + isLoading={isLoading} + onClick={handleRunEngineClick} + > + {i18n.RUN_RISK_SCORE_ENGINE} + </EuiButton> + + {/* Vertical Line */} + <styles.VerticalSeparator /> + + {/* Countdown Text */} + <div> + <EuiText size="s" color="subdued"> + {countDownText} + </EuiText> + </div> + </> + )} + + {/* Risk Score Enable Section */} + <div> + <RiskScoreEnableSection privileges={privileges} /> + </div> + </EuiFlexGroup> + </EuiFlexItem> </EuiFlexGroup> } /> - <EuiSpacer size="l" /> - <EuiFlexGroup gutterSize="xl"> + + <EuiHorizontalRule /> + <EuiFlexGroup gutterSize="xl" alignItems="flexStart"> <EuiFlexItem grow={2}> - <RiskScoreEnableSection privileges={privileges} /> + <RiskScoreConfigurationSection + includeClosedAlerts={includeClosedAlerts} + setIncludeClosedAlerts={handleIncludeClosedAlertsToggle} + from={from} + to={to} + onDateChange={handleDateChange} + /> + <EuiHorizontalRule /> + <RiskScoreUsefulLinksSection /> </EuiFlexItem> <EuiFlexItem grow={2}> - <RiskScorePreviewSection privileges={privileges} /> + <RiskScorePreviewSection + privileges={privileges} + includeClosedAlerts={includeClosedAlerts} + from={from} + to={to} + /> </EuiFlexItem> </EuiFlexGroup> </> diff --git a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts index 2e06ec9ad1eb..5d75b8f795d5 100644 --- a/x-pack/plugins/security_solution/public/entity_analytics/translations.ts +++ b/x-pack/plugins/security_solution/public/entity_analytics/translations.ts @@ -302,3 +302,64 @@ export const RISK_SCORE_MODULE_TURNED_OFF = i18n.translate( defaultMessage: 'Entity risk score has been turned off', } ); + +export const RISK_SCORE_ENGINE_RUN_SUCCESS = i18n.translate( + 'xpack.securitySolution.riskScore.engineRunSuccess', + { + defaultMessage: 'Entity risk score engine started successfully', + } +); + +export const RISK_ENGINE_SAVED_OBJECT_CONFIGURATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.riskScore.savedObject.configurationSuccess', + { + defaultMessage: 'Risk engine Saved Object configuration updated successfully', + } +); + +export const INCLUDE_CLOSED_ALERTS_LABEL = i18n.translate( + 'xpack.securitySolution.riskScore.includeClosedAlertsLabel', + { + defaultMessage: 'Include closed alerts for risk scoring', + } +); + +export const RISK_ENGINE_INCLUDE_CLOSED_ALERTS_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.riskScore.includeClosedAlertsDescription', + { + defaultMessage: `Enable this option to factor both open and closed alerts into the risk engine + calculations. Including closed alerts helps provide a more comprehensive risk assessment + based on past incidents, leading to more accurate scoring and insights.`, + } +); + +export const RISK_ENGINE_NEXT_RUN_TIME = (timeInMinutes: string) => + i18n.translate('xpack.securitySolution.riskScore.engineNextRunTime', { + defaultMessage: `Next engine run in {timeInMinutes}`, + values: { timeInMinutes }, + }); + +export const RUN_RISK_SCORE_ENGINE = i18n.translate('xpack.securitySolution.riskScore.runEngine', { + defaultMessage: 'Run Engine', +}); + +export const SAVE_CHANGES = i18n.translate( + 'xpack.securitySolution.riskScore.engineSavedObjectsaveChanges', + { + defaultMessage: 'Save', + } +); + +export const DISCARD_CHANGES = i18n.translate( + 'xpack.securitySolution.riskScore.engineSavedObject.discardChanges', + { + defaultMessage: 'Discard', + } +); + +export const RISK_SCORE_ENGINE_RUN_FAILURE = i18n.translate( + 'xpack.securitySolution.riskScore.engineRunSuccess', + { + defaultMessage: 'Entity risk score engine failed to start', + } +); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.tsx new file mode 100644 index 000000000000..96374b81e18d --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/graph_visualization.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, { memo } from 'react'; +import { css } from '@emotion/css'; +import { EuiLoadingSpinner } from '@elastic/eui'; +import { useGetScopedSourcererDataView } from '../../../../sourcerer/components/use_get_sourcerer_data_view'; +import { SourcererScopeName } from '../../../../sourcerer/store/model'; +import { useDocumentDetailsContext } from '../../shared/context'; +import { GRAPH_VISUALIZATION_TEST_ID } from './test_ids'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; + +const GraphInvestigationLazy = React.lazy(() => + import('@kbn/cloud-security-posture-graph').then((module) => ({ + default: module.GraphInvestigation, + })) +); + +export const GRAPH_ID = 'graph-visualization' as const; + +/** + * Graph visualization view displayed in the document details expandable flyout left section under the Visualize tab + */ +export const GraphVisualization: React.FC = memo(() => { + const dataView = useGetScopedSourcererDataView({ + sourcererScope: SourcererScopeName.default, + }); + const { getFieldsData, dataAsNestedObject } = useDocumentDetailsContext(); + const { eventIds, timestamp } = useGraphPreview({ + getFieldsData, + ecsData: dataAsNestedObject, + }); + + return ( + <div + data-test-subj={GRAPH_VISUALIZATION_TEST_ID} + css={css` + height: calc(100vh - 250px); + min-height: 400px; + width: 100%; + `} + > + {dataView && ( + <React.Suspense fallback={<EuiLoadingSpinner />}> + <GraphInvestigationLazy dataView={dataView} eventIds={eventIds} timestamp={timestamp} /> + </React.Suspense> + )} + </div> + ); +}); + +GraphVisualization.displayName = 'GraphVisualization'; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx index a5b2307dd9ca..e08a79466522 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.test.tsx @@ -39,7 +39,7 @@ import { HostPreviewPanelKey } from '../../../entity_details/host_right'; import { HOST_PREVIEW_BANNER } from '../../right/components/host_entity_overview'; import { UserPreviewPanelKey } from '../../../entity_details/user_right'; import { USER_PREVIEW_BANNER } from '../../right/components/user_entity_overview'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; import { useAlertsByStatus } from '../../../../overview/components/detection_response/alerts_by_status/use_alerts_by_status'; jest.mock('@kbn/expandable-flyout'); @@ -313,10 +313,11 @@ describe('<HostDetails />', () => { getAllByTestId(HOST_DETAILS_RELATED_USERS_IP_LINK_TEST_ID)[0].click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: '100.XXX.XXX', flowTarget: 'source', + scopeId: defaultProps.scopeId, banner: NETWORK_PREVIEW_BANNER, }, }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts index 8669b504f686..6979fa9cfa05 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/test_ids.ts @@ -11,6 +11,7 @@ import { PREFIX } from '../../../shared/test_ids'; export const ANALYZER_GRAPH_TEST_ID = `${PREFIX}AnalyzerGraph` as const; export const SESSION_VIEW_TEST_ID = `${PREFIX}SessionView` as const; +export const GRAPH_VISUALIZATION_TEST_ID = `${PREFIX}GraphVisualization` as const; /* Insights tab */ diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx index 28389919dec8..5bfb8a7df50d 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.test.tsx @@ -37,7 +37,7 @@ import { HostPreviewPanelKey } from '../../../entity_details/host_right'; import { HOST_PREVIEW_BANNER } from '../../right/components/host_entity_overview'; import { UserPreviewPanelKey } from '../../../entity_details/user_right'; import { USER_PREVIEW_BANNER } from '../../right/components/user_entity_overview'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; import { useAlertsByStatus } from '../../../../overview/components/detection_response/alerts_by_status/use_alerts_by_status'; jest.mock('@kbn/expandable-flyout'); @@ -291,10 +291,11 @@ describe('<UserDetails />', () => { getAllByTestId(USER_DETAILS_RELATED_HOSTS_IP_LINK_TEST_ID)[0].click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: '100.XXX.XXX', flowTarget: 'source', + scopeId: defaultProps.scopeId, banner: NETWORK_PREVIEW_BANNER, }, }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts index eb64c91b2143..bc1ee586606d 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/test_ids.ts @@ -13,6 +13,8 @@ export const VISUALIZE_TAB_SESSION_VIEW_BUTTON_TEST_ID = `${VISUALIZE_TAB_TEST_ID}SessionViewButton` as const; export const VISUALIZE_TAB_GRAPH_ANALYZER_BUTTON_TEST_ID = `${VISUALIZE_TAB_TEST_ID}GraphAnalyzerButton` as const; +export const VISUALIZE_TAB_GRAPH_VISUALIZATION_BUTTON_TEST_ID = + `${VISUALIZE_TAB_TEST_ID}GraphVisualizationButton` as const; const INSIGHTS_TAB_TEST_ID = `${PREFIX}InsightsTab` as const; export const INSIGHTS_TAB_BUTTON_GROUP_TEST_ID = `${INSIGHTS_TAB_TEST_ID}ButtonGroup` as const; export const INSIGHTS_TAB_ENTITIES_BUTTON_TEST_ID = diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx index 0dad444ee6ec..89e00e06e3a4 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/left/tabs/visualize_tab.tsx @@ -11,12 +11,14 @@ import type { EuiButtonGroupOptionProps } from '@elastic/eui/src/components/butt import { useExpandableFlyoutApi, useExpandableFlyoutState } from '@kbn/expandable-flyout'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { useDocumentDetailsContext } from '../../shared/context'; import { useWhichFlyout } from '../../shared/hooks/use_which_flyout'; import { DocumentDetailsAnalyzerPanelKey } from '../../shared/constants/panel_keys'; import { VISUALIZE_TAB_BUTTON_GROUP_TEST_ID, VISUALIZE_TAB_GRAPH_ANALYZER_BUTTON_TEST_ID, + VISUALIZE_TAB_GRAPH_VISUALIZATION_BUTTON_TEST_ID, VISUALIZE_TAB_SESSION_VIEW_BUTTON_TEST_ID, } from './test_ids'; import { @@ -27,6 +29,9 @@ import { import { SESSION_VIEW_ID, SessionView } from '../components/session_view'; import { ALERTS_ACTIONS } from '../../../../common/lib/apm/user_actions'; import { useStartTransaction } from '../../../../common/lib/apm/use_start_transaction'; +import { GRAPH_ID, GraphVisualization } from '../components/graph_visualization'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; +import { GRAPH_VISUALIZATION_IN_FLYOUT_ENABLED_EXPERIMENTAL_FEATURE } from '../../shared/constants/experimental_features'; const visualizeButtons: EuiButtonGroupOptionProps[] = [ { @@ -51,11 +56,39 @@ const visualizeButtons: EuiButtonGroupOptionProps[] = [ }, ]; +const graphVisualizationButton: EuiButtonGroupOptionProps = { + id: GRAPH_ID, + iconType: 'beaker', + iconSide: 'right', + toolTipProps: { + title: ( + <FormattedMessage + id="xpack.securitySolution.flyout.left.visualize.graphVisualizationButton.technicalPreviewLabel" + defaultMessage="Technical Preview" + /> + ), + }, + toolTipContent: i18n.translate( + 'xpack.securitySolution.flyout.left.visualize.graphVisualizationButton.technicalPreviewTooltip', + { + defaultMessage: + 'This functionality is in technical preview and may be changed or removed completely 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.', + } + ), + label: ( + <FormattedMessage + id="xpack.securitySolution.flyout.left.visualize.graphVisualizationButtonLabel" + defaultMessage="Graph view" + /> + ), + 'data-test-subj': VISUALIZE_TAB_GRAPH_VISUALIZATION_BUTTON_TEST_ID, +}; + /** * Visualize view displayed in the document details expandable flyout left section */ export const VisualizeTab = memo(() => { - const { scopeId } = useDocumentDetailsContext(); + const { scopeId, getFieldsData, dataAsNestedObject } = useDocumentDetailsContext(); const { openPreviewPanel } = useExpandableFlyoutApi(); const panels = useExpandableFlyoutState(); const [activeVisualizationId, setActiveVisualizationId] = useState( @@ -86,6 +119,22 @@ export const VisualizeTab = memo(() => { } }, [panels.left?.path?.subTab]); + // Decide whether to show the graph preview or not + const { hasGraphRepresentation } = useGraphPreview({ + getFieldsData, + ecsData: dataAsNestedObject, + }); + + const isGraphFeatureEnabled = useIsExperimentalFeatureEnabled( + GRAPH_VISUALIZATION_IN_FLYOUT_ENABLED_EXPERIMENTAL_FEATURE + ); + + const options = [...visualizeButtons]; + + if (hasGraphRepresentation && isGraphFeatureEnabled) { + options.push(graphVisualizationButton); + } + return ( <> <EuiButtonGroup @@ -97,7 +146,7 @@ export const VisualizeTab = memo(() => { defaultMessage: 'Visualize options', } )} - options={visualizeButtons} + options={options} idSelected={activeVisualizationId} onChange={(id) => onChangeCompressed(id)} buttonSize="compressed" @@ -107,6 +156,7 @@ export const VisualizeTab = memo(() => { <EuiSpacer size="m" /> {activeVisualizationId === SESSION_VIEW_ID && <SessionView />} {activeVisualizationId === ANALYZE_GRAPH_ID && <AnalyzeGraph />} + {activeVisualizationId === GRAPH_ID && <GraphVisualization />} </> ); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx index 8a8293badb6a..b2d8e64c34b4 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.test.tsx @@ -83,9 +83,4 @@ describe('<AlertHeaderTitle />', () => { const { getByTestId } = renderHeader(mockContextValue); expect(getByTestId(NOTES_TITLE_TEST_ID)).toBeInTheDocument(); }); - - it('should render fall back values if document is not alert', () => { - const { getByTestId } = renderHeader({ ...mockContextValue, dataFormattedForFieldBrowser: [] }); - expect(getByTestId(HEADER_TEXT_TEST_ID)).toHaveTextContent('Document details'); - }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx index cc7ef1458583..529e3d43b605 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/alert_header_title.tsx @@ -8,7 +8,6 @@ import React, { memo, useCallback, useMemo } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiLink } from '@elastic/eui'; import { ALERT_WORKFLOW_ASSIGNEE_IDS } from '@kbn/rule-data-utils'; -import { i18n } from '@kbn/i18n'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { Notes } from './notes'; import { useRuleDetailsLink } from '../../shared/hooks/use_rule_details_link'; @@ -22,6 +21,7 @@ import { PreferenceFormattedDate } from '../../../../common/components/formatted import { FLYOUT_ALERT_HEADER_TITLE_TEST_ID, ALERT_SUMMARY_PANEL_TEST_ID } from './test_ids'; import { Assignees } from './assignees'; import { FlyoutTitle } from '../../../shared/components/flyout_title'; +import { getAlertTitle } from '../../shared/utils'; // minWidth for each block, allows to switch for a 1 row 4 blocks to 2 rows with 2 block each const blockStyles = { @@ -44,17 +44,15 @@ export const AlertHeaderTitle = memo(() => { 'securitySolutionNotesDisabled' ); - const { isAlert, ruleName, timestamp, ruleId } = useBasicDataFromDetailsData( - dataFormattedForFieldBrowser - ); - + const { ruleName, timestamp, ruleId } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser); + const title = useMemo(() => getAlertTitle({ ruleName }), [ruleName]); const href = useRuleDetailsLink({ ruleId: !isPreview ? ruleId : null }); const ruleTitle = useMemo( () => href ? ( <EuiLink href={href} target="_blank" external={false}> <FlyoutTitle - title={ruleName} + title={title} iconType={'warning'} isLink data-test-subj={FLYOUT_ALERT_HEADER_TITLE_TEST_ID} @@ -62,12 +60,12 @@ export const AlertHeaderTitle = memo(() => { </EuiLink> ) : ( <FlyoutTitle - title={ruleName} + title={title} iconType={'warning'} data-test-subj={FLYOUT_ALERT_HEADER_TITLE_TEST_ID} /> ), - [ruleName, href] + [title, href] ); const { refetch } = useRefetchByScope({ scopeId }); @@ -86,17 +84,7 @@ export const AlertHeaderTitle = memo(() => { <EuiSpacer size="m" /> {timestamp && <PreferenceFormattedDate value={new Date(timestamp)} />} <EuiSpacer size="xs" /> - {isAlert && ruleName ? ( - ruleTitle - ) : ( - <FlyoutTitle - title={i18n.translate('xpack.securitySolution.flyout.right.header.headerTitle', { - defaultMessage: 'Document details', - })} - iconType={'warning'} - data-test-subj={FLYOUT_ALERT_HEADER_TITLE_TEST_ID} - /> - )} + {ruleTitle} <EuiSpacer size="m" /> {securitySolutionNotesDisabled ? ( <EuiFlexGroup diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx index 953a2371ffa8..32e85b786f6d 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/event_header_title.tsx @@ -6,17 +6,14 @@ */ import React, { memo, useMemo } from 'react'; -import { startCase } from 'lodash'; import { EuiSpacer } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; import { FlyoutTitle } from '../../../shared/components/flyout_title'; import { DocumentSeverity } from './severity'; import { useBasicDataFromDetailsData } from '../../shared/hooks/use_basic_data_from_details_data'; import { useDocumentDetailsContext } from '../../shared/context'; import { PreferenceFormattedDate } from '../../../../common/components/formatted_date'; import { FLYOUT_EVENT_HEADER_TITLE_TEST_ID } from './test_ids'; -import { getField } from '../../shared/utils'; -import { EVENT_CATEGORY_TO_FIELD } from '../utils/event_utils'; +import { getField, getEventTitle } from '../../shared/utils'; /** * Event details flyout right section header @@ -28,31 +25,10 @@ export const EventHeaderTitle = memo(() => { const eventKind = getField(getFieldsData('event.kind')); const eventCategory = getField(getFieldsData('event.category')); - const title = useMemo(() => { - const defaultTitle = i18n.translate('xpack.securitySolution.flyout.right.title.eventTitle', { - defaultMessage: `Event details`, - }); - - if (eventKind === 'event' && eventCategory) { - const fieldName = EVENT_CATEGORY_TO_FIELD[eventCategory]; - return getField(getFieldsData(fieldName)) ?? defaultTitle; - } - - if (eventKind === 'alert') { - return i18n.translate('xpack.securitySolution.flyout.right.title.alertEventTitle', { - defaultMessage: 'External alert details', - }); - } - - return eventKind - ? i18n.translate('xpack.securitySolution.flyout.right.title.otherEventTitle', { - defaultMessage: '{eventKind} details', - values: { - eventKind: startCase(eventKind), - }, - }) - : defaultTitle; - }, [eventKind, getFieldsData, eventCategory]); + const title = useMemo( + () => getEventTitle({ eventKind, eventCategory, getFieldsData }), + [eventKind, eventCategory, getFieldsData] + ); return ( <> diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx index 22ac27eaa4e0..2142d19c8287 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.test.tsx @@ -36,10 +36,19 @@ describe('<GraphPreview />', () => { }); it('shows graph preview correctly when data is loaded', async () => { - const graphProps = { + const graphProps: GraphPreviewProps = { isLoading: false, isError: false, - data: { nodes: [], edges: [] }, + data: { + nodes: [ + { + id: '1', + color: 'primary', + shape: 'ellipse', + }, + ], + edges: [], + }, }; const { findByTestId } = renderGraphPreview(mockContextValue, graphProps); @@ -69,4 +78,15 @@ describe('<GraphPreview />', () => { expect(getByText(ERROR_MESSAGE)).toBeInTheDocument(); }); + + it('shows error message when data is empty', () => { + const graphProps = { + isLoading: false, + isError: false, + }; + + const { getByText } = renderGraphPreview(mockContextValue, graphProps); + + expect(getByText(ERROR_MESSAGE)).toBeInTheDocument(); + }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx index c3c6d65c7e98..dec3c40790ad 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React, { memo, useMemo } from 'react'; -import { EuiSkeletonText } from '@elastic/eui'; +import { EuiPanel, EuiSkeletonText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { css } from '@emotion/react'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -71,13 +71,19 @@ export const GraphPreview: React.FC<GraphPreviewProps> = memo( return isLoading ? ( <LoadingComponent /> - ) : isError ? ( + ) : isError || memoizedNodes.length === 0 ? ( <FormattedMessage id="xpack.securitySolution.flyout.right.visualizations.graphPreview.errorDescription" defaultMessage="An error is preventing this alert from being visualized." /> ) : ( - <React.Suspense fallback={<LoadingComponent />}> + <React.Suspense + fallback={ + <EuiPanel> + <LoadingComponent /> + </EuiPanel> + } + > <GraphLazy css={css` height: 300px; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx index ae907af316dc..c805f2a3c67a 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.test.tsx @@ -6,14 +6,14 @@ */ import { render } from '@testing-library/react'; +import { useFetchGraphData } from '@kbn/cloud-security-posture-graph/src/hooks'; import { TestProviders } from '../../../../common/mock'; import React from 'react'; import { DocumentDetailsContext } from '../../shared/context'; import { mockContextValue } from '../../shared/mocks/mock_context'; import { GraphPreviewContainer } from './graph_preview_container'; import { GRAPH_PREVIEW_TEST_ID } from './test_ids'; -import { useGraphPreview } from '../hooks/use_graph_preview'; -import { useFetchGraphData } from '../hooks/use_fetch_graph_data'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; import { EXPANDABLE_PANEL_CONTENT_TEST_ID, EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID, @@ -21,9 +21,25 @@ import { EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID, EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID, } from '../../../shared/components/test_ids'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -jest.mock('../hooks/use_graph_preview'); -jest.mock('../hooks/use_fetch_graph_data', () => ({ +const mockUseUiSetting = jest.fn().mockReturnValue([true]); +jest.mock('@kbn/kibana-react-plugin/public', () => { + const original = jest.requireActual('@kbn/kibana-react-plugin/public'); + return { + ...original, + useUiSetting$: () => mockUseUiSetting(), + }; +}); + +jest.mock('../../../../common/hooks/use_experimental_features', () => ({ + useIsExperimentalFeatureEnabled: jest.fn(), +})); + +const useIsExperimentalFeatureEnabledMock = useIsExperimentalFeatureEnabled as jest.Mock; + +jest.mock('../../shared/hooks/use_graph_preview'); +jest.mock('@kbn/cloud-security-posture-graph/src/hooks', () => ({ useFetchGraphData: jest.fn(), })); const mockUseFetchGraphData = useFetchGraphData as jest.Mock; @@ -43,16 +59,25 @@ const renderGraphPreview = (context = mockContextValue) => </TestProviders> ); +const DEFAULT_NODES = [ + { + id: '1', + color: 'primary', + shape: 'ellipse', + }, +]; + describe('<GraphPreviewContainer />', () => { beforeEach(() => { jest.clearAllMocks(); + useIsExperimentalFeatureEnabledMock.mockReturnValue(true); }); it('should render component and link in header', async () => { mockUseFetchGraphData.mockReturnValue({ isLoading: false, isError: false, - data: { nodes: [], edges: [] }, + data: { nodes: DEFAULT_NODES, edges: [] }, }); const timestamp = new Date().toISOString(); @@ -60,11 +85,64 @@ describe('<GraphPreviewContainer />', () => { (useGraphPreview as jest.Mock).mockReturnValue({ timestamp, eventIds: [], - isAuditLog: true, + hasGraphRepresentation: true, }); const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + eventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component and without link in header in preview panel', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ + ...mockContextValue, + isPreviewMode: true, + }); + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); expect( @@ -98,21 +176,159 @@ describe('<GraphPreviewContainer />', () => { }); }); - it('should not render when graph data is not available', () => { + it('should render component and without link in header in rule preview', async () => { + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview({ + ...mockContextValue, + isPreview: true, + }); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + eventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should render component and without link in header when expanding flyout feature is disabled', async () => { + mockUseUiSetting.mockReturnValue([false]); + mockUseFetchGraphData.mockReturnValue({ + isLoading: false, + isError: false, + data: { nodes: DEFAULT_NODES, edges: [] }, + }); + + const timestamp = new Date().toISOString(); + + (useGraphPreview as jest.Mock).mockReturnValue({ + timestamp, + eventIds: [], + hasGraphRepresentation: true, + }); + + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component + expect(await findByTestId(GRAPH_PREVIEW_TEST_ID)).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + eventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: true, + refetchOnWindowFocus: false, + }, + }); + }); + + it('should not render when graph data is not available', async () => { mockUseFetchGraphData.mockReturnValue({ isLoading: false, isError: false, data: undefined, }); + const timestamp = new Date().toISOString(); + (useGraphPreview as jest.Mock).mockReturnValue({ - isAuditLog: false, + timestamp, + eventIds: [], + hasGraphRepresentation: false, }); - const { queryByTestId } = renderGraphPreview(); + const { getByTestId, queryByTestId, findByTestId } = renderGraphPreview(); + // Using findByTestId to wait for the component to be rendered because it is a lazy loaded component expect( - queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + await findByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_HEADER_TITLE_LINK_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).not.toBeInTheDocument(); + expect( + queryByTestId(EXPANDABLE_PANEL_TOGGLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) ).not.toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_ICON_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_CONTENT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect( + getByTestId(EXPANDABLE_PANEL_HEADER_TITLE_TEXT_TEST_ID(GRAPH_PREVIEW_TEST_ID)) + ).toBeInTheDocument(); + expect(mockUseFetchGraphData).toHaveBeenCalled(); + expect(mockUseFetchGraphData.mock.calls[0][0]).toEqual({ + req: { + query: { + eventIds: [], + start: `${timestamp}||-30m`, + end: `${timestamp}||+30m`, + }, + }, + options: { + enabled: false, + refetchOnWindowFocus: false, + }, + }); }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx index 0b881b8f8d43..90a021877854 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/graph_preview_container.tsx @@ -7,23 +7,48 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; +import { EuiBetaBadge } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { useFetchGraphData } from '@kbn/cloud-security-posture-graph/src/hooks'; +import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; import { useDocumentDetailsContext } from '../../shared/context'; import { GRAPH_PREVIEW_TEST_ID } from './test_ids'; import { GraphPreview } from './graph_preview'; -import { useFetchGraphData } from '../hooks/use_fetch_graph_data'; -import { useGraphPreview } from '../hooks/use_graph_preview'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; +import { useNavigateToGraphVisualization } from '../../shared/hooks/use_navigate_to_graph_visualization'; import { ExpandablePanel } from '../../../shared/components/expandable_panel'; /** * Graph preview under Overview, Visualizations. It shows a graph representation of entities. */ export const GraphPreviewContainer: React.FC = () => { - const { dataAsNestedObject, getFieldsData } = useDocumentDetailsContext(); + const { + dataAsNestedObject, + getFieldsData, + eventId, + indexName, + scopeId, + isPreview, + isPreviewMode, + } = useDocumentDetailsContext(); + + const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( + ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING + ); + const allowFlyoutExpansion = visualizationInFlyoutEnabled && !isPreviewMode && !isPreview; + + const { navigateToGraphVisualization } = useNavigateToGraphVisualization({ + eventId, + indexName, + isFlyoutOpen: true, + scopeId, + }); const { eventIds, timestamp = new Date().toISOString(), - isAuditLog, + hasGraphRepresentation, } = useGraphPreview({ getFieldsData, ecsData: dataAsNestedObject, @@ -39,35 +64,64 @@ export const GraphPreviewContainer: React.FC = () => { }, }, options: { - enabled: isAuditLog, + enabled: hasGraphRepresentation, refetchOnWindowFocus: false, }, }); return ( - isAuditLog && ( - <ExpandablePanel - header={{ - title: ( - <FormattedMessage - id="xpack.securitySolution.flyout.right.visualizations.graphPreview.graphPreviewTitle" - defaultMessage="Graph preview" - /> - ), - iconType: 'indexMapping', - }} - data-test-subj={GRAPH_PREVIEW_TEST_ID} - content={ - !isLoading && !isError - ? { - paddingSize: 'none', + <ExpandablePanel + header={{ + title: ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.graphPreview.graphPreviewTitle" + defaultMessage="Graph preview" + /> + ), + headerContent: ( + <EuiBetaBadge + alignment="middle" + iconType="beaker" + data-test-subj="graphPreviewBetaBadge" + label={i18n.translate( + 'xpack.securitySolution.flyout.right.visualizations.graphPreview.technicalPreviewLabel', + { + defaultMessage: 'Technical Preview', + } + )} + tooltipContent={i18n.translate( + 'xpack.securitySolution.flyout.right.visualizations.graphPreview.technicalPreviewTooltip', + { + defaultMessage: + 'This functionality is in technical preview and may be changed or removed completely 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.', } - : undefined - } - > - <GraphPreview isLoading={isLoading} isError={isError} data={data} /> - </ExpandablePanel> - ) + )} + /> + ), + iconType: allowFlyoutExpansion ? 'arrowStart' : 'indexMapping', + ...(allowFlyoutExpansion && { + link: { + callback: navigateToGraphVisualization, + tooltip: ( + <FormattedMessage + id="xpack.securitySolution.flyout.right.visualizations.graphPreview.graphPreviewOpenGraphTooltip" + defaultMessage="Expand graph" + /> + ), + }, + }), + }} + data-test-subj={GRAPH_PREVIEW_TEST_ID} + content={ + !isLoading && !isError + ? { + paddingSize: 'none', + } + : undefined + } + > + <GraphPreview isLoading={isLoading} isError={isError} data={data} /> + </ExpandablePanel> ); }; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx index d819365da00b..ff003813f260 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/highlighted_fields_cell.test.tsx @@ -26,7 +26,7 @@ import { HostPreviewPanelKey } from '../../../entity_details/host_right'; import { HOST_PREVIEW_BANNER } from './host_entity_overview'; import { UserPreviewPanelKey } from '../../../entity_details/user_right'; import { USER_PREVIEW_BANNER } from './user_entity_overview'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; import { createTelemetryServiceMock } from '../../../../common/lib/telemetry/telemetry_service.mock'; jest.mock('../../../../management/hooks'); @@ -137,10 +137,11 @@ describe('<HighlightedFieldsCell />', () => { getByTestId(HIGHLIGHTED_FIELDS_LINKED_CELL_TEST_ID).click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: '100:XXX:XXX', flowTarget: 'source', + scopeId: panelContextValue.scopeId, banner: NETWORK_PREVIEW_BANNER, }, }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx index ee680f106162..eec53dbe3d26 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx @@ -14,7 +14,7 @@ import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import type { EventFieldsData } from '../../../../common/components/event_details/types'; import { TableFieldValueCell } from './table_field_value_cell'; import { TestProviders } from '../../../../common/mock'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../../network_details'; import { mockFlyoutApi } from '../../shared/mocks/mock_flyout_context'; import { FLYOUT_TABLE_PREVIEW_LINK_FIELD_TEST_ID } from './test_ids'; import { createTelemetryServiceMock } from '../../../../common/lib/telemetry/telemetry_service.mock'; @@ -217,10 +217,11 @@ describe('TableFieldValueCell', () => { screen.getByTestId(`${FLYOUT_TABLE_PREVIEW_LINK_FIELD_TEST_ID}-0`).click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: '127.0.0.1', flowTarget: 'source', + scopeId: 'scopeId', banner: NETWORK_PREVIEW_BANNER, }, }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx index 3aeb7d30f8e4..6fb4d5d30b89 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.test.tsx @@ -8,6 +8,7 @@ import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n-react'; import { render } from '@testing-library/react'; +import { useFetchGraphData } from '@kbn/cloud-security-posture-graph/src/hooks'; import { ANALYZER_PREVIEW_TEST_ID, SESSION_PREVIEW_TEST_ID, @@ -25,9 +26,8 @@ import { TestProvider } from '@kbn/expandable-flyout/src/test/provider'; import { useExpandSection } from '../hooks/use_expand_section'; import { useInvestigateInTimeline } from '../../../../detections/components/alerts_table/timeline_actions/use_investigate_in_timeline'; import { useIsInvestigateInResolverActionEnabled } from '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; -import { useGraphPreview } from '../hooks/use_graph_preview'; -import { useFetchGraphData } from '../hooks/use_fetch_graph_data'; jest.mock('../hooks/use_expand_section'); jest.mock('../../shared/hooks/use_alert_prevalence_from_process_tree', () => ({ @@ -53,6 +53,7 @@ jest.mock( jest.mock( '../../../../detections/components/alerts_table/timeline_actions/investigate_in_resolver' ); + jest.mock('../../../../common/hooks/use_experimental_features', () => ({ useIsExperimentalFeatureEnabled: jest.fn(), })); @@ -67,11 +68,11 @@ jest.mock('@kbn/kibana-react-plugin/public', () => { useUiSetting$: () => mockUseUiSetting(), }; }); -jest.mock('../hooks/use_graph_preview'); +jest.mock('../../shared/hooks/use_graph_preview'); const mockUseGraphPreview = useGraphPreview as jest.Mock; -jest.mock('../hooks/use_fetch_graph_data', () => ({ +jest.mock('@kbn/cloud-security-posture-graph/src/hooks', () => ({ useFetchGraphData: jest.fn(), })); @@ -95,6 +96,7 @@ const renderVisualizationsSection = (contextValue = panelContextValue) => describe('<VisualizationsSection />', () => { beforeEach(() => { + mockUseUiSetting.mockReturnValue([false]); mockUseTimelineDataFilters.mockReturnValue({ selectedPatterns: ['index'] }); mockUseAlertPrevalenceFromProcessTree.mockReturnValue({ loading: false, @@ -103,7 +105,7 @@ describe('<VisualizationsSection />', () => { statsNodes: undefined, }); mockUseGraphPreview.mockReturnValue({ - isAuditLog: true, + hasGraphRepresentation: true, }); mockUseFetchGraphData.mockReturnValue({ isLoading: false, @@ -136,6 +138,7 @@ describe('<VisualizationsSection />', () => { }); (useIsInvestigateInResolverActionEnabled as jest.Mock).mockReturnValue(true); (useExpandSection as jest.Mock).mockReturnValue(true); + mockUseUiSetting.mockReturnValue([false]); useIsExperimentalFeatureEnabledMock.mockReturnValue(false); const { getByTestId, queryByTestId } = renderVisualizationsSection(); @@ -148,10 +151,31 @@ describe('<VisualizationsSection />', () => { it('should render the graph preview component if the feature is enabled', () => { (useExpandSection as jest.Mock).mockReturnValue(true); + mockUseUiSetting.mockReturnValue([true]); useIsExperimentalFeatureEnabledMock.mockReturnValue(true); const { getByTestId } = renderVisualizationsSection(); expect(getByTestId(`${GRAPH_PREVIEW_TEST_ID}LeftSection`)).toBeInTheDocument(); }); + + it('should not render the graph preview component if the experimental feature is disabled', () => { + (useExpandSection as jest.Mock).mockReturnValue(true); + mockUseUiSetting.mockReturnValue([true]); + useIsExperimentalFeatureEnabledMock.mockReturnValue(false); + + const { queryByTestId } = renderVisualizationsSection(); + + expect(queryByTestId(`${GRAPH_PREVIEW_TEST_ID}LeftSection`)).not.toBeInTheDocument(); + }); + + it('should not render the graph preview component if the flyout feature is disabled', () => { + (useExpandSection as jest.Mock).mockReturnValue(true); + mockUseUiSetting.mockReturnValue([false]); + useIsExperimentalFeatureEnabledMock.mockReturnValue(true); + + const { queryByTestId } = renderVisualizationsSection(); + + expect(queryByTestId(`${GRAPH_PREVIEW_TEST_ID}LeftSection`)).not.toBeInTheDocument(); + }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx index c328036eece4..23bea1f8fecd 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/visualizations_section.tsx @@ -8,15 +8,18 @@ import React, { memo } from 'react'; import { EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; +import { useUiSetting$ } from '@kbn/kibana-react-plugin/public'; import { useExpandSection } from '../hooks/use_expand_section'; import { AnalyzerPreviewContainer } from './analyzer_preview_container'; import { SessionPreviewContainer } from './session_preview_container'; import { ExpandableSection } from './expandable_section'; import { VISUALIZATIONS_TEST_ID } from './test_ids'; import { GraphPreviewContainer } from './graph_preview_container'; -import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; import { useDocumentDetailsContext } from '../../shared/context'; -import { useGraphPreview } from '../hooks/use_graph_preview'; +import { useGraphPreview } from '../../shared/hooks/use_graph_preview'; +import { useIsExperimentalFeatureEnabled } from '../../../../common/hooks/use_experimental_features'; +import { ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING } from '../../../../../common/constants'; +import { GRAPH_VISUALIZATION_IN_FLYOUT_ENABLED_EXPERIMENTAL_FEATURE } from '../../shared/constants/experimental_features'; const KEY = 'visualizations'; @@ -25,18 +28,25 @@ const KEY = 'visualizations'; */ export const VisualizationsSection = memo(() => { const expanded = useExpandSection({ title: KEY, defaultValue: false }); - const graphVisualizationInFlyoutEnabled = useIsExperimentalFeatureEnabled( - 'graphVisualizationInFlyoutEnabled' + const { dataAsNestedObject, getFieldsData } = useDocumentDetailsContext(); + + const [visualizationInFlyoutEnabled] = useUiSetting$<boolean>( + ENABLE_VISUALIZATIONS_IN_FLYOUT_SETTING ); - const { dataAsNestedObject, getFieldsData } = useDocumentDetailsContext(); + const isGraphFeatureEnabled = useIsExperimentalFeatureEnabled( + GRAPH_VISUALIZATION_IN_FLYOUT_ENABLED_EXPERIMENTAL_FEATURE + ); // Decide whether to show the graph preview or not - const { isAuditLog: isGraphPreviewEnabled } = useGraphPreview({ + const { hasGraphRepresentation } = useGraphPreview({ getFieldsData, ecsData: dataAsNestedObject, }); + const shouldShowGraphPreview = + visualizationInFlyoutEnabled && isGraphFeatureEnabled && hasGraphRepresentation; + return ( <ExpandableSection expanded={expanded} @@ -52,7 +62,7 @@ export const VisualizationsSection = memo(() => { <SessionPreviewContainer /> <EuiSpacer /> <AnalyzerPreviewContainer /> - {graphVisualizationInFlyoutEnabled && isGraphPreviewEnabled && ( + {shouldShowGraphPreview && ( <> <EuiSpacer /> <GraphPreviewContainer /> diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.test.tsx deleted file mode 100644 index c22ec0caa82c..000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.test.tsx +++ /dev/null @@ -1,89 +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 { useFetchGraphData } from './use_fetch_graph_data'; - -const mockUseQuery = jest.fn(); - -jest.mock('@tanstack/react-query', () => { - return { - useQuery: (...args: unknown[]) => mockUseQuery(...args), - }; -}); - -describe('useFetchGraphData', () => { - beforeEach(() => { - jest.clearAllMocks(); - }); - - it('Should pass default options when options are not provided', () => { - renderHook(() => { - return useFetchGraphData({ - req: { - query: { - eventIds: [], - start: '2021-09-01T00:00:00.000Z', - end: '2021-09-01T23:59:59.999Z', - }, - }, - }); - }); - - expect(mockUseQuery.mock.calls).toHaveLength(1); - expect(mockUseQuery.mock.calls[0][2]).toEqual({ - enabled: true, - refetchOnWindowFocus: true, - }); - }); - - it('Should should not be enabled when enabled set to false', () => { - renderHook(() => { - return useFetchGraphData({ - req: { - query: { - eventIds: [], - start: '2021-09-01T00:00:00.000Z', - end: '2021-09-01T23:59:59.999Z', - }, - }, - options: { - enabled: false, - }, - }); - }); - - expect(mockUseQuery.mock.calls).toHaveLength(1); - expect(mockUseQuery.mock.calls[0][2]).toEqual({ - enabled: false, - refetchOnWindowFocus: true, - }); - }); - - it('Should should not be refetchOnWindowFocus when refetchOnWindowFocus set to false', () => { - renderHook(() => { - return useFetchGraphData({ - req: { - query: { - eventIds: [], - start: '2021-09-01T00:00:00.000Z', - end: '2021-09-01T23:59:59.999Z', - }, - }, - options: { - refetchOnWindowFocus: false, - }, - }); - }); - - expect(mockUseQuery.mock.calls).toHaveLength(1); - expect(mockUseQuery.mock.calls[0][2]).toEqual({ - enabled: true, - refetchOnWindowFocus: false, - }); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.ts deleted file mode 100644 index 9a0e270a9b2e..000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_fetch_graph_data.ts +++ /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 { useQuery } from '@tanstack/react-query'; -import type { - GraphRequest, - GraphResponse, -} from '@kbn/cloud-security-posture-common/types/graph/latest'; -import { useMemo } from 'react'; -import { EVENT_GRAPH_VISUALIZATION_API } from '../../../../../common/constants'; -import { useHttp } from '../../../../common/lib/kibana'; - -/** - * Interface for the input parameters of the useFetchGraphData hook. - */ -export interface UseFetchGraphDataParams { - /** - * The request object containing the query parameters for the graph data. - */ - req: GraphRequest; - /** - * Optional configuration options for the query. - */ - options?: { - /** - * If false, the query will not automatically run. - * Defaults to true. - */ - enabled?: boolean; - /** - * If true, the query will refetch on window focus. - * Defaults to true. - */ - refetchOnWindowFocus?: boolean; - }; -} - -/** - * Interface for the result of the useFetchGraphData hook. - */ -export interface UseFetchGraphDataResult { - /** - * Indicates if the query is currently loading. - */ - isLoading: boolean; - /** - * Indicates if there was an error during the query. - */ - isError: boolean; - /** - * The data returned from the query. - */ - data?: GraphResponse; -} - -/** - * Hook to fetch event's graph visualization data. - * - * @param params - The input parameters for the hook. - * @returns The result of the hook. - */ -export const useFetchGraphData = ({ - req, - options, -}: UseFetchGraphDataParams): UseFetchGraphDataResult => { - const { eventIds, start, end, esQuery } = req.query; - const http = useHttp(); - const QUERY_KEY = useMemo( - () => ['useFetchGraphData', eventIds, start, end, esQuery], - [end, esQuery, eventIds, start] - ); - - const { isLoading, isError, data } = useQuery<GraphResponse>( - QUERY_KEY, - () => { - return http.post<GraphResponse>(EVENT_GRAPH_VISUALIZATION_API, { - version: '1', - body: JSON.stringify(req), - }); - }, - { - enabled: options?.enabled ?? true, - refetchOnWindowFocus: options?.refetchOnWindowFocus ?? true, - } - ); - - return { - isLoading, - isError, - data, - }; -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.test.tsx deleted file mode 100644 index 7fa0741a8511..000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.test.tsx +++ /dev/null @@ -1,195 +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 { RenderHookResult } from '@testing-library/react'; -import { renderHook } from '@testing-library/react'; -import type { UseGraphPreviewParams, UseGraphPreviewResult } from './use_graph_preview'; -import { useGraphPreview } from './use_graph_preview'; -import type { GetFieldsData } from '../../shared/hooks/use_get_fields_data'; -import { mockFieldData } from '../../shared/mocks/mock_get_fields_data'; - -describe('useGraphPreview', () => { - let hookResult: RenderHookResult<UseGraphPreviewResult, UseGraphPreviewParams>; - - it(`should return false when missing actor`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return 'eventId'; - } - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual([]); - expect(action).toEqual(['action']); - }); - - it(`should return false when missing event.action`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return 'eventId'; - } else if (field === 'actor.entity.id') { - return 'actorId'; - } - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(action).toEqual(undefined); - }); - - it(`should return false when missing original_event.id`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'actor.entity.id') { - return 'actorId'; - } - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(false); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual([]); - expect(actorIds).toEqual(['actorId']); - expect(action).toEqual(['action']); - }); - - it(`should return false when timestamp is missing`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === '@timestamp') { - return; - } else if (field === 'kibana.alert.original_event.id') { - return 'eventId'; - } else if (field === 'actor.entity.id') { - return 'actorId'; - } - - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(false); - expect(timestamp).toEqual(null); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(action).toEqual(['action']); - }); - - it(`should return true when alert is has graph preview`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return 'eventId'; - } else if (field === 'actor.entity.id') { - return 'actorId'; - } - - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action'], - }, - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(true); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['eventId']); - expect(actorIds).toEqual(['actorId']); - expect(action).toEqual(['action']); - }); - - it(`should return true when alert is has graph preview with multiple values`, () => { - const getFieldsData: GetFieldsData = (field: string) => { - if (field === 'kibana.alert.original_event.id') { - return ['id1', 'id2']; - } else if (field === 'actor.entity.id') { - return ['actorId1', 'actorId2']; - } - - return mockFieldData[field]; - }; - - hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { - initialProps: { - getFieldsData, - ecsData: { - _id: 'id', - event: { - action: ['action1', 'action2'], - }, - }, - }, - }); - - const { isAuditLog, timestamp, eventIds, actorIds, action } = hookResult.result.current; - expect(isAuditLog).toEqual(true); - expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); - expect(eventIds).toEqual(['id1', 'id2']); - expect(actorIds).toEqual(['actorId1', 'actorId2']); - expect(action).toEqual(['action1', 'action2']); - }); -}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.ts b/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.ts deleted file mode 100644 index bbaeb808c9e2..000000000000 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/hooks/use_graph_preview.ts +++ /dev/null @@ -1,72 +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 { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; -import { get } from 'lodash/fp'; -import type { GetFieldsData } from '../../shared/hooks/use_get_fields_data'; -import { getField, getFieldArray } from '../../shared/utils'; - -export interface UseGraphPreviewParams { - /** - * Retrieves searchHit values for the provided field - */ - getFieldsData: GetFieldsData; - - /** - * An object with top level fields from the ECS object - */ - ecsData: Ecs; -} -/** - * Interface for the result of the useGraphPreview hook - */ -export interface UseGraphPreviewResult { - /** - * The timestamp of the event - */ - timestamp: string | null; - - /** - * Array of event IDs associated with the alert - */ - eventIds: string[]; - - /** - * Array of actor entity IDs associated with the alert - */ - actorIds: string[]; - - /** - * Action associated with the event - */ - action?: string[]; - - /** - * Boolean indicating if the event is an audit log (contains event ids, actor ids and action) - */ - isAuditLog: boolean; -} - -/** - * Hook that returns the graph view configuration if the graph view is available for the alert - */ -export const useGraphPreview = ({ - getFieldsData, - ecsData, -}: UseGraphPreviewParams): UseGraphPreviewResult => { - const timestamp = getField(getFieldsData('@timestamp')); - const originalEventId = getFieldsData('kibana.alert.original_event.id'); - const eventId = getFieldsData('event.id'); - const eventIds = originalEventId ? getFieldArray(originalEventId) : getFieldArray(eventId); - - const actorIds = getFieldArray(getFieldsData('actor.entity.id')); - const action: string[] | undefined = get(['event', 'action'], ecsData); - const isAuditLog = - Boolean(timestamp) && actorIds.length > 0 && Boolean(action?.length) && eventIds.length > 0; - - return { timestamp, eventIds, actorIds, action, isAuditLog }; -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx index c3ee6a7d7a51..2a17b76c0385 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/navigation.tsx @@ -25,7 +25,7 @@ interface PanelNavigationProps { export const PanelNavigation: FC<PanelNavigationProps> = memo(({ flyoutIsExpandable }) => { const { telemetry } = useKibana().services; const { openLeftPanel } = useExpandableFlyoutApi(); - const { eventId, indexName, scopeId } = useDocumentDetailsContext(); + const { eventId, indexName, scopeId, isPreview } = useDocumentDetailsContext(); const expandDetails = useCallback(() => { openLeftPanel({ @@ -47,6 +47,8 @@ export const PanelNavigation: FC<PanelNavigationProps> = memo(({ flyoutIsExpanda flyoutIsExpandable={flyoutIsExpandable} expandDetails={expandDetails} actions={<HeaderActions />} + isPreviewMode={false} + isPreview={isPreview} /> ); }); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx index 59c06629e2a4..5f39d73bd31f 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/utils/event_utils.tsx @@ -48,25 +48,3 @@ export const getEcsAllowedValueDescription = (fieldName: FieldName, value: strin }) ); }; - -// mapping of event category to the field displayed as title -export const EVENT_CATEGORY_TO_FIELD: Record<string, string> = { - authentication: 'user.name', - configuration: '', - database: '', - driver: '', - email: '', - file: 'file.name', - host: 'host.name', - iam: '', - intrusion_detection: '', - malware: '', - network: '', - package: '', - process: 'process.name', - registry: '', - session: '', - threat: '', - vulnerability: '', - web: '', -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.ts new file mode 100644 index 000000000000..aeb8b899ef6e --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/constants/experimental_features.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. + */ + +/** This security solution experimental feature allows user to enable/disable the graph visualization in Flyout feature (depends on securitySolution:enableVisualizationsInFlyout) */ +export const GRAPH_VISUALIZATION_IN_FLYOUT_ENABLED_EXPERIMENTAL_FEATURE = + 'graphVisualizationInFlyoutEnabled' as const; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts index 3e055e3bc4f6..35492384f4f4 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_get_fields_data.ts @@ -17,7 +17,7 @@ import type { SearchHit } from '../../../../../common/search_strategy'; * This should be generally fine, but given the flattened nature of the top level key, utilities like `get` or `getOr` won't work since the path isn't actually nested * This utility allows users to not only get simple fields, but if they provide a path like `kibana.alert.parameters.index`, it will return an array of all index values * for each object in the parameters array. As an added note, this work stemmed from a hope to be able to purely use the fields api in place of the data produced by - * `getDataFromFieldsHits` found in `x-pack/plugins/timelines/common/utils/field_formatters.ts` + * `getDataFromFieldsHits` found in `x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts` */ const getAllDotIndicesInReverse = (dotField: string): number[] => { const dotRegx = RegExp('[.]', 'g'); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx new file mode 100644 index 000000000000..453f897d4e18 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.test.tsx @@ -0,0 +1,226 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { RenderHookResult } from '@testing-library/react'; +import { renderHook } from '@testing-library/react'; +import type { UseGraphPreviewParams, UseGraphPreviewResult } from './use_graph_preview'; +import { useGraphPreview } from './use_graph_preview'; +import type { GetFieldsData } from './use_get_fields_data'; +import { mockFieldData } from '../mocks/mock_get_fields_data'; + +const mockGetFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.original_event.id') { + return 'eventId'; + } else if (field === 'actor.entity.id') { + return 'actorId'; + } else if (field === 'target.entity.id') { + return 'targetId'; + } + + return mockFieldData[field]; +}; + +describe('useGraphPreview', () => { + let hookResult: RenderHookResult<UseGraphPreviewResult, UseGraphPreviewParams>; + + it(`should return false when missing actor`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'actor.entity.id') { + return; + } + return mockGetFieldsData(field); + }; + + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(false); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual(['eventId']); + expect(actorIds).toEqual([]); + expect(targetIds).toEqual(['targetId']); + expect(action).toEqual(['action']); + }); + + it(`should return false when missing event.action`, () => { + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData: mockGetFieldsData, + ecsData: { + _id: 'id', + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(false); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual(['eventId']); + expect(actorIds).toEqual(['actorId']); + expect(targetIds).toEqual(['targetId']); + expect(action).toEqual(undefined); + }); + + it(`should return false when missing target`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'target.entity.id') { + return; + } + return mockGetFieldsData(field); + }; + + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(false); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual(['eventId']); + expect(actorIds).toEqual(['actorId']); + expect(targetIds).toEqual([]); + expect(action).toEqual(undefined); + }); + + it(`should return false when missing original_event.id`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.original_event.id') { + return; + } + + return mockGetFieldsData(field); + }; + + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(false); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual([]); + expect(actorIds).toEqual(['actorId']); + expect(targetIds).toEqual(['targetId']); + expect(action).toEqual(['action']); + }); + + it(`should return false when timestamp is missing`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === '@timestamp') { + return; + } + + return mockGetFieldsData(field); + }; + + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(false); + expect(timestamp).toEqual(null); + expect(eventIds).toEqual(['eventId']); + expect(actorIds).toEqual(['actorId']); + expect(targetIds).toEqual(['targetId']); + expect(action).toEqual(['action']); + }); + + it(`should return true when alert is has graph preview`, () => { + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData: mockGetFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action'], + }, + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(true); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual(['eventId']); + expect(actorIds).toEqual(['actorId']); + expect(targetIds).toEqual(['targetId']); + expect(action).toEqual(['action']); + }); + + it(`should return true when alert is has graph preview with multiple values`, () => { + const getFieldsData: GetFieldsData = (field: string) => { + if (field === 'kibana.alert.original_event.id') { + return ['id1', 'id2']; + } else if (field === 'actor.entity.id') { + return ['actorId1', 'actorId2']; + } else if (field === 'target.entity.id') { + return ['targetId1', 'targetId2']; + } + + return mockFieldData[field]; + }; + + hookResult = renderHook((props: UseGraphPreviewParams) => useGraphPreview(props), { + initialProps: { + getFieldsData, + ecsData: { + _id: 'id', + event: { + action: ['action1', 'action2'], + }, + }, + }, + }); + + const { hasGraphRepresentation, timestamp, eventIds, actorIds, action, targetIds } = + hookResult.result.current; + expect(hasGraphRepresentation).toEqual(true); + expect(timestamp).toEqual(mockFieldData['@timestamp'][0]); + expect(eventIds).toEqual(['id1', 'id2']); + expect(actorIds).toEqual(['actorId1', 'actorId2']); + expect(action).toEqual(['action1', 'action2']); + expect(targetIds).toEqual(['targetId1', 'targetId2']); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.ts new file mode 100644 index 000000000000..48233afab02d --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_graph_preview.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 type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs'; +import { get } from 'lodash/fp'; +import type { GetFieldsData } from './use_get_fields_data'; +import { getField, getFieldArray } from '../utils'; + +export interface UseGraphPreviewParams { + /** + * Retrieves searchHit values for the provided field + */ + getFieldsData: GetFieldsData; + + /** + * An object with top level fields from the ECS object + */ + ecsData: Ecs; +} +/** + * Interface for the result of the useGraphPreview hook + */ +export interface UseGraphPreviewResult { + /** + * The timestamp of the event + */ + timestamp: string | null; + + /** + * Array of event IDs associated with the alert + */ + eventIds: string[]; + + /** + * Array of actor entity IDs associated with the alert + */ + actorIds: string[]; + + /** + * Array of target entity IDs associated with the alert + */ + targetIds: string[]; + + /** + * Action associated with the event + */ + action?: string[]; + + /** + * Boolean indicating if the event is has a graph representation (contains event ids, actor ids and action) + */ + hasGraphRepresentation: boolean; +} + +/** + * Hook that returns the graph view configuration if the graph view is available for the alert + */ +export const useGraphPreview = ({ + getFieldsData, + ecsData, +}: UseGraphPreviewParams): UseGraphPreviewResult => { + const timestamp = getField(getFieldsData('@timestamp')); + const originalEventId = getFieldsData('kibana.alert.original_event.id'); + const eventId = getFieldsData('event.id'); + const eventIds = originalEventId ? getFieldArray(originalEventId) : getFieldArray(eventId); + + const actorIds = getFieldArray(getFieldsData('actor.entity.id')); + const targetIds = getFieldArray(getFieldsData('target.entity.id')); + const action: string[] | undefined = get(['event', 'action'], ecsData); + const hasGraphRepresentation = + Boolean(timestamp) && + Boolean(action?.length) && + actorIds.length > 0 && + eventIds.length > 0 && + targetIds.length > 0; + + return { timestamp, eventIds, actorIds, action, targetIds, hasGraphRepresentation }; +}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx index a4539ed7e641..2137ce83527a 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_analyzer.tsx @@ -49,7 +49,7 @@ export interface UseNavigateToAnalyzerResult { } /** - * Hook that returns the a callback to navigate to the analyzer in the flyout + * Hook that returns a callback to navigate to the analyzer in the flyout */ export const useNavigateToAnalyzer = ({ isFlyoutOpen, diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.tsx new file mode 100644 index 000000000000..929dc208f3b3 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.test.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 { renderHook } from '@testing-library/react-hooks'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { mockFlyoutApi } from '../mocks/mock_flyout_context'; +import { useWhichFlyout } from './use_which_flyout'; +import { useKibana as mockUseKibana } from '../../../../common/lib/kibana/__mocks__'; +import { useKibana } from '../../../../common/lib/kibana'; +import { DocumentDetailsRightPanelKey, DocumentDetailsLeftPanelKey } from '../constants/panel_keys'; +import { useNavigateToGraphVisualization } from './use_navigate_to_graph_visualization'; +import { GRAPH_ID } from '../../left/components/graph_visualization'; + +jest.mock('@kbn/expandable-flyout'); +jest.mock('../../../../common/lib/kibana'); +jest.mock('./use_which_flyout'); + +const mockedUseKibana = mockUseKibana(); +(useKibana as jest.Mock).mockReturnValue(mockedUseKibana); + +const mockUseWhichFlyout = useWhichFlyout as jest.Mock; +const FLYOUT_KEY = 'SecuritySolution'; + +const eventId = 'eventId1'; +const indexName = 'index1'; +const scopeId = 'scopeId1'; + +describe('useNavigateToGraphVisualization', () => { + beforeEach(() => { + jest.clearAllMocks(); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(mockFlyoutApi); + }); + + it('when isFlyoutOpen is true, should return callback that opens left and preview panels', () => { + mockUseWhichFlyout.mockReturnValue(FLYOUT_KEY); + const hookResult = renderHook(() => + useNavigateToGraphVisualization({ isFlyoutOpen: true, eventId, indexName, scopeId }) + ); + + // Act + hookResult.result.current.navigateToGraphVisualization(); + + expect(mockFlyoutApi.openLeftPanel).toHaveBeenCalledWith({ + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }); + }); + + it('when isFlyoutOpen is false and scopeId is not timeline, should return callback that opens a new flyout', () => { + mockUseWhichFlyout.mockReturnValue(null); + + const hookResult = renderHook(() => + useNavigateToGraphVisualization({ isFlyoutOpen: false, eventId, indexName, scopeId }) + ); + + // Act + hookResult.result.current.navigateToGraphVisualization(); + + expect(mockFlyoutApi.openFlyout).toHaveBeenCalledWith({ + right: { + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + left: { + id: DocumentDetailsLeftPanelKey, + path: { + tab: 'visualize', + subTab: GRAPH_ID, + }, + params: { + id: eventId, + indexName, + scopeId, + }, + }, + }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.tsx new file mode 100644 index 000000000000..bb61ae6f9707 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_graph_visualization.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 { useCallback, useMemo } from 'react'; +import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import type { Maybe } from '@kbn/timelines-plugin/common/search_strategy/common'; +import { useKibana } from '../../../../common/lib/kibana'; +import { DocumentDetailsLeftPanelKey, DocumentDetailsRightPanelKey } from '../constants/panel_keys'; +import { DocumentEventTypes } from '../../../../common/lib/telemetry'; +import { GRAPH_ID } from '../../left/components/graph_visualization'; + +export interface UseNavigateToGraphVisualizationParams { + /** + * When flyout is already open, call open left panel only + * When flyout is not open, open a new flyout + */ + isFlyoutOpen: boolean; + /** + * Id of the document + */ + eventId: string; + /** + * Name of the index used in the parent's page + */ + indexName: Maybe<string> | undefined; + /** + * Scope id of the page + */ + scopeId: string; +} + +export interface UseNavigateToGraphVisualizationResult { + /** + * Callback to open analyzer in visualize tab + */ + navigateToGraphVisualization: () => void; +} + +/** + * Hook that returns a callback to navigate to the graph visualization in the flyout + */ +export const useNavigateToGraphVisualization = ({ + isFlyoutOpen, + eventId, + indexName, + scopeId, +}: UseNavigateToGraphVisualizationParams): UseNavigateToGraphVisualizationResult => { + const { telemetry } = useKibana().services; + const { openLeftPanel, openFlyout } = useExpandableFlyoutApi(); + + const right: FlyoutPanelProps = useMemo( + () => ({ + id: DocumentDetailsRightPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + }), + [eventId, indexName, scopeId] + ); + + const left: FlyoutPanelProps = useMemo( + () => ({ + id: DocumentDetailsLeftPanelKey, + params: { + id: eventId, + indexName, + scopeId, + }, + path: { + tab: 'visualize', + subTab: GRAPH_ID, + }, + }), + [eventId, indexName, scopeId] + ); + + const navigateToGraphVisualization = useCallback(() => { + if (isFlyoutOpen) { + openLeftPanel(left); + telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutTabClicked, { + location: scopeId, + panel: 'left', + tabId: 'visualize', + }); + } else { + openFlyout({ + right, + left, + }); + telemetry.reportEvent(DocumentEventTypes.DetailsFlyoutOpened, { + location: scopeId, + panel: 'left', + }); + } + }, [openFlyout, openLeftPanel, right, left, scopeId, telemetry, isFlyoutOpen]); + + return useMemo(() => ({ navigateToGraphVisualization }), [navigateToGraphVisualization]); +}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx index f0b2733998c9..d98ce5f489e3 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/hooks/use_navigate_to_session_view.tsx @@ -42,7 +42,7 @@ export interface UseNavigateToSessionViewResult { } /** - * Hook that returns the a callback to navigate to session view in the flyout + * Hook that returns a callback to navigate to session view in the flyout */ export const useNavigateToSessionView = ({ isFlyoutOpen, diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx index 531bc1b57df5..6c9e9917679f 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.test.tsx @@ -4,9 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { getField, getFieldArray } from './utils'; +import { getField, getFieldArray, getEventTitle, getAlertTitle } from './utils'; -describe('test getField', () => { +describe('getField', () => { it('should return the string value if field is a string', () => { expect(getField('test string')).toBe('test string'); }); @@ -29,7 +29,7 @@ describe('test getField', () => { }); }); -describe('test getFieldArray', () => { +describe('getFieldArray', () => { it('should return the string value in an array if field is a string', () => { expect(getFieldArray('test string')).toStrictEqual(['test string']); }); @@ -47,3 +47,43 @@ describe('test getFieldArray', () => { expect(getFieldArray(null)).toStrictEqual([]); }); }); + +describe('getEventTitle', () => { + it('should return event title based on category when event kind is event', () => { + expect( + getEventTitle({ + eventKind: 'event', + eventCategory: 'process', + getFieldsData: (field) => (field === 'process.name' ? 'process name' : ''), + }) + ).toBe('process name'); + }); + + it('should return External alert details when event kind is alert', () => { + expect( + getEventTitle({ eventKind: 'alert', eventCategory: null, getFieldsData: jest.fn() }) + ).toBe('External alert details'); + }); + + it('should return generic event details when event kind is not event or alert', () => { + expect( + getEventTitle({ eventKind: 'metric', eventCategory: null, getFieldsData: jest.fn() }) + ).toBe('Metric details'); + }); + + it('should return Event details when event kind is null', () => { + expect(getEventTitle({ eventKind: null, eventCategory: null, getFieldsData: jest.fn() })).toBe( + 'Event details' + ); + }); +}); + +describe('getAlertTitle', () => { + it('should return Document details when ruleName is undefined', () => { + expect(getAlertTitle({ ruleName: undefined })).toBe('Document details'); + }); + + it('should return ruleName when ruleName is defined', () => { + expect(getAlertTitle({ ruleName: 'test rule' })).toBe('test rule'); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx index 72d568325676..9953fa0fbbfb 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/shared/utils.tsx @@ -4,6 +4,9 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ +import { i18n } from '@kbn/i18n'; +import { startCase } from 'lodash'; +import type { GetFieldsData } from './hooks/use_get_fields_data'; /** * Helper function to retrieve a field's value (used in combination with the custom hook useGetFieldsData (https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/public/common/hooks/use_get_fields_data.ts) @@ -33,3 +36,73 @@ export const getFieldArray = (field: unknown | unknown[]) => { } return []; }; + +// mapping of event category to the field displayed as title +export const EVENT_CATEGORY_TO_FIELD: Record<string, string> = { + authentication: 'user.name', + configuration: '', + database: '', + driver: '', + email: '', + file: 'file.name', + host: 'host.name', + iam: '', + intrusion_detection: '', + malware: '', + network: '', + package: '', + process: 'process.name', + registry: '', + session: '', + threat: '', + vulnerability: '', + web: '', +}; + +/** + * Helper function to retrieve the alert title + */ +export const getAlertTitle = ({ ruleName }: { ruleName?: string | null }) => { + const defaultAlertTitle = i18n.translate( + 'xpack.securitySolution.flyout.right.header.headerTitle', + { defaultMessage: 'Document details' } + ); + return ruleName ?? defaultAlertTitle; +}; + +/** + * Helper function to retrieve the event title + */ +export const getEventTitle = ({ + eventKind, + eventCategory, + getFieldsData, +}: { + eventKind: string | null; + eventCategory: string | null; + getFieldsData: GetFieldsData; +}) => { + const defaultTitle = i18n.translate('xpack.securitySolution.flyout.title.eventTitle', { + defaultMessage: `Event details`, + }); + + if (eventKind === 'event' && eventCategory) { + const fieldName = EVENT_CATEGORY_TO_FIELD[eventCategory]; + return getField(getFieldsData(fieldName)) ?? defaultTitle; + } + + if (eventKind === 'alert') { + return i18n.translate('xpack.securitySolution.flyout.title.alertEventTitle', { + defaultMessage: 'External alert details', + }); + } + + return eventKind + ? i18n.translate('xpack.securitySolution.flyout.title.otherEventTitle', { + defaultMessage: '{eventKind} details', + values: { + eventKind: startCase(eventKind), + }, + }) + : defaultTitle; +}; diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx b/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx index 14bc3d3bd35d..f66ff0883a4a 100644 --- a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.test.tsx @@ -9,7 +9,16 @@ import { render } from '@testing-library/react'; import React from 'react'; import { TestProviders } from '../../../common/mock'; import { mockHostRiskScoreState, mockObservedHostData } from '../mocks'; - +import type { + FlyoutPanelProps, + ExpandableFlyoutState, + ExpandableFlyoutApi, +} from '@kbn/expandable-flyout'; +import { + useExpandableFlyoutApi, + useExpandableFlyoutState, + useExpandableFlyoutHistory, +} from '@kbn/expandable-flyout'; import type { HostPanelProps } from '.'; import { HostPanel } from '.'; @@ -34,10 +43,24 @@ jest.mock('./hooks/use_observed_host', () => ({ useObservedHost: () => mockedUseObservedHost(), })); +const flyoutContextValue = { + closeLeftPanel: jest.fn(), +} as unknown as ExpandableFlyoutApi; + +const flyoutHistory = [{ id: 'id1', params: {} }] as unknown as FlyoutPanelProps[]; +jest.mock('@kbn/expandable-flyout', () => ({ + useExpandableFlyoutApi: jest.fn(), + useExpandableFlyoutHistory: jest.fn(), + useExpandableFlyoutState: jest.fn(), +})); + describe('HostPanel', () => { beforeEach(() => { mockedHostRiskScore.mockReturnValue(mockHostRiskScoreState); mockedUseObservedHost.mockReturnValue(mockObservedHostData); + jest.mocked(useExpandableFlyoutHistory).mockReturnValue(flyoutHistory); + jest.mocked(useExpandableFlyoutState).mockReturnValue({} as unknown as ExpandableFlyoutState); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); }); it('renders', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx b/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx index 64c8e74d6271..abf7d5cf591d 100644 --- a/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/entity_details/host_right/index.tsx @@ -11,6 +11,7 @@ import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useHasMisconfigurations } from '@kbn/cloud-security-posture/src/hooks/use_has_misconfigurations'; import { useHasVulnerabilities } from '@kbn/cloud-security-posture/src/hooks/use_has_vulnerabilities'; +import { TableId } from '@kbn/securitysolution-data-table'; import { useNonClosedAlerts } from '../../../cloud_security_posture/hooks/use_non_closed_alerts'; import { DETECTION_RESPONSE_ALERTS_BY_STATUS_ID } from '../../../overview/components/detection_response/alerts_by_status/types'; import { useRefetchQueryById } from '../../../entity_analytics/api/hooks/use_refetch_query_by_id'; @@ -36,7 +37,6 @@ import { HostDetailsPanelKey } from '../host_details_left'; import { EntityDetailsLeftPanelTab } from '../shared/components/left_panel/left_panel_header'; import { HostPreviewPanelFooter } from '../host_preview/footer'; import { EntityEventTypes } from '../../../common/lib/telemetry'; - export interface HostPanelProps extends Record<string, unknown> { contextID: string; scopeId: string; @@ -187,13 +187,14 @@ export const HostPanel = ({ <> <FlyoutNavigation flyoutIsExpandable={ - !isPreviewMode && - (isRiskScoreExist || - hasMisconfigurationFindings || - hasVulnerabilitiesFindings || - hasNonClosedAlerts) + isRiskScoreExist || + hasMisconfigurationFindings || + hasVulnerabilitiesFindings || + hasNonClosedAlerts } expandDetails={openDefaultPanel} + isPreviewMode={isPreviewMode} + isPreview={scopeId === TableId.rulePreview} /> <HostPanelHeader hostName={hostName} observedHost={observedHostWithAnomalies} /> <HostPanelContent diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx b/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx index 4efd54dd0e8a..a8c7a08908b6 100644 --- a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.test.tsx @@ -10,7 +10,16 @@ import React from 'react'; import { TestProviders } from '../../../common/mock'; import type { UserPanelProps } from '.'; import { UserPanel } from '.'; - +import type { + FlyoutPanelProps, + ExpandableFlyoutState, + ExpandableFlyoutApi, +} from '@kbn/expandable-flyout'; +import { + useExpandableFlyoutApi, + useExpandableFlyoutState, + useExpandableFlyoutHistory, +} from '@kbn/expandable-flyout'; import { mockManagedUserData, mockObservedUser } from './mocks'; import { mockRiskScoreState } from '../../shared/mocks'; @@ -44,11 +53,25 @@ jest.mock('../../../common/hooks/use_experimental_features', () => ({ useIsExperimentalFeatureEnabled: () => mockedUseIsExperimentalFeatureEnabled(), })); +const flyoutContextValue = { + closeLeftPanel: jest.fn(), +} as unknown as ExpandableFlyoutApi; + +const flyoutHistory = [{ id: 'id1', params: {} }] as unknown as FlyoutPanelProps[]; +jest.mock('@kbn/expandable-flyout', () => ({ + useExpandableFlyoutApi: jest.fn(), + useExpandableFlyoutHistory: jest.fn(), + useExpandableFlyoutState: jest.fn(), +})); + describe('UserPanel', () => { beforeEach(() => { mockedUseRiskScore.mockReturnValue(mockRiskScoreState); mockedUseManagedUser.mockReturnValue(mockManagedUserData); mockedUseObservedUser.mockReturnValue(mockObservedUser); + jest.mocked(useExpandableFlyoutHistory).mockReturnValue(flyoutHistory); + jest.mocked(useExpandableFlyoutState).mockReturnValue({} as unknown as ExpandableFlyoutState); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); }); it('renders', () => { diff --git a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx b/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx index 1a97c691f373..182740a5afa5 100644 --- a/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/entity_details/user_right/index.tsx @@ -9,6 +9,7 @@ import React, { useCallback, useMemo } from 'react'; import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { useHasMisconfigurations } from '@kbn/cloud-security-posture/src/hooks/use_has_misconfigurations'; +import { TableId } from '@kbn/securitysolution-data-table'; import { useNonClosedAlerts } from '../../../cloud_security_posture/hooks/use_non_closed_alerts'; import { useRefetchQueryById } from '../../../entity_analytics/api/hooks/use_refetch_query_by_id'; import type { Refetch } from '../../../common/types'; @@ -191,10 +192,11 @@ export const UserPanel = ({ <> <FlyoutNavigation flyoutIsExpandable={ - !isPreviewMode && - (hasUserDetailsData || hasMisconfigurationFindings || hasNonClosedAlerts) + hasUserDetailsData || hasMisconfigurationFindings || hasNonClosedAlerts } expandDetails={openPanelFirstTab} + isPreviewMode={isPreviewMode} + isPreview={scopeId === TableId.rulePreview} /> <UserPanelHeader userName={userName} diff --git a/x-pack/plugins/security_solution/public/flyout/index.tsx b/x-pack/plugins/security_solution/public/flyout/index.tsx index ab5c874898ef..64fac23dfa98 100644 --- a/x-pack/plugins/security_solution/public/flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/index.tsx @@ -39,7 +39,7 @@ import type { HostPanelExpandableFlyoutProps } from './entity_details/host_right import { HostPanel, HostPanelKey, HostPreviewPanelKey } from './entity_details/host_right'; import type { HostDetailsExpandableFlyoutProps } from './entity_details/host_details_left'; import { HostDetailsPanel, HostDetailsPanelKey } from './entity_details/host_details_left'; -import { NetworkPanel, NetworkPanelKey } from './network_details'; +import { NetworkPanel, NetworkPanelKey, NetworkPreviewPanelKey } from './network_details'; import type { AnalyzerPanelExpandableFlyoutProps } from './document_details/analyzer_panels'; import { AnalyzerPanel } from './document_details/analyzer_panels'; @@ -140,6 +140,12 @@ const expandableFlyoutDocumentsPanels: ExpandableFlyoutProps['registeredPanels'] key: NetworkPanelKey, component: (props) => <NetworkPanel {...(props as NetworkExpandableFlyoutProps).params} />, }, + { + key: NetworkPreviewPanelKey, + component: (props) => ( + <NetworkPanel {...(props as NetworkExpandableFlyoutProps).params} isPreviewMode /> + ), + }, ]; export const SECURITY_SOLUTION_ON_CLOSE_EVENT = `expandable-flyout-on-close-${Flyouts.securitySolution}`; diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/header.tsx b/x-pack/plugins/security_solution/public/flyout/network_details/header.tsx index 8ffceb345b1e..5ebdf9c9e866 100644 --- a/x-pack/plugins/security_solution/public/flyout/network_details/header.tsx +++ b/x-pack/plugins/security_solution/public/flyout/network_details/header.tsx @@ -28,7 +28,7 @@ export interface PanelHeaderProps extends React.ComponentProps<typeof EuiFlyoutH } /** - * + * Header component for the network details flyout */ export const PanelHeader: FC<PanelHeaderProps> = memo( ({ ip, flowTarget, ...flyoutHeaderProps }: PanelHeaderProps) => { diff --git a/x-pack/plugins/security_solution/public/flyout/network_details/index.tsx b/x-pack/plugins/security_solution/public/flyout/network_details/index.tsx index d7e9d3519e4b..37727e8074f0 100644 --- a/x-pack/plugins/security_solution/public/flyout/network_details/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/network_details/index.tsx @@ -5,19 +5,23 @@ * 2.0. */ +import type { FC } from 'react'; import React, { memo } from 'react'; import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; import { i18n } from '@kbn/i18n'; +import { TableId } from '@kbn/securitysolution-data-table'; import type { FlowTargetSourceDest } from '../../../common/search_strategy'; import { PanelHeader } from './header'; import { PanelContent } from './content'; +import { FlyoutNavigation } from '../shared/components/flyout_navigation'; export interface NetworkExpandableFlyoutProps extends FlyoutPanelProps { - key: 'network-details'; + key: 'network-details' | 'network-preview'; params: NetworkPanelProps; } export const NetworkPanelKey: NetworkExpandableFlyoutProps['key'] = 'network-details'; +export const NetworkPreviewPanelKey: NetworkExpandableFlyoutProps['key'] = 'network-preview'; export const NETWORK_PREVIEW_BANNER = { title: i18n.translate('xpack.securitySolution.flyout.right.network.networkPreviewTitle', { @@ -36,18 +40,33 @@ export interface NetworkPanelProps extends Record<string, unknown> { * Destination or source information */ flowTarget: FlowTargetSourceDest; + /** + * Scope ID + */ + scopeId: string; + /** + * If in preview mode, show preview banner and hide navigation + */ + isPreviewMode?: boolean; } /** * Panel to be displayed in the network details expandable flyout right section */ -export const NetworkPanel = memo(({ ip, flowTarget }: NetworkPanelProps) => { - return ( - <> - <PanelHeader ip={ip} flowTarget={flowTarget} /> - <PanelContent ip={ip} flowTarget={flowTarget} /> - </> - ); -}); +export const NetworkPanel: FC<NetworkPanelProps> = memo( + ({ ip, flowTarget, scopeId, isPreviewMode }) => { + return ( + <> + <FlyoutNavigation + flyoutIsExpandable={false} + isPreviewMode={isPreviewMode} + isPreview={scopeId === TableId.rulePreview} + /> + <PanelHeader ip={ip} flowTarget={flowTarget} /> + <PanelContent ip={ip} flowTarget={flowTarget} /> + </> + ); + } +); NetworkPanel.displayName = 'NetworkPanel'; diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx b/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx index 8acc6cfe9b71..54e6824ce505 100644 --- a/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx +++ b/x-pack/plugins/security_solution/public/flyout/rule_details/right/content.tsx @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import React, { memo } from 'react'; +import React, { memo, useMemo } from 'react'; import { EuiText, EuiHorizontalRule, EuiSpacer, EuiPanel } from '@elastic/eui'; import { css } from '@emotion/css'; import { FormattedMessage } from '@kbn/i18n-react'; @@ -50,12 +50,23 @@ export interface RuleDetailsProps { * Rule details content on the right section of expandable flyout */ export const PanelContent = memo(({ rule }: RuleDetailsProps) => { - const { ruleActionsData } = - rule != null ? getStepsData({ rule, detailsView: true }) : { ruleActionsData: null }; + const { ruleActionsData } = useMemo( + () => (rule != null ? getStepsData({ rule, detailsView: true }) : { ruleActionsData: null }), + [rule] + ); - const hasNotificationActions = Boolean(ruleActionsData?.actions?.length); - const hasResponseActions = Boolean(ruleActionsData?.responseActions?.length); - const hasActions = ruleActionsData != null && (hasNotificationActions || hasResponseActions); + const hasNotificationActions = useMemo( + () => Boolean(ruleActionsData?.actions?.length), + [ruleActionsData] + ); + const hasResponseActions = useMemo( + () => Boolean(ruleActionsData?.responseActions?.length), + [ruleActionsData] + ); + const hasActions = useMemo( + () => ruleActionsData != null && (hasNotificationActions || hasResponseActions), + [ruleActionsData, hasNotificationActions, hasResponseActions] + ); return ( <FlyoutBody> diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx b/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx index 294870d6eebb..027fc2947954 100644 --- a/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx +++ b/x-pack/plugins/security_solution/public/flyout/rule_details/right/header.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import React from 'react'; +import React, { memo } from 'react'; import { EuiTitle, EuiText, @@ -43,7 +43,7 @@ export interface PanelHeaderProps { /** * Title component that shows basic information of a rule. This is displayed above rule overview body */ -export const PanelHeader: React.FC<PanelHeaderProps> = ({ rule, isSuppressed }) => { +export const PanelHeader: React.FC<PanelHeaderProps> = memo(({ rule, isSuppressed }) => { const href = useRuleDetailsLink({ ruleId: rule.id }); return ( @@ -86,6 +86,6 @@ export const PanelHeader: React.FC<PanelHeaderProps> = ({ rule, isSuppressed }) </EuiFlexGroup> </FlyoutHeader> ); -}; +}); PanelHeader.displayName = 'PanelHeader'; diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx b/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx index 146da2be3434..c1a629f88171 100644 --- a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.test.tsx @@ -22,6 +22,16 @@ import { import type { RuleResponse } from '../../../../common/api/detection_engine'; import { BODY_TEST_ID, LOADING_TEST_ID } from './test_ids'; import { RULE_PREVIEW_FOOTER_TEST_ID } from '../preview/test_ids'; +import type { + FlyoutPanelProps, + ExpandableFlyoutState, + ExpandableFlyoutApi, +} from '@kbn/expandable-flyout'; +import { + useExpandableFlyoutApi, + useExpandableFlyoutState, + useExpandableFlyoutHistory, +} from '@kbn/expandable-flyout'; jest.mock('../../document_details/shared/hooks/use_rule_details_link'); @@ -31,6 +41,18 @@ jest.mock('../hooks/use_rule_details'); const mockGetStepsData = getStepsData as jest.Mock; jest.mock('../../../detections/pages/detection_engine/rules/helpers'); +jest.mock('@kbn/expandable-flyout', () => ({ + useExpandableFlyoutApi: jest.fn(), + useExpandableFlyoutState: jest.fn(), + useExpandableFlyoutHistory: jest.fn(), +})); + +const flyoutContextValue = { + closeLeftPanel: jest.fn(), +} as unknown as ExpandableFlyoutApi; + +const flyoutHistory = [{ id: 'id1', params: {} }] as unknown as FlyoutPanelProps[]; + const mockTheme = getMockTheme({ eui: { euiColorMediumShade: '#ece' } }); const rule = { name: 'rule name', description: 'rule description' } as RuleResponse; const ERROR_MESSAGE = 'There was an error displaying data.'; @@ -45,6 +67,12 @@ const renderRulePanel = (isPreviewMode = false) => ); describe('<RulePanel />', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutHistory).mockReturnValue(flyoutHistory); + jest.mocked(useExpandableFlyoutState).mockReturnValue({} as unknown as ExpandableFlyoutState); + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + }); + it('should render rule details and its sub sections', () => { mockUseRuleDetails.mockReturnValue({ rule, diff --git a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx b/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx index 10b22e22a575..dfe5863f6a85 100644 --- a/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx +++ b/x-pack/plugins/security_solution/public/flyout/rule_details/right/index.tsx @@ -5,6 +5,7 @@ * 2.0. */ +import type { FC } from 'react'; import React, { memo } from 'react'; import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; import { i18n } from '@kbn/i18n'; @@ -50,14 +51,14 @@ export interface RulePanelProps extends Record<string, unknown> { /** * Displays a rule overview panel */ -export const RulePanel = memo(({ ruleId, isPreviewMode }: RulePanelProps) => { +export const RulePanel: FC<RulePanelProps> = memo(({ ruleId, isPreviewMode }) => { const { rule, loading, isExistingRule } = useRuleDetails({ ruleId }); return loading ? ( <FlyoutLoading data-test-subj={LOADING_TEST_ID} /> ) : rule ? ( <> - <FlyoutNavigation flyoutIsExpandable={false} /> + <FlyoutNavigation flyoutIsExpandable={false} isPreviewMode={isPreviewMode} /> <PanelHeader rule={rule} isSuppressed={!isExistingRule} /> <PanelContent rule={rule} /> {isPreviewMode && <PreviewFooter ruleId={ruleId} />} diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.test.tsx new file mode 100644 index 000000000000..f922190da3e7 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.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 React from 'react'; +import { render, fireEvent } from '@testing-library/react'; +import { TestProviders } from '../../../common/mock'; +import { + FLYOUT_HISTORY_TEST_ID, + FLYOUT_HISTORY_BUTTON_TEST_ID, + FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID, + NO_DATA_HISTORY_ROW_TEST_ID, +} from './test_ids'; +import { FlyoutHistory } from './flyout_history'; + +const mockedHistory = [{ id: '1' }, { id: '2' }]; + +describe('FlyoutHistory', () => { + it('renders', () => { + const { getByTestId, queryByTestId } = render( + <TestProviders> + <FlyoutHistory history={mockedHistory} /> + </TestProviders> + ); + expect(getByTestId(FLYOUT_HISTORY_TEST_ID)).toBeInTheDocument(); + expect(queryByTestId(FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID)).not.toBeInTheDocument(); + }); + + it('renders context menu when clicking the popover', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistory history={mockedHistory} /> + </TestProviders> + ); + + fireEvent.click(getByTestId(FLYOUT_HISTORY_BUTTON_TEST_ID)); + expect(getByTestId(FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID)).toBeInTheDocument(); + }); + + it('render empty history message if history is empty', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistory history={[]} /> + </TestProviders> + ); + fireEvent.click(getByTestId(FLYOUT_HISTORY_BUTTON_TEST_ID)); + expect(getByTestId(NO_DATA_HISTORY_ROW_TEST_ID)).toBeInTheDocument(); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.tsx new file mode 100644 index 000000000000..933106e28ed1 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history.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 type { FC } from 'react'; +import React, { memo, useMemo, useState } from 'react'; +import { + EuiFlexItem, + EuiButtonEmpty, + EuiPopover, + EuiContextMenuPanel, + EuiText, + EuiContextMenuItem, + EuiTextColor, +} from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; +import { FlyoutHistoryRow } from './flyout_history_row'; +import { + FLYOUT_HISTORY_TEST_ID, + FLYOUT_HISTORY_BUTTON_TEST_ID, + FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID, + NO_DATA_HISTORY_ROW_TEST_ID, +} from './test_ids'; + +export interface HistoryProps { + /** + * A list of flyouts that have been opened + */ + history: FlyoutPanelProps[]; +} + +/** + * History of flyouts shown in top navigation + * Shows the title of previously opened flyout, and count of history of more than 1 flyout was opened + */ +export const FlyoutHistory: FC<HistoryProps> = memo(({ history }) => { + const [isPopoverOpen, setPopover] = useState(false); + const togglePopover = () => setPopover(!isPopoverOpen); + + const emptyHistoryMessage = useMemo(() => { + return ( + <EuiContextMenuItem key={0} data-test-subj={NO_DATA_HISTORY_ROW_TEST_ID}> + <EuiText size="s"> + <EuiTextColor color="subdued"> + <i> + <FormattedMessage + id="xpack.securitySolution.flyout.history.noData" + defaultMessage="No history" + /> + </i> + </EuiTextColor> + </EuiText> + </EuiContextMenuItem> + ); + }, []); + + const historyDropdownPanels = useMemo( + () => + history.length > 0 + ? history.map((item, index) => { + return <FlyoutHistoryRow item={item} index={index} />; + }) + : [emptyHistoryMessage], + [history, emptyHistoryMessage] + ); + + return ( + <EuiFlexItem grow={false} data-test-subj={FLYOUT_HISTORY_TEST_ID}> + <EuiPopover + button={ + <EuiButtonEmpty + onClick={togglePopover} + size="m" + iconType={'clockCounter'} + data-test-subj={FLYOUT_HISTORY_BUTTON_TEST_ID} + /> + } + isOpen={isPopoverOpen} + closePopover={togglePopover} + panelPaddingSize="none" + anchorPosition="downLeft" + > + <EuiContextMenuPanel + size="s" + items={historyDropdownPanels} + data-test-subj={FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID} + /> + </EuiPopover> + </EuiFlexItem> + ); +}); + +FlyoutHistory.displayName = 'FlyoutHistory'; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx new file mode 100644 index 000000000000..f3dcaefd536e --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.test.tsx @@ -0,0 +1,270 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, fireEvent } from '@testing-library/react'; +import { + FlyoutHistoryRow, + RuleHistoryRow, + DocumentDetailsHistoryRow, + GenericHistoryRow, +} from './flyout_history_row'; +import { TestProviders } from '../../../common/mock'; +import type { RuleResponse } from '../../../../common/api/detection_engine'; +import { useExpandableFlyoutApi, type ExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import { useRuleDetails } from '../../rule_details/hooks/use_rule_details'; +import { useBasicDataFromDetailsData } from '../../document_details/shared/hooks/use_basic_data_from_details_data'; +import { DocumentDetailsRightPanelKey } from '../../document_details/shared/constants/panel_keys'; +import { RulePanelKey } from '../../rule_details/right'; +import { UserPanelKey } from '../../entity_details/user_right'; +import { HostPanelKey } from '../../entity_details/host_right'; +import { NetworkPanelKey } from '../../network_details'; +import { + DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID, + RULE_HISTORY_ROW_TEST_ID, + HOST_HISTORY_ROW_TEST_ID, + USER_HISTORY_ROW_TEST_ID, + NETWORK_HISTORY_ROW_TEST_ID, + GENERIC_HISTORY_ROW_TEST_ID, +} from './test_ids'; + +jest.mock('@kbn/expandable-flyout', () => ({ + useExpandableFlyoutApi: jest.fn(), + useExpandableFlyoutState: jest.fn(), + useExpandableFlyoutHistory: jest.fn(), + ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}</>, +})); + +jest.mock('../../../detection_engine/rule_management/logic/use_rule_with_fallback'); +jest.mock('../../document_details/shared/hooks/use_basic_data_from_details_data'); +jest.mock('../../rule_details/hooks/use_rule_details'); + +const flyoutContextValue = { + openFlyout: jest.fn(), +} as unknown as ExpandableFlyoutApi; + +const rowItems = { + alert: { + id: DocumentDetailsRightPanelKey, + params: { + id: 'eventId', + indexName: 'indexName', + scopeId: 'scopeId', + }, + }, + rule: { + id: RulePanelKey, + params: { ruleId: 'ruleId' }, + }, + host: { + id: HostPanelKey, + params: { hostName: 'host name' }, + }, + user: { + id: UserPanelKey, + params: { userName: 'user name' }, + }, + network: { + id: NetworkPanelKey, + params: { ip: 'ip' }, + }, +}; + +const mockedRuleResponse = { + rule: null, + loading: false, + isExistingRule: false, + error: null, + refresh: jest.fn(), +}; + +describe('FlyoutHistoryRow', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + jest.mocked(useRuleDetails).mockReturnValue({ + ...mockedRuleResponse, + rule: { name: 'rule name' } as RuleResponse, + }); + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ isAlert: false }); + }); + + it('renders document details history row when key is alert', () => { + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ + isAlert: true, + ruleName: 'rule name', + }); + + const { getByTestId } = render( + <TestProviders> + <FlyoutHistoryRow item={rowItems.alert} index={0} /> + </TestProviders> + ); + expect(getByTestId(`${0}-${DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID}`)).toBeInTheDocument(); + }); + + it('renders rule history row when key is rule', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistoryRow item={rowItems.rule} index={1} /> + </TestProviders> + ); + expect(getByTestId(`${1}-${RULE_HISTORY_ROW_TEST_ID}`)).toBeInTheDocument(); + }); + + it('renders generic host history row when key is host', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistoryRow item={rowItems.host} index={2} /> + </TestProviders> + ); + expect(getByTestId(`${2}-${HOST_HISTORY_ROW_TEST_ID}`)).toBeInTheDocument(); + expect(getByTestId(`${2}-${HOST_HISTORY_ROW_TEST_ID}`)).toHaveTextContent('Host: host name'); + }); + + it('renders generic user history row when key is user', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistoryRow item={rowItems.user} index={3} /> + </TestProviders> + ); + expect(getByTestId(`${3}-${USER_HISTORY_ROW_TEST_ID}`)).toBeInTheDocument(); + expect(getByTestId(`${3}-${USER_HISTORY_ROW_TEST_ID}`)).toHaveTextContent('User: user name'); + }); + + it('renders generic network history row when key is network', () => { + const { getByTestId } = render( + <TestProviders> + <FlyoutHistoryRow item={rowItems.network} index={4} /> + </TestProviders> + ); + expect(getByTestId(`${4}-${NETWORK_HISTORY_ROW_TEST_ID}`)).toBeInTheDocument(); + expect(getByTestId(`${4}-${NETWORK_HISTORY_ROW_TEST_ID}`)).toHaveTextContent('Network: ip'); + }); + + it('renders null when key is not supported', () => { + const { container } = render( + <TestProviders> + <FlyoutHistoryRow item={{ id: 'key' }} index={5} /> + </TestProviders> + ); + expect(container).toBeEmptyDOMElement(); + }); +}); + +describe('DocumentDetailsHistoryRow', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + }); + + it('renders alert title when isAlert is true and rule name is defined', () => { + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ + isAlert: true, + ruleName: 'rule name', + }); + + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsHistoryRow item={rowItems.alert} index={0} /> + </TestProviders> + ); + expect(getByTestId(`${0}-${DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID}`)).toHaveTextContent( + 'Alert: rule name' + ); + }); + + it('renders default alert title when isAlert is true and rule name is undefined', () => { + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ isAlert: true }); + + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsHistoryRow item={rowItems.alert} index={0} /> + </TestProviders> + ); + expect(getByTestId(`${0}-${DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID}`)).toHaveTextContent( + 'Alert: Document details' + ); + }); + + it('renders event title when isAlert is false', () => { + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ isAlert: false }); + + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsHistoryRow item={rowItems.alert} index={0} /> + </TestProviders> + ); + expect(getByTestId(`${0}-${DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID}`)).toHaveTextContent( + 'Event details' + ); + }); + + it('opens document details flyout when clicked', () => { + (useBasicDataFromDetailsData as jest.Mock).mockReturnValue({ isAlert: true }); + + const { getByTestId } = render( + <TestProviders> + <DocumentDetailsHistoryRow item={rowItems.alert} index={0} /> + </TestProviders> + ); + fireEvent.click(getByTestId(`${0}-${DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID}`)); + expect(flyoutContextValue.openFlyout).toHaveBeenCalledWith({ right: rowItems.alert }); + }); +}); + +describe('RuleHistoryRow', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + jest.mocked(useRuleDetails).mockReturnValue({ + rule: { name: 'rule name' } as RuleResponse, + loading: false, + isExistingRule: false, + }); + }); + + it('renders', () => { + const { getByTestId } = render( + <TestProviders> + <RuleHistoryRow item={rowItems.rule} index={0} /> + </TestProviders> + ); + expect(getByTestId(`${0}-${RULE_HISTORY_ROW_TEST_ID}`)).toHaveTextContent('Rule: rule name'); + expect(useRuleDetails).toHaveBeenCalledWith({ ruleId: rowItems.rule.params.ruleId }); + }); + + it('opens rule details flyout when clicked', () => { + const { getByTestId } = render( + <TestProviders> + <RuleHistoryRow item={rowItems.rule} index={0} /> + </TestProviders> + ); + fireEvent.click(getByTestId(`${0}-${RULE_HISTORY_ROW_TEST_ID}`)); + expect(flyoutContextValue.openFlyout).toHaveBeenCalledWith({ right: rowItems.rule }); + }); +}); + +describe('GenericHistoryRow', () => { + beforeEach(() => { + jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); + }); + + it('renders', () => { + const { getByTestId } = render( + <TestProviders> + <GenericHistoryRow + item={rowItems.host} + name="Row name" + icon={'user'} + title="title" + index={0} + /> + </TestProviders> + ); + expect(getByTestId(`${0}-${GENERIC_HISTORY_ROW_TEST_ID}`)).toHaveTextContent('Row name: title'); + fireEvent.click(getByTestId(`${0}-${GENERIC_HISTORY_ROW_TEST_ID}`)); + expect(flyoutContextValue.openFlyout).toHaveBeenCalledWith({ right: rowItems.host }); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx new file mode 100644 index 000000000000..1081cae88e31 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_history_row.tsx @@ -0,0 +1,186 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, { memo, useMemo, useCallback } from 'react'; +import { EuiContextMenuItem, type EuiIconProps } from '@elastic/eui'; +import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; +import type { FlyoutPanelProps } from '@kbn/expandable-flyout'; +import { DocumentDetailsRightPanelKey } from '../../document_details/shared/constants/panel_keys'; +import { useBasicDataFromDetailsData } from '../../document_details/shared/hooks/use_basic_data_from_details_data'; +import { useEventDetails } from '../../document_details/shared/hooks/use_event_details'; +import { getField, getAlertTitle, getEventTitle } from '../../document_details/shared/utils'; +import { RulePanelKey } from '../../rule_details/right'; +import { UserPanelKey } from '../../entity_details/user_right'; +import { HostPanelKey } from '../../entity_details/host_right'; +import { NetworkPanelKey } from '../../network_details'; +import { useRuleDetails } from '../../rule_details/hooks/use_rule_details'; +import { + DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID, + RULE_HISTORY_ROW_TEST_ID, + GENERIC_HISTORY_ROW_TEST_ID, + HOST_HISTORY_ROW_TEST_ID, + USER_HISTORY_ROW_TEST_ID, + NETWORK_HISTORY_ROW_TEST_ID, +} from './test_ids'; + +export interface FlyoutHistoryRowProps { + /** + * Flyout item to display + */ + item: FlyoutPanelProps; + /** + * Index of the flyout in the list + */ + index: number; +} + +/** + * Row item for a flyout history row + */ +export const FlyoutHistoryRow: FC<FlyoutHistoryRowProps> = memo(({ item, index }) => { + switch (item.id) { + case DocumentDetailsRightPanelKey: + return <DocumentDetailsHistoryRow item={item} index={index} />; + case RulePanelKey: + return <RuleHistoryRow item={item} index={index} />; + case HostPanelKey: + return ( + <GenericHistoryRow + item={item} + index={index} + title={String(item?.params?.hostName)} + icon={'storage'} + name={'Host'} + dataTestSubj={HOST_HISTORY_ROW_TEST_ID} + /> + ); + case UserPanelKey: + return ( + <GenericHistoryRow + item={item} + index={index} + title={String(item?.params?.userName)} + icon={'user'} + name={'User'} + dataTestSubj={USER_HISTORY_ROW_TEST_ID} + /> + ); + case NetworkPanelKey: + return ( + <GenericHistoryRow + item={item} + index={index} + title={String(item?.params?.ip)} + icon={'globe'} + name={'Network'} + dataTestSubj={NETWORK_HISTORY_ROW_TEST_ID} + /> + ); + default: + return null; + } +}); + +/** + * Row item for a document details + */ +export const DocumentDetailsHistoryRow: FC<FlyoutHistoryRowProps> = memo(({ item, index }) => { + const { dataFormattedForFieldBrowser, getFieldsData } = useEventDetails({ + eventId: String(item?.params?.id), + indexName: String(item?.params?.indexName), + }); + const { ruleName, isAlert } = useBasicDataFromDetailsData(dataFormattedForFieldBrowser); + const eventKind = useMemo(() => getField(getFieldsData('event.kind')), [getFieldsData]); + const eventCategory = useMemo(() => getField(getFieldsData('event.category')), [getFieldsData]); + + const title = useMemo( + () => + isAlert + ? getAlertTitle({ ruleName }) + : getEventTitle({ eventKind, eventCategory, getFieldsData }), + [isAlert, ruleName, eventKind, eventCategory, getFieldsData] + ); + + return ( + <GenericHistoryRow + item={item} + index={index} + title={title} + icon={isAlert ? 'warning' : 'analyzeEvent'} + name={isAlert ? 'Alert' : 'Event'} + dataTestSubj={DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID} + /> + ); +}); + +/** + * Row item for a rule details flyout + */ +export const RuleHistoryRow: FC<FlyoutHistoryRowProps> = memo(({ item, index }) => { + const ruleId = String(item?.params?.ruleId); + const { rule } = useRuleDetails({ ruleId }); + + return ( + <GenericHistoryRow + item={item} + index={index} + title={rule?.name ?? ''} + icon={'indexSettings'} + name={'Rule'} + dataTestSubj={RULE_HISTORY_ROW_TEST_ID} + /> + ); +}); + +interface GenericHistoryRowProps extends FlyoutHistoryRowProps { + /** + * Icon to display + */ + icon: EuiIconProps['type']; + /** + * Title to display + */ + title: string; + /** + * Name to display + */ + name: string; + /** + * Data test subject + */ + dataTestSubj?: string; +} + +/** + * Row item for a generic history row where the title is accessible in flyout params + */ +export const GenericHistoryRow: FC<GenericHistoryRowProps> = memo( + ({ item, index, title, icon, name, dataTestSubj }) => { + const { openFlyout } = useExpandableFlyoutApi(); + const onClick = useCallback(() => { + openFlyout({ right: item }); + }, [openFlyout, item]); + + return ( + <EuiContextMenuItem + key={index} + onClick={onClick} + icon={icon} + data-test-subj={`${index}-${dataTestSubj ?? GENERIC_HISTORY_ROW_TEST_ID}`} + > + <i>{`${name}: `}</i> + {title} + </EuiContextMenuItem> + ); + } +); + +FlyoutHistoryRow.displayName = 'FlyoutHistoryRow'; +DocumentDetailsHistoryRow.displayName = 'DocumentDetailsHistoryRow'; +RuleHistoryRow.displayName = 'RuleHistoryRow'; +GenericHistoryRow.displayName = 'GenericHistoryRow'; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx index 321245ccde86..372b11bcc9ef 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.test.tsx @@ -13,13 +13,16 @@ import { FlyoutNavigation } from './flyout_navigation'; import { COLLAPSE_DETAILS_BUTTON_TEST_ID, EXPAND_DETAILS_BUTTON_TEST_ID, + FLYOUT_HISTORY_BUTTON_TEST_ID, HEADER_ACTIONS_TEST_ID, } from './test_ids'; -import type { ExpandableFlyoutState } from '@kbn/expandable-flyout'; +import type { ExpandableFlyoutState, FlyoutPanelProps } from '@kbn/expandable-flyout'; +import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import { useExpandableFlyoutApi, type ExpandableFlyoutApi, useExpandableFlyoutState, + useExpandableFlyoutHistory, } from '@kbn/expandable-flyout'; const expandDetails = jest.fn(); @@ -31,9 +34,12 @@ const ExpandableFlyoutTestProviders: FC<PropsWithChildren<{}>> = ({ children }) jest.mock('@kbn/expandable-flyout', () => ({ useExpandableFlyoutApi: jest.fn(), useExpandableFlyoutState: jest.fn(), + useExpandableFlyoutHistory: jest.fn(), ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}</>, })); +jest.mock('../../../common/hooks/use_experimental_features'); + const flyoutContextValue = { closeLeftPanel: jest.fn(), } as unknown as ExpandableFlyoutApi; @@ -42,6 +48,8 @@ describe('<FlyoutNavigation />', () => { beforeEach(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue(flyoutContextValue); jest.mocked(useExpandableFlyoutState).mockReturnValue({} as unknown as ExpandableFlyoutState); + jest.mocked(useExpandableFlyoutHistory).mockReturnValue([]); + jest.mocked(useIsExperimentalFeatureEnabled).mockReturnValue(false); }); describe('when flyout is expandable', () => { @@ -114,4 +122,62 @@ describe('<FlyoutNavigation />', () => { expect(container).toBeEmptyDOMElement(); }); }); + + it('should render empty component if isPreviewMode is true', () => { + const { container } = render( + <ExpandableFlyoutTestProviders> + <FlyoutNavigation isPreviewMode={true} flyoutIsExpandable={true} /> + </ExpandableFlyoutTestProviders> + ); + expect(container).toBeEmptyDOMElement(); + }); + + const flyoutHistory = [ + { id: 'id1', params: {} }, + { id: 'id2', params: {} }, + ] as unknown as FlyoutPanelProps[]; + + describe('when flyout history is enabled', () => { + beforeEach(() => { + jest.mocked(useIsExperimentalFeatureEnabled).mockReturnValue(true); + jest.mocked(useExpandableFlyoutHistory).mockReturnValue(flyoutHistory); + }); + + it('should render history button when there is no item in history', () => { + jest.mocked(useExpandableFlyoutHistory).mockReturnValue([]); + const { getByTestId } = render( + <ExpandableFlyoutTestProviders> + <FlyoutNavigation flyoutIsExpandable={false} /> + </ExpandableFlyoutTestProviders> + ); + expect(getByTestId(FLYOUT_HISTORY_BUTTON_TEST_ID)).toBeInTheDocument(); + }); + + it('should render history button when there are more than 1 unqie item in history', () => { + const { getByTestId } = render( + <ExpandableFlyoutTestProviders> + <FlyoutNavigation flyoutIsExpandable={false} /> + </ExpandableFlyoutTestProviders> + ); + expect(getByTestId(FLYOUT_HISTORY_BUTTON_TEST_ID)).toBeInTheDocument(); + }); + + it('should not render history button if in rule preview', () => { + const { container } = render( + <ExpandableFlyoutTestProviders> + <FlyoutNavigation flyoutIsExpandable={false} isPreview={true} /> + </ExpandableFlyoutTestProviders> + ); + expect(container).toBeEmptyDOMElement(); + }); + + it('should render empty component if isPreviewMode is true', () => { + const { container } = render( + <ExpandableFlyoutTestProviders> + <FlyoutNavigation isPreviewMode={true} flyoutIsExpandable={true} /> + </ExpandableFlyoutTestProviders> + ); + expect(container).toBeEmptyDOMElement(); + }); + }); }); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx index 1915c5a4484a..89798687c3e6 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx @@ -15,9 +15,16 @@ import { EuiButtonEmpty, } from '@elastic/eui'; import { css } from '@emotion/react'; -import { useExpandableFlyoutApi, useExpandableFlyoutState } from '@kbn/expandable-flyout'; +import { + useExpandableFlyoutApi, + useExpandableFlyoutState, + useExpandableFlyoutHistory, +} from '@kbn/expandable-flyout'; import { FormattedMessage } from '@kbn/i18n-react'; import { i18n } from '@kbn/i18n'; +import { FlyoutHistory } from './flyout_history'; +import { getProcessedHistory } from '../utils/history_utils'; +import { useIsExperimentalFeatureEnabled } from '../../../common/hooks/use_experimental_features'; import { HEADER_ACTIONS_TEST_ID, COLLAPSE_DETAILS_BUTTON_TEST_ID, @@ -37,6 +44,14 @@ export interface FlyoutNavigationProps { * Optional actions to be placed on the right hand side of navigation */ actions?: React.ReactElement; + /** + * Boolean indicating the panel is shown in preview panel + */ + isPreviewMode?: boolean; + /** + * Boolean indicating the panel is shown in rule preview + */ + isPreview?: boolean; } /** @@ -44,9 +59,17 @@ export interface FlyoutNavigationProps { * pass in a list of actions to be displayed on top. */ export const FlyoutNavigation: FC<FlyoutNavigationProps> = memo( - ({ flyoutIsExpandable = false, expandDetails, actions }) => { + ({ flyoutIsExpandable = false, expandDetails, actions, isPreviewMode, isPreview }) => { const { euiTheme } = useEuiTheme(); + const history = useExpandableFlyoutHistory(); + const isFlyoutHistoryEnabled = useIsExperimentalFeatureEnabled( + 'newExpandableFlyoutNavigationEnabled' + ); + const historyArray = useMemo(() => getProcessedHistory({ history, maxCount: 10 }), [history]); + // Don't show history in rule preview + const hasHistory = !isPreview && isFlyoutHistoryEnabled; + const panels = useExpandableFlyoutState(); const isExpanded: boolean = !!panels.left; @@ -101,7 +124,12 @@ export const FlyoutNavigation: FC<FlyoutNavigationProps> = memo( [expandDetails] ); - return flyoutIsExpandable || actions ? ( + // do not show navigation in preview mode + if (isPreviewMode) { + return null; + } + + return flyoutIsExpandable || actions || hasHistory ? ( <EuiFlyoutHeader hasBorder> <EuiFlexGroup direction="row" @@ -116,7 +144,30 @@ export const FlyoutNavigation: FC<FlyoutNavigationProps> = memo( `} > <EuiFlexItem grow={false}> - {flyoutIsExpandable && expandDetails && (isExpanded ? collapseButton : expandButton)} + <EuiFlexGroup + direction="row" + justifyContent="flexStart" + alignItems="center" + responsive={false} + gutterSize="none" + > + {flyoutIsExpandable && expandDetails && ( + <EuiFlexItem + grow={false} + css={css` + border-right: 1px ${euiTheme.colors.lightShade} solid; + padding-right: -${euiTheme.size.m}; + `} + > + {isExpanded ? collapseButton : expandButton} + </EuiFlexItem> + )} + {hasHistory && ( + <EuiFlexItem> + <FlyoutHistory history={historyArray} /> + </EuiFlexItem> + )} + </EuiFlexGroup> </EuiFlexItem> {actions && ( <EuiFlexItem grow={false} data-test-subj={HEADER_ACTIONS_TEST_ID}> diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx index f1dedc18d3b1..0dcda8d52339 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx @@ -16,7 +16,7 @@ import { HostPreviewPanelKey } from '../../entity_details/host_right'; import { HOST_PREVIEW_BANNER } from '../../document_details/right/components/host_entity_overview'; import { UserPreviewPanelKey } from '../../entity_details/user_right'; import { USER_PREVIEW_BANNER } from '../../document_details/right/components/user_entity_overview'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../network_details'; import { RulePreviewPanelKey, RULE_PREVIEW_BANNER } from '../../rule_details/right'; import { createTelemetryServiceMock } from '../../../common/lib/telemetry/telemetry_service.mock'; @@ -105,10 +105,11 @@ describe('<PreviewLink />', () => { getByTestId('ip-link').click(); expect(mockFlyoutApi.openPreviewPanel).toHaveBeenCalledWith({ - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: '100:XXX:XXX', flowTarget: 'source', + scopeId: 'scopeId', banner: NETWORK_PREVIEW_BANNER, }, }); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx index b6a4ea33ba4b..712156243d4c 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.tsx @@ -22,7 +22,7 @@ import { HostPreviewPanelKey } from '../../entity_details/host_right'; import { HOST_PREVIEW_BANNER } from '../../document_details/right/components/host_entity_overview'; import { UserPreviewPanelKey } from '../../entity_details/user_right'; import { USER_PREVIEW_BANNER } from '../../document_details/right/components/user_entity_overview'; -import { NetworkPanelKey, NETWORK_PREVIEW_BANNER } from '../../network_details'; +import { NetworkPreviewPanelKey, NETWORK_PREVIEW_BANNER } from '../../network_details'; import { RulePreviewPanelKey, RULE_PREVIEW_BANNER } from '../../rule_details/right'; import { DocumentEventTypes } from '../../../common/lib/telemetry'; @@ -46,9 +46,10 @@ const getPreviewParams = ( ): PreviewParams | null => { if (getEcsField(field)?.type === IP_FIELD_TYPE) { return { - id: NetworkPanelKey, + id: NetworkPreviewPanelKey, params: { ip: value, + scopeId, flowTarget: field.includes(FlowTargetSourceDest.destination) ? FlowTargetSourceDest.destination : FlowTargetSourceDest.source, diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts b/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts index f8a589f31561..7f6be4ef2fa1 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/test_ids.ts @@ -36,3 +36,18 @@ export const HEADER_ACTIONS_TEST_ID = `${FLYOUT_NAVIGATION_TEST_ID}Actions` as c export const TITLE_HEADER_ICON_TEST_ID = (dataTestSubj: string) => `${dataTestSubj}Icon`; export const TITLE_HEADER_TEXT_TEST_ID = (dataTestSubj: string) => `${dataTestSubj}Text`; export const TITLE_LINK_ICON_TEST_ID = (dataTestSubj: string) => `${dataTestSubj}LinkIcon`; + +/* History */ +export const FLYOUT_HISTORY_TEST_ID = `${PREFIX}History` as const; +export const FLYOUT_HISTORY_BUTTON_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}Button` as const; +export const FLYOUT_HISTORY_CONTEXT_PANEL_TEST_ID = + `${FLYOUT_HISTORY_TEST_ID}ContextPanel` as const; + +export const DOCUMENT_DETAILS_HISTORY_ROW_TEST_ID = + `${FLYOUT_HISTORY_TEST_ID}DocumentDetailsRow` as const; +export const RULE_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}RuleRow` as const; +export const HOST_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}HostRow` as const; +export const USER_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}UserRow` as const; +export const NETWORK_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}NetworkRow` as const; +export const GENERIC_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}GenericRow` as const; +export const NO_DATA_HISTORY_ROW_TEST_ID = `${FLYOUT_HISTORY_TEST_ID}NoDataRow` as const; diff --git a/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts b/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts index e763bb222bc7..526382372ab4 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts +++ b/x-pack/plugins/security_solution/public/flyout/shared/hooks/use_on_expandable_flyout_close.ts @@ -19,7 +19,7 @@ export interface UseOnCloseParams { /** * Hook to abstract the logic of listening to the onClose event for the Security Solution application. - * The kbn-expandable-flyout package provides the onClose callback, but has there are only 2 instances of the expandable flyout in Security Solution (normal and timeline) + * The expandable-flyout package provides the onClose callback, but has there are only 2 instances of the expandable flyout in Security Solution (normal and timeline) * we need a way to propagate the onClose event to all other components. * 2 event names are available, we pick the correct one depending on which flyout is open (if the timeline flyout is open, it is always on top, so we choose that one). */ diff --git a/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts b/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.test.ts new file mode 100644 index 000000000000..97257fa84dd8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.test.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 { getProcessedHistory } from './history_utils'; + +describe('getProcessedHistory', () => { + const simpleHistory = [{ id: '1' }, { id: '2' }, { id: '3' }, { id: '4' }]; + const complexHistory = [ + { id: '1' }, + { id: '2' }, + { id: '1' }, + { id: '3' }, + { id: '4' }, + { id: '2' }, + ]; + + it('returns a reversed history array and removes latest entry', () => { + // input: 1, 2, 3, 4 + // reverse: 4, 3, 2, 1 + // remove latest: 4, 3, 2 + const processedHistory = getProcessedHistory({ history: simpleHistory, maxCount: 5 }); + expect(processedHistory).toEqual([{ id: '3' }, { id: '2' }, { id: '1' }]); + }); + + it('returns processed history with the maxCount', () => { + // input: 1, 2, 3, 4 + // reverse: 4, 3, 2, 1 + // remove latest: 3, 2, 1 + // keep maxCount: 3, 2 + const processedHistory = getProcessedHistory({ history: simpleHistory, maxCount: 2 }); + expect(processedHistory).toEqual([{ id: '3' }, { id: '2' }]); + }); + + it('removes duplicates and reverses', () => { + // input: 1, 2, 1, 3, 4, 2 + // reverse: 2, 4, 3, 1, 2, 1 + // remove duplicates: 2, 4, 3, 1 + // remove latest: 4, 3, 1 + const processedHistory = getProcessedHistory({ history: complexHistory, maxCount: 5 }); + expect(processedHistory).toEqual([{ id: '4' }, { id: '3' }, { id: '1' }]); + }); + + it('returns empty array if history only has one entry', () => { + const processedHistory = getProcessedHistory({ history: [{ id: '1' }], maxCount: 5 }); + expect(processedHistory).toEqual([]); + }); + + it('returns empty array if history is empty', () => { + const processedHistory = getProcessedHistory({ history: [], maxCount: 5 }); + expect(processedHistory).toEqual([]); + }); +}); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.ts b/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.ts new file mode 100644 index 000000000000..ef31daa7f83f --- /dev/null +++ b/x-pack/plugins/security_solution/public/flyout/shared/utils/history_utils.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 type { FlyoutPanelProps } from '@kbn/expandable-flyout'; + +/** + * Helper function that reverses the history array, + * removes duplicates and the most recent item + * @returns a history array of maxCount length + */ +export const getProcessedHistory = ({ + history, + maxCount, +}: { + history: FlyoutPanelProps[]; + maxCount: number; +}): FlyoutPanelProps[] => { + // Step 1: reverse history so the most recent is first + const reversedHistory = history.slice().reverse(); + + // Step 2: remove duplicates + const historyArray = Array.from(new Set(reversedHistory.map((i) => JSON.stringify(i)))).map((i) => + JSON.parse(i) + ); + + // Omit the first (current) entry and return array of maxCount length + return historyArray.slice(1, maxCount + 1); +}; diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts index 6851111f99dd..8c99186f69d9 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/console_commands_definition.ts @@ -538,7 +538,7 @@ export const getEndpointConsoleCommands = ({ capabilities: endpointCapabilities, privileges: endpointPrivileges, }, - exampleUsage: `runscript --Raw=\`\`\`Get-ChildItem .\`\`\` -CommandLine=""`, + exampleUsage: `runscript --Raw="Get-ChildItem ." --CommandLine=""`, helpUsage: CROWDSTRIKE_CONSOLE_COMMANDS.runscript.helpUsage, exampleInstruction: CROWDSTRIKE_CONSOLE_COMMANDS.runscript.about, validate: capabilitiesAndPrivilegesValidator(agentType), diff --git a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts index da407b589a84..a539fec35b19 100644 --- a/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts +++ b/x-pack/plugins/security_solution/public/management/components/endpoint_responder/lib/endpoint_action_response_codes.ts @@ -294,7 +294,7 @@ const CODES = Object.freeze({ ), // Dev: - // scan success/competed + // scan success/completed ra_scan_success_done: i18n.translate( 'xpack.securitySolution.endpointActionResponseCodes.scan.success', { defaultMessage: 'Scan complete' } diff --git a/x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts b/x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts index eb4264982790..f5bb7071d859 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/cypress.d.ts @@ -11,6 +11,7 @@ import type { CasePostRequest } from '@kbn/cases-plugin/common/api'; import type { UsageRecord } from '@kbn/security-solution-serverless/server/types'; +import type { HostVmTransferResponse } from '../../../scripts/endpoint/common/types'; import type { DeletedEndpointHeartbeats, IndexedEndpointHeartbeats, @@ -30,6 +31,7 @@ import type { UninstallAgentFromHostTaskOptions, IsAgentAndEndpointUninstalledFromHostTaskOptions, LogItTaskOptions, + CaptureHostVmAgentDiagnosticsOptions, } from './types'; import type { DeleteIndexedFleetEndpointPoliciesResponse, @@ -267,6 +269,12 @@ declare global { arg: LogItTaskOptions, options?: Partial<Loggable & Timeoutable> ): Chainable<null>; + + task( + name: 'captureHostVmAgentDiagnostics', + arg: CaptureHostVmAgentDiagnosticsOptions, + options?: Partial<Loggable & Timeoutable> + ): Chainable<Omit<HostVmTransferResponse, 'delete'>>; } } } diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts index 4aa8085fbf57..1ca42c446771 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifact_tabs_in_policy_details.cy.ts @@ -63,7 +63,9 @@ const clickArtifactTab = (tabId: string) => { cy.get(`#${tabId}`).click(); }; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/171644 +// Failing: See https://github.com/elastic/kibana/issues/203935 +describe.skip( 'Artifact tabs in Policy Details page', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts index b5c41d1e66fa..6ab7979c4608 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/artifacts_mocked_data.cy.ts @@ -35,7 +35,8 @@ const loginWithoutAccess = (url: string) => { loadPage(url); }; -describe('Artifacts pages', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/191914 +describe.skip('Artifacts pages', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts> | undefined; before(() => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts index 0b010d2d6009..1a06697ad975 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/blocklist.cy.ts @@ -38,7 +38,8 @@ const { clearMultiValueInput, } = blocklistFormSelectors; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203933 +describe.skip( 'Blocklist', { tags: ['@ess', '@serverless', '@serverlessQA'], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts index af7310953e86..1e9599afb9fe 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/event_filters.cy.ts @@ -18,7 +18,9 @@ import { login } from '../../tasks/login'; import type { ReturnTypeFromChainable } from '../../types'; // Skipped in Serverless MKI due to interactions with internal indices -describe('Event Filters', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/194135 +// Failing: See https://github.com/elastic/kibana/issues/194135 +describe.skip('Event Filters', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts> | undefined; const CONDITION_VALUE = 'valuesAutocompleteMatch'; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts index aef24ed4ce04..4b47fa234377 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/artifacts/trusted_apps.cy.ts @@ -35,7 +35,8 @@ const { expectFieldOptionsNotRendered, } = trustedAppsFormSelectors; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203929 +describe.skip( 'Trusted Apps', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'], // @skipInServerlessMKI until kibana is rebuilt after merge diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts index 86e07e65e83a..065a48f7cb3c 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/automated_response_actions.cy.ts @@ -20,7 +20,8 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203921 +describe.skip( 'Automated Response Actions', { tags: ['@ess', '@serverless'], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts index 84d160c2e492..5ebb78faef5d 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/history_log.cy.ts @@ -12,7 +12,8 @@ import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts' import { login, ROLE } from '../../tasks/login'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/171640 +describe.skip( 'Response actions history page', { tags: [ diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts index a427413429b1..c27fa73dcfee 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/no_license.cy.ts @@ -14,7 +14,9 @@ import type { ReturnTypeFromChainable } from '../../types'; import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts'; -describe('No License', { tags: '@ess', env: { ftrConfig: { license: 'basic' } } }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203917 +// Failing: See https://github.com/elastic/kibana/issues/203917 +describe.skip('No License', { tags: '@ess', env: { ftrConfig: { license: 'basic' } } }, () => { describe('User cannot use endpoint action in form', () => { const [ruleName, ruleDescription] = generateRandomStringName(2); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts index fa0c232498a4..a582180d4931 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/automated_response_actions/results.cy.ts @@ -14,7 +14,8 @@ import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts' import { login, ROLE } from '../../tasks/login'; -describe('Results', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/171665 +describe.skip('Results', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts> | undefined; let alertData: ReturnTypeFromChainable<typeof indexEndpointRuleAlerts> | undefined; const [endpointAgentId, endpointHostname] = generateRandomStringName(2); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts index 12cdfcfa6e09..2e9bbeb2a766 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints.cy.ts @@ -28,7 +28,8 @@ import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; -describe('Endpoints page', { tags: ['@ess', '@serverless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/168284 +describe.skip('Endpoints page', { tags: ['@ess', '@serverless'] }, () => { let indexedPolicy: IndexedFleetEndpointPolicyResponse; let policy: PolicyData; let createdHost: CreateAndEnrollEndpointHostResponse; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts index 2235cd3df683..dc0e35fb6a28 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_mocked_data.cy.ts @@ -13,7 +13,8 @@ import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; import { login } from '../../tasks/login'; import { loadPage } from '../../tasks/common'; -describe('Endpoints page', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/171639 +describe.skip('Endpoints page', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts>; before(() => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts index 62786effd830..f831cc24778f 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_list/endpoints_rbac_mocked_data.cy.ts @@ -14,7 +14,8 @@ import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; import { login } from '../../tasks/login'; import { loadPage } from '../../tasks/common'; -describe('Endpoints RBAC', { tags: ['@ess'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203930 +describe.skip('Endpoints RBAC', { tags: ['@ess'] }, () => { type Privilege = 'all' | 'read' | 'none'; const PRIVILEGES: Privilege[] = ['none', 'read', 'all']; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts index ee6ff0951d11..f3ee7e9dcf6c 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/policy/policy_list.cy.ts @@ -13,7 +13,8 @@ import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/e import { login } from '../../tasks/login'; import { createAgentPolicyTask, getEndpointIntegrationVersion } from '../../tasks/fleet'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203918 +describe.skip( 'Policy List', { tags: ['@ess', '@serverless', '@serverlessQA'], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts index eed5970fbc9d..c04db294c77c 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.ts @@ -27,7 +27,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/179598 +describe.skip( 'Response console: From Alerts', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts index 2ff96b249cfd..c1223c2f22d4 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/document_signing.cy.ts @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; -describe('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/170674 +describe.skip('Document signing:', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { let indexedPolicy: IndexedFleetEndpointPolicyResponse; let policy: PolicyData; let createdHost: CreateAndEnrollEndpointHostResponse; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts index 64cc11e55353..de1f9524326f 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/endpoints_list_response_console.cy.ts @@ -20,7 +20,8 @@ import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; import { createEndpointHost } from '../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/169821 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts index c5d88ad5420b..a7f600521e8f 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/isolate_mocked_data.cy.ts @@ -29,7 +29,8 @@ import { indexNewCase } from '../../tasks/index_new_case'; import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; import { indexEndpointRuleAlerts } from '../../tasks/index_endpoint_rule_alerts'; -describe('Isolate command', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/182459 +describe.skip('Isolate command', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { describe('from Manage', () => { let endpointData: ReturnTypeFromChainable<typeof indexEndpointHosts> | undefined; let isolatedEndpointData: ReturnTypeFromChainable<typeof indexEndpointHosts> | undefined; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts index dfd67d6854b6..93c6f0698a81 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_actions_history.cy.ts @@ -10,7 +10,8 @@ import { indexEndpointHosts } from '../../tasks/index_endpoint_hosts'; import { login } from '../../tasks/login'; import { loadPage } from '../../tasks/common'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/172549 +describe.skip( 'Response actions history page', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts index d5f3bd7d956a..a95c935c4ca9 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/170373 +describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts index ef252cbce01a..c36c9153a248 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/170424 +describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => { beforeEach(() => { login(); }); @@ -66,6 +67,15 @@ describe('Response console', { tags: ['@ess', '@serverless'] }, () => { } }); + afterEach(function () { + if (Cypress.env('IS_CI') && this.currentTest?.isFailed() && createdHost) { + cy.task('captureHostVmAgentDiagnostics', { + hostname: createdHost.hostname, + fileNamePrefix: this.currentTest?.fullTitle(), + }); + } + }); + it('"get-file --path" - should retrieve a file', () => { const downloadsFolder = Cypress.config('downloadsFolder'); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts index b08dcd0eea49..8b6ca1ed95e1 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts @@ -26,7 +26,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/173464 +describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => { let indexedPolicy: IndexedFleetEndpointPolicyResponse; let policy: PolicyData; let createdHost: CreateAndEnrollEndpointHostResponse; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts index a2b150bfad0c..fc5a05cbc777 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts @@ -28,6 +28,7 @@ const AGENT_BEAT_FILE_PATH_SUFFIX = '/components/agentbeat'; // FLAKY: https://github.com/elastic/kibana/issues/170370 // FLAKY: https://github.com/elastic/kibana/issues/170371 +// FLAKY: https://github.com/elastic/kibana/issues/170563 describe.skip('Response console', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { beforeEach(() => { login(); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts index 4f45522a76ec..dba28400b8ed 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts @@ -27,7 +27,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe('Response console', { tags: ['@ess', '@serverless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/172326 +describe.skip('Response console', { tags: ['@ess', '@serverless'] }, () => { let indexedPolicy: IndexedFleetEndpointPolicyResponse; let policy: PolicyData; let createdHost: CreateAndEnrollEndpointHostResponse; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts index e9ca6a7ee422..c1e566c16ca5 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts @@ -41,7 +41,8 @@ describe( login(); }); - describe('Scan operation:', () => { + // FLAKY: https://github.com/elastic/kibana/issues/187932 + describe.skip('Scan operation:', () => { const homeFilePath = Cypress.env('IS_CI') ? '/home/vagrant' : '/home'; const fileContent = 'This is a test file for the scan command.'; diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts index 5c7432129e43..bf89837ae414 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/execute.cy.ts @@ -17,7 +17,9 @@ import { import { interceptActionRequests, sendActionResponse } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203899 +// Failing: See https://github.com/elastic/kibana/issues/203899 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts index 978b1e2cd37d..87d11f163c3f 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/get_file.cy.ts @@ -17,7 +17,8 @@ import { import { interceptActionRequests, sendActionResponse } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203905 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts index 0afac2d5dc45..1d67a1dd5ebb 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/isolate.cy.ts @@ -22,7 +22,8 @@ import { } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203896 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts index 3c484d2a6fa7..bbb527e38526 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/kill_process.cy.ts @@ -17,7 +17,8 @@ import { import { interceptActionRequests, sendActionResponse } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203919 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts index e4226aae4c39..d18dafba9126 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/processes.cy.ts @@ -18,7 +18,8 @@ import { import { interceptActionRequests, sendActionResponse } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203907 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts index f4c68a4fd040..aa083545877a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/release.cy.ts @@ -22,7 +22,8 @@ import { } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/203904 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts index b5ef08feb807..544d13e1ab08 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console_mocked/suspend_process.cy.ts @@ -17,7 +17,8 @@ import { import { interceptActionRequests, sendActionResponse } from '../../../tasks/isolate'; import { login } from '../../../tasks/login'; -describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { +// Failing: See https://github.com/elastic/kibana/issues/180388 +describe.skip('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { beforeEach(() => { login(); }); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts index d82bde7f0426..2c79cff9fede 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/endpoint_list_with_security_essentials.cy.ts @@ -15,7 +15,8 @@ import { visitEndpointList, } from '../../screens'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/171643 +describe.skip( 'When on the Endpoint List in Security Essentials PLI', { tags: ['@serverless', '@skipInServerlessMKI'], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts index ca3d0b9f6c1a..727597cdc458 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/serverless/roles/complete_with_endpoint_roles.cy.ts @@ -30,7 +30,8 @@ import { visitPolicyList, } from '../../../screens'; -describe( +// FLAKY: https://github.com/elastic/kibana/issues/170052 +describe.skip( 'User Roles for Security Complete PLI with Endpoint Complete addon', { tags: ['@serverless', '@skipInServerlessMKI'], diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts index 674ede811fc7..0be9b83fe32f 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/unenroll_agent_from_fleet.cy.ts @@ -20,7 +20,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203913 +describe.skip( 'Unenroll agent from fleet with agent tamper protection is disabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts index 6f82d9c98a0c..819506722f8b 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/disabled/uninstall_agent_from_host.cy.ts @@ -21,7 +21,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203911 +describe.skip( 'Uninstall agent from host when agent tamper protection is disabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts index 0915cd578adc..48f9a59a2601 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/unenroll_agent_from_fleet.cy.ts @@ -20,7 +20,8 @@ import { login } from '../../../tasks/login'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182451 +describe.skip( 'Unenroll agent from fleet when agent tamper protection is enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts index 286be75f745b..aea4ee91829c 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/enabled/uninstall_agent_from_host.cy.ts @@ -22,7 +22,8 @@ import { login } from '../../../tasks/login'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182448 +describe.skip( 'Uninstall agent from host when agent tamper protection is enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts index 67c71e4bd5ff..27a9d8e94409 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_disabled_to_enabled.cy.ts @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203932 +describe.skip( 'Unenroll agent from fleet when agent tamper protection is disabled but then is switched to a policy with it enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts index 687b2a5924be..d81afeed57bb 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_disabled.cy.ts @@ -22,7 +22,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/203934 +describe.skip( 'Unenroll agent from fleet changing when agent tamper protection is enabled but then is switched to a policy with it disabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts index cf091cdccc60..5a6326b77582 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/unenroll_agent_from_fleet_changing_policy_from_enabled_to_enabled.cy.ts @@ -21,7 +21,8 @@ import { login } from '../../../tasks/login'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182505 +describe.skip( 'Unenroll agent from fleet changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts index 63f471533151..29fa081ef4fe 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_disabled_to_enabled.cy.ts @@ -24,7 +24,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182458 +describe.skip( 'Uninstall agent from host changing agent policy when agent tamper protection is disabled but then is switched to a policy with it enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts index 45b278539d5b..1c87e379234b 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_disabled.cy.ts @@ -23,7 +23,8 @@ import { enableAllPolicyProtections } from '../../../tasks/endpoint_policy'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182515 +describe.skip( 'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it disabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts index db49f448bc98..1cdb4833945a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/tamper_protection/switching_policies/uninstall_agent_from_host_changing_policy_from_enabled_to_enabled.cy.ts @@ -23,7 +23,8 @@ import { login } from '../../../tasks/login'; import { createEndpointHost } from '../../../tasks/create_endpoint_host'; import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_data'; -describe( +// Failing: See https://github.com/elastic/kibana/issues/182450 +describe.skip( 'Uninstall agent from host changing agent policy when agent tamper protection is enabled but then is switched to a policy with it also enabled', { tags: ['@ess'] }, () => { diff --git a/x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts b/x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts index d3cec917610f..7575b1ba7d1b 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/screens/responder.ts @@ -29,6 +29,8 @@ export const getConsoleHelpPanelResponseActionTestSubj = (): Record< execute: 'endpointResponseActionsConsole-commandList-Responseactions-execute', upload: 'endpointResponseActionsConsole-commandList-Responseactions-upload', scan: 'endpointResponseActionsConsole-commandList-Responseactions-scan', + // Not implemented in Endpoint yet + // runscript: 'endpointResponseActionsConsole-commandList-Responseactions-runscript', }; }; diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts b/x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts index 3abf04765ca5..a85feb74f1d9 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/support/data_loaders.ts @@ -11,6 +11,10 @@ import type { CasePostRequest } from '@kbn/cases-plugin/common'; import execa from 'execa'; import type { KbnClient } from '@kbn/test'; import type { ToolingLog } from '@kbn/tooling-log'; +import { REPO_ROOT } from '@kbn/repo-info'; +// This is a Cypress module and only used by Cypress, so disabling "should" be safe +// eslint-disable-next-line import/no-nodejs-modules +import { mkdir } from 'node:fs/promises'; import type { IndexedEndpointHeartbeats } from '../../../../common/endpoint/data_loaders/index_endpoint_hearbeats'; import { deleteIndexedEndpointHeartbeats, @@ -53,6 +57,7 @@ import type { LoadUserAndRoleCyTaskOptions, CreateUserAndRoleCyTaskOptions, LogItTaskOptions, + CaptureHostVmAgentDiagnosticsOptions, } from '../types'; import type { DeletedIndexedEndpointRuleAlerts, @@ -75,6 +80,7 @@ import { deleteAgentPolicy, fetchAgentPolicyEnrollmentKey, getOrCreateDefaultAgentPolicy, + setAgentLoggingLevel, } from '../../../../scripts/endpoint/common/fleet_services'; import { startElasticAgentWithDocker } from '../../../../scripts/endpoint/common/elastic_agent_service'; import type { IndexedFleetEndpointPolicyResponse } from '../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; @@ -433,6 +439,7 @@ ${s1Info.status} log, kbnClient, }); + await setAgentLoggingLevel(kbnClient, newHost.agentId, 'debug', log); await waitForEndpointToStreamData(kbnClient, newHost.agentId, 360000); return newHost; } catch (err) { @@ -531,5 +538,65 @@ ${s1Info.status} await startEndpointHost(hostName); return null; }, + + /** + * Generates an Agent Diagnostics archive (ZIP) directly on the Host VM and saves it to a directory + * that is then included with the list of Artifacts that are captured with Buildkite job. + * + * ### Usage: + * + * This task is best used from a `afterEach()` by checking if the test failed and if so (and it + * was a test that was running against a host VM), then capture the diagnostics file + * + * @param hostname + * + * @example + * + * describe('something', () => { + * let hostVm; + * + * afterEach(function() { // << Important: Note the use of `function()` here instead of arrow function + * if (this.currentTest?.isFailed() && hostVm) { + * cy.task('captureHostVmAgentDiagnostics', { hostname: hostVm.hostname }); + * } + * }); + * + * //... + * }) + */ + captureHostVmAgentDiagnostics: async ({ + hostname, + fileNamePrefix = '', + }: CaptureHostVmAgentDiagnosticsOptions) => { + const { log } = await stackServicesPromise; + + log.info(`Capturing agent diagnostics for host VM [${hostname}]`); + + const vmClient = getHostVmClient(hostname, undefined, undefined, log); + const fileName = `elastic-agent-diagnostics-${hostname}-${new Date() + .toISOString() + .replace(/:/g, '.')}.zip`; + const vmDiagnosticsFile = `/tmp/${fileName}`; + const localDiagnosticsDir = `${REPO_ROOT}/target/test_failures`; + const localDiagnosticsFile = `${localDiagnosticsDir}/${ + fileNamePrefix + ? // Insure the file name prefix does not have characters that can't be used in file names + `${fileNamePrefix.replace(/[><:"/\\|?*'`{} ]/g, '_')}-` + : '' + }${fileName}`; + + await mkdir(localDiagnosticsDir, { recursive: true }); + + // generate diagnostics file on the host and then download it + await vmClient.exec( + `sudo /opt/Elastic/Agent/elastic-agent diagnostics --file ${vmDiagnosticsFile}` + ); + return vmClient.download(vmDiagnosticsFile, localDiagnosticsFile).then((response) => { + log.info(`Agent diagnostic file for host [${hostname}] has been downloaded and is available at: + ${response.filePath} +`); + return { filePath: response.filePath }; + }); + }, }); }; diff --git a/x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts b/x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts index b4901bef9321..a8c85fad1c3a 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/support/setup_tooling_log_level.ts @@ -16,10 +16,20 @@ export const setupToolingLogLevel = (config: Cypress.PluginConfigOptions) => { const log = createToolingLogger(); const defaultToolingLogLevel = config.env.TOOLING_LOG_LEVEL; - log.info(`Cypress config 'env.TOOLING_LOG_LEVEL': ${defaultToolingLogLevel}`); + log.info(` + +Cypress Configuration File: ${config.configFile} + +'env.TOOLING_LOG_LEVEL' set to: ${defaultToolingLogLevel} + +*** FYI: *** To help with test failures, an environmental variable named 'TOOLING_LOG_LEVEL' can be set + with a value of 'verbose' in order to capture more data in the logs. This environment + property can be set either in the runtime environment (ex. local shell or buildkite) or + directly in the Cypress configuration file \`env: {}\` section. + + `); if (defaultToolingLogLevel && defaultToolingLogLevel !== createToolingLogger.defaultLogLevel) { createToolingLogger.defaultLogLevel = defaultToolingLogLevel; - log.info(`Default log level for 'createToolingLogger()' set to ${defaultToolingLogLevel}`); } }; diff --git a/x-pack/plugins/security_solution/public/management/cypress/types.ts b/x-pack/plugins/security_solution/public/management/cypress/types.ts index 8beb150a64d5..e23ff82fa847 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/types.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/types.ts @@ -81,3 +81,8 @@ export interface LogItTaskOptions { level: keyof Pick<ToolingLog, 'info' | 'debug' | 'verbose'>; data: any; } + +export interface CaptureHostVmAgentDiagnosticsOptions { + hostname: string; + fileNamePrefix?: string; +} diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx index c1e7539c8e10..a8d7aa78d0c9 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_card.tsx @@ -5,8 +5,9 @@ * 2.0. */ -import React, { useCallback, useState } from 'react'; +import React, { useCallback, useEffect, useState } from 'react'; import { EuiSpacer, EuiText } from '@elastic/eui'; +import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; import { OnboardingCardId } from '../../../../../constants'; import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; import { useLatestStats } from '../../../../../../siem_migrations/rules/service/hooks/use_latest_stats'; @@ -21,22 +22,29 @@ import * as i18n from './translations'; import { MissingAIConnectorCallout } from './missing_ai_connector_callout'; export const StartMigrationCard: OnboardingCardComponent = React.memo( - ({ checkComplete, isCardComplete, setExpandedCardId }) => { + ({ setComplete, isCardComplete, setExpandedCardId }) => { const styles = useStyles(); - const { data: migrationsStats, isLoading } = useLatestStats(); + const { data: migrationsStats, isLoading, refreshStats } = useLatestStats(); const [isFlyoutOpen, setIsFlyoutOpen] = useState<boolean>(); const [flyoutMigrationStats, setFlyoutMigrationStats] = useState< RuleMigrationTaskStats | undefined >(); + useEffect(() => { + // Set card complete if any migration is finished + if (!isCardComplete(OnboardingCardId.siemMigrationsStart) && migrationsStats) { + if (migrationsStats.some(({ status }) => status === SiemMigrationTaskStatus.FINISHED)) { + setComplete(true); + } + } + }, [isCardComplete, migrationsStats, setComplete]); + const closeFlyout = useCallback(() => { setIsFlyoutOpen(false); setFlyoutMigrationStats(undefined); - if (!isCardComplete(OnboardingCardId.siemMigrationsStart)) { - checkComplete(); - } - }, [checkComplete, isCardComplete]); + refreshStats(); + }, [refreshStats]); const openFlyout = useCallback((migrationStats?: RuleMigrationTaskStats) => { setFlyoutMigrationStats(migrationStats); diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts index 41e65352d4bc..79a7238b9554 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/start_migration_check_complete.ts @@ -5,12 +5,15 @@ * 2.0. */ +import { SiemMigrationTaskStatus } from '../../../../../../../common/siem_migrations/constants'; import type { OnboardingCardCheckComplete } from '../../../../../types'; export const checkStartMigrationCardComplete: OnboardingCardCheckComplete = async ({ siemMigrations, }) => { const migrationsStats = await siemMigrations.rules.getRuleMigrationsStats(); - const isComplete = migrationsStats.length > 0; + const isComplete = migrationsStats.some( + (migrationStats) => migrationStats.status === SiemMigrationTaskStatus.FINISHED + ); return isComplete; }; diff --git a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx index 95b53d921fd1..6d011fc5fbb5 100644 --- a/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx +++ b/x-pack/plugins/security_solution/public/onboarding/components/onboarding_body/cards/siem_migrations/start_migration/upload_rules_panels.tsx @@ -28,7 +28,7 @@ export const UploadRulesPanels = React.memo<UploadRulesPanelsProps>(({ migration <UploadRulesPanel isUploadMore /> </EuiFlexItem> {migrationsStats.map((migrationStats) => ( - <EuiFlexItem grow={false}> + <EuiFlexItem grow={false} key={migrationStats.id}> {migrationStats.status === SiemMigrationTaskStatus.READY && ( <MigrationReadyPanel migrationStats={migrationStats} /> )} diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts index 57fb5d042209..02fb423b0527 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/api/index.ts @@ -7,6 +7,7 @@ import { replaceParams } from '@kbn/openapi-common/shared'; +import type { UpdateRuleMigrationData } from '../../../../common/siem_migrations/model/rule_migration.gen'; import type { LangSmithOptions } from '../../../../common/siem_migrations/model/common.gen'; import { KibanaServices } from '../../../common/lib/kibana'; @@ -19,6 +20,8 @@ import { SIEM_RULE_MIGRATION_START_PATH, SIEM_RULE_MIGRATION_STATS_PATH, SIEM_RULE_MIGRATION_TRANSLATION_STATS_PATH, + SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH, + SIEM_RULE_MIGRATION_RESOURCES_PATH, SIEM_RULE_MIGRATIONS_PREBUILT_RULES_PATH, } from '../../../../common/siem_migrations/constants'; import type { @@ -31,7 +34,11 @@ import type { InstallMigrationRulesResponse, StartRuleMigrationRequestBody, GetRuleMigrationStatsResponse, + GetRuleMigrationResourcesMissingResponse, + UpsertRuleMigrationResourcesRequestBody, + UpsertRuleMigrationResourcesResponse, GetRuleMigrationPrebuiltRulesResponse, + UpdateRuleMigrationResponse, } from '../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; export interface GetRuleMigrationStatsParams { @@ -86,6 +93,43 @@ export const createRuleMigration = async ({ ); }; +export interface GetRuleMigrationMissingResourcesParams { + /** `id` of the migration to get missing resources for */ + migrationId: string; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Retrieves all missing resources of a specific migration. */ +export const getMissingResources = async ({ + migrationId, + signal, +}: GetRuleMigrationMissingResourcesParams): Promise<GetRuleMigrationResourcesMissingResponse> => { + return KibanaServices.get().http.get<GetRuleMigrationResourcesMissingResponse>( + replaceParams(SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH, { migration_id: migrationId }), + { version: '1', signal } + ); +}; + +export interface UpsertResourcesParams { + /** Optional `id` of migration to add the resources to. */ + migrationId: string; + /** The body containing the `connectorId` to use for the migration */ + body: UpsertRuleMigrationResourcesRequestBody; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Updates or creates resources for a specific migration. */ +export const upsertMigrationResources = async ({ + migrationId, + body, + signal, +}: UpsertResourcesParams): Promise<UpsertRuleMigrationResourcesResponse> => { + return KibanaServices.get().http.post<UpsertRuleMigrationResourcesResponse>( + replaceParams(SIEM_RULE_MIGRATION_RESOURCES_PATH, { migration_id: migrationId }), + { body: JSON.stringify(body), version: '1', signal } + ); +}; + export interface StartRuleMigrationParams { /** `id` of the migration to start */ migrationId: string; @@ -126,6 +170,8 @@ export interface GetRuleMigrationParams { sortDirection?: 'asc' | 'desc'; /** Optional search term to filter documents */ searchTerm?: string; + /** Optional rules ids to filter documents */ + ids?: string[]; /** Optional AbortSignal for cancelling request */ signal?: AbortSignal; } @@ -137,6 +183,7 @@ export const getRuleMigrations = async ({ sortField, sortDirection, searchTerm, + ids, signal, }: GetRuleMigrationParams): Promise<GetRuleMigrationResponse> => { return KibanaServices.get().http.get<GetRuleMigrationResponse>( @@ -149,6 +196,7 @@ export const getRuleMigrations = async ({ sort_field: sortField, sort_direction: sortDirection, search_term: searchTerm, + ids, }, signal, } @@ -230,3 +278,21 @@ export const getRuleMigrationsPrebuiltRules = async ({ { version: '1', signal } ); }; + +export interface UpdateRulesParams { + /** The list of migration rules data to update */ + rulesToUpdate: UpdateRuleMigrationData[]; + /** Optional AbortSignal for cancelling request */ + signal?: AbortSignal; +} +/** Updates provided migration rules. */ +export const updateMigrationRules = async ({ + rulesToUpdate, + signal, +}: UpdateRulesParams): Promise<UpdateRuleMigrationResponse> => { + return KibanaServices.get().http.put<UpdateRuleMigrationResponse>(SIEM_RULE_MIGRATIONS_PATH, { + version: '1', + body: JSON.stringify(rulesToUpdate), + signal, + }); +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts index aa331bf17c83..d390b395ed98 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/constants.ts @@ -5,13 +5,7 @@ * 2.0. */ -export enum DataInputStep { - rules = 'rules', - macros = 'macros', - lookups = 'lookups', -} - -export const SPL_RULES_COLUMNS = [ +export const SPLUNK_RULES_COLUMNS = [ 'id', 'title', 'search', @@ -23,4 +17,9 @@ export const SPL_RULES_COLUMNS = [ export const RULES_SPLUNK_QUERY = `| rest /servicesNS/-/-/saved/searches | search action.correlationsearch.enabled = "1" OR (eai:acl.app = "Splunk_Security_Essentials" AND is_scheduled=1) | where disabled=0 -| table ${SPL_RULES_COLUMNS.join(', ')}`; +| table ${SPLUNK_RULES_COLUMNS.join(', ')}`; + +export const SPLUNK_MACROS_COLUMNS = ['title', 'definition'] as const; + +export const MACROS_SPLUNK_QUERY = `| rest /servicesNS/-/-/admin/macros count=0 +| table ${SPLUNK_MACROS_COLUMNS.join(', ')}`; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx index 6a4916a5e54b..ffc40c59d495 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/data_input_flyout.tsx @@ -17,10 +17,19 @@ import { EuiButton, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n-react'; -import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; -import { DataInputStep } from './constants'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; import { RulesDataInput } from './steps/rules/rules_data_input'; import { useStartMigration } from '../../service/hooks/use_start_migration'; +import { DataInputStep } from './types'; +import { MacrosDataInput } from './steps/macros/macros_data_input'; + +interface MissingResourcesIndexed { + macros: string[]; + lookups: string[]; +} export interface MigrationDataInputFlyoutProps { onClose: () => void; @@ -31,6 +40,9 @@ export const MigrationDataInputFlyout = React.memo<MigrationDataInputFlyoutProps const [migrationStats, setMigrationStats] = useState<RuleMigrationTaskStats | undefined>( initialMigrationSats ); + const [missingResourcesIndexed, setMissingResourcesIndexed] = useState< + MissingResourcesIndexed | undefined + >(); const { startMigration, isLoading: isStartLoading } = useStartMigration(onClose); const onStartMigration = useCallback(() => { @@ -39,23 +51,43 @@ export const MigrationDataInputFlyout = React.memo<MigrationDataInputFlyoutProps } }, [migrationStats, startMigration]); - const [dataInputStep, setDataInputStep] = useState<DataInputStep>(() => { - if (migrationStats) { - return DataInputStep.macros; - } - return DataInputStep.rules; - }); + const [dataInputStep, setDataInputStep] = useState<DataInputStep>(DataInputStep.Rules); - const onMigrationCreated = useCallback( - (createdMigrationStats: RuleMigrationTaskStats) => { - if (createdMigrationStats) { - setMigrationStats(createdMigrationStats); - setDataInputStep(DataInputStep.macros); + const onMigrationCreated = useCallback((createdMigrationStats: RuleMigrationTaskStats) => { + setMigrationStats(createdMigrationStats); + }, []); + + const onMissingResourcesFetched = useCallback( + (missingResources: RuleMigrationResourceData[]) => { + const newMissingResourcesIndexed = missingResources.reduce<MissingResourcesIndexed>( + (acc, { type, name }) => { + if (type === 'macro') { + acc.macros.push(name); + } else if (type === 'list') { + acc.lookups.push(name); + } + return acc; + }, + { macros: [], lookups: [] } + ); + setMissingResourcesIndexed(newMissingResourcesIndexed); + if (newMissingResourcesIndexed.macros.length) { + setDataInputStep(DataInputStep.Macros); + return; + } + if (newMissingResourcesIndexed.lookups.length) { + setDataInputStep(DataInputStep.Lookups); + return; } + setDataInputStep(DataInputStep.End); }, - [setDataInputStep] + [] ); + const onMacrosCreated = useCallback(() => { + setDataInputStep(DataInputStep.Lookups); + }, []); + return ( <EuiFlyoutResizable onClose={onClose} @@ -75,10 +107,25 @@ export const MigrationDataInputFlyout = React.memo<MigrationDataInputFlyoutProps </EuiTitle> </EuiFlyoutHeader> <EuiFlyoutBody> - <RulesDataInput - selected={dataInputStep === DataInputStep.rules} - onMigrationCreated={onMigrationCreated} - /> + <EuiFlexGroup direction="column" gutterSize="m"> + <EuiFlexItem> + <RulesDataInput + dataInputStep={dataInputStep} + migrationStats={migrationStats} + onMigrationCreated={onMigrationCreated} + onMissingResourcesFetched={onMissingResourcesFetched} + /> + </EuiFlexItem> + <EuiFlexItem> + <MacrosDataInput + dataInputStep={dataInputStep} + missingMacros={missingResourcesIndexed?.macros} + migrationStats={migrationStats} + onMacrosCreated={onMacrosCreated} + onMissingResourcesFetched={onMissingResourcesFetched} + /> + </EuiFlexItem> + </EuiFlexGroup> </EuiFlyoutBody> <EuiFlyoutFooter> <EuiFlexGroup justifyContent="spaceBetween"> diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.ts new file mode 100644 index 000000000000..f9f14298d00b --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/get_status.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 type { EuiStepStatus } from '@elastic/eui'; + +export const getStatus = (step: number, currentStep: number): EuiStepStatus => { + if (step === currentStep) { + return 'current'; + } + if (step < currentStep) { + return 'complete'; + } + return 'incomplete'; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx index 438134b0ad99..fc0bd0e8c3b4 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/sub_step_wrapper.tsx @@ -16,11 +16,11 @@ const style = css` } `; -export const SubStepWrapper = React.memo<PropsWithChildren<{}>>(({ children }) => { +export const SubStepsWrapper = React.memo<PropsWithChildren<{}>>(({ children }) => { return ( <EuiPanel hasShadow={false} paddingSize="xs" className={style}> {children} </EuiPanel> ); }); -SubStepWrapper.displayName = 'SubStepWrapper'; +SubStepsWrapper.displayName = 'SubStepsWrapper'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts new file mode 100644 index 000000000000..b99cf826194f --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/common/use_parse_file_input.ts @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useState, useCallback } from 'react'; +import { FILE_UPLOAD_ERROR } from '../../translations'; + +export interface SplunkRow<T extends object = object> { + result: T; +} + +export type OnFileParsed = (content: SplunkRow[]) => void; + +export const useParseFileInput = (onFileParsed: OnFileParsed) => { + const [isParsing, setIsParsing] = useState<boolean>(false); + const [error, setError] = useState<string>(); + + const parseFile = useCallback( + (files: FileList | null) => { + if (!files) { + return; + } + + setError(undefined); + + const rulesFile = files[0]; + const reader = new FileReader(); + + reader.onloadstart = () => setIsParsing(true); + reader.onloadend = () => setIsParsing(false); + + reader.onload = function (e) { + // We can safely cast to string since we call `readAsText` to load the file. + const fileContent = e.target?.result as string | undefined; + + if (fileContent == null) { + setError(FILE_UPLOAD_ERROR.CAN_NOT_READ); + return; + } + + if (fileContent === '' && e.loaded > 100000) { + // V8-based browsers can't handle large files and return an empty string + // instead of an error; see https://stackoverflow.com/a/61316641 + setError(FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); + return; + } + + try { + const parsedData = parseContent(fileContent); + onFileParsed(parsedData); + } catch (err) { + setError(err.message); + } + }; + + const handleReaderError = function () { + const message = reader.error?.message; + if (message) { + setError(FILE_UPLOAD_ERROR.CAN_NOT_READ_WITH_REASON(message)); + } else { + setError(FILE_UPLOAD_ERROR.CAN_NOT_READ); + } + }; + + reader.onerror = handleReaderError; + reader.onabort = handleReaderError; + + reader.readAsText(rulesFile); + }, + [onFileParsed] + ); + + return { parseFile, isParsing, error }; +}; + +const parseContent = (fileContent: string): SplunkRow[] => { + const trimmedContent = fileContent.trim(); + let arrayContent: SplunkRow[]; + if (trimmedContent.startsWith('[')) { + arrayContent = parseJSONArray(trimmedContent); + } else { + arrayContent = parseNDJSON(trimmedContent); + } + if (arrayContent.length === 0) { + throw new Error(FILE_UPLOAD_ERROR.EMPTY); + } + return arrayContent; +}; + +const parseNDJSON = (fileContent: string): SplunkRow[] => { + return fileContent + .split(/\n(?=\{)/) // split at newline followed by '{'. + .filter((entry) => entry.trim() !== '') // Remove empty entries. + .map(parseJSON); // Parse each entry as JSON. +}; + +const parseJSONArray = (fileContent: string): SplunkRow[] => { + const parsedContent = parseJSON(fileContent); + if (!Array.isArray(parsedContent)) { + throw new Error(FILE_UPLOAD_ERROR.NOT_ARRAY); + } + return parsedContent; +}; + +const parseJSON = (fileContent: string) => { + try { + return JSON.parse(fileContent); + } catch (error) { + if (error instanceof RangeError) { + throw new Error(FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); + } + throw new Error(FILE_UPLOAD_ERROR.CAN_NOT_PARSE); + } +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx new file mode 100644 index 000000000000..f19e704b9671 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/macros_data_input.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { EuiStepProps } from '@elastic/eui'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiPanel, + EuiStepNumber, + EuiSteps, + EuiTitle, +} from '@elastic/eui'; +import React, { useCallback, useMemo, useState } from 'react'; +import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { SubStepsWrapper } from '../common/sub_step_wrapper'; +import type { OnResourcesCreated, OnMissingResourcesFetched, DataInputStep } from '../../types'; +import { getStatus } from '../common/get_status'; +import { useCopyExportQueryStep } from './sub_steps/copy_export_query'; +import { useMacrosFileUploadStep } from './sub_steps/macros_file_upload'; +import * as i18n from './translations'; +import { useCheckResourcesStep } from './sub_steps/check_resources'; + +const DataInputStepNumber: DataInputStep = 2; + +interface MacrosDataInputSubStepsProps { + migrationStats: RuleMigrationTaskStats; + missingMacros: string[]; + onMacrosCreated: OnResourcesCreated; + onMissingResourcesFetched: OnMissingResourcesFetched; +} +interface MacrosDataInputProps + extends Omit<MacrosDataInputSubStepsProps, 'migrationStats' | 'missingMacros'> { + dataInputStep: DataInputStep; + migrationStats?: RuleMigrationTaskStats; + missingMacros?: string[]; +} +export const MacrosDataInput = React.memo<MacrosDataInputProps>( + ({ + dataInputStep, + migrationStats, + missingMacros, + onMacrosCreated, + onMissingResourcesFetched, + }) => { + const dataInputStatus = useMemo( + () => getStatus(DataInputStepNumber, dataInputStep), + [dataInputStep] + ); + + return ( + <EuiPanel hasShadow={false} hasBorder> + <EuiFlexGroup direction="column"> + <EuiFlexItem> + <EuiFlexGroup direction="row" justifyContent="center" gutterSize="m"> + <EuiFlexItem grow={false}> + <EuiStepNumber + titleSize="xs" + number={DataInputStepNumber} + status={dataInputStatus} + /> + </EuiFlexItem> + <EuiFlexItem> + <EuiTitle size="xs"> + <b>{i18n.MACROS_DATA_INPUT_TITLE}</b> + </EuiTitle> + </EuiFlexItem> + </EuiFlexGroup> + </EuiFlexItem> + {dataInputStatus === 'current' && migrationStats && missingMacros && ( + <EuiFlexItem> + <MacrosDataInputSubSteps + migrationStats={migrationStats} + missingMacros={missingMacros} + onMacrosCreated={onMacrosCreated} + onMissingResourcesFetched={onMissingResourcesFetched} + /> + </EuiFlexItem> + )} + </EuiFlexGroup> + </EuiPanel> + ); + } +); +MacrosDataInput.displayName = 'MacrosDataInput'; + +const END = 10 as const; +type SubStep = 1 | 2 | 3 | typeof END; +export const MacrosDataInputSubSteps = React.memo<MacrosDataInputSubStepsProps>( + ({ migrationStats, missingMacros, onMacrosCreated, onMissingResourcesFetched }) => { + const [subStep, setSubStep] = useState<SubStep>(missingMacros.length ? 1 : 3); + + // Copy query step + const onCopied = useCallback(() => { + setSubStep(2); + }, []); + const copyStep = useCopyExportQueryStep({ status: getStatus(1, subStep), onCopied }); + + // Upload macros step + const onMacrosCreatedStep = useCallback<OnResourcesCreated>(() => { + onMacrosCreated(); + setSubStep(3); + }, [onMacrosCreated]); + const uploadStep = useMacrosFileUploadStep({ + status: getStatus(2, subStep), + migrationStats, + missingMacros, + onMacrosCreated: onMacrosCreatedStep, + }); + + // Check missing resources step + const onMissingResourcesFetchedStep = useCallback<OnMissingResourcesFetched>( + (newMissingResources) => { + onMissingResourcesFetched(newMissingResources); + setSubStep(END); + }, + [onMissingResourcesFetched] + ); + const resourcesStep = useCheckResourcesStep({ + status: getStatus(3, subStep), + migrationStats, + onMissingResourcesFetched: onMissingResourcesFetchedStep, + }); + + const steps = useMemo<EuiStepProps[]>( + () => [copyStep, uploadStep, resourcesStep], + [copyStep, uploadStep, resourcesStep] + ); + + return ( + <SubStepsWrapper> + <EuiSteps titleSize="xxs" steps={steps} /> + </SubStepsWrapper> + ); + } +); +MacrosDataInputSubSteps.displayName = 'MacrosDataInputActive'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.tsx new file mode 100644 index 000000000000..d83890e1f260 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/index.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 React, { useEffect, useMemo } from 'react'; +import { EuiText, type EuiStepProps, type EuiStepStatus } from '@elastic/eui'; +// import { useGetMissingResources } from '../../../../../../logic/use_get_migration_missing_resources'; +import type { RuleMigrationTaskStats } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useGetMissingResources } from '../../../../../../service/hooks/use_get_missing_resources'; +import type { OnMissingResourcesFetched } from '../../../../types'; +import * as i18n from './translations'; + +export interface CheckResourcesStepProps { + status: EuiStepStatus; + migrationStats: RuleMigrationTaskStats | undefined; + onMissingResourcesFetched: OnMissingResourcesFetched; +} +export const useCheckResourcesStep = ({ + status, + migrationStats, + onMissingResourcesFetched, +}: CheckResourcesStepProps): EuiStepProps => { + const { getMissingResources, isLoading, error } = + useGetMissingResources(onMissingResourcesFetched); + + useEffect(() => { + if (status === 'current' && migrationStats?.id) { + getMissingResources(migrationStats.id); + } + }, [getMissingResources, status, migrationStats?.id]); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.RULES_DATA_INPUT_CHECK_RESOURCES_TITLE, + status: uploadStepStatus, + children: ( + <EuiText size="xs" color="subdued"> + {i18n.RULES_DATA_INPUT_CHECK_RESOURCES_DESCRIPTION} + </EuiText> + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts new file mode 100644 index 000000000000..159b4033fafd --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/check_resources/translations.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_CHECK_RESOURCES_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.checkResources.title', + { defaultMessage: 'Check for macros and lookups' } +); + +export const RULES_DATA_INPUT_CHECK_RESOURCES_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.checkResources.description', + { + defaultMessage: `For best translation results, we will automatically review your rules for macros and lookups and ask you to upload them. Once uploaded, we'll be able to deliver a more complete rule translation for all rules using those macros or lookups.`, + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.tsx new file mode 100644 index 000000000000..93f2ce715184 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/copy_export_query.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 React, { useCallback } from 'react'; +import { EuiCodeBlock, EuiSpacer, EuiText } from '@elastic/eui'; +import { FormattedMessage } from '@kbn/i18n-react'; +import { MACROS_SPLUNK_QUERY } from '../../../../constants'; +import * as i18n from './translations'; + +interface CopyExportQueryProps { + onCopied: () => void; +} +export const CopyExportQuery = React.memo<CopyExportQueryProps>(({ onCopied }) => { + const onClick: React.MouseEventHandler = useCallback( + (ev) => { + // The only button inside the element is the "copy" button. + if ((ev.target as Element).tagName === 'BUTTON') { + onCopied(); + } + }, + [onCopied] + ); + + return ( + <> + {/* The click event is also dispatched when using the keyboard actions (space or enter) for "copy" button. + No need to use keyboard specific events, disabling the a11y lint rule:*/} + {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */} + <div onClick={onClick}> + {/* onCopy react event is dispatched when the user copies text manually */} + <EuiCodeBlock language="text" fontSize="m" paddingSize="m" isCopyable onCopy={onCopied}> + {MACROS_SPLUNK_QUERY} + </EuiCodeBlock> + </div> + <EuiSpacer size="m" /> + <EuiText size="s"> + <FormattedMessage + id="xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.copyExportQuery.description" + defaultMessage="From you admin Splunk account, go to the {section} app and run the above query. Export your results as {format}." + values={{ + section: <b>{i18n.RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION}</b>, + format: <b>{'JSON'}</b>, + }} + /> + </EuiText> + </> + ); +}); +CopyExportQuery.displayName = 'CopyExportQuery'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.tsx new file mode 100644 index 000000000000..3d2adcc78857 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/index.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 React from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { CopyExportQuery } from './copy_export_query'; +import * as i18n from './translations'; + +export interface CopyExportQueryStepProps { + status: EuiStepStatus; + onCopied: () => void; +} +export const useCopyExportQueryStep = ({ + status, + onCopied, +}: CopyExportQueryStepProps): EuiStepProps => { + return { + title: i18n.RULES_DATA_INPUT_COPY_TITLE, + status, + children: <CopyExportQuery onCopied={onCopied} />, + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.ts new file mode 100644 index 000000000000..71466a54dd13 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/copy_export_query/translations.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 { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_COPY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.title', + { defaultMessage: 'Copy macros query' } +); + +export const RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.copyExportQuery.description.section', + { defaultMessage: 'Search and Reporting' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/index.tsx new file mode 100644 index 000000000000..f2353e3f0276 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/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 React, { useCallback, useMemo } from 'react'; +import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import { ResourceIdentifier } from '../../../../../../../../../common/siem_migrations/rules/resources'; +import { useUpsertResources } from '../../../../../../service/hooks/use_upsert_resources'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { OnResourcesCreated } from '../../../../types'; +import { MacrosFileUpload } from './macros_file_upload'; +import * as i18n from './translations'; + +export interface RulesFileUploadStepProps { + status: EuiStepStatus; + migrationStats: RuleMigrationTaskStats; + missingMacros: string[]; + onMacrosCreated: OnResourcesCreated; +} +export const useMacrosFileUploadStep = ({ + status, + migrationStats, + missingMacros, + onMacrosCreated, +}: RulesFileUploadStepProps): EuiStepProps => { + const { upsertResources, isLoading, error } = useUpsertResources(onMacrosCreated); + + const upsertMigrationResources = useCallback( + (macrosFromFile: RuleMigrationResourceData[]) => { + const macrosIndexed: Record<string, RuleMigrationResourceData> = Object.fromEntries( + macrosFromFile.map((macro) => [macro.name, macro]) + ); + const resourceIdentifier = new ResourceIdentifier('splunk'); + const macrosToUpsert: RuleMigrationResourceData[] = []; + let missingMacrosIt: string[] = missingMacros; + + while (missingMacrosIt.length > 0) { + const macros: RuleMigrationResourceData[] = []; + missingMacrosIt.forEach((macroName) => { + const macro = macrosIndexed[macroName]; + if (macro) { + macros.push(macro); + } else { + // Macro missing from file + } + }); + macrosToUpsert.push(...macros); + + missingMacrosIt = resourceIdentifier + .fromResources(macros) + .reduce<string[]>((acc, resource) => { + if (resource.type === 'macro') { + acc.push(resource.name); + } + return acc; + }, []); + } + + if (macrosToUpsert.length === 0) { + return; // No missing macros provided + } + upsertResources(migrationStats.id, macrosToUpsert); + }, + [upsertResources, migrationStats, missingMacros] + ); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + + return { + title: i18n.RULES_DATA_INPUT_FILE_UPLOAD_TITLE, + status: uploadStepStatus, + children: ( + <MacrosFileUpload + createResources={upsertMigrationResources} + isLoading={isLoading} + apiError={error?.message} + /> + ), + }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.tsx new file mode 100644 index 000000000000..b8d7022d9b45 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/macros_file_upload.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, { useCallback, useMemo } from 'react'; +import { EuiFilePicker, EuiFormRow, EuiText } from '@elastic/eui'; +import { isPlainObject } from 'lodash'; +import type { RuleMigrationResourceData } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { FILE_UPLOAD_ERROR } from '../../../../translations'; +import type { SPLUNK_MACROS_COLUMNS } from '../../../../constants'; +import { useParseFileInput, type SplunkRow } from '../../../common/use_parse_file_input'; +import * as i18n from './translations'; + +type SplunkMacroResult = Partial<Record<(typeof SPLUNK_MACROS_COLUMNS)[number], string>>; + +export interface MacrosFileUploadProps { + createResources: (resources: RuleMigrationResourceData[]) => void; + apiError?: string; + isLoading?: boolean; +} +export const MacrosFileUpload = React.memo<MacrosFileUploadProps>( + ({ createResources, apiError, isLoading }) => { + const onFileParsed = useCallback( + (content: Array<SplunkRow<SplunkMacroResult>>) => { + const rules = content.map(formatMacroRow); + createResources(rules); + }, + [createResources] + ); + + const { parseFile, isParsing, error: fileError } = useParseFileInput(onFileParsed); + + const error = useMemo(() => { + if (apiError) { + return apiError; + } + return fileError; + }, [apiError, fileError]); + + return ( + <EuiFormRow + helpText={ + <EuiText color="danger" size="xs"> + {error} + </EuiText> + } + isInvalid={error != null} + fullWidth + > + <EuiFilePicker + id="macrosFilePicker" + fullWidth + initialPromptText={ + <> + <EuiText size="s" textAlign="center"> + {i18n.RULES_DATA_INPUT_FILE_UPLOAD_PROMPT} + </EuiText> + </> + } + accept="application/json, application/x-ndjson" + onChange={parseFile} + display="large" + aria-label="Upload logs sample file" + isLoading={isParsing || isLoading} + disabled={isParsing || isLoading} + data-test-subj="macrosFilePicker" + data-loading={isParsing} + /> + </EuiFormRow> + ); + } +); +MacrosFileUpload.displayName = 'MacrosFileUpload'; + +const formatMacroRow = (row: SplunkRow<SplunkMacroResult>): RuleMigrationResourceData => { + if (!isPlainObject(row.result)) { + throw new Error(FILE_UPLOAD_ERROR.NOT_OBJECT); + } + const macroResource: Partial<RuleMigrationResourceData> = { + type: 'macro', + name: row.result.title, + content: row.result.definition, + }; + // resource document format validation delegated to API + return macroResource as RuleMigrationResourceData; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.ts new file mode 100644 index 000000000000..25b64787d6dc --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/sub_steps/macros_file_upload/translations.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 { i18n } from '@kbn/i18n'; + +export const RULES_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.title', + { defaultMessage: 'Update your macros export' } +); +export const RULES_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.prompt', + { defaultMessage: 'Select or drag and drop the exported JSON file' } +); + +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.createSuccess', + { defaultMessage: 'Macros uploaded successfully' } +); +export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.macrosFileUpload.createError', + { defaultMessage: 'Failed to upload macros file' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.ts new file mode 100644 index 000000000000..7061e9131130 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/macros/translations.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. + */ + +import { i18n } from '@kbn/i18n'; + +export const MACROS_DATA_INPUT_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.macros.title', + { defaultMessage: 'Upload identified macros' } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx index 2b20dcda0cea..acc22a030b02 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/rules_data_input.tsx @@ -5,7 +5,7 @@ * 2.0. */ -import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import type { EuiStepProps } from '@elastic/eui'; import { EuiFlexGroup, EuiFlexItem, @@ -14,57 +14,31 @@ import { EuiSteps, EuiTitle, } from '@elastic/eui'; -import React, { useMemo, useState } from 'react'; -import { SubStepWrapper } from '../common/sub_step_wrapper'; -import type { OnMigrationCreated } from '../../types'; +import React, { useCallback, useMemo, useState } from 'react'; +import type { RuleMigrationTaskStats } from '../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { SubStepsWrapper } from '../common/sub_step_wrapper'; +import type { OnMigrationCreated, OnMissingResourcesFetched, DataInputStep } from '../../types'; import { useCopyExportQueryStep } from './sub_steps/copy_export_query'; import { useRulesFileUploadStep } from './sub_steps/rules_file_upload'; import * as i18n from './translations'; import { useCheckResourcesStep } from './sub_steps/check_resources'; +import { getStatus } from '../common/get_status'; -type Step = 1 | 2 | 3 | 4; -const getStatus = (step: Step, currentStep: Step): EuiStepStatus => { - if (step === currentStep) { - return 'current'; - } - if (step < currentStep) { - return 'complete'; - } - return 'incomplete'; -}; +const DataInputStepNumber: DataInputStep = 1; -interface RulesDataInputProps { - selected: boolean; +interface RulesDataInputSubStepsProps { + migrationStats?: RuleMigrationTaskStats; onMigrationCreated: OnMigrationCreated; + onMissingResourcesFetched: OnMissingResourcesFetched; +} +interface RulesDataInputProps extends RulesDataInputSubStepsProps { + dataInputStep: DataInputStep; } - export const RulesDataInput = React.memo<RulesDataInputProps>( - ({ selected, onMigrationCreated }) => { - const [step, setStep] = useState<Step>(1); - - const copyStep = useCopyExportQueryStep({ - status: getStatus(1, step), - onCopied: () => setStep(2), - }); - - const uploadStep = useRulesFileUploadStep({ - status: getStatus(2, step), - onMigrationCreated: (stats) => { - onMigrationCreated(stats); - setStep(3); - }, - }); - - const resourcesStep = useCheckResourcesStep({ - status: getStatus(3, step), - onComplete: () => { - setStep(4); - }, - }); - - const steps = useMemo<EuiStepProps[]>( - () => [copyStep, uploadStep, resourcesStep], - [copyStep, uploadStep, resourcesStep] + ({ dataInputStep, migrationStats, onMigrationCreated, onMissingResourcesFetched }) => { + const dataInputStatus = useMemo( + () => getStatus(DataInputStepNumber, dataInputStep), + [dataInputStep] ); return ( @@ -73,7 +47,11 @@ export const RulesDataInput = React.memo<RulesDataInputProps>( <EuiFlexItem> <EuiFlexGroup direction="row" justifyContent="center" gutterSize="m"> <EuiFlexItem grow={false}> - <EuiStepNumber number={1} titleSize="xs" /> + <EuiStepNumber + titleSize="xs" + number={DataInputStepNumber} + status={dataInputStatus} + /> </EuiFlexItem> <EuiFlexItem> <EuiTitle size="xs"> @@ -82,14 +60,72 @@ export const RulesDataInput = React.memo<RulesDataInputProps>( </EuiFlexItem> </EuiFlexGroup> </EuiFlexItem> - <EuiFlexItem> - <SubStepWrapper> - <EuiSteps titleSize="xxs" steps={steps} /> - </SubStepWrapper> - </EuiFlexItem> + {dataInputStatus === 'current' && ( + <EuiFlexItem> + <RulesDataInputSubSteps + migrationStats={migrationStats} + onMigrationCreated={onMigrationCreated} + onMissingResourcesFetched={onMissingResourcesFetched} + /> + </EuiFlexItem> + )} </EuiFlexGroup> </EuiPanel> ); } ); RulesDataInput.displayName = 'RulesDataInput'; + +const END = 10 as const; +type SubStep = 1 | 2 | 3 | typeof END; +export const RulesDataInputSubSteps = React.memo<RulesDataInputSubStepsProps>( + ({ migrationStats, onMigrationCreated, onMissingResourcesFetched }) => { + const [subStep, setSubStep] = useState<SubStep>(migrationStats ? 3 : 1); + + // Copy query step + const onCopied = useCallback(() => { + setSubStep(2); + }, []); + const copyStep = useCopyExportQueryStep({ status: getStatus(1, subStep), onCopied }); + + // Upload rules step + const onMigrationCreatedStep = useCallback<OnMigrationCreated>( + (stats) => { + onMigrationCreated(stats); + setSubStep(3); + }, + [onMigrationCreated] + ); + const uploadStep = useRulesFileUploadStep({ + status: getStatus(2, subStep), + migrationStats, + onMigrationCreated: onMigrationCreatedStep, + }); + + // Check missing resources step + const onMissingResourcesFetchedStep = useCallback<OnMissingResourcesFetched>( + (missingResources) => { + onMissingResourcesFetched(missingResources); + setSubStep(END); + }, + [onMissingResourcesFetched] + ); + const resourcesStep = useCheckResourcesStep({ + status: getStatus(3, subStep), + migrationStats, + onMissingResourcesFetched: onMissingResourcesFetchedStep, + }); + + const steps = useMemo<EuiStepProps[]>( + () => [copyStep, uploadStep, resourcesStep], + [copyStep, uploadStep, resourcesStep] + ); + + return ( + <SubStepsWrapper> + <EuiSteps titleSize="xxs" steps={steps} /> + </SubStepsWrapper> + ); + } +); +RulesDataInputSubSteps.displayName = 'RulesDataInputActive'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx index 3b081eb20326..02aa109872f4 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/check_resources/index.tsx @@ -5,22 +5,45 @@ * 2.0. */ -import React from 'react'; +import React, { useEffect, useMemo } from 'react'; import { EuiText, type EuiStepProps, type EuiStepStatus } from '@elastic/eui'; +import type { RuleMigrationTaskStats } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useGetMissingResources } from '../../../../../../service/hooks/use_get_missing_resources'; +import type { OnMissingResourcesFetched } from '../../../../types'; import * as i18n from './translations'; export interface CheckResourcesStepProps { status: EuiStepStatus; - onComplete: () => void; + migrationStats: RuleMigrationTaskStats | undefined; + onMissingResourcesFetched: OnMissingResourcesFetched; } export const useCheckResourcesStep = ({ status, - onComplete, + migrationStats, + onMissingResourcesFetched, }: CheckResourcesStepProps): EuiStepProps => { - // onComplete(); // TODO: check the resources + const { getMissingResources, isLoading, error } = + useGetMissingResources(onMissingResourcesFetched); + + useEffect(() => { + if (status === 'current' && migrationStats?.id) { + getMissingResources(migrationStats.id); + } + }, [getMissingResources, status, migrationStats?.id]); + + const uploadStepStatus = useMemo(() => { + if (isLoading) { + return 'loading'; + } + if (error) { + return 'danger'; + } + return status; + }, [isLoading, error, status]); + return { title: i18n.RULES_DATA_INPUT_CHECK_RESOURCES_TITLE, - status, + status: uploadStepStatus, children: ( <EuiText size="xs" color="subdued"> {i18n.RULES_DATA_INPUT_CHECK_RESOURCES_DESCRIPTION} diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts index d76eb71f2e37..78a063666160 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/copy_export_query/translations.ts @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; export const RULES_DATA_INPUT_COPY_TITLE = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.copyExportQuery.title', - { defaultMessage: 'Copy and export query' } + { defaultMessage: 'Copy rules query' } ); export const RULES_DATA_INPUT_COPY_DESCRIPTION_SECTION = i18n.translate( diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx index ab7838b28908..97dfd903e499 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/index.tsx @@ -7,6 +7,7 @@ import React, { useCallback, useMemo, useState } from 'react'; import type { EuiStepProps, EuiStepStatus } from '@elastic/eui'; +import type { RuleMigrationTaskStats } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; import type { OnMigrationCreated } from '../../../../types'; import { RulesFileUpload } from './rules_file_upload'; import { @@ -17,13 +18,15 @@ import * as i18n from './translations'; export interface RulesFileUploadStepProps { status: EuiStepStatus; + migrationStats?: RuleMigrationTaskStats; onMigrationCreated: OnMigrationCreated; } export const useRulesFileUploadStep = ({ status, + migrationStats, onMigrationCreated, }: RulesFileUploadStepProps): EuiStepProps => { - const [isCreated, setIsCreated] = useState<boolean>(false); + const [isCreated, setIsCreated] = useState<boolean>(!!migrationStats); const onSuccess = useCallback<OnSuccess>( (stats) => { setIsCreated(true); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts deleted file mode 100644 index 3d5dbb32ccde..000000000000 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/parse_rules_file.ts +++ /dev/null @@ -1,79 +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 { isPlainObject } from 'lodash/fp'; -import type { OriginalRule } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; -import type { SPL_RULES_COLUMNS } from '../../../../constants'; -import * as i18n from './translations'; - -type SplunkResult = Partial<Record<(typeof SPL_RULES_COLUMNS)[number], string>>; -interface SplunkRow { - result: SplunkResult; -} - -export const parseContent = (fileContent: string): OriginalRule[] => { - const trimmedContent = fileContent.trim(); - let arrayContent: SplunkRow[]; - if (trimmedContent.startsWith('[')) { - arrayContent = parseJSONArray(trimmedContent); - } else { - arrayContent = parseNDJSON(trimmedContent); - } - if (arrayContent.length === 0) { - throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.EMPTY); - } - return arrayContent.map(convertFormat); -}; - -const parseNDJSON = (fileContent: string): SplunkRow[] => { - return fileContent - .split(/\n(?=\{)/) // split at newline followed by '{'. - .filter((entry) => entry.trim() !== '') // Remove empty entries. - .map(parseJSON); // Parse each entry as JSON. -}; - -const parseJSONArray = (fileContent: string): SplunkRow[] => { - const parsedContent = parseJSON(fileContent); - if (!Array.isArray(parsedContent)) { - throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.NOT_ARRAY); - } - return parsedContent; -}; - -const parseJSON = (fileContent: string) => { - try { - return JSON.parse(fileContent); - } catch (error) { - if (error instanceof RangeError) { - throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); - } - throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_PARSE); - } -}; - -const convertFormat = (row: SplunkRow): OriginalRule => { - if (!isPlainObject(row) || !isPlainObject(row.result)) { - throw new Error(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.NOT_OBJECT); - } - const originalRule: Partial<OriginalRule> = { - id: row.result.id, - vendor: 'splunk', - title: row.result.title, - query: row.result.search, - query_language: 'spl', - description: row.result['action.escu.eli5']?.trim() || row.result.description, - }; - - if (row.result['action.correlationsearch.annotations']) { - try { - originalRule.annotations = JSON.parse(row.result['action.correlationsearch.annotations']); - } catch (error) { - delete originalRule.annotations; - } - } - return originalRule as OriginalRule; -}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx index 0f9787a4ddf6..bec918242007 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/rules_file_upload.tsx @@ -5,12 +5,17 @@ * 2.0. */ -import React, { useCallback, useMemo, useState } from 'react'; +import React, { useCallback, useMemo } from 'react'; import { EuiFilePicker, EuiFormRow, EuiText } from '@elastic/eui'; +import { isPlainObject } from 'lodash'; import type { OriginalRule } from '../../../../../../../../../common/siem_migrations/model/rule_migration.gen'; import type { CreateMigration } from '../../../../../../service/hooks/use_create_migration'; -import { parseContent } from './parse_rules_file'; import * as i18n from './translations'; +import { FILE_UPLOAD_ERROR } from '../../../../translations'; +import { useParseFileInput, type SplunkRow } from '../../../common/use_parse_file_input'; +import type { SPLUNK_RULES_COLUMNS } from '../../../../constants'; + +type SplunkRulesResult = Partial<Record<(typeof SPLUNK_RULES_COLUMNS)[number], string>>; export interface RulesFileUploadProps { createMigration: CreateMigration; @@ -20,65 +25,16 @@ export interface RulesFileUploadProps { } export const RulesFileUpload = React.memo<RulesFileUploadProps>( ({ createMigration, apiError, isLoading, isCreated }) => { - const [isParsing, setIsParsing] = useState<boolean>(false); - const [fileError, setFileError] = useState<string>(); - - const onChangeFile = useCallback( - (files: FileList | null) => { - if (!files) { - return; - } - - setFileError(undefined); - - const rulesFile = files[0]; - const reader = new FileReader(); - - reader.onloadstart = () => setIsParsing(true); - reader.onloadend = () => setIsParsing(false); - - reader.onload = function (e) { - // We can safely cast to string since we call `readAsText` to load the file. - const fileContent = e.target?.result as string | undefined; - - if (fileContent == null) { - setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ); - return; - } - - if (fileContent === '' && e.loaded > 100000) { - // V8-based browsers can't handle large files and return an empty string - // instead of an error; see https://stackoverflow.com/a/61316641 - setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.TOO_LARGE_TO_PARSE); - return; - } - - let data: OriginalRule[]; - try { - data = parseContent(fileContent); - createMigration(data); - } catch (err) { - setFileError(err.message); - } - }; - - const handleReaderError = function () { - const message = reader.error?.message; - if (message) { - setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ_WITH_REASON(message)); - } else { - setFileError(i18n.RULES_DATA_INPUT_FILE_UPLOAD_ERROR.CAN_NOT_READ); - } - }; - - reader.onerror = handleReaderError; - reader.onabort = handleReaderError; - - reader.readAsText(rulesFile); + const onFileParsed = useCallback( + (content: Array<SplunkRow<SplunkRulesResult>>) => { + const rules = content.map(formatRuleRow); + createMigration(rules); }, [createMigration] ); + const { parseFile, isParsing, error: fileError } = useParseFileInput(onFileParsed); + const error = useMemo(() => { if (apiError) { return apiError; @@ -106,10 +62,10 @@ export const RulesFileUpload = React.memo<RulesFileUploadProps>( </EuiText> </> } - accept="application/json" - onChange={onChangeFile} + accept="application/json, application/x-ndjson" + onChange={parseFile} display="large" - aria-label="Upload logs sample file" + aria-label="Upload rules file" isLoading={isParsing || isLoading} disabled={isLoading || isCreated} data-test-subj="rulesFilePicker" @@ -120,3 +76,27 @@ export const RulesFileUpload = React.memo<RulesFileUploadProps>( } ); RulesFileUpload.displayName = 'RulesFileUpload'; + +const formatRuleRow = (row: SplunkRow<SplunkRulesResult>): OriginalRule => { + if (!isPlainObject(row.result)) { + throw new Error(FILE_UPLOAD_ERROR.NOT_OBJECT); + } + const originalRule: Partial<OriginalRule> = { + id: row.result.id, + vendor: 'splunk', + title: row.result.title, + query: row.result.search, + query_language: 'spl', + description: row.result['action.escu.eli5']?.trim() || row.result.description, + }; + + if (row.result['action.correlationsearch.annotations']) { + try { + originalRule.annotations = JSON.parse(row.result['action.correlationsearch.annotations']); + } catch (error) { + delete originalRule.annotations; + } + } + // rule document format validation delegated to API + return originalRule as OriginalRule; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts index 675eed61f497..b560849ca1cd 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/steps/rules/sub_steps/rules_file_upload/translations.ts @@ -9,57 +9,13 @@ import { i18n } from '@kbn/i18n'; export const RULES_DATA_INPUT_FILE_UPLOAD_TITLE = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.title', - { defaultMessage: 'Update your rule export' } + { defaultMessage: 'Update your rules export' } ); export const RULES_DATA_INPUT_FILE_UPLOAD_PROMPT = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.prompt', { defaultMessage: 'Select or drag and drop the exported JSON file' } ); -export const RULES_DATA_INPUT_FILE_UPLOAD_ERROR = { - CAN_NOT_READ: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotRead', - { defaultMessage: 'Failed to read the rules export file' } - ), - CAN_NOT_READ_WITH_REASON: (reason: string) => - i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotReadWithReason', - { - defaultMessage: 'An error occurred when reading rules export file: {reason}', - values: { reason }, - } - ), - CAN_NOT_PARSE: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.canNotParse', - { defaultMessage: 'Cannot parse the rules export file as either a JSON file' } - ), - TOO_LARGE_TO_PARSE: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.tooLargeToParse', - { defaultMessage: 'This rules export file is too large to parse' } - ), - NOT_ARRAY: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.notArray', - { defaultMessage: 'The rules export file is not an array' } - ), - EMPTY: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.empty', - { defaultMessage: 'The rules export file is empty' } - ), - NOT_OBJECT: i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.notObject', - { defaultMessage: 'The rules export file contains non-object entries' } - ), - WRONG_FORMAT: (formatError: string) => { - return i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.error.wrongFormat', - { - defaultMessage: 'The rules export file has wrong format: {formatError}', - values: { formatError }, - } - ); - }, -}; - export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.rules.rulesFileUpload.createSuccess', { defaultMessage: 'Rules uploaded successfully' } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.ts new file mode 100644 index 000000000000..1e7988b596e4 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/translations.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 { i18n } from '@kbn/i18n'; + +export const FILE_UPLOAD_ERROR = { + CAN_NOT_READ: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.canNotRead', + { defaultMessage: 'Failed to read file' } + ), + CAN_NOT_READ_WITH_REASON: (reason: string) => + i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.canNotReadWithReason', + { + defaultMessage: 'An error occurred when reading file: {reason}', + values: { reason }, + } + ), + CAN_NOT_PARSE: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.canNotParse', + { defaultMessage: 'Cannot parse the file as either a JSON file or NDJSON file' } + ), + TOO_LARGE_TO_PARSE: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.tooLargeToParse', + { defaultMessage: 'This file is too large to parse' } + ), + NOT_ARRAY: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.notArray', + { defaultMessage: 'The file content is not an array' } + ), + EMPTY: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.empty', + { defaultMessage: 'The file is empty' } + ), + NOT_OBJECT: i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.notObject', + { defaultMessage: 'The file contains non-object entries' } + ), + WRONG_FORMAT: (formatError: string) => { + return i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.dataInputFlyout.fileUploadError.wrongFormat', + { + defaultMessage: 'The file has wrong format: {formatError}', + values: { formatError }, + } + ); + }, +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts index 16d8f60043bc..b293a9394ba5 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/data_input_flyout/types.ts @@ -5,6 +5,18 @@ * 2.0. */ -import type { RuleMigrationTaskStats } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; export type OnMigrationCreated = (migrationStats: RuleMigrationTaskStats) => void; +export type OnResourcesCreated = () => void; +export type OnMissingResourcesFetched = (missingResources: RuleMigrationResourceData[]) => void; + +export enum DataInputStep { + Rules = 1, + Macros = 2, + Lookups = 3, + End = 10, +} diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx index 9762cc578e0c..fa13c44d764a 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/index.tsx @@ -6,7 +6,7 @@ */ import type { FC, PropsWithChildren } from 'react'; -import React, { useMemo, useState, useEffect } from 'react'; +import React, { useMemo, useState, useEffect, useCallback } from 'react'; import { css } from '@emotion/css'; import { euiThemeVars } from '@kbn/ui-theme'; import { @@ -21,16 +21,21 @@ import { EuiFlexGroup, EuiFlexItem, useGeneratedHtmlId, + EuiSkeletonLoading, + EuiSkeletonTitle, + EuiSkeletonText, } from '@elastic/eui'; import type { EuiTabbedContentTab, EuiTabbedContentProps, EuiFlyoutProps } from '@elastic/eui'; import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useAppToasts } from '../../../../common/hooks/use_app_toasts'; import { RuleOverviewTab, useOverviewTabSections, } from '../../../../detection_engine/rule_management/components/rule_details/rule_overview_tab'; import type { RuleResponse } from '../../../../../common/api/detection_engine/model/rule_schema'; +import * as logicI18n from '../../logic/translations'; import * as i18n from './translations'; import { DEFAULT_DESCRIPTION_LIST_COLUMN_WIDTHS, @@ -41,6 +46,7 @@ import { convertMigrationCustomRuleToSecurityRulePayload, isMigrationCustomRule, } from '../../../../../common/siem_migrations/rules/utils'; +import { useUpdateMigrationRules } from '../../logic/use_update_migration_rules'; /* * Fixes tabs to the top and allows the content to scroll. @@ -62,11 +68,12 @@ export const TabContentPadding: FC<PropsWithChildren<unknown>> = ({ children }) ); interface MigrationRuleDetailsFlyoutProps { - ruleActions?: React.ReactNode; ruleMigration: RuleMigration; + ruleActions?: React.ReactNode; matchedPrebuiltRule?: RuleResponse; size?: EuiFlyoutProps['size']; extraTabs?: EuiTabbedContentTab[]; + isDataLoading?: boolean; closeFlyout: () => void; } @@ -77,19 +84,52 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp matchedPrebuiltRule, size = 'm', extraTabs = [], + isDataLoading, closeFlyout, }: MigrationRuleDetailsFlyoutProps) => { + const { addError } = useAppToasts(); + const { expandedOverviewSections, toggleOverviewSection } = useOverviewTabSections(); - const rule = useMemo(() => { - if (isMigrationCustomRule(ruleMigration.elastic_rule)) { - return convertMigrationCustomRuleToSecurityRulePayload( - ruleMigration.elastic_rule, - false - ) as RuleResponse; // TODO: we need to adjust RuleOverviewTab to allow partial RuleResponse as a parameter; + const { mutateAsync: updateMigrationRules } = useUpdateMigrationRules( + ruleMigration.migration_id + ); + + const [isUpdating, setIsUpdating] = useState(false); + const isLoading = isDataLoading || isUpdating; + + const handleTranslationUpdate = useCallback( + async (ruleName: string, ruleQuery: string) => { + if (!ruleMigration || isLoading) { + return; + } + setIsUpdating(true); + try { + await updateMigrationRules([ + { + id: ruleMigration.id, + elastic_rule: { + title: ruleName, + query: ruleQuery, + }, + }, + ]); + } catch (error) { + addError(error, { title: logicI18n.UPDATE_MIGRATION_RULES_FAILURE }); + } finally { + setIsUpdating(false); + } + }, + [addError, ruleMigration, isLoading, updateMigrationRules] + ); + + const ruleDetailsToOverview = useMemo(() => { + const elasticRule = ruleMigration?.elastic_rule; + if (isMigrationCustomRule(elasticRule)) { + return convertMigrationCustomRuleToSecurityRulePayload(elasticRule, false) as RuleResponse; // TODO: we need to adjust RuleOverviewTab to allow partial RuleResponse as a parameter; } return matchedPrebuiltRule; - }, [matchedPrebuiltRule, ruleMigration]); + }, [ruleMigration, matchedPrebuiltRule]); const translationTab: EuiTabbedContentTab = useMemo( () => ({ @@ -97,14 +137,17 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp name: i18n.TRANSLATION_TAB_LABEL, content: ( <TabContentPadding> - <TranslationTab - ruleMigration={ruleMigration} - matchedPrebuiltRule={matchedPrebuiltRule} - /> + {ruleMigration && ( + <TranslationTab + ruleMigration={ruleMigration} + matchedPrebuiltRule={matchedPrebuiltRule} + onTranslationUpdate={handleTranslationUpdate} + /> + )} </TabContentPadding> ), }), - [matchedPrebuiltRule, ruleMigration] + [ruleMigration, handleTranslationUpdate, matchedPrebuiltRule] ); const overviewTab: EuiTabbedContentTab = useMemo( @@ -113,9 +156,9 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp name: i18n.OVERVIEW_TAB_LABEL, content: ( <TabContentPadding> - {rule && ( + {ruleDetailsToOverview && ( <RuleOverviewTab - rule={rule} + rule={ruleDetailsToOverview} columnWidths={ size === 'l' ? LARGE_DESCRIPTION_LIST_COLUMN_WIDTHS @@ -128,7 +171,7 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp </TabContentPadding> ), }), - [rule, size, expandedOverviewSections, toggleOverviewSection] + [ruleDetailsToOverview, size, expandedOverviewSections, toggleOverviewSection] ); const tabs = useMemo(() => { @@ -149,6 +192,16 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp setSelectedTabId(tab.id); }; + const tabsContent = useMemo(() => { + return ( + <ScrollableFlyoutTabbedContent + tabs={tabs} + selectedTab={selectedTab} + onTabClick={onTabClick} + /> + ); + }, [selectedTab, tabs]); + const migrationsRulesFlyoutTitleId = useGeneratedHtmlId({ prefix: 'migrationRulesFlyoutTitle', }); @@ -166,16 +219,23 @@ export const MigrationRuleDetailsFlyout: React.FC<MigrationRuleDetailsFlyoutProp <EuiFlyoutHeader> <EuiTitle size="m"> <h2 id={migrationsRulesFlyoutTitleId}> - {rule?.name ?? ruleMigration.original_rule.title} + {ruleDetailsToOverview?.name ?? + ruleMigration?.original_rule.title ?? + i18n.UNKNOWN_MIGRATION_RULE_TITLE} </h2> </EuiTitle> <EuiSpacer size="l" /> </EuiFlyoutHeader> <EuiFlyoutBody> - <ScrollableFlyoutTabbedContent - tabs={tabs} - selectedTab={selectedTab} - onTabClick={onTabClick} + <EuiSkeletonLoading + isLoading={isLoading} + loadingContent={ + <> + <EuiSkeletonTitle /> + <EuiSkeletonText /> + </> + } + loadedContent={tabsContent} /> </EuiFlyoutBody> <EuiFlyoutFooter> diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/callout.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/callout.tsx new file mode 100644 index 000000000000..fd014b28fcd8 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/callout.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 type { FC } from 'react'; +import React from 'react'; +import type { IconType } from '@elastic/eui'; +import { EuiCallOut } from '@elastic/eui'; +import { + RuleMigrationTranslationResultEnum, + type RuleMigrationTranslationResult, +} from '../../../../../../common/siem_migrations/model/rule_migration.gen'; +import * as i18n from './translations'; + +const getCallOutInfo = ( + translationResult: RuleMigrationTranslationResult +): { title: string; message?: string; icon: IconType; color: 'success' | 'warning' | 'danger' } => { + switch (translationResult) { + case RuleMigrationTranslationResultEnum.full: + return { + title: i18n.CALLOUT_TRANSLATED_RULE_TITLE, + icon: 'checkInCircleFilled', + color: 'success', + }; + case RuleMigrationTranslationResultEnum.partial: + return { + title: i18n.CALLOUT_PARTIALLY_TRANSLATED_RULE_TITLE, + message: i18n.CALLOUT_PARTIALLY_TRANSLATED_RULE_DESCRIPTION, + icon: 'warningFilled', + color: 'warning', + }; + case RuleMigrationTranslationResultEnum.untranslatable: + return { + title: i18n.CALLOUT_NOT_TRANSLATED_RULE_TITLE, + message: i18n.CALLOUT_NOT_TRANSLATED_RULE_DESCRIPTION, + icon: 'checkInCircleFilled', + color: 'danger', + }; + } +}; + +export interface TranslationCallOutProps { + translationResult: RuleMigrationTranslationResult; +} + +export const TranslationCallOut: FC<TranslationCallOutProps> = React.memo( + ({ translationResult }) => { + const { title, message, icon, color } = getCallOutInfo(translationResult); + + return ( + <EuiCallOut + color={color} + title={title} + iconType={icon} + data-test-subj={`ruleMigrationCallOut-${translationResult}`} + > + {message} + </EuiCallOut> + ); + } +); +TranslationCallOut.displayName = 'TranslationCallOut'; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/index.tsx index a80480b8837b..28a07dc0caa3 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/index.tsx @@ -9,10 +9,8 @@ import React, { useMemo } from 'react'; import { EuiAccordion, EuiBadge, - EuiFieldText, EuiFlexGroup, EuiFlexItem, - EuiFormRow, EuiSpacer, EuiSplitPanel, EuiTitle, @@ -29,20 +27,22 @@ import { convertTranslationResultIntoColor, convertTranslationResultIntoText, } from '../../../utils/helpers'; +import { TranslationCallOut } from './callout'; interface TranslationTabProps { ruleMigration: RuleMigration; matchedPrebuiltRule?: RuleResponse; + onTranslationUpdate?: (ruleName: string, ruleQuery: string) => Promise<void>; } export const TranslationTab: React.FC<TranslationTabProps> = React.memo( - ({ ruleMigration, matchedPrebuiltRule }) => { + ({ ruleMigration, matchedPrebuiltRule, onTranslationUpdate }) => { const { euiTheme } = useEuiTheme(); - const name = useMemo( - () => ruleMigration.elastic_rule?.title ?? ruleMigration.original_rule.title, - [ruleMigration.elastic_rule?.title, ruleMigration.original_rule.title] - ); + const isInstalled = !!ruleMigration.elastic_rule?.id; + const canEdit = !matchedPrebuiltRule && !isInstalled; + + const ruleName = matchedPrebuiltRule?.name ?? ruleMigration.elastic_rule?.title; const originalQuery = ruleMigration.original_rule.query; const elasticQuery = useMemo(() => { let query = ruleMigration.elastic_rule?.query; @@ -55,10 +55,12 @@ export const TranslationTab: React.FC<TranslationTabProps> = React.memo( return ( <> <EuiSpacer size="m" /> - <EuiFormRow label={i18n.NAME_LABEL} fullWidth> - <EuiFieldText value={name} fullWidth /> - </EuiFormRow> - <EuiSpacer size="m" /> + {ruleMigration.translation_result && !isInstalled && ( + <> + <TranslationCallOut translationResult={ruleMigration.translation_result} /> + <EuiSpacer size="m" /> + </> + )} <EuiAccordion id="translationQueryItem" buttonContent={<TranslationTabHeader />} @@ -85,7 +87,9 @@ export const TranslationTab: React.FC<TranslationTabProps> = React.memo( onClick={() => {}} onClickAriaLabel={'Click to update translation status'} > - {convertTranslationResultIntoText(ruleMigration.translation_result)} + {isInstalled + ? i18n.INSTALLED_LABEL + : convertTranslationResultIntoText(ruleMigration.translation_result)} </EuiBadge> </EuiFlexItem> </EuiFlexGroup> @@ -95,6 +99,7 @@ export const TranslationTab: React.FC<TranslationTabProps> = React.memo( <EuiFlexItem grow={1}> <MigrationRuleQuery title={i18n.SPLUNK_QUERY_TITLE} + ruleName={ruleMigration.original_rule.title} query={originalQuery} canEdit={false} /> @@ -108,13 +113,11 @@ export const TranslationTab: React.FC<TranslationTabProps> = React.memo( /> <EuiFlexItem grow={1}> <MigrationRuleQuery - title={ - matchedPrebuiltRule - ? i18n.PREBUILT_RULE_QUERY_TITLE - : i18n.ESQL_TRANSLATION_TITLE - } + title={i18n.ESQL_TRANSLATION_TITLE} + ruleName={ruleName} query={elasticQuery} - canEdit={false} + canEdit={canEdit} + onTranslationUpdate={onTranslationUpdate} /> </EuiFlexItem> </EuiFlexGroup> diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/migration_rule_query.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/migration_rule_query.tsx index 534f765da97b..252fd11ead9f 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/migration_rule_query.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/migration_rule_query.tsx @@ -5,29 +5,71 @@ * 2.0. */ -import React, { useMemo } from 'react'; +import React, { useCallback, useMemo, useState } from 'react'; import { + EuiButtonEmpty, EuiFlexGroup, EuiFlexItem, EuiHorizontalRule, - EuiMarkdownEditor, EuiMarkdownFormat, + EuiSpacer, EuiTitle, useEuiTheme, } from '@elastic/eui'; import { css } from '@emotion/react'; +import { VALIDATION_WARNING_CODES } from '../../../../../detection_engine/rule_creation/constants/validation_warning_codes'; +import { useFormWithWarnings } from '../../../../../common/hooks/use_form_with_warnings'; +import { EsqlQueryEdit } from '../../../../../detection_engine/rule_creation/components/esql_query_edit'; +import { Field, Form, getUseField } from '../../../../../shared_imports'; +import type { RuleTranslationSchema } from './types'; +import { schema } from './schema'; import * as i18n from './translations'; +const CommonUseField = getUseField({ component: Field }); + interface MigrationRuleQueryProps { title: string; + ruleName?: string; query: string; canEdit?: boolean; + onTranslationUpdate?: (ruleName: string, ruleQuery: string) => Promise<void>; } export const MigrationRuleQuery: React.FC<MigrationRuleQueryProps> = React.memo( - ({ title, query, canEdit }) => { + ({ title, ruleName, query, canEdit, onTranslationUpdate }) => { const { euiTheme } = useEuiTheme(); + const formDefaultValue: RuleTranslationSchema = useMemo(() => { + return { + ruleName: ruleName ?? '', + queryBar: { + query: { + query, + language: 'esql', + }, + }, + }; + }, [query, ruleName]); + const { form } = useFormWithWarnings<RuleTranslationSchema>({ + defaultValue: formDefaultValue, + options: { stripEmptyFields: false, warningValidationCodes: VALIDATION_WARNING_CODES }, + schema, + }); + + const [editMode, setEditMode] = useState(false); + const onCancel = useCallback(() => setEditMode(false), []); + const onEdit = useCallback(() => { + form.reset({ defaultValue: formDefaultValue }); + setEditMode(true); + }, [form, formDefaultValue]); + const onSave = useCallback(async () => { + const { data, isValid } = await form.submit(); + if (isValid) { + await onTranslationUpdate?.(data.ruleName, data.queryBar.query.query); + setEditMode(false); + } + }, [form, onTranslationUpdate]); + const headerComponent = useMemo(() => { return ( <EuiFlexGroup @@ -45,27 +87,83 @@ export const MigrationRuleQuery: React.FC<MigrationRuleQueryProps> = React.memo( ); }, [euiTheme, title]); - const queryTextComponent = useMemo(() => { - if (canEdit) { - return ( - <EuiMarkdownEditor - aria-label={i18n.TRANSLATED_QUERY_AREAL_LABEL} - value={query} - onChange={() => {}} - height={400} - initialViewMode={'viewing'} - /> - ); - } else { - return <EuiMarkdownFormat>{query}</EuiMarkdownFormat>; + const readQueryComponent = useMemo(() => { + if (editMode) { + return null; } - }, [canEdit, query]); + return ( + <> + {canEdit ? ( + <EuiFlexGroup direction="row" justifyContent="flexEnd"> + <EuiFlexItem grow={false}> + <EuiButtonEmpty iconType="pencil" onClick={onEdit} size="xs"> + {i18n.EDIT} + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + ) : ( + <EuiSpacer size="l" /> + )} + <EuiTitle size="xxs"> + <h3>{ruleName}</h3> + </EuiTitle> + <EuiSpacer size="m" /> + <EuiMarkdownFormat textSize="xs">{query}</EuiMarkdownFormat> + </> + ); + }, [canEdit, editMode, onEdit, query, ruleName]); + + const editQueryComponent = useMemo(() => { + if (!editMode) { + return null; + } + return ( + <Form form={form} data-test-subj="ruleMigrationTranslationTab"> + <EuiFlexGroup + direction="row" + gutterSize="none" + justifyContent="flexEnd" + alignItems="flexStart" + > + <EuiFlexItem grow={false}> + <EuiButtonEmpty iconType="cross" onClick={onCancel} size="xs"> + {i18n.CANCEL} + </EuiButtonEmpty> + </EuiFlexItem> + <EuiFlexItem grow={false}> + <EuiButtonEmpty iconType="save" onClick={onSave} size="xs"> + {i18n.SAVE} + </EuiButtonEmpty> + </EuiFlexItem> + </EuiFlexGroup> + <CommonUseField + path="ruleName" + componentProps={{ + idAria: 'ruleMigrationTranslationRuleName', + 'data-test-subj': 'ruleMigrationTranslationRuleName', + euiFieldProps: { + fullWidth: true, + }, + }} + /> + <EuiSpacer size="m" /> + <EsqlQueryEdit + path="queryBar" + dataView={{ + title: '', + fields: [], + }} + /> + </Form> + ); + }, [editMode, form, onCancel, onSave]); return ( <> {headerComponent} - <EuiHorizontalRule margin="s" /> - {queryTextComponent} + <EuiHorizontalRule margin="xs" /> + {readQueryComponent} + {editQueryComponent} </> ); } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/schema.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/schema.tsx new file mode 100644 index 000000000000..5b49fbc91f57 --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/schema.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { queryRequiredValidatorFactory } from '../../../../../detection_engine/rule_creation_ui/validators/query_required_validator_factory'; +import { FIELD_TYPES, fieldValidators, type FormSchema } from '../../../../../shared_imports'; +import type { RuleTranslationSchema } from './types'; +import * as i18n from './translations'; + +export const schema: FormSchema<RuleTranslationSchema> = { + ruleName: { + type: FIELD_TYPES.TEXT, + label: i18n.NAME_LABEL, + validations: [ + { + validator: fieldValidators.emptyField(i18n.NAME_REQUIRED_ERROR_MESSAGE), + }, + ], + }, + queryBar: { + fieldsToValidateOnChange: ['queryBar'], + validations: [ + { + validator: (...args) => { + return queryRequiredValidatorFactory('esql')(...args); + }, + }, + ], + }, +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/translations.ts index 1592a80d3247..70325c76b932 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/translations.ts @@ -21,17 +21,17 @@ export const NAME_LABEL = i18n.translate( } ); -export const SPLUNK_QUERY_TITLE = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.splunkQueryTitle', +export const NAME_REQUIRED_ERROR_MESSAGE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.nameFieldRequiredError', { - defaultMessage: 'Splunk query', + defaultMessage: 'A name is required.', } ); -export const PREBUILT_RULE_QUERY_TITLE = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.prebuiltRuleQueryTitle', +export const SPLUNK_QUERY_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.splunkQueryTitle', { - defaultMessage: 'Prebuilt rule query', + defaultMessage: 'Splunk query', } ); @@ -48,3 +48,71 @@ export const TRANSLATED_QUERY_AREAL_LABEL = i18n.translate( defaultMessage: 'Translated query', } ); + +export const INSTALLED_LABEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.installedLabel', + { + defaultMessage: 'Installed', + } +); + +export const EDIT = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.editButtonLabel', + { + defaultMessage: 'Edit', + } +); + +export const SAVE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.saveButtonLabel', + { + defaultMessage: 'Save', + } +); + +export const CANCEL = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.cancelButtonLabel', + { + defaultMessage: 'Cancel', + } +); + +export const CALLOUT_TRANSLATED_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.translatedRuleCalloutTitle', + { + defaultMessage: + 'This rule has been fully translated. Install rule to finish migration. Once installed, you’ll be able to fine tune the rule.', + } +); + +export const CALLOUT_PARTIALLY_TRANSLATED_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.partiallyTranslatedRuleCalloutTitle', + { + defaultMessage: + 'Parts of the query couldn’t be translated, please complete to Install the rule and finish migrating.', + } +); + +export const CALLOUT_PARTIALLY_TRANSLATED_RULE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.partiallyTranslatedRuleCalloutDescription', + { + defaultMessage: + 'In order to save this SIEM Rule to Elastic, you’ll need to finish the query and define the rule severity below. Complete the required fields and finalize the query to save as Rule. Or if you need help, please reach out to Elastic support.', + } +); + +export const CALLOUT_NOT_TRANSLATED_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.notTranslatedRuleCalloutTitle', + { + defaultMessage: + 'This query couldn’t be translated, please complete to Install the rule and finish migrating.', + } +); + +export const CALLOUT_NOT_TRANSLATED_RULE_DESCRIPTION = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.translationTab.notTranslatedRuleCalloutDescription', + { + defaultMessage: + 'When a query cannot be partially translated, there could be a misalignment in features between the SIEM product.', + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/types.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/types.ts new file mode 100644 index 000000000000..1b509a71f47a --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translation_tab/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +type EsqlLanguage = 'esql'; + +export interface RuleTranslationSchema { + ruleName: string; + // The type is compatible with the validation function used in form schema + queryBar: { query: { query: string; language: EsqlLanguage } }; +} diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts index 8e6582b8c198..47a476ef4289 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rule_details_flyout/translations.ts @@ -7,6 +7,13 @@ import { i18n } from '@kbn/i18n'; +export const UNKNOWN_MIGRATION_RULE_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.translationDetails.unknownMigrationRuleTitle', + { + defaultMessage: 'Unknown migration rule', + } +); + export const OVERVIEW_TAB_LABEL = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.translationDetails.overviewTabLabel', { diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx index 106e7ba514d3..07ba44d4d167 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx @@ -224,11 +224,22 @@ export const MigrationRulesTable: React.FC<MigrationRulesTableProps> = React.mem [installSingleRule, isLoading] ); + const getMigrationRule = useCallback( + (ruleId: string) => { + if (!isLoading && ruleMigrations.length) { + return ruleMigrations.find((item) => item.id === ruleId); + } + }, + [isLoading, ruleMigrations] + ); + const { migrationRuleDetailsFlyout: rulePreviewFlyout, openMigrationRuleDetails: openRulePreview, } = useMigrationRuleDetailsFlyout({ + isLoading, prebuiltRules, + getMigrationRule, ruleActionsFactory, }); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx index dd77636521ed..ce0e1d3c99d8 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/name.tsx @@ -6,7 +6,7 @@ */ import React from 'react'; -import { EuiLink } from '@elastic/eui'; +import { EuiLink, EuiText } from '@elastic/eui'; import type { RuleMigration } from '../../../../../common/siem_migrations/model/rule_migration.gen'; import * as i18n from './translations'; import type { TableColumn } from './constants'; @@ -17,6 +17,13 @@ interface NameProps { } const Name = ({ rule, openMigrationRuleDetails }: NameProps) => { + if (!rule.elastic_rule) { + return ( + <EuiText color="danger" size="s"> + {rule.original_rule.title} + </EuiText> + ); + } return ( <EuiLink onClick={() => { @@ -24,7 +31,7 @@ const Name = ({ rule, openMigrationRuleDetails }: NameProps) => { }} data-test-subj="ruleName" > - {rule.elastic_rule?.title} + {rule.elastic_rule.title} </EuiLink> ); }; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx index 5daec1f1b4fa..2936878c93b8 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table_columns/status.tsx @@ -15,9 +15,7 @@ export const createStatusColumn = (): TableColumn => { return { field: 'translation_result', name: i18n.COLUMN_STATUS, - render: (value: RuleMigration['translation_result'], rule: RuleMigration) => ( - <StatusBadge value={value} installedRuleId={rule.elastic_rule?.id} /> - ), + render: (_, rule: RuleMigration) => <StatusBadge migrationRule={rule} />, sortable: true, truncateText: true, width: '15%', diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx index 8f8bcff40f67..f1f435c7e14a 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/index.tsx @@ -10,7 +10,11 @@ import { euiLightVars } from '@kbn/ui-theme'; import { EuiFlexGroup, EuiFlexItem, EuiHealth, EuiIcon, EuiToolTip } from '@elastic/eui'; import { css } from '@emotion/css'; -import type { RuleMigrationTranslationResult } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { + RuleMigrationStatusEnum, + type RuleMigration, + type RuleMigrationTranslationResult, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; import { convertTranslationResultIntoText } from '../../utils/helpers'; import * as i18n from './translations'; @@ -27,35 +31,51 @@ const statusToColorMap: Record<RuleMigrationTranslationResult, string> = { }; interface StatusBadgeProps { - value?: RuleMigrationTranslationResult; - installedRuleId?: string; + migrationRule: RuleMigration; 'data-test-subj'?: string; } export const StatusBadge: React.FC<StatusBadgeProps> = React.memo( - ({ value, installedRuleId, 'data-test-subj': dataTestSubj = 'translation-result' }) => { - const translationResult = installedRuleId ? 'full' : value ?? 'untranslatable'; - const displayValue = installedRuleId - ? i18n.RULE_STATUS_INSTALLED - : convertTranslationResultIntoText(translationResult); - const color = statusToColorMap[translationResult]; + ({ migrationRule, 'data-test-subj': dataTestSubj = 'translation-result' }) => { + // Installed + if (migrationRule.elastic_rule?.id) { + return ( + <EuiToolTip content={i18n.RULE_STATUS_INSTALLED}> + <EuiFlexGroup gutterSize="xs" alignItems="center"> + <EuiFlexItem grow={false}> + <EuiIcon type="check" color={statusToColorMap.full} /> + </EuiFlexItem> + <EuiFlexItem grow={false}>{i18n.RULE_STATUS_INSTALLED}</EuiFlexItem> + </EuiFlexGroup> + </EuiToolTip> + ); + } - return ( - <EuiToolTip content={displayValue}> - {installedRuleId ? ( + // Failed + if (migrationRule.status === RuleMigrationStatusEnum.failed) { + return ( + <EuiToolTip content={i18n.RULE_STATUS_FAILED}> <EuiFlexGroup gutterSize="xs" alignItems="center"> <EuiFlexItem grow={false}> - <EuiIcon type={'check'} color={statusToColorMap.full} /> + <EuiIcon type="warningFilled" color="danger" /> </EuiFlexItem> - <EuiFlexItem grow={false}>{displayValue}</EuiFlexItem> + <EuiFlexItem grow={false}>{i18n.RULE_STATUS_FAILED}</EuiFlexItem> </EuiFlexGroup> - ) : ( - <EuiHealth color={color} data-test-subj={dataTestSubj}> - <div className={statusTextWrapperClassName}> - <span className="eui-textTruncate">{displayValue}</span> - </div> - </EuiHealth> - )} + </EuiToolTip> + ); + } + + const translationResult = migrationRule.translation_result ?? 'untranslatable'; + const displayValue = convertTranslationResultIntoText(translationResult); + const color = statusToColorMap[translationResult]; + + return ( + <EuiToolTip content={displayValue}> + <EuiHealth color={color} data-test-subj={dataTestSubj}> + <div className={statusTextWrapperClassName}> + <span className="eui-textTruncate">{displayValue}</span> + </div> + </EuiHealth> </EuiToolTip> ); } diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts index 0a7b1c37f7ac..a84fd298ed36 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/components/status_badge/translations.ts @@ -13,3 +13,10 @@ export const RULE_STATUS_INSTALLED = i18n.translate( defaultMessage: 'Installed', } ); + +export const RULE_STATUS_FAILED = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.status.failedLabel', + { + defaultMessage: 'Error', + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx b/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx index 4df54d6331f6..4efaa4aba718 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/hooks/use_migration_rule_preview_flyout.tsx @@ -8,7 +8,6 @@ import type { ReactNode } from 'react'; import React, { useCallback, useState, useMemo } from 'react'; import type { EuiTabbedContentTab } from '@elastic/eui'; -import type { RuleResponse } from '../../../../common/api/detection_engine'; import type { PrebuiltRuleVersion, RuleMigration, @@ -16,7 +15,9 @@ import type { import { MigrationRuleDetailsFlyout } from '../components/rule_details_flyout'; interface UseMigrationRuleDetailsFlyoutParams { + isLoading?: boolean; prebuiltRules: Record<string, PrebuiltRuleVersion>; + getMigrationRule: (ruleId: string) => RuleMigration | undefined; ruleActionsFactory: (ruleMigration: RuleMigration, closeRulePreview: () => void) => ReactNode; extraTabsFactory?: (ruleMigration: RuleMigration) => EuiTabbedContentTab[]; } @@ -28,13 +29,34 @@ interface UseMigrationRuleDetailsFlyoutResult { } export function useMigrationRuleDetailsFlyout({ + isLoading, prebuiltRules, + getMigrationRule, extraTabsFactory, ruleActionsFactory, }: UseMigrationRuleDetailsFlyoutParams): UseMigrationRuleDetailsFlyoutResult { - const [ruleMigration, setMigrationRuleForPreview] = useState<RuleMigration | undefined>(); - const [matchedPrebuiltRule, setMatchedPrebuiltRule] = useState<RuleResponse | undefined>(); - const closeMigrationRuleDetails = useCallback(() => setMigrationRuleForPreview(undefined), []); + const [migrationRuleId, setMigrationRuleId] = useState<string | undefined>(); + + const ruleMigration = useMemo(() => { + if (migrationRuleId) { + return getMigrationRule(migrationRuleId); + } + }, [getMigrationRule, migrationRuleId]); + const matchedPrebuiltRule = useMemo(() => { + if (ruleMigration) { + // Find matched prebuilt rule if any and prioritize its installed version + const matchedPrebuiltRuleVersion = ruleMigration.elastic_rule?.prebuilt_rule_id + ? prebuiltRules[ruleMigration.elastic_rule.prebuilt_rule_id] + : undefined; + return matchedPrebuiltRuleVersion?.current ?? matchedPrebuiltRuleVersion?.target; + } + }, [prebuiltRules, ruleMigration]); + + const openMigrationRuleDetails = useCallback((rule: RuleMigration) => { + setMigrationRuleId(rule.id); + }, []); + const closeMigrationRuleDetails = useCallback(() => setMigrationRuleId(undefined), []); + const ruleActions = useMemo( () => ruleMigration && ruleActionsFactory(ruleMigration, closeMigrationRuleDetails), [ruleMigration, ruleActionsFactory, closeMigrationRuleDetails] @@ -44,21 +66,6 @@ export function useMigrationRuleDetailsFlyout({ [ruleMigration, extraTabsFactory] ); - const openMigrationRuleDetails = useCallback( - (rule: RuleMigration) => { - setMigrationRuleForPreview(rule); - - // Find matched prebuilt rule if any and prioritize its installed version - const matchedPrebuiltRuleVersion = rule.elastic_rule?.prebuilt_rule_id - ? prebuiltRules[rule.elastic_rule.prebuilt_rule_id] - : undefined; - const prebuiltRule = - matchedPrebuiltRuleVersion?.current ?? matchedPrebuiltRuleVersion?.target; - setMatchedPrebuiltRule(prebuiltRule); - }, - [prebuiltRules] - ); - return { migrationRuleDetailsFlyout: ruleMigration && ( <MigrationRuleDetailsFlyout @@ -68,6 +75,7 @@ export function useMigrationRuleDetailsFlyout({ closeFlyout={closeMigrationRuleDetails} ruleActions={ruleActions} extraTabs={extraTabs} + isDataLoading={isLoading} /> ), openMigrationRuleDetails, diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts index 3f92da4e8ddc..ef3521fd3730 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/translations.ts @@ -34,3 +34,10 @@ export const INSTALL_MIGRATION_RULES_FAILURE = i18n.translate( defaultMessage: 'Failed to install migration rules', } ); + +export const UPDATE_MIGRATION_RULES_FAILURE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.updateMigrationRulesFailDescription', + { + defaultMessage: 'Failed to update migration rules', + } +); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts index 410957545923..b06f041e2c58 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_get_migration_rules.ts @@ -18,9 +18,10 @@ export const useGetMigrationRules = (params: { migrationId: string; page?: number; perPage?: number; - sortField: string; - sortDirection: 'asc' | 'desc'; + sortField?: string; + sortDirection?: 'asc' | 'desc'; searchTerm?: string; + ids?: string[]; }) => { const { addError } = useAppToasts(); diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.ts new file mode 100644 index 000000000000..1e0fa22c466f --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/logic/use_update_migration_rules.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 { useMutation } from '@tanstack/react-query'; +import type { UpdateRuleMigrationData } from '../../../../common/siem_migrations/model/rule_migration.gen'; +import { SIEM_RULE_MIGRATIONS_PATH } from '../../../../common/siem_migrations/constants'; +import type { UpdateRuleMigrationResponse } from '../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; +import { useAppToasts } from '../../../common/hooks/use_app_toasts'; +import * as i18n from './translations'; +import { useInvalidateGetMigrationRules } from './use_get_migration_rules'; +import { useInvalidateGetMigrationTranslationStats } from './use_get_migration_translation_stats'; +import { updateMigrationRules } from '../api'; + +export const UPDATE_MIGRATION_RULES_MUTATION_KEY = ['PUT', SIEM_RULE_MIGRATIONS_PATH]; + +export const useUpdateMigrationRules = (migrationId: string) => { + const { addError } = useAppToasts(); + + const invalidateGetRuleMigrations = useInvalidateGetMigrationRules(migrationId); + const invalidateGetMigrationTranslationStats = + useInvalidateGetMigrationTranslationStats(migrationId); + + return useMutation<UpdateRuleMigrationResponse, Error, UpdateRuleMigrationData[]>( + (rulesToUpdate) => updateMigrationRules({ rulesToUpdate }), + { + mutationKey: UPDATE_MIGRATION_RULES_MUTATION_KEY, + onError: (error) => { + addError(error, { title: i18n.UPDATE_MIGRATION_RULES_FAILURE }); + }, + onSettled: () => { + invalidateGetRuleMigrations(); + invalidateGetMigrationTranslationStats(); + }, + } + ); +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts index 94082cf59d35..18a4ebe47bf8 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_create_migration.ts @@ -12,10 +12,15 @@ import type { CreateRuleMigrationRequestBody } from '../../../../../common/siem_ import { useKibana } from '../../../../common/lib/kibana/kibana_react'; import { reducer, initialState } from './common/api_request_reducer'; -export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS = i18n.translate( - 'xpack.securitySolution.siemMigrations.rules.service.createRuleSuccess', - { defaultMessage: 'Rules uploaded successfully' } +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS_TITLE = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.createRuleSuccess.title', + { defaultMessage: 'Rule migration created successfully' } ); +export const RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS_DESCRIPTION = (rules: number) => + i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.createRuleSuccess.description', + { defaultMessage: '{rules} rules uploaded', values: { rules } } + ); export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.service.createRuleError', { defaultMessage: 'Failed to upload rules file' } @@ -36,7 +41,10 @@ export const useCreateMigration = (onSuccess: OnSuccess) => { const migrationId = await siemMigrations.rules.createRuleMigration(data); const stats = await siemMigrations.rules.getRuleMigrationStats(migrationId); - notifications.toasts.addSuccess(RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS); + notifications.toasts.addSuccess({ + title: RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS_TITLE, + text: RULES_DATA_INPUT_CREATE_MIGRATION_SUCCESS_DESCRIPTION(data.length), + }); onSuccess(stats); dispatch({ type: 'success' }); } catch (err) { diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts new file mode 100644 index 000000000000..a0679aa1e8bd --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_get_missing_resources.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useCallback, useReducer } from 'react'; +import { i18n } from '@kbn/i18n'; +import type { RuleMigrationResourceData } from '../../../../../common/siem_migrations/model/rule_migration.gen'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; +import { reducer, initialState } from './common/api_request_reducer'; + +export const RULES_DATA_INPUT_CREATE_MIGRATION_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.getMissingResourcesError', + { defaultMessage: 'Failed to fetch missing macros & lookups' } +); + +export type GetMissingResources = (migrationId: string) => void; +export type OnSuccess = (missingResources: RuleMigrationResourceData[]) => void; + +export const useGetMissingResources = (onSuccess: OnSuccess) => { + const { siemMigrations, notifications } = useKibana().services; + const [state, dispatch] = useReducer(reducer, initialState); + + const getMissingResources = useCallback<GetMissingResources>( + (migrationId) => { + (async () => { + try { + dispatch({ type: 'start' }); + const missingResources = await siemMigrations.rules.getMissingResources(migrationId); + + onSuccess(missingResources); + dispatch({ type: 'success' }); + } catch (err) { + const apiError = err.body ?? err; + notifications.toasts.addError(apiError, { + title: RULES_DATA_INPUT_CREATE_MIGRATION_ERROR, + }); + dispatch({ type: 'error', error: apiError }); + } + })(); + }, + [siemMigrations.rules, notifications.toasts, onSuccess] + ); + + return { isLoading: state.loading, error: state.error, getMissingResources }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts index 8b692f07eb3c..88c6b798e2f4 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_latest_stats.ts @@ -6,7 +6,7 @@ */ import useObservable from 'react-use/lib/useObservable'; -import { useEffect, useMemo } from 'react'; +import { useCallback, useEffect, useMemo } from 'react'; import { useKibana } from '../../../../common/lib/kibana/kibana_react'; export const useLatestStats = () => { @@ -16,8 +16,12 @@ export const useLatestStats = () => { siemMigrations.rules.startPolling(); }, [siemMigrations.rules]); + const refreshStats = useCallback(() => { + siemMigrations.rules.getRuleMigrationsStats(); // this updates latestStats$ internally + }, [siemMigrations.rules]); + const latestStats$ = useMemo(() => siemMigrations.rules.getLatestStats$(), [siemMigrations]); const latestStats = useObservable(latestStats$, null); - return { data: latestStats ?? [], isLoading: latestStats === null }; + return { data: latestStats ?? [], isLoading: latestStats === null, refreshStats }; }; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.ts new file mode 100644 index 000000000000..eab3888422ba --- /dev/null +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/hooks/use_upsert_resources.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 { useCallback, useReducer } from 'react'; +import { i18n } from '@kbn/i18n'; +import type { UpsertRuleMigrationResourcesRequestBody } from '../../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; +import { useKibana } from '../../../../common/lib/kibana/kibana_react'; +import { reducer, initialState } from './common/api_request_reducer'; + +export const RULES_DATA_INPUT_UPSERT_MIGRATION_RESOURCES_ERROR = i18n.translate( + 'xpack.securitySolution.siemMigrations.rules.service.upsertRuleMigrationResourcesError', + { defaultMessage: 'Failed to upload rule migration resources' } +); + +export type UpsertResources = ( + migrationId: string, + data: UpsertRuleMigrationResourcesRequestBody +) => void; +export type OnSuccess = () => void; + +export const useUpsertResources = (onSuccess: OnSuccess) => { + const { siemMigrations, notifications } = useKibana().services; + const [state, dispatch] = useReducer(reducer, initialState); + + const upsertResources = useCallback<UpsertResources>( + (migrationId, data) => { + (async () => { + try { + dispatch({ type: 'start' }); + await siemMigrations.rules.upsertMigrationResources(migrationId, data); + + onSuccess(); + dispatch({ type: 'success' }); + } catch (err) { + const apiError = err.body ?? err; + notifications.toasts.addError(apiError, { + title: RULES_DATA_INPUT_UPSERT_MIGRATION_RESOURCES_ERROR, + }); + dispatch({ type: 'error', error: apiError }); + } + })(); + }, + [siemMigrations.rules, notifications.toasts, onSuccess] + ); + + return { isLoading: state.loading, error: state.error, upsertResources }; +}; diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts index c13b0606d771..75b7887db652 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/service/rule_migrations_service.ts @@ -13,11 +13,15 @@ import { TRACE_OPTIONS_SESSION_STORAGE_KEY, } from '@kbn/elastic-assistant/impl/assistant_context/constants'; import type { LangSmithOptions } from '../../../../common/siem_migrations/model/common.gen'; -import type { RuleMigrationTaskStats } from '../../../../common/siem_migrations/model/rule_migration.gen'; +import type { + RuleMigrationResourceData, + RuleMigrationTaskStats, +} from '../../../../common/siem_migrations/model/rule_migration.gen'; import type { CreateRuleMigrationRequestBody, GetAllStatsRuleMigrationResponse, GetRuleMigrationStatsResponse, + UpsertRuleMigrationResourcesRequestBody, } from '../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; import { SiemMigrationTaskStatus } from '../../../../common/siem_migrations/constants'; import type { StartPluginsDependencies } from '../../../types'; @@ -29,6 +33,8 @@ import { getRuleMigrationsStatsAll, startRuleMigration, type GetRuleMigrationsStatsAllParams, + getMissingResources, + upsertMigrationResources, } from '../api'; import type { RuleMigrationStats } from '../types'; import { getSuccessToast } from './success_notification'; @@ -99,6 +105,20 @@ export class SiemRulesMigrationsService { return migrationId as string; } + public async upsertMigrationResources( + migrationId: string, + body: UpsertRuleMigrationResourcesRequestBody + ): Promise<void> { + if (body.length === 0) { + throw new Error(i18n.EMPTY_RULES_ERROR); + } + // Batching creation to avoid hitting the max payload size limit of the API + for (let i = 0; i < body.length; i += CREATE_MIGRATION_BODY_BATCH_SIZE) { + const bodyBatch = body.slice(i, i + CREATE_MIGRATION_BODY_BATCH_SIZE); + await upsertMigrationResources({ migrationId, body: bodyBatch }); + } + } + public async startRuleMigration(migrationId: string): Promise<GetAllStatsRuleMigrationResponse> { const connectorId = this.connectorIdStorage.get(); if (!connectorId) { @@ -135,6 +155,10 @@ export class SiemRulesMigrationsService { return results; } + public async getMissingResources(migrationId: string): Promise<RuleMigrationResourceData[]> { + return getMissingResources({ migrationId }); + } + private async getRuleMigrationsStatsWithRetry( params: GetRuleMigrationsStatsAllParams = {}, sleepSecs?: number diff --git a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts b/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts index 366ad435c61b..03f76cb83381 100644 --- a/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts +++ b/x-pack/plugins/security_solution/public/siem_migrations/rules/utils/translations.ts @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; export const SIEM_TRANSLATION_RESULT_FULL_LABEL = i18n.translate( 'xpack.securitySolution.siemMigrations.rules.translationResult.full', { - defaultMessage: 'Fully translated', + defaultMessage: 'Translated', } ); diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx index 339a55a8b6d5..a132a1745af6 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.test.tsx @@ -113,6 +113,7 @@ describe('FormattedIp', () => { params: { ip: props.value, flowTarget: 'source', + scopeId: TimelineId.active, }, }, }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx index fc03759e17b1..3871a20f6b69 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx @@ -195,6 +195,7 @@ const AddressLinksItemComponent: React.FC<AddressLinksItemProps> = ({ id: NetworkPanelKey, params: { ip: address, + scopeId: eventContext.timelineID, flowTarget: fieldName.includes(FlowTargetSourceDest.destination) ? FlowTargetSourceDest.destination : FlowTargetSourceDest.source, diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx index d41c0238ce59..057f108834ee 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/formatted_field_helpers.tsx @@ -67,7 +67,7 @@ export const RenderRuleName: React.FC<RenderRuleNameProps> = ({ title, value, }) => { - const { openRightPanel } = useExpandableFlyoutApi(); + const { openFlyout } = useExpandableFlyoutApi(); const eventContext = useContext(StatefulEventContext); const ruleName = `${value}`; @@ -91,14 +91,16 @@ export const RenderRuleName: React.FC<RenderRuleNameProps> = ({ return; } - openRightPanel({ - id: RulePanelKey, - params: { - ruleId, + openFlyout({ + right: { + id: RulePanelKey, + params: { + ruleId, + }, }, }); }, - [navigateToApp, ruleId, search, openInNewTab, openRightPanel, eventContext, isInTimelineContext] + [navigateToApp, ruleId, search, openInNewTab, openFlyout, eventContext, isInTimelineContext] ); const href = useMemo( diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx index a7769069ff19..24f704e5f846 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.test.tsx @@ -16,7 +16,7 @@ import { TableId } from '@kbn/securitysolution-data-table'; import { createExpandableFlyoutApiMock } from '../../../../../common/mock/expandable_flyout'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; -const mockOpenRightPanel = jest.fn(); +const mockOpenFlyout = jest.fn(); jest.mock('@kbn/expandable-flyout'); @@ -28,7 +28,7 @@ describe('HostName', () => { beforeEach(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue({ ...createExpandableFlyoutApiMock(), - openRightPanel: mockOpenRightPanel, + openFlyout: mockOpenFlyout, }); }); @@ -81,7 +81,7 @@ describe('HostName', () => { wrapper.find('[data-test-subj="host-details-button"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).not.toHaveBeenCalled(); + expect(mockOpenFlyout).not.toHaveBeenCalled(); }); }); @@ -103,7 +103,7 @@ describe('HostName', () => { wrapper.find('[data-test-subj="host-details-button"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).not.toHaveBeenCalled(); + expect(mockOpenFlyout).not.toHaveBeenCalled(); }); }); @@ -125,7 +125,7 @@ describe('HostName', () => { wrapper.find('[data-test-subj="host-details-button"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).not.toHaveBeenCalled(); + expect(mockOpenFlyout).not.toHaveBeenCalled(); }); }); @@ -146,13 +146,15 @@ describe('HostName', () => { wrapper.find('[data-test-subj="host-details-button"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).toHaveBeenCalledWith({ - id: 'host-panel', - params: { - hostName: props.value, - contextID: props.contextId, - scopeId: TableId.alertsOnAlertsPage, - isDraggable: false, + expect(mockOpenFlyout).toHaveBeenCalledWith({ + right: { + id: 'host-panel', + params: { + hostName: props.value, + contextID: props.contextId, + scopeId: TableId.alertsOnAlertsPage, + isDraggable: false, + }, }, }); }); @@ -175,13 +177,15 @@ describe('HostName', () => { wrapper.find('[data-test-subj="host-details-button"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).toHaveBeenCalledWith({ - id: 'host-panel', - params: { - hostName: props.value, - contextID: props.contextId, - scopeId: 'timeline-1', - isDraggable: false, + expect(mockOpenFlyout).toHaveBeenCalledWith({ + right: { + id: 'host-panel', + params: { + hostName: props.value, + contextID: props.contextId, + scopeId: 'timeline-1', + isDraggable: false, + }, }, }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx index 41d403b3f2c5..0597b3e99d20 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx @@ -44,7 +44,7 @@ const HostNameComponent: React.FC<Props> = ({ title, value, }) => { - const { openRightPanel } = useExpandableFlyoutApi(); + const { openFlyout } = useExpandableFlyoutApi(); const isInSecurityApp = useIsInSecurityApp(); @@ -70,18 +70,19 @@ const HostNameComponent: React.FC<Props> = ({ } const { timelineID } = eventContext; - - openRightPanel({ - id: HostPanelKey, - params: { - hostName, - contextID: contextId, - scopeId: timelineID, - isDraggable, + openFlyout({ + right: { + id: HostPanelKey, + params: { + hostName, + contextID: contextId, + scopeId: timelineID, + isDraggable, + }, }, }); }, - [contextId, eventContext, hostName, isDraggable, isInTimelineContext, onClick, openRightPanel] + [contextId, eventContext, hostName, isDraggable, isInTimelineContext, onClick, openFlyout] ); // The below is explicitly defined this way as the onClick takes precedence when it and the href are both defined diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx index bdb53f5850ec..c3211d5fd776 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.test.tsx @@ -16,7 +16,7 @@ import { TableId } from '@kbn/securitysolution-data-table'; import { useExpandableFlyoutApi } from '@kbn/expandable-flyout'; import { createExpandableFlyoutApiMock } from '../../../../../common/mock/expandable_flyout'; -const mockOpenRightPanel = jest.fn(); +const mockOpenFlyout = jest.fn(); jest.mock('@kbn/expandable-flyout'); @@ -28,7 +28,7 @@ describe('UserName', () => { beforeEach(() => { jest.mocked(useExpandableFlyoutApi).mockReturnValue({ ...createExpandableFlyoutApiMock(), - openRightPanel: mockOpenRightPanel, + openFlyout: mockOpenFlyout, }); }); afterEach(() => { @@ -78,7 +78,7 @@ describe('UserName', () => { wrapper.find('[data-test-subj="users-link-anchor"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).not.toHaveBeenCalled(); + expect(mockOpenFlyout).not.toHaveBeenCalled(); }); }); @@ -100,7 +100,7 @@ describe('UserName', () => { wrapper.find('[data-test-subj="users-link-anchor"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).not.toHaveBeenCalled(); + expect(mockOpenFlyout).not.toHaveBeenCalled(); }); }); @@ -121,13 +121,15 @@ describe('UserName', () => { wrapper.find('[data-test-subj="users-link-anchor"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).toHaveBeenCalledWith({ - id: 'user-panel', - params: { - userName: props.value, - contextID: props.contextId, - scopeId: TableId.alertsOnAlertsPage, - isDraggable: false, + expect(mockOpenFlyout).toHaveBeenCalledWith({ + right: { + id: 'user-panel', + params: { + userName: props.value, + contextID: props.contextId, + scopeId: TableId.alertsOnAlertsPage, + isDraggable: false, + }, }, }); }); @@ -150,13 +152,15 @@ describe('UserName', () => { wrapper.find('[data-test-subj="users-link-anchor"]').last().simulate('click'); await waitFor(() => { - expect(mockOpenRightPanel).toHaveBeenCalledWith({ - id: 'user-panel', - params: { - userName: props.value, - contextID: props.contextId, - scopeId: 'timeline-1', - isDraggable: false, + expect(mockOpenFlyout).toHaveBeenCalledWith({ + right: { + id: 'user-panel', + params: { + userName: props.value, + contextID: props.contextId, + scopeId: 'timeline-1', + isDraggable: false, + }, }, }); }); diff --git a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx index 31a8424e5ea0..88e8889353a0 100644 --- a/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx +++ b/x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/user_name.tsx @@ -47,7 +47,7 @@ const UserNameComponent: React.FC<Props> = ({ const eventContext = useContext(StatefulEventContext); const userName = `${value}`; const isInTimelineContext = userName && eventContext?.timelineID; - const { openRightPanel } = useExpandableFlyoutApi(); + const { openFlyout } = useExpandableFlyoutApi(); const isInSecurityApp = useIsInSecurityApp(); @@ -65,17 +65,19 @@ const UserNameComponent: React.FC<Props> = ({ const { timelineID } = eventContext; - openRightPanel({ - id: UserPanelKey, - params: { - userName, - contextID: contextId, - scopeId: timelineID, - isDraggable, + openFlyout({ + right: { + id: UserPanelKey, + params: { + userName, + contextID: contextId, + scopeId: timelineID, + isDraggable, + }, }, }); }, - [contextId, eventContext, isDraggable, isInTimelineContext, onClick, openRightPanel, userName] + [contextId, eventContext, isDraggable, isInTimelineContext, onClick, openFlyout, userName] ); // The below is explicitly defined this way as the onClick takes precedence when it and the href are both defined diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts index 51260c5ac605..cc9a75148d9d 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_server/fleet_server_services.ts @@ -277,6 +277,7 @@ const startFleetServerWithDocker = async ({ const isServerless = await isServerlessKibanaFlavor(kbnClient); const esURL = new URL(await getFleetElasticsearchOutputHost(kbnClient)); const containerName = `dev-fleet-server.${port}`; + let fleetServerVersionInfo = ''; log.info( `Starting a new fleet server using Docker\n Agent version: ${agentVersion}\n Server URL: ${fleetServerUrl}` @@ -284,10 +285,11 @@ const startFleetServerWithDocker = async ({ let retryAttempt = isServerless ? 0 : 1; const attemptServerlessFleetServerSetup = async (): Promise<StartedServer> => { + fleetServerVersionInfo = ''; + return log.indent(4, async () => { const hostname = `dev-fleet-server.${port}.${Math.random().toString(32).substring(2, 6)}`; let containerId = ''; - let fleetServerVersionInfo = ''; if (isLocalhost(esURL.hostname)) { esURL.hostname = localhostRealIp; @@ -361,8 +363,17 @@ const startFleetServerWithDocker = async ({ } fleetServerVersionInfo = isServerless - ? // `/usr/bin/fleet-server` process does not seem to support a `--version` type of argument - 'Running latest standalone fleet server' + ? ( + await execa + .command(`docker exec ${containerName} /usr/bin/fleet-server --version`) + .catch((err) => { + log.verbose( + `Failed to retrieve fleet-server (serverless/standalone) version information from running instance.`, + err + ); + return { stdout: 'Unable to retrieve version information (serverless)' }; + }) + ).stdout : ( await execa('docker', [ 'exec', @@ -424,7 +435,7 @@ Kill container: ${chalk.cyan(`docker kill ${containerId}`)} const response: StartedServer = await attemptServerlessFleetServerSetup(); - log.info(`Done. Fleet server up and running`); + log.info(`Done. Fleet server up and running (version: ${fleetServerVersionInfo})`); return response; }; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts index a07823194fa6..7c89beec9150 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/fleet_services.ts @@ -56,12 +56,14 @@ import type { DeleteAgentPolicyResponse, EnrollmentAPIKey, GenerateServiceTokenResponse, + GetActionStatusResponse, GetAgentsRequest, GetEnrollmentAPIKeysResponse, GetOutputsResponse, PostAgentUnenrollResponse, UpdateAgentPolicyRequest, UpdateAgentPolicyResponse, + PostNewAgentActionResponse, } from '@kbn/fleet-plugin/common/types'; import semver from 'semver'; import axios from 'axios'; @@ -1499,3 +1501,92 @@ export const updateAgentPolicy = async ( .catch(catchAxiosErrorFormatAndThrow) .then((response) => response.data.item); }; + +/** + * Sets the log level on a Fleet agent and waits a bit of time to allow it for to + * complete (but does not error if it does not complete) + * + * @param kbnClient + * @param agentId + * @param logLevel + * @param log + */ +export const setAgentLoggingLevel = async ( + kbnClient: KbnClient, + agentId: string, + logLevel: 'debug' | 'info' | 'warning' | 'error', + log: ToolingLog = createToolingLogger() +): Promise<PostNewAgentActionResponse> => { + log.debug(`Setting fleet agent [${agentId}] logging level to [${logLevel}]`); + + const response = await kbnClient + .request<PostNewAgentActionResponse>({ + method: 'POST', + path: `/api/fleet/agents/${agentId}/actions`, + body: { action: { type: 'SETTINGS', data: { log_level: logLevel } } }, + headers: { 'Elastic-Api-Version': API_VERSIONS.public.v1 }, + }) + .then((res) => res.data); + + // Wait to see if the action completes, but don't `throw` if it does not + await waitForFleetAgentActionToComplete(kbnClient, response.item.id) + .then(() => { + log.debug(`Fleet action to set agent [${agentId}] logging level to [${logLevel}] completed!`); + }) + .catch((err) => { + log.debug(err.message); + }); + + return response; +}; + +/** + * Retrieve fleet agent action statuses + * @param kbnClient + */ +export const fetchFleetAgentActionStatus = async ( + kbnClient: KbnClient +): Promise<GetActionStatusResponse> => { + return kbnClient + .request<GetActionStatusResponse>({ + method: 'GET', + path: agentRouteService.getActionStatusPath(), + query: { perPage: 1000 }, + headers: { 'Elastic-Api-Version': API_VERSIONS.public.v1 }, + }) + .then((response) => response.data); +}; + +/** + * Check and wait until a Fleet Agent action is complete. + * @param kbnClient + * @param actionId + * @param timeout + * + * @throws + */ +export const waitForFleetAgentActionToComplete = async ( + kbnClient: KbnClient, + actionId: string, + timeout: number = 20_000 +): Promise<void> => { + await pRetry( + async (attempts) => { + const { items: actionList } = await fetchFleetAgentActionStatus(kbnClient); + const actionInfo = actionList.find((action) => action.actionId === actionId); + + if (!actionInfo) { + throw new Error( + `Fleet Agent action id [${actionId}] was not found in list of actions retrieved from fleet!` + ); + } + + if (actionInfo.status === 'IN_PROGRESS') { + throw new Error( + `Fleet agent action id [${actionId}] remains in progress after [${attempts}] attempts to check its status` + ); + } + }, + { maxTimeout: 2_000, maxRetryTime: timeout } + ); +}; diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/types.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/types.ts index 38256f1c774b..e3e41c41b77f 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/types.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/types.ts @@ -14,8 +14,12 @@ export interface HostVm { exec: (command: string) => Promise<HostVmExecResponse>; mount: (localDir: string, hostVmDir: string) => Promise<HostVmMountResponse>; unmount: (hostVmDir: string) => Promise<void>; - /** Uploads/copies a file from the local machine to the VM */ + /** @deprecated use `upload` */ transfer: (localFilePath: string, destFilePath: string) => Promise<HostVmTransferResponse>; + /** Uploads/copies a file from the local machine to the VM */ + upload: (localFilePath: string, destFilePath: string) => Promise<HostVmTransferResponse>; + /** Downloads a file from the host VM to the local machine */ + download: (vmFilePath: string, localFilePath: string) => Promise<HostVmTransferResponse>; destroy: () => Promise<void>; info: () => string; stop: () => void; @@ -33,8 +37,8 @@ export interface HostVmMountResponse { unmount: () => Promise<void>; } export interface HostVmTransferResponse { - /** The file path of the file on the host vm */ + /** The path of the file that was either uploaded to the host VM or downloaded to the local machine from the VM */ filePath: string; - /** Delete the file from the host VM */ + /** Delete the file from the host VM or from the local machine depending on what client method was used */ delete: () => Promise<HostVmExecResponse>; } diff --git a/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts b/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts index 084e068768e8..fc1301c9fed9 100644 --- a/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts +++ b/x-pack/plugins/security_solution/scripts/endpoint/common/vm_services.ts @@ -8,15 +8,19 @@ import type { ToolingLog } from '@kbn/tooling-log'; import execa from 'execa'; import chalk from 'chalk'; +import path from 'path'; import { userInfo } from 'os'; -import { join as pathJoin, dirname } from 'path'; +import { unlink as deleteFile } from 'fs/promises'; +import { dump } from './utils'; import type { DownloadedAgentInfo } from './agent_downloads_service'; import { BaseDataGenerator } from '../../../common/endpoint/data_generators/base_data_generator'; import { createToolingLogger } from '../../../common/endpoint/data_loaders/utils'; import type { HostVm, HostVmExecResponse, SupportedVmManager } from './types'; const baseGenerator = new BaseDataGenerator(); -export const DEFAULT_VAGRANTFILE = pathJoin(__dirname, 'vagrant', 'Vagrantfile'); +export const DEFAULT_VAGRANTFILE = path.join(__dirname, 'vagrant', 'Vagrantfile'); + +const MAX_BUFFER = 1024 * 1024 * 5; // 5MB export interface BaseVmCreateOptions { name: string; @@ -75,9 +79,16 @@ export const createMultipassHostVmClient = ( log: ToolingLog = createToolingLogger() ): HostVm => { const exec = async (command: string): Promise<HostVmExecResponse> => { - const execResponse = await execa.command(`multipass exec ${name} -- ${command}`); - - log.verbose(execResponse); + const execResponse = await execa + .command(`multipass exec ${name} -- ${command}`, { maxBuffer: MAX_BUFFER }) + .catch((e) => { + log.error(dump(e)); + throw e; + }); + + log.verbose( + `exec response from host [${name}] for command [${command}]:\n${dump(execResponse)}` + ); return { stdout: execResponse.stdout, @@ -125,11 +136,11 @@ export const createMultipassHostVmClient = ( log.verbose(`multipass stop response:\n`, response); }; - const transfer: HostVm['transfer'] = async (localFilePath, destFilePath) => { + const upload: HostVm['upload'] = async (localFilePath, destFilePath) => { const response = await execa.command( `multipass transfer ${localFilePath} ${name}:${destFilePath}` ); - log.verbose(`Transferred file to VM [${name}]:`, response); + log.verbose(`Uploaded file to VM [${name}]:`, response); return { filePath: destFilePath, @@ -139,6 +150,27 @@ export const createMultipassHostVmClient = ( }; }; + const download: HostVm['download'] = async (vmFilePath: string, localFilePath: string) => { + const localFileAbsolutePath = path.resolve(localFilePath); + const response = await execa.command( + `multipass transfer ${name}:${vmFilePath} ${localFilePath}` + ); + log.verbose(`Downloaded file from VM [${name}]:`, response); + + return { + filePath: localFileAbsolutePath, + delete: async () => { + return deleteFile(localFileAbsolutePath).then(() => { + return { + stdout: 'success', + stderr: '', + exitCode: 0, + }; + }); + }, + }; + }; + return { type: 'multipass', name, @@ -147,7 +179,9 @@ export const createMultipassHostVmClient = ( info, mount, unmount, - transfer, + transfer: upload, + upload, + download, start, stop, }; @@ -217,7 +251,7 @@ const createVagrantVm = async ({ }: CreateVagrantVmOptions): Promise<HostVm> => { log.debug(`Using Vagrantfile: ${vagrantFile}`); - const VAGRANT_CWD = dirname(vagrantFile); + const VAGRANT_CWD = path.dirname(vagrantFile); // Destroy the VM running (if any) with the provided vagrant file before re-creating it try { @@ -273,18 +307,24 @@ export const createVagrantHostVmClient = ( vagrantFile: string = DEFAULT_VAGRANTFILE, log: ToolingLog = createToolingLogger() ): HostVm => { - const VAGRANT_CWD = dirname(vagrantFile); + const VAGRANT_CWD = path.dirname(vagrantFile); const execaOptions: execa.Options = { env: { VAGRANT_CWD, }, stdio: ['inherit', 'pipe', 'pipe'], + maxBuffer: MAX_BUFFER, }; log.debug(`Creating Vagrant VM client for [${name}] with vagrantfile [${vagrantFile}]`); const exec = async (command: string): Promise<HostVmExecResponse> => { - const execResponse = await execa.command(`vagrant ssh -- ${command}`, execaOptions); + const execResponse = await execa + .command(`vagrant ssh -- ${command}`, execaOptions) + .catch((e) => { + log.error(dump(e)); + throw e; + }); log.verbose(execResponse); @@ -328,12 +368,12 @@ export const createVagrantHostVmClient = ( log.verbose('vagrant suspend response:\n', response); }; - const transfer: HostVm['transfer'] = async (localFilePath, destFilePath) => { + const upload: HostVm['upload'] = async (localFilePath, destFilePath) => { const response = await execa.command( `vagrant upload ${localFilePath} ${destFilePath}`, execaOptions ); - log.verbose(`Transferred file to VM [${name}]:`, response); + log.verbose(`Uploaded file to VM [${name}]:`, response); return { filePath: destFilePath, @@ -343,6 +383,34 @@ export const createVagrantHostVmClient = ( }; }; + const download: HostVm['download'] = async (vmFilePath, localFilePath) => { + const localFileAbsolutePath = path.resolve(localFilePath); + + // Vagrant will auto-mount the directory that includes the Vagrant file to the VM under `/vagrant`, + // and it keeps that sync'd to the local system. So we first copy the file in the VM there so we + // can retrieve it from the local machine + await exec(`cp ${vmFilePath} /vagrant`).catch((e) => { + log.error(`Error while attempting to copy file on VM:\n${dump(e)}`); + throw e; + }); + + // Now move the file from the local vagrant directory to the desired location + await execa.command(`mv ${VAGRANT_CWD}/${path.basename(vmFilePath)} ${localFileAbsolutePath}`); + + return { + filePath: localFileAbsolutePath, + delete: async () => { + return deleteFile(localFileAbsolutePath).then(() => { + return { + stdout: 'success', + stderr: '', + exitCode: 0, + }; + }); + }, + }; + }; + return { type: 'vagrant', name, @@ -351,7 +419,9 @@ export const createVagrantHostVmClient = ( info, mount, unmount, - transfer, + transfer: upload, + upload, + download, start, stop, }; diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js index 2c0e36f3db8e..7bfd659927ec 100644 --- a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js +++ b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections.js @@ -20,21 +20,10 @@ const ROOT = resolve(__dirname, '../..'); ), options: { includeLabels: ['serverless'], - prototypeDocument: { - info: { - title: 'Security Detections API (Elastic Cloud Serverless)', - 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.', - }, - tags: [ - { - name: 'Security Detections API', - 'x-displayName': 'Security detections', - 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.', - }, - ], - }, + prototypeDocument: join( + ROOT, + 'scripts/openapi/bundle_detections_info/detections_serverless.info.yaml' + ), }, }); @@ -46,21 +35,10 @@ const ROOT = resolve(__dirname, '../..'); ), options: { includeLabels: ['ess'], - prototypeDocument: { - info: { - title: 'Security Detections API (Elastic Cloud and self-hosted)', - 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.', - }, - tags: [ - { - name: 'Security Detections API', - 'x-displayName': 'Security detections', - 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.', - }, - ], - }, + prototypeDocument: join( + ROOT, + 'scripts/openapi/bundle_detections_info/detections_ess.info.yaml' + ), }, }); })(); diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml new file mode 100644 index 000000000000..bb3f8830dc35 --- /dev/null +++ b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_ess.info.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.3 +info: + title: "Security Detections API (Elastic Cloud and self-hosted)" + description: "Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged." + +tags: + - name: "Security Detections API" + x-displayName: "Security detections" + description: | + Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged. + > warn + > If the API key used for authorization has different privileges than the key that created or most recently updated a rule, the rule behavior might change. + + > If the API key that created a rule is deleted, or the user that created the rule becomes inactive, the rule will stop running. \ No newline at end of file diff --git a/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml new file mode 100644 index 000000000000..a90f669b4ed2 --- /dev/null +++ b/x-pack/plugins/security_solution/scripts/openapi/bundle_detections_info/detections_serverless.info.yaml @@ -0,0 +1,14 @@ +openapi: 3.0.3 +info: + title: "Security Detections API (Elastic Cloud Serverless)" + description: "Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged." + +tags: + - name: "Security Detections API" + x-displayName: "Security detections" + description: | + Use the detections APIs to create and manage detection rules. Detection rules search events and external alerts sent to Elastic Security and generate detection alerts from any hits. Alerts are displayed on the **Alerts** page and can be assigned and triaged, using the alert status to mark them as open, closed, or acknowledged. + > warn + > If the API key used for authorization has different privileges than the key that created or most recently updated a rule, the rule behavior might change. + + > If the API key that created a rule is deleted, or the user that created the rule becomes inactive, the rule will stop running. \ No newline at end of file diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts b/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts index 0f93e4fceb10..77c01622a5df 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/parallel.ts @@ -32,7 +32,7 @@ import { createKbnClient } from '../endpoint/common/stack_services'; import type { StartedFleetServer } from '../endpoint/common/fleet_server/fleet_server_services'; import { startFleetServer } from '../endpoint/common/fleet_server/fleet_server_services'; import { renderSummaryTable } from './print_run'; -import { parseTestFileConfig, retrieveIntegrations } from './utils'; +import { parseTestFileConfig, retrieveIntegrations, setDefaultToolingLoggingLevel } from './utils'; import { getFTRConfig } from './get_ftr_config'; export const cli = () => { @@ -70,9 +70,9 @@ ${JSON.stringify(argv, null, 2)} const cypressConfigFilePath = require.resolve(`../../${argv.configFile}`) as string; const cypressConfigFile = await import(cypressConfigFilePath); - if (cypressConfigFile.env?.TOOLING_LOG_LEVEL) { - createToolingLogger.defaultLogLevel = cypressConfigFile.env.TOOLING_LOG_LEVEL; - } + // Adjust tooling log level based on the `TOOLING_LOG_LEVEL` property, which can be + // defined in the cypress config file or set in the `env` + setDefaultToolingLoggingLevel(cypressConfigFile?.env?.TOOLING_LOG_LEVEL); const log = prefixedOutputLogger('cy.parallel()', createToolingLogger()); diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts b/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts index 0b426cf1e8c2..7a68b596ea5d 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/parallel_serverless.ts @@ -28,7 +28,12 @@ import { INITIAL_REST_VERSION } from '@kbn/data-views-plugin/server/constants'; import { catchAxiosErrorFormatAndThrow } from '../../common/endpoint/format_axios_error'; import { createToolingLogger } from '../../common/endpoint/data_loaders/utils'; import { renderSummaryTable } from './print_run'; -import { getOnBeforeHook, parseTestFileConfig, retrieveIntegrations } from './utils'; +import { + getOnBeforeHook, + parseTestFileConfig, + retrieveIntegrations, + setDefaultToolingLoggingLevel, +} from './utils'; import { prefixedOutputLogger } from '../endpoint/common/utils'; import type { ProductType, Credentials, ProjectHandler } from './project_handler/project_handler'; @@ -363,9 +368,8 @@ ${JSON.stringify(argv, null, 2)} cypressConfigFile.env.grepTags = '@serverlessQA --@skipInServerless --@skipInServerlessMKI'; } - if (cypressConfigFile.env?.TOOLING_LOG_LEVEL) { - createToolingLogger.defaultLogLevel = cypressConfigFile.env.TOOLING_LOG_LEVEL; - } + setDefaultToolingLoggingLevel(cypressConfigFile?.env?.TOOLING_LOG_LEVEL); + // eslint-disable-next-line require-atomic-updates log = prefixedOutputLogger('cy.parallel(svl)', createToolingLogger()); diff --git a/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts b/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts index ba1974565e10..6e292eff9a38 100644 --- a/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts +++ b/x-pack/plugins/security_solution/scripts/run_cypress/utils.ts @@ -12,6 +12,8 @@ import generate from '@babel/generator'; import type { ExpressionStatement, ObjectExpression, ObjectProperty } from '@babel/types'; import { schema, type TypeOf } from '@kbn/config-schema'; import chalk from 'chalk'; +import type { ToolingLogTextWriterConfig } from '@kbn/tooling-log'; +import { createToolingLogger } from '../../common/endpoint/data_loaders/utils'; /** * Retrieve test files using a glob pattern. @@ -156,3 +158,22 @@ export const getOnBeforeHook = (module: unknown, beforeSpecFilePath: string): Fu return module.onBeforeHook; }; + +/** + * Sets the default log level for `ToolingLog` instances created by `createToolingLogger()`: + * `x-pack/plugins/security_solution/common/endpoint/data_loaders/utils.ts:148`. + * It will first check the NodeJs `process.env` to see if an Environment Variable was set + * and then, if provided, it will use the value defined in the Cypress Config. file. + */ +export const setDefaultToolingLoggingLevel = (defaultFallbackLoggingLevel?: string) => { + const logLevel = + process.env.TOOLING_LOG_LEVEL || + process.env.CYPRESS_TOOLING_LOG_LEVEL || + defaultFallbackLoggingLevel || + ''; + + if (logLevel) { + createToolingLogger('info').info(`Setting tooling log level to [${logLevel}]`); + createToolingLogger.defaultLogLevel = logLevel as ToolingLogTextWriterConfig['level']; + } +}; diff --git a/x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts b/x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts index e4de97523a84..d8d043c29ec6 100644 --- a/x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts +++ b/x-pack/plugins/security_solution/server/endpoint/mocks/utils.mock.ts @@ -6,7 +6,7 @@ */ import type { ElasticsearchClientMock } from '@kbn/core-elasticsearch-client-server-mocks'; -import type { SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { OpenPointInTimeResponse, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; import { v4 as uuidV4 } from 'uuid'; import { BaseDataGenerator } from '../../../common/endpoint/data_generators/base_data_generator'; @@ -45,14 +45,14 @@ export const applyEsClientSearchMock = <TDocument = unknown>({ const pitResponse = { id: `mock:pit:${index}:${uuidV4()}` }; openedPitIds.add(pitResponse.id); - return pitResponse; + return pitResponse as OpenPointInTimeResponse; } if (priorOpenPointInTimeImplementation) { return priorOpenPointInTimeImplementation(...args); } - return { id: 'mock' }; + return { id: 'mock' } as OpenPointInTimeResponse; }); esClientMock.closePointInTime.mockImplementation(async (...args) => { diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts b/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts index 0c0d1f8a167d..a85ebb4a0391 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/actions/response_actions.ts @@ -6,31 +6,29 @@ */ import type { RequestHandler } from '@kbn/core/server'; - -import { responseActionsWithLegacyActionProperty } from '../../services/actions/constants'; -import { stringify } from '../../utils/stringify'; -import { getResponseActionsClient, NormalizedExternalConnectorClient } from '../../services'; -import type { ResponseActionsClient } from '../../services/actions/clients/lib/types'; -import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; import type { - KillProcessRequestBody, - SuspendProcessRequestBody, -} from '../../../../common/api/endpoint'; + ResponseActionAgentType, + ResponseActionsApiCommandNames, +} from '../../../../common/endpoint/service/response_actions/constants'; +import type { RunScriptActionRequestBody } from '../../../../common/api/endpoint'; import { EndpointActionGetFileSchema, type ExecuteActionRequestBody, ExecuteActionRequestSchema, GetProcessesRouteRequestSchema, IsolateRouteRequestSchema, + type KillProcessRequestBody, KillProcessRouteRequestSchema, type ResponseActionGetFileRequestBody, type ResponseActionsRequestBody, type ScanActionRequestBody, ScanActionRequestSchema, + type SuspendProcessRequestBody, SuspendProcessRouteRequestSchema, UnisolateRouteRequestSchema, type UploadActionApiRequestBody, UploadActionRequestSchema, + RunScriptActionRequestSchema, } from '../../../../common/api/endpoint'; import { @@ -39,29 +37,32 @@ import { GET_PROCESSES_ROUTE, ISOLATE_HOST_ROUTE_V2, KILL_PROCESS_ROUTE, + RUN_SCRIPT_ROUTE, SCAN_ROUTE, SUSPEND_PROCESS_ROUTE, UNISOLATE_HOST_ROUTE_V2, UPLOAD_ROUTE, } from '../../../../common/endpoint/constants'; import type { - ActionDetails, - EndpointActionDataParameterTypes, ResponseActionParametersWithProcessData, ResponseActionsExecuteParameters, ResponseActionScanParameters, + EndpointActionDataParameterTypes, + ActionDetails, + ResponseActionRunScriptParameters, } from '../../../../common/endpoint/types'; -import type { - ResponseActionAgentType, - ResponseActionsApiCommandNames, -} from '../../../../common/endpoint/service/response_actions/constants'; import type { SecuritySolutionPluginRouter, SecuritySolutionRequestHandlerContext, } from '../../../types'; import type { EndpointAppContext } from '../../types'; import { withEndpointAuthz } from '../with_endpoint_authz'; +import { stringify } from '../../utils/stringify'; import { errorHandler } from '../error_handler'; +import { CustomHttpRequestError } from '../../../utils/custom_http_request_error'; +import type { ResponseActionsClient } from '../../services'; +import { getResponseActionsClient, NormalizedExternalConnectorClient } from '../../services'; +import { responseActionsWithLegacyActionProperty } from '../../services/actions/constants'; export function registerResponseActionRoutes( router: SecuritySolutionPluginRouter, @@ -307,6 +308,33 @@ export function registerResponseActionRoutes( responseActionRequestHandler<ResponseActionScanParameters>(endpointContext, 'scan') ) ); + router.versioned + .post({ + access: 'public', + path: RUN_SCRIPT_ROUTE, + security: { + authz: { + requiredPrivileges: ['securitySolution'], + }, + }, + options: { authRequired: true }, + }) + .addVersion( + { + version: '2023-10-31', + validate: { + request: RunScriptActionRequestSchema, + }, + }, + withEndpointAuthz( + { all: ['canWriteExecuteOperations'] }, + logger, + responseActionRequestHandler<ResponseActionRunScriptParameters>( + endpointContext, + 'runscript' + ) + ) + ); } function responseActionRequestHandler<T extends EndpointActionDataParameterTypes>( @@ -412,6 +440,8 @@ async function handleActionCreation( return responseActionsClient.upload(body as UploadActionApiRequestBody); case 'scan': return responseActionsClient.scan(body as ScanActionRequestBody); + case 'runscript': + return responseActionsClient.runscript(body as RunScriptActionRequestBody); default: throw new CustomHttpRequestError( `No handler found for response action command: [${command}]`, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts index f4ad7f981ab9..0c505b12c129 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/crowdstrike/crowdstrike_actions_client.ts @@ -26,9 +26,12 @@ import type { EndpointActionDataParameterTypes, EndpointActionResponseDataOutput, LogsEndpointAction, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, } from '../../../../../../common/endpoint/types'; import type { IsolationRouteRequestBody, + RunScriptActionRequestBody, UnisolationRouteRequestBody, } from '../../../../../../common/api/endpoint'; import type { @@ -296,6 +299,19 @@ export class CrowdstrikeActionsClient extends ResponseActionsClientImpl { return this.fetchActionDetails(actionRequestDoc.EndpointActions.action_id); } + public async runscript( + actionRequest: RunScriptActionRequestBody, + options?: CommonResponseActionMethodOptions + ): Promise< + ActionDetails<ResponseActionRunScriptOutputContent, ResponseActionRunScriptParameters> + > { + // TODO: just a placeholder for now + return Promise.resolve({ output: 'runscript', code: 200 }) as never as ActionDetails< + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters + >; + } + private async completeCrowdstrikeAction( actionResponse: ActionTypeExecutorResult<CrowdstrikeBaseApiResponse> | undefined, doc: LogsEndpointAction diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts index a406397c2be1..3dde5e798c66 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/endpoint/endpoint_actions_client.test.ts @@ -347,7 +347,8 @@ describe('EndpointActionsClient', () => { type ResponseActionsMethodsOnly = keyof Omit< ResponseActionsClient, - 'processPendingActions' | 'getFileDownload' | 'getFileInfo' + // TODO: not yet implemented + 'processPendingActions' | 'getFileDownload' | 'getFileInfo' | 'runscript' >; // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -375,6 +376,9 @@ describe('EndpointActionsClient', () => { upload: responseActionsClientMock.createUploadOptions(getCommonResponseActionOptions()), scan: responseActionsClientMock.createScanOptions(getCommonResponseActionOptions()), + + // TODO: not yet implemented + // runscript: responseActionsClientMock.createRunScriptOptions(getCommonResponseActionOptions()), }; it.each(Object.keys(responseActionMethods) as ResponseActionsMethodsOnly[])( diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts index 7a8f14b6e9a8..3e4c21d403bf 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/base_response_actions_client.ts @@ -71,6 +71,8 @@ import type { SuspendProcessActionOutputContent, UploadedFileInfo, WithAllKeys, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, } from '../../../../../../common/endpoint/types'; import type { ExecuteActionRequestBody, @@ -79,6 +81,7 @@ import type { KillProcessRequestBody, ResponseActionGetFileRequestBody, ResponseActionsRequestBody, + RunScriptActionRequestBody, ScanActionRequestBody, SuspendProcessRequestBody, UnisolationRouteRequestBody, @@ -841,6 +844,15 @@ export abstract class ResponseActionsClientImpl implements ResponseActionsClient throw new ResponseActionsNotSupportedError('scan'); } + public async runscript( + actionRequest: RunScriptActionRequestBody, + options?: CommonResponseActionMethodOptions + ): Promise< + ActionDetails<ResponseActionRunScriptOutputContent, ResponseActionRunScriptParameters> + > { + throw new ResponseActionsNotSupportedError('runscript'); + } + public async processPendingActions(_: ProcessPendingActionsMethodOptions): Promise<void> { this.log.debug(`#processPendingActions() method is not implemented for ${this.agentType}!`); } diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts index e3407b5ba959..a703e3c16cdd 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/lib/types.ts @@ -23,6 +23,8 @@ import type { UploadedFileInfo, ResponseActionScanOutputContent, ResponseActionScanParameters, + ResponseActionRunScriptOutputContent, + ResponseActionRunScriptParameters, } from '../../../../../../common/endpoint/types'; import type { IsolationRouteRequestBody, @@ -35,6 +37,7 @@ import type { ScanActionRequestBody, KillProcessRequestBody, SuspendProcessRequestBody, + RunScriptActionRequestBody, } from '../../../../../../common/api/endpoint'; type OmitUnsupportedAttributes<T extends BaseActionRequestBody> = Omit< @@ -155,4 +158,16 @@ export interface ResponseActionsClient { actionRequest: OmitUnsupportedAttributes<ScanActionRequestBody>, options?: CommonResponseActionMethodOptions ) => Promise<ActionDetails<ResponseActionScanOutputContent, ResponseActionScanParameters>>; + + /** + * Run a script + * @param actionRequest + * @param options + */ + runscript: ( + actionRequest: OmitUnsupportedAttributes<RunScriptActionRequestBody>, + options?: CommonResponseActionMethodOptions + ) => Promise< + ActionDetails<ResponseActionRunScriptOutputContent, ResponseActionRunScriptParameters> + >; } diff --git a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts index 69901033eaaf..6360ceba71ce 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/actions/clients/mocks.ts @@ -49,6 +49,7 @@ import type { ResponseActionGetFileRequestBody, UploadActionApiRequestBody, ScanActionRequestBody, + RunScriptActionRequestBody, } from '../../../../../common/api/endpoint'; export interface ResponseActionsClientOptionsMock extends ResponseActionsClientOptions { @@ -70,6 +71,7 @@ const createResponseActionClientMock = (): jest.Mocked<ResponseActionsClient> => getFileInfo: jest.fn().mockReturnValue(Promise.resolve()), getFileDownload: jest.fn().mockReturnValue(Promise.resolve()), scan: jest.fn().mockReturnValue(Promise.resolve()), + runscript: jest.fn().mockReturnValue(Promise.resolve()), }; }; @@ -240,6 +242,18 @@ const createScanOptionsMock = ( return merge(options, overrides); }; +const createRunScriptOptionsMock = ( + overrides: Partial<RunScriptActionRequestBody> = {} +): RunScriptActionRequestBody => { + const options: RunScriptActionRequestBody = { + ...createNoParamsResponseActionOptionsMock(), + parameters: { + Raw: 'ls', + }, + }; + return merge(options, overrides); +}; + const createConnectorMock = ( overrides: DeepPartial<ConnectorWithExtraFindData> = {} ): ConnectorWithExtraFindData => { @@ -316,6 +330,7 @@ export const responseActionsClientMock = Object.freeze({ createExecuteOptions: createExecuteOptionsMock, createUploadOptions: createUploadOptionsMock, createScanOptions: createScanOptionsMock, + createRunScriptOptions: createRunScriptOptionsMock, createIndexedResponse: createEsIndexTransportResponseMock, diff --git a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts b/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts index d29e9b70606e..65db7d72cc48 100644 --- a/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts +++ b/x-pack/plugins/security_solution/server/endpoint/services/feature_usage/feature_keys.ts @@ -24,9 +24,9 @@ export const FEATURE_KEYS = { UPLOAD: 'Upload file', EXECUTE: 'Execute command', SCAN: 'Scan files', + RUN_SCRIPT: 'Run script', ALERTS_BY_PROCESS_ANCESTRY: 'Get related alerts by process ancestry', ENDPOINT_EXCEPTIONS: 'Endpoint exceptions', - RUN_SCRIPT: 'Run script', } as const; export type FeatureKeys = keyof typeof FEATURE_KEYS; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts index 45098f8dea23..04f15570434a 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/delete_migration.ts @@ -14,7 +14,6 @@ import type { SignalsMigrationSO } from './saved_objects_schema'; /** * Deletes a completed migration: * * deletes the migration SO - * * deletes the underlying task document * * applies deletion policy to the relevant index * * @param esClient An {@link ElasticsearchClient} @@ -40,7 +39,7 @@ export const deleteMigration = async ({ return migration; } - const { destinationIndex, sourceIndex, taskId } = migration.attributes; + const { destinationIndex, sourceIndex } = migration.attributes; if (isMigrationFailed(migration)) { await applyMigrationCleanupPolicy({ @@ -57,7 +56,6 @@ export const deleteMigration = async ({ }); } - await esClient.delete({ index: '.tasks', id: taskId }); await deleteMigrationSavedObject({ id: migration.id, soClient }); return migration; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts index 6c855a5b7774..51f81ad75e40 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.test.ts @@ -40,6 +40,7 @@ describe('finalizeMigration', () => { signalsAlias: 'my-signals-alias', soClient, username: 'username', + legacySiemSignalsAlias: '.siem-signals-default', }); expect(updateMigrationSavedObject).not.toHaveBeenCalled(); @@ -54,6 +55,7 @@ describe('finalizeMigration', () => { signalsAlias: 'my-signals-alias', soClient, username: 'username', + legacySiemSignalsAlias: '.siem-signals-default', }); expect(updateMigrationSavedObject).not.toHaveBeenCalled(); @@ -72,6 +74,7 @@ describe('finalizeMigration', () => { signalsAlias: 'my-signals-alias', soClient, username: 'username', + legacySiemSignalsAlias: '.siem-signals-default', }); expect(updateMigrationSavedObject).toHaveBeenCalledWith( diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts index e9ce2a4a641a..3aca53c1422d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/finalize_migration.ts @@ -35,12 +35,14 @@ export const finalizeMigration = async ({ signalsAlias, soClient, username, + legacySiemSignalsAlias, }: { esClient: ElasticsearchClient; migration: SignalsMigrationSO; signalsAlias: string; soClient: SavedObjectsClientContract; username: string; + legacySiemSignalsAlias: string; }): Promise<SignalsMigrationSO> => { if (!isMigrationPending(migration)) { return migration; @@ -86,6 +88,7 @@ export const finalizeMigration = async ({ esClient, newIndex: destinationIndex, oldIndex: sourceIndex, + legacySiemSignalsAlias, }); const updatedMigration = await updateMigrationSavedObject({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.test.ts new file mode 100644 index 000000000000..a2361c6b7aee --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.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 { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { getIndexAliasPerSpace } from './get_index_alias_per_space'; + +describe('getIndexAliasPerSpace', () => { + let esClient: ReturnType<typeof elasticsearchServiceMock.createElasticsearchClient>; + + beforeEach(() => { + esClient = elasticsearchServiceMock.createElasticsearchClient(); + }); + + it('returns object with index alias and space', async () => { + esClient.indices.getAlias.mockResponseOnce({ + '.siem-signals-default-old-one': { + aliases: { + '.siem-signals-default': { + is_write_index: false, + }, + }, + }, + '.siem-signals-another-1-legacy': { + aliases: { + '.siem-signals-another-1': { + is_write_index: false, + }, + }, + }, + }); + + const result = await getIndexAliasPerSpace({ + esClient, + signalsIndex: '.siem-signals', + signalsAliasAllSpaces: '.siem-signals-*', + }); + + expect(result).toEqual({ + '.siem-signals-another-1-legacy': { + alias: '.siem-signals-another-1', + indexName: '.siem-signals-another-1-legacy', + space: 'another-1', + }, + '.siem-signals-default-old-one': { + alias: '.siem-signals-default', + indexName: '.siem-signals-default-old-one', + space: 'default', + }, + }); + }); + + it('filters out .internal.alert indices', async () => { + esClient.indices.getAlias.mockResponseOnce({ + '.siem-signals-default-old-one': { + aliases: { + '.siem-signals-default': { + is_write_index: false, + }, + }, + }, + '.internal.alerts-security.alerts-another-2-000001': { + aliases: { + '.siem-signals-another-2': { + is_write_index: false, + }, + }, + }, + }); + + const result = await getIndexAliasPerSpace({ + esClient, + signalsIndex: '.siem-signals', + signalsAliasAllSpaces: '.siem-signals-*', + }); + + expect(result).toEqual({ + '.siem-signals-default-old-one': { + alias: '.siem-signals-default', + indexName: '.siem-signals-default-old-one', + space: 'default', + }, + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.ts new file mode 100644 index 000000000000..04895f0d74f3 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_index_alias_per_space.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 type { ElasticsearchClient } from '@kbn/core/server'; + +interface IndexAlias { + alias: string; + space: string; + indexName: string; +} + +/** + * Retrieves index, its alias and Kibana space + */ +export const getIndexAliasPerSpace = async ({ + esClient, + signalsIndex, + signalsAliasAllSpaces, +}: { + esClient: ElasticsearchClient; + signalsIndex: string; + signalsAliasAllSpaces: string; +}): Promise<Record<string, IndexAlias>> => { + const response = await esClient.indices.getAlias( + { + name: signalsAliasAllSpaces, + }, + { meta: true } + ); + + const indexAliasesMap = Object.keys(response.body).reduce<Record<string, IndexAlias>>( + (acc, indexName) => { + if (!indexName.startsWith('.internal.alerts-')) { + const alias = Object.keys(response.body[indexName].aliases)[0]; + + acc[indexName] = { + alias, + space: alias.replace(`${signalsIndex}-`, ''), + indexName, + }; + } + + return acc; + }, + {} + ); + + return indexAliasesMap; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts new file mode 100644 index 000000000000..ea48c51aabcc --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.test.ts @@ -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 { IndicesGetIndexTemplateResponse } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { getLatestIndexTemplateVersion } from './get_latest_index_template_version'; + +describe('getIndexAliasPerSpace', () => { + let esClient: ReturnType<typeof elasticsearchServiceMock.createElasticsearchClient>; + + beforeEach(() => { + esClient = elasticsearchServiceMock.createElasticsearchClient(); + }); + + it('returns latest index template version', async () => { + esClient.indices.getIndexTemplate.mockResponseOnce({ + index_templates: [ + { index_template: { version: 77 } }, + { index_template: { version: 10 } }, + { index_template: { version: 23 } }, + { index_template: { version: 0 } }, + ], + } as IndicesGetIndexTemplateResponse); + + const version = await getLatestIndexTemplateVersion({ + esClient, + name: '.siem-signals-*', + }); + + expect(version).toBe(77); + }); + + it('returns 0 if templates empty', async () => { + esClient.indices.getIndexTemplate.mockResponseOnce({ + index_templates: [], + }); + + const version = await getLatestIndexTemplateVersion({ + esClient, + name: '.siem-signals-*', + }); + + expect(version).toBe(0); + }); + + it('returns 0 if request fails', async () => { + esClient.indices.getIndexTemplate.mockRejectedValueOnce('Failure'); + + const version = await getLatestIndexTemplateVersion({ + esClient, + name: '.siem-signals-*', + }); + + expect(version).toBe(0); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts new file mode 100644 index 000000000000..b06a14adc2ce --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_latest_index_template_version.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { ElasticsearchClient } from '@kbn/core/server'; + +/** + * Retrieves the latest version of index template + * There are can be multiple index templates across different Kibana spaces, + * so we get them all and return the latest(greatest) number + */ +export const getLatestIndexTemplateVersion = async ({ + esClient, + name, +}: { + esClient: ElasticsearchClient; + name: string; +}): Promise<number> => { + let latestTemplateVersion: number; + try { + const response = await esClient.indices.getIndexTemplate({ name }); + const versions = response.index_templates.map( + (template) => template.index_template.version ?? 0 + ); + + latestTemplateVersion = versions.length ? Math.max(...versions) : 0; + } catch (e) { + latestTemplateVersion = 0; + } + + return latestTemplateVersion; +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts new file mode 100644 index 000000000000..36252ab79234 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.test.ts @@ -0,0 +1,177 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { elasticsearchServiceMock } from '@kbn/core/server/mocks'; +import { loggerMock } from '@kbn/logging-mocks'; + +import { getNonMigratedSignalsInfo } from './get_non_migrated_signals_info'; +import { getIndexVersionsByIndex } from './get_index_versions_by_index'; +import { getSignalVersionsByIndex } from './get_signal_versions_by_index'; +import { getLatestIndexTemplateVersion } from './get_latest_index_template_version'; +import { getIndexAliasPerSpace } from './get_index_alias_per_space'; + +jest.mock('./get_index_versions_by_index', () => ({ getIndexVersionsByIndex: jest.fn() })); +jest.mock('./get_signal_versions_by_index', () => ({ getSignalVersionsByIndex: jest.fn() })); +jest.mock('./get_latest_index_template_version', () => ({ + getLatestIndexTemplateVersion: jest.fn(), +})); +jest.mock('./get_index_alias_per_space', () => ({ getIndexAliasPerSpace: jest.fn() })); + +const getIndexVersionsByIndexMock = getIndexVersionsByIndex as jest.Mock; +const getSignalVersionsByIndexMock = getSignalVersionsByIndex as jest.Mock; +const getLatestIndexTemplateVersionMock = getLatestIndexTemplateVersion as jest.Mock; +const getIndexAliasPerSpaceMock = getIndexAliasPerSpace as jest.Mock; + +const TEMPLATE_VERSION = 77; + +describe('getNonMigratedSignalsInfo', () => { + let esClient: ReturnType<typeof elasticsearchServiceMock.createElasticsearchClient>; + const logger = loggerMock.create(); + + beforeEach(() => { + esClient = elasticsearchServiceMock.createElasticsearchClient(); + + getLatestIndexTemplateVersionMock.mockReturnValue(TEMPLATE_VERSION); + getIndexVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': 10, + '.siem-signals-default-old-one': 42, + }); + getSignalVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': [{ count: 2, version: 10 }], + }); + getIndexAliasPerSpaceMock.mockReturnValue({ + '.siem-signals-another-1-legacy': { + alias: '.siem-signals-another-1', + indexName: '.siem-signals-another-1-legacy', + space: 'another-1', + }, + '.siem-signals-default-old-one': { + alias: '.siem-signals-default', + indexName: '.siem-signals-default-old-one', + space: 'default', + }, + }); + }); + + it('returns empty results if no siem indices found', async () => { + getIndexAliasPerSpaceMock.mockReturnValue({}); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + isMigrationRequired: false, + spaces: [], + indices: [], + }); + }); + + it('returns empty when error happens', async () => { + getLatestIndexTemplateVersionMock.mockRejectedValueOnce(new Error('Test failure')); + const debugSpy = jest.spyOn(logger, 'debug'); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + isMigrationRequired: false, + spaces: [], + indices: [], + }); + expect(debugSpy).toHaveBeenCalledWith(expect.stringContaining('Test failure')); + }); + + it('returns empty results if no siem indices or signals outdated', async () => { + getIndexVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': TEMPLATE_VERSION, + '.siem-signals-default-old-one': TEMPLATE_VERSION, + }); + getSignalVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': [{ count: 2, version: TEMPLATE_VERSION }], + }); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + isMigrationRequired: false, + spaces: [], + indices: [], + }); + }); + it('returns results for outdated index', async () => { + getIndexVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': TEMPLATE_VERSION, + '.siem-signals-default-old-one': 16, + }); + getSignalVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': [{ count: 2, version: TEMPLATE_VERSION }], + }); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + indices: ['.siem-signals-default-old-one'], + isMigrationRequired: true, + spaces: ['default'], + }); + }); + it('returns results for outdated signals in index', async () => { + getIndexVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': TEMPLATE_VERSION, + '.siem-signals-default-old-one': TEMPLATE_VERSION, + }); + getSignalVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': [{ count: 2, version: 12 }], + }); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + indices: ['.siem-signals-another-1-legacy'], + isMigrationRequired: true, + spaces: ['another-1'], + }); + }); + it('returns indices in multiple spaces', async () => { + getIndexVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': 11, + '.siem-signals-default-old-one': 11, + }); + getSignalVersionsByIndexMock.mockReturnValue({ + '.siem-signals-another-1-legacy': [{ count: 2, version: 11 }], + }); + + const result = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex: 'siem-signals', + logger, + }); + + expect(result).toEqual({ + indices: ['.siem-signals-another-1-legacy', '.siem-signals-default-old-one'], + isMigrationRequired: true, + spaces: ['another-1', 'default'], + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts new file mode 100644 index 000000000000..d1f561fb3846 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/get_non_migrated_signals_info.ts @@ -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 type { ElasticsearchClient, Logger } from '@kbn/core/server'; + +import type { IndexVersionsByIndex } from './get_index_versions_by_index'; +import { getIndexVersionsByIndex } from './get_index_versions_by_index'; +import { + getSignalVersionsByIndex, + type SignalVersionsByIndex, +} from './get_signal_versions_by_index'; +import { isOutdated as getIsOutdated, signalsAreOutdated } from './helpers'; +import { getLatestIndexTemplateVersion } from './get_latest_index_template_version'; +import { getIndexAliasPerSpace } from './get_index_alias_per_space'; + +interface OutdatedSpaces { + isMigrationRequired: boolean; + spaces: string[]; + indices: string[]; +} + +/** + * gets lists of spaces and non-migrated signal indices + */ +export const getNonMigratedSignalsInfo = async ({ + esClient, + signalsIndex, + logger, +}: { + esClient: ElasticsearchClient; + signalsIndex: string; + logger: Logger; +}): Promise<OutdatedSpaces> => { + const signalsAliasAllSpaces = `${signalsIndex}-*`; + + try { + const latestTemplateVersion = await getLatestIndexTemplateVersion({ + esClient, + name: signalsAliasAllSpaces, + }); + const indexAliasesMap = await getIndexAliasPerSpace({ + esClient, + signalsAliasAllSpaces, + signalsIndex, + }); + + const indices = Object.keys(indexAliasesMap); + + if (indices.length === 0) { + return { + isMigrationRequired: false, + spaces: [], + indices: [], + }; + } + + let indexVersionsByIndex: IndexVersionsByIndex = {}; + try { + indexVersionsByIndex = await getIndexVersionsByIndex({ + esClient, + index: indices, + }); + } catch (e) { + logger.debug( + `Getting information about legacy siem signals index version failed:"${e?.message}"` + ); + } + + let signalVersionsByIndex: SignalVersionsByIndex = {}; + try { + signalVersionsByIndex = await getSignalVersionsByIndex({ + esClient, + index: indices, + }); + } catch (e) { + logger.debug(`Getting information about legacy siem signals versions failed:"${e?.message}"`); + } + + const outdatedIndices = indices.reduce<Array<{ indexName: string; space: string }>>( + (acc, indexName) => { + const version = indexVersionsByIndex[indexName] ?? 0; + const signalVersions = signalVersionsByIndex[indexName] ?? []; + + const isOutdated = + getIsOutdated({ current: version, target: latestTemplateVersion }) || + signalsAreOutdated({ signalVersions, target: latestTemplateVersion }); + + if (isOutdated) { + acc.push({ + indexName, + space: indexAliasesMap[indexName].space, + }); + } + + return acc; + }, + [] + ); + + const outdatedIndexNames = outdatedIndices.map((outdatedIndex) => outdatedIndex.indexName); + + // remove duplicated spaces + const spaces = [...new Set<string>(outdatedIndices.map((indexStatus) => indexStatus.space))]; + const isMigrationRequired = outdatedIndices.length > 0; + + logger.debug( + isMigrationRequired + ? `Legacy siem signals indices require migration: "${outdatedIndexNames.join( + ', ' + )}" in "${spaces.join(', ')}" spaces` + : 'No legacy siem indices require migration' + ); + + return { + isMigrationRequired, + spaces, + indices: outdatedIndexNames, + }; + } catch (e) { + logger.debug(`Getting information about legacy siem signals failed:"${e?.message}"`); + return { + isMigrationRequired: false, + spaces: [], + indices: [], + }; + } +}; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts index 5a4399bd6389..5530f0a80c5d 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/migration_service.ts @@ -22,6 +22,7 @@ export interface CreateParams { export interface FinalizeParams { signalsAlias: string; migration: SignalsMigrationSO; + legacySiemSignalsAlias: string; } export interface DeleteParams { @@ -59,13 +60,14 @@ export const signalsMigrationService = ({ username, }); }, - finalize: ({ migration, signalsAlias }) => + finalize: ({ migration, signalsAlias, legacySiemSignalsAlias }) => finalizeMigration({ esClient, migration, signalsAlias, soClient, username, + legacySiemSignalsAlias, }), delete: ({ migration, signalsAlias }) => deleteMigration({ diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts index ad77e64a55ac..984707959005 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/migrations/replace_signals_index_alias.ts @@ -26,11 +26,13 @@ export const replaceSignalsIndexAlias = async ({ esClient, newIndex, oldIndex, + legacySiemSignalsAlias, }: { alias: string; esClient: ElasticsearchClient; newIndex: string; oldIndex: string; + legacySiemSignalsAlias: string; }): Promise<void> => { await esClient.indices.updateAliases({ body: { @@ -40,12 +42,11 @@ export const replaceSignalsIndexAlias = async ({ ], }, }); - // TODO: space-aware? await esClient.indices.updateAliases({ body: { actions: [ - { remove: { index: oldIndex, alias: '.siem-signals-default' } }, - { add: { index: newIndex, alias: '.siem-signals-default', is_write_index: false } }, + { remove: { index: oldIndex, alias: legacySiemSignalsAlias } }, + { add: { index: newIndex, alias: legacySiemSignalsAlias, is_write_index: false } }, ], }, }); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts index 0ff0220056e7..4421a116def7 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/finalize_signals_migration_route.ts @@ -74,6 +74,7 @@ export const finalizeSignalsMigrationRoute = ( }); const spaceId = securitySolution.getSpaceId(); + const legacySiemSignalsAlias = appClient.getSignalsIndex(); const signalsAlias = ruleDataService.getResourceName(`security.alerts-${spaceId}`); const finalizeResults = await Promise.all( migrations.map(async (migration) => { @@ -81,6 +82,7 @@ export const finalizeSignalsMigrationRoute = ( const finalizedMigration = await migrationService.finalize({ migration, signalsAlias, + legacySiemSignalsAlias, }); if (isMigrationFailed(finalizedMigration)) { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts index 15f64c7f96c4..8bee9b1947c2 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/get_signals_migration_status_route.ts @@ -65,7 +65,11 @@ export const getSignalsMigrationStatusRoute = ( const signalsAlias = appClient.getSignalsIndex(); const currentVersion = await getTemplateVersion({ alias: signalsAlias, esClient }); - const indexAliases = await getIndexAliases({ alias: signalsAlias, esClient }); + const indexAliases = await getIndexAliases({ + alias: signalsAlias, + esClient, + index: `${signalsAlias}-*`, + }); const signalsIndices = indexAliases.map((indexAlias) => indexAlias.index); const indicesInRange = await getSignalsIndicesInRange({ esClient, diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts index dfc0603598a0..4b4653d19474 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals/set_alert_assignees_route.test.ts @@ -92,7 +92,7 @@ describe('setAlertAssigneesRoute', () => { const result = server.validate(request); expect(result.badRequest).toHaveBeenCalledWith( - 'ids.0: String must contain at least 1 character(s), ids.0: Invalid' + 'ids.0: String must contain at least 1 character(s), ids.0: No empty strings allowed' ); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts index 9ade355d54bf..3fc2f6d48923 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/audit.ts @@ -17,4 +17,5 @@ export enum RiskEngineAuditActions { RISK_ENGINE_DISABLE_LEGACY_ENGINE = 'risk_engine_disable_legacy_engine', RISK_ENGINE_REMOVE_TASK = 'risk_engine_remove_task', RISK_ENGINE_SCHEDULE_NOW = 'risk_engine_schedule_now', + RISK_ENGINE_CONFIGURE_SAVED_OBJECT = 'risk_engine_configure_saved_object', } diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts index 241523f62e12..09ef77d3df6a 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/risk_engine_data_client.ts @@ -82,10 +82,13 @@ export class RiskEngineDataClient { } try { - await initSavedObjects({ + const soResult = await initSavedObjects({ savedObjectsClient: this.options.soClient, namespace, }); + this.options.logger.info( + `Risk engine savedObject configuration: ${JSON.stringify(soResult, null, 2)}` + ); result.riskEngineConfigurationCreated = true; } catch (e) { result.errors.push(e.message); @@ -319,4 +322,25 @@ export class RiskEngineDataClient { return RiskEngineStatusEnum.ENABLED; } + + public async updateRiskEngineSavedObject(attributes: {}) { + try { + const configuration = await this.getConfiguration(); + if (!configuration) { + await initSavedObjects({ + savedObjectsClient: this.options.soClient, + namespace: this.options.namespace, + }); + } + return await updateSavedObjectAttribute({ + savedObjectsClient: this.options.soClient, + attributes, + }); + } catch (e) { + this.options.logger.error( + `Error updating risk score engine saved object attributes: ${e.message}` + ); + throw e; + } + } } diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.test.ts new file mode 100644 index 000000000000..c70af5c70c7a --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.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 { + serverMock, + requestContextMock, + requestMock, +} from '../../../detection_engine/routes/__mocks__'; +import { riskEnginePrivilegesMock } from './risk_engine_privileges.mock'; +import { riskEngineDataClientMock } from '../risk_engine_data_client.mock'; +import { taskManagerMock } from '@kbn/task-manager-plugin/server/mocks'; +import { RISK_ENGINE_CONFIGURE_SO_URL } from '../../../../../common/constants'; +import { riskEngineConfigureSavedObjectRoute } from './configure_saved_object'; + +describe('riskEnginConfigureSavedObjectRoute', () => { + let server: ReturnType<typeof serverMock.create>; + let context: ReturnType<typeof requestContextMock.convertContext>; + let mockTaskManagerStart: ReturnType<typeof taskManagerMock.createStart>; + let mockRiskEngineDataClient: ReturnType<typeof riskEngineDataClientMock.create>; + let getStartServicesMock: jest.Mock; + + beforeEach(() => { + jest.resetAllMocks(); + + server = serverMock.create(); + const { clients } = requestContextMock.createTools(); + mockRiskEngineDataClient = riskEngineDataClientMock.create(); + mockRiskEngineDataClient.updateRiskEngineSavedObject = jest.fn(); + context = requestContextMock.convertContext( + requestContextMock.create({ + ...clients, + riskEngineDataClient: mockRiskEngineDataClient, + }) + ); + mockTaskManagerStart = taskManagerMock.createStart(); + getStartServicesMock = jest.fn().mockResolvedValue([ + {}, + { + taskManager: mockTaskManagerStart, + security: riskEnginePrivilegesMock.createMockSecurityStartWithFullRiskEngineAccess(), + }, + ]); + riskEngineConfigureSavedObjectRoute(server.router, getStartServicesMock); + }); + + const buildRequest = (body: {}) => { + return requestMock.create({ + method: 'put', + path: RISK_ENGINE_CONFIGURE_SO_URL, + body, + }); + }; + + it('should call the router with the correct route and handler', async () => { + const request = buildRequest({}); + await server.inject(request, context); + expect(mockRiskEngineDataClient.updateRiskEngineSavedObject).toHaveBeenCalled(); + }); + + it('returns a 200 when the saved object is updated successfully', async () => { + const request = buildRequest({ + exclude_alert_statuses: ['open'], + range: { start: 'now-30d', end: 'now' }, + exclude_alert_tags: ['tag1'], + }); + const response = await server.inject(request, context); + expect(response.status).toEqual(200); + expect(response.body).toEqual({ risk_engine_saved_object_configured: true }); + expect(mockRiskEngineDataClient.updateRiskEngineSavedObject).toHaveBeenCalledWith({ + excludeAlertStatuses: ['open'], + range: { start: 'now-30d', end: 'now' }, + excludeAlertTags: ['tag1'], + }); + }); +}); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts new file mode 100644 index 000000000000..5a1e84763752 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/configure_saved_object.ts @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { buildSiemResponse } from '@kbn/lists-plugin/server/routes/utils'; +import { transformError } from '@kbn/securitysolution-es-utils'; +import type { IKibanaResponse } from '@kbn/core-http-server'; +import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; +import type { ConfigureRiskEngineSavedObjectResponse } from '../../../../../common/api/entity_analytics'; +import { ConfigureRiskEngineSavedObjectRequestBody } from '../../../../../common/api/entity_analytics'; +import { + RISK_ENGINE_CONFIGURE_SO_URL, + APP_ID, + API_VERSIONS, +} from '../../../../../common/constants'; +import { TASK_MANAGER_UNAVAILABLE_ERROR } from './translations'; +import { withRiskEnginePrivilegeCheck } from '../risk_engine_privileges'; +import type { EntityAnalyticsRoutesDeps } from '../../types'; +import { RiskEngineAuditActions } from '../audit'; +import { AUDIT_CATEGORY, AUDIT_OUTCOME, AUDIT_TYPE } from '../../audit'; + +export const riskEngineConfigureSavedObjectRoute = ( + router: EntityAnalyticsRoutesDeps['router'], + getStartServices: EntityAnalyticsRoutesDeps['getStartServices'] +) => { + router.versioned + .put({ + access: 'public', + path: RISK_ENGINE_CONFIGURE_SO_URL, + security: { + authz: { + requiredPrivileges: ['securitySolution', `${APP_ID}-entity-analytics`], + }, + }, + }) + .addVersion( + { + version: API_VERSIONS.public.v1, + validate: { + request: { body: buildRouteValidationWithZod(ConfigureRiskEngineSavedObjectRequestBody) }, + }, + }, + withRiskEnginePrivilegeCheck( + getStartServices, + async ( + context, + request, + response + ): Promise<IKibanaResponse<ConfigureRiskEngineSavedObjectResponse>> => { + const securitySolution = await context.securitySolution; + + securitySolution.getAuditLogger()?.log({ + message: 'User attempted to configure the saved object of the risk engine', + event: { + action: RiskEngineAuditActions.RISK_ENGINE_CONFIGURE_SAVED_OBJECT, + category: AUDIT_CATEGORY.DATABASE, + type: AUDIT_TYPE.CHANGE, + outcome: AUDIT_OUTCOME.UNKNOWN, + }, + }); + + const siemResponse = buildSiemResponse(response); + const [_, { taskManager }] = await getStartServices(); + const riskEngineClient = securitySolution.getRiskEngineDataClient(); + + if (!taskManager) { + securitySolution.getAuditLogger()?.log({ + message: + 'User attempted to configure the saved object of the risk engine, but the Kibana Task Manager was unavailable', + event: { + action: RiskEngineAuditActions.RISK_ENGINE_CONFIGURE_SAVED_OBJECT, + category: AUDIT_CATEGORY.DATABASE, + type: AUDIT_TYPE.CHANGE, + outcome: AUDIT_OUTCOME.FAILURE, + }, + error: { + message: + 'User attempted to configure the saved object of the risk engine, but the Kibana Task Manager was unavailable', + }, + }); + + return siemResponse.error({ + statusCode: 400, + body: TASK_MANAGER_UNAVAILABLE_ERROR, + }); + } + + try { + await riskEngineClient.updateRiskEngineSavedObject({ + excludeAlertStatuses: request.body.exclude_alert_statuses, + range: request.body.range, + excludeAlertTags: request.body.exclude_alert_tags, + }); + return response.ok({ body: { risk_engine_saved_object_configured: true } }); + } catch (e) { + const error = transformError(e); + + return siemResponse.error({ + statusCode: error.statusCode, + body: { message: error.message, full_error: JSON.stringify(e) }, + bypassErrorFormat: true, + }); + } + } + ) + ); +}; diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts index f4edb7d79818..a82ca38f7e1f 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/routes/register_risk_engine_routes.ts @@ -13,6 +13,7 @@ import { riskEngineSettingsRoute } from './settings'; import type { EntityAnalyticsRoutesDeps } from '../../types'; import { riskEngineScheduleNowRoute } from './schedule_now'; import { riskEngineCleanupRoute } from './delete'; +import { riskEngineConfigureSavedObjectRoute } from './configure_saved_object'; export const registerRiskEngineRoutes = ({ router, @@ -26,4 +27,5 @@ export const registerRiskEngineRoutes = ({ riskEngineSettingsRoute(router); riskEnginePrivilegesRoute(router, getStartServices); riskEngineCleanupRoute(router, getStartServices); + riskEngineConfigureSavedObjectRoute(router, getStartServices); }; diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts index 4282e0a793f4..a72835a92c1f 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_engine/utils/saved_object_configuration.ts @@ -42,7 +42,10 @@ export const updateSavedObjectAttribute = async ({ attributes, }: SavedObjectsClientArg & { attributes: { - enabled: boolean; + enabled?: boolean; + excludeAlertIds?: string[]; + range?: { start: string; end: string }; + excludeAlertTags?: string[]; }; }) => { const savedObjectConfiguration = await getConfigurationSavedObject({ diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts index ff1062393c93..3981781ca3fa 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/calculate_risk_scores.ts @@ -14,6 +14,7 @@ import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import { ALERT_RISK_SCORE, ALERT_WORKFLOW_STATUS, + ALERT_WORKFLOW_TAGS, } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; import type { AssetCriticalityRecord, @@ -219,6 +220,7 @@ export const calculateRiskScores = async ({ weights, alertSampleSizePerShard = 10_000, excludeAlertStatuses = [], + excludeAlertTags = [], }: { assetCriticalityService: AssetCriticalityService; esClient: ElasticsearchClient; @@ -236,6 +238,11 @@ export const calculateRiskScores = async ({ if (!isEmpty(userFilter)) { filter.push(userFilter as QueryDslQueryContainer); } + if (excludeAlertTags.length > 0) { + filter.push({ + bool: { must_not: { terms: { [ALERT_WORKFLOW_TAGS]: excludeAlertTags } } }, + }); + } const identifierTypes: IdentifierType[] = identifierType ? [identifierType] : ['host', 'user']; const request = { size: 0, diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts index b5ff9c3487a0..6aa2339b999d 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.test.ts @@ -250,5 +250,35 @@ describe('POST risk_engine/preview route', () => { expect(result.ok).toHaveBeenCalledWith(expect.objectContaining({ after_keys: {} })); }); }); + + describe('exclude_alert_statuses', () => { + it('respects the provided exclude_alert_statuses', async () => { + const request = buildRequest({ + exclude_alert_statuses: ['open'], + }); + + const response = await server.inject(request, requestContextMock.convertContext(context)); + + expect(response.status).toEqual(200); + expect(mockRiskScoreService.calculateScores).toHaveBeenCalledWith( + expect.objectContaining({ excludeAlertStatuses: ['open'] }) + ); + }); + }); + + describe('exclude_alert_tags', () => { + it('respects the provided exclude_alert_tags', async () => { + const request = buildRequest({ + exclude_alert_tags: ['tag1'], + }); + + const response = await server.inject(request, requestContextMock.convertContext(context)); + + expect(response.status).toEqual(200); + expect(mockRiskScoreService.calculateScores).toHaveBeenCalledWith( + expect.objectContaining({ excludeAlertTags: ['tag1'] }) + ); + }); + }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts index 5ab6791a300c..eb4cd433b74c 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/routes/preview.ts @@ -65,7 +65,8 @@ export const riskScorePreviewRoute = ( filter, range: userRange, weights, - excludeAlertStatuses, + exclude_alert_statuses: excludedStatuses, + exclude_alert_tags: excludedTags, } = request.body; const entityAnalyticsConfig = await riskScoreService.getConfigurationWithDefaults( @@ -84,6 +85,8 @@ export const riskScorePreviewRoute = ( const afterKeys = userAfterKeys ?? {}; const range = userRange ?? { start: 'now-15d', end: 'now' }; const pageSize = userPageSize ?? DEFAULT_RISK_SCORE_PAGE_SIZE; + const excludeAlertStatuses = excludedStatuses || ['closed']; + const excludeAlertTags = excludedTags || []; const result = await riskScoreService.calculateScores({ afterKeys, @@ -97,6 +100,7 @@ export const riskScorePreviewRoute = ( weights, alertSampleSizePerShard, excludeAlertStatuses, + excludeAlertTags, }); securityContext.getAuditLogger()?.log({ diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts index 4230b8fa05e2..06ec89061e7e 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/risk_score/tasks/risk_scoring_task.ts @@ -257,6 +257,7 @@ export const runTask = async ({ const configuration = await riskScoreService.getConfigurationWithDefaults( entityAnalyticsConfig ); + log(`Risk engine running with configuration : ${JSON.stringify(configuration, null, 2)}`); if (configuration == null) { log( 'Risk engine configuration not found; exiting task. Please reinitialize the risk engine and try again' diff --git a/x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts b/x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts index af683db51771..48ddc9b4a769 100644 --- a/x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts +++ b/x-pack/plugins/security_solution/server/lib/entity_analytics/types.ts @@ -86,6 +86,7 @@ export interface CalculateScoresParams { weights?: RiskScoreWeights; alertSampleSizePerShard?: number; excludeAlertStatuses?: string[]; + excludeAlertTags?: string[]; } export interface CalculateAndPersistScoresParams { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts index 19669fa75cd3..1e0a2fc5cb8c 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/create.ts @@ -8,6 +8,7 @@ import type { IKibanaResponse, Logger } from '@kbn/core/server'; import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; import { v4 as uuidV4 } from 'uuid'; +import { ResourceIdentifier } from '../../../../../common/siem_migrations/rules/resources'; import { SIEM_RULE_MIGRATION_CREATE_PATH } from '../../../../../common/siem_migrations/constants'; import { CreateRuleMigrationRequestBody, @@ -43,6 +44,11 @@ export const registerSiemRuleMigrationsCreateRoute = ( const originalRules = req.body; const migrationId = req.params.migration_id ?? uuidV4(); try { + const [firstOriginalRule] = originalRules; + if (!firstOriginalRule) { + return res.noContent(); + } + const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); @@ -53,6 +59,16 @@ export const registerSiemRuleMigrationsCreateRoute = ( await ruleMigrationsClient.data.rules.create(ruleMigrations); + // Create identified resource documents without content to keep track of them + const resourceIdentifier = new ResourceIdentifier(firstOriginalRule.vendor); + const resources = resourceIdentifier + .fromOriginalRules(originalRules) + .map((resource) => ({ ...resource, migration_id: migrationId })); + + if (resources.length > 0) { + await ruleMigrationsClient.data.resources.create(resources); + } + return res.ok({ body: { migration_id: migrationId } }); } catch (err) { logger.error(err); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts index 30037aeea88a..2450bd02edad 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/get.ts @@ -45,13 +45,14 @@ export const registerSiemRuleMigrationsGetRoute = ( sort_field: sortField, sort_direction: sortDirection, search_term: searchTerm, + ids, } = req.query; try { const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); const options: RuleMigrationGetOptions = { - filters: { searchTerm }, + filters: { searchTerm, ids }, sort: { sortField, sortDirection }, size: perPage, from: page && perPage ? page * perPage : 0, diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts index a327d4b28a9b..241e59ac02a2 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts @@ -20,6 +20,7 @@ import { registerSiemRuleMigrationsResourceGetRoute } from './resources/get'; import { registerSiemRuleMigrationsRetryRoute } from './retry'; import { registerSiemRuleMigrationsInstallRoute } from './install'; import { registerSiemRuleMigrationsInstallTranslatedRoute } from './install_translated'; +import { registerSiemRuleMigrationsResourceGetMissingRoute } from './resources/missing'; import { registerSiemRuleMigrationsPrebuiltRulesRoute } from './get_prebuilt_rules'; export const registerSiemRuleMigrationsRoutes = ( @@ -41,4 +42,5 @@ export const registerSiemRuleMigrationsRoutes = ( registerSiemRuleMigrationsResourceUpsertRoute(router, logger); registerSiemRuleMigrationsResourceGetRoute(router, logger); + registerSiemRuleMigrationsResourceGetMissingRoute(router, logger); }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts index 7f2cfc8743f0..8d1e1d353e32 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/get.ts @@ -39,16 +39,13 @@ export const registerSiemRuleMigrationsResourceGetRoute = ( withLicense( async (context, req, res): Promise<IKibanaResponse<GetRuleMigrationResourcesResponse>> => { const migrationId = req.params.migration_id; - const { type, names } = req.query; + const { type, names, from, size } = req.query; try { const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); - const resources = await ruleMigrationsClient.data.resources.get( - migrationId, - type, - names - ); + const options = { filters: { type, names }, from, size }; + const resources = await ruleMigrationsClient.data.resources.get(migrationId, options); return res.ok({ body: resources }); } catch (err) { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts new file mode 100644 index 000000000000..0c9ad11f4cce --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/missing.ts @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { IKibanaResponse, Logger } from '@kbn/core/server'; +import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; +import type { RuleMigrationResourceData } from '../../../../../../common/siem_migrations/model/rule_migration.gen'; +import { + GetRuleMigrationResourcesMissingRequestParams, + type GetRuleMigrationResourcesMissingResponse, +} from '../../../../../../common/siem_migrations/model/api/rules/rule_migration.gen'; +import { SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH } from '../../../../../../common/siem_migrations/constants'; +import type { SecuritySolutionPluginRouter } from '../../../../../types'; +import { withLicense } from '../util/with_license'; + +export const registerSiemRuleMigrationsResourceGetMissingRoute = ( + router: SecuritySolutionPluginRouter, + logger: Logger +) => { + router.versioned + .get({ + path: SIEM_RULE_MIGRATION_RESOURCES_MISSING_PATH, + access: 'internal', + security: { authz: { requiredPrivileges: ['securitySolution'] } }, + }) + .addVersion( + { + version: '1', + validate: { + request: { + params: buildRouteValidationWithZod(GetRuleMigrationResourcesMissingRequestParams), + }, + }, + }, + withLicense( + async ( + context, + req, + res + ): Promise<IKibanaResponse<GetRuleMigrationResourcesMissingResponse>> => { + const migrationId = req.params.migration_id; + try { + const ctx = await context.resolve(['securitySolution']); + const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); + + const options = { filters: { hasContent: false } }; + const batches = ruleMigrationsClient.data.resources.searchBatches(migrationId, options); + + const missingResources: RuleMigrationResourceData[] = []; + let results = await batches.next(); + while (results.length) { + missingResources.push(...results.map(({ type, name }) => ({ type, name }))); + results = await batches.next(); + } + + return res.ok({ body: missingResources }); + } catch (err) { + logger.error(err); + return res.badRequest({ body: err.message }); + } + } + ) + ); +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts index 645fa09b49dc..9557c5cfd652 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/resources/upsert.ts @@ -7,6 +7,7 @@ import type { IKibanaResponse, Logger } from '@kbn/core/server'; import { buildRouteValidationWithZod } from '@kbn/zod-helpers'; +import { ResourceIdentifier } from '../../../../../../common/siem_migrations/rules/resources'; import { UpsertRuleMigrationResourcesRequestBody, UpsertRuleMigrationResourcesRequestParams, @@ -49,13 +50,30 @@ export const registerSiemRuleMigrationsResourceUpsertRoute = ( const ctx = await context.resolve(['securitySolution']); const ruleMigrationsClient = ctx.securitySolution.getSiemRuleMigrationsClient(); + // Check if the migration exists + const { data } = await ruleMigrationsClient.data.rules.get(migrationId, { size: 1 }); + const [rule] = data; + if (!rule) { + return res.notFound({ body: { message: 'Migration not found' } }); + } + + // Upsert identified resource documents with content const ruleMigrations = resources.map<CreateRuleMigrationResourceInput>((resource) => ({ - migration_id: migrationId, ...resource, + migration_id: migrationId, })); - await ruleMigrationsClient.data.resources.upsert(ruleMigrations); + // Create identified resource documents without content to keep track of them + const resourceIdentifier = new ResourceIdentifier(rule.original_rule.vendor); + const resourcesToCreate = resourceIdentifier + .fromResources(resources) + .map<CreateRuleMigrationResourceInput>((resource) => ({ + ...resource, + migration_id: migrationId, + })); + await ruleMigrationsClient.data.resources.create(resourcesToCreate); + return res.ok({ body: { acknowledged: true } }); } catch (err) { logger.error(err); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts index 8716c83ce6ba..de95d818dd18 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/util/installation.ts @@ -7,13 +7,13 @@ import type { Logger, SavedObjectsClientContract } from '@kbn/core/server'; import type { RulesClient } from '@kbn/alerting-plugin/server'; +import type { UpdateRuleMigrationData } from '../../../../../../common/siem_migrations/model/rule_migration.gen'; import { initPromisePool } from '../../../../../utils/promise_pool'; import type { SecuritySolutionApiRequestHandlerContext } from '../../../../..'; import { performTimelinesInstallation } from '../../../../detection_engine/prebuilt_rules/logic/perform_timelines_installation'; import { createPrebuiltRules } from '../../../../detection_engine/prebuilt_rules/logic/rule_objects/create_prebuilt_rules'; import type { IDetectionRulesClient } from '../../../../detection_engine/rule_management/logic/detection_rules_client/detection_rules_client_interface'; import type { RuleResponse } from '../../../../../../common/api/detection_engine'; -import type { UpdateRuleMigrationInput } from '../../data/rule_migrations_data_rules_client'; import type { StoredRuleMigration } from '../../types'; import { getPrebuiltRules, getUniquePrebuiltRuleIds } from './prebuilt_rules'; import { @@ -32,7 +32,7 @@ const installPrebuiltRules = async ( rulesClient: RulesClient, savedObjectsClient: SavedObjectsClientContract, detectionRulesClient: IDetectionRulesClient -): Promise<UpdateRuleMigrationInput[]> => { +): Promise<UpdateRuleMigrationData[]> => { // Get required prebuilt rules const prebuiltRulesIds = getUniquePrebuiltRuleIds(rulesToInstall); const prebuiltRules = await getPrebuiltRules(rulesClient, savedObjectsClient, prebuiltRulesIds); @@ -66,7 +66,7 @@ const installPrebuiltRules = async ( ]; // Create migration rules updates templates - const rulesToUpdate: UpdateRuleMigrationInput[] = []; + const rulesToUpdate: UpdateRuleMigrationData[] = []; installedRules.forEach((installedRule) => { const filteredRules = rulesToInstall.filter( (rule) => rule.elastic_rule?.prebuilt_rule_id === installedRule.rule_id @@ -89,8 +89,8 @@ export const installCustomRules = async ( enabled: boolean, detectionRulesClient: IDetectionRulesClient, logger: Logger -): Promise<UpdateRuleMigrationInput[]> => { - const rulesToUpdate: UpdateRuleMigrationInput[] = []; +): Promise<UpdateRuleMigrationData[]> => { + const rulesToUpdate: UpdateRuleMigrationData[] = []; const createCustomRulesOutcome = await initPromisePool({ concurrency: MAX_CUSTOM_RULES_TO_CREATE_IN_PARALLEL, items: rulesToInstall, @@ -211,10 +211,7 @@ export const installTranslated = async ({ logger ); - const rulesToUpdate: UpdateRuleMigrationInput[] = [ - ...updatedPrebuiltRules, - ...updatedCustomRules, - ]; + const rulesToUpdate: UpdateRuleMigrationData[] = [...updatedPrebuiltRules, ...updatedCustomRules]; if (rulesToUpdate.length) { await ruleMigrationsClient.data.rules.update(rulesToUpdate); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts index d8dc1bb168a7..77ed5e87084e 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/__mocks__/mocks.ts @@ -11,6 +11,10 @@ import type { RuleMigrationsDataRulesClient } from '../rule_migrations_data_rule export const mockRuleMigrationsDataRulesClient = { create: jest.fn().mockResolvedValue(undefined), get: jest.fn().mockResolvedValue([]), + searchBatches: jest.fn().mockReturnValue({ + next: jest.fn().mockResolvedValue([]), + all: jest.fn().mockResolvedValue([]), + }), takePending: jest.fn().mockResolvedValue([]), saveCompleted: jest.fn().mockResolvedValue(undefined), saveError: jest.fn().mockResolvedValue(undefined), @@ -27,6 +31,10 @@ export const MockRuleMigrationsDataRulesClient = jest export const mockRuleMigrationsDataResourcesClient = { upsert: jest.fn().mockResolvedValue(undefined), get: jest.fn().mockResolvedValue(undefined), + searchBatches: jest.fn().mockReturnValue({ + next: jest.fn().mockResolvedValue([]), + all: jest.fn().mockResolvedValue([]), + }), }; export const MockRuleMigrationsDataResourcesClient = jest .fn() diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts index 14825326eee0..31931fce0b1d 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_base_client.ts @@ -5,12 +5,19 @@ * 2.0. */ -import type { SearchHit, SearchResponse } from '@elastic/elasticsearch/lib/api/types'; +import type { + SearchHit, + SearchRequest, + SearchResponse, + Duration, +} from '@elastic/elasticsearch/lib/api/types'; import type { ElasticsearchClient, Logger } from '@kbn/core/server'; import assert from 'assert'; import type { Stored } from '../types'; import type { IndexNameProvider } from './rule_migrations_data_client'; +const DEFAULT_PIT_KEEP_ALIVE: Duration = '30s' as const; + export class RuleMigrationsDataBaseClient { constructor( protected getIndexName: IndexNameProvider, @@ -42,4 +49,48 @@ export class RuleMigrationsDataBaseClient { ? response.hits.total : response.hits.total?.value ?? 0; } + + /** Returns functions to iterate over all the search results in batches */ + protected getSearchBatches<T extends object>( + search: SearchRequest, + keepAlive: Duration = DEFAULT_PIT_KEEP_ALIVE + ) { + const pitPromise = this.getIndexName().then((index) => + this.esClient + .openPointInTime({ index, keep_alive: keepAlive }) + .then(({ id }) => ({ id, keep_alive: keepAlive })) + ); + + let currentBatchSearch: Promise<SearchResponse<T>> | undefined; + /* Returns the next batch of search results */ + const next = async (): Promise<Array<Stored<T>>> => { + const pit = await pitPromise; + if (!currentBatchSearch) { + currentBatchSearch = this.esClient.search<T>({ ...search, pit }); + } else { + currentBatchSearch = currentBatchSearch.then((previousResponse) => { + if (previousResponse.hits.hits.length === 0) { + return previousResponse; + } + const lastSort = previousResponse.hits.hits[previousResponse.hits.hits.length - 1].sort; + return this.esClient.search<T>({ ...search, pit, search_after: lastSort }); + }); + } + const response = await currentBatchSearch; + return this.processResponseHits(response); + }; + + /** Returns all the search results */ + const all = async (): Promise<Array<Stored<T>>> => { + const allResults: Array<Stored<T>> = []; + let results = await next(); + while (results.length) { + allResults.push(...results); + results = await next(); + } + return allResults; + }; + + return { next, all }; + } } diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts index 888a41aca944..97e51e9bafdb 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_resources_client.ts @@ -6,7 +6,7 @@ */ import { sha256 } from 'js-sha256'; -import type { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types'; +import type { QueryDslQueryContainer, Duration } from '@elastic/elasticsearch/lib/api/types'; import type { RuleMigrationResource, RuleMigrationResourceType, @@ -14,12 +14,30 @@ import type { import type { StoredRuleMigrationResource } from '../types'; import { RuleMigrationsDataBaseClient } from './rule_migrations_data_base_client'; -export type CreateRuleMigrationResourceInput = Omit<RuleMigrationResource, 'id'>; +export type CreateRuleMigrationResourceInput = Pick< + RuleMigrationResource, + 'migration_id' | 'type' | 'name' | 'metadata' +> & { + content?: string; +}; +export interface RuleMigrationResourceFilters { + type?: RuleMigrationResourceType; + names?: string[]; + hasContent?: boolean; +} +export interface RuleMigrationResourceGetOptions { + filters?: RuleMigrationResourceFilters; + size?: number; + from?: number; +} /* BULK_MAX_SIZE defines the number to break down the bulk operations by. * The 500 number was chosen as a reasonable number to avoid large payloads. It can be adjusted if needed. */ const BULK_MAX_SIZE = 500 as const; +/* DEFAULT_SEARCH_BATCH_SIZE defines the default number of documents to retrieve per search operation + * when retrieving search results in batches. */ +const DEFAULT_SEARCH_BATCH_SIZE = 500 as const; export class RuleMigrationsDataResourcesClient extends RuleMigrationsDataBaseClient { public async upsert(resources: CreateRuleMigrationResourceInput[]): Promise<void> { @@ -52,24 +70,43 @@ export class RuleMigrationsDataResourcesClient extends RuleMigrationsDataBaseCli } } + /** Creates the resources in the index only if they do not exist */ + public async create(resources: CreateRuleMigrationResourceInput[]): Promise<void> { + const index = await this.getIndexName(); + + let resourcesSlice: CreateRuleMigrationResourceInput[]; + const createdAt = new Date().toISOString(); + while ((resourcesSlice = resources.splice(0, BULK_MAX_SIZE)).length > 0) { + await this.esClient + .bulk({ + refresh: 'wait_for', + operations: resourcesSlice.flatMap((resource) => [ + { create: { _id: this.createId(resource), _index: index } }, + { + ...resource, + '@timestamp': createdAt, + updated_by: this.username, + updated_at: createdAt, + }, + ]), + }) + .catch((error) => { + this.logger.error(`Error upsert resources: ${error.message}`); + throw error; + }); + } + } + public async get( migrationId: string, - type?: RuleMigrationResourceType, - names?: string[] + options: RuleMigrationResourceGetOptions = {} ): Promise<StoredRuleMigrationResource[]> { + const { filters, size, from } = options; const index = await this.getIndexName(); - - const filter: QueryDslQueryContainer[] = [{ term: { migration_id: migrationId } }]; - if (type) { - filter.push({ term: { type } }); - } - if (names) { - filter.push({ terms: { name: names } }); - } - const query = { bool: { filter } }; + const query = this.getFilterQuery(migrationId, filters); return this.esClient - .search<RuleMigrationResource>({ index, query }) + .search<RuleMigrationResource>({ index, query, size, from }) .then(this.processResponseHits.bind(this)) .catch((error) => { this.logger.error(`Error searching resources: ${error.message}`); @@ -77,8 +114,46 @@ export class RuleMigrationsDataResourcesClient extends RuleMigrationsDataBaseCli }); } + /** Returns batching functions to traverse all the migration resources search results */ + searchBatches<T extends RuleMigrationResource = RuleMigrationResource>( + migrationId: string, + options: { scroll?: Duration; size?: number; filters?: RuleMigrationResourceFilters } = {} + ) { + const { size = DEFAULT_SEARCH_BATCH_SIZE, filters = {}, scroll } = options; + const query = this.getFilterQuery(migrationId, filters); + const search = { query, sort: '_doc', scroll, size }; // sort by _doc to ensure consistent order + try { + return this.getSearchBatches<T>(search); + } catch (error) { + this.logger.error(`Error scrolling rule migration resources: ${error.message}`); + throw error; + } + } + private createId(resource: CreateRuleMigrationResourceInput): string { const key = `${resource.migration_id}-${resource.type}-${resource.name}`; return sha256.create().update(key).hex(); } + + private getFilterQuery( + migrationId: string, + filters: RuleMigrationResourceFilters = {} + ): QueryDslQueryContainer { + const filter: QueryDslQueryContainer[] = [{ term: { migration_id: migrationId } }]; + if (filters.type) { + filter.push({ term: { type: filters.type } }); + } + if (filters.names) { + filter.push({ terms: { name: filters.names } }); + } + if (filters.hasContent != null) { + const existContent = { exists: { field: 'content' } }; + if (filters.hasContent) { + filter.push(existContent); + } else { + filter.push({ bool: { must_not: existContent } }); + } + } + return { bool: { filter } }; + } } diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts index 1eeb3ced0572..b483b3bdd4fb 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts @@ -13,27 +13,25 @@ import type { AggregationsStringTermsAggregate, AggregationsStringTermsBucket, QueryDslQueryContainer, + Duration, } from '@elastic/elasticsearch/lib/api/types'; import type { StoredRuleMigration } from '../types'; import { SiemMigrationStatus } from '../../../../../common/siem_migrations/constants'; -import type { - ElasticRule, - RuleMigration, - RuleMigrationTaskStats, - RuleMigrationTranslationStats, +import { + type RuleMigration, + type RuleMigrationTaskStats, + type RuleMigrationTranslationStats, + type UpdateRuleMigrationData, } from '../../../../../common/siem_migrations/model/rule_migration.gen'; import { RuleMigrationsDataBaseClient } from './rule_migrations_data_base_client'; import { getSortingOptions, type RuleMigrationSort } from './sort'; import { conditions as searchConditions } from './search'; +import { convertEsqlQueryToTranslationResult } from './utils'; export type CreateRuleMigrationInput = Omit< RuleMigration, '@timestamp' | 'id' | 'status' | 'created_by' >; -export type UpdateRuleMigrationInput = { elastic_rule?: Partial<ElasticRule> } & Pick< - RuleMigration, - 'id' | 'translation_result' | 'comments' ->; export type RuleMigrationDataStats = Omit<RuleMigrationTaskStats, 'status'>; export type RuleMigrationAllDataStats = RuleMigrationDataStats[]; @@ -52,9 +50,11 @@ export interface RuleMigrationGetOptions { } /* BULK_MAX_SIZE defines the number to break down the bulk operations by. - * The 500 number was chosen as a reasonable number to avoid large payloads. It can be adjusted if needed. - */ + * The 500 number was chosen as a reasonable number to avoid large payloads. It can be adjusted if needed. */ const BULK_MAX_SIZE = 500 as const; +/* DEFAULT_SEARCH_BATCH_SIZE defines the default number of documents to retrieve per search operation + * when retrieving search results in batches. */ +const DEFAULT_SEARCH_BATCH_SIZE = 500 as const; export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient { /** Indexes an array of rule migrations to be processed */ @@ -87,22 +87,30 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient } /** Updates an array of rule migrations to be processed */ - async update(ruleMigrations: UpdateRuleMigrationInput[]): Promise<void> { + async update(ruleMigrations: UpdateRuleMigrationData[]): Promise<void> { const index = await this.getIndexName(); - let ruleMigrationsSlice: UpdateRuleMigrationInput[]; + let ruleMigrationsSlice: UpdateRuleMigrationData[]; const updatedAt = new Date().toISOString(); while ((ruleMigrationsSlice = ruleMigrations.splice(0, BULK_MAX_SIZE)).length) { await this.esClient .bulk({ refresh: 'wait_for', operations: ruleMigrationsSlice.flatMap((ruleMigration) => { - const { id, ...rest } = ruleMigration; + const { + id, + translation_result: translationResult, + elastic_rule: elasticRule, + ...rest + } = ruleMigration; return [ { update: { _index: index, _id: id } }, { doc: { ...rest, + elastic_rule: elasticRule, + translation_result: + translationResult ?? convertEsqlQueryToTranslationResult(elasticRule?.query), updated_by: this.username, updated_at: updatedAt, }, @@ -123,7 +131,7 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient { filters = {}, sort = {}, from, size }: RuleMigrationGetOptions = {} ): Promise<{ total: number; data: StoredRuleMigration[] }> { const index = await this.getIndexName(); - const query = this.getFilterQuery(migrationId, { ...filters }); + const query = this.getFilterQuery(migrationId, filters); const result = await this.esClient .search<RuleMigration>({ @@ -143,6 +151,22 @@ export class RuleMigrationsDataRulesClient extends RuleMigrationsDataBaseClient }; } + /** Returns batching functions to traverse all the migration rules search results */ + searchBatches( + migrationId: string, + options: { scroll?: Duration; size?: number; filters?: RuleMigrationFilters } = {} + ) { + const { size = DEFAULT_SEARCH_BATCH_SIZE, filters = {}, scroll } = options; + const query = this.getFilterQuery(migrationId, filters); + const search = { query, sort: '_doc', scroll, size }; // sort by _doc to ensure consistent order + try { + return this.getSearchBatches<RuleMigration>(search); + } catch (error) { + this.logger.error(`Error scrolling rule migrations: ${error.message}`); + throw error; + } + } + /** * Retrieves `pending` rule migrations with the provided id and updates their status to `processing`. * This operation is not atomic at migration level: diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts index 952663c36123..c03b7ef52e78 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/rule_migrations_field_maps.ts @@ -27,7 +27,7 @@ export const ruleMigrationsFieldMap: FieldMap<SchemaFieldMapKeys<Omit<RuleMigrat 'original_rule.annotations.mitre_attack': { type: 'keyword', array: true, required: false }, elastic_rule: { type: 'nested', required: false }, 'elastic_rule.title': { type: 'text', required: true, fields: { keyword: { type: 'keyword' } } }, - 'elastic_rule.integration_ids': { type: 'keyword', array: true, required: false }, + 'elastic_rule.integration_id': { type: 'keyword', required: false }, 'elastic_rule.query': { type: 'text', required: true }, 'elastic_rule.query_language': { type: 'keyword', required: true }, 'elastic_rule.description': { type: 'text', required: false }, diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts new file mode 100644 index 000000000000..ca547da00e8c --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/data/utils.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { parseEsqlQuery } from '@kbn/securitysolution-utils'; +import { + RuleMigrationTranslationResultEnum, + type RuleMigrationTranslationResult, +} from '../../../../../common/siem_migrations/model/rule_migration.gen'; + +export const isValidEsqlQuery = (esqlQuery: string) => { + const { isEsqlQueryAggregating, hasMetadataOperator, errors } = parseEsqlQuery(esqlQuery); + + // Check if there are any syntax errors + if (errors.length) { + return false; + } + + // non-aggregating query which does not have metadata, is not a valid one + if (!isEsqlQueryAggregating && !hasMetadataOperator) { + return false; + } + + return true; +}; + +export const convertEsqlQueryToTranslationResult = ( + esqlQuery?: string +): RuleMigrationTranslationResult | undefined => { + if (esqlQuery === undefined) { + return undefined; + } + if (esqlQuery === '') { + return RuleMigrationTranslationResultEnum.untranslatable; + } + return isValidEsqlQuery(esqlQuery) + ? RuleMigrationTranslationResultEnum.full + : RuleMigrationTranslationResultEnum.partial; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts index 20b7cc6f1361..942adcfcc89e 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/graph.ts @@ -6,6 +6,7 @@ */ import { END, START, StateGraph } from '@langchain/langgraph'; +import { SiemMigrationRuleTranslationResult } from '../../../../../../common/siem_migrations/constants'; import { getCreateSemanticQueryNode } from './nodes/create_semantic_query'; import { getMatchPrebuiltRuleNode } from './nodes/match_prebuilt_rule'; import { getProcessQueryNode } from './nodes/process_query'; @@ -23,9 +24,11 @@ export function getRuleMigrationAgent({ }: MigrateRuleGraphParams) { const matchPrebuiltRuleNode = getMatchPrebuiltRuleNode({ model, + logger, ruleMigrationsRetriever, }); const translationSubGraph = getTranslateRuleGraph({ + model, inferenceClient, ruleMigrationsRetriever, connectorId, @@ -41,13 +44,10 @@ export function getRuleMigrationAgent({ .addNode('matchPrebuiltRule', matchPrebuiltRuleNode) .addNode('translationSubGraph', translationSubGraph) // Edges - .addEdge(START, 'processQuery') - .addEdge('processQuery', 'createSemanticQuery') + .addEdge(START, 'createSemanticQuery') .addEdge('createSemanticQuery', 'matchPrebuiltRule') - .addConditionalEdges('matchPrebuiltRule', matchedPrebuiltRuleConditional, [ - 'translationSubGraph', - END, - ]) + .addConditionalEdges('matchPrebuiltRule', matchedPrebuiltRuleConditional, ['processQuery', END]) + .addEdge('processQuery', 'translationSubGraph') .addEdge('translationSubGraph', END); const graph = siemMigrationAgentGraph.compile(); @@ -55,9 +55,15 @@ export function getRuleMigrationAgent({ return graph; } +/* + * If the original splunk rule has no prebuilt rule match, we will start processing the query, unless it is related to input/outputlookups. + */ const matchedPrebuiltRuleConditional = (state: MigrateRuleState) => { if (state.elastic_rule?.prebuilt_rule_id) { return END; } - return 'translationSubGraph'; + if (state.translation_result === SiemMigrationRuleTranslationResult.UNTRANSLATABLE) { + return END; + } + return 'processQuery'; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts index 54be39eb193f..6f1e39f93869 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/create_semantic_query/prompts.ts @@ -29,6 +29,7 @@ Go through the relevant title, description and data sources from the above query - Include keywords that are relevant to the use case. - Add related keywords you detected from the above query, like one or more vendor, product, cloud provider, OS platform etc. - Always reply with a JSON object with the key "semantic_query" and the value as the semantic search query inside three backticks as shown in the below example. +- If the related query focuses on Endpoint datamodel, make sure that "endpoint", "security" keywords are included. </guidelines> <example_response> diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts index ea403c5c4ffa..e4b2162249ca 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts @@ -5,6 +5,7 @@ * 2.0. */ +import type { Logger } from '@kbn/core/server'; import { JsonOutputParser } from '@langchain/core/output_parsers'; import { SiemMigrationRuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; import type { RuleMigrationsRetriever } from '../../../retrievers'; @@ -14,6 +15,7 @@ import { MATCH_PREBUILT_RULE_PROMPT } from './prompts'; interface GetMatchPrebuiltRuleNodeParams { model: ChatModel; + logger: Logger; ruleMigrationsRetriever: RuleMigrationsRetriever; } @@ -21,9 +23,12 @@ interface GetMatchedRuleResponse { match: string; } -export const getMatchPrebuiltRuleNode = - ({ model, ruleMigrationsRetriever }: GetMatchPrebuiltRuleNodeParams): GraphNode => - async (state) => { +export const getMatchPrebuiltRuleNode = ({ + model, + ruleMigrationsRetriever, + logger, +}: GetMatchPrebuiltRuleNodeParams): GraphNode => { + return async (state) => { const query = state.semantic_query; const techniqueIds = state.original_rule.annotations?.mitre_attack || []; const prebuiltRules = await ruleMigrationsRetriever.prebuiltRules.getRules( @@ -32,7 +37,7 @@ export const getMatchPrebuiltRuleNode = ); const outputParser = new JsonOutputParser(); - const matchPrebuiltRule = MATCH_PREBUILT_RULE_PROMPT.pipe(model).pipe(outputParser); + const mostRelevantRule = MATCH_PREBUILT_RULE_PROMPT.pipe(model).pipe(outputParser); const elasticSecurityRules = prebuiltRules.map((rule) => { return { @@ -41,9 +46,17 @@ export const getMatchPrebuiltRuleNode = }; }); - const response = (await matchPrebuiltRule.invoke({ + const splunkRule = { + title: state.original_rule.title, + description: state.original_rule.description, + }; + + /* + * Takes the most relevant rule from the array of rule(s) returned by the semantic query, returns either the most relevant or none. + */ + const response = (await mostRelevantRule.invoke({ rules: JSON.stringify(elasticSecurityRules, null, 2), - ruleTitle: state.original_rule.title, + splunk_rule: JSON.stringify(splunkRule, null, 2), })) as GetMatchedRuleResponse; if (response.match) { const matchedRule = prebuiltRules.find((r) => r.name === response.match); @@ -59,5 +72,16 @@ export const getMatchPrebuiltRuleNode = }; } } + const lookupTypes = ['inputlookup', 'outputlookup']; + if ( + state.original_rule?.query && + lookupTypes.some((type) => state.original_rule.query.includes(type)) + ) { + logger.debug( + `Rule: ${state.original_rule?.title} did not match any prebuilt rule, but contains inputlookup, dropping` + ); + return { translation_result: SiemMigrationRuleTranslationResult.UNTRANSLATABLE }; + } return {}; }; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts index 60fea54250bb..12fb7ec70feb 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/prompts.ts @@ -23,21 +23,22 @@ Here are some context for you to reference for your task, read it carefully as y [ 'human', `See the below description of the relevant splunk rule and try to match it with any of the elastic detection rules with similar names. -<splunk_rule_name> -{ruleTitle} -</splunk_rule_name> +<splunk_rule> +{splunk_rule} +</splunk_rule> <guidelines> - Always reply with a JSON object with the key "match" and the value being the most relevant matched elastic detection rule name. Do not reply with anything else. - Only reply with exact matches, if you are unsure or do not find a very confident match, always reply with an empty string value in the match key, do not guess or reply with anything else. -- If there is one Elastic rule in the list that covers the same threat, set the name of the matching rule as a value of the match key. Do not reply with anything else. -- If there are multiple rules in the list that cover the same threat, answer with the most specific of them, for example: "Linux User Account Creation" is more specific than "User Account Creation". +- If there is one Elastic rule in the list that covers the same usecase, set the name of the matching rule as a value of the match key. Do not reply with anything else. +- If there are multiple rules in the list that cover the same usecase, answer with the most specific of them, for example: "Linux User Account Creation" is more specific than "User Account Creation". </guidelines> <example_response> -U: <splunk_rule_name> -Linux Auditd Add User Account Type -</splunk_rule_name> +U: <splunk_rule> +Title: Linux Auditd Add User Account Type +Description: The following analytic detects the suspicious add user account type. +</splunk_rule> A: Please find the match JSON object below: \`\`\`json {{"match": "Linux User Account Creation"}} diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts index edd33e2ec69b..a9047c9dc543 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/state.ts @@ -13,7 +13,6 @@ import type { OriginalRule, RuleMigration, } from '../../../../../../common/siem_migrations/model/rule_migration.gen'; -import type { Integration } from '../../types'; export const migrateRuleState = Annotation.Root({ messages: Annotation<BaseMessage[]>({ @@ -32,10 +31,6 @@ export const migrateRuleState = Annotation.Root({ reducer: (current, value) => value ?? current, default: () => '', }), - integrations: Annotation<Integration[]>({ - reducer: (current, value) => value ?? current, - default: () => [], - }), translation_result: Annotation<SiemMigrationRuleTranslationResult>(), comments: Annotation<RuleMigration['comments']>({ reducer: (current, value) => (value ? (current ?? []).concat(value) : current), diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts index 267a5bb0dd52..463de671552c 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/graph.ts @@ -8,6 +8,8 @@ import { END, START, StateGraph } from '@langchain/langgraph'; import { isEmpty } from 'lodash/fp'; import { SiemMigrationRuleTranslationResult } from '../../../../../../../../common/siem_migrations/constants'; +import { getEcsMappingNode } from './nodes/ecs_mapping'; +import { getFilterIndexPatternsNode } from './nodes/filter_index_patterns'; import { getFixQueryErrorsNode } from './nodes/fix_query_errors'; import { getRetrieveIntegrationsNode } from './nodes/retrieve_integrations'; import { getTranslateRuleNode } from './nodes/translate_rule'; @@ -19,6 +21,7 @@ import type { TranslateRuleGraphParams, TranslateRuleState } from './types'; const MAX_VALIDATION_ITERATIONS = 3; export function getTranslateRuleGraph({ + model, inferenceClient, connectorId, ruleMigrationsRetriever, @@ -31,7 +34,9 @@ export function getTranslateRuleGraph({ }); const validationNode = getValidationNode({ logger }); const fixQueryErrorsNode = getFixQueryErrorsNode({ inferenceClient, connectorId, logger }); - const retrieveIntegrationsNode = getRetrieveIntegrationsNode({ ruleMigrationsRetriever }); + const retrieveIntegrationsNode = getRetrieveIntegrationsNode({ model, ruleMigrationsRetriever }); + const ecsMappingNode = getEcsMappingNode({ inferenceClient, connectorId, logger }); + const filterIndexPatternsNode = getFilterIndexPatternsNode({ logger }); const translateRuleGraph = new StateGraph(translateRuleState) // Nodes @@ -39,12 +44,20 @@ export function getTranslateRuleGraph({ .addNode('validation', validationNode) .addNode('fixQueryErrors', fixQueryErrorsNode) .addNode('retrieveIntegrations', retrieveIntegrationsNode) + .addNode('ecsMapping', ecsMappingNode) + .addNode('filterIndexPatterns', filterIndexPatternsNode) // Edges .addEdge(START, 'retrieveIntegrations') .addEdge('retrieveIntegrations', 'translateRule') .addEdge('translateRule', 'validation') .addEdge('fixQueryErrors', 'validation') - .addConditionalEdges('validation', validationRouter, ['fixQueryErrors', END]); + .addEdge('ecsMapping', 'validation') + .addConditionalEdges('validation', validationRouter, [ + 'fixQueryErrors', + 'ecsMapping', + 'filterIndexPatterns', + ]) + .addEdge('filterIndexPatterns', END); const graph = translateRuleGraph.compile(); graph.name = 'Translate Rule Graph'; @@ -59,6 +72,9 @@ const validationRouter = (state: TranslateRuleState) => { if (!isEmpty(state.validation_errors?.esql_errors)) { return 'fixQueryErrors'; } + if (!state.translation_finalized) { + return 'ecsMapping'; + } } - return END; + return 'filterIndexPatterns'; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.ts new file mode 100644 index 000000000000..3bafaf2fc651 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/cim_ecs_map.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const SIEM_RULE_MIGRATION_CIM_ECS_MAP = ` +datamodel,object,source_field,ecs_field,data_type +Application_State,All_Application_State,dest,service.node.name,string +Application_State,All_Application_State,process,process.title,string +Application_State,All_Application_State,user,user.name,string +Application_State,Ports,dest_port,destination.port,number +Application_State,Ports,transport,network.transport,string +Application_State,Ports,transport_dest_port,destination.port,string +Application_State,Services,service,service.name,string +Application_State,Services,service_id,service.id,string +Application_State,Services,status,service.state,string +Authentication,Authentication,action,event.action,string +Authentication,Authentication,app,process.name,string +Authentication,Authentication,dest,host.name,string +Authentication,Authentication,duration,event.duration,number +Authentication,Authentication,signature,event.code,string +Authentication,Authentication,signature_id,event.reason,string +Authentication,Authentication,src,source.address,string +Authentication,Authentication,src_nt_domain,source.domain,string +Authentication,Authentication,user,user.name,string +Certificates,All_Certificates,dest_port,destination.port,number +Certificates,All_Certificates,duration,event.duration,number +Certificates,All_Certificates,src,source.address,string +Certificates,All_Certificates,src_port,source.port,number +Certificates,All_Certificates,transport,network.protocol,string +Certificates,SSL,ssl_end_time,tls.server.not_after,time +Certificates,SSL,ssl_hash,tls.server.hash,string +Certificates,SSL,ssl_issuer_common_name,tls.server.issuer,string +Certificates,SSL,ssl_issuer_locality,x509.issuer.locality,string +Certificates,SSL,ssl_issuer_organization,x509.issuer.organization,string +Certificates,SSL,ssl_issuer_state,x509.issuer.state_or_province,string +Certificates,SSL,ssl_issuer_unit,x509.issuer.organizational_unit,string +Certificates,SSL,ssl_publickey_algorithm,x509.public_key_algorithm,string +Certificates,SSL,ssl_serial,x509.serial_number,string +Certificates,SSL,ssl_signature_algorithm,x509.signature_algorithm,string +Certificates,SSL,ssl_start_time,x509.not_before,time +Certificates,SSL,ssl_subject,x509.subject.distinguished_name,string +Certificates,SSL,ssl_subject_common_name,x509.subject.common_name,string +Certificates,SSL,ssl_subject_locality,x509.subject.locality,string +Certificates,SSL,ssl_subject_organization,x509.subject.organization,string +Certificates,SSL,ssl_subject_state,x509.subject.state_or_province,string +Certificates,SSL,ssl_subject_unit,x509.subject.organizational_unit,string +Certificates,SSL,ssl_version,tls.version,string +Change,All_Changes,action,event.action,string +Change,Account_Management,dest_nt_domain,destination.domain,string +Change,Account_Management,src_nt_domain,source.domain,string +Change,Account_Management,src_user,source.user,string +Intrusion_Detection,IDS_Attacks,action,event.action,string +Intrusion_Detection,IDS_Attacks,dest,destination.address,string +Intrusion_Detection,IDS_Attacks,dest_port,destination.port,number +Intrusion_Detection,IDS_Attacks,dvc,observer.hostname,string +Intrusion_Detection,IDS_Attacks,severity,event.severity,string +Intrusion_Detection,IDS_Attacks,src,source.ip,string +Intrusion_Detection,IDS_Attacks,user,source.user,string +JVM,OS,os,host.os.name,string +JVM,OS,os_architecture,host.architecture,string +JVM,OS,os_version,host.os.version,string +Malware,Malware_Attacks,action,event.action,string +Malware,Malware_Attacks,date,event.created,string +Malware,Malware_Attacks,dest,host.hostname,string +Malware,Malware_Attacks,file_hash,file.hash.*,string +Malware,Malware_Attacks,file_name,file.name,string +Malware,Malware_Attacks,file_path,file.path,string +Malware,Malware_Attacks,Sender,source.user.email,string +Malware,Malware_Attacks,src,source.ip,string +Malware,Malware_Attacks,user,related.user,string +Malware,Malware_Attacks,url,rule.reference,string +Network_Resolution,DNS,answer,dns.answers,string +Network_Resolution,DNS,dest,destination.address,string +Network_Resolution,DNS,dest_port,destination.port,number +Network_Resolution,DNS,duration,event.duration,number +Network_Resolution,DNS,message_type,dns.type,string +Network_Resolution,DNS,name,dns.question.name,string +Network_Resolution,DNS,query,dns.question.name,string +Network_Resolution,DNS,query_type,dns.op_code,string +Network_Resolution,DNS,record_type,dns.question.type,string +Network_Resolution,DNS,reply_code,dns.response_code,string +Network_Resolution,DNS,reply_code_id,dns.id,number +Network_Resolution,DNS,response_time,event.duration,number +Network_Resolution,DNS,src,source.address,string +Network_Resolution,DNS,src_port,source.port,number +Network_Resolution,DNS,transaction_id,dns.id,number +Network_Resolution,DNS,transport,network.transport,string +Network_Resolution,DNS,ttl,dns.answers.ttl,number +Network_Sessions,All_Sessions,action,event.action,string +Network_Sessions,All_Sessions,dest_ip,destination.ip,string +Network_Sessions,All_Sessions,dest_mac,destination.mac,string +Network_Sessions,All_Sessions,duration,event.duration,number +Network_Sessions,All_Sessions,src_dns,source.registered_domain,string +Network_Sessions,All_Sessions,src_ip,source.ip,string +Network_Sessions,All_Sessions,src_mac,source.mac,string +Network_Sessions,All_Sessions,user,user.name,string +Network_Traffic,All_Traffic,action,event.action,string +Network_Traffic,All_Traffic,app,network.protocol,string +Network_Traffic,All_Traffic,bytes,network.bytes,number +Network_Traffic,All_Traffic,dest,destination.ip,string +Network_Traffic,All_Traffic,dest_ip,destination.ip,string +Network_Traffic,All_Traffic,dest_mac,destination.mac,string +Network_Traffic,All_Traffic,dest_port,destination.port,number +Network_Traffic,All_Traffic,dest_translated_ip,destination.nat.ip,string +Network_Traffic,All_Traffic,dest_translated_port,destination.nat.port,number +Network_Traffic,All_Traffic,direction,network.direction,string +Network_Traffic,All_Traffic,duration,event.duration,number +Network_Traffic,All_Traffic,dvc,observer.name,string +Network_Traffic,All_Traffic,dvc_ip,observer.ip,string +Network_Traffic,All_Traffic,dvc_mac,observer.mac,string +Network_Traffic,All_Traffic,dvc_zone,observer.egress.zone,string +Network_Traffic,All_Traffic,packets,network.packets,number +Network_Traffic,All_Traffic,packets_in,source.packets,number +Network_Traffic,All_Traffic,packets_out,destination.packets,number +Network_Traffic,All_Traffic,protocol,network.protocol,string +Network_Traffic,All_Traffic,rule,rule.name,string +Network_Traffic,All_Traffic,src,source.address,string +Network_Traffic,All_Traffic,src_ip,source.ip,string +Network_Traffic,All_Traffic,src_mac,source.mac,string +Network_Traffic,All_Traffic,src_port,source.port,number +Network_Traffic,All_Traffic,src_translated_ip,source.nat.ip,string +Network_Traffic,All_Traffic,src_translated_port,source.nat.port,number +Network_Traffic,All_Traffic,transport,network.transport,string +Network_Traffic,All_Traffic,vlan,vlan.name,string +Vulnerabilities,Vulnerabilities,category,vulnerability.category,string +Vulnerabilities,Vulnerabilities,cve,vulnerability.id,string +Vulnerabilities,Vulnerabilities,cvss,vulnerability.score.base,number +Vulnerabilities,Vulnerabilities,dest,host.name,string +Vulnerabilities,Vulnerabilities,dvc,vulnerability.scanner.vendor,string +Vulnerabilities,Vulnerabilities,severity,vulnerability.severity,string +Vulnerabilities,Vulnerabilities,url,vulnerability.reference,string +Vulnerabilities,Vulnerabilities,user,related.user,string +Vulnerabilities,Vulnerabilities,vendor_product,vulnerability.scanner.vendor,string +Endpoint,Ports,creation_time,@timestamp,timestamp +Endpoint,Ports,dest_port,destination.port,number +Endpoint,Ports,process_id,process.pid,string +Endpoint,Ports,transport,network.transport,string +Endpoint,Ports,transport_dest_port,destination.port,string +Endpoint,Processes,action,event.action,string +Endpoint,Processes,os,os.full,string +Endpoint,Processes,parent_process_exec,process.parent.name,string +Endpoint,Processes,parent_process_id,process.ppid,number +Endpoint,Processes,parent_process_guid,process.parent.entity_id,string +Endpoint,Processes,parent_process_path,process.parent.executable,string +Endpoint,Processes,process_current_directory,process.parent.working_directory, +Endpoint,Processes,process_exec,process.name,string +Endpoint,Processes,process_hash,process.hash.*,string +Endpoint,Processes,process_guid,process.entity_id,string +Endpoint,Processes,process_id,process.pid,number +Endpoint,Processes,process_path,process.executable,string +Endpoint,Processes,user_id,related.user,string +Endpoint,Services,description,service.name,string +Endpoint,Services,process_id,service.id,string +Endpoint,Services,service_dll,dll.name,string +Endpoint,Services,service_dll_path,dll.path,string +Endpoint,Services,service_dll_hash,dll.hash.*,string +Endpoint,Services,service_dll_signature_exists,dll.code_signature.exists,boolean +Endpoint,Services,service_dll_signature_verified,dll.code_signature.valid,boolean +Endpoint,Services,service_exec,service.name,string +Endpoint,Services,service_hash,hash.*,string +Endpoint,Filesystem,file_access_time,file.accessed,timestamp +Endpoint,Filesystem,file_create_time,file.created,timestamp +Endpoint,Filesystem,file_modify_time,file.mtime,timestamp +Endpoint,Filesystem,process_id,process.pid,string +Endpoint,Registry,process_id,process.id,string +Web,Web,action,event.action,string +Web,Web,app,observer.product,string +Web,Web,bytes_in,http.request.bytes,number +Web,Web,bytes_out,http.response.bytes,number +Web,Web,dest,destination.ip,string +Web,Web,duration,event.duration,number +Web,Web,http_method,http.request.method,string +Web,Web,http_referrer,http.request.referrer,string +Web,Web,http_user_agent,user_agent.name,string +Web,Web,status,http.response.status_code,string +Web,Web,url,url.full,string +Web,Web,user,url.username,string +Web,Web,vendor_product,observer.product,string`; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.ts new file mode 100644 index 000000000000..ac7f6db7236d --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/ecs_mapping.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 { Logger } from '@kbn/core/server'; +import type { InferenceClient } from '@kbn/inference-plugin/server'; +import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; +import { getEsqlKnowledgeBase } from '../../../../../util/esql_knowledge_base_caller'; +import type { GraphNode } from '../../types'; +import { SIEM_RULE_MIGRATION_CIM_ECS_MAP } from './cim_ecs_map'; +import { ESQL_TRANSLATE_ECS_MAPPING_PROMPT } from './prompts'; + +interface GetEcsMappingNodeParams { + inferenceClient: InferenceClient; + connectorId: string; + logger: Logger; +} + +export const getEcsMappingNode = ({ + inferenceClient, + connectorId, + logger, +}: GetEcsMappingNodeParams): GraphNode => { + const esqlKnowledgeBaseCaller = getEsqlKnowledgeBase({ inferenceClient, connectorId, logger }); + return async (state) => { + const elasticRule = { + title: state.elastic_rule.title, + description: state.elastic_rule.description, + query: state.elastic_rule.query, + }; + + const prompt = await ESQL_TRANSLATE_ECS_MAPPING_PROMPT.format({ + field_mapping: SIEM_RULE_MIGRATION_CIM_ECS_MAP, + splunk_query: state.inline_query, + elastic_rule: JSON.stringify(elasticRule, null, 2), + }); + + const response = await esqlKnowledgeBaseCaller(prompt); + + const updatedQuery = response.match(/```esql\n([\s\S]*?)\n```/)?.[1] ?? ''; + const ecsSummary = response.match(/## Field Mapping Summary[\s\S]*$/)?.[0] ?? ''; + + const translationResult = getTranslationResult(updatedQuery); + + return { + response, + comments: [ecsSummary], + translation_finalized: true, + translation_result: translationResult, + elastic_rule: { + ...state.elastic_rule, + query: updatedQuery, + }, + }; + }; +}; + +const getTranslationResult = (esqlQuery: string): SiemMigrationRuleTranslationResult => { + if (esqlQuery.match(/\[(macro|lookup):[\s\S]*\]/)) { + return SiemMigrationRuleTranslationResult.PARTIAL; + } + return SiemMigrationRuleTranslationResult.FULL; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.ts new file mode 100644 index 000000000000..339e6d3dd8e7 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/index.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 { getEcsMappingNode } from './ecs_mapping'; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.ts new file mode 100644 index 000000000000..1e89cda884ca --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/ecs_mapping/prompts.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 { ChatPromptTemplate } from '@langchain/core/prompts'; + +export const ESQL_TRANSLATE_ECS_MAPPING_PROMPT = + ChatPromptTemplate.fromTemplate(`You are a helpful cybersecurity (SIEM) expert agent. Your task is to migrate "detection rules" from Splunk SPL to Elasticsearch ESQL. +Your task is to look at the new ESQL query already generated from its initial Splunk SPL query and translate the Splunk CIM field names to the Elastic Common Schema (ECS) fields. +Below is the relevant context used when deciding which Elastic Common Schema field to use when translating from Splunk CIM fields: + +<context> +<cim_to_ecs_map> +{field_mapping} +</cim_to_ecs_map> +<initial_splunk_query> +{splunk_query} +</initial_splunk_query> +<current_elastic_rule> +{elastic_rule} +</current_elastic_rule> +</context> + +Go through the current esql query above and translate the current field names that originated from a Splunk CIM/SPL query to the equivalent Elastic Common Schema (ECS) fields by following these steps: +- Analyze all the information about the related esql rule especially the query and try to determine the intent of the rule, which should help in choosing which fields to map to ECS. +- Try to determine if and which datamodel is being used by looking at the initial splunk query, the query usually contains the datamodel name, its object and related fields. +- Go through each part of the ESQL query, if a part is determined to be related to a splunk CIM field or datamodel use the cim to ecs map above to determine the equivalent ECS field. +- If a field is not in the cim to ecs map, or no datamodel is used, try to use your existing knowledge about Elastic Common Schema to determine if and which ECS field to use. +- Do not reuse the same ECS field name for multiple Splunk CIM fields, always try to find the most appropriate ECS field. +- If you are uncertain about a field mapping, leave it as is and mention it in the summary. + +<guidelines> +- If a field is found in the CIM to ECS map, replace the field name with the ECS field name. If not, try to determine if and what equivalent ECS field can be used. +- Only translate the field names, do not modify the structure of the query. +- Only translate when you are certain about the field mapping, if uncertain, leave the field as is and mention it in the summary. +- Only use and modify the current ESQL query, do not create a new one or modify any other part of the rule. +</guidelines> + +<expected_output> +- First, the updated ES|QL query inside an \`\`\`esql code block. +- At the end, the summary of the the field mapping process followed in markdown, starting with "## Field Mapping Summary". This would include the reason, original field names, the target ECS field name and any fields that were left as is. +</expected_output> +`); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.ts new file mode 100644 index 000000000000..bb1e086bf493 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/filter_index_patterns.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 type { Logger } from '@kbn/core/server'; +import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; +import type { GraphNode } from '../../types'; + +interface GetFilterIndexPatternsNodeParams { + logger: Logger; +} + +/** + * When rule translation happens without any related integrations found we reuse the logs-* pattern to make validation easier. + * However we want to replace this with a value to notify the end user that it needs to be replaced. + */ +export const getFilterIndexPatternsNode = ({ + logger, +}: GetFilterIndexPatternsNodeParams): GraphNode => { + return async (state) => { + const query = state.elastic_rule?.query; + + if (query && query.includes('logs-*')) { + logger.debug('Replacing logs-* with a placeholder value'); + const newQuery = query.replace('logs-*', '[indexPattern:logs-*]'); + return { + elastic_rule: { + ...state.elastic_rule, + query: newQuery, + translation_result: SiemMigrationRuleTranslationResult.PARTIAL, + }, + }; + } + + return {}; + }; +}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.ts new file mode 100644 index 000000000000..6e7762633b7f --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/filter_index_patterns/index.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 { getFilterIndexPatternsNode } from './filter_index_patterns'; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.ts new file mode 100644 index 000000000000..d562bb31b162 --- /dev/null +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/prompts.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 { ChatPromptTemplate } from '@langchain/core/prompts'; +export const MATCH_INTEGRATION_PROMPT = ChatPromptTemplate.fromMessages([ + [ + 'system', + `You are an expert assistant in Cybersecurity, your task is to help migrating a SIEM detection rule, from Splunk Security to Elastic Security. +You will be provided with a Splunk Detection Rule name by the user, your goal is to try to find the most relevant Elastic Integration from the integration list below if any, and return either the most relevant. If none seems relevant you should always return empty. +Here are some context for you to reference for your task, read it carefully as you will get questions about it later: + +<context> +<elastic_integrations> +{integrations} +</elastic_integrations> +</context> +`, + ], + [ + 'human', + `See the below description of the relevant splunk rule and try to match it with any of the Elastic Integrations from before, do not guess or reply with anything else, only reply with the most relevant Elastic Integration if any. +<splunk_rule> +{splunk_rule} +</splunk_rule> + +<guidelines> +- Always reply with a JSON object with the key "match" and the value being the most relevant matched integration title. Do not reply with anything else. +- Only reply with exact matches, if you are unsure or do not find a very confident match, always reply with an empty string value in the match key, do not guess or reply with anything else. +- If there is one elastic integration in the list that covers the relevant usecase, set the title of the matching integration as a value of the match key. Do not reply with anything else. +- If there are multiple elastic integrations in the list that cover the same usecase, answer with the most specific of them, for example if the rule is related to "Sysmon" then the Sysmon integration is more specific than Windows. +</guidelines> + +<example_response> +U: <splunk_rule_name> +Linux Auditd Add User Account Type +</splunk_rule_name> +A: Please find the match JSON object below: +\`\`\`json +{{"match": "auditd_manager"}} +\`\`\` +</example_response> +`, + ], + ['ai', 'Please find the match JSON object below:'], +]); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts index fa5b761806b5..74c9055bd766 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/retrieve_integrations/retrieve_integrations.ts @@ -5,22 +5,57 @@ * 2.0. */ +import { JsonOutputParser } from '@langchain/core/output_parsers'; import type { RuleMigrationsRetriever } from '../../../../../retrievers'; +import type { ChatModel } from '../../../../../util/actions_client_chat'; import type { GraphNode } from '../../types'; +import { MATCH_INTEGRATION_PROMPT } from './prompts'; interface GetRetrieveIntegrationsNodeParams { + model: ChatModel; ruleMigrationsRetriever: RuleMigrationsRetriever; } +interface GetMatchedIntegrationResponse { + match: string; +} + export const getRetrieveIntegrationsNode = ({ + model, ruleMigrationsRetriever, }: GetRetrieveIntegrationsNodeParams): GraphNode => { return async (state) => { const query = state.semantic_query; const integrations = await ruleMigrationsRetriever.integrations.getIntegrations(query); - return { - integrations, + + const outputParser = new JsonOutputParser(); + const mostRelevantIntegration = MATCH_INTEGRATION_PROMPT.pipe(model).pipe(outputParser); + + const elasticSecurityIntegrations = integrations.map((integration) => { + return { + title: integration.title, + description: integration.description, + }; + }); + const splunkRule = { + title: state.original_rule.title, + description: state.original_rule.description, }; + + /* + * Takes the most relevant integration from the array of integration(s) returned by the semantic query, returns either the most relevant or none. + */ + const response = (await mostRelevantIntegration.invoke({ + integrations: JSON.stringify(elasticSecurityIntegrations, null, 2), + splunk_rule: JSON.stringify(splunkRule, null, 2), + })) as GetMatchedIntegrationResponse; + if (response.match) { + const matchedIntegration = integrations.find((r) => r.title === response.match); + if (matchedIntegration) { + return { integration: matchedIntegration }; + } + } + return {}; }; }; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts index 9749dfd96efb..1ea8295c7402 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/prompts.ts @@ -7,46 +7,39 @@ import { ChatPromptTemplate } from '@langchain/core/prompts'; -export const ESQL_TRANSLATION_PROMPT = - ChatPromptTemplate.fromTemplate(`You are a helpful cybersecurity (SIEM) expert agent. Your task is to migrate "detection rules" from Splunk to Elastic Security. -Your goal is to translate the SPL query into an equivalent Elastic Security Query Language (ES|QL) query. -Below is the relevant context used when deciding which Elastic Common Schema field to use when translating from Splunk CIM fields: +export const ESQL_SYNTAX_TRANSLATION_PROMPT = + ChatPromptTemplate.fromTemplate(`You are a helpful cybersecurity (SIEM) expert agent. Your task is to migrate "detection rules" from Splunk SPL to Elasticsearch ES|QL. +Your goal is to translate the SPL query syntax into an equivalent Elastic Search Query Language (ES|QL) query without changing any of the field names and focusing only on translating the syntax and structure. +Here are some context for you to reference for your task, read it carefully as you will get questions about it later: <context> -<cim_to_ecs_map> -{field_mapping} -</cim_to_ecs_map> +<splunk_rule> +{splunk_rule} +</splunk_rule> +<lookup_and_macro_info> +If, in the SPL query, you find a lookup list or macro call, mention it in the summary and add a placeholder in the query with the format [macro:<macro_name>(argumentCount)] or [lookup:<lookup_name>] including the [] keys, + Examples: + - \`get_duration(firstDate,secondDate)\` -> [macro:get_duration(2)] + - lookup dns_domains.csv -> [lookup:dns_domains.csv]. +</lookup_and_macro_info> </context> -## Splunk rule Information provided: -- Below you will find Splunk rule information: the title (<<TITLE>>), the description (<<DESCRIPTION>>), and the SPL (Search Processing Language) query (<<SPL_QUERY>>). -- Use all the information to analyze the intent of the rule, in order to translate into an equivalent ES|QL rule. -- The fields in the Splunk query may not be the same as in the Elastic Common Schema (ECS), so you may need to map them accordingly. +Go through each step and part of the splunk rule and query while following the below guide to produce the resulting ES|QL query: +- Analyze all the information about the related splunk rule and try to determine the intent of the rule, in order to translate into an equivalent ES|QL rule. +- Go through each part of the SPL query and determine the steps required to produce the same end results using ES|QL. Only focus on translating the structure without modifying any of the field names. +- Do NOT map any of the fields to the Elastic Common Schema (ECS), this will happen in a later step. +- Always remember to replace any lookup list or macro call with the appropriate placeholder as defined in the context. -## Guidelines: + +<guidelines> - Analyze the SPL query and identify the key components. -- Translate the SPL query into an equivalent ES|QL query using ECS (Elastic Common Schema) field names. -- Always start the generated ES|QL query by filtering FROM using these index patterns in the translated query: {indexPatterns}. -- If, in the SPL query, you find a lookup list or macro call, mention it in the summary and add a placeholder in the query with the format [macro:<macro_name>(argumentCount)] or [lookup:<lookup_name>] including the [] keys, - - Examples: - - \`get_duration(firstDate,secondDate)\` -> [macro:get_duration(2)] - - lookup dns_domains.csv -> [lookup:dns_domains.csv]. +- Do NOT translate the field names of the SPL query. +- Always start the resulting ES|QL query by filtering using FROM and with these index patterns: {indexPatterns}. +- Remember to always replace any lookup list or macro call with the appropriate placeholder as defined in the context. +</guidelines> -## The output will be parsed and must contain: +<expected_output> - First, the ES|QL query inside an \`\`\`esql code block. -- At the end, the summary of the translation process followed in markdown, starting with "## Migration Summary". - -Find the Splunk rule information below: - -<<TITLE>> -{title} -<> - -<> -{description} -<> - -<> -{inline_query} -<> +- At the end, the summary of the translation process followed in markdown, starting with "## Translation Summary". + `); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts index 85f5e7279d2b..09f9bca47400 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/nodes/translate_rule/translate_rule.ts @@ -10,8 +10,7 @@ import type { InferenceClient } from '@kbn/inference-plugin/server'; import { SiemMigrationRuleTranslationResult } from '../../../../../../../../../../common/siem_migrations/constants'; import { getEsqlKnowledgeBase } from '../../../../../util/esql_knowledge_base_caller'; import type { GraphNode } from '../../types'; -import { SIEM_RULE_MIGRATION_CIM_ECS_MAP } from './cim_ecs_map'; -import { ESQL_TRANSLATION_PROMPT } from './prompts'; +import { ESQL_SYNTAX_TRANSLATION_PROMPT } from './prompts'; interface GetTranslateRuleNodeParams { inferenceClient: InferenceClient; @@ -26,34 +25,35 @@ export const getTranslateRuleNode = ({ }: GetTranslateRuleNodeParams): GraphNode => { const esqlKnowledgeBaseCaller = getEsqlKnowledgeBase({ inferenceClient, connectorId, logger }); return async (state) => { - const indexPatterns = state.integrations - .flatMap((integration) => - integration.data_streams.map((dataStream) => dataStream.index_pattern) - ) - .join(','); - const integrationIds = state.integrations.map((integration) => integration.id); + const indexPatterns = + state.integration?.data_streams?.map((dataStream) => dataStream.index_pattern).join(',') || + 'logs-*'; + const integrationId = state.integration?.id || ''; - const prompt = await ESQL_TRANSLATION_PROMPT.format({ + const splunkRule = { title: state.original_rule.title, description: state.original_rule.description, - field_mapping: SIEM_RULE_MIGRATION_CIM_ECS_MAP, inline_query: state.inline_query, + }; + + const prompt = await ESQL_SYNTAX_TRANSLATION_PROMPT.format({ + splunk_rule: JSON.stringify(splunkRule, null, 2), indexPatterns, }); const response = await esqlKnowledgeBaseCaller(prompt); const esqlQuery = response.match(/```esql\n([\s\S]*?)\n```/)?.[1] ?? ''; - const summary = response.match(/## Migration Summary[\s\S]*$/)?.[0] ?? ''; + const translationSummary = response.match(/## Translation Summary[\s\S]*$/)?.[0] ?? ''; const translationResult = getTranslationResult(esqlQuery); return { response, - comments: [summary], + comments: [translationSummary], translation_result: translationResult, elastic_rule: { title: state.original_rule.title, - integration_ids: integrationIds, + integration_id: integrationId, description: state.original_rule.description, severity: 'low', query: esqlQuery, diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts index ac8799cb09d7..ea4623800217 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/state.ts @@ -22,9 +22,13 @@ export const translateRuleState = Annotation.Root({ default: () => [], }), original_rule: Annotation(), - integrations: Annotation({ + integration: Annotation({ reducer: (current, value) => value ?? current, - default: () => [], + default: () => ({} as Integration), + }), + translation_finalized: Annotation({ + reducer: (current, value) => value ?? current, + default: () => false, }), inline_query: Annotation({ reducer: (current, value) => value ?? current, diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts index eddc415f2339..0a3435d49673 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/sub_graphs/translate_rule/types.ts @@ -8,12 +8,14 @@ import type { Logger } from '@kbn/core/server'; import type { InferenceClient } from '@kbn/inference-plugin/server'; import type { RuleMigrationsRetriever } from '../../../retrievers'; +import type { ChatModel } from '../../../util/actions_client_chat'; import type { translateRuleState } from './state'; export type TranslateRuleState = typeof translateRuleState.State; export type GraphNode = (state: TranslateRuleState) => Promise>; export interface TranslateRuleGraphParams { + model: ChatModel; inferenceClient: InferenceClient; connectorId: string; ruleMigrationsRetriever: RuleMigrationsRetriever; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts index 22c884fa4043..29852558cda4 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_migrations_retriever.ts @@ -5,19 +5,42 @@ * 2.0. */ +import type { RulesClient } from '@kbn/alerting-plugin/server'; +import type { SavedObjectsClientContract } from '@kbn/core/server'; import type { RuleMigrationsDataClient } from '../../data/rule_migrations_data_client'; import { IntegrationRetriever } from './integration_retriever'; import { PrebuiltRulesRetriever } from './prebuilt_rules_retriever'; import { RuleResourceRetriever } from './rule_resource_retriever'; +interface RuleMigrationsRetrieverDeps { + data: RuleMigrationsDataClient; + rules: RulesClient; + savedObjects: SavedObjectsClientContract; +} + export class RuleMigrationsRetriever { public readonly resources: RuleResourceRetriever; public readonly integrations: IntegrationRetriever; public readonly prebuiltRules: PrebuiltRulesRetriever; - constructor(dataClient: RuleMigrationsDataClient, migrationId: string) { - this.resources = new RuleResourceRetriever(migrationId, dataClient); - this.integrations = new IntegrationRetriever(dataClient); - this.prebuiltRules = new PrebuiltRulesRetriever(dataClient); + constructor(migrationId: string, private readonly clients: RuleMigrationsRetrieverDeps) { + this.resources = new RuleResourceRetriever(migrationId, this.clients.data); + this.integrations = new IntegrationRetriever(this.clients.data); + this.prebuiltRules = new PrebuiltRulesRetriever(this.clients.data); + } + + public async initialize() { + await Promise.all([ + this.resources.initialize(), + // Populates the indices used for RAG searches on prebuilt rules and integrations. + this.clients.data.prebuiltRules.create({ + rulesClient: this.clients.rules, + soClient: this.clients.savedObjects, + }), + // Will use Fleet API client for integration retrieval as an argument once feature is available + this.clients.data.integrations.create(), + ]).catch((error) => { + throw new Error(`Failed to initialize RuleMigrationsRetriever: ${error}`); + }); } } diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts index 51618d5f3ca1..1e02eec2315e 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.test.ts @@ -5,176 +5,124 @@ * 2.0. */ -import { MAX_RECURSION_DEPTH, RuleResourceRetriever } from './rule_resource_retriever'; // Adjust path as needed +import { RuleResourceRetriever } from './rule_resource_retriever'; // Adjust path as needed import type { OriginalRule } from '../../../../../../common/siem_migrations/model/rule_migration.gen'; -import { MockRuleMigrationsDataClient } from '../../data/__mocks__/mocks'; - -const mockRuleResourceIdentifier = jest.fn(); -const mockGetRuleResourceIdentifier = jest.fn((_: unknown) => mockRuleResourceIdentifier); -jest.mock('../../../../../../common/siem_migrations/rules/resources', () => ({ - getRuleResourceIdentifier: (params: unknown) => mockGetRuleResourceIdentifier(params), -})); +import { ResourceIdentifier } from '../../../../../../common/siem_migrations/rules/resources'; +import type { RuleMigrationsDataClient } from '../../data/rule_migrations_data_client'; jest.mock('../../data/rule_migrations_data_service'); +jest.mock('../../../../../../common/siem_migrations/rules/resources'); + +const MockResourceIdentifier = ResourceIdentifier as jest.Mock; describe('RuleResourceRetriever', () => { let retriever: RuleResourceRetriever; - const mockRuleMigrationsDataClient = new MockRuleMigrationsDataClient(); - const migrationId = 'test-migration-id'; - const ruleQuery = 'rule-query'; - const originalRule = { query: ruleQuery } as OriginalRule; + let mockDataClient: jest.Mocked; + let mockResourceIdentifier: jest.Mocked; beforeEach(() => { - retriever = new RuleResourceRetriever(migrationId, mockRuleMigrationsDataClient); - mockRuleResourceIdentifier.mockReturnValue({ list: [], macro: [] }); - - mockRuleMigrationsDataClient.resources.get.mockImplementation( - async (_: string, type: string, names: string[]) => - names.map((name) => ({ type, name, content: `${name}-content` })) - ); - - mockRuleResourceIdentifier.mockImplementation((query) => { - if (query === ruleQuery) { - return { list: ['list1', 'list2'], macro: ['macro1'] }; - } - return { list: [], macro: [] }; - }); - - jest.clearAllMocks(); + mockDataClient = { + resources: { searchBatches: jest.fn().mockReturnValue({ next: jest.fn(() => []) }) }, + } as unknown as RuleMigrationsDataClient; + + retriever = new RuleResourceRetriever('mockMigrationId', mockDataClient); + + MockResourceIdentifier.mockImplementation(() => ({ + fromOriginalRule: jest.fn().mockReturnValue([]), + fromResources: jest.fn().mockReturnValue([]), + })); + mockResourceIdentifier = new MockResourceIdentifier( + 'splunk' + ) as jest.Mocked; }); - describe('getResources', () => { - it('should call resource identification', async () => { - await retriever.getResources(originalRule); + it('throws an error if initialize is not called before getResources', async () => { + const originalRule = { vendor: 'splunk' } as unknown as OriginalRule; - expect(mockGetRuleResourceIdentifier).toHaveBeenCalledWith(originalRule); - expect(mockRuleResourceIdentifier).toHaveBeenCalledWith(ruleQuery); - expect(mockRuleResourceIdentifier).toHaveBeenCalledWith('macro1-content'); - }); - - it('should retrieve resources', async () => { - const resources = await retriever.getResources(originalRule); - - expect(mockRuleMigrationsDataClient.resources.get).toHaveBeenCalledWith(migrationId, 'list', [ - 'list1', - 'list2', - ]); - expect(mockRuleMigrationsDataClient.resources.get).toHaveBeenCalledWith( - migrationId, - 'macro', - ['macro1'] - ); - - expect(resources).toEqual({ - list: [ - { type: 'list', name: 'list1', content: 'list1-content' }, - { type: 'list', name: 'list2', content: 'list2-content' }, - ], - macro: [{ type: 'macro', name: 'macro1', content: 'macro1-content' }], - }); - }); + await expect(retriever.getResources(originalRule)).rejects.toThrow( + 'initialize must be called before calling getResources' + ); + }); - it('should retrieve nested resources', async () => { - mockRuleResourceIdentifier.mockImplementation((query) => { - if (query === ruleQuery) { - return { list: ['list1', 'list2'], macro: ['macro1'] }; - } - if (query === 'macro1-content') { - return { list: ['list3'], macro: [] }; - } - return { list: [], macro: [] }; - }); - - const resources = await retriever.getResources(originalRule); - - expect(mockRuleMigrationsDataClient.resources.get).toHaveBeenCalledWith(migrationId, 'list', [ - 'list1', - 'list2', - ]); - expect(mockRuleMigrationsDataClient.resources.get).toHaveBeenCalledWith( - migrationId, - 'macro', - ['macro1'] - ); - expect(mockRuleMigrationsDataClient.resources.get).toHaveBeenCalledWith(migrationId, 'list', [ - 'list3', - ]); - - expect(resources).toEqual({ - list: [ - { type: 'list', name: 'list1', content: 'list1-content' }, - { type: 'list', name: 'list2', content: 'list2-content' }, - { type: 'list', name: 'list3', content: 'list3-content' }, - ], - macro: [{ type: 'macro', name: 'macro1', content: 'macro1-content' }], - }); - }); + it('returns an empty object if no matching resources are found', async () => { + const originalRule = { vendor: 'splunk' } as unknown as OriginalRule; - it('should handle missing macros', async () => { - mockRuleMigrationsDataClient.resources.get.mockImplementation( - async (_: string, type: string, names: string[]) => { - if (type === 'macro') { - return []; - } - return names.map((name) => ({ type, name, content: `${name}-content` })); - } - ); - - const resources = await retriever.getResources(originalRule); - - expect(resources).toEqual({ - list: [ - { type: 'list', name: 'list1', content: 'list1-content' }, - { type: 'list', name: 'list2', content: 'list2-content' }, - ], - }); - }); + // Mock the resource identifier to return no resources + mockResourceIdentifier.fromOriginalRule.mockReturnValue([]); + await retriever.initialize(); // Pretend initialize has been called - it('should handle missing lists', async () => { - mockRuleMigrationsDataClient.resources.get.mockImplementation( - async (_: string, type: string, names: string[]) => { - if (type === 'list') { - return []; - } - return names.map((name) => ({ type, name, content: `${name}-content` })); - } - ); - - const resources = await retriever.getResources(originalRule); - - expect(resources).toEqual({ - macro: [{ type: 'macro', name: 'macro1', content: 'macro1-content' }], - }); - }); + const result = await retriever.getResources(originalRule); + expect(result).toEqual({}); + }); - it('should not include resources with missing content', async () => { - mockRuleMigrationsDataClient.resources.get.mockImplementation( - async (_: string, type: string, names: string[]) => { - return names.map((name) => { - if (name === 'list1') { - return { type, name, content: '' }; - } - return { type, name, content: `${name}-content` }; - }); - } - ); - - const resources = await retriever.getResources(originalRule); - - expect(resources).toEqual({ - list: [{ type: 'list', name: 'list2', content: 'list2-content' }], - macro: [{ type: 'macro', name: 'macro1', content: 'macro1-content' }], - }); + it('returns matching macro and list resources', async () => { + const mockExistingResources = { + macro: { macro1: { name: 'macro1', type: 'macro' } }, + list: { list1: { name: 'list1', type: 'list' } }, + }; + // Inject existing resources manually + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (retriever as any).existingResources = mockExistingResources; + + const mockResourcesIdentified = [ + { name: 'macro1', type: 'macro' as const }, + { name: 'list1', type: 'list' as const }, + ]; + MockResourceIdentifier.mockImplementation(() => ({ + fromOriginalRule: jest.fn().mockReturnValue(mockResourcesIdentified), + fromResources: jest.fn().mockReturnValue([]), + })); + + const originalRule = { vendor: 'splunk' } as unknown as OriginalRule; + + const result = await retriever.getResources(originalRule); + expect(result).toEqual({ + macro: [{ name: 'macro1', type: 'macro' }], + list: [{ name: 'list1', type: 'list' }], }); + }); - it('should stop recursion after reaching MAX_RECURSION_DEPTH', async () => { - mockRuleResourceIdentifier.mockImplementation(() => { - return { list: [], macro: ['infinite-macro'] }; - }); - - const resources = await retriever.getResources(originalRule); - - expect(resources.macro?.length).toEqual(MAX_RECURSION_DEPTH); + it('handles nested resources properly', async () => { + const originalRule = { vendor: 'splunk' } as unknown as OriginalRule; + + const mockExistingResources = { + macro: { + macro1: { name: 'macro1', type: 'macro' }, + macro2: { name: 'macro2', type: 'macro' }, + }, + list: { + list1: { name: 'list1', type: 'list' }, + list2: { name: 'list2', type: 'list' }, + }, + }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (retriever as any).existingResources = mockExistingResources; + + const mockResourcesIdentifiedFromRule = [ + { name: 'macro1', type: 'macro' as const }, + { name: 'list1', type: 'list' as const }, + ]; + + const mockNestedResources = [ + { name: 'macro2', type: 'macro' as const }, + { name: 'list2', type: 'list' as const }, + ]; + + MockResourceIdentifier.mockImplementation(() => ({ + fromOriginalRule: jest.fn().mockReturnValue(mockResourcesIdentifiedFromRule), + fromResources: jest.fn().mockReturnValue([]).mockReturnValueOnce(mockNestedResources), + })); + + const result = await retriever.getResources(originalRule); + expect(result).toEqual({ + macro: [ + { name: 'macro1', type: 'macro' }, + { name: 'macro2', type: 'macro' }, + ], + list: [ + { name: 'list1', type: 'list' }, + { name: 'list2', type: 'list' }, + ], }); }); }); diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts index d80646dc27c4..b89939e199e5 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/retrievers/rule_resource_retriever.ts @@ -5,9 +5,7 @@ * 2.0. */ -import { isEmpty } from 'lodash/fp'; -import type { QueryResourceIdentifier } from '../../../../../../common/siem_migrations/rules/resources/types'; -import { getRuleResourceIdentifier } from '../../../../../../common/siem_migrations/rules/resources'; +import { ResourceIdentifier } from '../../../../../../common/siem_migrations/rules/resources'; import type { OriginalRule, RuleMigrationResource, @@ -15,86 +13,91 @@ import type { } from '../../../../../../common/siem_migrations/model/rule_migration.gen'; import type { RuleMigrationsDataClient } from '../../data/rule_migrations_data_client'; +export interface RuleMigrationDefinedResource extends RuleMigrationResource { + content: string; // ensures content exists +} export type RuleMigrationResources = Partial< - Record + Record >; - -/* It's not a common practice to have more than 2-3 nested levels of resources. - * This limit is just to prevent infinite recursion in case something goes wrong. - */ -export const MAX_RECURSION_DEPTH = 30; +interface ExistingResources { + macro: Record; + list: Record; +} export class RuleResourceRetriever { + private existingResources?: ExistingResources; + constructor( private readonly migrationId: string, private readonly dataClient: RuleMigrationsDataClient ) {} - public async getResources(originalRule: OriginalRule): Promise { - const resourceIdentifier = getRuleResourceIdentifier(originalRule); - return this.recursiveRetriever(originalRule.query, resourceIdentifier); + public async initialize(): Promise { + const batches = this.dataClient.resources.searchBatches( + this.migrationId, + { filters: { hasContent: true } } + ); + + const existingRuleResources: ExistingResources = { macro: {}, list: {} }; + let resources; + do { + resources = await batches.next(); + resources.forEach((resource) => { + existingRuleResources[resource.type][resource.name] = resource; + }); + } while (resources.length > 0); + + this.existingResources = existingRuleResources; } - private recursiveRetriever = async ( - query: string, - resourceIdentifier: QueryResourceIdentifier, - it = 0 - ): Promise => { - if (it >= MAX_RECURSION_DEPTH) { - return {}; + public async getResources(originalRule: OriginalRule): Promise { + const existingResources = this.existingResources; + if (!existingResources) { + throw new Error('initialize must be called before calling getResources'); } - const identifiedResources = resourceIdentifier(query); - const resources: RuleMigrationResources = {}; - - const listNames = identifiedResources.list; - if (listNames.length > 0) { - const listsWithContent = await this.dataClient.resources - .get(this.migrationId, 'list', listNames) - .then(withContent); + const resourceIdentifier = new ResourceIdentifier(originalRule.vendor); + const resourcesIdentifiedFromRule = resourceIdentifier.fromOriginalRule(originalRule); - if (listsWithContent.length > 0) { - resources.list = listsWithContent; + const macrosFound = new Map(); + const listsFound = new Map(); + resourcesIdentifiedFromRule.forEach((resource) => { + const existingResource = existingResources[resource.type][resource.name]; + if (existingResource) { + if (resource.type === 'macro') { + macrosFound.set(resource.name, existingResource); + } else if (resource.type === 'list') { + listsFound.set(resource.name, existingResource); + } } - } + }); - const macroNames = identifiedResources.macro; - if (macroNames.length > 0) { - const macrosWithContent = await this.dataClient.resources - .get(this.migrationId, 'macro', macroNames) - .then(withContent); + const resourcesFound = [...macrosFound.values(), ...listsFound.values()]; + if (!resourcesFound.length) { + return {}; + } - if (macrosWithContent.length > 0) { - // retrieve nested resources inside macros - const macrosNestedResources = await Promise.all( - macrosWithContent.map(({ content }) => - this.recursiveRetriever(content, resourceIdentifier, it + 1) - ) - ); + let nestedResourcesFound = resourcesFound; + do { + const nestedResourcesIdentified = resourceIdentifier.fromResources(nestedResourcesFound); - // Process lists inside macros - const macrosNestedLists = macrosNestedResources.flatMap( - (macroNestedResources) => macroNestedResources.list ?? [] - ); - if (macrosNestedLists.length > 0) { - resources.list = (resources.list ?? []).concat(macrosNestedLists); + nestedResourcesFound = []; + nestedResourcesIdentified.forEach((resource) => { + const existingResource = existingResources[resource.type][resource.name]; + if (existingResource) { + nestedResourcesFound.push(existingResource); + if (resource.type === 'macro') { + macrosFound.set(resource.name, existingResource); + } else if (resource.type === 'list') { + listsFound.set(resource.name, existingResource); + } } + }); + } while (nestedResourcesFound.length > 0); - // Process macros inside macros - const macrosNestedMacros = macrosNestedResources.flatMap( - (macroNestedResources) => macroNestedResources.macro ?? [] - ); - - if (macrosNestedMacros.length > 0) { - macrosWithContent.push(...macrosNestedMacros); - } - resources.macro = macrosWithContent; - } - } - return resources; - }; + return { + ...(macrosFound.size > 0 ? { macro: Array.from(macrosFound.values()) } : {}), + ...(listsFound.size > 0 ? { list: Array.from(listsFound.values()) } : {}), + }; + } } - -const withContent = (resources: RuleMigrationResource[]) => { - return resources.filter((resource) => !isEmpty(resource.content)); -}; diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts index 6dbee5c64ee4..1edd1b449070 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/rule_migrations_task_client.ts @@ -20,15 +20,14 @@ import type { MigrateRuleState } from './agent/types'; import { RuleMigrationsRetriever } from './retrievers'; import type { MigrationAgent, - RuleMigrationTaskPrepareParams, - RuleMigrationTaskRunParams, RuleMigrationTaskStartParams, + RuleMigrationTaskCreateAgentParams, RuleMigrationTaskStartResult, RuleMigrationTaskStopResult, } from './types'; import { ActionsClientChat } from './util/actions_client_chat'; -const ITERATION_BATCH_SIZE = 50 as const; +const ITERATION_BATCH_SIZE = 15 as const; const ITERATION_SLEEP_SECONDS = 10 as const; type MigrationsRunning = Map; @@ -63,82 +62,40 @@ export class RuleMigrationsTaskClient { return { exists: true, started: false }; } - const abortController = new AbortController(); - - // Retrieve agent from prepare and pass it to run right after without awaiting but using .then - this.prepare({ ...params, abortController }) - .then((agent) => this.run({ ...params, agent, abortController })) - .catch((error) => { - this.logger.error(`Error starting migration ID:${migrationId} with error:${error}`, error); - }); - - return { exists: true, started: true }; - } - - private async prepare({ - migrationId, - connectorId, - inferenceClient, - actionsClient, - rulesClient, - soClient, - abortController, - }: RuleMigrationTaskPrepareParams): Promise { - await Promise.all([ - // Populates the indices used for RAG searches on prebuilt rules and integrations. - await this.data.prebuiltRules.create({ rulesClient, soClient }), - // Will use Fleet API client for integration retrieval as an argument once feature is available - await this.data.integrations.create(), - ]).catch((error) => { - this.logger.error(`Error preparing RAG indices for migration ID:${migrationId}`, error); - throw error; + // run the migration without awaiting it to execute it in the background + this.run(params).catch((error) => { + this.logger.error(`Error executing migration ID:${migrationId}`, error); }); - const ruleMigrationsRetriever = new RuleMigrationsRetriever(this.data, migrationId); - - const actionsClientChat = new ActionsClientChat(connectorId, actionsClient, this.logger); - const model = await actionsClientChat.createModel({ - signal: abortController.signal, - temperature: 0.05, - }); - - const agent = getRuleMigrationAgent({ - connectorId, - model, - inferenceClient, - ruleMigrationsRetriever, - logger: this.logger, - }); - return agent; + return { exists: true, started: true }; } - private async run({ - migrationId, - agent, - invocationConfig, - abortController, - }: RuleMigrationTaskRunParams): Promise { + private async run(params: RuleMigrationTaskStartParams): Promise { + const { migrationId, invocationConfig } = params; if (this.migrationsRunning.has(migrationId)) { // This should never happen, but just in case throw new Error(`Task already running for migration ID:${migrationId} `); } this.logger.info(`Starting migration ID:${migrationId}`); + const abortController = new AbortController(); this.migrationsRunning.set(migrationId, { user: this.currentUser.username, abortController }); - const config: RunnableConfig = { - ...invocationConfig, - // signal: abortController.signal, // not working properly https://github.com/langchain-ai/langgraphjs/issues/319 - }; const abortPromise = abortSignalToPromise(abortController.signal); + const withAbortRace = async (task: Promise) => Promise.race([task, abortPromise.promise]); + + const sleep = async (seconds: number) => { + this.logger.debug(`Sleeping ${seconds}s for migration ID:${migrationId}`); + await withAbortRace(new Promise((resolve) => setTimeout(resolve, seconds * 1000))); + }; try { - const sleep = async (seconds: number) => { - this.logger.debug(`Sleeping ${seconds}s for migration ID:${migrationId}`); - await Promise.race([ - new Promise((resolve) => setTimeout(resolve, seconds * 1000)), - abortPromise.promise, - ]); + this.logger.debug(`Creating agent for migration ID:${migrationId}`); + const agent = await withAbortRace(this.createAgent({ ...params, abortController })); + + const config: RunnableConfig = { + ...invocationConfig, + // signal: abortController.signal, // not working properly https://github.com/langchain-ai/langgraphjs/issues/319 }; let isDone: boolean = false; @@ -154,10 +111,12 @@ export class RuleMigrationsTaskClient { try { const start = Date.now(); - const migrationResult: MigrateRuleState = await Promise.race([ - agent.invoke({ original_rule: ruleMigration.original_rule }, config), - abortPromise.promise, // workaround for the issue with the langGraph signal - ]); + const invocation = agent.invoke( + { original_rule: ruleMigration.original_rule }, + config + ); + // using withAbortRace is a workaround for the issue with the langGraph signal not working properly + const migrationResult = await withAbortRace(invocation); const duration = (Date.now() - start) / 1000; this.logger.debug( @@ -211,6 +170,38 @@ export class RuleMigrationsTaskClient { } } + private async createAgent({ + migrationId, + connectorId, + inferenceClient, + actionsClient, + rulesClient, + soClient, + abortController, + }: RuleMigrationTaskCreateAgentParams): Promise { + const actionsClientChat = new ActionsClientChat(connectorId, actionsClient, this.logger); + const model = await actionsClientChat.createModel({ + signal: abortController.signal, + temperature: 0.05, + }); + + const ruleMigrationsRetriever = new RuleMigrationsRetriever(migrationId, { + data: this.data, + rules: rulesClient, + savedObjects: soClient, + }); + await ruleMigrationsRetriever.initialize(); + + const agent = getRuleMigrationAgent({ + connectorId, + model, + inferenceClient, + ruleMigrationsRetriever, + logger: this.logger, + }); + return agent; + } + /** Updates all the rules in a migration to be re-executed */ public async updateToRetry(migrationId: string): Promise<{ updated: boolean }> { if (this.migrationsRunning.has(migrationId)) { diff --git a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts index 7ac7e848ba80..7ddb08f1e47d 100644 --- a/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts +++ b/x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/types.ts @@ -30,20 +30,7 @@ export interface RuleMigrationTaskStartParams { soClient: SavedObjectsClientContract; } -export interface RuleMigrationTaskPrepareParams { - migrationId: string; - connectorId: string; - inferenceClient: InferenceClient; - actionsClient: ActionsClient; - rulesClient: RulesClient; - soClient: SavedObjectsClientContract; - abortController: AbortController; -} - -export interface RuleMigrationTaskRunParams { - migrationId: string; - invocationConfig: RunnableConfig; - agent: MigrationAgent; +export interface RuleMigrationTaskCreateAgentParams extends RuleMigrationTaskStartParams { abortController: AbortController; } diff --git a/x-pack/plugins/security_solution/server/plugin.ts b/x-pack/plugins/security_solution/server/plugin.ts index 28666df8c42b..03512d9cbda0 100644 --- a/x-pack/plugins/security_solution/server/plugin.ts +++ b/x-pack/plugins/security_solution/server/plugin.ts @@ -281,6 +281,7 @@ export class Plugin implements ISecuritySolutionPlugin { all: allRiskScoreIndexPattern, latest: latestRiskScoreIndexPattern, }, + legacySignalsIndex: config.signalsIndex, }); this.telemetryUsageCounter = plugins.usageCollection?.createUsageCounter(APP_ID); diff --git a/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts b/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts index cdea82d68069..4e950a4202c6 100644 --- a/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts +++ b/x-pack/plugins/security_solution/server/search_strategy/endpoint_fields/index.ts @@ -25,7 +25,7 @@ import { EndpointAuthorizationError } from '../../endpoint/errors'; import { parseRequest } from './parse_request'; /** - * EndpointFieldProvider mimics indexField provider from timeline plugin: x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts + * EndpointFieldProvider mimics indexField provider from timeline plugin: x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts * but it uses ES internalUser instead to avoid adding extra index privileges for users with event filters permissions. * It is used to retrieve index patterns for event filters form. */ diff --git a/x-pack/plugins/security_solution/server/usage/collector.ts b/x-pack/plugins/security_solution/server/usage/collector.ts index ca016d07d509..aa507cd683db 100644 --- a/x-pack/plugins/security_solution/server/usage/collector.ts +++ b/x-pack/plugins/security_solution/server/usage/collector.ts @@ -32,6 +32,7 @@ export const registerCollector: RegisterCollector = ({ usageCollection, logger, riskEngineIndexPatterns, + legacySignalsIndex, }) => { if (!usageCollection) { logger.debug('Usage collection is undefined, therefore returning early without registering it'); @@ -3076,6 +3077,21 @@ export const registerCollector: RegisterCollector = ({ }, }, }, + legacy_siem_signals: { + non_migrated_indices_total: { + type: 'long', + _meta: { + description: 'Total number of non migrated legacy siem signals indices', + }, + }, + spaces_total: { + type: 'long', + _meta: { + description: + 'Total number of Kibana spaces that have non migrated legacy siem signals indices', + }, + }, + }, }, endpointMetrics: { unique_endpoint_count: { @@ -3130,6 +3146,7 @@ export const registerCollector: RegisterCollector = ({ savedObjectsClient, logger, mlClient: ml, + legacySignalsIndex, }), getEndpointMetrics({ esClient, logger }), getDashboardMetrics({ diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts b/x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts index 6252b865c0ec..538ea2509c46 100644 --- a/x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts +++ b/x-pack/plugins/security_solution/server/usage/detections/get_initial_usage.ts @@ -9,6 +9,8 @@ import type { DetectionMetrics } from './types'; import { getInitialMlJobUsage } from './ml_jobs/get_initial_usage'; import { getInitialEventLogUsage, getInitialRulesUsage } from './rules/get_initial_usage'; +// eslint-disable-next-line no-restricted-imports +import { getInitialLegacySiemSignalsUsage } from './legacy_siem_signals/get_initial_usage'; /** * Initial detection metrics initialized. @@ -23,4 +25,5 @@ export const getInitialDetectionMetrics = (): DetectionMetrics => ({ detection_rule_usage: getInitialRulesUsage(), detection_rule_status: getInitialEventLogUsage(), }, + legacy_siem_signals: getInitialLegacySiemSignalsUsage(), }); diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts b/x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts index be5044fbb4e2..cb5006799a1c 100644 --- a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts +++ b/x-pack/plugins/security_solution/server/usage/detections/get_metrics.test.ts @@ -57,6 +57,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual(getInitialDetectionMetrics()); }); @@ -79,6 +80,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual({ @@ -154,6 +156,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual({ @@ -210,6 +213,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual({ @@ -290,6 +294,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual(getInitialDetectionMetrics()); }); @@ -329,6 +334,7 @@ describe('Detections Usage and Metrics', () => { savedObjectsClient, logger, mlClient, + legacySignalsIndex: '', }); expect(result).toEqual( diff --git a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts b/x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts index 904c80debf5d..61badd153c65 100644 --- a/x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts +++ b/x-pack/plugins/security_solution/server/usage/detections/get_metrics.ts @@ -13,6 +13,10 @@ import { getMlJobMetrics } from './ml_jobs/get_metrics'; import { getRuleMetrics } from './rules/get_metrics'; import { getInitialEventLogUsage, getInitialRulesUsage } from './rules/get_initial_usage'; import { getInitialMlJobUsage } from './ml_jobs/get_initial_usage'; +// eslint-disable-next-line no-restricted-imports +import { getInitialLegacySiemSignalsUsage } from './legacy_siem_signals/get_initial_usage'; +// eslint-disable-next-line no-restricted-imports +import { getLegacySiemSignalsUsage } from './legacy_siem_signals/get_legacy_siem_signals_metrics'; export interface GetDetectionsMetricsOptions { signalsIndex: string; @@ -21,6 +25,7 @@ export interface GetDetectionsMetricsOptions { logger: Logger; mlClient: MlPluginSetup | undefined; eventLogIndex: string; + legacySignalsIndex: string; } export const getDetectionsMetrics = async ({ @@ -30,10 +35,12 @@ export const getDetectionsMetrics = async ({ savedObjectsClient, logger, mlClient, + legacySignalsIndex, }: GetDetectionsMetricsOptions): Promise => { - const [mlJobMetrics, detectionRuleMetrics] = await Promise.allSettled([ + const [mlJobMetrics, detectionRuleMetrics, legacySiemSignalsUsage] = await Promise.allSettled([ getMlJobMetrics({ mlClient, savedObjectsClient, logger }), getRuleMetrics({ signalsIndex, eventLogIndex, esClient, savedObjectsClient, logger }), + getLegacySiemSignalsUsage({ signalsIndex: legacySignalsIndex, esClient, logger }), ]); return { @@ -49,5 +56,9 @@ export const getDetectionsMetrics = async ({ detection_rule_usage: getInitialRulesUsage(), detection_rule_status: getInitialEventLogUsage(), }, + legacy_siem_signals: + legacySiemSignalsUsage.status === 'fulfilled' + ? legacySiemSignalsUsage.value + : getInitialLegacySiemSignalsUsage(), }; }; diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.ts new file mode 100644 index 000000000000..df222f975049 --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_initial_usage.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. + */ + +import type { LegacySiemSignals } from './types'; + +export const getInitialLegacySiemSignalsUsage = (): LegacySiemSignals => ({ + non_migrated_indices_total: 0, + spaces_total: 0, +}); diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.ts new file mode 100644 index 000000000000..a6d2b8bf06af --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/get_legacy_siem_signals_metrics.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 type { ElasticsearchClient, Logger } from '@kbn/core/server'; +import { getNonMigratedSignalsInfo } from '../../../lib/detection_engine/migrations/get_non_migrated_signals_info'; +import type { LegacySiemSignals } from './types'; + +export interface GetLegacySiemSignalsUsageOptions { + signalsIndex: string; + esClient: ElasticsearchClient; + logger: Logger; +} + +export const getLegacySiemSignalsUsage = async ({ + signalsIndex, + esClient, + logger, +}: GetLegacySiemSignalsUsageOptions): Promise => { + const { indices, spaces } = await getNonMigratedSignalsInfo({ + esClient, + signalsIndex, + logger, + }); + + return { + non_migrated_indices_total: indices.length, + spaces_total: spaces.length, + }; +}; diff --git a/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.ts new file mode 100644 index 000000000000..b4351b2e7808 --- /dev/null +++ b/x-pack/plugins/security_solution/server/usage/detections/legacy_siem_signals/types.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 interface LegacySiemSignals { + non_migrated_indices_total: number; + spaces_total: number; +} diff --git a/x-pack/plugins/security_solution/server/usage/detections/types.ts b/x-pack/plugins/security_solution/server/usage/detections/types.ts index 2895e5c6f8b9..3edbd028b632 100644 --- a/x-pack/plugins/security_solution/server/usage/detections/types.ts +++ b/x-pack/plugins/security_solution/server/usage/detections/types.ts @@ -7,8 +7,11 @@ import type { MlJobUsageMetric } from './ml_jobs/types'; import type { RuleAdoption } from './rules/types'; +// eslint-disable-next-line no-restricted-imports +import type { LegacySiemSignals } from './legacy_siem_signals/types'; export interface DetectionMetrics { ml_jobs: MlJobUsageMetric; detection_rules: RuleAdoption; + legacy_siem_signals: LegacySiemSignals; } diff --git a/x-pack/plugins/security_solution/server/usage/types.ts b/x-pack/plugins/security_solution/server/usage/types.ts index 1df8f2d1388a..fdaaac663ad4 100644 --- a/x-pack/plugins/security_solution/server/usage/types.ts +++ b/x-pack/plugins/security_solution/server/usage/types.ts @@ -33,6 +33,7 @@ export type CollectorDependencies = { all: string; latest: string; }; + legacySignalsIndex: string; } & Pick; export interface AlertBucket { diff --git a/x-pack/plugins/serverless/public/navigation/index.tsx b/x-pack/plugins/serverless/public/navigation/index.tsx index 2ff6e27c664f..c7862d80eef1 100644 --- a/x-pack/plugins/serverless/public/navigation/index.tsx +++ b/x-pack/plugins/serverless/public/navigation/index.tsx @@ -6,32 +6,34 @@ */ import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import React, { Suspense, type FC } from 'react'; -import { EuiSkeletonRectangle } from '@elastic/eui'; +import { EuiSkeletonRectangle, useEuiTheme } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import type { Props as NavigationProps } from './navigation'; const SideNavComponentLazy = React.lazy(() => import('./navigation')); -export const SideNavComponent: FC = (props) => ( - - } - > - - -); +export const SideNavComponent: FC = (props) => { + const { euiTheme } = useEuiTheme(); + return ( + + } + > + + + ); +}; export { manageOrgMembersNavCardName, generateManageOrgMembersNavCard } from './nav_cards'; diff --git a/x-pack/plugins/serverless/tsconfig.json b/x-pack/plugins/serverless/tsconfig.json index 35cc5e554ceb..ce60d39bef0f 100644 --- a/x-pack/plugins/serverless/tsconfig.json +++ b/x-pack/plugins/serverless/tsconfig.json @@ -28,6 +28,5 @@ "@kbn/management-cards-navigation", "@kbn/react-kibana-mount", "@kbn/react-kibana-context-render", - "@kbn/ui-theme", ] } diff --git a/x-pack/plugins/serverless_observability/package.json b/x-pack/plugins/serverless_observability/package.json deleted file mode 100644 index 64b310d7eaba..000000000000 --- a/x-pack/plugins/serverless_observability/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "@kbn/serverless-observability", - "version": "1.0.0", - "license": "Elastic License 2.0", - "private": true, - "scripts": { - "build": "yarn plugin-helpers build", - "plugin-helpers": "node ../../../scripts/plugin_helpers", - "kbn": "node ../../../scripts/kbn" - } -} \ No newline at end of file diff --git a/x-pack/plugins/serverless_observability/tsconfig.json b/x-pack/plugins/serverless_observability/tsconfig.json deleted file mode 100644 index 5aa97143107a..000000000000 --- a/x-pack/plugins/serverless_observability/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "index.ts", - "common/**/*.ts", - "public/**/*.ts", - "public/**/*.tsx", - "server/**/*.ts", - "../../../typings/**/*" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/config-schema", - "@kbn/management-plugin", - "@kbn/serverless", - "@kbn/observability-shared-plugin", - "@kbn/i18n", - "@kbn/management-cards-navigation", - "@kbn/data-plugin", - "@kbn/observability-plugin", - "@kbn/io-ts-utils", - "@kbn/serverless-observability-settings", - "@kbn/core-chrome-browser", - "@kbn/discover-plugin", - "@kbn/security-plugin", - "@kbn/search-types", - "@kbn/streams-plugin", - ] -} diff --git a/x-pack/plugins/serverless_search/kibana.jsonc b/x-pack/plugins/serverless_search/kibana.jsonc index cae0a693846f..8b1609c5f126 100644 --- a/x-pack/plugins/serverless_search/kibana.jsonc +++ b/x-pack/plugins/serverless_search/kibana.jsonc @@ -38,6 +38,8 @@ "searchPlayground", "usageCollection" ], - "requiredBundles": ["kibanaReact"] + "requiredBundles": [ + "kibanaReact" + ] } } diff --git a/x-pack/plugins/spaces/public/config.ts b/x-pack/plugins/spaces/public/config.ts index 3dd2d3bc89f9..dcd203eb696e 100644 --- a/x-pack/plugins/spaces/public/config.ts +++ b/x-pack/plugins/spaces/public/config.ts @@ -9,7 +9,4 @@ export interface ConfigType { maxSpaces: number; allowFeatureVisibility: boolean; allowSolutionVisibility: boolean; - experimental: { - forceSolutionVisibility: boolean; - }; } diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx index bcd7ef069e0c..ce28fd05516f 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_status_summary_indicator.tsx @@ -138,7 +138,7 @@ export const CopyStatusSummaryIndicator = (props: Props) => { return ( {renderIcon(props)} - + {summarizedCopyResult.objects.length} diff --git a/x-pack/plugins/spaces/public/management/management_service.test.ts b/x-pack/plugins/spaces/public/management/management_service.test.ts index c89801953acd..9aeddb8a6646 100644 --- a/x-pack/plugins/spaces/public/management/management_service.test.ts +++ b/x-pack/plugins/spaces/public/management/management_service.test.ts @@ -27,9 +27,6 @@ describe('ManagementService', () => { maxSpaces: 1000, allowFeatureVisibility: true, allowSolutionVisibility: true, - experimental: { - forceSolutionVisibility: false, - }, }; describe('#setup', () => { diff --git a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx index d721ff79600c..ff5a70976590 100644 --- a/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx +++ b/x-pack/plugins/spaces/public/management/spaces_management_app.test.tsx @@ -45,9 +45,6 @@ const config: ConfigType = { maxSpaces: 1000, allowFeatureVisibility: true, allowSolutionVisibility: true, - experimental: { - forceSolutionVisibility: false, - }, }; const eventTracker = new EventTracker({ reportEvent: jest.fn() }); diff --git a/x-pack/plugins/spaces/public/nav_control/solution_view_tour/solution_view_tour.tsx b/x-pack/plugins/spaces/public/nav_control/solution_view_tour/solution_view_tour.tsx index eda87809c66b..dc4f77a3b3e0 100644 --- a/x-pack/plugins/spaces/public/nav_control/solution_view_tour/solution_view_tour.tsx +++ b/x-pack/plugins/spaces/public/nav_control/solution_view_tour/solution_view_tour.tsx @@ -72,6 +72,7 @@ export const SolutionViewTour: FC = ({ children, solution, isTourOpen, on onFinish={onFinishTour} step={1} stepsTotal={1} + repositionOnScroll title={i18n.translate('xpack.spaces.navControl.tour.title', { defaultMessage: 'You chose the {solution} solution view', values: { solution: solutionLabel }, diff --git a/x-pack/plugins/spaces/public/plugin.test.ts b/x-pack/plugins/spaces/public/plugin.test.ts index 33565748a99e..40d6d7b39aa7 100644 --- a/x-pack/plugins/spaces/public/plugin.test.ts +++ b/x-pack/plugins/spaces/public/plugin.test.ts @@ -5,7 +5,6 @@ * 2.0. */ -import { cloudMock } from '@kbn/cloud-plugin/public/mocks'; import { coreMock } from '@kbn/core/public/mocks'; import { homePluginMock } from '@kbn/home-plugin/public/mocks'; import { @@ -20,7 +19,7 @@ describe('Spaces plugin', () => { it('should register the space selector app when buildFlavor is traditional', () => { const coreSetup = coreMock.createSetup(); const mockInitializerContext = coreMock.createPluginInitializerContext( - {}, + { allowSolutionVisibility: true }, { buildFlavor: 'traditional' } ); @@ -40,7 +39,7 @@ describe('Spaces plugin', () => { it('should not register the space selector app when buildFlavor is serverless and maxSpaces is 1', () => { const coreSetup = coreMock.createSetup(); const mockInitializerContext = coreMock.createPluginInitializerContext( - { maxSpaces: 1 }, + { maxSpaces: 1, allowSolutionVisibility: true }, { buildFlavor: 'serverless' } ); @@ -60,7 +59,7 @@ describe('Spaces plugin', () => { it('should register the space selector app when buildFlavor is serverless and and maxSpaces is >1', () => { const coreSetup = coreMock.createSetup(); const mockInitializerContext = coreMock.createPluginInitializerContext( - { maxSpaces: 2 }, + { maxSpaces: 2, allowSolutionVisibility: true }, { buildFlavor: 'serverless' } ); @@ -88,7 +87,7 @@ describe('Spaces plugin', () => { management.sections.section.kibana = mockSection; const mockInitializerContext = coreMock.createPluginInitializerContext( - {}, + { allowSolutionVisibility: true }, { buildFlavor: 'traditional' } ); @@ -122,7 +121,9 @@ describe('Spaces plugin', () => { management.sections.section.kibana = mockSection; - const plugin = new SpacesPlugin(coreMock.createPluginInitializerContext({ maxSpaces: 1 })); + const plugin = new SpacesPlugin( + coreMock.createPluginInitializerContext({ maxSpaces: 1, allowSolutionVisibility: true }) + ); plugin.setup(coreSetup, { management, home, @@ -152,7 +153,9 @@ describe('Spaces plugin', () => { management.sections.section.kibana = mockSection; - const plugin = new SpacesPlugin(coreMock.createPluginInitializerContext({ maxSpaces: 2 })); + const plugin = new SpacesPlugin( + coreMock.createPluginInitializerContext({ maxSpaces: 2, allowSolutionVisibility: true }) + ); plugin.setup(coreSetup, { management, home, @@ -179,7 +182,7 @@ describe('Spaces plugin', () => { const coreStart = coreMock.createStart(); const mockInitializerContext = coreMock.createPluginInitializerContext( - {}, + { allowSolutionVisibility: true }, { buildFlavor: 'traditional' } ); @@ -196,7 +199,7 @@ describe('Spaces plugin', () => { const coreStart = coreMock.createStart(); const mockInitializerContext = coreMock.createPluginInitializerContext( - { maxSpaces: 1 }, + { maxSpaces: 1, allowSolutionVisibility: true }, { buildFlavor: 'serverless' } ); @@ -214,7 +217,9 @@ describe('Spaces plugin', () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); - const plugin = new SpacesPlugin(coreMock.createPluginInitializerContext({ maxSpaces: 1 })); + const plugin = new SpacesPlugin( + coreMock.createPluginInitializerContext({ maxSpaces: 1, allowSolutionVisibility: true }) + ); const spacesSetup = plugin.setup(coreSetup, {}); const spacesStart = plugin.start(coreStart); @@ -226,7 +231,9 @@ describe('Spaces plugin', () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); - const plugin = new SpacesPlugin(coreMock.createPluginInitializerContext({ maxSpaces: 1000 })); + const plugin = new SpacesPlugin( + coreMock.createPluginInitializerContext({ maxSpaces: 1000, allowSolutionVisibility: true }) + ); const spacesSetup = plugin.setup(coreSetup, {}); const spacesStart = plugin.start(coreStart); @@ -236,129 +243,45 @@ describe('Spaces plugin', () => { }); describe('isSolutionViewEnabled', () => { - it('when onCloud, not serverless and allowSolutionVisibility is "true"', () => { + it('when allowSolutionVisibility is "true"', () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); - const cloud = cloudMock.createSetup(); - cloud.isCloudEnabled = true; const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: true }, - { buildFlavor: 'traditional' } - ) + coreMock.createPluginInitializerContext({ allowSolutionVisibility: true }) ); - const spacesSetup = plugin.setup(coreSetup, { cloud }); + const spacesSetup = plugin.setup(coreSetup, {}); const spacesStart = plugin.start(coreStart); expect(spacesSetup.isSolutionViewEnabled).toBe(true); expect(spacesStart.isSolutionViewEnabled).toBe(true); }); - it('when not onCloud and allowSolutionVisibility is "true"', () => { + it('when allowSolutionVisibility is "false"', () => { const coreSetup = coreMock.createSetup(); const coreStart = coreMock.createStart(); { const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: true }, // it is true but we are not onCloud - { buildFlavor: 'traditional' } - ) + coreMock.createPluginInitializerContext({ allowSolutionVisibility: false }) ); const spacesSetup = plugin.setup(coreSetup, {}); const spacesStart = plugin.start(coreStart); - expect(spacesSetup.isSolutionViewEnabled).toBe(false); // so it should be false - expect(spacesStart.isSolutionViewEnabled).toBe(false); - } - - { - // unless the forceSolutionVisibility flag is set - const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: false, experimental: { forceSolutionVisibility: true } }, - { buildFlavor: 'traditional' } - ) - ); - const spacesSetup = plugin.setup(coreSetup, {}); // we are not onCloud but forceSolutionVisibility is true - const spacesStart = plugin.start(coreStart); - - expect(spacesSetup.isSolutionViewEnabled).toBe(true); - expect(spacesStart.isSolutionViewEnabled).toBe(true); - } - }); - - it('when onCloud, not serverless and allowSolutionVisibility is "false"', () => { - const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const cloud = cloudMock.createSetup(); - cloud.isCloudEnabled = true; - - { - const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: false }, - { buildFlavor: 'traditional' } - ) - ); - const spacesSetup = plugin.setup(coreSetup, { cloud }); - const spacesStart = plugin.start(coreStart); - expect(spacesSetup.isSolutionViewEnabled).toBe(false); expect(spacesStart.isSolutionViewEnabled).toBe(false); } - - { - // unless the forceSolutionVisibility flag is set - const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: false, experimental: { forceSolutionVisibility: true } }, - { buildFlavor: 'traditional' } - ) - ); - const spacesSetup = plugin.setup(coreSetup, { cloud }); - const spacesStart = plugin.start(coreStart); - - expect(spacesSetup.isSolutionViewEnabled).toBe(true); - expect(spacesStart.isSolutionViewEnabled).toBe(true); - } }); - it('when onCloud and serverless', () => { + it('when allowSolutionVisibility is "undefined"', () => { const coreSetup = coreMock.createSetup(); - const coreStart = coreMock.createStart(); - const cloud = cloudMock.createSetup(); - cloud.isCloudEnabled = true; - - { - const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: true }, - { buildFlavor: 'serverless' } - ) - ); - const spacesSetup = plugin.setup(coreSetup, { cloud }); - const spacesStart = plugin.start(coreStart); - expect(spacesSetup.isSolutionViewEnabled).toBe(false); - expect(spacesStart.isSolutionViewEnabled).toBe(false); - } - - { - // unless the forceSolutionVisibility flag is set - const plugin = new SpacesPlugin( - coreMock.createPluginInitializerContext( - { allowSolutionVisibility: true, experimental: { forceSolutionVisibility: true } }, - { buildFlavor: 'serverless' } - ) - ); - const spacesSetup = plugin.setup(coreSetup, { cloud }); - const spacesStart = plugin.start(coreStart); - - expect(spacesSetup.isSolutionViewEnabled).toBe(true); - expect(spacesStart.isSolutionViewEnabled).toBe(true); - } + const plugin = new SpacesPlugin( + coreMock.createPluginInitializerContext({ allowSolutionVisibility: undefined }) + ); + expect(() => plugin.setup(coreSetup, {})).toThrowErrorMatchingInlineSnapshot( + `"allowSolutionVisibility has not been set in the Spaces plugin config."` + ); }); }); }); diff --git a/x-pack/plugins/spaces/public/plugin.tsx b/x-pack/plugins/spaces/public/plugin.tsx index 18083924200d..c3583204a7bb 100644 --- a/x-pack/plugins/spaces/public/plugin.tsx +++ b/x-pack/plugins/spaces/public/plugin.tsx @@ -59,14 +59,11 @@ export class SpacesPlugin implements Plugin, plugins: PluginsSetup) { - const hasOnlyDefaultSpace = this.config.maxSpaces === 1; - const onCloud = plugins.cloud !== undefined && plugins.cloud.isCloudEnabled; + if (this.config.allowSolutionVisibility === undefined) { + throw new Error('allowSolutionVisibility has not been set in the Spaces plugin config.'); + } - // We only allow "solution" to be set on cloud environments, not on prem - // unless the forceSolutionVisibility flag is set - const allowSolutionVisibility = - (onCloud && !this.isServerless && this.config.allowSolutionVisibility) || - Boolean(this.config.experimental?.forceSolutionVisibility); + const hasOnlyDefaultSpace = this.config.maxSpaces === 1; this.spacesManager = new SpacesManager(core.http); this.spacesApi = { @@ -77,12 +74,7 @@ export class SpacesPlugin implements Plugin this.spacesManager.onActiveSpaceChange$, getActiveSpace: () => this.spacesManager.getActiveSpace(), hasOnlyDefaultSpace, - isSolutionViewEnabled: allowSolutionVisibility, - }; - - this.config = { - ...this.config, - allowSolutionVisibility, + isSolutionViewEnabled: this.config.allowSolutionVisibility, }; registerSpacesEventTypes(core); @@ -167,7 +159,7 @@ export class SpacesPlugin implements Plugin { const { spacesDataPromise } = useSpaces(); + const { euiTheme } = useEuiTheme(); const [isExpanded, setIsExpanded] = useState(false); const [shareToSpacesData, setShareToSpacesData] = useState(); @@ -76,7 +78,7 @@ export const SpaceListInternal = ({ defaultMessage: `* All spaces`, }), initials: '*', - color: '#D3DAE6', + color: euiTheme.colors.vis.euiColorVisGrey0, }, ]; } else { @@ -145,7 +147,7 @@ export const SpaceListInternal = ({ /> } > - +{unauthorizedSpacesCount} + +{unauthorizedSpacesCount} ) : null; diff --git a/x-pack/plugins/spaces/server/index.ts b/x-pack/plugins/spaces/server/index.ts index 297a99a525ec..a568f52c7c29 100644 --- a/x-pack/plugins/spaces/server/index.ts +++ b/x-pack/plugins/spaces/server/index.ts @@ -34,9 +34,6 @@ export const config: PluginConfigDescriptor = { maxSpaces: true, allowFeatureVisibility: true, allowSolutionVisibility: true, - experimental: { - forceSolutionVisibility: true, - }, }, }; diff --git a/x-pack/plugins/spaces/server/plugin.test.ts b/x-pack/plugins/spaces/server/plugin.test.ts index 40aaf7044a4e..cb2cee96a34e 100644 --- a/x-pack/plugins/spaces/server/plugin.test.ts +++ b/x-pack/plugins/spaces/server/plugin.test.ts @@ -36,10 +36,7 @@ describe('Spaces plugin', () => { "hasOnlyDefaultSpace$": Observable { "operator": [Function], "source": Observable { - "operator": [Function], - "source": Observable { - "_subscribe": [Function], - }, + "_subscribe": [Function], }, }, "spacesClient": Object { @@ -123,10 +120,7 @@ describe('Spaces plugin', () => { "hasOnlyDefaultSpace$": Observable { "operator": [Function], "source": Observable { - "operator": [Function], - "source": Observable { - "_subscribe": [Function], - }, + "_subscribe": [Function], }, }, "spacesService": Object { diff --git a/x-pack/plugins/spaces/server/plugin.ts b/x-pack/plugins/spaces/server/plugin.ts index e36a6fb3cc7f..e1c3c78976ec 100644 --- a/x-pack/plugins/spaces/server/plugin.ts +++ b/x-pack/plugins/spaces/server/plugin.ts @@ -6,7 +6,7 @@ */ import type { Observable } from 'rxjs'; -import { BehaviorSubject, combineLatest, map } from 'rxjs'; +import { map } from 'rxjs'; import type { CloudSetup } from '@kbn/cloud-plugin/server'; import type { @@ -120,24 +120,8 @@ export class SpacesPlugin private defaultSpaceService?: DefaultSpaceService; - private onCloud$ = new BehaviorSubject(false); - constructor(private readonly initializerContext: PluginInitializerContext) { - this.config$ = combineLatest([ - initializerContext.config.create(), - this.onCloud$, - ]).pipe( - map( - ([config, onCloud]): ConfigType => ({ - ...config, - // We only allow "solution" to be set on cloud environments, not on prem - // unless the forceSolutionVisibility flag is set. - allowSolutionVisibility: - (onCloud && config.allowSolutionVisibility) || - Boolean(config.experimental?.forceSolutionVisibility), - }) - ) - ); + this.config$ = initializerContext.config.create(); this.hasOnlyDefaultSpace$ = this.config$.pipe(map(({ maxSpaces }) => maxSpaces === 1)); this.log = initializerContext.logger.get(); this.spacesService = new SpacesService(); @@ -148,7 +132,6 @@ export class SpacesPlugin } public setup(core: CoreSetup, plugins: PluginsSetup): SpacesPluginSetup { - this.onCloud$.next(plugins.cloud !== undefined && plugins.cloud.isCloudEnabled); const spacesClientSetup = this.spacesClientService.setup({ config$: this.config$ }); core.uiSettings.registerGlobal(getUiSettings()); diff --git a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx index cfa6cde15ee5..adee5b4bc2bc 100644 --- a/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx +++ b/x-pack/plugins/stack_alerts/public/rule_types/es_query/expression/esql_query_expression.tsx @@ -27,7 +27,6 @@ import { getTimeOptions, parseAggregationResults, } from '@kbn/triggers-actions-ui-plugin/public/common'; -import { DataView } from '@kbn/data-views-plugin/common'; import { EsQueryRuleParams, EsQueryRuleMetaData, SearchType } from '../types'; import { DEFAULT_VALUES, SERVERLESS_DEFAULT_VALUES } from '../constants'; import { useTriggerUiActionServices } from '../util'; @@ -38,7 +37,7 @@ import { rowToDocument, toEsQueryHits, transformDatatableToEsqlTable } from '../ export const EsqlQueryExpression: React.FC< RuleTypeParamsExpressionProps, EsQueryRuleMetaData> > = ({ ruleParams, setRuleParams, setRuleProperty, errors }) => { - const { expressions, http, fieldFormats, isServerless, dataViews } = useTriggerUiActionServices(); + const { expressions, http, isServerless, dataViews } = useTriggerUiActionServices(); const { esqlQuery, timeWindowSize, timeWindowUnit, timeField } = ruleParams; const [currentRuleParams, setCurrentRuleParams] = useState< @@ -116,10 +115,7 @@ export const EsqlQueryExpression: React.FC< }, undefined, // create a data view with the timefield to pass into the query - new DataView({ - spec: { timeFieldName: timeField }, - fieldFormats, - }) + timeField ); if (table) { const esqlTable = transformDatatableToEsqlTable(table); @@ -154,7 +150,6 @@ export const EsqlQueryExpression: React.FC< currentRuleParams, esqlQuery, expressions, - fieldFormats, timeField, isServerless, ]); diff --git a/x-pack/plugins/stack_connectors/common/crowdstrike/constants.ts b/x-pack/plugins/stack_connectors/common/crowdstrike/constants.ts index c5186edf4a37..a75f379ce471 100644 --- a/x-pack/plugins/stack_connectors/common/crowdstrike/constants.ts +++ b/x-pack/plugins/stack_connectors/common/crowdstrike/constants.ts @@ -14,4 +14,7 @@ export enum SUB_ACTION { HOST_ACTIONS = 'hostActions', GET_AGENT_ONLINE_STATUS = 'getAgentOnlineStatus', EXECUTE_RTR_COMMAND = 'executeRTRCommand', + EXECUTE_ACTIVE_RESPONDER_RTR = 'batchActiveResponderExecuteRTR', + EXECUTE_ADMIN_RTR = 'batchAdminExecuteRTR', + GET_RTR_CLOUD_SCRIPTS = 'getRTRCloudScripts', } diff --git a/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts b/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts index d5e8cd693af9..d5d4154f985e 100644 --- a/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts +++ b/x-pack/plugins/stack_connectors/common/crowdstrike/schema.ts @@ -17,6 +17,8 @@ export const CrowdstrikeSecretsSchema = schema.object({ clientSecret: schema.string(), }); +export const CrowdstrikeApiDoNotValidateResponsesSchema = schema.any(); + export const RelaxedCrowdstrikeBaseApiResponseSchema = schema.maybe( schema.object({}, { unknowns: 'allow' }) ); @@ -307,3 +309,46 @@ export const CrowdstrikeInitRTRResponseSchema = schema.object( export const CrowdstrikeInitRTRParamsSchema = schema.object({ endpoint_ids: schema.arrayOf(schema.string()), }); + +export const CrowdstrikeExecuteRTRResponseSchema = schema.object( + { + combined: schema.object( + { + resources: schema.recordOf( + schema.string(), + schema.object( + { + session_id: schema.maybe(schema.string()), + task_id: schema.maybe(schema.string()), + complete: schema.maybe(schema.boolean()), + stdout: schema.maybe(schema.string()), + stderr: schema.maybe(schema.string()), + base_command: schema.maybe(schema.string()), + aid: schema.maybe(schema.string()), + errors: schema.maybe(schema.arrayOf(schema.any())), + query_time: schema.maybe(schema.number()), + offline_queued: schema.maybe(schema.boolean()), + }, + { unknowns: 'allow' } + ) + ), + }, + { unknowns: 'allow' } + ), + meta: schema.object( + { + query_time: schema.maybe(schema.number()), + powered_by: schema.maybe(schema.string()), + trace_id: schema.maybe(schema.string()), + }, + { unknowns: 'allow' } + ), + errors: schema.nullable(schema.arrayOf(schema.any())), + }, + { unknowns: 'allow' } +); + +export type CrowdStrikeExecuteRTRResponse = typeof CrowdstrikeExecuteRTRResponseSchema; + +// TODO: will be part of a next PR +export const CrowdstrikeGetScriptsParamsSchema = schema.any({}); diff --git a/x-pack/plugins/stack_connectors/common/sentinelone/schema.ts b/x-pack/plugins/stack_connectors/common/sentinelone/schema.ts index 7daf615e01d3..7a20df3ef45a 100644 --- a/x-pack/plugins/stack_connectors/common/sentinelone/schema.ts +++ b/x-pack/plugins/stack_connectors/common/sentinelone/schema.ts @@ -16,6 +16,8 @@ export const SentinelOneSecretsSchema = schema.object({ token: schema.string(), }); +export const SentinelOneApiDoNotValidateResponsesSchema = schema.any(); + export const SentinelOneBaseApiResponseSchema = schema.maybe( schema.object({}, { unknowns: 'allow' }) ); diff --git a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.test.ts b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.test.ts index eec431d8a4dc..815e22de5259 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.test.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.test.ts @@ -345,70 +345,185 @@ describe('CrowdstrikeConnector', () => { expect(mockedRequest).toHaveBeenCalledTimes(3); }); }); - describe('batchInitRTRSession', () => { + describe('executeRTRCommand', () => { it('should make a POST request to the correct URL with correct data', async () => { - const mockResponse = { data: { batch_id: 'testBatchId' } }; + const mockResponse = { data: obfuscatedRTRResponse }; + mockedRequest.mockResolvedValueOnce({ data: { access_token: 'testToken' } }); - mockedRequest.mockResolvedValueOnce(mockResponse); + mockedRequest.mockResolvedValue(mockResponse); - await connector.batchInitRTRSession( - { endpoint_ids: ['id1', 'id2'] }, + const result = await connector.executeRTRCommand( + { + command: 'runscript -Raw', + endpoint_ids: ['id1', 'id2'], + }, + connectorUsageCollector + ); + + expect(mockedRequest).toHaveBeenNthCalledWith( + 3, + expect.objectContaining({ + url: 'https://api.crowdstrike.com/real-time-response/combined/batch-command/v1', + method: 'post', + data: expect.objectContaining({ + command_string: 'runscript -Raw', + hosts: ['id1', 'id2'], + }), + }), + connectorUsageCollector + ); + + expect(result).toEqual(obfuscatedRTRResponse); + }); + }); + + describe('batchActiveResponderExecuteRTR', () => { + it('should make a POST request to the correct URL with correct data', async () => { + const mockResponse = { data: obfuscatedRTRResponse }; + + mockedRequest.mockResolvedValueOnce({ data: { access_token: 'testToken' } }); + mockedRequest.mockResolvedValue(mockResponse); + + const result = await connector.batchActiveResponderExecuteRTR( + { + command: 'runscript', + endpoint_ids: ['id1', 'id2'], + }, connectorUsageCollector ); expect(mockedRequest).toHaveBeenNthCalledWith( 1, expect.objectContaining({ - headers: { - accept: 'application/json', - 'Content-Type': 'application/x-www-form-urlencoded', - authorization: expect.any(String), - }, + url: 'https://api.crowdstrike.com/oauth2/token', method: 'post', - responseSchema: expect.any(Object), - url: tokenPath, }), connectorUsageCollector ); + expect(mockedRequest).toHaveBeenNthCalledWith( - 2, + 3, expect.objectContaining({ - url: 'https://api.crowdstrike.com/real-time-response/combined/batch-init-session/v1', + url: 'https://api.crowdstrike.com/real-time-response/combined/batch-active-responder-command/v1', method: 'post', - data: { host_ids: ['id1', 'id2'] }, - paramsSerializer: expect.any(Function), - responseSchema: expect.any(Object), }), connectorUsageCollector ); - // @ts-expect-error private static - but I still want to test it - expect(CrowdstrikeConnector.currentBatchId).toBe('testBatchId'); + + expect(result).toEqual(obfuscatedRTRResponse); }); + }); + + describe('batchAdminExecuteRTR', () => { + it('should make a POST request to the correct URL with correct data', async () => { + const mockResponse = { data: obfuscatedRTRResponse }; - it('should handle error when fetching batch init session', async () => { mockedRequest.mockResolvedValueOnce({ data: { access_token: 'testToken' } }); - mockedRequest.mockRejectedValueOnce(new Error('Failed to fetch batch init session')); + mockedRequest.mockResolvedValue(mockResponse); + + const result = await connector.batchAdminExecuteRTR( + { + command: 'runscript', + endpoint_ids: ['id1', 'id2'], + }, + connectorUsageCollector + ); + + expect(mockedRequest).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + url: 'https://api.crowdstrike.com/oauth2/token', + method: 'post', + }), + connectorUsageCollector + ); + + expect(mockedRequest).toHaveBeenNthCalledWith( + 3, + expect.objectContaining({ + url: 'https://api.crowdstrike.com/real-time-response/combined/batch-admin-command/v1', + method: 'post', + }), + connectorUsageCollector + ); - await expect( - connector.batchInitRTRSession({ endpoint_ids: ['id1', 'id2'] }, connectorUsageCollector) - ).rejects.toThrow('Failed to fetch batch init session'); + expect(result).toEqual(obfuscatedRTRResponse); }); + }); + + describe('getRTRCloudScripts', () => { + it('should make a GET request to the correct URL with correct params', async () => { + const mockResponse = { data: { scripts: [{}] } }; - it('should retry once if token is invalid', async () => { - const mockResponse = { data: { batch_id: 'testBatchId' } }; mockedRequest.mockResolvedValueOnce({ data: { access_token: 'testToken' } }); - mockedRequest.mockRejectedValueOnce({ code: 401 }); - mockedRequest.mockResolvedValueOnce({ data: { access_token: 'newTestToken' } }); mockedRequest.mockResolvedValueOnce(mockResponse); - await connector.batchInitRTRSession( - { endpoint_ids: ['id1', 'id2'] }, + const result = await connector.getRTRCloudScripts( + { ids: ['script1', 'script2'] }, + connectorUsageCollector + ); + + expect(mockedRequest).toHaveBeenNthCalledWith( + 1, + expect.objectContaining({ + url: 'https://api.crowdstrike.com/oauth2/token', + method: 'post', + }), connectorUsageCollector ); - expect(mockedRequest).toHaveBeenCalledTimes(4); - // @ts-expect-error private static - but I still want to test it - expect(CrowdstrikeConnector.currentBatchId).toBe('testBatchId'); + expect(mockedRequest).toHaveBeenNthCalledWith( + 2, + expect.objectContaining({ + url: 'https://api.crowdstrike.com/real-time-response/entities/scripts/v1', + method: 'GET', + }), + connectorUsageCollector + ); + + expect(result).toEqual({ scripts: [{}] }); }); }); }); + +const obfuscatedRTRResponse = { + combined: { + resources: { + host1: { + session_id: 'abcdef123456', + task_id: 'task123', + complete: true, + stdout: + 'bin \n boot \n dev \n etc \n home \n lib \n lib64 \n media \n mnt \n opt \n proc \n root \n run \n sbin \n srv \n sys \n tmp \n usr \n var \n', + stderr: '', + base_command: 'runscript', + aid: 'aid123', + errors: [{ message: 'Error example', code: 123 }], + query_time: 1234567890, + offline_queued: false, + }, + host2: { + session_id: 'ghijkl789101', + task_id: 'task456', + complete: false, + stdout: + 'bin \n boot \n dev \n etc \n home \n lib \n lib64 \n media \n mnt \n opt \n proc \n root \n run \n sbin \n srv \n sys \n tmp \n usr \n var \n', + stderr: '', + base_command: 'getscripts', + aid: 'aid456', + errors: null, + query_time: 9876543210, + offline_queued: true, + }, + }, + }, + meta: { + query_time: 1234567890, + powered_by: 'CrowdStrike', + trace_id: 'trace-abcdef123456', + }, + errors: [ + { message: 'An example error', code: 500 }, + { message: 'Another error example', code: 404 }, + ], +}; diff --git a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts index bd1f6613d5f0..14b38b414eb3 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/crowdstrike/crowdstrike.ts @@ -22,20 +22,24 @@ import type { CrowdstrikeGetTokenResponse, CrowdstrikeGetAgentOnlineStatusResponse, RelaxedCrowdstrikeBaseApiResponse, - CrowdstrikeInitRTRParams, } from '../../../common/crowdstrike/types'; import { CrowdstrikeHostActionsParamsSchema, CrowdstrikeGetAgentsParamsSchema, - CrowdstrikeGetTokenResponseSchema, CrowdstrikeHostActionsResponseSchema, RelaxedCrowdstrikeBaseApiResponseSchema, - CrowdstrikeInitRTRResponseSchema, CrowdstrikeRTRCommandParamsSchema, + CrowdstrikeExecuteRTRResponseSchema, + CrowdstrikeGetScriptsParamsSchema, + CrowdStrikeExecuteRTRResponse, + CrowdstrikeApiDoNotValidateResponsesSchema, + CrowdstrikeGetTokenResponseSchema, } from '../../../common/crowdstrike/schema'; import { SUB_ACTION } from '../../../common/crowdstrike/constants'; import { CrowdstrikeError } from './error'; +const SUPPORTED_RTR_COMMANDS = ['runscript']; + const paramsSerializer = (params: Record) => { return Object.entries(params) .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`) @@ -56,8 +60,6 @@ export class CrowdstrikeConnector extends SubActionConnector< > { private static token: string | null; private static tokenExpiryTimeout: NodeJS.Timeout; - // @ts-expect-error not used at the moment, will be used in a follow up PR - private static currentBatchId: string | undefined; private static base64encodedToken: string; private experimentalFeatures: ExperimentalFeatures; @@ -69,6 +71,10 @@ export class CrowdstrikeConnector extends SubActionConnector< agentStatus: string; batchInitRTRSession: string; batchRefreshRTRSession: string; + batchExecuteRTR: string; + batchActiveResponderExecuteRTR: string; + batchAdminExecuteRTR: string; + getRTRCloudScriptsDetails: string; }; constructor( @@ -84,6 +90,10 @@ export class CrowdstrikeConnector extends SubActionConnector< agentStatus: `${this.config.url}/devices/entities/online-state/v1`, batchInitRTRSession: `${this.config.url}/real-time-response/combined/batch-init-session/v1`, batchRefreshRTRSession: `${this.config.url}/real-time-response/combined/batch-refresh-session/v1`, + batchExecuteRTR: `${this.config.url}/real-time-response/combined/batch-command/v1`, + batchActiveResponderExecuteRTR: `${this.config.url}/real-time-response/combined/batch-active-responder-command/v1`, + batchAdminExecuteRTR: `${this.config.url}/real-time-response/combined/batch-admin-command/v1`, + getRTRCloudScriptsDetails: `${this.config.url}/real-time-response/entities/scripts/v1`, }; if (!CrowdstrikeConnector.base64encodedToken) { @@ -124,6 +134,22 @@ export class CrowdstrikeConnector extends SubActionConnector< method: 'executeRTRCommand', schema: CrowdstrikeRTRCommandParamsSchema, // Define a proper schema for the command }); + this.registerSubAction({ + name: SUB_ACTION.EXECUTE_ACTIVE_RESPONDER_RTR, + method: 'batchActiveResponderExecuteRTR', + schema: CrowdstrikeRTRCommandParamsSchema, // Define a proper schema for the command + }); + this.registerSubAction({ + name: SUB_ACTION.EXECUTE_ADMIN_RTR, + method: 'batchAdminExecuteRTR', + schema: CrowdstrikeRTRCommandParamsSchema, // Define a proper schema for the command + }); + // temporary to fetch scripts and help testing + this.registerSubAction({ + name: SUB_ACTION.GET_RTR_CLOUD_SCRIPTS, + method: 'getRTRCloudScripts', + schema: CrowdstrikeGetScriptsParamsSchema, + }); } } @@ -194,7 +220,7 @@ export class CrowdstrikeConnector extends SubActionConnector< ) as Promise; } - private async getTokenRequest(connectorUsageCollector: ConnectorUsageCollector) { + private getTokenRequest = async (connectorUsageCollector: ConnectorUsageCollector) => { const response = await this.request( { url: this.urls.getToken, @@ -204,7 +230,8 @@ export class CrowdstrikeConnector extends SubActionConnector< 'Content-Type': 'application/x-www-form-urlencoded', authorization: 'Basic ' + CrowdstrikeConnector.base64encodedToken, }, - responseSchema: CrowdstrikeGetTokenResponseSchema, + responseSchema: + CrowdstrikeApiDoNotValidateResponsesSchema as unknown as typeof CrowdstrikeGetTokenResponseSchema, }, connectorUsageCollector ); @@ -219,13 +246,13 @@ export class CrowdstrikeConnector extends SubActionConnector< }, 29 * 60 * 1000); } return token; - } + }; - private async crowdstrikeApiRequest( + private crowdstrikeApiRequest = async ( req: SubActionRequestParams, connectorUsageCollector: ConnectorUsageCollector, retried?: boolean - ): Promise { + ): Promise => { try { if (!CrowdstrikeConnector.token) { CrowdstrikeConnector.token = (await this.getTokenRequest( @@ -240,7 +267,7 @@ export class CrowdstrikeConnector extends SubActionConnector< // where the external system might add/remove/change values in the response that we have no // control over. responseSchema: - RelaxedCrowdstrikeBaseApiResponseSchema as unknown as SubActionRequestParams['responseSchema'], + CrowdstrikeApiDoNotValidateResponsesSchema as unknown as SubActionRequestParams['responseSchema'], headers: { ...req.headers, Authorization: `Bearer ${CrowdstrikeConnector.token}`, @@ -257,39 +284,114 @@ export class CrowdstrikeConnector extends SubActionConnector< } throw new CrowdstrikeError(error.message); } - } + }; - public async batchInitRTRSession( - payload: CrowdstrikeInitRTRParams, + // Helper method to execute RTR commands with different API endpoints + private executeRTRCommandWithUrl = async ( + url: string, + payload: { + command: string; + endpoint_ids: string[]; + overwriteUrl?: 'batchExecuteRTR' | 'batchActiveResponderExecuteRTR' | 'batchAdminExecuteRTR'; + }, connectorUsageCollector: ConnectorUsageCollector - ) { - const response = await this.crowdstrikeApiRequest( + ): Promise => { + // Some commands are only available in specific API endpoints, however there's an additional requirement check for the command's argument + // Eg. runscript command is available with the batchExecuteRTR endpoint, but if it goes with --Raw parameter, it should go to batchAdminExecuteRTR endpoint + // This overwrite value will be coming from kibana response actions api + const csUrl = payload.overwriteUrl ? this.urls[payload.overwriteUrl] : url; + + const batchId = await this.crowdStrikeSessionManager.initializeSession( + { endpoint_ids: payload.endpoint_ids }, + connectorUsageCollector + ); + + const baseCommand = payload.command.split(' ')[0]; + + if (!SUPPORTED_RTR_COMMANDS.includes(baseCommand)) { + throw new CrowdstrikeError('Command not supported'); + } + return await this.crowdstrikeApiRequest( { - url: this.urls.batchInitRTRSession, + url: csUrl, method: 'post', data: { - host_ids: payload.endpoint_ids, + base_command: baseCommand, + command_string: payload.command, + batch_id: batchId, + hosts: payload.endpoint_ids, + persist_all: false, }, paramsSerializer, - responseSchema: CrowdstrikeInitRTRResponseSchema, + responseSchema: + CrowdstrikeExecuteRTRResponseSchema as unknown as SubActionRequestParams['responseSchema'], }, connectorUsageCollector ); + }; + + // Public method for generic RTR command execution + public async executeRTRCommand( + payload: { + command: string; + endpoint_ids: string[]; + overwriteUrl?: 'batchActiveResponderExecuteRTR' | 'batchAdminExecuteRTR'; + }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise { + return await this.executeRTRCommandWithUrl( + this.urls.batchExecuteRTR, + payload, + connectorUsageCollector + ); + } - CrowdstrikeConnector.currentBatchId = response.batch_id; + // Public method for Active Responder RTR command execution + public async batchActiveResponderExecuteRTR( + payload: { + command: string; + endpoint_ids: string[]; + overwriteUrl?: 'batchAdminExecuteRTR'; + }, + connectorUsageCollector: ConnectorUsageCollector + ): Promise { + return await this.executeRTRCommandWithUrl( + this.urls.batchActiveResponderExecuteRTR, + payload, + connectorUsageCollector + ); } - // TODO: WIP - just to have session init logic in place - public async executeRTRCommand( - payload: { command: string; endpoint_ids: string[] }, + // Public method for Admin RTR command execution + public async batchAdminExecuteRTR( + payload: { + command: string; + endpoint_ids: string[]; + }, connectorUsageCollector: ConnectorUsageCollector - ) { - const batchId = await this.crowdStrikeSessionManager.initializeSession( - { endpoint_ids: payload.endpoint_ids }, + ): Promise { + return await this.executeRTRCommandWithUrl( + this.urls.batchAdminExecuteRTR, + payload, connectorUsageCollector ); + } - return Promise.resolve({ batchId }); + // TODO: for now just for testing purposes, will be a part of a following PR + public async getRTRCloudScripts( + payload: CrowdstrikeGetAgentsParams, + connectorUsageCollector: ConnectorUsageCollector + ): Promise { + // @ts-expect-error will be a part of the next PR + return this.crowdstrikeApiRequest( + { + url: this.urls.getRTRCloudScriptsDetails, + method: 'GET', + paramsSerializer, + responseSchema: RelaxedCrowdstrikeBaseApiResponseSchema, + }, + connectorUsageCollector + ); } protected getResponseErrorMessage( diff --git a/x-pack/plugins/stack_connectors/server/connector_types/sentinelone/sentinelone.ts b/x-pack/plugins/stack_connectors/server/connector_types/sentinelone/sentinelone.ts index 42d946edbc78..4be4a4e25ef1 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/sentinelone/sentinelone.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/sentinelone/sentinelone.ts @@ -43,7 +43,7 @@ import { SentinelOneGetRemoteScriptResultsParamsSchema, SentinelOneDownloadRemoteScriptResultsParamsSchema, SentinelOneDownloadRemoteScriptResultsResponseSchema, - SentinelOneBaseApiResponseSchema, + SentinelOneApiDoNotValidateResponsesSchema, } from '../../../common/sentinelone/schema'; import { SUB_ACTION } from '../../../common/sentinelone/constants'; import { @@ -405,7 +405,7 @@ export class SentinelOneConnector extends SubActionConnector< // where the external system might add/remove/change values in the response that we have no // control over. responseSchema: - SentinelOneBaseApiResponseSchema as unknown as SubActionRequestParams['responseSchema'], + SentinelOneApiDoNotValidateResponsesSchema as unknown as SubActionRequestParams['responseSchema'], params: { ...req.params, APIToken: this.secrets.token, diff --git a/x-pack/plugins/streams/common/types.ts b/x-pack/plugins/streams/common/types.ts deleted file mode 100644 index 59cdd1cf9c4b..000000000000 --- a/x-pack/plugins/streams/common/types.ts +++ /dev/null @@ -1,118 +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 { z } from '@kbn/zod'; - -const stringOrNumberOrBoolean = z.union([z.string(), z.number(), z.boolean()]); - -export const binaryConditionSchema = z.object({ - field: z.string(), - operator: z.enum(['eq', 'neq', 'lt', 'lte', 'gt', 'gte', 'contains', 'startsWith', 'endsWith']), - value: stringOrNumberOrBoolean, -}); - -export const unaryFilterConditionSchema = z.object({ - field: z.string(), - operator: z.enum(['exists', 'notExists']), -}); - -export const filterConditionSchema = z.discriminatedUnion('operator', [ - unaryFilterConditionSchema, - binaryConditionSchema, -]); - -export type FilterCondition = z.infer; -export type BinaryFilterCondition = z.infer; -export type UnaryFilterCondition = z.infer; - -export interface AndCondition { - and: Condition[]; -} - -export interface OrCondition { - or: Condition[]; -} - -export type Condition = FilterCondition | AndCondition | OrCondition | undefined; - -export const conditionSchema: z.ZodType = z.lazy(() => - z.union([ - filterConditionSchema, - z.object({ and: z.array(conditionSchema) }), - z.object({ or: z.array(conditionSchema) }), - ]) -); - -export const grokProcessingDefinitionSchema = z.object({ - type: z.literal('grok'), - field: z.string(), - patterns: z.array(z.string()), - pattern_definitions: z.optional(z.record(z.string())), -}); - -export const dissectProcessingDefinitionSchema = z.object({ - type: z.literal('dissect'), - field: z.string(), - pattern: z.string(), -}); - -export const processingDefinitionSchema = z.object({ - condition: z.optional(conditionSchema), - config: z.discriminatedUnion('type', [ - grokProcessingDefinitionSchema, - dissectProcessingDefinitionSchema, - ]), -}); - -export type ProcessingDefinition = z.infer; - -export const fieldDefinitionSchema = z.object({ - name: z.string(), - type: z.enum(['keyword', 'match_only_text', 'long', 'double', 'date', 'boolean', 'ip']), -}); - -export type FieldDefinition = z.infer; - -export const streamChildSchema = z.object({ - id: z.string(), - condition: z.optional(conditionSchema), -}); - -export type StreamChild = z.infer; - -export const streamWithoutIdDefinitonSchema = z.object({ - processing: z.array(processingDefinitionSchema).default([]), - fields: z.array(fieldDefinitionSchema).default([]), - children: z.array(streamChildSchema).default([]), -}); - -export type StreamWithoutIdDefinition = z.infer; - -export const streamDefinitonSchema = streamWithoutIdDefinitonSchema.extend({ - id: z.string(), - managed: z.boolean().default(true), - unmanaged_elasticsearch_assets: z.optional( - z.array( - z.object({ - type: z.enum(['ingest_pipeline', 'component_template', 'index_template', 'data_stream']), - id: z.string(), - }) - ) - ), -}); - -export type StreamDefinition = z.infer; - -export const streamDefinitonWithoutChildrenSchema = streamDefinitonSchema.omit({ children: true }); - -export type StreamWithoutChildrenDefinition = z.infer; - -export const readStreamDefinitonSchema = streamDefinitonSchema.extend({ - inheritedFields: z.array(fieldDefinitionSchema.extend({ from: z.string() })).default([]), -}); - -export type ReadStreamDefinition = z.infer; diff --git a/x-pack/plugins/streams/jest.config.js b/x-pack/plugins/streams/jest.config.js deleted file mode 100644 index 43d4fd28da9b..000000000000 --- a/x-pack/plugins/streams/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/streams'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/streams', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/streams/{common,public,server}/**/*.{js,ts,tsx}'], -}; diff --git a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.ts b/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.ts deleted file mode 100644 index eb09df883130..000000000000 --- a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.ts +++ /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 { StreamDefinition } from '../../../../common/types'; -import { ASSET_VERSION } from '../../../../common/constants'; -import { conditionToPainless } from '../helpers/condition_to_painless'; -import { logsDefaultPipelineProcessors } from './logs_default_pipeline'; -import { isRoot } from '../helpers/hierarchy'; -import { getProcessingPipelineName } from './name'; - -export function generateIngestPipeline(id: string, definition: StreamDefinition) { - return { - id: getProcessingPipelineName(id), - processors: [ - ...(isRoot(definition.id) ? logsDefaultPipelineProcessors : []), - ...definition.processing.map((processor) => { - const { type, ...config } = processor.config; - return { - [type]: { - ...config, - if: processor.condition ? conditionToPainless(processor.condition) : undefined, - }, - }; - }), - { - pipeline: { - name: `${id}@stream.reroutes`, - ignore_missing_pipeline: true, - }, - }, - ], - _meta: { - description: `Default pipeline for the ${id} stream`, - managed: true, - }, - version: ASSET_VERSION, - }; -} diff --git a/x-pack/plugins/streams/server/lib/streams/stream_crud.ts b/x-pack/plugins/streams/server/lib/streams/stream_crud.ts deleted file mode 100644 index c158280bec16..000000000000 --- a/x-pack/plugins/streams/server/lib/streams/stream_crud.ts +++ /dev/null @@ -1,439 +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 { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; -import { Logger } from '@kbn/logging'; -import { IndicesDataStream } from '@elastic/elasticsearch/lib/api/types'; -import { STREAMS_INDEX } from '../../../common/constants'; -import { FieldDefinition, StreamDefinition } from '../../../common/types'; -import { generateLayer } from './component_templates/generate_layer'; -import { deleteComponent, upsertComponent } from './component_templates/manage_component_templates'; -import { getComponentTemplateName } from './component_templates/name'; -import { - deleteDataStream, - rolloverDataStreamIfNecessary, - upsertDataStream, -} from './data_streams/manage_data_streams'; -import { DefinitionNotFound } from './errors'; -import { MalformedFields } from './errors/malformed_fields'; -import { getAncestors } from './helpers/hierarchy'; -import { generateIndexTemplate } from './index_templates/generate_index_template'; -import { deleteTemplate, upsertTemplate } from './index_templates/manage_index_templates'; -import { getIndexTemplateName } from './index_templates/name'; -import { generateIngestPipeline } from './ingest_pipelines/generate_ingest_pipeline'; -import { generateReroutePipeline } from './ingest_pipelines/generate_reroute_pipeline'; -import { - deleteIngestPipeline, - upsertIngestPipeline, -} from './ingest_pipelines/manage_ingest_pipelines'; -import { getProcessingPipelineName, getReroutePipelineName } from './ingest_pipelines/name'; - -interface BaseParams { - scopedClusterClient: IScopedClusterClient; -} - -interface BaseParamsWithDefinition extends BaseParams { - definition: StreamDefinition; -} - -interface DeleteStreamParams extends BaseParams { - id: string; - logger: Logger; -} - -export async function deleteStreamObjects({ id, scopedClusterClient, logger }: DeleteStreamParams) { - await deleteDataStream({ - esClient: scopedClusterClient.asCurrentUser, - name: id, - logger, - }); - await deleteTemplate({ - esClient: scopedClusterClient.asCurrentUser, - name: getIndexTemplateName(id), - logger, - }); - await deleteComponent({ - esClient: scopedClusterClient.asCurrentUser, - name: getComponentTemplateName(id), - logger, - }); - await deleteIngestPipeline({ - esClient: scopedClusterClient.asCurrentUser, - id: getProcessingPipelineName(id), - logger, - }); - await deleteIngestPipeline({ - esClient: scopedClusterClient.asCurrentUser, - id: getReroutePipelineName(id), - logger, - }); - await scopedClusterClient.asInternalUser.delete({ - id, - index: STREAMS_INDEX, - refresh: 'wait_for', - }); -} - -async function upsertInternalStream({ definition, scopedClusterClient }: BaseParamsWithDefinition) { - return scopedClusterClient.asInternalUser.index({ - id: definition.id, - index: STREAMS_INDEX, - document: { ...definition, managed: true }, - refresh: 'wait_for', - }); -} - -type ListStreamsParams = BaseParams; - -export interface ListStreamResponse { - definitions: StreamDefinition[]; -} - -export async function listStreams({ - scopedClusterClient, -}: ListStreamsParams): Promise { - const response = await scopedClusterClient.asInternalUser.search({ - index: STREAMS_INDEX, - size: 10000, - sort: [{ id: 'asc' }], - }); - - const dataStreams = await listDataStreamsAsStreams({ scopedClusterClient }); - let definitions = response.hits.hits.map((hit) => ({ ...hit._source!, managed: true })); - const hasAccess = await Promise.all( - definitions.map((definition) => checkReadAccess({ id: definition.id, scopedClusterClient })) - ); - definitions = definitions.filter((_, index) => hasAccess[index]); - - return { - definitions: [...definitions, ...dataStreams], - }; -} - -export async function listDataStreamsAsStreams({ - scopedClusterClient, -}: ListStreamsParams): Promise { - const response = await scopedClusterClient.asInternalUser.indices.getDataStream(); - return response.data_streams - .filter((dataStream) => dataStream.template.endsWith('@stream') === false) - .map((dataStream) => ({ - id: dataStream.name, - managed: false, - children: [], - fields: [], - processing: [], - })); -} - -interface ReadStreamParams extends BaseParams { - id: string; - skipAccessCheck?: boolean; -} - -export interface ReadStreamResponse { - definition: StreamDefinition; -} - -export async function readStream({ - id, - scopedClusterClient, - skipAccessCheck, -}: ReadStreamParams): Promise { - try { - const response = await scopedClusterClient.asInternalUser.get({ - id, - index: STREAMS_INDEX, - }); - const definition = response._source as StreamDefinition; - if (!skipAccessCheck) { - const hasAccess = await checkReadAccess({ id, scopedClusterClient }); - if (!hasAccess) { - throw new DefinitionNotFound(`Stream definition for ${id} not found.`); - } - } - return { - definition: { - ...definition, - managed: true, - }, - }; - } catch (e) { - if (e.meta?.statusCode === 404) { - return readDataStreamAsStream({ id, scopedClusterClient, skipAccessCheck }); - } - throw e; - } -} - -export async function readDataStreamAsStream({ - id, - scopedClusterClient, - skipAccessCheck, -}: ReadStreamParams) { - let dataStream: IndicesDataStream; - try { - const response = await scopedClusterClient.asInternalUser.indices.getDataStream({ name: id }); - dataStream = response.data_streams[0]; - } catch (e) { - if (e.meta?.statusCode === 404) { - throw new DefinitionNotFound(`Stream definition for ${id} not found.`); - } - throw e; - } - - const definition: StreamDefinition = { - id, - managed: false, - children: [], - fields: [], - processing: [], - }; - if (!skipAccessCheck) { - const hasAccess = await checkReadAccess({ id, scopedClusterClient }); - if (!hasAccess) { - throw new DefinitionNotFound(`Stream definition for ${id} not found.`); - } - } - // retrieve linked index template, component template and ingest pipeline - const templateName = dataStream.template; - const componentTemplates: string[] = []; - const template = await scopedClusterClient.asInternalUser.indices.getIndexTemplate({ - name: templateName, - }); - if (template.index_templates.length) { - template.index_templates[0].index_template.composed_of.forEach((componentTemplateName) => { - componentTemplates.push(componentTemplateName); - }); - } - const writeIndexName = dataStream.indices.at(-1)?.index_name!; - const currentIndex = await scopedClusterClient.asInternalUser.indices.get({ - index: writeIndexName, - }); - const ingestPipelineId = currentIndex[writeIndexName].settings?.index?.default_pipeline!; - - definition.unmanaged_elasticsearch_assets = [ - { - type: 'ingest_pipeline', - id: ingestPipelineId, - }, - ...componentTemplates.map((componentTemplateName) => ({ - type: 'component_template' as const, - id: componentTemplateName, - })), - { - type: 'index_template', - id: templateName, - }, - { - type: 'data_stream', - id, - }, - ]; - - return { definition }; -} - -interface ReadAncestorsParams extends BaseParams { - id: string; -} - -export interface ReadAncestorsResponse { - ancestors: Array<{ definition: StreamDefinition }>; -} - -export async function readAncestors({ - id, - scopedClusterClient, -}: ReadAncestorsParams): Promise { - const ancestorIds = getAncestors(id); - - return { - ancestors: await Promise.all( - ancestorIds.map((ancestorId) => - readStream({ scopedClusterClient, id: ancestorId, skipAccessCheck: true }) - ) - ), - }; -} - -interface ReadDescendantsParams extends BaseParams { - id: string; -} - -export async function readDescendants({ id, scopedClusterClient }: ReadDescendantsParams) { - const response = await scopedClusterClient.asInternalUser.search({ - index: STREAMS_INDEX, - size: 10000, - body: { - query: { - bool: { - filter: { - prefix: { - id, - }, - }, - must_not: { - term: { - id, - }, - }, - }, - }, - }, - }); - return response.hits.hits.map((hit) => hit._source as StreamDefinition); -} - -export async function validateAncestorFields( - scopedClusterClient: IScopedClusterClient, - id: string, - fields: FieldDefinition[] -) { - const { ancestors } = await readAncestors({ - id, - scopedClusterClient, - }); - for (const ancestor of ancestors) { - for (const field of fields) { - if ( - ancestor.definition.fields.some( - (ancestorField) => ancestorField.type !== field.type && ancestorField.name === field.name - ) - ) { - throw new MalformedFields( - `Field ${field.name} is already defined with incompatible type in the parent stream ${ancestor.definition.id}` - ); - } - } - } -} - -export async function validateDescendantFields( - scopedClusterClient: IScopedClusterClient, - id: string, - fields: FieldDefinition[] -) { - const descendants = await readDescendants({ - id, - scopedClusterClient, - }); - for (const descendant of descendants) { - for (const field of fields) { - if ( - descendant.fields.some( - (descendantField) => - descendantField.type !== field.type && descendantField.name === field.name - ) - ) { - throw new MalformedFields( - `Field ${field.name} is already defined with incompatible type in the child stream ${descendant.id}` - ); - } - } - } -} - -export async function checkStreamExists({ id, scopedClusterClient }: ReadStreamParams) { - try { - await readStream({ id, scopedClusterClient }); - return true; - } catch (e) { - if (e instanceof DefinitionNotFound) { - return false; - } - throw e; - } -} - -interface CheckReadAccessParams extends BaseParams { - id: string; -} - -export async function checkReadAccess({ - id, - scopedClusterClient, -}: CheckReadAccessParams): Promise { - try { - return await scopedClusterClient.asCurrentUser.indices.exists({ index: id }); - } catch (e) { - return false; - } -} - -interface SyncStreamParams { - scopedClusterClient: IScopedClusterClient; - definition: StreamDefinition; - rootDefinition?: StreamDefinition; - logger: Logger; -} - -export async function syncStream({ - scopedClusterClient, - definition, - rootDefinition, - logger, -}: SyncStreamParams) { - if (!definition.managed) { - // TODO For now, we just don't allow reads at all - later on we will relax this to allow certain operations, but they will use a completely different syncing logic - throw new Error('Cannot sync an unmanaged stream'); - } - const componentTemplate = generateLayer(definition.id, definition); - await upsertComponent({ - esClient: scopedClusterClient.asCurrentUser, - logger, - component: componentTemplate, - }); - await upsertIngestPipeline({ - esClient: scopedClusterClient.asCurrentUser, - logger, - pipeline: generateIngestPipeline(definition.id, definition), - }); - const reroutePipeline = await generateReroutePipeline({ - definition, - }); - await upsertIngestPipeline({ - esClient: scopedClusterClient.asCurrentUser, - logger, - pipeline: reroutePipeline, - }); - await upsertTemplate({ - esClient: scopedClusterClient.asCurrentUser, - logger, - template: generateIndexTemplate(definition.id), - }); - if (rootDefinition) { - const parentReroutePipeline = await generateReroutePipeline({ - definition: rootDefinition, - }); - await upsertIngestPipeline({ - esClient: scopedClusterClient.asCurrentUser, - logger, - pipeline: parentReroutePipeline, - }); - } - await upsertDataStream({ - esClient: scopedClusterClient.asCurrentUser, - logger, - name: definition.id, - }); - await upsertInternalStream({ - scopedClusterClient, - definition, - }); - await rolloverDataStreamIfNecessary({ - esClient: scopedClusterClient.asCurrentUser, - name: definition.id, - logger, - mappings: componentTemplate.template.mappings?.properties, - }); -} - -export async function streamsEnabled({ scopedClusterClient }: BaseParams) { - return await scopedClusterClient.asInternalUser.indices.exists({ - index: STREAMS_INDEX, - }); -} diff --git a/x-pack/plugins/streams/server/routes/index.ts b/x-pack/plugins/streams/server/routes/index.ts deleted file mode 100644 index cf130e99db3f..000000000000 --- a/x-pack/plugins/streams/server/routes/index.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { esqlRoutes } from './esql/route'; -import { deleteStreamRoute } from './streams/delete'; -import { disableStreamsRoute } from './streams/disable'; -import { editStreamRoute } from './streams/edit'; -import { enableStreamsRoute } from './streams/enable'; -import { forkStreamsRoute } from './streams/fork'; -import { listStreamsRoute } from './streams/list'; -import { readStreamRoute } from './streams/read'; -import { resyncStreamsRoute } from './streams/resync'; -import { sampleStreamRoute } from './streams/sample'; -import { streamsStatusRoutes } from './streams/settings'; - -export const streamsRouteRepository = { - ...enableStreamsRoute, - ...resyncStreamsRoute, - ...forkStreamsRoute, - ...readStreamRoute, - ...editStreamRoute, - ...deleteStreamRoute, - ...listStreamsRoute, - ...streamsStatusRoutes, - ...esqlRoutes, - ...disableStreamsRoute, - ...sampleStreamRoute, -}; - -export type StreamsRouteRepository = typeof streamsRouteRepository; diff --git a/x-pack/plugins/streams/server/routes/streams/delete.ts b/x-pack/plugins/streams/server/routes/streams/delete.ts deleted file mode 100644 index a2092838792c..000000000000 --- a/x-pack/plugins/streams/server/routes/streams/delete.ts +++ /dev/null @@ -1,118 +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 { z } from '@kbn/zod'; -import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; -import { Logger } from '@kbn/logging'; -import { badRequest, internal, notFound } from '@hapi/boom'; -import { - DefinitionNotFound, - ForkConditionMissing, - IndexTemplateNotFound, - SecurityException, -} from '../../lib/streams/errors'; -import { createServerRoute } from '../create_server_route'; -import { syncStream, readStream, deleteStreamObjects } from '../../lib/streams/stream_crud'; -import { MalformedStreamId } from '../../lib/streams/errors/malformed_stream_id'; -import { getParentId } from '../../lib/streams/helpers/hierarchy'; - -export const deleteStreamRoute = createServerRoute({ - endpoint: 'DELETE /api/streams/{id}', - options: { - access: 'internal', - }, - security: { - authz: { - enabled: false, - reason: - 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', - }, - }, - params: z.object({ - path: z.object({ - id: z.string(), - }), - }), - handler: async ({ - response, - params, - logger, - request, - getScopedClients, - }): Promise<{ acknowledged: true }> => { - try { - const { scopedClusterClient } = await getScopedClients({ request }); - - const parentId = getParentId(params.path.id); - if (!parentId) { - throw new MalformedStreamId('Cannot delete root stream'); - } - - // need to update parent first to cut off documents streaming down - await updateParentStream(scopedClusterClient, params.path.id, parentId, logger); - - await deleteStream(scopedClusterClient, params.path.id, logger); - - return { acknowledged: true }; - } catch (e) { - if (e instanceof IndexTemplateNotFound || e instanceof DefinitionNotFound) { - throw notFound(e); - } - - if ( - e instanceof SecurityException || - e instanceof ForkConditionMissing || - e instanceof MalformedStreamId - ) { - throw badRequest(e); - } - - throw internal(e); - } - }, -}); - -export async function deleteStream( - scopedClusterClient: IScopedClusterClient, - id: string, - logger: Logger -) { - try { - const { definition } = await readStream({ scopedClusterClient, id }); - for (const child of definition.children) { - await deleteStream(scopedClusterClient, child.id, logger); - } - await deleteStreamObjects({ scopedClusterClient, id, logger }); - } catch (e) { - if (e instanceof DefinitionNotFound) { - logger.debug(`Stream definition for ${id} not found.`); - } else { - throw e; - } - } -} - -async function updateParentStream( - scopedClusterClient: IScopedClusterClient, - id: string, - parentId: string, - logger: Logger -) { - const { definition: parentDefinition } = await readStream({ - scopedClusterClient, - id: parentId, - }); - - parentDefinition.children = parentDefinition.children.filter((child) => child.id !== id); - - await syncStream({ - scopedClusterClient, - definition: parentDefinition, - logger, - }); - return parentDefinition; -} diff --git a/x-pack/plugins/streams/server/routes/streams/list.ts b/x-pack/plugins/streams/server/routes/streams/list.ts deleted file mode 100644 index 774a256e5ba4..000000000000 --- a/x-pack/plugins/streams/server/routes/streams/list.ts +++ /dev/null @@ -1,78 +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 { z } from '@kbn/zod'; -import { notFound, internal } from '@hapi/boom'; -import { createServerRoute } from '../create_server_route'; -import { DefinitionNotFound } from '../../lib/streams/errors'; -import { listStreams } from '../../lib/streams/stream_crud'; -import { StreamDefinition } from '../../../common'; - -export const listStreamsRoute = createServerRoute({ - endpoint: 'GET /api/streams', - options: { - access: 'internal', - }, - security: { - authz: { - enabled: false, - reason: - 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', - }, - }, - params: z.object({}), - handler: async ({ - response, - request, - getScopedClients, - }): Promise<{ definitions: StreamDefinition[]; trees: StreamTree[] }> => { - try { - const { scopedClusterClient } = await getScopedClients({ request }); - const { definitions } = await listStreams({ scopedClusterClient }); - - const trees = asTrees(definitions); - - return { definitions, trees }; - } catch (e) { - if (e instanceof DefinitionNotFound) { - throw notFound(e); - } - - throw internal(e); - } - }, -}); - -export interface StreamTree { - id: string; - children: StreamTree[]; -} - -function asTrees(definitions: Array<{ id: string; managed?: boolean }>) { - const trees: StreamTree[] = []; - const ids = definitions - .filter((definition) => definition.managed) - .map((definition) => definition.id); - - ids.sort((a, b) => a.split('.').length - b.split('.').length); - - ids.forEach((id) => { - let currentTree = trees; - let existingNode: StreamTree | undefined; - // traverse the tree following the prefix of the current id. - // once we reach the leaf, the current id is added as child - this works because the ids are sorted by depth - while ((existingNode = currentTree.find((node) => id.startsWith(node.id)))) { - currentTree = existingNode.children; - } - if (!existingNode) { - const newNode = { id, children: [] }; - currentTree.push(newNode); - } - }); - - return trees; -} diff --git a/x-pack/plugins/streams/tsconfig.json b/x-pack/plugins/streams/tsconfig.json deleted file mode 100644 index 3f863145f4d2..000000000000 --- a/x-pack/plugins/streams/tsconfig.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "server/**/*", - "public/**/*", - "types/**/*" - ], - "exclude": [ - "target/**/*" - ], - "kbn_references": [ - "@kbn/config-schema", - "@kbn/core", - "@kbn/logging", - "@kbn/core-plugins-server", - "@kbn/core-http-server", - "@kbn/security-plugin", - "@kbn/core-saved-objects-api-server", - "@kbn/core-elasticsearch-server", - "@kbn/task-manager-plugin", - "@kbn/server-route-repository", - "@kbn/zod", - "@kbn/encrypted-saved-objects-plugin", - "@kbn/licensing-plugin", - "@kbn/server-route-repository-client", - "@kbn/observability-utils-server", - "@kbn/observability-utils-common" - ] -} diff --git a/x-pack/plugins/streams_app/jest.config.js b/x-pack/plugins/streams_app/jest.config.js deleted file mode 100644 index d9c01c40a322..000000000000 --- a/x-pack/plugins/streams_app/jest.config.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: [ - '/x-pack/plugins/streams_app/public', - '/x-pack/plugins/streams_app/common', - '/x-pack/plugins/streams_app/server', - ], - setupFiles: ['/x-pack/plugins/streams_app/.storybook/jest_setup.js'], - collectCoverage: true, - collectCoverageFrom: [ - '/x-pack/plugins/streams_app/{public,common,server}/**/*.{js,ts,tsx}', - ], - - coverageReporters: ['html'], -}; diff --git a/x-pack/plugins/streams_app/public/components/preview_table/index.tsx b/x-pack/plugins/streams_app/public/components/preview_table/index.tsx deleted file mode 100644 index 22db6ff29407..000000000000 --- a/x-pack/plugins/streams_app/public/components/preview_table/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 { EuiDataGrid } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React, { useEffect, useMemo, useState } from 'react'; - -export function PreviewTable({ documents }: { documents: unknown[] }) { - const [height, setHeight] = useState('100px'); - useEffect(() => { - // set height to 100% after a short delay otherwise it doesn't calculate correctly - // TODO: figure out a better way to do this - setTimeout(() => { - setHeight(`100%`); - }, 50); - }, []); - - const columns = useMemo(() => { - const cols = new Set(); - documents.forEach((doc) => { - if (!doc || typeof doc !== 'object') { - return; - } - Object.keys(doc).forEach((key) => { - cols.add(key); - }); - }); - return Array.from(cols); - }, [documents]); - - const gridColumns = useMemo(() => { - return Array.from(columns).map((column) => ({ - id: column, - displayAsText: column, - })); - }, [columns]); - - return ( - {}, - canDragAndDropColumns: false, - }} - toolbarVisibility={false} - rowCount={documents.length} - height={height} - renderCellValue={({ rowIndex, columnId }) => { - const doc = documents[rowIndex]; - if (!doc || typeof doc !== 'object') { - return ''; - } - const value = (doc as Record)[columnId]; - if (value === undefined || value === null) { - return ''; - } - if (typeof value === 'object') { - return JSON.stringify(value); - } - return String(value); - }} - /> - ); -} diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_management/index.tsx b/x-pack/plugins/streams_app/public/components/stream_detail_management/index.tsx deleted file mode 100644 index 1e66490bca3c..000000000000 --- a/x-pack/plugins/streams_app/public/components/stream_detail_management/index.tsx +++ /dev/null @@ -1,209 +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 { i18n } from '@kbn/i18n'; -import { ReadStreamDefinition, StreamDefinition } from '@kbn/streams-plugin/common'; -import { css } from '@emotion/css'; -import { EuiButtonGroup, EuiFlexGroup, EuiFlexItem, EuiListGroup, EuiText } from '@elastic/eui'; -import { useStreamsAppParams } from '../../hooks/use_streams_app_params'; -import { RedirectTo } from '../redirect_to'; -import { useStreamsAppRouter } from '../../hooks/use_streams_app_router'; -import { StreamDetailRouting } from '../stream_detail_routing'; -import { StreamDetailEnriching } from '../stream_detail_enriching'; -import { StreamDetailSchemaEditor } from '../stream_detail_schema_editor'; -import { useKibana } from '../../hooks/use_kibana'; - -type ManagementSubTabs = 'route' | 'enrich' | 'schemaEditor'; - -function isValidManagementSubTab(value: string): value is ManagementSubTabs { - return ['route', 'enrich', 'schemaEditor'].includes(value); -} - -export function StreamDetailManagement({ - definition, - refreshDefinition, -}: { - definition?: ReadStreamDefinition; - refreshDefinition: () => void; -}) { - const { - path: { key, subtab }, - } = useStreamsAppParams('/{key}/management/{subtab}'); - const router = useStreamsAppRouter(); - - if (subtab === 'overview') { - if (!definition) { - return null; - } - if (definition.managed) { - return ( - - ); - } - return ; - } - - const tabs = { - route: { - content: ( - - ), - label: i18n.translate('xpack.streams.streamDetailView.routingTab', { - defaultMessage: 'Streams Partitioning', - }), - }, - enrich: { - content: ( - - ), - label: i18n.translate('xpack.streams.streamDetailView.enrichingTab', { - defaultMessage: 'Extract field', - }), - }, - schemaEditor: { - content: ( - - ), - label: i18n.translate('xpack.streams.streamDetailView.schemaEditorTab', { - defaultMessage: 'Schema editor', - }), - }, - }; - - if (!isValidManagementSubTab(subtab)) { - return ( - - ); - } - - if (!definition?.managed) { - return ( - - ); - } - - const selectedTabObject = tabs[subtab]; - - return ( - - - { - router.push('/{key}/management/{subtab}', { - path: { key, subtab: optionId }, - query: {}, - }); - }} - options={Object.keys(tabs).map((id) => ({ - id, - label: tabs[id as ManagementSubTabs].label, - }))} - /> - - - {selectedTabObject.content} - - - ); -} - -function assetToLink(asset: { type: string; id: string }) { - switch (asset.type) { - case 'index_template': - return `/app/management/data/index_management/templates/${asset.id}`; - case 'component_template': - return `/app/management/data/index_management/component_templates/${asset.id}`; - case 'data_stream': - return `/app/management/data/index_management/data_streams/${asset.id}`; - case 'ingest_pipeline': - return `/app/management/ingest/ingest_pipelines?pipeline=${asset.id}`; - default: - return ''; - } -} - -function assetToTitle(asset: { type: string; id: string }) { - switch (asset.type) { - case 'index_template': - return i18n.translate('xpack.streams.streamDetailView.indexTemplate', { - defaultMessage: 'Index template', - }); - case 'component_template': - return i18n.translate('xpack.streams.streamDetailView.componentTemplate', { - defaultMessage: 'Component template', - }); - case 'data_stream': - return i18n.translate('xpack.streams.streamDetailView.dataStream', { - defaultMessage: 'Data stream', - }); - case 'ingest_pipeline': - return i18n.translate('xpack.streams.streamDetailView.ingestPipeline', { - defaultMessage: 'Ingest pipeline', - }); - default: - return ''; - } -} - -function UnmanagedStreamOverview({ definition }: { definition: StreamDefinition }) { - const { - core: { - http: { basePath }, - }, - } = useKibana(); - const groupedAssets = (definition.unmanaged_elasticsearch_assets ?? []).reduce((acc, asset) => { - const title = assetToTitle(asset); - if (title) { - acc[title] = acc[title] ?? []; - acc[title].push(asset); - } - return acc; - }, {} as Record>); - return ( - - -

- {i18n.translate('xpack.streams.streamDetailView.unmanagedStreamOverview', { - defaultMessage: - 'This stream is not managed. Follow the links to stack management to change the related Elasticsearch objects.', - })} -

-
- {Object.entries(groupedAssets).map(([title, assets]) => ( -
- -

{title}

-
- ({ - label: asset.id, - href: basePath.prepend(assetToLink(asset)), - iconType: 'index', - target: '_blank', - }))} - /> -
- ))} -
- ); -} diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_overview/index.tsx b/x-pack/plugins/streams_app/public/components/stream_detail_overview/index.tsx deleted file mode 100644 index c051d114317e..000000000000 --- a/x-pack/plugins/streams_app/public/components/stream_detail_overview/index.tsx +++ /dev/null @@ -1,172 +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 { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; -import { calculateAuto } from '@kbn/calculate-auto'; -import { i18n } from '@kbn/i18n'; -import { useDateRange } from '@kbn/observability-utils-browser/hooks/use_date_range'; -import { StreamDefinition } from '@kbn/streams-plugin/common'; -import moment from 'moment'; -import React, { useMemo } from 'react'; -import { useKibana } from '../../hooks/use_kibana'; -import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; -import { ControlledEsqlChart } from '../esql_chart/controlled_esql_chart'; -import { StreamsAppSearchBar } from '../streams_app_search_bar'; - -export function StreamDetailOverview({ definition }: { definition?: StreamDefinition }) { - const { - dependencies: { - start: { - data, - dataViews, - streams: { streamsRepositoryClient }, - share, - }, - }, - } = useKibana(); - - const { - timeRange, - absoluteTimeRange: { start, end }, - setTimeRange, - } = useDateRange({ data }); - - const indexPatterns = useMemo(() => { - if (!definition?.id) { - return undefined; - } - - const isRoot = definition.id.indexOf('.') === -1; - - const dataStreamOfDefinition = definition.id; - - return isRoot - ? [dataStreamOfDefinition, `${dataStreamOfDefinition}.*`] - : [`${dataStreamOfDefinition}*`]; - }, [definition?.id]); - - const discoverLocator = useMemo( - () => share.url.locators.get('DISCOVER_APP_LOCATOR'), - [share.url.locators] - ); - - const queries = useMemo(() => { - if (!indexPatterns) { - return undefined; - } - - const baseQuery = `FROM ${indexPatterns.join(', ')}`; - - const bucketSize = Math.round( - calculateAuto.atLeast(50, moment.duration(1, 'minute'))!.asSeconds() - ); - - const histogramQuery = `${baseQuery} | STATS metric = COUNT(*) BY @timestamp = BUCKET(@timestamp, ${bucketSize} seconds)`; - - return { - baseQuery, - histogramQuery, - }; - }, [indexPatterns]); - - const discoverLink = useMemo(() => { - if (!discoverLocator || !queries?.baseQuery) { - return undefined; - } - - return discoverLocator.getRedirectUrl({ - query: { - esql: queries.baseQuery, - }, - }); - }, [queries?.baseQuery, discoverLocator]); - - const histogramQueryFetch = useStreamsAppFetch( - async ({ signal }) => { - if (!queries?.histogramQuery || !indexPatterns) { - return undefined; - } - - const existingIndices = await dataViews.getExistingIndices(indexPatterns); - - if (existingIndices.length === 0) { - return undefined; - } - - return streamsRepositoryClient.fetch('POST /internal/streams/esql', { - params: { - body: { - operationName: 'get_histogram_for_stream', - query: queries.histogramQuery, - start, - end, - }, - }, - signal, - }); - }, - [indexPatterns, dataViews, streamsRepositoryClient, queries?.histogramQuery, start, end] - ); - - return ( - <> - - - - - { - if (!isUpdate) { - histogramQueryFetch.refresh(); - return; - } - - if (dateRange) { - setTimeRange({ from: dateRange.from, to: dateRange?.to, mode: dateRange.mode }); - } - }} - onRefresh={() => { - histogramQueryFetch.refresh(); - }} - placeholder={i18n.translate( - 'xpack.streams.entityDetailOverview.searchBarPlaceholder', - { - defaultMessage: 'Filter data by using KQL', - } - )} - dateRangeFrom={timeRange.from} - dateRangeTo={timeRange.to} - /> - - - {i18n.translate('xpack.streams.streamDetailOverview.openInDiscoverButtonLabel', { - defaultMessage: 'Open in Discover', - })} - - - - - - - - - - - - - ); -} diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_routing/index.tsx b/x-pack/plugins/streams_app/public/components/stream_detail_routing/index.tsx deleted file mode 100644 index ca58051f9db2..000000000000 --- a/x-pack/plugins/streams_app/public/components/stream_detail_routing/index.tsx +++ /dev/null @@ -1,781 +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 { - EuiButton, - EuiButtonEmpty, - EuiButtonIcon, - EuiFieldText, - EuiFlexGroup, - EuiFlexItem, - EuiFormRow, - EuiIcon, - EuiImage, - EuiLoadingSpinner, - EuiPanel, - EuiResizableContainer, - EuiSpacer, - EuiText, - useEuiTheme, -} from '@elastic/eui'; -import { css } from '@emotion/css'; -import { i18n } from '@kbn/i18n'; -import { useAbortController } from '@kbn/observability-utils-browser/hooks/use_abort_controller'; -import { useDateRange } from '@kbn/observability-utils-browser/hooks/use_date_range'; -import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; -import React from 'react'; -import { StreamChild } from '@kbn/streams-plugin/common/types'; -import { AbortableAsyncState } from '@kbn/observability-utils-browser/hooks/use_abortable_async'; -import { useKibana } from '../../hooks/use_kibana'; -import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; -import { StreamsAppSearchBar } from '../streams_app_search_bar'; -import { ConditionEditor } from '../condition_editor'; -import { useDebounced } from '../../util/use_debounce'; -import { useStreamsAppRouter } from '../../hooks/use_streams_app_router'; -import { NestedView } from '../nested_view'; -import illustration from '../assets/illustration.png'; -import { PreviewTable } from '../preview_table'; -import { StreamDeleteModal } from '../stream_delete_modal'; - -function useRoutingState() { - const [childUnderEdit, setChildUnderEdit] = React.useState< - { isNew: boolean; child: StreamChild } | undefined - >(); - - const debouncedChildUnderEdit = useDebounced(childUnderEdit, 300); - - const [saveInProgress, setSaveInProgress] = React.useState(false); - const [showDeleteModal, setShowDeleteModal] = React.useState(false); - - return { - debouncedChildUnderEdit, - childUnderEdit, - setChildUnderEdit, - saveInProgress, - setSaveInProgress, - showDeleteModal, - setShowDeleteModal, - }; -} - -export function StreamDetailRouting({ - definition, - refreshDefinition, -}: { - definition?: ReadStreamDefinition; - refreshDefinition: () => void; -}) { - const theme = useEuiTheme().euiTheme; - const routingAppState = useRoutingState(); - - if (!definition) { - return null; - } - - const closeModal = () => routingAppState.setShowDeleteModal(false); - - return ( - <> - {routingAppState.showDeleteModal && routingAppState.childUnderEdit && ( - routingAppState.setChildUnderEdit(undefined)} - refreshDefinition={refreshDefinition} - id={routingAppState.childUnderEdit.child.id} - /> - )} - - - - {(EuiResizablePanel, EuiResizableButton) => ( - <> - - - - - - - - - - - )} - - - - - - - - ); -} - -function ControlBar({ - definition, - routingAppState, - refreshDefinition, -}: { - definition: ReadStreamDefinition; - routingAppState: ReturnType; - refreshDefinition: () => void; -}) { - const { - core: { notifications }, - dependencies: { - start: { - streams: { streamsRepositoryClient }, - }, - }, - } = useKibana(); - - const { signal } = useAbortController(); - - if (!routingAppState.childUnderEdit) { - return ( - - - {i18n.translate('xpack.streams.streamDetailRouting.save', { - defaultMessage: 'Save', - })} - - - ); - } - - function forkChild() { - if (!routingAppState.childUnderEdit) { - return; - } - return streamsRepositoryClient.fetch('POST /api/streams/{id}/_fork', { - signal, - params: { - path: { - id: definition.id, - }, - body: { - condition: routingAppState.childUnderEdit.child.condition, - stream: { - id: routingAppState.childUnderEdit.child.id, - processing: [], - fields: [], - }, - }, - }, - }); - } - - function updateChild() { - if (!routingAppState.childUnderEdit) { - return; - } - - const childUnderEdit = routingAppState.childUnderEdit.child; - const { inheritedFields, id, ...definitionToUpdate } = definition; - return streamsRepositoryClient.fetch('PUT /api/streams/{id}', { - signal, - params: { - path: { - id: definition.id, - }, - body: { - ...definitionToUpdate, - children: definition.children.map((child) => - child.id === childUnderEdit.id ? childUnderEdit : child - ), - }, - }, - }); - } - - async function saveOrUpdateChild() { - if (!routingAppState.childUnderEdit) { - return; - } - try { - routingAppState.setSaveInProgress(true); - - if (routingAppState.childUnderEdit.isNew) { - await forkChild(); - } else { - await updateChild(); - } - - routingAppState.setSaveInProgress(false); - notifications.toasts.addSuccess({ - title: i18n.translate('xpack.streams.streamDetailRouting.saved', { - defaultMessage: 'Stream saved', - }), - }); - routingAppState.setChildUnderEdit(undefined); - refreshDefinition(); - } catch (error) { - routingAppState.setSaveInProgress(false); - notifications.toasts.addError(error, { - title: i18n.translate('xpack.streams.failedToSave', { - defaultMessage: 'Failed to save', - }), - toastMessage: 'body' in error ? error.body.message : error.message, - }); - } - } - - return ( - - {!routingAppState.childUnderEdit.isNew && ( - <> - { - routingAppState.setShowDeleteModal(true); - }} - > - {i18n.translate('xpack.streams.streamDetailRouting.remove', { - defaultMessage: 'Remove', - })} - - - - )} - { - routingAppState.setChildUnderEdit(undefined); - }} - > - {i18n.translate('xpack.streams.streamDetailRouting.cancel', { - defaultMessage: 'Cancel', - })} - - - {routingAppState.childUnderEdit.isNew - ? i18n.translate('xpack.streams.streamDetailRouting.add', { - defaultMessage: 'Save', - }) - : i18n.translate('xpack.streams.streamDetailRouting.change', { - defaultMessage: 'Change routing', - })} - - - ); -} - -function PreviewPanel({ - definition, - routingAppState, -}: { - definition: ReadStreamDefinition; - routingAppState: ReturnType; -}) { - const { - dependencies: { - start: { - data, - streams: { streamsRepositoryClient }, - }, - }, - } = useKibana(); - - const { - timeRange, - absoluteTimeRange: { start, end }, - setTimeRange, - } = useDateRange({ data }); - - const previewSampleFetch = useStreamsAppFetch( - ({ signal }) => { - if ( - !definition || - !routingAppState.debouncedChildUnderEdit || - !routingAppState.debouncedChildUnderEdit.isNew - ) { - return Promise.resolve({ documents: [] }); - } - return streamsRepositoryClient.fetch('POST /api/streams/{id}/_sample', { - signal, - params: { - path: { - id: definition.id, - }, - body: { - condition: routingAppState.debouncedChildUnderEdit.child.condition, - start: start?.valueOf(), - end: end?.valueOf(), - number: 100, - }, - }, - }); - }, - [definition, routingAppState.debouncedChildUnderEdit, streamsRepositoryClient, start, end], - { - disableToastOnError: true, - } - ); - - let content = ( - - ); - - if (routingAppState.debouncedChildUnderEdit?.isNew) { - if (previewSampleFetch.error) { - content = ( - - - - {i18n.translate('xpack.streams.streamDetail.preview.error', { - defaultMessage: 'Error loading preview', - })} - - - - ); - } else if (previewSampleFetch.value?.documents && previewSampleFetch.value.documents.length) { - content = ( - - - - ); - } - } - - return ( - <> - - - - - - - {i18n.translate('xpack.streams.streamDetail.preview.header', { - defaultMessage: 'Data Preview', - })} - {previewSampleFetch.loading && } - - - - - { - if (!isUpdate) { - previewSampleFetch.refresh(); - return; - } - - if (dateRange) { - setTimeRange({ - from: dateRange.from, - to: dateRange?.to, - mode: dateRange.mode, - }); - } - }} - onRefresh={() => { - previewSampleFetch.refresh(); - }} - dateRangeFrom={timeRange.from} - dateRangeTo={timeRange.to} - /> - - - - - {content} - - ); -} - -function PreviewPanelIllustration({ - previewSampleFetch, - routingAppState, -}: { - routingAppState: ReturnType; - previewSampleFetch: AbortableAsyncState<{ - documents: unknown[]; - }>; -}) { - return ( - - - - {previewSampleFetch.loading ? ( - - - - ) : ( - <> - {routingAppState.debouncedChildUnderEdit && - routingAppState.debouncedChildUnderEdit.isNew && ( - - {i18n.translate('xpack.streams.streamDetail.preview.empty', { - defaultMessage: 'No documents to preview', - })} - - )} - {routingAppState.debouncedChildUnderEdit && - !routingAppState.debouncedChildUnderEdit.isNew && ( - - {i18n.translate('xpack.streams.streamDetail.preview.editPreviewMessage', { - defaultMessage: 'Preview is not available while editing streams', - })} - - )} - {!routingAppState.debouncedChildUnderEdit && ( - <> - - {i18n.translate('xpack.streams.streamDetail.preview.editPreviewMessageEmpty', { - defaultMessage: 'Your preview will appear here', - })} - - - {i18n.translate( - 'xpack.streams.streamDetail.preview.editPreviewMessageEmptyDescription', - { - defaultMessage: - 'Create a new child stream to see what will be routed to it based on the conditions', - } - )} - - - )} - - )} - - - ); -} - -function ChildStreamList({ - definition, - routingAppState: { childUnderEdit, setChildUnderEdit }, -}: { - definition: ReadStreamDefinition; - routingAppState: ReturnType; -}) { - return ( - - - - {i18n.translate('xpack.streams.streamDetailRouting.rules.header', { - defaultMessage: 'Routing rules', - })} - - - - - - {definition.children.map((child, i) => ( - - { - if (child.id === childUnderEdit?.child.id) { - setChildUnderEdit(undefined); - } else { - setChildUnderEdit({ isNew: false, child }); - } - }} - onChildChange={(newChild) => { - setChildUnderEdit({ - isNew: false, - child: newChild, - }); - }} - /> - - ))} - {childUnderEdit?.isNew ? ( - - { - if (!newChild) { - setChildUnderEdit(undefined); - return; - } - setChildUnderEdit({ - isNew: true, - child: newChild, - }); - }} - /> - - ) : ( - - - { - setChildUnderEdit({ - isNew: true, - child: { - id: `${definition.id}.child`, - condition: { - field: '', - operator: 'eq', - value: '', - }, - }, - }); - }} - > - {i18n.translate('xpack.streams.streamDetailRouting.addRule', { - defaultMessage: 'Create a new child stream', - })} - - - - )} - - - ); -} - -function CurrentStreamEntry({ definition }: { definition: ReadStreamDefinition }) { - return ( - - - {definition.id} - - {i18n.translate('xpack.streams.streamDetailRouting.currentStream', { - defaultMessage: 'Current stream', - })} - - - - ); -} - -function PreviousStreamEntry({ definition }: { definition: ReadStreamDefinition }) { - const router = useStreamsAppRouter(); - - const parentId = definition.id.split('.').slice(0, -1).join('.'); - if (parentId === '') { - return null; - } - - return ( - - - - - {i18n.translate('xpack.streams.streamDetailRouting.previousStream', { - defaultMessage: '.. (Previous stream)', - })} - - - - - ); -} - -function RoutingStreamEntry({ - child, - onChildChange, - onEditStateChange, - edit, -}: { - child: StreamChild; - onChildChange: (child: StreamChild) => void; - onEditStateChange: () => void; - edit?: boolean; -}) { - const router = useStreamsAppRouter(); - return ( - - - - {child.id} - - { - onEditStateChange(); - }} - aria-label={i18n.translate('xpack.streams.streamDetailRouting.edit', { - defaultMessage: 'Edit', - })} - /> - - - {child.condition && ( - { - onChildChange({ - ...child, - condition, - }); - }} - /> - )} - {!child.condition && ( - - {i18n.translate('xpack.streams.streamDetailRouting.noCondition', { - defaultMessage: 'No condition, no documents will be routed', - })} - - )} - - ); -} - -function NewRoutingStreamEntry({ - child, - onChildChange, -}: { - child: StreamChild; - onChildChange: (child?: StreamChild) => void; -}) { - return ( - - - - { - onChildChange({ - ...child, - id: e.target.value, - }); - }} - /> - - {child.condition && ( - { - onChildChange({ - ...child, - condition, - }); - }} - /> - )} - {!child.condition && ( - - {i18n.translate('xpack.streams.streamDetailRouting.noCondition', { - defaultMessage: 'No condition, no documents will be routed', - })} - - )} - - - ); -} diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx b/x-pack/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx deleted file mode 100644 index 7d3e9322e8d4..000000000000 --- a/x-pack/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx +++ /dev/null @@ -1,18 +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 { StreamDefinition } from '@kbn/streams-plugin/common'; -import React from 'react'; - -export function StreamDetailSchemaEditor({ - definition: _definition, - refreshDefinition: _refreshDefinition, -}: { - definition?: StreamDefinition; - refreshDefinition: () => void; -}) { - return <>{'TODO'}; -} diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_view/index.tsx b/x-pack/plugins/streams_app/public/components/stream_detail_view/index.tsx deleted file mode 100644 index b0a2307f7b2b..000000000000 --- a/x-pack/plugins/streams_app/public/components/stream_detail_view/index.tsx +++ /dev/null @@ -1,76 +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 { i18n } from '@kbn/i18n'; -import { EntityDetailViewWithoutParams, EntityViewTab } from '../entity_detail_view'; -import { useStreamsAppParams } from '../../hooks/use_streams_app_params'; -import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; -import { useKibana } from '../../hooks/use_kibana'; -import { StreamDetailOverview } from '../stream_detail_overview'; -import { StreamDetailManagement } from '../stream_detail_management'; - -export function StreamDetailView() { - const params1 = useStreamsAppParams('/{key}/{tab}', true); - - const params2 = useStreamsAppParams('/{key}/management/{subtab}', true); - - const key = params1?.path?.key || params2.path.key; - const tab = params1?.path?.tab || 'management'; - - const { - dependencies: { - start: { - streams: { streamsRepositoryClient }, - }, - }, - } = useKibana(); - - const { value: streamEntity, refresh } = useStreamsAppFetch( - ({ signal }) => { - return streamsRepositoryClient.fetch('GET /api/streams/{id}', { - signal, - params: { - path: { - id: key, - }, - }, - }); - }, - [streamsRepositoryClient, key] - ); - - const entity = { - id: key, - displayName: key, - }; - - const tabs: EntityViewTab[] = [ - { - name: 'overview', - content: , - label: i18n.translate('xpack.streams.streamDetailView.overviewTab', { - defaultMessage: 'Overview', - }), - }, - { - name: 'management', - content: , - label: i18n.translate('xpack.streams.streamDetailView.managementTab', { - defaultMessage: 'Management', - }), - }, - ]; - - return ( - - ); -} diff --git a/x-pack/plugins/streams_app/tsconfig.json b/x-pack/plugins/streams_app/tsconfig.json deleted file mode 100644 index cba6a2d993bd..000000000000 --- a/x-pack/plugins/streams_app/tsconfig.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "../../../typings/**/*", - "common/**/*", - "public/**/*", - "typings/**/*", - "public/**/*.json", - "server/**/*", - ".storybook/**/*" - ], - "exclude": ["target/**/*", ".storybook/**/*.js"], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/data-views-plugin", - "@kbn/observability-shared-plugin", - "@kbn/unified-search-plugin", - "@kbn/react-kibana-context-render", - "@kbn/shared-ux-link-redirect-app", - "@kbn/typed-react-router-config", - "@kbn/i18n", - "@kbn/observability-utils-browser", - "@kbn/kibana-react-plugin", - "@kbn/es-query", - "@kbn/logging", - "@kbn/deeplinks-observability", - "@kbn/config-schema", - "@kbn/calculate-auto", - "@kbn/streams-plugin", - "@kbn/share-plugin", - "@kbn/observability-utils-server", - "@kbn/code-editor", - "@kbn/ui-theme", - "@kbn/navigation-plugin", - ] -} diff --git a/x-pack/plugins/task_manager/server/config.ts b/x-pack/plugins/task_manager/server/config.ts index 002f18380a74..92d7429501cd 100644 --- a/x-pack/plugins/task_manager/server/config.ts +++ b/x-pack/plugins/task_manager/server/config.ts @@ -36,6 +36,7 @@ export const CLAIM_STRATEGY_MGET = 'mget'; export const DEFAULT_DISCOVERY_INTERVAL_MS = 1000 * 10; // 10 seconds const MIN_DISCOVERY_INTERVAL_MS = 1000; // 1 second const MAX_DISCOVERY_INTERVAL_MS = 1000 * 60 * 5; // 5 minutes +export const DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS = 6 * 1000 * 10; // 60 seconds export const DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION = '30s'; const FIVE_MIN_IN_MS = 5 * 60 * 1000; diff --git a/x-pack/plugins/task_manager/server/index.ts b/x-pack/plugins/task_manager/server/index.ts index f2ad559f02b9..93ca1b13b8b0 100644 --- a/x-pack/plugins/task_manager/server/index.ts +++ b/x-pack/plugins/task_manager/server/index.ts @@ -69,6 +69,10 @@ export const config: PluginConfigDescriptor = { level: 'warning', message: `Configuring "xpack.task_manager.max_workers" is deprecated and will be removed in a future version. Remove this setting and use "xpack.task_manager.capacity" instead.`, }), + deprecate('claim_strategy', 'a future version', { + level: 'warning', + message: `Configuring "xpack.task_manager.claim_strategy" is deprecated and will be removed in a future version. This setting should be removed.`, + }), (settings, fromPath, addDeprecation) => { const taskManager = get(settings, fromPath); if (taskManager?.index) { diff --git a/x-pack/plugins/task_manager/server/integration_tests/__snapshots__/task_cost_check.test.ts.snap b/x-pack/plugins/task_manager/server/integration_tests/__snapshots__/task_cost_check.test.ts.snap index 754d9f0c66b4..1e3fa4cbf864 100644 --- a/x-pack/plugins/task_manager/server/integration_tests/__snapshots__/task_cost_check.test.ts.snap +++ b/x-pack/plugins/task_manager/server/integration_tests/__snapshots__/task_cost_check.test.ts.snap @@ -4,95 +4,95 @@ exports[`Task cost checks detects tasks with cost definitions 1`] = ` Array [ Object { "cost": 1, - "taskType": "actions:.email", + "taskType": "actions:.bedrock", }, Object { "cost": 1, - "taskType": "actions:.index", + "taskType": "actions:.cases", }, Object { "cost": 1, - "taskType": "actions:.pagerduty", + "taskType": "actions:.cases-webhook", }, Object { "cost": 1, - "taskType": "actions:.swimlane", + "taskType": "actions:.crowdstrike", }, Object { "cost": 1, - "taskType": "actions:.server-log", + "taskType": "actions:.d3security", }, Object { "cost": 1, - "taskType": "actions:.slack", + "taskType": "actions:.email", }, Object { "cost": 1, - "taskType": "actions:.slack_api", + "taskType": "actions:.gemini", }, Object { "cost": 1, - "taskType": "actions:.webhook", + "taskType": "actions:.gen-ai", }, Object { "cost": 1, - "taskType": "actions:.cases-webhook", + "taskType": "actions:.index", }, Object { "cost": 1, - "taskType": "actions:.xmatters", + "taskType": "actions:.jira", }, Object { "cost": 1, - "taskType": "actions:.servicenow", + "taskType": "actions:.observability-ai-assistant", }, Object { "cost": 1, - "taskType": "actions:.servicenow-sir", + "taskType": "actions:.opsgenie", }, Object { "cost": 1, - "taskType": "actions:.servicenow-itom", + "taskType": "actions:.pagerduty", }, Object { "cost": 1, - "taskType": "actions:.jira", + "taskType": "actions:.resilient", }, Object { "cost": 1, - "taskType": "actions:.teams", + "taskType": "actions:.sentinelone", }, Object { "cost": 1, - "taskType": "actions:.torq", + "taskType": "actions:.server-log", }, Object { "cost": 1, - "taskType": "actions:.opsgenie", + "taskType": "actions:.servicenow", }, Object { "cost": 1, - "taskType": "actions:.tines", + "taskType": "actions:.servicenow-itom", }, Object { "cost": 1, - "taskType": "actions:.gen-ai", + "taskType": "actions:.servicenow-sir", }, Object { "cost": 1, - "taskType": "actions:.bedrock", + "taskType": "actions:.slack", }, Object { "cost": 1, - "taskType": "actions:.gemini", + "taskType": "actions:.slack_api", }, Object { "cost": 1, - "taskType": "actions:.d3security", + "taskType": "actions:.swimlane", }, Object { "cost": 1, - "taskType": "actions:.resilient", + "taskType": "actions:.teams", }, Object { "cost": 1, @@ -100,19 +100,19 @@ Array [ }, Object { "cost": 1, - "taskType": "actions:.sentinelone", + "taskType": "actions:.tines", }, Object { "cost": 1, - "taskType": "actions:.crowdstrike", + "taskType": "actions:.torq", }, Object { "cost": 1, - "taskType": "actions:.cases", + "taskType": "actions:.webhook", }, Object { "cost": 1, - "taskType": "actions:.observability-ai-assistant", + "taskType": "actions:.xmatters", }, Object { "cost": 10, diff --git a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts index ab1d1bc0498f..d048cc4063fa 100644 --- a/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts +++ b/x-pack/plugins/task_manager/server/integration_tests/managed_configuration.test.ts @@ -13,6 +13,7 @@ import { ADJUST_THROUGHPUT_INTERVAL } from '../lib/create_managed_configuration' import { TaskManagerPlugin, TaskManagerStartContract } from '../plugin'; import { coreMock } from '@kbn/core/server/mocks'; import { TaskManagerConfig } from '../config'; +import { BulkUpdateError } from '../lib/bulk_update_error'; describe('managed configuration', () => { let taskManagerStart: TaskManagerStartContract; @@ -130,14 +131,41 @@ describe('managed configuration', () => { clock.tick(ADJUST_THROUGHPUT_INTERVAL); expect(logger.warn).toHaveBeenCalledWith( - 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" error(s).' + 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' ); expect(logger.debug).toHaveBeenCalledWith( - 'Poll interval configuration changing from 3000 to 3600 after seeing 1 "too many request" and/or "execute [inline] script" error(s)' + 'Poll interval configuration changing from 3000 to 3600 after seeing 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' ); expect(logger.debug).toHaveBeenCalledWith('Task poller now using interval of 3600ms'); }); + test('should increase poll interval when Elasticsearch returns a cluster_block_exception error', async () => { + savedObjectsClient.create.mockRejectedValueOnce( + new BulkUpdateError({ + statusCode: 403, + message: 'index is blocked', + type: 'cluster_block_exception', + }) + ); + + await expect( + taskManagerStart.schedule({ + taskType: 'foo', + state: {}, + params: {}, + }) + ).rejects.toThrowErrorMatchingInlineSnapshot(`"index is blocked"`); + clock.tick(100000); + + expect(logger.warn).toHaveBeenCalledWith( + 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' + ); + expect(logger.debug).toHaveBeenCalledWith( + 'Poll interval configuration changing from 3000 to 61000 after seeing 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' + ); + expect(logger.debug).toHaveBeenCalledWith('Task poller now using interval of 61000ms'); + }); + test('should increase poll interval when Elasticsearch returns "cannot execute [inline] scripts" error', async () => { const childEsClient = esStart.client.asInternalUser.child({}) as jest.Mocked; childEsClient.search.mockImplementationOnce(async () => { @@ -151,10 +179,10 @@ describe('managed configuration', () => { clock.tick(ADJUST_THROUGHPUT_INTERVAL); expect(logger.warn).toHaveBeenCalledWith( - 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" error(s).' + 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' ); expect(logger.debug).toHaveBeenCalledWith( - 'Poll interval configuration changing from 3000 to 3600 after seeing 1 "too many request" and/or "execute [inline] script" error(s)' + 'Poll interval configuration changing from 3000 to 3600 after seeing 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' ); expect(logger.debug).toHaveBeenCalledWith('Task poller now using interval of 3600ms'); }); diff --git a/x-pack/plugins/task_manager/server/integration_tests/task_cost_check.test.ts b/x-pack/plugins/task_manager/server/integration_tests/task_cost_check.test.ts index 96678f714ac6..df11792b2c4a 100644 --- a/x-pack/plugins/task_manager/server/integration_tests/task_cost_check.test.ts +++ b/x-pack/plugins/task_manager/server/integration_tests/task_cost_check.test.ts @@ -12,6 +12,7 @@ import { import { TaskCost, TaskDefinition } from '../task'; import { setupTestServers } from './lib'; import { TaskTypeDictionary } from '../task_type_dictionary'; +import { sortBy } from 'lodash'; jest.mock('../task_type_dictionary', () => { const actual = jest.requireActual('../task_type_dictionary'); @@ -50,14 +51,17 @@ describe('Task cost checks', () => { it('detects tasks with cost definitions', async () => { const taskTypes = taskTypeDictionary.getAllDefinitions(); - const taskTypesWithCost = taskTypes - .map((taskType: TaskDefinition) => - !!taskType.cost ? { taskType: taskType.type, cost: taskType.cost } : null - ) - .filter( - (tt: { taskType: string; cost: TaskCost } | null) => - null != tt && tt.cost !== TaskCost.Normal - ); + const taskTypesWithCost = sortBy( + taskTypes + .map((taskType: TaskDefinition) => + !!taskType.cost ? { taskType: taskType.type, cost: taskType.cost } : null + ) + .filter( + (tt: { taskType: string; cost: TaskCost } | null) => + null != tt && tt.cost !== TaskCost.Normal + ), + 'taskType' + ); expect(taskTypesWithCost).toMatchSnapshot(); }); }); diff --git a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts index 3a4870b6a476..beb686c8ea4b 100644 --- a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts +++ b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.test.ts @@ -10,7 +10,11 @@ import { BACKGROUND_TASK_NODE_SO_NAME } from '../saved_objects'; import { SavedObjectsBulkDeleteResponse, SavedObjectsUpdateResponse } from '@kbn/core/server'; import { createFindResponse, createFindSO } from './mock_kibana_discovery_service'; -import { DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, DEFAULT_DISCOVERY_INTERVAL_MS } from '../config'; +import { + DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + DEFAULT_DISCOVERY_INTERVAL_MS, + DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS, +} from '../config'; const currentNode = 'current-node-id'; const now = '2024-08-10T10:00:00.000Z'; @@ -199,6 +203,49 @@ describe('KibanaDiscoveryService', () => { ); }); + it('reschedules discovery job in case of cluster_block_exception', async () => { + savedObjectsRepository.update.mockResolvedValueOnce( + {} as SavedObjectsUpdateResponse + ); + + const kibanaDiscoveryService = new KibanaDiscoveryService({ + savedObjectsRepository, + logger, + currentNode, + config: { + active_nodes_lookback: DEFAULT_ACTIVE_NODES_LOOK_BACK_DURATION, + interval: DEFAULT_DISCOVERY_INTERVAL_MS, + }, + }); + await kibanaDiscoveryService.start(); + + expect(kibanaDiscoveryService.isStarted()).toBe(true); + expect(setTimeout).toHaveBeenCalledTimes(1); + expect(setTimeout).toHaveBeenNthCalledWith( + 1, + expect.any(Function), + DEFAULT_DISCOVERY_INTERVAL_MS + ); + + savedObjectsRepository.update.mockRejectedValueOnce( + new Error('failed due to cluster_block_exception, task_manager index') + ); + + await jest.advanceTimersByTimeAsync(15000); + + expect(savedObjectsRepository.update).toHaveBeenCalledTimes(2); + expect(setTimeout).toHaveBeenCalledTimes(2); + expect(setTimeout).toHaveBeenNthCalledWith( + 2, + expect.any(Function), + DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS + ); + expect(logger.error).toHaveBeenCalledTimes(1); + expect(logger.error).toHaveBeenCalledWith( + "Kibana Discovery Service couldn't update this node's last_seen timestamp. id: current-node-id, last_seen: 2024-08-10T10:00:10.000Z, error:failed due to cluster_block_exception, task_manager index" + ); + }); + it('does not schedule when Kibana is shutting down', async () => { savedObjectsRepository.update.mockResolvedValueOnce( {} as SavedObjectsUpdateResponse diff --git a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts index 1c4fcb00981a..fbd797355d1e 100644 --- a/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts +++ b/x-pack/plugins/task_manager/server/kibana_discovery_service/kibana_discovery_service.ts @@ -9,7 +9,8 @@ import type { ISavedObjectsRepository } from '@kbn/core/server'; import { Logger } from '@kbn/core/server'; import { BACKGROUND_TASK_NODE_SO_NAME } from '../saved_objects'; import { BackgroundTaskNode } from '../saved_objects/schemas/background_task_node'; -import { TaskManagerConfig } from '../config'; +import { DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS, TaskManagerConfig } from '../config'; +import { isClusterBlockException } from '../lib/bulk_update_error'; interface DiscoveryServiceParams { config: TaskManagerConfig['discovery']; @@ -59,6 +60,7 @@ export class KibanaDiscoveryService { } private async scheduleUpsertCurrentNode() { + let retryInterval = this.discoveryInterval; if (!this.stopped) { const lastSeenDate = new Date(); const lastSeen = lastSeenDate.toISOString(); @@ -69,9 +71,12 @@ export class KibanaDiscoveryService { this.started = true; } } catch (e) { + if (isClusterBlockException(e)) { + retryInterval = DISCOVERY_INTERVAL_AFTER_BLOCK_EXCEPTION_MS; + } if (!this.started) { this.logger.error( - `Kibana Discovery Service couldn't be started and will be retried in ${this.discoveryInterval}ms, error:${e.message}` + `Kibana Discovery Service couldn't be started and will be retried in ${retryInterval}ms, error:${e.message}` ); } else { this.logger.error( @@ -82,7 +87,7 @@ export class KibanaDiscoveryService { this.timer = setTimeout( async () => await this.scheduleUpsertCurrentNode(), // The timeout should not be less than the default timeout of two seconds - Math.max(this.discoveryInterval - (Date.now() - lastSeenDate.getTime()), DEFAULT_TIMEOUT) + Math.max(retryInterval - (Date.now() - lastSeenDate.getTime()), DEFAULT_TIMEOUT) ); } } diff --git a/x-pack/plugins/task_manager/server/lib/bulk_update_error.ts b/x-pack/plugins/task_manager/server/lib/bulk_update_error.ts index f7e0552e5a73..822980f4f946 100644 --- a/x-pack/plugins/task_manager/server/lib/bulk_update_error.ts +++ b/x-pack/plugins/task_manager/server/lib/bulk_update_error.ts @@ -43,3 +43,10 @@ export function getBulkUpdateErrorType(error: Error | BulkUpdateError): string | return (error as BulkUpdateError).type; } } + +export function isClusterBlockException(error: Error | BulkUpdateError): boolean { + return ( + getBulkUpdateErrorType(error) === 'cluster_block_exception' || + error.message.includes('cluster_block_exception') + ); +} diff --git a/x-pack/plugins/task_manager/server/lib/create_managed_configuration.test.ts b/x-pack/plugins/task_manager/server/lib/create_managed_configuration.test.ts index d453edc8e700..cd13ac20026e 100644 --- a/x-pack/plugins/task_manager/server/lib/create_managed_configuration.test.ts +++ b/x-pack/plugins/task_manager/server/lib/create_managed_configuration.test.ts @@ -11,6 +11,7 @@ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; import { createManagedConfiguration, ADJUST_THROUGHPUT_INTERVAL, + INTERVAL_AFTER_BLOCK_EXCEPTION, } from './create_managed_configuration'; import { mockLogger } from '../test_utils'; import { CLAIM_STRATEGY_UPDATE_BY_QUERY, CLAIM_STRATEGY_MGET, TaskManagerConfig } from '../config'; @@ -420,12 +421,29 @@ describe('createManagedConfiguration()', () => { expect(subscription).toHaveBeenNthCalledWith(2, 120); }); + test('should increase configuration at the next interval when an error with cluster_block_exception type is emitted, then decreases back to normal', async () => { + const { subscription, errors$ } = setupScenario(100); + errors$.next( + new BulkUpdateError({ + statusCode: 403, + message: 'index is blocked', + type: 'cluster_block_exception', + }) + ); + expect(subscription).toHaveBeenNthCalledWith(1, 100); + // It emits the error with cluster_block_exception type immediately + expect(subscription).toHaveBeenNthCalledWith(2, INTERVAL_AFTER_BLOCK_EXCEPTION); + clock.tick(INTERVAL_AFTER_BLOCK_EXCEPTION); + expect(subscription).toHaveBeenCalledTimes(3); + expect(subscription).toHaveBeenNthCalledWith(3, 100); + }); + test('should log a warning when the configuration changes from the starting value', async () => { const { errors$ } = setupScenario(100); errors$.next(SavedObjectsErrorHelpers.createTooManyRequestsError('a', 'b')); clock.tick(ADJUST_THROUGHPUT_INTERVAL); expect(logger.warn).toHaveBeenCalledWith( - 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" error(s).' + 'Poll interval configuration is temporarily increased after Elasticsearch returned 1 "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).' ); }); diff --git a/x-pack/plugins/task_manager/server/lib/create_managed_configuration.ts b/x-pack/plugins/task_manager/server/lib/create_managed_configuration.ts index 00736f2c36cd..2105f29e9c61 100644 --- a/x-pack/plugins/task_manager/server/lib/create_managed_configuration.ts +++ b/x-pack/plugins/task_manager/server/lib/create_managed_configuration.ts @@ -13,11 +13,12 @@ import { isEsCannotExecuteScriptError } from './identify_es_error'; import { CLAIM_STRATEGY_MGET, DEFAULT_CAPACITY, MAX_CAPACITY, TaskManagerConfig } from '../config'; import { TaskCost } from '../task'; import { getMsearchStatusCode } from './msearch_error'; -import { getBulkUpdateStatusCode } from './bulk_update_error'; +import { getBulkUpdateStatusCode, isClusterBlockException } from './bulk_update_error'; const FLUSH_MARKER = Symbol('flush'); export const ADJUST_THROUGHPUT_INTERVAL = 10 * 1000; export const PREFERRED_MAX_POLL_INTERVAL = 60 * 1000; +export const INTERVAL_AFTER_BLOCK_EXCEPTION = 61 * 1000; // Capacity is measured in number of normal cost tasks that can be run // At a minimum, we need to be able to run a single task with the greatest cost @@ -46,6 +47,11 @@ interface ManagedConfigurationOpts { logger: Logger; } +interface ErrorScanResult { + count: number; + isBlockException: boolean; +} + export interface ManagedConfiguration { startingCapacity: number; capacityConfiguration$: Observable; @@ -77,87 +83,112 @@ export function createManagedConfiguration({ } function createCapacityScan(config: TaskManagerConfig, logger: Logger, startingCapacity: number) { - return scan((previousCapacity: number, errorCount: number) => { - let newCapacity: number; - if (errorCount > 0) { - const minCapacity = getMinCapacity(config); - // Decrease capacity by CAPACITY_DECREASE_PERCENTAGE while making sure it doesn't go lower than minCapacity. - // Using Math.floor to make sure the number is different than previous while not being a decimal value. - newCapacity = Math.max( - Math.floor(previousCapacity * CAPACITY_DECREASE_PERCENTAGE), - minCapacity - ); - } else { - // Increase capacity by CAPACITY_INCREASE_PERCENTAGE while making sure it doesn't go - // higher than the starting value. Using Math.ceil to make sure the number is different than - // previous while not being a decimal value - newCapacity = Math.min( - startingCapacity, - Math.ceil(previousCapacity * CAPACITY_INCREASE_PERCENTAGE) - ); - } - - if (newCapacity !== previousCapacity) { - logger.debug( - `Capacity configuration changing from ${previousCapacity} to ${newCapacity} after seeing ${errorCount} "too many request" and/or "execute [inline] script" error(s)` - ); - if (previousCapacity === startingCapacity) { - logger.warn( - `Capacity configuration is temporarily reduced after Elasticsearch returned ${errorCount} "too many request" and/or "execute [inline] script" error(s).` + return scan( + (previousCapacity: number, { count: errorCount, isBlockException }: ErrorScanResult) => { + let newCapacity: number; + if (isBlockException) { + newCapacity = previousCapacity; + } else { + if (errorCount > 0) { + const minCapacity = getMinCapacity(config); + // Decrease capacity by CAPACITY_DECREASE_PERCENTAGE while making sure it doesn't go lower than minCapacity. + // Using Math.floor to make sure the number is different than previous while not being a decimal value. + newCapacity = Math.max( + Math.floor(previousCapacity * CAPACITY_DECREASE_PERCENTAGE), + minCapacity + ); + } else { + // Increase capacity by CAPACITY_INCREASE_PERCENTAGE while making sure it doesn't go + // higher than the starting value. Using Math.ceil to make sure the number is different than + // previous while not being a decimal value + newCapacity = Math.min( + startingCapacity, + Math.ceil(previousCapacity * CAPACITY_INCREASE_PERCENTAGE) + ); + } + } + + if (newCapacity !== previousCapacity) { + logger.debug( + `Capacity configuration changing from ${previousCapacity} to ${newCapacity} after seeing ${errorCount} "too many request" and/or "execute [inline] script" error(s)` ); + if (previousCapacity === startingCapacity) { + logger.warn( + `Capacity configuration is temporarily reduced after Elasticsearch returned ${errorCount} "too many request" and/or "execute [inline] script" error(s).` + ); + } } - } - return newCapacity; - }, startingCapacity); + return newCapacity; + }, + startingCapacity + ); } function createPollIntervalScan(logger: Logger, startingPollInterval: number) { - return scan((previousPollInterval: number, errorCount: number) => { - let newPollInterval: number; - if (errorCount > 0) { - // Increase poll interval by POLL_INTERVAL_INCREASE_PERCENTAGE and use Math.ceil to - // make sure the number is different than previous while not being a decimal value. - // Also ensure we don't go over PREFERRED_MAX_POLL_INTERVAL or startingPollInterval, - // whichever is greater. - newPollInterval = Math.min( - Math.ceil(previousPollInterval * POLL_INTERVAL_INCREASE_PERCENTAGE), - Math.ceil(Math.max(PREFERRED_MAX_POLL_INTERVAL, startingPollInterval)) - ); - if (!Number.isSafeInteger(newPollInterval) || newPollInterval < 0) { - logger.error( - `Poll interval configuration had an issue calculating the new poll interval: Math.min(Math.ceil(${previousPollInterval} * ${POLL_INTERVAL_INCREASE_PERCENTAGE}), Math.max(${PREFERRED_MAX_POLL_INTERVAL}, ${startingPollInterval})) = ${newPollInterval}, will keep the poll interval unchanged (${previousPollInterval})` - ); - newPollInterval = previousPollInterval; - } - } else { - // Decrease poll interval by POLL_INTERVAL_DECREASE_PERCENTAGE and use Math.floor to - // make sure the number is different than previous while not being a decimal value. - newPollInterval = Math.max( - startingPollInterval, - Math.floor(previousPollInterval * POLL_INTERVAL_DECREASE_PERCENTAGE) - ); - if (!Number.isSafeInteger(newPollInterval) || newPollInterval < 0) { - logger.error( - `Poll interval configuration had an issue calculating the new poll interval: Math.max(${startingPollInterval}, Math.floor(${previousPollInterval} * ${POLL_INTERVAL_DECREASE_PERCENTAGE})) = ${newPollInterval}, will keep the poll interval unchanged (${previousPollInterval})` - ); - newPollInterval = previousPollInterval; + return scan( + (previousPollInterval: number, { count: errorCount, isBlockException }: ErrorScanResult) => { + let newPollInterval: number; + if (isBlockException) { + newPollInterval = INTERVAL_AFTER_BLOCK_EXCEPTION; + } else { + if (errorCount > 0) { + // Increase poll interval by POLL_INTERVAL_INCREASE_PERCENTAGE and use Math.ceil to + // make sure the number is different than previous while not being a decimal value. + // Also ensure we don't go over PREFERRED_MAX_POLL_INTERVAL or startingPollInterval, + // whichever is greater. + newPollInterval = Math.min( + Math.ceil(previousPollInterval * POLL_INTERVAL_INCREASE_PERCENTAGE), + Math.ceil(Math.max(PREFERRED_MAX_POLL_INTERVAL, startingPollInterval)) + ); + if (!Number.isSafeInteger(newPollInterval) || newPollInterval < 0) { + logger.error( + `Poll interval configuration had an issue calculating the new poll interval: Math.min(Math.ceil(${previousPollInterval} * ${POLL_INTERVAL_INCREASE_PERCENTAGE}), Math.max(${PREFERRED_MAX_POLL_INTERVAL}, ${startingPollInterval})) = ${newPollInterval}, will keep the poll interval unchanged (${previousPollInterval})` + ); + newPollInterval = previousPollInterval; + } + } else { + if (previousPollInterval === INTERVAL_AFTER_BLOCK_EXCEPTION) { + newPollInterval = startingPollInterval; + } else { + // Decrease poll interval by POLL_INTERVAL_DECREASE_PERCENTAGE and use Math.floor to + // make sure the number is different than previous while not being a decimal value. + newPollInterval = Math.max( + startingPollInterval, + Math.floor(previousPollInterval * POLL_INTERVAL_DECREASE_PERCENTAGE) + ); + } + + if (!Number.isSafeInteger(newPollInterval) || newPollInterval < 0) { + logger.error( + `Poll interval configuration had an issue calculating the new poll interval: Math.max(${startingPollInterval}, Math.floor(${previousPollInterval} * ${POLL_INTERVAL_DECREASE_PERCENTAGE})) = ${newPollInterval}, will keep the poll interval unchanged (${previousPollInterval})` + ); + newPollInterval = previousPollInterval; + } + } } - } - if (newPollInterval !== previousPollInterval) { - logger.debug( - `Poll interval configuration changing from ${previousPollInterval} to ${newPollInterval} after seeing ${errorCount} "too many request" and/or "execute [inline] script" error(s)` - ); - if (previousPollInterval === startingPollInterval) { - logger.warn( - `Poll interval configuration is temporarily increased after Elasticsearch returned ${errorCount} "too many request" and/or "execute [inline] script" error(s).` - ); + + if (newPollInterval !== previousPollInterval) { + if (previousPollInterval !== INTERVAL_AFTER_BLOCK_EXCEPTION) { + logger.debug( + `Poll interval configuration changing from ${previousPollInterval} to ${newPollInterval} after seeing ${errorCount} "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).` + ); + } + if (previousPollInterval === startingPollInterval) { + logger.warn( + `Poll interval configuration is temporarily increased after Elasticsearch returned ${errorCount} "too many request" and/or "execute [inline] script" and/or "cluster_block_exception" error(s).` + ); + } } - } - return newPollInterval; - }, startingPollInterval); + return newPollInterval; + }, + startingPollInterval + ); } -function countErrors(errors$: Observable, countInterval: number): Observable { +function countErrors( + errors$: Observable, + countInterval: number +): Observable { return merge( // Flush error count at fixed interval interval(countInterval).pipe(map(() => FLUSH_MARKER)), @@ -173,36 +204,48 @@ function countErrors(errors$: Observable, countInterval: number): Observa getMsearchStatusCode(e) === 503 || getBulkUpdateStatusCode(e) === 429 || getBulkUpdateStatusCode(e) === 500 || - getBulkUpdateStatusCode(e) === 503 + getBulkUpdateStatusCode(e) === 503 || + isClusterBlockException(e) ) ) ).pipe( // When tag is "flush", reset the error counter // Otherwise increment the error counter - mergeScan(({ count }, next) => { + mergeScan(({ count, isBlockException }, next) => { return next === FLUSH_MARKER - ? of(emitErrorCount(count), resetErrorCount()) - : of(incementErrorCount(count)); - }, emitErrorCount(0)), + ? of(emitErrorCount(count, isBlockException), resetErrorCount()) + : of(incrementOrEmitErrorCount(count, isClusterBlockException(next as Error))); + }, emitErrorCount(0, false)), filter(isEmitEvent), - map(({ count }) => count) + map(({ count, isBlockException }) => { + return { count, isBlockException }; + }) ); } -function emitErrorCount(count: number) { +function emitErrorCount(count: number, isBlockException: boolean) { return { tag: 'emit', + isBlockException, count, }; } -function isEmitEvent(event: { tag: string; count: number }) { +function isEmitEvent(event: { tag: string; count: number; isBlockException: boolean }) { return event.tag === 'emit'; } -function incementErrorCount(count: number) { +function incrementOrEmitErrorCount(count: number, isBlockException: boolean) { + if (isBlockException) { + return { + tag: 'emit', + isBlockException, + count: count + 1, + }; + } return { tag: 'inc', + isBlockException, count: count + 1, }; } @@ -210,6 +253,7 @@ function incementErrorCount(count: number) { function resetErrorCount() { return { tag: 'initial', + isBlockException: false, count: 0, }; } diff --git a/x-pack/plugins/task_manager/server/saved_objects/mappings.ts b/x-pack/plugins/task_manager/server/saved_objects/mappings.ts index 8ad641b56a58..7ebd5091c7d4 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/mappings.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/mappings.ts @@ -65,6 +65,9 @@ export const taskMappings: SavedObjectsTypeMappingDefinition = { partition: { type: 'integer', }, + priority: { + type: 'integer', + }, }, }; diff --git a/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts b/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts index 775b3ea2f8ca..4c7ae514f0bb 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/model_versions/task_model_versions.ts @@ -6,7 +6,7 @@ */ import { SavedObjectsModelVersionMap } from '@kbn/core-saved-objects-server'; -import { taskSchemaV1, taskSchemaV2 } from '../schemas/task'; +import { taskSchemaV1, taskSchemaV2, taskSchemaV3 } from '../schemas/task'; export const taskModelVersions: SavedObjectsModelVersionMap = { '1': { @@ -35,4 +35,18 @@ export const taskModelVersions: SavedObjectsModelVersionMap = { create: taskSchemaV2, }, }, + '3': { + changes: [ + { + type: 'mappings_addition', + addedMappings: { + priority: { type: 'integer' }, + }, + }, + ], + schemas: { + forwardCompatibility: taskSchemaV3.extends({}, { unknowns: 'ignore' }), + create: taskSchemaV3, + }, + }, }; diff --git a/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts index 2a6ee5c92198..b6e724099912 100644 --- a/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts +++ b/x-pack/plugins/task_manager/server/saved_objects/schemas/task.ts @@ -42,3 +42,7 @@ export const taskSchemaV1 = schema.object({ export const taskSchemaV2 = taskSchemaV1.extends({ partition: schema.maybe(schema.number()), }); + +export const taskSchemaV3 = taskSchemaV2.extends({ + priority: schema.maybe(schema.number()), +}); diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json index d5b0514b6491..22b1e3c3071e 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_observability.json @@ -1,3 +1,136 @@ { - "properties": {} + "properties": { + "investigation": { + "properties": { + "investigation": { + "properties": { + "total": { + "type": "long", + "_meta": { + "description": "The total number of investigations in the cluster" + } + }, + "by_status": { + "properties": { + "triage": { + "type": "long", + "_meta": { + "description": "The number of investigations in triage status in the cluster" + } + }, + "active": { + "type": "long", + "_meta": { + "description": "The number of investigations in active status in the cluster" + } + }, + "mitigated": { + "type": "long", + "_meta": { + "description": "The number of investigations in mitigated status in the cluster" + } + }, + "resolved": { + "type": "long", + "_meta": { + "description": "The number of investigations in resolved status in the cluster" + } + }, + "cancelled": { + "type": "long", + "_meta": { + "description": "The number of investigations in cancelled status in the cluster" + } + } + } + }, + "by_origin": { + "properties": { + "alert": { + "type": "long", + "_meta": { + "description": "The number of investigations created from alerts in the cluster" + } + }, + "blank": { + "type": "long", + "_meta": { + "description": "The number of investigations created from scratch in the cluster" + } + } + } + }, + "items": { + "properties": { + "avg": { + "type": "long", + "_meta": { + "description": "The average number of items across all investigations in the cluster" + } + }, + "p90": { + "type": "long", + "_meta": { + "description": "The 90th percentile of the number of items across all investigations in the cluster" + } + }, + "p95": { + "type": "long", + "_meta": { + "description": "The 95th percentile of the number of items across all investigations in the cluster" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "The maximum number of items across all investigations in the cluster" + } + }, + "min": { + "type": "long", + "_meta": { + "description": "The minimum number of items across all investigations in the cluster" + } + } + } + }, + "notes": { + "properties": { + "avg": { + "type": "long", + "_meta": { + "description": "The average number of notes across all investigations in the cluster" + } + }, + "p90": { + "type": "long", + "_meta": { + "description": "The 90th percentile of the number of notes across all investigations in the cluster" + } + }, + "p95": { + "type": "long", + "_meta": { + "description": "The 95th percentile of the number of notes across all investigations in the cluster" + } + }, + "max": { + "type": "long", + "_meta": { + "description": "The maximum number of notes across all investigations in the cluster" + } + }, + "min": { + "type": "long", + "_meta": { + "description": "The minimum number of notes across all investigations in the cluster" + } + } + } + } + } + } + } + } + } } diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index eb9150f8482e..bdbd6e52ff1f 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -13643,138 +13643,6 @@ } } }, - "investigation": { - "properties": { - "investigation": { - "properties": { - "total": { - "type": "long", - "_meta": { - "description": "The total number of investigations in the cluster" - } - }, - "by_status": { - "properties": { - "triage": { - "type": "long", - "_meta": { - "description": "The number of investigations in triage status in the cluster" - } - }, - "active": { - "type": "long", - "_meta": { - "description": "The number of investigations in active status in the cluster" - } - }, - "mitigated": { - "type": "long", - "_meta": { - "description": "The number of investigations in mitigated status in the cluster" - } - }, - "resolved": { - "type": "long", - "_meta": { - "description": "The number of investigations in resolved status in the cluster" - } - }, - "cancelled": { - "type": "long", - "_meta": { - "description": "The number of investigations in cancelled status in the cluster" - } - } - } - }, - "by_origin": { - "properties": { - "alert": { - "type": "long", - "_meta": { - "description": "The number of investigations created from alerts in the cluster" - } - }, - "blank": { - "type": "long", - "_meta": { - "description": "The number of investigations created from scratch in the cluster" - } - } - } - }, - "items": { - "properties": { - "avg": { - "type": "long", - "_meta": { - "description": "The average number of items across all investigations in the cluster" - } - }, - "p90": { - "type": "long", - "_meta": { - "description": "The 90th percentile of the number of items across all investigations in the cluster" - } - }, - "p95": { - "type": "long", - "_meta": { - "description": "The 95th percentile of the number of items across all investigations in the cluster" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "The maximum number of items across all investigations in the cluster" - } - }, - "min": { - "type": "long", - "_meta": { - "description": "The minimum number of items across all investigations in the cluster" - } - } - } - }, - "notes": { - "properties": { - "avg": { - "type": "long", - "_meta": { - "description": "The average number of notes across all investigations in the cluster" - } - }, - "p90": { - "type": "long", - "_meta": { - "description": "The 90th percentile of the number of notes across all investigations in the cluster" - } - }, - "p95": { - "type": "long", - "_meta": { - "description": "The 95th percentile of the number of notes across all investigations in the cluster" - } - }, - "max": { - "type": "long", - "_meta": { - "description": "The maximum number of notes across all investigations in the cluster" - } - }, - "min": { - "type": "long", - "_meta": { - "description": "The minimum number of notes across all investigations in the cluster" - } - } - } - } - } - } - } - }, "kibana_settings": { "properties": { "xpack": { @@ -19470,6 +19338,22 @@ } } } + }, + "legacy_siem_signals": { + "properties": { + "non_migrated_indices_total": { + "type": "long", + "_meta": { + "description": "Total number of non migrated legacy siem signals indices" + } + }, + "spaces_total": { + "type": "long", + "_meta": { + "description": "Total number of Kibana spaces that have non migrated legacy siem signals indices" + } + } + } } } }, diff --git a/x-pack/plugins/threat_intelligence/README.md b/x-pack/plugins/threat_intelligence/README.md deleted file mode 100755 index 777e932f6d95..000000000000 --- a/x-pack/plugins/threat_intelligence/README.md +++ /dev/null @@ -1,91 +0,0 @@ -# Threat Intelligence - -Elastic Threat Intelligence makes it easy to analyze and investigate potential security threats by aggregating data from multiple sources in one place. You’ll be able to view data from all activated threat intelligence feeds and take action. - -### Where to find the UI for this plugin? - -The Threat Intelligence UI is displayed in Kibana Security, under the Explore section. - -## Development setup - -### Kibana development in general - -Best source - [internal Kibana docs](https://docs.elastic.dev/kibana-dev-docs/getting-started/welcome). If you have any issues with setting up your Kibana dev environment [#kibana](https://elastic.slack.com/archives/C0D8P2XK5) Slack channel is a good way to get help. - -### Essential `kibana.yml` settings - -You can make a copy of `kibana.yml` file into `kibana.dev.yml` and make adjustments to the settings. External documentation on the flags available is [here](https://www.elastic.co/guide/en/kibana/current/settings.html) - -It is recommended to set `server.basePath: "/kbn"` to make you local instance persist the base Kibana path. If you don't do it, the base path will be a random string every time you start Kibana. Any other value than `/kbn` will also work. - -### Getting Threat Intelligence feeds data into Kibana - -There are many ways to get data for you local development. We first focus on getting Threat Intelligence data specifically. - -### Setting up filebeat threatintel integrations locally - -1. install [mage](https://github.com/magefile/mage). It is a Go build tool used to build `beats`. Installation from the sources requires Go lang set up. A simpler option might be to install it from a package manager available in your system (eg. `brew` on MacOs) or use their [binary distribution](https://github.com/magefile/mage/releases) -1. start Elasticsearch and Kibana -1. clone [beats](https://github.com/elastic/beats) repository -1. inside beats repository, update `x-pack/filebeat/filebeat.yml` with your local Elasticsearch and Kibana connection configs - - ``` - output.elasticsearch: - hosts: ["localhost:9200"] - username: "elastic" - password: "changeme" - - setup.kibana: - host: "localhost:5601" // make sure to run Kibana with --no-base-path option or specify server.basePath in Kibana config and use it here as a path, eg. localhost:5601/kbn - ``` - -1. go into `x-pack/filebeat` (that's where security related modules live) -1. build filebeat `mage build` -1. enable `threatintel` module by running `./filebeat modules enable threatintel` -1. enable specific Threat Intelligence integrations by updating `modules.d/threatintel.yml`. Update `enable` to `true` in every integration you want to enable and configs specific for these integrations. The bare minimum is to enable Abuse.CH feeds `abuseurl`, `abusemalware` and `malwarebazaar`. -1. run `./filebeat setup -E setup.dashboards.directory=build/kibana` to set up predefined dashboards -1. run `./filebeat -e` to start filebeat -1. to validate that the set up works, wait for some Threat Intel data to be ingested and then go in Analytics > Discover in your local Kibana to search `event.category : threat and event.type : indicator`. You should see some documents returned by this search. Abuse.CH feeds are up to date so you should see the results from the last 7 days. - -### More ways to get data - -There are many more tools available for getting the data for testing or local development, depending on the data type and usecase. - -- Kibana development docs > [Add data](https://docs.elastic.dev/kibana-dev-docs/getting-started/sample-data) -- [Dev/Design/Testing Environments and Frameworks](https://docs.google.com/document/d/1DGCcLMnVKQ_STlkbS4E0m4kbPivNtR8iMlg_IoCuCEw/edit#) gathered by Security Engineering Productivity team - -### Generate fixtures for local testing - -You can generate large volumes of threat indicators on demand with the following script: - -``` -node scripts/generate_indicators.js -``` - -see the file in order to adjust the amount of indicators generated. The default is one million. - -## E2E - -### Running locally - -Cypress tests are integrated with the Security Solution ones. Please refer to https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/README.md for more information - -## FAQ - -### How is the Threat Intelligence code loaded in Kibana? - -The Threat Intelligence plugin is loaded lazily within the [security_solution](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution) plugin, -from `x-pack/plugins/security_solution/public/threat_intelligence` owned by the Threat Hunting Investigations Team. - -## QA and demo for implemented features - -One way to QA and demo the feature merged into `main` branch is to run the latest `main` locally. -Another option is to deploy a Staging instance. For Staging environment snapshots are being build every night with the latest state of the `main` branch. More documentation can be found [here](https://cloud.elastic.dev/environments/Staging/#automatic-termination-of-staging-deployments) - -## Contributing - -See [CONTRIBUTING.md](https://github.com/elastic/kibana/blob/main/x-pack/plugins/threat_intelligence/CONTRIBUTING.md) for information on contributing. - -## Issues - -Please report any issues in [this GitHub project](https://github.com/orgs/elastic/projects/758/). \ No newline at end of file diff --git a/x-pack/plugins/threat_intelligence/jest.config.js b/x-pack/plugins/threat_intelligence/jest.config.js deleted file mode 100644 index 8c8711ba5089..000000000000 --- a/x-pack/plugins/threat_intelligence/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../../', - roots: ['/x-pack/plugins/threat_intelligence'], -}; diff --git a/x-pack/plugins/threat_intelligence/tsconfig.json b/x-pack/plugins/threat_intelligence/tsconfig.json deleted file mode 100644 index 21109d162481..000000000000 --- a/x-pack/plugins/threat_intelligence/tsconfig.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - "scripts/**/*", - "public/**/*.json", - "server/**/*.json", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/cases-plugin", - "@kbn/timelines-plugin", - "@kbn/core", - "@kbn/data-plugin", - "@kbn/unified-search-plugin", - "@kbn/triggers-actions-ui-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/i18n-react", - "@kbn/data-views-plugin", - "@kbn/es-query", - "@kbn/rule-registry-plugin", - "@kbn/inspector-plugin", - "@kbn/shared-ux-page-kibana-template-types", - "@kbn/doc-links", - "@kbn/i18n", - "@kbn/kibana-react-plugin", - "@kbn/utility-types", - "@kbn/ui-theme", - "@kbn/securitysolution-io-ts-list-types", - "@kbn/core-ui-settings-browser", - "@kbn/search-types" - ], - "exclude": ["target/**/*"] -} diff --git a/x-pack/plugins/timelines/jest.config.js b/x-pack/plugins/timelines/jest.config.js deleted file mode 100644 index d26134d924e1..000000000000 --- a/x-pack/plugins/timelines/jest.config.js +++ /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. - */ - -module.exports = { - preset: '@kbn/test', - rootDir: '../../..', - roots: ['/x-pack/plugins/timelines'], - coverageDirectory: '/target/kibana-coverage/jest/x-pack/plugins/timelines', - coverageReporters: ['text', 'html'], - collectCoverageFrom: ['/x-pack/plugins/timelines/{common,public,server}/**/*.{ts,tsx}'], -}; diff --git a/x-pack/plugins/timelines/server/index.ts b/x-pack/plugins/timelines/server/index.ts deleted file mode 100644 index 929be7a34ab4..000000000000 --- a/x-pack/plugins/timelines/server/index.ts +++ /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 { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; -import { schema } from '@kbn/config-schema'; -import { ConfigSchema } from './config'; - -export async function plugin(initializerContext: PluginInitializerContext) { - const { TimelinesPlugin } = await import('./plugin'); - return new TimelinesPlugin(initializerContext); -} - -export type { TimelinesPluginUI, TimelinesPluginStart } from './types'; - -const configSchema = schema.object({ - /** - * For internal use. A list of string values (comma delimited) that will enable experimental - * type of functionality that is not yet released. Valid values for this settings need to - * be defined in: - * `x-pack/plugins/timelines/common/experimental_features.ts` - * under the `allowedExperimentalValues` object - * - * @example - * xpack.timelines.enableExperimental: - * - someCrazyFeature - * - someEvenCrazierFeature - */ - enableExperimental: schema.arrayOf(schema.string(), { - defaultValue: () => [], - }), -}); - -export const config: PluginConfigDescriptor = { - exposeToBrowser: { - enableExperimental: true, - }, - schema: configSchema, -}; diff --git a/x-pack/plugins/timelines/tsconfig.json b/x-pack/plugins/timelines/tsconfig.json deleted file mode 100644 index 7a317bdd7503..000000000000 --- a/x-pack/plugins/timelines/tsconfig.json +++ /dev/null @@ -1,47 +0,0 @@ - -{ - "extends": "../../../tsconfig.base.json", - "compilerOptions": { - "outDir": "target/types" - }, - "include": [ - "common/**/*", - "public/**/*", - "server/**/*", - // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 - "server/**/*.json", - "public/**/*.json", - "../../../typings/**/*" - ], - "kbn_references": [ - "@kbn/core", - "@kbn/data-plugin", - "@kbn/cases-plugin", - "@kbn/alerting-plugin", - "@kbn/utility-types", - "@kbn/es-query", - "@kbn/securitysolution-ecs", - "@kbn/securitysolution-t-grid", - "@kbn/rule-data-utils", - "@kbn/rule-registry-plugin", - "@kbn/data-views-plugin", - "@kbn/kibana-react-plugin", - "@kbn/kibana-utils-plugin", - "@kbn/ui-theme", - "@kbn/i18n-react", - "@kbn/i18n", - "@kbn/security-plugin", - "@kbn/safer-lodash-set", - "@kbn/alerts-as-data-utils", - "@kbn/logging", - "@kbn/search-errors", - "@kbn/search-types", - "@kbn/react-kibana-mount", - "@kbn/field-formats-plugin", - "@kbn/config-schema", - "@kbn/zod" - ], - "exclude": [ - "target/**/*" - ] -} diff --git a/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx b/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx index 233b67335392..8947cf9f6bbe 100644 --- a/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx +++ b/x-pack/plugins/triggers_actions_ui/.storybook/decorator.tsx @@ -50,6 +50,8 @@ const notifications: NotificationsStart = { showErrorDialog: () => {}, }; +const userProfile = { getUserProfile$: () => of(null) }; + export const StorybookContextDecorator: FC> = ( props ) => { @@ -75,7 +77,7 @@ export const StorybookContextDecorator: FC - + { }; export const App = ({ deps }: { deps: TriggersAndActionsUiServices }) => { - const { dataViews, i18n, theme } = deps; + const { dataViews } = deps; setDataViewsService(dataViews); return ( - + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/connectors_app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/connectors_app.tsx index 8fe0d9745d1c..f00db5879120 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/connectors_app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/connectors_app.tsx @@ -73,13 +73,13 @@ export const renderApp = (deps: TriggersAndActionsUiServices) => { }; export const App = ({ deps }: { deps: TriggersAndActionsUiServices }) => { - const { dataViews, i18n, theme } = deps; + const { dataViews } = deps; const sections: Section[] = ['connectors', 'logs']; const sectionsRegex = sections.join('|'); setDataViewsService(dataViews); return ( - + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_edit_response.tsx b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_edit_response.tsx index b1d69c89094e..c07cc9ac770d 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_edit_response.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_edit_response.tsx @@ -65,6 +65,7 @@ export function useBulkEditResponse(props: UseBulkEditResponseProps) { const { i18n: i18nStart, theme, + userProfile, notifications: { toasts }, } = useKibana().services; @@ -124,7 +125,11 @@ export function useBulkEditResponse(props: UseBulkEditResponseProps) { if (numberOfErrors === total) { toasts.addDanger({ title: failureMessage(numberOfErrors, translationMap[property]), - text: toMountPoint(renderToastErrorBody(response), { i18n: i18nStart, theme }), + text: toMountPoint(renderToastErrorBody(response), { + i18n: i18nStart, + theme, + userProfile, + }), }); return; } @@ -132,10 +137,10 @@ export function useBulkEditResponse(props: UseBulkEditResponseProps) { // Some failure toasts.addWarning({ title: someSuccessMessage(numberOfSuccess, numberOfErrors, translationMap[property]), - text: toMountPoint(renderToastErrorBody(response), { i18n: i18nStart, theme }), + text: toMountPoint(renderToastErrorBody(response), { i18n: i18nStart, theme, userProfile }), }); }, - [i18nStart, theme, toasts, renderToastErrorBody] + [i18nStart, theme, userProfile, toasts, renderToastErrorBody] ); return useMemo(() => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_operation_toast.tsx b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_operation_toast.tsx index 88ad5c8f5295..8d2d8d98b115 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_operation_toast.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_bulk_operation_toast.tsx @@ -50,6 +50,7 @@ export const useBulkOperationToast = ({ const { i18n, theme, + userProfile, notifications: { toasts }, } = useKibana().services; @@ -122,7 +123,7 @@ export const useBulkOperationToast = ({ SINGLE_RULE_TITLE, MULTIPLE_RULE_TITLE ), - text: toMountPoint(renderToastErrorBody(errors, 'danger'), { i18n, theme }), + text: toMountPoint(renderToastErrorBody(errors, 'danger'), { i18n, theme, userProfile }), }); return; } @@ -135,10 +136,10 @@ export const useBulkOperationToast = ({ SINGLE_RULE_TITLE, MULTIPLE_RULE_TITLE ), - text: toMountPoint(renderToastErrorBody(errors, 'warning'), { i18n, theme }), + text: toMountPoint(renderToastErrorBody(errors, 'warning'), { i18n, theme, userProfile }), }); }, - [i18n, theme, toasts, renderToastErrorBody] + [i18n, theme, userProfile, toasts, renderToastErrorBody] ); return useMemo(() => { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/rules_app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/rules_app.tsx index 8550518edb45..2477d9d95c4b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/rules_app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/rules_app.tsx @@ -101,13 +101,13 @@ export const renderApp = (deps: TriggersAndActionsUiServices) => { }; export const App = ({ deps }: { deps: TriggersAndActionsUiServices }) => { - const { dataViews, i18n, theme } = deps; + const { dataViews } = deps; const sections: Section[] = ['rules', 'logs']; const sectionsRegex = sections.join('|'); setDataViewsService(dataViews); return ( - + diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx index afb483b70f00..5fdd96611d71 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/action_connector_form/connectors_selection.test.tsx @@ -94,7 +94,7 @@ describe('connectors_selection', () => { it('renders a selector', () => { const wrapper = mountWithIntl( - + { it('renders the title of the connector', () => { render( - + { const renderModalInspectQuery = () => { const theme = { theme$: of({ darkMode: false, name: 'amsterdam' }) }; + const userProfile = userProfileServiceMock.createStart(); return render(, { wrapper: ({ children }) => ( - {children} + + {children} + ), }); }; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx index da1bd753af9b..767b7cf70b9b 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_details/components/rule_details.tsx @@ -108,6 +108,7 @@ export const RuleDetails: React.FunctionComponent = ({ http, i18n: i18nStart, theme, + userProfile, notifications: { toasts }, } = useKibana().services; @@ -223,7 +224,7 @@ export const RuleDetails: React.FunctionComponent = ({ )} , - { i18n: i18nStart, theme } + { i18n: i18nStart, theme, userProfile } ), }); } @@ -232,6 +233,7 @@ export const RuleDetails: React.FunctionComponent = ({ }, [ i18nStart, theme, + userProfile, rule.schedule.interval, config.minimumScheduleInterval, toasts, diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx index 99a9e0761eb9..419f4c769637 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_add.tsx @@ -132,9 +132,8 @@ const RuleAdd = < http, notifications: { toasts }, application: { capabilities }, - i18n: i18nStart, - theme, isServerless, + ...startServices } = useKibana().services; const canShowActions = hasShowActionsCapability(capabilities); @@ -284,7 +283,7 @@ const RuleAdd = < ...(message.details && { text: toMountPoint( {message.details}, - { i18n: i18nStart, theme } + startServices ), }), }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx index 3400f8c5270f..5d1337063948 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_edit.tsx @@ -140,9 +140,8 @@ export const RuleEdit = < const { http, notifications: { toasts }, - i18n: i18nStart, - theme, isServerless, + ...startServices } = useKibana().services; const setRule = (value: Rule) => { @@ -238,7 +237,7 @@ export const RuleEdit = < ...(message.details && { text: toMountPoint( {message.details}, - { i18n: i18nStart, theme } + startServices ), }), }); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_route.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_route.tsx index f0ecb56d0bc8..bfa4bccd4940 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_route.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rule_form/rule_form_route.tsx @@ -17,8 +17,6 @@ import { getCurrentDocTitle } from '../../lib/doc_title'; export const RuleFormRoute = () => { const { http, - i18n, - theme, application, notifications, charts, @@ -31,6 +29,7 @@ export const RuleFormRoute = () => { actionTypeRegistry, chrome, setBreadcrumbs, + ...startServices } = useKibana().services; const location = useLocation<{ returnApp?: string; returnPath?: string }>(); @@ -64,8 +63,6 @@ export const RuleFormRoute = () => { { docLinks, ruleTypeRegistry, actionTypeRegistry, + ...startServices, }} onCancel={() => { if (returnApp && returnPath) { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx index 6ad7d525c350..27f05487fb6e 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rule_status_dropdown.tsx @@ -63,6 +63,7 @@ export const RuleStatusDropdown: React.FunctionComponent = ({ notifications: { toasts }, i18n: i18nStart, theme, + userProfile, } = useKibana().services; const [isUpdating, setIsUpdating] = useState(false); @@ -86,12 +87,12 @@ export const RuleStatusDropdown: React.FunctionComponent = ({ ...(message.details && { text: toMountPoint( {message.details}, - { i18n: i18nStart, theme } + { i18n: i18nStart, theme, userProfile } ), }), }); throw new Error(); - }, [i18nStart, theme, enableRule, toasts]); + }, [i18nStart, theme, userProfile, enableRule, toasts]); const onEnable = useCallback(async () => { setIsUpdating(true); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx index f8a01e6f47f2..f956a16d3d23 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.test.tsx @@ -1382,7 +1382,8 @@ describe('rules_list with show only capability', () => { }); }); -describe('MaintenanceWindowsMock', () => { +// FLAKY: https://github.com/elastic/kibana/issues/203179 +describe.skip('MaintenanceWindowsMock', () => { beforeEach(() => { fetchActiveMaintenanceWindowsMock.mockResolvedValue([]); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx index d1d1ce4fe6a3..b827307cecdf 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list.tsx @@ -196,8 +196,7 @@ export const RulesList = ({ kibanaFeatures, notifications: { toasts }, ruleTypeRegistry, - i18n: i18nStart, - theme, + ...startServices } = kibanaServices; const canExecuteActions = hasExecuteActionsCapability(capabilities); @@ -715,7 +714,7 @@ export const RulesList = ({ title: parsedError.summary, text: toMountPoint( {parsedError.details}, - { theme, i18n: i18nStart } + startServices ), }); } else { diff --git a/x-pack/plugins/triggers_actions_ui/tsconfig.json b/x-pack/plugins/triggers_actions_ui/tsconfig.json index 7b947f560db8..7004ad1b1b08 100644 --- a/x-pack/plugins/triggers_actions_ui/tsconfig.json +++ b/x-pack/plugins/triggers_actions_ui/tsconfig.json @@ -73,7 +73,8 @@ "@kbn/observability-alerting-rule-utils", "@kbn/core-application-browser", "@kbn/cloud-plugin", - "@kbn/response-ops-rule-form" + "@kbn/response-ops-rule-form", + "@kbn/core-user-profile-browser-mocks" ], "exclude": ["target/**/*"] } diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.test.tsx b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.test.tsx index 29600c855dcb..fe41b89de3e0 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.test.tsx +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecation_logs/es_deprecation_logs.test.tsx @@ -18,12 +18,10 @@ import { APPS_WITH_DEPRECATION_LOGS, DEPRECATION_LOGS_ORIGIN_FIELD, } from '../../../common/constants'; -import { stringifySearchParams } from '../helpers/app_context.mock'; // Once the logs team register the kibana locators in their app, we should be able // to remove this mock and follow a similar approach to how discover link is tested. // See: https://github.com/elastic/kibana/issues/104855 -const MOCKED_TIME = '2021-09-05T10:49:01.805Z'; jest.mock('../../../public/application/lib/logs_checkpoint', () => { const originalModule = jest.requireActual('../../../public/application/lib/logs_checkpoint'); @@ -157,40 +155,6 @@ describe('ES deprecation logs', () => { httpRequestsMockHelpers.setLoadDeprecationLoggingResponse(getLoggingResponse(true)); }); - test('Has a link to see logs in observability app', async () => { - await act(async () => { - testBed = await setupESDeprecationLogsPage(httpSetup, { - http: { - basePath: { - prepend: (url: string) => url, - }, - }, - }); - }); - - const { component, exists, find } = testBed; - - component.update(); - - expect(exists('viewObserveLogs')).toBe(true); - const locatorParams = stringifySearchParams({ - id: DEPRECATION_LOGS_INDEX, - timeRange: { - from: MOCKED_TIME, - to: 'now', - }, - query: { - language: 'kuery', - query: `not ${DEPRECATION_LOGS_ORIGIN_FIELD} : (${APPS_WITH_DEPRECATION_LOGS.join( - ' or ' - )})`, - }, - }); - const href = find('viewObserveLogs').props().href; - expect(href).toContain('logsExplorerUrl'); - expect(href).toContain(locatorParams); - }); - test('Has a link to see logs in discover app', async () => { await act(async () => { testBed = await setupESDeprecationLogsPage(httpSetup); diff --git a/x-pack/plugins/upgrade_assistant/common/types.ts b/x-pack/plugins/upgrade_assistant/common/types.ts index 781e4865ee56..54b175a42851 100644 --- a/x-pack/plugins/upgrade_assistant/common/types.ts +++ b/x-pack/plugins/upgrade_assistant/common/types.ts @@ -121,8 +121,8 @@ export interface ReindexOperation { export type ReindexSavedObject = SavedObject; -// 7.0 -> 8.0 warnings -export type ReindexWarningTypes = 'customTypeName' | 'indexSetting' | 'replaceIndexWithAlias'; +// 8.0 -> 9.0 warnings +export type ReindexWarningTypes = 'indexSetting' | 'replaceIndexWithAlias'; export interface ReindexWarning { warningType: ReindexWarningTypes; @@ -130,8 +130,6 @@ export interface ReindexWarning { * Optional metadata for deprecations * * @remark - * For example, for the "customTypeName" deprecation, - * we want to surface the typeName to the user. * For "indexSetting" we want to surface the deprecated settings. */ meta?: { diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx index c96a17ed9e2e..aef1dbfc0087 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecation_logs/fix_deprecation_logs/external_links.tsx @@ -10,23 +10,15 @@ import { buildPhrasesFilter, PhrasesFilter } from '@kbn/es-query'; import { FormattedMessage } from '@kbn/i18n-react'; import { METRIC_TYPE } from '@kbn/analytics'; -import { EuiLink, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiPanel, EuiText } from '@elastic/eui'; +import { EuiLink, EuiSpacer, EuiText } from '@elastic/eui'; import { DataView } from '@kbn/data-views-plugin/common'; -import { - OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR_ID, - ObsLogsExplorerDataViewLocatorParams, -} from '@kbn/deeplinks-observability'; import { APPS_WITH_DEPRECATION_LOGS, DEPRECATION_LOGS_ORIGIN_FIELD, } from '../../../../../common/constants'; import { DataPublicPluginStart } from '../../../../shared_imports'; import { useAppContext } from '../../../app_context'; -import { - uiMetricService, - UIM_OBSERVABILITY_CLICK, - UIM_DISCOVER_CLICK, -} from '../../../lib/ui_metric'; +import { uiMetricService, UIM_DISCOVER_CLICK } from '../../../lib/ui_metric'; import { DEPRECATION_LOGS_INDEX_PATTERN } from '../../../../../common/constants'; @@ -129,48 +121,6 @@ const DiscoverAppLink: FunctionComponent = ({ checkpoint, deprecationData ); }; -const ObservabilityAppLink: FunctionComponent = ({ checkpoint, deprecationDataView }) => { - const { - plugins: { - share: { url }, - }, - } = useAppContext(); - - const logsLocator = url.locators.get( - OBS_LOGS_EXPLORER_DATA_VIEW_LOCATOR_ID - )!; - - if (!deprecationDataView.id) return null; - - const logsUrl = logsLocator.getRedirectUrl({ - id: deprecationDataView.id, - timeRange: { - from: checkpoint, - to: 'now', - }, - query: { - language: 'kuery', - query: `not ${DEPRECATION_LOGS_ORIGIN_FIELD} : (${APPS_WITH_DEPRECATION_LOGS.join(' or ')})`, - }, - }); - - return ( - // eslint-disable-next-line @elastic/eui/href-or-on-click - { - uiMetricService.trackUiMetric(METRIC_TYPE.CLICK, UIM_OBSERVABILITY_CLICK); - }} - data-test-subj="viewObserveLogs" - > - - - ); -}; - export const ExternalLinks: FunctionComponent> = ({ checkpoint, }) => { @@ -190,42 +140,19 @@ export const ExternalLinks: FunctionComponent }, [dataService, checkpoint, share.url.locators]); return ( - - - - -

- -

-
- - {deprecationDataView ? ( - - ) : null} -
-
- - - -

- -

-
- - {deprecationDataView ? ( - - ) : null} -
-
-
+ <> + +

+ +

+
+ + {deprecationDataView ? ( + + ) : null} + ); }; diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx index eedb05e8b809..7c6f7d554082 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step.test.tsx @@ -52,12 +52,6 @@ describe('WarningsFlyoutStep', () => { const defaultPropsWithWarnings = { ...defaultProps, warnings: [ - { - warningType: 'customTypeName', - meta: { - typeName: 'my_mapping_type', - }, - }, { warningType: 'indexSetting', meta: { @@ -76,9 +70,7 @@ describe('WarningsFlyoutStep', () => { button.simulate('click'); expect(defaultPropsWithWarnings.continueReindex).not.toHaveBeenCalled(); - // first warning (customTypeName) - wrapper.find(`input#${idForWarning(0)}`).simulate('change'); - // second warning (indexSetting) + // first warning (indexSetting) wrapper.find(`input#${idForWarning(1)}`).simulate('change'); button.simulate('click'); diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx index 7782d47fc5cc..27bfdc625678 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warning_step_checkbox.tsx @@ -82,42 +82,6 @@ export interface WarningCheckboxProps { meta?: ReindexWarning['meta']; } -export const CustomTypeNameWarningCheckbox: React.FunctionComponent = ({ - isChecked, - onChange, - docLinks, - id, - meta, -}) => { - return ( - {meta!.typeName as string}, - defaultType: _doc, - }} - /> - } - description={ - {meta!.typeName as string}, - }} - /> - } - documentationUrl={docLinks.elasticsearch.typesRemoval} - /> - ); -}; - export const DeprecatedSettingWarningCheckbox: React.FunctionComponent = ({ isChecked, onChange, diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx index 0de8449a7cc7..d3ed1d0c1638 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/reindex/flyout/warnings_step.tsx @@ -27,7 +27,6 @@ import { } from '../../../../../../../common/types'; import { useAppContext } from '../../../../../app_context'; import { - CustomTypeNameWarningCheckbox, DeprecatedSettingWarningCheckbox, ReplaceIndexWithAliasWarningCheckbox, WarningCheckboxProps, @@ -40,7 +39,6 @@ interface CheckedIds { const warningToComponentMap: { [key in ReindexWarningTypes]: React.FunctionComponent; } = { - customTypeName: CustomTypeNameWarningCheckbox, indexSetting: DeprecatedSettingWarningCheckbox, replaceIndexWithAlias: ReplaceIndexWithAliasWarningCheckbox, }; diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts index 4f58c1a2ea02..685bc443c324 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.test.ts @@ -182,71 +182,5 @@ describe('transformFlatSettings', () => { }) ).toEqual([]); }); - - if (currentMajor === 7) { - describe('[7.x] customTypeName warning', () => { - it('returns customTypeName warning for non-_doc mapping types', () => { - expect( - getReindexWarnings({ - settings: {}, - mappings: { doc: {} }, - }) - ).toEqual([ - { - warningType: 'customTypeName', - meta: { - typeName: 'doc', - }, - }, - ]); - }); - it('does not return customTypeName warning for _doc mapping types', () => { - expect( - getReindexWarnings({ - settings: {}, - mappings: { _doc: {} }, - }) - ).toEqual([]); - }); - }); - - describe('[7.x] deprecatedSetting warning', () => { - it('returns deprecatedSetting warning for deprecated index settings', () => { - expect( - getReindexWarnings({ - settings: { - // Deprecated settings - 'index.force_memory_term_dictionary': '1024', - 'index.max_adjacency_matrix_filters': 'true', - 'index.soft_deletes.enabled': 'true', - }, - mappings: {}, - }) - ).toEqual([ - { - warningType: 'indexSetting', - meta: { - deprecatedSettings: [ - 'index.force_memory_term_dictionary', - 'index.max_adjacency_matrix_filters', - 'index.soft_deletes.enabled', - ], - }, - }, - ]); - }); - - it('does not return a deprecatedSetting warning for there are no deprecated index settings', () => { - expect( - getReindexWarnings({ - settings: { - 'index.number_of_replicas': '1', - }, - mappings: {}, - }) - ).toEqual([]); - }); - }); - } }); }); diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts index 96d14bac8d63..3344ecde4ab6 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/index_settings.ts @@ -8,7 +8,7 @@ import { flow, omit } from 'lodash'; import { ReindexWarning } from '../../../common/types'; import { versionService } from '../version'; -import { FlatSettings, FlatSettingsWithTypeName } from './types'; +import { FlatSettings } from './types'; export interface ParsedIndexName { cleanIndexName: string; baseName: string; @@ -75,27 +75,8 @@ export const generateNewIndexName = (indexName: string): string => { : `${currentVersion}-${sourceName}`; }; -export const getCustomTypeWarning = ( - flatSettings: FlatSettingsWithTypeName | FlatSettings -): ReindexWarning | undefined => { - const DEFAULT_TYPE_NAME = '_doc'; - // In 7+, it's not possible to have more than one type, - // so always grab the first (and only) key. - const typeName = Object.getOwnPropertyNames(flatSettings.mappings)[0]; - const typeNameWarning = Boolean(typeName && typeName !== DEFAULT_TYPE_NAME); - - if (typeNameWarning) { - return { - warningType: 'customTypeName', - meta: { - typeName, - }, - }; - } -}; - export const getDeprecatedSettingWarning = ( - flatSettings: FlatSettingsWithTypeName | FlatSettings + flatSettings: FlatSettings ): ReindexWarning | undefined => { const { settings } = flatSettings; @@ -131,19 +112,12 @@ export const getDeprecatedSettingWarning = ( * Returns an array of warnings that should be displayed to user before reindexing begins. * @param flatSettings */ -export const getReindexWarnings = ( - flatSettings: FlatSettingsWithTypeName | FlatSettings -): ReindexWarning[] => { +export const getReindexWarnings = (flatSettings: FlatSettings): ReindexWarning[] => { const warnings = [] as ReindexWarning[]; - if (versionService.getMajorVersion() === 7) { - const customTypeWarning = getCustomTypeWarning(flatSettings); + if (versionService.getMajorVersion() === 8) { const deprecatedSettingWarning = getDeprecatedSettingWarning(flatSettings); - if (customTypeWarning) { - warnings.push(customTypeWarning); - } - if (deprecatedSettingWarning) { warnings.push(deprecatedSettingWarning); } diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts index 01c73bf85765..ce588e8bdb47 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.ts @@ -20,9 +20,8 @@ import { ReindexStatus, ReindexStep, } from '../../../common/types'; -import { versionService } from '../version'; import { generateNewIndexName } from './index_settings'; -import { FlatSettings, FlatSettingsWithTypeName } from './types'; +import { FlatSettings } from './types'; // TODO: base on elasticsearch.requestTimeout? export const LOCK_WINDOW = moment.duration(90, 'seconds'); @@ -80,10 +79,7 @@ export interface ReindexActions { * Retrieve index settings (in flat, dot-notation style) and mappings. * @param indexName */ - getFlatSettings( - indexName: string, - withTypeName?: boolean - ): Promise; + getFlatSettings(indexName: string): Promise; } export const reindexActionsFactory = ( @@ -208,23 +204,10 @@ export const reindexActionsFactory = ( }, async getFlatSettings(indexName: string) { - let flatSettings; - - if (versionService.getMajorVersion() === 7) { - // On 7.x, we need to get index settings with mapping type - flatSettings = await esClient.indices.get({ - index: indexName, - flat_settings: true, - // This @ts-ignore is needed on master since the flag is deprecated on >7.x - // @ts-ignore - include_type_name: true, - }); - } else { - flatSettings = await esClient.indices.get({ - index: indexName, - flat_settings: true, - }); - } + const flatSettings = await esClient.indices.get({ + index: indexName, + flat_settings: true, + }); if (!flatSettings[indexName]) { return null; diff --git a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts index 8d600849987d..09449413dabc 100644 --- a/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts +++ b/x-pack/plugins/upgrade_assistant/server/lib/reindexing/types.ts @@ -26,14 +26,3 @@ export interface FlatSettings { _meta?: MetaProperties; }; } - -// Specific to 7.x-8 upgrade -export interface FlatSettingsWithTypeName { - settings: estypes.IndicesIndexState['settings']; - mappings?: { - [typeName: string]: { - properties?: MappingProperties; - _meta?: MetaProperties; - }; - }; -} diff --git a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts index bb3ccaeb8b12..b02dd08f841d 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/reindex_indices/reindex_indices.test.ts @@ -94,9 +94,9 @@ describe('reindex API', () => { }); mockReindexService.detectReindexWarnings.mockResolvedValueOnce([ { - warningType: 'customTypeName', + warningType: 'indexSetting', meta: { - typeName: 'my_mapping_type', + settingA: 'deprecated', }, }, ]); @@ -120,9 +120,9 @@ describe('reindex API', () => { expect(data.reindexOp).toEqual({ indexName: 'wowIndex', status: ReindexStatus.inProgress }); expect(data.warnings).toEqual([ { - warningType: 'customTypeName', + warningType: 'indexSetting', meta: { - typeName: 'my_mapping_type', + settingA: 'deprecated', }, }, ]); diff --git a/x-pack/packages/observability/alert_details/README.md b/x-pack/solutions/observability/packages/alert_details/README.md similarity index 100% rename from x-pack/packages/observability/alert_details/README.md rename to x-pack/solutions/observability/packages/alert_details/README.md diff --git a/x-pack/packages/observability/alert_details/index.ts b/x-pack/solutions/observability/packages/alert_details/index.ts similarity index 100% rename from x-pack/packages/observability/alert_details/index.ts rename to x-pack/solutions/observability/packages/alert_details/index.ts diff --git a/x-pack/solutions/observability/packages/alert_details/jest.config.js b/x-pack/solutions/observability/packages/alert_details/jest.config.js new file mode 100644 index 000000000000..b7c6f40e5bd5 --- /dev/null +++ b/x-pack/solutions/observability/packages/alert_details/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/solutions/observability/packages/alert_details'], +}; diff --git a/x-pack/packages/observability/alert_details/kibana.jsonc b/x-pack/solutions/observability/packages/alert_details/kibana.jsonc similarity index 100% rename from x-pack/packages/observability/alert_details/kibana.jsonc rename to x-pack/solutions/observability/packages/alert_details/kibana.jsonc diff --git a/x-pack/packages/observability/alert_details/package.json b/x-pack/solutions/observability/packages/alert_details/package.json similarity index 100% rename from x-pack/packages/observability/alert_details/package.json rename to x-pack/solutions/observability/packages/alert_details/package.json diff --git a/x-pack/packages/observability/alert_details/src/components/alert_active_time_range_annotation.tsx b/x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx similarity index 100% rename from x-pack/packages/observability/alert_details/src/components/alert_active_time_range_annotation.tsx rename to x-pack/solutions/observability/packages/alert_details/src/components/alert_active_time_range_annotation.tsx diff --git a/x-pack/packages/observability/alert_details/src/components/alert_annotation.tsx b/x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx similarity index 100% rename from x-pack/packages/observability/alert_details/src/components/alert_annotation.tsx rename to x-pack/solutions/observability/packages/alert_details/src/components/alert_annotation.tsx diff --git a/x-pack/packages/observability/alert_details/src/components/alert_threshold_annotation.tsx b/x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx similarity index 100% rename from x-pack/packages/observability/alert_details/src/components/alert_threshold_annotation.tsx rename to x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_annotation.tsx diff --git a/x-pack/packages/observability/alert_details/src/components/alert_threshold_time_range_rect.tsx b/x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx similarity index 100% rename from x-pack/packages/observability/alert_details/src/components/alert_threshold_time_range_rect.tsx rename to x-pack/solutions/observability/packages/alert_details/src/components/alert_threshold_time_range_rect.tsx diff --git a/x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.test.tsx b/x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.test.tsx similarity index 100% rename from x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.test.tsx rename to x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.test.tsx diff --git a/x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.ts b/x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts similarity index 100% rename from x-pack/packages/observability/alert_details/src/hooks/use_alerts_history.ts rename to x-pack/solutions/observability/packages/alert_details/src/hooks/use_alerts_history.ts diff --git a/x-pack/solutions/observability/packages/alert_details/tsconfig.json b/x-pack/solutions/observability/packages/alert_details/tsconfig.json new file mode 100644 index 000000000000..d4c633333875 --- /dev/null +++ b/x-pack/solutions/observability/packages/alert_details/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/i18n", + "@kbn/rule-data-utils", + "@kbn/core", + "@kbn/rule-registry-plugin", + "@kbn/core-http-browser-mocks" + ] +} diff --git a/x-pack/packages/observability/alerting_test_data/README.md b/x-pack/solutions/observability/packages/alerting_test_data/README.md similarity index 100% rename from x-pack/packages/observability/alerting_test_data/README.md rename to x-pack/solutions/observability/packages/alerting_test_data/README.md diff --git a/x-pack/packages/observability/alerting_test_data/index.ts b/x-pack/solutions/observability/packages/alerting_test_data/index.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/index.ts rename to x-pack/solutions/observability/packages/alerting_test_data/index.ts diff --git a/x-pack/solutions/observability/packages/alerting_test_data/jest.config.js b/x-pack/solutions/observability/packages/alerting_test_data/jest.config.js new file mode 100644 index 000000000000..6a296e9d22c0 --- /dev/null +++ b/x-pack/solutions/observability/packages/alerting_test_data/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/solutions/observability/packages/alerting_test_data'], +}; diff --git a/x-pack/packages/observability/alerting_test_data/kibana.jsonc b/x-pack/solutions/observability/packages/alerting_test_data/kibana.jsonc similarity index 100% rename from x-pack/packages/observability/alerting_test_data/kibana.jsonc rename to x-pack/solutions/observability/packages/alerting_test_data/kibana.jsonc diff --git a/x-pack/packages/observability/alerting_test_data/package.json b/x-pack/solutions/observability/packages/alerting_test_data/package.json similarity index 100% rename from x-pack/packages/observability/alerting_test_data/package.json rename to x-pack/solutions/observability/packages/alerting_test_data/package.json diff --git a/x-pack/packages/observability/alerting_test_data/src/constants.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/constants.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/constants.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/constants.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_apm_error_count_threshold_rule.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_apm_error_count_threshold_rule.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_error_count_threshold_rule.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_apm_failed_transaction_rate_rule.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_custom_threshold_rule.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_custom_threshold_rule.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_data_view.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_data_view.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_data_view.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_index_connector.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_index_connector.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_index_connector.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_index_connector.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/create_rule.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/create_rule.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/create_rule.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/get_kibana_url.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/get_kibana_url.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/get_kibana_url.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/get_kibana_url.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/run.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/run.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/run.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/run.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_groupby.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_log_count_nodata.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_groupby.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/custom_threshold_metric_avg_nodata.ts diff --git a/x-pack/packages/observability/alerting_test_data/src/scenarios/index.ts b/x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/index.ts similarity index 100% rename from x-pack/packages/observability/alerting_test_data/src/scenarios/index.ts rename to x-pack/solutions/observability/packages/alerting_test_data/src/scenarios/index.ts diff --git a/x-pack/solutions/observability/packages/alerting_test_data/tsconfig.json b/x-pack/solutions/observability/packages/alerting_test_data/tsconfig.json new file mode 100644 index 000000000000..5e83fb292b66 --- /dev/null +++ b/x-pack/solutions/observability/packages/alerting_test_data/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/observability-plugin", + "@kbn/rule-data-utils", + "@kbn/alerting-comparators", + ] +} diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/README.md b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/README.md similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/README.md rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/README.md diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/index.ts b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/index.ts similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/index.ts rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/index.ts diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/jest.config.js b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/jest.config.js new file mode 100644 index 000000000000..6941925a188e --- /dev/null +++ b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/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/solutions/observability/packages/get_padded_alert_time_range_util'], +}; diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/kibana.jsonc b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/kibana.jsonc similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/kibana.jsonc rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/kibana.jsonc diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/package.json b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/package.json similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/package.json rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/package.json diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.test.ts diff --git a/x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts similarity index 100% rename from x-pack/packages/observability/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts rename to x-pack/solutions/observability/packages/get_padded_alert_time_range_util/src/get_padded_alert_time_range.ts diff --git a/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/tsconfig.json b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/tsconfig.json new file mode 100644 index 000000000000..7aba1b1a9378 --- /dev/null +++ b/x-pack/solutions/observability/packages/get_padded_alert_time_range_util/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-investigation-shared/README.md b/x-pack/solutions/observability/packages/kbn-investigation-shared/README.md similarity index 100% rename from packages/kbn-investigation-shared/README.md rename to x-pack/solutions/observability/packages/kbn-investigation-shared/README.md diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/index.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/index.ts new file mode 100644 index 000000000000..3b2a320ae181 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/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 './src'; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/jest.config.js b/x-pack/solutions/observability/packages/kbn-investigation-shared/jest.config.js new file mode 100644 index 000000000000..85d033a05a56 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/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/jest_node', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/packages/kbn-investigation-shared'], +}; diff --git a/packages/kbn-investigation-shared/kibana.jsonc b/x-pack/solutions/observability/packages/kbn-investigation-shared/kibana.jsonc similarity index 100% rename from packages/kbn-investigation-shared/kibana.jsonc rename to x-pack/solutions/observability/packages/kbn-investigation-shared/kibana.jsonc diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/package.json b/x-pack/solutions/observability/packages/kbn-investigation-shared/package.json new file mode 100644 index 000000000000..96c45f7b3cdd --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/investigation-shared", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/index.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/index.ts new file mode 100644 index 000000000000..cf5975aaaa97 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/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 './rest_specs'; +export * from './schema'; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.ts new file mode 100644 index 000000000000..08edee8a931d --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create.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 { z } from '@kbn/zod'; +import { investigationResponseSchema } from './investigation'; +import { alertOriginSchema, blankOriginSchema } from '../schema'; + +const createInvestigationParamsSchema = z.object({ + body: z.object({ + id: z.string(), + title: z.string(), + params: z.object({ + timeRange: z.object({ from: z.number(), to: z.number() }), + }), + origin: z.union([alertOriginSchema, blankOriginSchema]), + tags: z.array(z.string()), + externalIncidentUrl: z.string().nullable(), + }), +}); + +const createInvestigationResponseSchema = investigationResponseSchema; + +type CreateInvestigationParams = z.infer; +type CreateInvestigationResponse = z.output; + +export { createInvestigationParamsSchema, createInvestigationResponseSchema }; +export type { CreateInvestigationParams, CreateInvestigationResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.ts new file mode 100644 index 000000000000..c13bab564904 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_item.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 { z } from '@kbn/zod'; +import { itemSchema } from '../schema'; +import { investigationItemResponseSchema } from './investigation_item'; + +const createInvestigationItemParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), + body: itemSchema, +}); + +const createInvestigationItemResponseSchema = investigationItemResponseSchema; + +type CreateInvestigationItemParams = z.infer; +type CreateInvestigationItemResponse = z.output; + +export { createInvestigationItemParamsSchema, createInvestigationItemResponseSchema }; +export type { CreateInvestigationItemParams, CreateInvestigationItemResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.ts new file mode 100644 index 000000000000..f9e68b2131e8 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/create_note.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 { z } from '@kbn/zod'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const createInvestigationNoteParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), + body: z.object({ + content: z.string(), + }), +}); + +const createInvestigationNoteResponseSchema = investigationNoteResponseSchema; + +type CreateInvestigationNoteParams = z.infer; +type CreateInvestigationNoteResponse = z.output; + +export { createInvestigationNoteParamsSchema, createInvestigationNoteResponseSchema }; +export type { CreateInvestigationNoteParams, CreateInvestigationNoteResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete.ts new file mode 100644 index 000000000000..f4a1d20c03c9 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete.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 { z } from '@kbn/zod'; +const deleteInvestigationParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), +}); + +type DeleteInvestigationParams = z.infer; + +export { deleteInvestigationParamsSchema }; +export type { DeleteInvestigationParams }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts new file mode 100644 index 000000000000..78b69f0bb5c2 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_item.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const deleteInvestigationItemParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + itemId: z.string(), + }), +}); + +type DeleteInvestigationItemParams = z.infer; + +export { deleteInvestigationItemParamsSchema }; +export type { DeleteInvestigationItemParams }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts new file mode 100644 index 000000000000..eb39d6a3a50b --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/delete_note.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const deleteInvestigationNoteParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + noteId: z.string(), + }), +}); + +type DeleteInvestigationNoteParams = z.infer; + +export { deleteInvestigationNoteParamsSchema }; +export type { DeleteInvestigationNoteParams }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.ts new file mode 100644 index 000000000000..a15d0e9da4e0 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/entity.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 { z } from '@kbn/zod'; + +const metricsSchema = z.object({ + failedTransactionRate: z.number().optional(), + latency: z.number().optional(), + throughput: z.number().optional(), + logErrorRate: z.number().optional(), + logRate: z.number().optional(), +}); + +const entitySchema = z.object({ + id: z.string(), + definition_id: z.string(), + definition_version: z.string(), + display_name: z.string(), + last_seen_timestamp: z.string(), + identity_fields: z.array(z.string()), + schema_version: z.string(), + type: z.string(), + metrics: metricsSchema, +}); + +const entitySourceSchema = z.object({ + dataStream: z.string().optional(), +}); + +const entityWithSourceSchema = z.intersection( + entitySchema, + z.object({ + sources: z.array(entitySourceSchema), + }) +); + +type EntityWithSource = z.output; +type EntitySource = z.output; + +export { entitySchema, entityWithSourceSchema }; +export type { EntityWithSource, EntitySource }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.ts new file mode 100644 index 000000000000..5eaf1a9b6194 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/find.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 { z } from '@kbn/zod'; +import { investigationResponseSchema } from './investigation'; + +const findInvestigationsParamsSchema = z + .object({ + query: z + .object({ + alertId: z.string(), + search: z.string(), + filter: z.string(), + page: z.coerce.number(), + perPage: z.coerce.number(), + }) + .partial(), + }) + .partial(); + +const findInvestigationsResponseSchema = z.object({ + page: z.number(), + perPage: z.number(), + total: z.number(), + results: z.array(investigationResponseSchema), +}); + +type FindInvestigationsParams = z.infer; +type FindInvestigationsResponse = z.output; + +export { findInvestigationsParamsSchema, findInvestigationsResponseSchema }; +export type { FindInvestigationsParams, FindInvestigationsResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.ts new file mode 100644 index 000000000000..0222d97abdaa --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get.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 { z } from '@kbn/zod'; +import { investigationResponseSchema } from './investigation'; + +const getInvestigationParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), +}); + +const getInvestigationResponseSchema = investigationResponseSchema; + +type GetInvestigationParams = z.infer; // Parsed payload used by the backend +type GetInvestigationResponse = z.output; // Raw response sent to the frontend + +export { getInvestigationParamsSchema, getInvestigationResponseSchema }; +export type { GetInvestigationParams, GetInvestigationResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.ts new file mode 100644 index 000000000000..f4dc0bd96efd --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_stats.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 { z } from '@kbn/zod'; +import { statusSchema } from '../schema'; + +const getAllInvestigationStatsParamsSchema = z.object({ + query: z.object({}), +}); + +const getAllInvestigationStatsResponseSchema = z.object({ + count: z.record(statusSchema, z.number()), + total: z.number(), +}); + +type GetAllInvestigationStatsResponse = z.output; + +export { getAllInvestigationStatsParamsSchema, getAllInvestigationStatsResponseSchema }; +export type { GetAllInvestigationStatsResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.ts new file mode 100644 index 000000000000..5cb03bc483ad --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_all_investigation_tags.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 { z } from '@kbn/zod'; + +const getAllInvestigationTagsParamsSchema = z.object({ + query: z.object({}), +}); + +const getAllInvestigationTagsResponseSchema = z.string().array(); + +type GetAllInvestigationTagsResponse = z.output; + +export { getAllInvestigationTagsParamsSchema, getAllInvestigationTagsResponseSchema }; +export type { GetAllInvestigationTagsResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts new file mode 100644 index 000000000000..5c7cdbc7617a --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_entities.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { entityWithSourceSchema } from './entity'; + +const getEntitiesParamsSchema = z + .object({ + query: z + .object({ + 'service.name': z.string(), + 'service.environment': z.string(), + 'host.name': z.string(), + 'container.id': z.string(), + }) + .partial(), + }) + .partial(); + +const getEntitiesResponseSchema = z.object({ + entities: z.array(entityWithSourceSchema), +}); + +type GetEntitiesParams = z.infer; +type GetEntitiesResponse = z.output; + +export { getEntitiesParamsSchema, getEntitiesResponseSchema }; +export type { GetEntitiesParams, GetEntitiesResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts new file mode 100644 index 000000000000..eb6d9bf8df38 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_events.ts @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { eventTypeSchema, eventSchema } from '../schema'; + +const getEventsParamsSchema = z + .object({ + query: z + .object({ + rangeFrom: z.string(), + rangeTo: z.string(), + filter: z.string(), + eventTypes: z.string().transform((val, ctx) => { + const eventTypes = val.split(','); + const hasInvalidType = eventTypes.some((eventType) => !eventTypeSchema.parse(eventType)); + if (hasInvalidType) { + ctx.addIssue({ + code: z.ZodIssueCode.custom, + message: 'Invalid event type', + }); + return z.NEVER; + } + return val.split(',').map((v) => eventTypeSchema.parse(v)); + }), + }) + .partial(), + }) + .partial(); + +const getEventsResponseSchema = z.array(eventSchema); + +type GetEventsParams = z.infer; +type GetEventsResponse = z.output; + +export { getEventsParamsSchema, getEventsResponseSchema }; +export type { GetEventsParams, GetEventsResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.ts new file mode 100644 index 000000000000..8fb7524da511 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_items.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 { z } from '@kbn/zod'; +import { investigationItemResponseSchema } from './investigation_item'; + +const getInvestigationItemsParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), +}); + +const getInvestigationItemsResponseSchema = z.array(investigationItemResponseSchema); + +type GetInvestigationItemsResponse = z.output; + +export { getInvestigationItemsParamsSchema, getInvestigationItemsResponseSchema }; +export type { GetInvestigationItemsResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.ts new file mode 100644 index 000000000000..e0be09fde7d8 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/get_notes.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 { z } from '@kbn/zod'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const getInvestigationNotesParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), +}); + +const getInvestigationNotesResponseSchema = z.array(investigationNoteResponseSchema); + +type GetInvestigationNotesResponse = z.output; + +export { getInvestigationNotesParamsSchema, getInvestigationNotesResponseSchema }; +export type { GetInvestigationNotesResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/index.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/index.ts new file mode 100644 index 000000000000..cfc0b979a735 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type * from './create'; +export type * from './create_item'; +export type * from './create_note'; +export type * from './delete'; +export type * from './delete_item'; +export type * from './delete_note'; +export type * from './find'; +export type * from './get'; +export type * from './get_items'; +export type * from './get_notes'; +export type * from './get_all_investigation_stats'; +export type * from './get_all_investigation_tags'; +export type * from './investigation'; +export type * from './investigation_item'; +export type * from './investigation_note'; +export type * from './update'; +export type * from './update_item'; +export type * from './update_note'; +export type * from './get_events'; +export type * from './entity'; +export type * from './get_entities'; + +export * from './create'; +export * from './create_item'; +export * from './create_note'; +export * from './delete'; +export * from './delete_item'; +export * from './delete_note'; +export * from './find'; +export * from './get'; +export * from './get_items'; +export * from './get_notes'; +export * from './get_all_investigation_stats'; +export * from './get_all_investigation_tags'; +export * from './investigation'; +export * from './investigation_item'; +export * from './investigation_note'; +export * from './update'; +export * from './update_item'; +export * from './update_note'; +export * from './get_events'; +export * from './entity'; +export * from './get_entities'; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation.ts new file mode 100644 index 000000000000..fc00d81bbb0b --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation.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. + */ + +import { z } from '@kbn/zod'; +import { investigationSchema } from '../schema'; + +const investigationResponseSchema = investigationSchema; + +type InvestigationResponse = z.output; + +export { investigationResponseSchema }; +export type { InvestigationResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_item.ts new file mode 100644 index 000000000000..1c580f668f82 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_item.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. + */ + +import { z } from '@kbn/zod'; +import { investigationItemSchema } from '../schema'; + +const investigationItemResponseSchema = investigationItemSchema; + +type InvestigationItemResponse = z.output; + +export { investigationItemResponseSchema }; +export type { InvestigationItemResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_note.ts new file mode 100644 index 000000000000..b0784d679f13 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/investigation_note.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. + */ + +import { z } from '@kbn/zod'; +import { investigationNoteSchema } from '../schema'; + +const investigationNoteResponseSchema = investigationNoteSchema; + +type InvestigationNoteResponse = z.output; + +export { investigationNoteResponseSchema }; +export type { InvestigationNoteResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts new file mode 100644 index 000000000000..ab1e5ab1dc05 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update.ts @@ -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 { z } from '@kbn/zod'; +import { investigationResponseSchema } from './investigation'; +import { statusSchema } from '../schema'; + +const updateInvestigationParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + }), + body: z + .object({ + title: z.string(), + status: statusSchema, + params: z.object({ + timeRange: z.object({ from: z.number(), to: z.number() }), + }), + tags: z.array(z.string()), + externalIncidentUrl: z.string().nullable(), + rootCauseAnalysis: z.object({ + events: z.array(z.any()), + }), + }) + .partial(), +}); + +const updateInvestigationResponseSchema = investigationResponseSchema; + +type UpdateInvestigationParams = z.infer; +type UpdateInvestigationResponse = z.output; + +export { updateInvestigationParamsSchema, updateInvestigationResponseSchema }; +export type { UpdateInvestigationParams, UpdateInvestigationResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.ts new file mode 100644 index 000000000000..59c0a2196ab4 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_item.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 { z } from '@kbn/zod'; +import { investigationItemResponseSchema } from './investigation_item'; +import { itemSchema } from '../schema'; + +const updateInvestigationItemParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + itemId: z.string(), + }), + body: itemSchema, +}); + +const updateInvestigationItemResponseSchema = investigationItemResponseSchema; + +type UpdateInvestigationItemParams = z.infer; +type UpdateInvestigationItemResponse = z.output; + +export { updateInvestigationItemParamsSchema, updateInvestigationItemResponseSchema }; +export type { UpdateInvestigationItemParams, UpdateInvestigationItemResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.ts new file mode 100644 index 000000000000..d5a95a0a691e --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/rest_specs/update_note.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { investigationNoteResponseSchema } from './investigation_note'; + +const updateInvestigationNoteParamsSchema = z.object({ + path: z.object({ + investigationId: z.string(), + noteId: z.string(), + }), + body: z.object({ + content: z.string(), + }), +}); + +const updateInvestigationNoteResponseSchema = investigationNoteResponseSchema; + +type UpdateInvestigationNoteParams = z.infer; +type UpdateInvestigationNoteResponse = z.output; + +export { updateInvestigationNoteParamsSchema, updateInvestigationNoteResponseSchema }; +export type { UpdateInvestigationNoteParams, UpdateInvestigationNoteResponse }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts new file mode 100644 index 000000000000..953d5dfbdf25 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/event.ts @@ -0,0 +1,54 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const eventTypeSchema = z.union([ + z.literal('annotation'), + z.literal('alert'), + z.literal('error_rate'), + z.literal('latency'), + z.literal('anomaly'), +]); + +const sourceSchema = z.record(z.string(), z.any()); + +const annotationEventSchema = z.object({ + eventType: z.literal('annotation'), + id: z.string(), + title: z.string(), + description: z.string(), + timestamp: z.number(), + source: sourceSchema.optional(), + annotationType: z.string().optional(), +}); + +const alertStatusSchema = z.union([ + z.literal('active'), + z.literal('flapping'), + z.literal('recovered'), + z.literal('untracked'), +]); + +const alertEventSchema = z.object({ + eventType: z.literal('alert'), + id: z.string(), + title: z.string(), + description: z.string(), + timestamp: z.number(), + source: sourceSchema.optional(), + alertStatus: alertStatusSchema, +}); + +const eventSchema = z.discriminatedUnion('eventType', [annotationEventSchema, alertEventSchema]); + +type EventResponse = z.output; +type AlertEventResponse = z.output; +type AnnotationEventResponse = z.output; + +export type { EventResponse, AlertEventResponse, AnnotationEventResponse }; +export { eventSchema, eventTypeSchema, alertEventSchema, annotationEventSchema }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/index.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/index.ts new file mode 100644 index 000000000000..dba2f51cb196 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export * from './investigation'; +export * from './investigation_item'; +export * from './investigation_note'; +export * from './origin'; +export * from './event'; + +export type * from './investigation'; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.ts new file mode 100644 index 000000000000..3905ef2bf982 --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation.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 { z } from '@kbn/zod'; +import { alertOriginSchema, blankOriginSchema } from './origin'; +import { investigationNoteSchema } from './investigation_note'; +import { investigationItemSchema } from './investigation_item'; + +const statusSchema = z.union([ + z.literal('triage'), + z.literal('active'), + z.literal('mitigated'), + z.literal('resolved'), + z.literal('cancelled'), +]); + +const investigationSchema = z.object({ + id: z.string(), + title: z.string(), + createdAt: z.number(), + createdBy: z.string(), + updatedAt: z.number(), + params: z.object({ + timeRange: z.object({ from: z.number(), to: z.number() }), + }), + origin: z.union([alertOriginSchema, blankOriginSchema]), + status: statusSchema, + tags: z.array(z.string()), + notes: z.array(investigationNoteSchema), + items: z.array(investigationItemSchema), + externalIncidentUrl: z.string().nullable(), + rootCauseAnalysis: z + .object({ + events: z.array(z.any()), + }) + .optional(), +}); + +type Status = z.infer; + +export type { Status }; +export { investigationSchema, statusSchema }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_item.ts new file mode 100644 index 000000000000..0bf08d588f17 --- /dev/null +++ b/x-pack/solutions/observability/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const itemSchema = z.object({ + title: z.string(), + type: z.string(), + params: z.record(z.string(), z.any()), +}); + +const investigationItemSchema = z.intersection( + z.object({ + id: z.string(), + createdAt: z.number(), + createdBy: z.string(), + updatedAt: z.number(), + }), + itemSchema +); + +type Item = z.infer; +type InvestigationItem = z.infer; + +export type { Item, InvestigationItem }; +export { investigationItemSchema, itemSchema }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_note.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/investigation_note.ts new file mode 100644 index 000000000000..0d210fa6d8aa --- /dev/null +++ b/x-pack/solutions/observability/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const investigationNoteSchema = z.object({ + id: z.string(), + content: z.string(), + createdAt: z.number(), + updatedAt: z.number(), + createdBy: z.string(), +}); + +export { investigationNoteSchema }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/origin.ts b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/origin.ts new file mode 100644 index 000000000000..d586b368bf6e --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/src/schema/origin.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. + */ + +import { z } from '@kbn/zod'; + +const blankOriginSchema = z.object({ type: z.literal('blank') }); +const alertOriginSchema = z.object({ type: z.literal('alert'), id: z.string() }); + +export { alertOriginSchema, blankOriginSchema }; diff --git a/x-pack/solutions/observability/packages/kbn-investigation-shared/tsconfig.json b/x-pack/solutions/observability/packages/kbn-investigation-shared/tsconfig.json new file mode 100644 index 000000000000..424670ff55ae --- /dev/null +++ b/x-pack/solutions/observability/packages/kbn-investigation-shared/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node" + ] + }, + "include": [ + "**/*.ts", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/zod" + ] +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/jest.config.js b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/jest.config.js new file mode 100644 index 000000000000..3620ef5a1c25 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/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 = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: [ + '/x-pack/solutions/observability/packages/observability_ai/observability_ai_common', + '/x-pack/solutions/observability/packages/observability_ai/observability_ai_server', + ], +}; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/kibana.jsonc b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/kibana.jsonc new file mode 100644 index 000000000000..731f38d6bfe8 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/observability-ai-common", + "owner": "@elastic/obs-ai-assistant", + "group": "observability", + "visibility": "private" +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/package.json b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/package.json new file mode 100644 index 000000000000..0f5f1062937b --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/observability-ai-common", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/index.ts new file mode 100644 index 000000000000..8d052799aa58 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/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 { + RCA_END_PROCESS_TOOL_NAME, + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from './tool_names'; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/tool_names.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/tool_names.ts new file mode 100644 index 000000000000..76fe9e377dae --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/root_cause_analysis/tool_names.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 RCA_OBSERVE_TOOL_NAME = 'observe'; +export const RCA_END_PROCESS_TOOL_NAME = 'endProcessAndWriteReport'; +export const RCA_INVESTIGATE_ENTITY_TOOL_NAME = 'investigateEntity'; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/tsconfig.json b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/tsconfig.json new file mode 100644 index 000000000000..af23c916b5d1 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_common/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/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.js b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.js new file mode 100644 index 000000000000..8aa1c2d67322 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/jest.config.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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../../..', + roots: [ + '/x-pack/solutions/observability/packages/observability_ai/observability_ai_server', + ], +}; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/kibana.jsonc b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/kibana.jsonc new file mode 100644 index 000000000000..6eb48a95a562 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-server", + "id": "@kbn/observability-ai-server", + "owner": "@elastic/obs-ai-assistant", + "group": "observability", + "visibility": "private" +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/package.json b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/package.json new file mode 100644 index 000000000000..fc6fc310801d --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/package.json @@ -0,0 +1,6 @@ +{ + "name": "@kbn/observability-ai-server", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0" +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_end_rca_process_tool.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_end_rca_process_tool.ts new file mode 100644 index 000000000000..a1b546d2629a --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_end_rca_process_tool.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 { from, Observable, of, switchMap } from 'rxjs'; +import { RCA_END_PROCESS_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { AssistantMessage, MessageRole } from '@kbn/inference-common'; +import { writeFinalReport } from './tasks/write_final_report'; +import { EndProcessToolMessage, RootCauseAnalysisContext } from './types'; +import { generateSignificantEventsTimeline } from './tasks/generate_timeline'; +import { EMPTY_ASSISTANT_MESSAGE } from './empty_assistant_message'; + +export function callEndRcaProcessTool({ + rcaContext, + toolCallId, +}: { + rcaContext: RootCauseAnalysisContext; + toolCallId: string; +}): Observable { + return from( + writeFinalReport({ + rcaContext, + }) + ).pipe( + switchMap((report) => { + return from( + generateSignificantEventsTimeline({ + rcaContext, + report, + }).then((timeline) => { + return { timeline, report }; + }) + ); + }), + switchMap(({ report, timeline }) => { + const toolMessage: EndProcessToolMessage = { + name: RCA_END_PROCESS_TOOL_NAME, + role: MessageRole.Tool, + toolCallId, + response: { + report, + timeline, + }, + }; + return of(toolMessage, EMPTY_ASSISTANT_MESSAGE); + }) + ); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_investigate_entity_tool.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_investigate_entity_tool.ts new file mode 100644 index 000000000000..c22d28d7389f --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_investigate_entity_tool.ts @@ -0,0 +1,80 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { from, Observable, of, switchMap } from 'rxjs'; +import { MessageRole } from '@kbn/inference-common'; +import { RCA_INVESTIGATE_ENTITY_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { InvestigateEntityToolMessage, RootCauseAnalysisContext, ToolErrorMessage } from './types'; +import { investigateEntity } from './tasks/investigate_entity'; +import { formatEntity } from './util/format_entity'; + +export function callInvestigateEntityTool({ + field, + value, + context, + toolCallId, + rcaContext, +}: { + field: string; + value: string; + context: string; + toolCallId: string; + rcaContext: RootCauseAnalysisContext; +}): Observable { + const nextEntity = { + [field]: value, + }; + + return from( + investigateEntity({ + rcaContext, + entity: nextEntity, + context, + }) + ).pipe( + switchMap((entityInvestigation) => { + if (!entityInvestigation) { + const entityNotFoundToolMessage: ToolErrorMessage = { + name: 'error', + role: MessageRole.Tool, + response: { + error: { + message: `Entity ${formatEntity(nextEntity)} not found, have + you verified it exists and if the field and value you are using + are correct?`, + }, + }, + toolCallId, + }; + + return of(entityNotFoundToolMessage); + } + + const { + attachments, + relatedEntities, + entity: investigatedEntity, + summary, + } = entityInvestigation; + const toolMessage: InvestigateEntityToolMessage = { + name: RCA_INVESTIGATE_ENTITY_TOOL_NAME, + role: MessageRole.Tool as const, + toolCallId, + response: { + entity: investigatedEntity, + relatedEntities, + summary, + }, + data: { + attachments, + }, + }; + + return of(toolMessage); + }) + ); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_observe_tool.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_observe_tool.ts new file mode 100644 index 000000000000..06676abd729f --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/call_observe_tool.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. + */ + +import { AssistantMessage, MessageRole } from '@kbn/inference-common'; +import { + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from '@kbn/observability-ai-common/root_cause_analysis'; +import { compact, findLast } from 'lodash'; +import { from, Observable, of, switchMap } from 'rxjs'; +import { observeInvestigationResults } from './tasks/observe_investigation_results'; +import { + InvestigateEntityToolMessage, + ObservationToolMessage, + RootCauseAnalysisContext, + RootCauseAnalysisEvent, +} from './types'; + +export function callObserveTool({ + rcaContext, + toolCallId, +}: { + rcaContext: RootCauseAnalysisContext; + toolCallId: string; +}): Observable { + const { events } = rcaContext; + + const lastAssistantMessage = findLast( + events.slice(0, -1), + (event): event is Extract => + event.role === MessageRole.Assistant + ); + + const toolMessagesByToolCallId = Object.fromEntries( + compact( + events.map((message) => + 'toolCallId' in message && + (message.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME || message.name === 'error') + ? [message.toolCallId, message] + : undefined + ) + ) + ); + + const investigationToolMessages = + lastAssistantMessage && lastAssistantMessage.toolCalls + ? compact( + lastAssistantMessage.toolCalls.map((investigateEntityToolCall) => { + if (investigateEntityToolCall.function.name !== RCA_INVESTIGATE_ENTITY_TOOL_NAME) { + return undefined; + } + return { + toolCall: investigateEntityToolCall, + toolResponse: toolMessagesByToolCallId[investigateEntityToolCall.toolCallId], + }; + }) + ) + : []; + + const investigations = investigationToolMessages + .map((toolMessage) => toolMessage.toolResponse) + .filter( + (toolResponse): toolResponse is InvestigateEntityToolMessage => + toolResponse.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME + ) + .map((toolResponse) => ({ ...toolResponse.data, ...toolResponse.response })); + + return from( + observeInvestigationResults({ + rcaContext, + investigations, + }) + ).pipe( + switchMap((summary) => { + const observationToolMessage: ObservationToolMessage = { + name: RCA_OBSERVE_TOOL_NAME, + response: { + content: summary.content, + }, + data: summary, + role: MessageRole.Tool, + toolCallId, + }; + return of(observationToolMessage); + }) + ); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/empty_assistant_message.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/empty_assistant_message.ts new file mode 100644 index 000000000000..08443d593a81 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/empty_assistant_message.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 { AssistantMessage, MessageRole } from '@kbn/inference-common'; +import { RootCauseAnalysisEvent } from './types'; + +export const EMPTY_ASSISTANT_MESSAGE: Extract = { + content: '', + role: MessageRole.Assistant, + toolCalls: [], +}; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/index.ts new file mode 100644 index 000000000000..66307dc2ef9a --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/index.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export type { + RootCauseAnalysisEvent, + InvestigateEntityToolMessage, + EndProcessToolMessage, + ObservationToolMessage, + RootCauseAnalysisToolMessage, + ToolErrorMessage, + RootCauseAnalysisToolRequest, +} from './types'; +export type { SignificantEventsTimeline, SignificantEvent } from './tasks/generate_timeline'; +export type { EntityInvestigation } from './tasks/investigate_entity'; + +export { runRootCauseAnalysis } from './run_root_cause_analysis'; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/prompts/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/prompts/index.ts new file mode 100644 index 000000000000..8a0a6a906470 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/prompts/index.ts @@ -0,0 +1,345 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor 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 RCA_SYSTEM_PROMPT_BASE = `You are a helpful assistant for Elastic Observability. +You are a distinguished SRE, who has an established career, working in both +small shops and FAANG-level companies. You have worked with Elasticsearch +since the beginning and expertly use it in your analysis of incidents. + +You use an evidence-based strategy to determine the root cause of +an incident. You thoroughly analyze Observability data. You use your +understanding of different architectures like microservies, monoliths, +event-driven systems, and environments like Kubernetes to discover +patterns and correlations in the data ingested into the user's system. + +Your sizable experience with monitoring software systems has taught +you how to investigate issues and correlate symptoms of the investigate +service with its dependencies. + +## Capabilities + +You are highly skilled at inspecting logs, traces, alerts, and SLOs to uncover +the root cause of incidents, with a special emphasis on detecting log patterns +that reveal system behavior. You can identify related entities, such as upstream +services or the specific pod a service is running on, by searching through logs +and traces for relationships using metadata like IP addresses, session IDs, or +distributed tracing data. While you can analyze alerts and SLO-derived metrics, +you do not directly analyze other system metrics, inspect files, or execute +commands that modify the system. + +## Non-capabilities + +You lack the capabilities to analyze metrics or connect to external systems.`; + +export const RCA_PROMPT_ENTITIES = `# Entities + +In an Observability system, entities are distinct components or resources within +the infrastructure, each representing points of interest for monitoring and +troubleshooting. These entities form the backbone of log-based analysis and +allow teams to track behavior, detect anomalies, and investigate issues across +different layers of the system. Here’s a breakdown of common entities in +observability: + +1. Services: Core units of functionality in an application ecosystem, +representing individual processes or applications (e.g., user-authentication, +payment processing). Services typically expose APIs or endpoints, and logs from +these entities often capture requests, responses, and error events, which are +critical for understanding application behavior. + +2. Kubernetes (K8s) Entities: + - Pods: The smallest deployable units in Kubernetes, usually containing one +or more containers. Logs from pods provide insight into container operations, +errors, and application states. + - Namespaces: Logical groupings within a cluster for organizing and isolating +resources, helping in filtering logs by domain or responsibility. + - Nodes: Worker machines (either physical or virtual) where pods run. Node +logs often cover hardware resource events, errors, and other system-level events +relevant to pod health and performance. + - Deployments and ReplicaSets: Define and manage the desired state of pod +replication and rolling updates. Logs from these components can reveal changes +in application versions, scaling events, and configuration updates. + +3. Virtual Machines (VMs): Virtualized computing resources that generate +operating system-level logs capturing events such as application crashes, +network issues, and OS-related errors. + +4. Applications: Software systems or packages running across the infrastructure,n +which may encompass multiple services. Logs from applications track user flows, +application states, and error messages, providing context for user interactions +and system events. + +5. Serverless Functions (e.g., AWS Lambda): Code executions triggered by +specific events. Logs from serverless functions capture invocation details, +execution paths, and error traces, which are useful for understanding specific +function behaviors and pinpointing execution anomalies. + +6. Databases and Data Stores: Includes SQL/NoSQL databases, caches, and storage +solutions. Logs from these entities cover query executions, connection issues, +and transaction errors, essential for tracking data layer issues. + +7. Containers: Portable environments running individual services or processes. +Container logs capture application and system events within the containerized +environment, helping track process-level errors and status changes. + +8. Load Balancers and API Gateways: Components responsible for managing and +routing traffic. Logs from these entities include request paths, status codes, +and errors encountered, which can indicate connectivity issues or +misconfigurations. + +9. Networking Components: Entities like virtual private clouds (VPCs), +firewalls, VPNs, and network interfaces. Logs from these components track +traffic flows, connectivity issues, and security events, crucial for identifying +network-related anomalies. + +10. Clusters and Regions: Groupings of infrastructure either physically or +logically, such as across data centers or cloud regions. Cluster and region logs +help capture high-level events and error messages, useful for understanding +system-wide issues and region-specific disruptions. + +Each of these entities is typically identified by fields such as +\`service.name\`, \`kubernetes.pod.name\`, \`container.id\`, or similar fields +in log records. Observability systems use these identifiers to connect entities, +creating a map of relationships and dependencies that helps teams diagnose +issues, understand cross-entity impacts, and uncover root causes in distributed +architectures.`; + +export const RCA_PROMPT_DEPENDENCIES = `## Understanding the Flow: Upstream vs. Downstream + +- Upstream dependencies: These are the services that your service +depends on. They supply data, perform tasks, or provide resources that +your service consumes. +- Downstream dependencies: These are the services that depend on your +service. They consume the data or resources your service generates. + +When diagnosing issues, distinguishing the direction of dependency can +clarify whether a problem originates from your service’s reliance on an +external input or whether your service is causing issues for other systems. + +--- + +## When to Investigate Upstream Dependencies + +Upstream issues typically occur when your service is failing due to problems +with the responses it receives from external systems. + +1. Timeouts and Latency +- Symptoms: Slow response times, retries, or timeouts. +- Errors: HTTP 504, retrying connection, exceeded timeout threshold. +- Focus: Check the performance and availability of upstream services +(e.g., APIs, databases) and network latency. + +2. Data Integrity Issues** +- Symptoms: Inconsistent or corrupted data. +- Errors: unexpected data format, deserialization errors. +- Focus: Verify data received from upstream services, and investigate +schema or data format changes. + +3. Connection Failures +- Symptoms: Your service cannot connect to upstream services. +- Errors: DNS lookup failed, connection refused, socket timeout. +- Focus: Check upstream service health, DNS, and networking components. + +4. Authentication/Authorization Failures** +- Symptoms: Failed access to upstream resources. +- Errors: 401 Unauthorized, 403 Forbidden, token issues. +- Focus: Validate credentials or tokens and investigate upstream access +policies. + +--- + +## When to Investigate Downstream Dependencies + +Downstream issues occur when your service is functioning but its outputs cause +failures in other services that depend on it. + +1. Data or API Response Issues +- Symptoms: Downstream services receive bad or invalid data. +- Errors: data type mismatch, invalid JSON format. +- Focus: Ensure your service is returning correct data and check for API +changes. + +2. Rate-Limiting and Resource Exhaustion** +- Symptoms: Downstream services are overwhelmed. +- Errors: 429 Too Many Requests, throttling or resource exhaustion. +- Focus: Check your service’s request rates and resource usage (e.g., memory, CPU). + +3. Unexpected Behavior or Regression +- Symptoms: Downstream failures after a recent deployment. +- Errors: New downstream errors after your service changes. +- Focus: Review recent updates, API contracts, or integration points. + +4. Eventual Consistency or Queue Backlogs +- Symptoms: Delayed processing in downstream systems. +- Errors: message queue full, backlog warnings. +- Focus: Check event production rates and queue statuses in downstream services.`; + +export const RCA_PROMPT_CHANGES = `## Reasoning about Correlating Changes in Incident Investigations + +In a root cause analysis, understanding the types and timing of changes is key +to linking symptoms with underlying causes. Changes can broadly be classified +into **symptomatic changes** (indicators of system issues like elevated error +rates or degraded throughput) and **system changes** (events that modify system +configuration or structure, such as scale-downs, new version rollouts, or +significant configuration adjustments). By correlating these changes, we can +assess whether observed symptoms are likely related to specific system +modifications. + +### Identifying Correlations Between Symptomatic and System Changes + +When investigating a sudden issue—such as a 5x increase in latency—it’s +essential to evaluate both the **timing** and **nature** of associated changes +in upstream dependencies, resource utilization, and configuration events. For +instance: + +- Consistent Symptomatic Behavior: If an upstream dependency exhibits a +similar, sustained latency spike around the same time and shows log entries +indicating CPU throttling, this would suggest a correlated, persistent issue +that may directly impact the observed symptom. A scale-down event preceding the +latency increase might indicate that reduced resources are stressing the +dependency. + +- Transient vs. Persistent Issues: Another upstream dependency that +experiences a brief latency increase but recovers quickly is less likely +related. Short-lived changes that self-correct without intervention typically +have different root causes or may be unrelated noise. + +### Types of Changes to Consider in Correlation + +1. Log Pattern Changes: A shift in log patterns, especially around error +levels, provides significant insight. If there’s an increase in critical or +warning log patterns for a dependency during the latency spike, it could +indicate that the issue stems from this entity. Compare these log patterns to +past behavior to assess whether they represent an anomaly that might warrant +further investigation. + +2. Event-Driven System Changes: + - Scale Events: Scale-up or scale-down events can directly impact +performance. If a latency increase aligns with a scale-down, it may suggest that +resource reduction is straining the system. + - Release or Deployment Events: A new version rollout or config change is +a frequent source of correlated issues. Compare the timing of the latency +increase to the deployment to see if the change directly impacts the system. +Correlate with alerts or SLO breaches on endpoints to understand the immediate +effects of the release. + +3. SLO and Alert-Based Changes: SLO breaches and alerts can provide concrete +timestamps for when symptoms begin. For instance, a breach on error rates for a +specific service endpoint following a dependency’s scale-down event suggests a +possible causal link. An alert indicating sustained latency increase in a +dependency that remains unresolved points to a high-priority area for deeper +investigation. + +4. Dependency Health and Behavior: + - Related vs. Unrelated Dependencies: Similar to the latency example, +observe if multiple dependencies experience symptomatic changes simultaneously. +Related dependencies should show consistent, similar issues, while unrelated +dependencies may exhibit brief, unrelated spikes. Persistent issues across key +dependencies likely indicate a systemic cause, while isolated changes are less +likely to be relevant. + +### Examples of Reasoning Through Changes + +Consider these scenarios: +- Increase in Error Rates and a Recent Deployment: Suppose error rates for +an endpoint increase sharply post-deployment. If related logs show new error +patterns, this aligns the symptom with a deployment change. Investigate specific +changes in the deployment (e.g., code changes or resource allocation). +- Throughput Decrease and Scaling Events: If throughput dips shortly after a +scale-down event, it might suggest resource constraints. Analyze CPU or memory +throttling logs from this period in upstream dependencies to confirm. +- Cross-Service Latency Spikes: If multiple services along a call path +experience latency spikes, with CPU throttling logs, this suggests a resource +bottleneck. Trace logs and alerts related to autoscaling decisions may provide +insights into whether the system configuration caused cascading delays. + +By carefully mapping these changes and analyzing their timing, you can +distinguish between causally related events and incidental changes, allowing for +a targeted and effective investigation.`; + +export const RCA_PROMPT_CHANGE_POINTS = `## Change points + +Change points can be defined as the following type: + +- \`dip\`: a significant dip occurs at this change point +- \`distribution_change\`: the overall distribution of the values has changed +significantly +- \`non_stationary\`: there is no change point, but the values are not from a +stationary distribution +- \`spike\`: a significant spike occurs at this point +- \`stationary\`: no change point found +- \`step_change\`: the change indicates a statistically significant step up or +down in value distribution +- \`trend_change\`: there is an overall trend change occurring at this point + +For \`spike\`, and \`dip\`, this means: a short-lived spike or dip that then again +stabilizes. For persisted changes, you'd see a \`step_change\` (if the values +before and after the change point are stable), or a \`trend_change\` when the +values show an upward or downward trend after the change.`; + +export const RCA_PROMPT_SIGNIFICANT_EVENTS = `## Significant events + +Generate a timeline of significant events. These events should capture +significant observed changes in the system that can be extracted from the +analyzed data. This timeline is absolutely critical to the investigation, +and close attention has to be paid to the data, and the instructions. + +The timeline should focus on key events as captured in log patterns, including +both notable changes and unusual/critical messages. This data-driven timeline +should help establish a chain of causality, pinpointing when anomalies began, +what system behaviors were observed, and how these patterns relate to the overall incident. + +- Use ISO timestamps to ensure precision and clarity. +- Include alerts that are part of the investigation. For these, use the start +time of the alert, and mention critical information about the alert, such as +reason and grouping fields. +- Focus on log entries that signal significant system behavior (e.g., errors, +retries, anomalies). +- Highlight critical log messages or changes in patterns that may correlate +with the issue. +- Include notable anomalies, such as spikes in error rates, unexpected system +responses, or any log entries suggesting failure or degradation. + +Do not include: +- Events that are indicative of normal operations. +- Events that are unlikely to be related to the investigated issue. + +Key Elements to Include: + +- Log Patterns: Capture log messages that show unusual events or +abnormalities such as error codes, failed retries, or changes in log frequency. +- Timestamps: Ensure every entry in the timeline is time-stamped +with an accurate ISO 8601 timestamp. +- Event Description: Provide a clear, concise, and objective description of +what was observed in the logs. +- Corroborating Data: Link log anomalies to other relevant data points such +as traffic shifts, request patterns, or upstream/downstream service impacts.`; + +export const RCA_PROMPT_TIMELINE_GUIDE = ` +The timeline should focus on key events as +captured in log patterns, including both notable changes and unusual/critical +messages. This data-driven timeline should help establish a chain of causality, +pinpointing when anomalies began, what system behaviors were observed, and how +these patterns relate to the overall incident. + +- Use ISO timestamps** to ensure precision and clarity. +- Focus on log entries** that signal significant system behavior (e.g., +errors, retries, anomalies). +- Highlight critical log messages** or changes in patterns that may correlate +with the issue. +- Include notable anomalies, such as spikes in error rates, unexpected +system responses, or any log entries suggesting failure or degradation. + +Key Elements to Include: + +Log Patterns: Capture log messages that show unusual events or +abnormalities such as error codes, failed retries, or changes in log frequency. +Timestamps: Ensure every entry in the timeline is time-stamped +with an accurate ISO 8601 timestamp. +Event Description: Provide a clear, concise description of what was +observed in the logs. +Corroborating Data: Link log anomalies to other relevant data points such +as traffic shifts, request patterns, or upstream/downstream service impacts.`; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/run_root_cause_analysis.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/run_root_cause_analysis.ts new file mode 100644 index 000000000000..94b14b4f3d12 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/run_root_cause_analysis.ts @@ -0,0 +1,305 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RulesClient } from '@kbn/alerting-plugin/server'; +import { calculateAuto } from '@kbn/calculate-auto'; +import { MessageRole, AssistantMessage, ToolMessage, ToolChoiceType } from '@kbn/inference-common'; +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { Logger } from '@kbn/logging'; +import { AlertsClient } from '@kbn/rule-registry-plugin/server'; +import { findLast, pick } from 'lodash'; +import moment from 'moment'; +import { catchError, filter, from, map, mergeMap, Observable, of, switchMap } from 'rxjs'; +import { ObservabilityAIAssistantClient } from '@kbn/observability-ai-assistant-plugin/server'; +import { ObservabilityElasticsearchClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { + RCA_END_PROCESS_TOOL_NAME, + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from '@kbn/observability-ai-common/root_cause_analysis'; +import { callEndRcaProcessTool } from './call_end_rca_process_tool'; +import { callInvestigateEntityTool } from './call_investigate_entity_tool'; +import { callObserveTool } from './call_observe_tool'; +import { RCA_PROMPT_CHANGES, RCA_PROMPT_ENTITIES, RCA_SYSTEM_PROMPT_BASE } from './prompts'; +import { RCA_TOOLS } from './tools'; +import { + EndProcessToolMessage, + InvestigateEntityToolMessage, + ObservationToolMessage, + RootCauseAnalysisContext, + RootCauseAnalysisEvent, + ToolErrorMessage, +} from './types'; +import { callTools } from './util/call_tools'; +import { formatEntity } from './util/format_entity'; +import { validateInvestigateEntityToolCalls } from './util/validate_investigate_entity_tool_call'; + +const SYSTEM_PROMPT_WITH_OBSERVE_INSTRUCTIONS = `${RCA_SYSTEM_PROMPT_BASE} + +Your next step is to request an observation from another agent based +on the initial context or the results of previous investigations.`; + +const SYSTEM_PROMPT_WITH_DECISION_INSTRUCTIONS = `${RCA_SYSTEM_PROMPT_BASE} + +${RCA_PROMPT_ENTITIES} + +${RCA_PROMPT_CHANGES} + + To determine whether to end the process or continue analyzing another entity, +follow the advice from the previous observation, and these tips: + + Continuing the process: + - Do not investigate an entity twice. This will result in a failure. + - Logs, traces, or observability data that suggest upstream or downstream +issues (such as connection failures, timeouts, or authentication errors) +indicate further investigation is required. + + Ending the process: + - No further entities to investigate: If there are no unexplored upstream or +downstream dependencies, and all related entities have been investigated without +discovering new anomalies, it may be appropriate to end the process. + - If all investigated entities (e.g., services, hosts, containers) are +functioning normally, with no relevant issues found, and there are no signs of +dependencies being affected, you may consider ending the process. + - Avoid concluding the investigation based solely on symptoms or the absence +of immediate errors in the data. Unless a system change has been connected to +the incident, it is important to continue investigating dependencies to ensure +the root cause has been accurately identified.`; + +export function runRootCauseAnalysis({ + serviceName, + start: requestedStart, + end: requestedEnd, + esClient, + alertsClient, + rulesClient, + observabilityAIAssistantClient, + spaceId, + indices, + connectorId, + inferenceClient, + context: initialContext, + logger: incomingLogger, + prevEvents, +}: { + context: string; + serviceName: string; + logger: Logger; + inferenceClient: InferenceClient; + start: number; + end: number; + alertsClient: AlertsClient; + rulesClient: RulesClient; + esClient: ObservabilityElasticsearchClient; + observabilityAIAssistantClient: ObservabilityAIAssistantClient; + indices: { + logs: string[]; + traces: string[]; + sloSummaries: string[]; + }; + connectorId: string; + spaceId: string; + prevEvents?: RootCauseAnalysisEvent[]; +}): Observable { + const logger = incomingLogger.get('rca'); + + const entity = { 'service.name': serviceName }; + + const bucketSize = calculateAuto + .atLeast(30, moment.duration(requestedEnd - requestedStart))! + .asMilliseconds(); + + const start = Math.floor(requestedStart / bucketSize) * bucketSize; + const end = Math.floor(requestedEnd / bucketSize) * bucketSize; + + const initialMessage = { + role: MessageRole.User as const, + content: `Investigate the health status of ${formatEntity(entity)}. + + The context given for this investigation is: + + ${initialContext}`, + }; + + const nextEvents = [initialMessage, ...(prevEvents ?? [])]; + + const initialRcaContext: RootCauseAnalysisContext = { + connectorId, + start, + end, + esClient, + events: nextEvents, + indices, + inferenceClient, + initialContext, + alertsClient, + observabilityAIAssistantClient, + logger, + rulesClient, + spaceId, + tokenLimit: 32_000, + }; + + const investigationTimeRangePrompt = `## Time range + + The time range of the investigation is ${new Date(start).toISOString()} until ${new Date( + end + ).toISOString()}`; + + initialContext = `${initialContext} + + ${investigationTimeRangePrompt} + `; + + const next$ = callTools( + { + system: RCA_SYSTEM_PROMPT_BASE, + connectorId, + inferenceClient, + messages: nextEvents, + logger, + }, + ({ messages }) => { + const lastSuccessfulToolResponse = findLast( + messages, + (message) => message.role === MessageRole.Tool && message.name !== 'error' + ) as Exclude | undefined; + + const shouldWriteObservationNext = + !lastSuccessfulToolResponse || lastSuccessfulToolResponse.name !== RCA_OBSERVE_TOOL_NAME; + + const nextTools = shouldWriteObservationNext + ? pick(RCA_TOOLS, RCA_OBSERVE_TOOL_NAME) + : pick(RCA_TOOLS, RCA_END_PROCESS_TOOL_NAME, RCA_INVESTIGATE_ENTITY_TOOL_NAME); + + const nextSystem = shouldWriteObservationNext + ? SYSTEM_PROMPT_WITH_OBSERVE_INSTRUCTIONS + : SYSTEM_PROMPT_WITH_DECISION_INSTRUCTIONS; + + return { + messages, + system: `${nextSystem} + + ${investigationTimeRangePrompt}`, + tools: nextTools, + toolChoice: shouldWriteObservationNext + ? { function: RCA_OBSERVE_TOOL_NAME } + : ToolChoiceType.required, + }; + }, + ({ + toolCalls, + messages, + }): Observable< + | ObservationToolMessage + | ToolErrorMessage + | InvestigateEntityToolMessage + | EndProcessToolMessage + | AssistantMessage + > => { + const nextRcaContext = { + ...initialRcaContext, + events: messages as RootCauseAnalysisEvent[], + }; + + return of(undefined).pipe( + switchMap(() => { + return from( + validateInvestigateEntityToolCalls({ rcaContext: nextRcaContext, toolCalls }) + ); + }), + switchMap((errors) => { + if (errors.length) { + return of( + ...toolCalls.map((toolCall) => { + const toolCallErrorMessage: ToolErrorMessage = { + role: MessageRole.Tool, + name: 'error', + response: { + error: { + message: `Some ${RCA_INVESTIGATE_ENTITY_TOOL_NAME} calls were not valid: + ${errors.map((error) => `- ${error}`).join('\n')}`, + }, + }, + toolCallId: toolCall.toolCallId, + }; + return toolCallErrorMessage; + }) + ); + } + return of(...toolCalls).pipe( + mergeMap((toolCall) => { + function executeToolCall(): Observable< + | EndProcessToolMessage + | InvestigateEntityToolMessage + | ObservationToolMessage + | ToolErrorMessage + | AssistantMessage + > { + switch (toolCall.function.name) { + case RCA_END_PROCESS_TOOL_NAME: + return callEndRcaProcessTool({ + rcaContext: nextRcaContext, + toolCallId: toolCall.toolCallId, + }); + + case RCA_INVESTIGATE_ENTITY_TOOL_NAME: + return callInvestigateEntityTool({ + context: toolCall.function.arguments.context, + field: toolCall.function.arguments.entity.field, + value: toolCall.function.arguments.entity.value, + rcaContext: nextRcaContext, + toolCallId: toolCall.toolCallId, + }); + + case RCA_OBSERVE_TOOL_NAME: + return callObserveTool({ + rcaContext: nextRcaContext, + toolCallId: toolCall.toolCallId, + }); + } + } + + return executeToolCall().pipe( + catchError((error) => { + logger.error(`Failed executing task: ${error.message}`); + logger.error(error); + const toolErrorMessage: ToolErrorMessage = { + name: 'error', + role: MessageRole.Tool, + response: { + error: { + ...('toJSON' in error && typeof error.toJSON === 'function' + ? error.toJSON() + : {}), + message: error.message, + }, + }, + toolCallId: toolCall.toolCallId, + }; + return of(toolErrorMessage); + }) + ); + }, 3) + ); + }) + ); + } + ); + + return next$.pipe( + filter((event) => + Boolean(event.role !== MessageRole.Assistant || event.content || event.toolCalls?.length) + ), + map((event) => { + if (event.role === MessageRole.Assistant) { + return event as Extract; + } + return event; + }) + ); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/analyze_log_patterns/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/analyze_log_patterns/index.ts new file mode 100644 index 000000000000..fe090b64c972 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/analyze_log_patterns/index.ts @@ -0,0 +1,402 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { getEntityKuery } from '@kbn/observability-utils-common/entities/get_entity_kuery'; +import { formatValueForKql } from '@kbn/observability-utils-common/es/format_value_for_kql'; +import type { TruncatedDocumentAnalysis } from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { ShortIdTable } from '@kbn/observability-utils-common/llm/short_id_table'; +import { + P_VALUE_SIGNIFICANCE_HIGH, + P_VALUE_SIGNIFICANCE_MEDIUM, +} from '@kbn/observability-utils-common/ml/p_value_to_label'; +import { + FieldPatternResultWithChanges, + getLogPatterns, +} from '@kbn/observability-utils-server/entities/get_log_patterns'; +import { castArray, compact, groupBy, orderBy } from 'lodash'; +import { RCA_PROMPT_CHANGES, RCA_PROMPT_ENTITIES } from '../../prompts'; +import { RootCauseAnalysisContext } from '../../types'; +import { formatEntity } from '../../util/format_entity'; +import { serializeKnowledgeBaseEntries } from '../../util/serialize_knowledge_base_entries'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; + +type LogPatternRelevance = 'normal' | 'unusual' | 'warning' | 'critical'; + +export type AnalyzedLogPattern = FieldPatternResultWithChanges & { + relevance: LogPatternRelevance; + interesting: boolean; +}; + +export interface AnalyzeLogPatternOutput { + ownPatterns: AnalyzedLogPattern[]; + patternsFromOtherEntities: AnalyzedLogPattern[]; +} + +const normalDescription = `normal operations, such as such access logs`; +const unusualDescription = `something unusual and/or +appear rarely, such as startup or shutdown messages or +other rare vents`; +const warningDescription = `something being in an unexpected state, +such as error messages, rate limiting or disk usage warnings`; +const criticalDescription = `something being in a critical state, +such as startup failure messages, out-of-memory errors or crashloopbackoff +events`; + +interface LogPatternCutOff { + significance?: 'high' | 'medium' | 'low'; + pValue?: number; +} + +export async function analyzeLogPatterns({ + entity, + allAnalysis, + system, + rcaContext: { logger: parentLogger, inferenceClient, connectorId, esClient, start, end, indices }, + cutoff, + kbEntries, +}: { + entity: Record; + allAnalysis: Array<{ index: string | string[]; analysis: TruncatedDocumentAnalysis }>; + system: string; + cutoff?: LogPatternCutOff; + kbEntries: ScoredKnowledgeBaseEntry[]; + rcaContext: Pick< + RootCauseAnalysisContext, + 'indices' | 'logger' | 'inferenceClient' | 'connectorId' | 'esClient' | 'start' | 'end' + >; +}): Promise { + const kuery = getEntityKuery(entity); + + const logger = parentLogger.get('analyzeLogPatterns'); + + const fields = ['message', 'error.exception.message']; + + logger.debug(() => `Analyzing log patterns for ${JSON.stringify(entity)}`); + + const systemPrompt = `You are a helpful assistant for Elastic Observability. + You are an expert in analyzing log messages for software + systems, and you use your extensive experience as an SRE + to thoroughly analyze log patterns for things that require + attention from the user. + + ${RCA_PROMPT_CHANGES} + + ${RCA_PROMPT_ENTITIES} + + ## Entity + + The following entity is being analyzed: + + ${formatEntity(entity)} + + ${serializeKnowledgeBaseEntries(kbEntries)} + + ### Entity analysis + + ${allAnalysis.map(({ index: analyzedIndex, analysis }) => { + return `#### Indices: ${castArray(analyzedIndex).join(',')} + + ${JSON.stringify(analysis)}`; + })} + + ${system}`; + + const kueryForOtherEntities = `NOT (${kuery}) AND ${Object.values(entity) + .map( + (val) => + `(${fields.map((field) => `(${[field, formatValueForKql(val)].join(':')})`).join(' OR ')})` + ) + .join(' AND ')}`; + + const [logPatternsFromEntity, logPatternsFromElsewhere] = await Promise.all([ + getLogPatterns({ + esClient, + index: [...indices.logs, ...indices.traces], + start, + end, + kuery, + includeChanges: true, + fields, + metadata: [], + }), + getLogPatterns({ + esClient, + index: [...indices.logs], + start, + end, + kuery: kueryForOtherEntities, + metadata: Object.keys(entity), + includeChanges: true, + fields, + }), + ]); + const patternIdLookupTable = new ShortIdTable(); + + logger.debug( + () => + `Found ${logPatternsFromEntity.length} own log patterns and ${logPatternsFromElsewhere.length} from others` + ); + + logger.trace( + () => + `Found log patterns${JSON.stringify({ + entity, + logPatternsFromEntity, + logPatternsFromElsewhere, + })}` + ); + + const patternsWithIds = [...logPatternsFromEntity, ...logPatternsFromElsewhere].map((pattern) => { + return { + ...pattern, + shortId: patternIdLookupTable.take(pattern.regex), + }; + }); + + const patternsByRegex = new Map(patternsWithIds.map((pattern) => [pattern.regex, pattern])); + + const serializedOwnEntity = formatEntity(entity); + + const [ownPatterns, patternsFromOtherEntities] = await Promise.all([ + logPatternsFromEntity.length ? categorizeOwnPatterns() : [], + logPatternsFromElsewhere.length ? selectRelevantPatternsFromOtherEntities() : [], + ]); + + logger.trace( + () => + `Classified log patterns ${JSON.stringify([entity, ownPatterns, patternsFromOtherEntities])}` + ); + + const allPatterns = [...ownPatterns, ...patternsFromOtherEntities]; + + const sortedByPValueAsc = orderBy( + allPatterns.filter((pattern) => pattern.change && pattern.change.p_value), + (pattern) => { + return pattern.change.p_value; + }, + 'asc' + ); + + const pValueCutOff = getPValueCutoff({ cutoff, max: sortedByPValueAsc[0]?.change.p_value }); + + return { + ownPatterns: ownPatterns.map((pattern) => ({ + ...pattern, + interesting: isInterestingPattern(pattern, pValueCutOff), + })), + patternsFromOtherEntities: patternsFromOtherEntities.map((pattern) => ({ + ...pattern, + interesting: isInterestingPattern(pattern, pValueCutOff), + })), + }; + + function categorizeOwnPatterns() { + return inferenceClient + .output({ + id: 'analyze_log_patterns', + connectorId, + system: systemPrompt, + input: `Based on the following log patterns from + ${formatEntity(entity)}, group these patterns into + the following categories: + + - normal (patterns that are indicative of ${normalDescription}) + - unusual (patterns that are indicative of ${unusualDescription}) + - warning (patterns that are indicative of ${warningDescription}) + - critical (patterns that are indicative of ${criticalDescription}) + + ## Log patterns: + + ${preparePatternsForLlm(logPatternsFromEntity)} + `, + schema: { + type: 'object', + properties: { + categories: { + type: 'array', + items: { + type: 'object', + properties: { + relevance: { + type: 'string', + enum: ['normal', 'unusual', 'warning', 'critical'], + }, + shortIds: { + type: 'array', + description: + 'The pattern IDs you want to group here. Use the pattern short ID.', + items: { + type: 'string', + }, + }, + }, + required: ['relevance', 'shortIds'], + }, + }, + }, + required: ['categories'], + } as const, + }) + .then((outputEvent) => { + return outputEvent.output.categories.flatMap((category) => { + return mapIdsBackToPatterns(category.shortIds).map((pattern) => { + return { + ...pattern, + relevance: category.relevance, + }; + }); + }); + }); + } + + function selectRelevantPatternsFromOtherEntities() { + return inferenceClient + .output({ + id: 'select_relevant_patterns_from_other_entities', + connectorId, + system: systemPrompt, + input: `Based on the following log patterns that + are NOT from ${serializedOwnEntity}, group these + patterns into the following categories: + + - irrelevant (patterns that are not relevant for + ${serializedOwnEntity}) + - normal (patterns that relevant for + ${serializedOwnEntity} and are indicative of ${normalDescription}) + - unusual (patterns that are relevant for + ${serializedOwnEntity} and are indicative of ${unusualDescription}) + - warning (patterns that are relevant for + ${serializedOwnEntity} and are indicative of ${warningDescription}) + - critical (patterns that are relevant for + ${serializedOwnEntity} and are indicative of ${criticalDescription}) + + Relevant patterns are messages that mention the + investigated entity, or things that are indicative + of critical failures or changes in the entity + that owns the log pattern. + + ## Log patterns: + + ${preparePatternsForLlm(logPatternsFromElsewhere)} + `, + schema: { + type: 'object', + properties: { + categories: { + type: 'array', + items: { + type: 'object', + properties: { + relevance: { + type: 'string', + enum: ['irrelevant', 'normal', 'unusual', 'warning', 'critical'], + }, + shortIds: { + type: 'array', + description: + 'The pattern IDs you want to group here. Use the pattern short ID.', + items: { + type: 'string', + }, + }, + }, + required: ['relevance', 'shortIds'], + }, + }, + }, + required: ['categories'], + } as const, + }) + .then((outputEvent) => { + return outputEvent.output.categories.flatMap((category) => { + return mapIdsBackToPatterns(category.shortIds).flatMap((pattern) => { + if (category.relevance === 'irrelevant') { + return []; + } + return [ + { + ...pattern, + relevance: category.relevance, + }, + ]; + }); + }); + }); + } + + function preparePatternsForLlm(patterns: FieldPatternResultWithChanges[]): string { + const groupedByField = groupBy(patterns, (pattern) => pattern.field); + + return Object.entries(groupedByField) + .map(([field, patternsForField]) => { + return `### \`${field}\` + + #### Patterns + + ${JSON.stringify( + patternsForField.map((pattern) => { + return { + shortId: patternIdLookupTable.take(pattern.regex), + regex: pattern.regex, + sample: pattern.sample, + highlight: pattern.highlight, + change: pattern.change, + }; + }) + )} + `; + }) + .join('\n\n'); + } + + function mapIdsBackToPatterns(ids?: string[]) { + return compact( + ids?.map((shortId) => { + const lookupId = patternIdLookupTable.lookup(shortId); + if (!lookupId) { + return undefined; + } + const pattern = patternsByRegex.get(lookupId); + return pattern; + }) + ); + } +} + +function isInterestingPattern( + pattern: Omit, + pValueCutOff: number +) { + return (pattern.change.p_value ?? 1) <= pValueCutOff || pattern.relevance !== 'normal'; +} + +function getPValueCutoff({ max, cutoff }: { max?: number; cutoff?: LogPatternCutOff }) { + if (cutoff?.pValue) { + return cutoff?.pValue; + } + + if (cutoff?.significance === 'high') { + return P_VALUE_SIGNIFICANCE_HIGH; + } + + if (cutoff?.significance === 'medium') { + return P_VALUE_SIGNIFICANCE_MEDIUM; + } + + if (max === undefined) { + return Number.MAX_VALUE; + } + + if (max <= P_VALUE_SIGNIFICANCE_HIGH) { + return P_VALUE_SIGNIFICANCE_HIGH; + } + + if (max <= P_VALUE_SIGNIFICANCE_MEDIUM) { + return P_VALUE_SIGNIFICANCE_MEDIUM; + } + + return Number.MAX_VALUE; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_entity/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_entity/index.ts new file mode 100644 index 000000000000..bd050c4c61df --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_entity/index.ts @@ -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 { InferenceClient } from '@kbn/inference-plugin/server'; +import { TruncatedDocumentAnalysis } from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { FieldPatternResultWithChanges } from '@kbn/observability-utils-server/entities/get_log_patterns'; +import { RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { formatEntity } from '../../util/format_entity'; +import { serializeKnowledgeBaseEntries } from '../../util/serialize_knowledge_base_entries'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; +import { getInvestigateEntityTaskPrompt } from '../investigate_entity/prompts'; + +export async function describeEntity({ + inferenceClient, + connectorId, + entity, + contextForEntityInvestigation, + analysis, + ownPatterns, + kbEntries, +}: { + inferenceClient: InferenceClient; + connectorId: string; + entity: Record; + analysis: TruncatedDocumentAnalysis; + contextForEntityInvestigation: string; + ownPatterns: FieldPatternResultWithChanges[]; + kbEntries: ScoredKnowledgeBaseEntry[]; +}) { + const system = RCA_SYSTEM_PROMPT_BASE; + + const input = `${getInvestigateEntityTaskPrompt({ entity, contextForEntityInvestigation })} + + ## Context for investigating ${formatEntity(entity)} + + ${contextForEntityInvestigation} + + ${serializeKnowledgeBaseEntries(kbEntries)} + + ## Data samples + + ${JSON.stringify(analysis)} + + ## Log patterns + + ${JSON.stringify(ownPatterns.map(({ regex, sample }) => ({ regex, sample })))} + + ## Current task + + Describe the entity characteristics based on the sample documents and log + patterns. Put it in context of the investigation process. Mention the reason + why it's being investigated, and how it is related other entities that were + previously investigated. Mention these three things: + + - infrastructure & environment + - communication characteristics (protocols and endpoints) + - context of entity in investigation + + You shouldn't mention the log patterns, they will be analyzed elsewhere. + `; + + const response = await inferenceClient.output({ + id: 'describe_entity', + connectorId, + system, + input, + }); + + return response.content; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_log_patterns/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_log_patterns/index.ts new file mode 100644 index 000000000000..ea5cc75eea1d --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/describe_log_patterns/index.ts @@ -0,0 +1,189 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { TruncatedDocumentAnalysis } from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { omit, partition, sumBy } from 'lodash'; +import { RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { formatEntity } from '../../util/format_entity'; +import { serializeKnowledgeBaseEntries } from '../../util/serialize_knowledge_base_entries'; +import { AnalyzedLogPattern } from '../analyze_log_patterns'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; +import { getInvestigateEntityTaskPrompt } from '../investigate_entity/prompts'; + +export interface LogPatternDescription { + content: string; + docCount: number; + interestingPatternCount: number; + ignoredPatternCount: number; + ignoredDocCount: number; +} + +export async function describeLogPatterns({ + inferenceClient, + connectorId, + entity, + contextForEntityInvestigation, + analysis, + ownPatterns: allOwnPatterns, + patternsFromOtherEntities, + kbEntries, +}: { + inferenceClient: InferenceClient; + connectorId: string; + entity: Record; + analysis: TruncatedDocumentAnalysis; + contextForEntityInvestigation: string; + ownPatterns: AnalyzedLogPattern[]; + patternsFromOtherEntities: AnalyzedLogPattern[]; + kbEntries: ScoredKnowledgeBaseEntry[]; +}): Promise { + const system = RCA_SYSTEM_PROMPT_BASE; + + const [ownInterestingPatterns, ignoredOwnPatterns] = partition( + allOwnPatterns, + (pattern) => pattern.interesting + ); + + const stats = { + docCount: sumBy(allOwnPatterns, (pattern) => pattern.count), + interestingPatternCount: ownInterestingPatterns.length, + otherInterestingPatternCount: patternsFromOtherEntities.length, + ignoredPatternCount: ignoredOwnPatterns.length, + ignoredDocCount: sumBy(ignoredOwnPatterns, (pattern) => pattern.count), + }; + + const header = `## Log analysis + + ### Stats for own log patterns: + - ${stats.docCount} documents analyzed + - ${stats.interestingPatternCount} interesting patterns + - ${stats.ignoredPatternCount} ignored patterns, accounting for + ${stats.ignoredDocCount} out of ${stats.docCount} documents + - ${stats.otherInterestingPatternCount} relevant patterns from + other entities`; + + if (!stats.interestingPatternCount && !stats.otherInterestingPatternCount) { + return { + ...stats, + content: `${header}\n\nNo interesting log patterns`, + }; + } + + const ownLogPatternsPrompt = ownInterestingPatterns.length + ? JSON.stringify( + ownInterestingPatterns.map(({ regex, sample, change, count, timeseries }) => ({ + regex, + sample, + change, + count, + timeseries: timeseries.map(({ x, y }, index) => { + if (index === change.change_point) { + return `${change.type} at ${new Date(x).toISOString()}: ${y}`; + } + return `${new Date(x).toISOString()}: ${y}`; + }), + })) + ) + : 'No own log patterns found'; + + const otherLogPatternsPrompt = patternsFromOtherEntities.length + ? JSON.stringify( + patternsFromOtherEntities.map( + ({ regex, sample, change, count, timeseries, metadata, field, highlight }) => ({ + regex, + sample, + change, + count, + timeseries: timeseries.map(({ x, y }, index) => { + if (index === change.change_point) { + return `${change.type} at ${new Date(x).toISOString()}: ${y}`; + } + return `${new Date(x).toISOString()}: ${y}`; + }), + entity: omit(metadata, field), + highlight, + }) + ) + ) + : 'No relevant log patterns found from other entities'; + + const input = `${getInvestigateEntityTaskPrompt({ entity, contextForEntityInvestigation })} + + ## Context for investigating ${formatEntity(entity)} + + ${contextForEntityInvestigation} + + ${serializeKnowledgeBaseEntries(kbEntries)} + + ## Data samples + + ${JSON.stringify(analysis)} + + ## Log patterns from ${formatEntity(entity)} + + ${ownLogPatternsPrompt} + + ## Possibly relevant log patterns from other entities + + ${otherLogPatternsPrompt} + + ### Interpreting log patterns and samples + + The pattern itself is what is consistent across all messages. The values from these parts + are separately given in "constants". There's also a single (random) _sample_ included, with + the variable part being given as well. E.g., if the failure in the sample is not part of the pattern + itself, you should mention that in your analysis. + + ## Task + + Using only the log patterns, describe your observations about the entity. + + Group these pattterns together based on topic. Some examples of these topics: + + - normal operations such as request logs + - connection issues to an upstream dependency + - startup messages + - garbage collection messages + + For patterns with change points, describe the trend before and after the change point based + on the data points. E.g.: + - A persisted drop to near-zero after 2020-01-01T05:00:00.000Z + - A spike from 10 to 100 at 2020-01-01T05:00:00.000Z, which went back down + to the average after 2020-01-01T05:02:00.000Z + - A trend change after 2020-01-01T05:00:00.000Z. The values ranged from 10 + to 20 before, but then after increased from 20 to 100 until + 2020-01-01T05:02:00.000Z. + + Do not: + - repeat the variables, instead, repeat the constants. + - repeat the timeseries as a whole, verbatim, in full. However, you can use individual data points + timestamps to illustrate the magnitude of the change, as in the example previously given. + - make up timestamps. + - do not separately list individual events if you have already mentioned + the pattern. + + Statistics: + + - ${stats.interestingPatternCount} patterns from ${formatEntity(entity)} + were collected + - ${stats.docCount} logs were categorized + - ${stats.ignoredPatternCount} patterns were deemed uninteresting and accounted + for ${stats.ignoredDocCount} out of the total amount of logs + `; + + const response = await inferenceClient.output({ + id: 'describe_log_patterns', + connectorId, + system, + input, + }); + + return { + ...stats, + content: response.content, + }; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts new file mode 100644 index 000000000000..893533629ff0 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/analyze_fetched_related_entities.ts @@ -0,0 +1,438 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { Logger } from '@kbn/logging'; +import { getEntityKuery } from '@kbn/observability-utils-common/entities/get_entity_kuery'; +import { + DocumentAnalysis, + TruncatedDocumentAnalysis, +} from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { sortAndTruncateAnalyzedFields } from '@kbn/observability-utils-common/llm/log_analysis/sort_and_truncate_analyzed_fields'; +import { analyzeDocuments } from '@kbn/observability-utils-server/entities/analyze_documents'; +import { FieldPatternResultWithChanges } from '@kbn/observability-utils-server/entities/get_log_patterns'; +import { ObservabilityElasticsearchClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { kqlQuery } from '@kbn/observability-utils-server/es/queries/kql_query'; +import { rangeQuery } from '@kbn/observability-utils-server/es/queries/range_query'; +import { chunk, isEmpty, isEqual } from 'lodash'; +import pLimit from 'p-limit'; +import { + RCA_PROMPT_DEPENDENCIES, + RCA_PROMPT_ENTITIES, + RCA_SYSTEM_PROMPT_BASE, +} from '../../prompts'; +import { chunkOutputCalls } from '../../util/chunk_output_calls'; +import { formatEntity } from '../../util/format_entity'; +import { serializeKnowledgeBaseEntries } from '../../util/serialize_knowledge_base_entries'; +import { toBlockquote } from '../../util/to_blockquote'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; +import { RelatedEntityKeywordSearch } from './write_keyword_searches_for_related_entities'; + +export interface RelatedEntityFromSearchResults { + entity: { [x: string]: string }; + highlight: Record; + analysis: TruncatedDocumentAnalysis; +} + +function getPromptForFoundEntity({ entity, analysis, highlight }: RelatedEntityFromSearchResults) { + return `## Entity: ${formatEntity(entity)} + + ${toBlockquote(`### Search highlights for ${formatEntity(entity)} + ${JSON.stringify(highlight)}`)} + `; +} + +function getInputPromptBase({ + entity, + analysis, + ownPatterns, + patternsFromOtherEntities, + searches, + context, + kbEntries, +}: { + entity: Record; + analysis: TruncatedDocumentAnalysis; + ownPatterns: FieldPatternResultWithChanges[]; + patternsFromOtherEntities: FieldPatternResultWithChanges[]; + searches: RelatedEntityKeywordSearch[]; + context: string; + kbEntries: ScoredKnowledgeBaseEntry[]; +}) { + const otherPatternsPrompt = patternsFromOtherEntities.length + ? JSON.stringify( + patternsFromOtherEntities.map((pattern) => ({ + sample: pattern.sample, + regex: pattern.regex, + })) + ) + : 'No relevant log patterns from other entities found'; + const logPatternsPrompt = ownPatterns.length + ? JSON.stringify( + ownPatterns.map((pattern) => { + return { sample: pattern.sample, regex: pattern.regex }; + }) + ) + : 'No log patterns found'; + return `Describe possible relationships to the investigated entity ${formatEntity(entity)}. + + ## Context + + ${toBlockquote(context)} + + ${serializeKnowledgeBaseEntries(kbEntries)} + + ## Data analysis + ${JSON.stringify(analysis)} + + ## Log patterns for ${formatEntity(entity)} + + ${logPatternsPrompt} + + ## Patterns from other entities + + ${otherPatternsPrompt} + + ## Search keywords + + ${searches + .map(({ fragments, appearsAs }) => { + return `## Appears as: ${appearsAs} + + ### Fragments: + ${fragments.map((fragment) => `- \`${fragment}\``).join('\n')}`; + }) + .join('\n')}`; +} + +function getInputPromptInstructions({ entity }: { entity: Record }) { + return `### Indicator strength + +In an Observability system, indicators of relationships between entities like +services, hosts, users, or requests can vary in strength. Some indicators +clearly define relationships, while others only suggest correlations. Here’s a +breakdown of these indicators into strong, average, and weak categories, with an +additional look at how weak indicators can become strong when combined. + +Strong indicators provide definitive links between entities. Distributed tracing +IDs (trace, span, and parent) are among the strongest indicators, as they map +the complete request path across services, showing exact service interactions. +Session or user IDs are also strong indicators, capturing a user’s actions +across services or hosts and revealing issues specific to particular users. + +Average indicators give helpful context but may require supporting data to +clarify relationships. IP addresses, for instance, are moderately strong for +tracking inter-service calls within controlled environments but are weaker +across public or shared networks where IP reuse is common. URL paths also fall +in this category; they link entities to specific endpoints or service functions +and are moderately strong for tracking interactions between microservices with +known APIs. Port numbers are another average indicator. While they suggest the +service interaction type (HTTP, database), they generally need pairing with IP +addresses or URLs for more accuracy, as port numbers alone are often shared +across different services. + +Weak indicators are often too generic to imply a direct relationship but can +suggest possible correlations. Host names, for example, are broad and typically +cover a range of services or applications, especially in large clusters. +Time-based indicators, such as timestamps or TTL values, suggest possible timing +correlations but don’t establish a definitive link on their own. Status codes, +like HTTP 500 errors, indicate issues but don’t specify causality, often +requiring corroboration with stronger indicators like trace or session IDs. + +However, weak indicators can become strong when they appear together. For +instance, a combination of IP address, port, and timestamp can strongly suggest +a direct interaction between services, especially when the same combination is +seen repeatedly or in conjunction with related URLs. Similarly, a host name +combined with a unique URL path can strongly suggest that a specific service or +pod is generating particular request patterns, even if each alone is too +general. + +## Relevance to the investigation + +Given the context of the investigation, some entities might be very relevant +even if there is no strong evidence of them being a direct dependency of +${formatEntity(entity)}. For instance, the related entity might be an +orchestrating entity, or it might be involved in a specific operation related +to the ongoing issue. + +## Identifying entity relationships + +Your current task is to identify possible entity relationships for the +investigated entity ${formatEntity(entity)}. You will get some context, document +analysis for the investigated entity, and results from keyword searches that were +extracted from the entity. Based on this data, list entities that could possibly +be related to the given entity and/or the initial context. List the highly +relevant entities first. + +## Output + +For each possible relationship, describe the following things: +- The related entity (as a key-value pair) +- The indicators you have observed as evidence of the relationship. Include the +strength of the indicator, and the exact pieces of data that are related to it +(field names and values, in both the investigated entity, and the possibly +related entity). +- Reason how the related entity is related to both ${formatEntity(entity)} as a +dependency and the context. For instance, describe who is the caller and callee +or whether that is unclear, based on the data, or explain how it might be +related to the context. +- The overall likeliness of it being a relevant entity.`; +} + +export async function analyzeFetchedRelatedEntities({ + connectorId, + inferenceClient, + esClient, + start, + end, + searches, + groupingFields, + index, + entity, + ownPatterns, + analysis, + patternsFromOtherEntities, + logger: parentLogger, + context, + kbEntries, +}: { + connectorId: string; + inferenceClient: InferenceClient; + esClient: ObservabilityElasticsearchClient; + start: number; + end: number; + searches: RelatedEntityKeywordSearch[]; + groupingFields: string[]; + index: string | string[]; + entity: Record; + analysis: { + truncated: TruncatedDocumentAnalysis; + full: DocumentAnalysis; + }; + ownPatterns: FieldPatternResultWithChanges[]; + patternsFromOtherEntities: FieldPatternResultWithChanges[]; + context: string; + logger: Logger; + kbEntries: ScoredKnowledgeBaseEntry[]; +}): Promise<{ + summaries: string[]; + foundEntities: RelatedEntityFromSearchResults[]; +}> { + const entityFields = Object.keys(entity); + + const logger = parentLogger.get('findRelatedEntities'); + + logger.debug( + () => `Finding related entities: ${JSON.stringify({ entity, groupingFields, searches })}` + ); + + const allValuesFromEntity = Array.from( + new Set(analysis.full.fields.flatMap((field) => field.values)) + ); + + const foundEntities = ( + await Promise.all( + groupingFields.map((groupingField) => getResultsForGroupingField(groupingField)) + ) + ).flat(); + + logger.debug(() => `Found ${foundEntities.length} entities via keyword searches`); + + const system = `${RCA_SYSTEM_PROMPT_BASE} + + ${RCA_PROMPT_ENTITIES} + + ${RCA_PROMPT_DEPENDENCIES}`; + + const inputPromptBase = getInputPromptBase({ + entity, + analysis: analysis.truncated, + ownPatterns, + patternsFromOtherEntities, + searches, + context, + kbEntries, + }); + + const foundEntityPrompts = foundEntities.map((foundEntity) => { + return { + text: getPromptForFoundEntity(foundEntity), + id: formatEntity(foundEntity.entity), + }; + }); + + const inputPromptInstructions = getInputPromptInstructions({ entity }); + + // don't do more than 10 entities in a response, we'll run out of + // tokens + const requests = chunk(foundEntityPrompts, 10).flatMap((texts) => + chunkOutputCalls({ + system, + input: `${inputPromptBase} ${inputPromptInstructions}`, + texts, + tokenLimit: 32_000 - 6_000, + }) + ); + + const allRelevantEntityDescriptions = await Promise.all( + requests.map(async (request) => { + const outputCompleteEvent = await inferenceClient.output({ + id: 'describe_relevant_entities', + connectorId, + system: request.system, + input: `${inputPromptBase} + + # Found entities + + ${request.texts.map((text) => text.text).join('\n\n')} + + ${inputPromptInstructions}`, + }); + + return outputCompleteEvent.content; + }) + ); + + return { + summaries: allRelevantEntityDescriptions, + foundEntities, + }; + + async function getResultsForGroupingField( + groupingField: string + ): Promise { + const excludeQuery = isEqual([groupingField], entityFields) + ? `NOT (${groupingField}:"${entity[groupingField]}")` + : ``; + + const fieldCaps = await esClient.fieldCaps('check_if_grouping_field_exists', { + fields: [groupingField], + index, + index_filter: { + bool: { + filter: [...rangeQuery(start, end)], + }, + }, + }); + + if (isEmpty(fieldCaps.fields[groupingField])) { + return []; + } + + const keywordSearchResults = await esClient.search( + 'find_related_entities_via_keyword_searches', + { + track_total_hits: false, + index, + query: { + bool: { + must: [...rangeQuery(start, end), ...kqlQuery(excludeQuery)], + should: [ + { + multi_match: { + query: searches.flatMap((search) => search.fragments).join(' '), + fields: '*', + }, + }, + ], + minimum_should_match: 1, + }, + }, + fields: [groupingField], + collapse: { + field: groupingField, + }, + highlight: { + fields: { + '*': {}, + }, + }, + _source: false, + size: 1_000, + } + ); + + if (!keywordSearchResults.hits.hits.length) { + logger.debug(() => `No hits: ${JSON.stringify({ entity, groupingField, searches })}`); + return []; + } + + logger.trace( + () => + `Hits: ${JSON.stringify({ + entity, + groupingField, + searches, + count: keywordSearchResults.hits.hits.length, + hits: keywordSearchResults.hits.hits, + })}` + ); + + const limiter = pLimit(20); + + const groupingFieldAnalysis = await Promise.all( + keywordSearchResults.hits.hits.map(async (hit) => { + return limiter(async () => { + const groupValue = hit.fields![groupingField][0] as string; + + const analysisForGroupingField = await analyzeDocuments({ + esClient, + start, + end, + index, + kuery: getEntityKuery({ + [groupingField]: groupValue, + }), + }); + + const analysisWithRelevantValues = { + ...analysisForGroupingField, + fields: analysisForGroupingField.fields + .filter((field) => { + return !field.empty; + }) + .map((field) => { + const valuesFoundInEntity = field.values.filter((value) => { + return ( + allValuesFromEntity.includes(value) || + allValuesFromEntity.some((valueFromEntity) => { + return ( + typeof valueFromEntity === 'string' && + typeof value === 'string' && + (value.includes(valueFromEntity) || valueFromEntity.includes(value)) + ); + }) + ); + }); + return { + ...field, + values: valuesFoundInEntity, + }; + }), + }; + + return { + groupingField, + key: groupValue, + highlight: hit.highlight!, + analysis: sortAndTruncateAnalyzedFields(analysisWithRelevantValues), + }; + }); + }) + ); + + return groupingFieldAnalysis.map(({ key, highlight, analysis: analysisForGroupingField }) => { + return { + entity: { + [groupingField]: key, + }, + highlight, + analysis: analysisForGroupingField, + }; + }); + } +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts new file mode 100644 index 000000000000..5480a76eb209 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/extract_related_entities.ts @@ -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 stringify from 'json-stable-stringify'; +import pLimit from 'p-limit'; +import { RelatedEntityFromSearchResults } from '.'; +import { + RCA_PROMPT_DEPENDENCIES, + RCA_PROMPT_ENTITIES, + RCA_SYSTEM_PROMPT_BASE, +} from '../../prompts'; +import { RootCauseAnalysisContext } from '../../types'; +import { formatEntity } from '../../util/format_entity'; +import { getPreviouslyInvestigatedEntities } from '../../util/get_previously_investigated_entities'; +import { toBlockquote } from '../../util/to_blockquote'; + +export interface RelatedEntityDescription { + entity: Record; + reason: string; + confidence: string; +} + +export async function extractRelatedEntities({ + entity, + entityReport, + summaries, + foundEntities, + context, + rcaContext: { events, connectorId, inferenceClient }, +}: { + foundEntities: RelatedEntityFromSearchResults[]; + entity: Record; + entityReport: string; + summaries: string[]; + context: string; + rcaContext: Pick; +}): Promise<{ relatedEntities: RelatedEntityDescription[] }> { + const system = `${RCA_SYSTEM_PROMPT_BASE} + + ${RCA_PROMPT_ENTITIES} + + ${RCA_PROMPT_DEPENDENCIES}`; + + const previouslyInvestigatedEntities = getPreviouslyInvestigatedEntities({ events }); + + const previouslyInvestigatedEntitiesPrompt = previouslyInvestigatedEntities.length + ? `## Previously investigated entities + + ${previouslyInvestigatedEntities + .map((prevEntity) => `- ${formatEntity(prevEntity)}`) + .join('\n')}` + : ''; + + const prompts = summaries.map((summary) => { + return ` + # Investigated entity + + ${formatEntity(entity)} + + # Report + + ${toBlockquote(entityReport)} + + # Related entities report + + ${toBlockquote(summary)} + + ${previouslyInvestigatedEntitiesPrompt} + + # Context + + ${context} + + # Task + + Your current task is to extract relevant entities as a data structure from the + related entities report. Order them by relevance to the investigation, put the + most relevant ones first. + `; + }); + + const limiter = pLimit(5); + + const allEvents = await Promise.all( + prompts.map(async (input) => { + const completeEvent = await limiter(() => + inferenceClient.output({ + id: 'get_entity_relationships', + connectorId, + system, + input, + schema: { + type: 'object', + properties: { + related_entities: { + type: 'array', + items: { + type: 'object', + properties: { + entity: { + type: 'object', + properties: { + field: { + type: 'string', + }, + value: { + type: 'string', + }, + }, + required: ['field', 'value'], + }, + reason: { + type: 'string', + description: 'Describe why this entity might be relevant. Provide evidence.', + }, + confidence: { + type: 'string', + description: + 'Describe how confident you are in your conclusion about this relationship: low, moderate, high', + }, + }, + + required: ['entity', 'reason', 'confidence'], + }, + }, + }, + required: ['related_entities'], + } as const, + }) + ); + return completeEvent.output; + }) + ); + + const foundEntityIds = foundEntities.map(({ entity: foundEntity }) => stringify(foundEntity)); + + const relatedEntities = allEvents + .flat() + .flatMap((event) => { + return event.related_entities.map((item) => { + return { + entity: { [item.entity.field]: item.entity.value }, + reason: item.reason, + confidence: item.confidence, + }; + }); + }) + .filter((item) => { + return foundEntityIds.includes(stringify(item.entity)); + }); + + return { + relatedEntities, + }; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/index.ts new file mode 100644 index 000000000000..05392db2d502 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/index.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 { InferenceClient } from '@kbn/inference-plugin/server'; +import { Logger } from '@kbn/logging'; +import { + DocumentAnalysis, + TruncatedDocumentAnalysis, +} from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { ObservabilityElasticsearchClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { FieldPatternResultWithChanges } from '@kbn/observability-utils-server/entities/get_log_patterns'; +import { + analyzeFetchedRelatedEntities, + RelatedEntityFromSearchResults, +} from './analyze_fetched_related_entities'; +import { + RelatedEntityKeywordSearch, + writeKeywordSearchForRelatedEntities, +} from './write_keyword_searches_for_related_entities'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; + +export type { RelatedEntityFromSearchResults }; + +export async function findRelatedEntities({ + connectorId, + inferenceClient, + start, + end, + index, + esClient, + entity, + analysis, + logger, + context, + ownPatterns, + patternsFromOtherEntities, + kbEntries, +}: { + connectorId: string; + inferenceClient: InferenceClient; + start: number; + end: number; + index: string | string[]; + esClient: ObservabilityElasticsearchClient; + entity: Record; + analysis: { + truncated: TruncatedDocumentAnalysis; + full: DocumentAnalysis; + }; + logger: Logger; + context: string; + ownPatterns: FieldPatternResultWithChanges[]; + patternsFromOtherEntities: FieldPatternResultWithChanges[]; + kbEntries: ScoredKnowledgeBaseEntry[]; +}): Promise<{ + searches: RelatedEntityKeywordSearch[]; + summaries: string[]; + foundEntities: RelatedEntityFromSearchResults[]; +}> { + const { groupingFields, searches } = await writeKeywordSearchForRelatedEntities({ + connectorId, + inferenceClient, + entity, + analysis: analysis.truncated, + ownPatterns, + context, + kbEntries, + }); + + const { summaries, foundEntities } = await analyzeFetchedRelatedEntities({ + entity, + connectorId, + start, + end, + esClient, + index, + inferenceClient, + searches, + groupingFields, + logger, + analysis, + ownPatterns, + patternsFromOtherEntities, + context, + kbEntries, + }); + + return { + searches, + summaries, + foundEntities, + }; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts new file mode 100644 index 000000000000..6089ce748eb2 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/find_related_entities/write_keyword_searches_for_related_entities.ts @@ -0,0 +1,199 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { TruncatedDocumentAnalysis } from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import { FieldPatternResultWithChanges } from '@kbn/observability-utils-server/entities/get_log_patterns'; +import { RCA_PROMPT_ENTITIES, RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { formatEntity } from '../../util/format_entity'; +import { serializeKnowledgeBaseEntries } from '../../util/serialize_knowledge_base_entries'; +import { toBlockquote } from '../../util/to_blockquote'; +import { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; + +const SYSTEM_PROMPT_ADDENDUM = `# Guide: Constructing Keyword Searches to Find Related Entities + +When investigating issues like elevated failure rates for a +specific endpoint, you can use the metadata at hand (IP addresses, +URLs, session IDs, tracing IDs, etc.) to build targeted keyword searches. +By extracting meaningful fragments from the data, you can correlate +related services or hosts across distributed systems. Here’s how +you can break down the metadata and format your searches. + +## Grouping fields + +Define grouping fields for the entities you want to extract. For +instance, "service.name" if you are looking for services, or +"kubernetes.pod.name" if you are looking for pods. Focus +on services, unless you are looking for deployment or +configuration changes. + +--- + +## Key Metadata and Search Format + +### Example: Investigating a service failure for \`/api/products\` + +You can break down various pieces of metadata into searchable +fragments. For each value, include a short description of its +relationship to the investigation. This value will be used +by the system to determine the relevance of a given entity +that matches the search request. + +### 1. **IP Address and Port** +- **Fragments:** + - \`"10.44.0.11:8080"\`: Full address. + - \`"10.44.0.11"\`: IP address only. + - \`"8080"\`: Port number. +- **Appears as:** This IP address and port are referenced as + and in the investigated entity +.. + +### 2. **Outgoing Request URL** +- **Fragments:** + - \`"http://called-service/api/product"\`: Full outgoing URL. + - \`"/api/product*"\`: Endpoint path. + - \`"called-service"\`: Service name of the upstream dependency. + - **Appears as:** These URL fragments appear as attributes.request.url + in the investigated entity . They could appear as referer + in the upstream dependency. + +### 3. **Parent and Span IDs** + - **Fragments:** + - \`"000aa"\`: Parent ID. + - \`"000bbb"\`: Span ID. + - **Relationship:** These ids appear as span.id and parent.id in the + investigated entity . They could be referring to spans + found on upstream or downstream services. + +--- + +## Example Search Format in JSON + +To structure your keyword search, format the fragments and their +relationships in a JSON array like this: + +\`\`\`json +{ + "groupingFields": [ "service.name" ], + "values": [ + { + "fragments": [ + "10.44.0.11:8080", + "10.44.0.11", + "8080" + ], + "appearsAs": "This IP address and port are referenced as and in the investigated entity ." + }, + { + "fragments": [ + "http:///api/product", + "/api/product", + "" + ], + "relationship": "These URL fragments appear as attributes.request.url in the investigated entity ." + }, + { + "fragments": [ + "000aa", + "000bbb" + ], + "relationship": " These ids appear as span.id and parent.id in the investigated entity . They could be referring to spans found on upstream or downstream services" + } + ] +}`; + +export interface RelatedEntityKeywordSearch { + fragments: string[]; + appearsAs: string; +} + +export async function writeKeywordSearchForRelatedEntities({ + connectorId, + inferenceClient, + entity, + analysis, + ownPatterns, + context, + kbEntries, +}: { + connectorId: string; + inferenceClient: InferenceClient; + entity: Record; + analysis: TruncatedDocumentAnalysis; + ownPatterns: FieldPatternResultWithChanges[]; + context: string; + kbEntries: ScoredKnowledgeBaseEntry[]; +}): Promise<{ + groupingFields: string[]; + searches: RelatedEntityKeywordSearch[]; +}> { + const logPatternsPrompt = ownPatterns.length + ? JSON.stringify( + ownPatterns.map((pattern) => ({ regex: pattern.regex, sample: pattern.sample })) + ) + : 'No log patterns found'; + + return inferenceClient + .output({ + id: 'extract_keyword_searches', + connectorId, + system: `${RCA_SYSTEM_PROMPT_BASE} + + ${RCA_PROMPT_ENTITIES}`, + input: `Your current task is to to extract keyword searches + to find related entities to the entity ${formatEntity(entity)}, + based on the following context: + + ## Investigation context + ${toBlockquote(context)} + + ${serializeKnowledgeBaseEntries(kbEntries)} + + ## Data analysis + ${JSON.stringify(analysis)} + + ## Log patterns + + ${logPatternsPrompt} + + ## Instructions + ${SYSTEM_PROMPT_ADDENDUM}`, + schema: { + type: 'object', + properties: { + groupingFields: { + type: 'array', + items: { + type: 'string', + }, + }, + searches: { + type: 'array', + items: { + type: 'object', + properties: { + fragments: { + type: 'array', + items: { + type: 'string', + }, + }, + appearsAs: { + type: 'string', + description: + 'Describe in what fields these values appear as in the investigated entity. You can mention multiple fields if applicable', + }, + }, + required: ['fragments', 'appearsAs'], + }, + }, + }, + required: ['searches', 'groupingFields'], + } as const, + }) + .then((event) => event.output); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/generate_timeline/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/generate_timeline/index.ts new file mode 100644 index 000000000000..799755abec2e --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/generate_timeline/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { RootCauseAnalysisContext } from '../../types'; +import { stringifySummaries } from '../../util/stringify_summaries'; + +type SignificantEventSeverity = 'info' | 'unusual' | 'warning' | 'critical'; + +type SignificantEventType = 'alert' | 'slo' | 'event'; + +export interface SignificantEvent { + severity: SignificantEventSeverity; + '@timestamp'?: string; + description: string; + type: SignificantEventType; +} + +export interface SignificantEventsTimeline { + events: SignificantEvent[]; +} + +export async function generateSignificantEventsTimeline({ + report, + rcaContext, +}: { + report: string; + rcaContext: RootCauseAnalysisContext; +}): Promise { + const { connectorId, inferenceClient } = rcaContext; + + return await inferenceClient + .output({ + id: 'generate_timeline', + system: RCA_SYSTEM_PROMPT_BASE, + connectorId, + input: `Your current task is to generate a timeline + of significant events, based on the given RCA report, + according to a structured schema. This timeline will + be presented to the user as a visualization. + + ${stringifySummaries(rcaContext)} + + # Report + + ${report} + `, + schema: { + type: 'object', + properties: { + events: { + type: 'array', + items: { + type: 'object', + properties: { + timestamp: { + type: 'string', + description: 'The ISO timestamp of when the event occurred', + }, + severity: { + type: 'string', + enum: ['info', 'unusual', 'warning', 'critical'], + }, + type: { + type: 'string', + enum: ['alert', 'slo', 'event'], + }, + description: { + type: 'string', + description: 'A description of the event', + }, + }, + required: ['severity', 'description'], + }, + }, + }, + required: ['events'], + } as const, + }) + .then((timelineCompleteEvent) => { + return { + events: timelineCompleteEvent.output.events.map((event) => { + return { + '@timestamp': event.timestamp, + severity: event.severity, + type: event.type ?? 'event', + description: event.description, + }; + }), + }; + }); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts new file mode 100644 index 000000000000..8fbe9a43defe --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/get_knowledge_base_entries/index.ts @@ -0,0 +1,185 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ShortIdTable } from '@kbn/observability-ai-assistant-plugin/common'; +import { decode, encode } from 'gpt-tokenizer'; +import { orderBy, sumBy } from 'lodash'; +import { RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { RootCauseAnalysisContext } from '../../types'; +import { formatEntity } from '../../util/format_entity'; +import { toBlockquote } from '../../util/to_blockquote'; + +export interface ScoredKnowledgeBaseEntry { + id: string; + text: string; + tokens: number; + score: number; + truncated?: { + tokens: number; + text: string; + }; +} + +export async function getKnowledgeBaseEntries({ + entity, + context, + rcaContext, + maxTokens: maxTokensForEntries, +}: { + entity: Record; + context: string; + rcaContext: RootCauseAnalysisContext; + maxTokens: number; +}): Promise { + const response = await rcaContext.observabilityAIAssistantClient.recall({ + queries: [ + ...Object.values(entity).map((value) => ({ text: value, boost: 3 })), + { text: context }, + ], + limit: { + tokenCount: Number.MAX_VALUE, + }, + }); + + const { inferenceClient, connectorId } = rcaContext; + + const shortIdTable = new ShortIdTable(); + + const system = RCA_SYSTEM_PROMPT_BASE; + + const input = `Re-order the attached documents, based on relevance to the context. + Score them between 1 and 5, based on their relative relevance to each other. The + most relevant doc should be scored 5, and the least relevant doc should be scored + 1. + + # Entity + + ${formatEntity(entity)} + + # Context + + ${toBlockquote(context)} + `; + + const maxTokensForScoring = rcaContext.tokenLimit - encode(system + input).length - 1_000; + + const entriesWithTokens = response.map((entry) => { + return { + id: entry.id, + text: entry.text, + tokens: encode(entry.text), + }; + }); + + const totalTokenCount = sumBy(entriesWithTokens, (entry) => entry.tokens.length); + + const truncatedEntriesWithShortIds = entriesWithTokens.map((entry) => { + const tokensForEntry = Math.floor( + (entry.tokens.length / totalTokenCount) * maxTokensForScoring + ); + + const truncatedText = decode(entry.tokens.slice(0, tokensForEntry)); + const isTruncated = tokensForEntry < entry.tokens.length; + + return { + id: entry.id, + tokens: entry.tokens, + shortId: shortIdTable.take(entry.id), + text: entry.text, + truncatedText, + isTruncated, + }; + }); + + const scoredEntries = await inferenceClient.output({ + id: 'score_entries', + connectorId, + system: RCA_SYSTEM_PROMPT_BASE, + input: `${input} + + ${truncatedEntriesWithShortIds + .map((entry) => { + return `# ID: ${entry.shortId} + + ## Text (${entry.isTruncated ? `truncated` : `not truncated `}) + + ${toBlockquote(entry.truncatedText)} + `; + }) + .join('\n\n')} + `, + stream: false, + schema: { + type: 'object', + properties: { + docs: { + type: 'array', + items: { + type: 'object', + properties: { + score: { + type: 'number', + description: + 'A score between 1 and 5, with 5 being most relevant, and 1 being least relevant', + }, + id: { + type: 'string', + }, + }, + required: ['score', 'id'], + }, + }, + }, + required: ['docs'], + }, + } as const); + + const scoresById = new Map(scoredEntries.output.docs.map((doc) => [doc.id, doc.score])); + + const entriesWithScore = truncatedEntriesWithShortIds.map((entry) => { + const score = scoresById.get(entry.shortId) ?? 0; + return { + ...entry, + score, + }; + }); + + const sortedEntries = orderBy(entriesWithScore, (entry) => entry.score, 'desc'); + + const returnedEntries: ScoredKnowledgeBaseEntry[] = []; + + const tokensLeft = maxTokensForEntries; + + sortedEntries.forEach((entry) => { + if (entry.tokens.length <= tokensLeft) { + returnedEntries.push({ + id: entry.id, + text: entry.text, + tokens: entry.tokens.length, + score: entry.score, + }); + return; + } + + const tokensToTake = tokensLeft; + if (tokensToTake > 0) { + const tookTokens = entry.tokens.slice(0, tokensToTake); + returnedEntries.push({ + id: entry.id, + text: entry.text, + tokens: entry.tokens.length, + score: entry.score, + truncated: { + text: decode(tookTokens), + tokens: tookTokens.length, + }, + }); + } + }); + + return returnedEntries; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/index.ts new file mode 100644 index 000000000000..1e9ae7147211 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/index.ts @@ -0,0 +1,268 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { getEntityKuery } from '@kbn/observability-utils-common/entities/get_entity_kuery'; +import { sortAndTruncateAnalyzedFields } from '@kbn/observability-utils-common/llm/log_analysis/sort_and_truncate_analyzed_fields'; +import { analyzeDocuments } from '@kbn/observability-utils-server/entities/analyze_documents'; +import { getDataStreamsForEntity } from '@kbn/observability-utils-server/entities/get_data_streams_for_entity'; +import { getAlertsForEntity } from '@kbn/observability-utils-server/entities/signals/get_alerts_for_entity'; +import { getSlosForEntity } from '@kbn/observability-utils-server/entities/signals/get_slos_for_entity'; +import { ObservabilityElasticsearchClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { RootCauseAnalysisContext } from '../../types'; +import { stringifySummaries } from '../../util/stringify_summaries'; +import { analyzeLogPatterns } from '../analyze_log_patterns'; +import { describeEntity } from '../describe_entity'; +import { describeLogPatterns } from '../describe_log_patterns'; +import { findRelatedEntities } from '../find_related_entities'; +import { extractRelatedEntities } from '../find_related_entities/extract_related_entities'; +import { writeEntityInvestigationReport } from '../write_entity_investigation_report'; +import { EntityInvestigation } from './types'; +import { getKnowledgeBaseEntries } from '../get_knowledge_base_entries'; + +export type { EntityInvestigation }; + +export interface EntityInvestigationParameters { + entity: Record; + rcaContext: RootCauseAnalysisContext; + context: string; +} + +export async function investigateEntity( + parameters: EntityInvestigationParameters +): Promise { + const { + entity, + rcaContext, + rcaContext: { + inferenceClient, + connectorId, + start, + end, + esClient, + logger: parentLogger, + indices, + }, + context, + } = parameters; + const kuery = getEntityKuery(entity); + + const logger = parentLogger.get('investigateEntity'); + + logger.debug(() => `Investigating entity: ${JSON.stringify(parameters.entity)}`); + + const kbPromise = getKnowledgeBaseEntries({ + entity, + context, + rcaContext, + maxTokens: 4_000, + }).catch((error) => { + logger.error(`Could not fetch entries from knowledge base`); + logger.error(error); + return []; + }); + + const [{ dataStreams }, alerts, slos] = await getSignals({ ...parameters, kuery }); + + logger.debug( + () => + `Signals for entity ${JSON.stringify(entity)}: ${dataStreams.length} data streams, ${ + alerts.length + } alerts, ${slos.length} slos` + ); + + if (!dataStreams.length) { + return undefined; + } + + const fullAnalysis = await analyzeDataStreamsForEntity({ + start, + end, + esClient, + kuery, + dataStreams, + }); + + const truncatedAnalysis = sortAndTruncateAnalyzedFields(fullAnalysis); + + const kbEntries = await kbPromise; + + const { ownPatterns, patternsFromOtherEntities } = await analyzeLogPatterns({ + allAnalysis: [{ index: dataStreams, analysis: truncatedAnalysis }], + entity, + system: stringifySummaries(rcaContext), + cutoff: { + significance: 'high', + }, + rcaContext, + kbEntries, + }); + + logger.trace( + () => `Analyzed log patterns: ${JSON.stringify({ ownPatterns, patternsFromOtherEntities })}` + ); + + const entityReportPromise = Promise.all([ + describeEntity({ + inferenceClient, + analysis: truncatedAnalysis, + connectorId, + contextForEntityInvestigation: context, + entity, + ownPatterns, + kbEntries, + }), + describeLogPatterns({ + analysis: truncatedAnalysis, + connectorId, + contextForEntityInvestigation: context, + entity, + inferenceClient, + ownPatterns, + patternsFromOtherEntities, + kbEntries, + }), + ]).then(([entityDescription, logPatternDescription]) => { + return writeEntityInvestigationReport({ + connectorId, + inferenceClient, + entityDescription, + logPatternDescription, + contextForEntityInvestigation: context, + entity, + }).then((report) => { + return { + description: entityDescription, + logPatternDescription, + report, + }; + }); + }); + + const [entityReport, relatedEntitiesResults] = await Promise.all([ + entityReportPromise, + findRelatedEntities({ + connectorId, + end, + entity, + esClient, + index: indices.logs, + inferenceClient, + logger, + start, + context, + analysis: { + full: fullAnalysis, + truncated: truncatedAnalysis, + }, + ownPatterns, + patternsFromOtherEntities, + kbEntries, + }).then(async ({ searches, summaries, foundEntities }) => { + const report = await entityReportPromise; + + const { relatedEntities } = await extractRelatedEntities({ + entityReport: report.report, + summaries, + entity, + foundEntities, + context, + rcaContext, + }); + + return { + relatedEntities, + foundEntities, + searches, + summaries, + }; + }), + ]); + + return { + entity, + summary: [ + entityReport.description, + entityReport.logPatternDescription.content, + entityReport.report, + ].join('\n\n'), + relatedEntities: relatedEntitiesResults.relatedEntities, + attachments: { + alerts, + slos, + analysis: truncatedAnalysis, + ownPatterns, + patternsFromOtherEntities, + searches: relatedEntitiesResults.searches, + relatedEntitiesSummaries: relatedEntitiesResults.summaries, + kbEntries, + }, + }; +} + +async function getSignals({ + entity, + kuery, + rcaContext: { start, end, esClient, rulesClient, alertsClient, indices, spaceId }, +}: { + kuery: string; + entity: Record; + rcaContext: Pick< + RootCauseAnalysisContext, + 'start' | 'end' | 'esClient' | 'rulesClient' | 'alertsClient' | 'indices' | 'spaceId' + >; +}) { + return await Promise.all([ + getDataStreamsForEntity({ + esClient, + kuery, + index: indices.logs.concat(indices.traces), + }), + getAlertsForEntity({ entity, rulesClient, alertsClient, start, end, size: 10 }).then( + (alertsResponse) => { + return alertsResponse.hits.hits.map((hit) => hit._source!); + } + ), + getSlosForEntity({ + entity, + start, + end, + esClient, + size: 1000, + sloSummaryIndices: indices.sloSummaries, + spaceId, + }).then((slosResponse) => { + return slosResponse.hits.hits.map((hit) => hit._source); + }), + ]); +} + +async function analyzeDataStreamsForEntity({ + start, + end, + dataStreams, + esClient, + kuery, +}: { + start: number; + end: number; + kuery: string; + dataStreams: string[]; + esClient: ObservabilityElasticsearchClient; +}) { + const analysis = await analyzeDocuments({ + esClient, + start, + end, + index: dataStreams, + kuery, + }); + + return { + ...analysis, + fields: analysis.fields.filter((field) => !field.empty), + }; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/prompts.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/prompts.ts new file mode 100644 index 000000000000..e9d042e88a6e --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/prompts.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 { formatEntity } from '../../util/format_entity'; +import { toBlockquote } from '../../util/to_blockquote'; + +export const getInvestigateEntityTaskPrompt = ({ + entity, + contextForEntityInvestigation, +}: { + entity: Record; + contextForEntityInvestigation: string; +}) => `## Entity-Based Investigation: Task Guide + +In the investigation process, you are currently investigating the entity +${formatEntity(entity)}. The context given for this investigation is: + +${toBlockquote(contextForEntityInvestigation)}`; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/types.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/types.ts new file mode 100644 index 000000000000..e29735c894f2 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/investigate_entity/types.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 type { ParsedTechnicalFields } from '@kbn/rule-registry-plugin/common'; +import type { TruncatedDocumentAnalysis } from '@kbn/observability-utils-common/llm/log_analysis/document_analysis'; +import type { AnalyzeLogPatternOutput } from '../analyze_log_patterns'; +import type { RelatedEntityDescription } from '../find_related_entities/extract_related_entities'; +import type { RelatedEntityKeywordSearch } from '../find_related_entities/write_keyword_searches_for_related_entities'; +import type { ScoredKnowledgeBaseEntry } from '../get_knowledge_base_entries'; + +export interface EntityInvestigation { + entity: Record; + summary: string; + relatedEntities: RelatedEntityDescription[]; + attachments: { + analysis: TruncatedDocumentAnalysis; + slos: Array< + Record & { + status: 'VIOLATED' | 'DEGRADED' | 'HEALTHY' | 'NO_DATA'; + } + >; + alerts: ParsedTechnicalFields[]; + searches: RelatedEntityKeywordSearch[]; + relatedEntitiesSummaries: string[]; + kbEntries: ScoredKnowledgeBaseEntry[]; + } & AnalyzeLogPatternOutput; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/observe_investigation_results/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/observe_investigation_results/index.ts new file mode 100644 index 000000000000..c0b5367cded3 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/observe_investigation_results/index.ts @@ -0,0 +1,239 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MessageRole } from '@kbn/inference-common'; +import { RCA_OBSERVE_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { RCA_PROMPT_CHANGES, RCA_PROMPT_ENTITIES, RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { ObservationToolMessage, RootCauseAnalysisContext } from '../../types'; +import { formatEntity } from '../../util/format_entity'; +import { getPreviouslyInvestigatedEntities } from '../../util/get_previously_investigated_entities'; +import { stringifySummaries } from '../../util/stringify_summaries'; +import { toBlockquote } from '../../util/to_blockquote'; +import { EntityInvestigation } from '../investigate_entity/types'; + +const INITIAL_OBSERVATION_TASK_GUIDE = `Your current task is to write observations based on the initial context. You +should acknowledge the context briefly, and mention key observations from the +initial context. + +Then, briefly describe what change you are looking for. Are the symptoms: + +- rapid, or gradual onset? +- subtle or prounounced? + +If possible, mention the time of the change. + +When considering the initial context, reason about relevant changes to observe, +such as short-lived versus persistent changes or singular events, like scale +events, rollouts, or configuration changes. + +After, taking into account the capabilities you have, plan for next steps. + +Describe the next step, which is to investigate the entity found in the initial +context. Only mention the entity (as a field/value). Do not mention any +additional filters. + +Be brief, accurate, and critical.`; + +const INVESTIGATION_ADDENDUM = ` +**Task Guide: Observe the investigation results** + +You will receive one or more investigations. These investigations mention: +- a general characterization of the entity based on its data +- relevant log patterns +- other signals, like SLOs or alerts +- possibly related entities, and investigation suggestions + +First, you should briefly acknowledge the initial context of the investigation +and where it stands. + +Next, you should note key observations from the investigations, and how they relate +to the ongoing investigation. + +After, you should generate a timeline of significant events. For this timeline, +include events from previous observations. Additionally, include significant +events from the inspected investigations. Group events together in a topic +if needed. Significant events are things like: an increase in errors, deployment +events, a drop to zero for access logs, etc. In most cases, you do not want to +mention individual log messages, unless it is a particularly significant event +by itself. + +For each event, mention: + +- the timestamp of the event +- the nature of the change, if applicable +- data from the event, such as specific log patterns, alerts or slos +- the meaning of the event and how it is related to the initial context + +Do not include: +- the time range from the investigation itself (start/end) +- other events that occurred during the investigation itself, like running +log analysis or other patterns + +## Correlating significant events + +When correlating significant events, pay close attention to the timestamp of +the mentioned change, and how it correlates to the timestamp of the change you +want to correlate it to, such as the start time of an alert. An alert might be +delayed, but if you see many changes around a specific timestamp, and some of +them being significantly earlier, or later, the latter group is likely not +relevant. + +## Context and reasoning + +Next, use the timeline of events and the new observations to revise your +analysis of the initial context and the ongoing investigation. Reason about +how changes could be related: are they close in time, or far removed, compared +to others? Is the type of change similar? Is the magnitude of the change similar?`; + +const SUGGEST_NEXT_STEPS_PROMPT = ` +Next, consider next steps. it's always important to contextualize the significant +in the initial context of the investigation. Focus on your strongest pieces of +evidence. Your observations should be related to finding out the cause of the +initial context of the investigation - you should not concern yourself with the +impact on _other_ entities. + +Suggest to conclude the process when: + +- there is a clear and obvious root cause +- you have investigated more than 10 entities +- OR you cannot find any unhealthy entities +- there are no more entities to investigate + +If the conclusion is you need to continue your investigation, mention the entities +that should be investigated. Do this only if there is a significant change one of +the related entities will give you new insights into the root cause (instead of +just the impact). DO NOT investigate an entity more than once.`; + +const CONCLUDE_PROCESS_PROMPT = ` +You must suggest to conclude the process and write the final report, as your +capabilities do not allow you go investigate more entities.`; + +function getInitialPrompts(initialContext: string) { + return { + system: `${RCA_SYSTEM_PROMPT_BASE} + + ${RCA_PROMPT_ENTITIES} + + ${RCA_PROMPT_CHANGES}`, + input: `## Context + + ${initialContext} + + ${INITIAL_OBSERVATION_TASK_GUIDE}`, + }; +} + +function getObserveInvestigationsPrompts({ + investigations, + summaries, + rcaContext, +}: { + investigations: EntityInvestigation[]; + summaries: ObservationStepSummary[]; + rcaContext: RootCauseAnalysisContext; +}) { + const previouslyInvestigatedEntities = getPreviouslyInvestigatedEntities(rcaContext); + + const canContinue = + summaries.length <= 5 && + investigations.filter((investigation) => 'summary' in investigation).length <= 10; + + const investigationsPrompt = `Observe the following investigations that recently concluded: + ${investigations + .map((investigation, index) => { + return `## ${index + 1}: investigation of ${formatEntity(investigation.entity)} + + ${toBlockquote(investigation.summary)} + + ${ + investigation.relatedEntities.length + ? `### Relationships to ${formatEntity(investigation.entity)} + + ${toBlockquote(JSON.stringify(investigation.relatedEntities))} + + ` + : `` + } + `; + }) + .join('\n\n')} + + ${INVESTIGATION_ADDENDUM} + + ${ + canContinue + ? `${SUGGEST_NEXT_STEPS_PROMPT} + + ${ + previouslyInvestigatedEntities.length + ? `The following entities have been investigated previously. + Do not investigate them again: + + ${previouslyInvestigatedEntities.map((entity) => `- ${JSON.stringify(entity)}`).join('\n')}` + : `` + } + + ` + : CONCLUDE_PROCESS_PROMPT + } + + `; + + const systemPrompt = `${RCA_SYSTEM_PROMPT_BASE} + + ${RCA_PROMPT_ENTITIES} + + ${stringifySummaries(rcaContext)}`; + + return { + system: systemPrompt, + input: investigationsPrompt, + }; +} + +export interface ObservationStepSummary { + investigations: EntityInvestigation[]; + content: string; +} + +export function observeInvestigationResults({ + rcaContext, + rcaContext: { logger, events, initialContext, inferenceClient, connectorId }, + investigations, +}: { + rcaContext: RootCauseAnalysisContext; + investigations: EntityInvestigation[]; +}): Promise { + const summaries = events + .filter((event): event is ObservationToolMessage => { + return event.role === MessageRole.Tool && event.name === RCA_OBSERVE_TOOL_NAME; + }) + .map((event) => event.data); + + logger.debug( + () => + `Observing ${investigations.length} investigations (${summaries.length} previous summaries)` + ); + + const { system, input } = investigations.length + ? getObserveInvestigationsPrompts({ summaries, investigations, rcaContext }) + : getInitialPrompts(initialContext); + + return inferenceClient + .output({ + id: 'observe', + system, + input, + connectorId, + }) + .then((outputCompleteEvent) => { + return { + content: outputCompleteEvent.content, + investigations, + }; + }); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_entity_investigation_report/index.ts new file mode 100644 index 000000000000..58ef6f4ab5d0 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_entity_investigation_report/index.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 { InferenceClient } from '@kbn/inference-plugin/server'; +import { RCA_PROMPT_SIGNIFICANT_EVENTS, RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { formatEntity } from '../../util/format_entity'; +import { toBlockquote } from '../../util/to_blockquote'; +import { LogPatternDescription } from '../describe_log_patterns'; +import { getInvestigateEntityTaskPrompt } from '../investigate_entity/prompts'; + +export async function writeEntityInvestigationReport({ + inferenceClient, + connectorId, + entity, + contextForEntityInvestigation, + entityDescription, + logPatternDescription, +}: { + inferenceClient: InferenceClient; + connectorId: string; + entity: Record; + contextForEntityInvestigation: string; + entityDescription: string; + logPatternDescription: LogPatternDescription; +}): Promise { + const system = RCA_SYSTEM_PROMPT_BASE; + + const shouldGenerateTimeline = logPatternDescription.interestingPatternCount > 0; + + let input = `${getInvestigateEntityTaskPrompt({ entity, contextForEntityInvestigation })} + + ## Entity description + + ${toBlockquote(entityDescription)} + + ## Log pattern analysis + + ${toBlockquote(logPatternDescription.content)} + + # Current task + + Your current task is to write a report the investigation into ${formatEntity(entity)}. + The log pattern analysis and entity description will be added to your report (at the + top), so you don't need to repeat anything in it.`; + + if (shouldGenerateTimeline) { + input += `${RCA_PROMPT_SIGNIFICANT_EVENTS}\n\n`; + } + + input += `## Context and reasoning + + Reason about the role that the entity plays in the investigation, given the context. + mention evidence (hard pieces of data) when reasoning. + + Do not suggest next steps - this will happen in a follow-up task.`; + + if (shouldGenerateTimeline) { + input += `## Format + + Your reply should only contain two sections: + + - Timeline of significant events + - Context and reasoning + `; + } else { + input += `## Format + Your reply should only contain one section: + - Context and reasoning + `; + } + + const response = await inferenceClient.output({ + id: 'generate_entity_report', + connectorId, + input, + system, + }); + + return response.content; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_final_report/index.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_final_report/index.ts new file mode 100644 index 000000000000..db7aa9f3b7aa --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tasks/write_final_report/index.ts @@ -0,0 +1,191 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RCA_PROMPT_TIMELINE_GUIDE, RCA_SYSTEM_PROMPT_BASE } from '../../prompts'; +import { RootCauseAnalysisContext } from '../../types'; +import { stringifySummaries } from '../../util/stringify_summaries'; + +const SYSTEM_PROMPT_ADDENDUM = ` +# Guide: Writing a Root Cause Analysis (RCA) Report + +A Root Cause Analysis (RCA) report is the final step in a thorough +investigation. Its purpose is to provide a clear, evidence-backed explanation of +the underlying cause of an issue, as well as the impact. Even if no definitive +root cause is identified, the report should reflect the findings, the hypotheses +considered, and why certain assumptions were rejected. This guide will help +structure an RCA that distinguishes between cause and effect, organizes +evidence, and presents a timeline of key events. + +--- + +## 1. Introduction + +Start by summarizing the reason for the investigation. Provide a brief overview +of the incident, the affected services or entities, and the initial alerts or +issues that triggered the investigation. + +- **What prompted the investigation?** +- **Which entities were investigated?** +- **Was there a specific hypothesis proposed at the outset?** + +### Example: +- **Overview:** This RCA report investigates the elevated error rates in +\`myservice\` and its downstream dependencies, first identified through an SLO +breach for the \`/api/submit\` endpoint. The investigation considered multiple +entities and possible causes, including resource exhaustion and upstream service +failures. + +--- + +## 2. Investigation Summary + +Summarize the key steps of the investigation, outlining: +- **What hypotheses were proposed and why.** +- **Which entities were investigated (e.g., \`myservice\`, \`myotherservice\`, +\`notification-service\`).** +- **Which hypotheses were discarded and why.** + +For each hypothesis, present the supporting or contradicting evidence. + +- **Strong Indicators:** Clear, repeated evidence pointing toward or against a +hypothesis. +- **Weak Indicators:** Inconsistent or ambiguous data that did not provide +conclusive answers. + +#### Example Format: +- **Hypothesis 1:** Resource exhaustion in \`myservice\` caused elevated error +rates. + - **Evidence:** + - **Strong:** Memory usage exceeded 90% during the incident. + - **Weak:** CPU usage remained stable, making resource exhaustion a partial +explanation. + +- **Hypothesis 2:** Upstream latency from \`myotherservice\` caused delays. + - **Evidence:** + - **Strong:** API logs showed frequent retries and timeouts from +\`myotherservice\`. + - **Weak:** No errors were observed in \`myotherservice\` logs, suggesting an +issue isolated to \`myservice\`. + +--- + +## 3. Cause and Effect + +Differentiate between the **cause** (what initiated the issue) and the +**effect** (the impact or symptoms seen across the system). The cause should +focus on the root, while the effect describes the wider system response or +failure. + +- **Root Cause:** Identify the underlying problem, supported by strong evidence. +If no root cause is found, clearly state that the investigation did not lead to +a conclusive root cause. + +- **Impact:** Describe the downstream effects on other services, performance +degradation, or SLO violations. + +#### Example: +- **Cause:** The root cause of the elevated error rate was identified as a +memory leak in \`myservice\` that gradually led to resource exhaustion. +- **Effect:** This led to elevated latency and increased error rates at the +\`/api/submit\` endpoint, impacting downstream services like +\`notification-service\` that rely on responses from \`myservice\`. + +--- + +## 4. Evidence for Root Cause + +Present a structured section summarizing all the evidence that supports the +identified root cause. If no root cause is identified, outline the most +significant findings that guided or limited the investigation. + +- **Log Patterns:** Describe any abnormal log patterns observed, including +notable change points. +- **Alerts and SLOs:** Mention any alerts or breached SLOs that were triggered, +including their relevance to the investigation. +- **Data Analysis:** Include any data trends or patterns that were analyzed +(e.g., resource usage spikes, network traffic). + +#### Example: +- **Memory Usage:** Logs showed a steady increase in memory consumption starting +at 10:00 AM, peaking at 12:00 PM, where memory usage surpassed 90%, triggering +the alert. +- **Error Rate Logs:** Error rates for \`/api/submit\` began increasing around +11:30 AM, correlating with the memory pressure in \`myservice\`. +- **API Logs:** \`myotherservice\` API logs showed no internal errors, ruling out +an upstream dependency as the primary cause. + +--- + +## 5. Proposed Impact + +Even if the root cause is clear, it is important to mention the impact of the +issue on the system, users, and business operations. This includes: +- **Affected Services:** Identify the services impacted (e.g., downstream +dependencies). +- **Performance Degradation:** Describe any SLO breaches or performance +bottlenecks. +- **User Impact:** Explain how users or clients were affected (e.g., higher +latency, failed transactions). + +#### Example: +- **Impact:** The memory leak in \`myservice\` caused service degradation over a +2-hour window. This affected \`/api/submit\`, causing delays and failed +requests, ultimately impacting user-facing services relying on that endpoint. + +--- + +## 6. Timeline of Significant Events + +${RCA_PROMPT_TIMELINE_GUIDE} + +--- + +## 7. Conclusion and Next Steps + +Summarize the conclusions of the investigation: +- If a root cause was identified, confirm it with the strongest supporting +evidence. +- If no root cause was found, state that clearly and suggest areas for further +investigation or monitoring. + +Finally, outline the next steps: +- **Fixes or Mitigations:** Recommend any immediate actions (e.g., patch +deployment, configuration changes). +- **Monitoring Improvements:** Suggest new alerts or monitoring metrics based on +lessons learned. +- **Further Investigations:** If necessary, propose any follow-up investigations +to gather more evidence. + +#### Example: +- **Conclusion:** The root cause of the incident was a memory leak in +\`myservice\`, leading to resource exhaustion and elevated error rates at +\`/api/submit\`. The leak has been patched, and monitoring has been improved to +detect memory spikes earlier. +- **Next Steps:** Monitor memory usage for the next 24 hours to ensure no +recurrence. Investigate adding a memory ceiling for \`myservice\` to prevent +future resource exhaustion.`; + +export async function writeFinalReport({ + rcaContext, +}: { + rcaContext: RootCauseAnalysisContext; +}): Promise { + const { inferenceClient, connectorId } = rcaContext; + + return await inferenceClient + .output({ + id: 'write_final_report', + connectorId, + system: `${RCA_SYSTEM_PROMPT_BASE} + + ${SYSTEM_PROMPT_ADDENDUM}`, + input: `Write the RCA report, based on the observations. + + ${stringifySummaries(rcaContext)}`, + }) + .then((event) => event.content); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tools.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tools.ts new file mode 100644 index 000000000000..8c3082aa320c --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/tools.ts @@ -0,0 +1,77 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + RCA_END_PROCESS_TOOL_NAME, + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from '@kbn/observability-ai-common/root_cause_analysis/tool_names'; + +export const RCA_TOOLS = { + [RCA_OBSERVE_TOOL_NAME]: { + description: `Request an observation from another agent on + the results of the returned investigations. The title should + cover key new observations from the initial context or + completed investigations, not anything about next steps.`, + schema: { + type: 'object', + properties: { + title: { + type: 'string', + description: `A short title w/ the key new observations that will be displayed on top of a collapsible panel.`, + }, + }, + required: ['title'], + }, + }, + [RCA_END_PROCESS_TOOL_NAME]: { + description: `End the RCA process by requesting a + written report from another agent`, + schema: { + type: 'object', + properties: { + endProcess: { + type: 'boolean', + }, + }, + required: ['endProcess'], + }, + }, + [RCA_INVESTIGATE_ENTITY_TOOL_NAME]: { + description: `Investigate an entity`, + schema: { + type: 'object', + properties: { + context: { + type: 'string', + description: `Context that will be used in the investigation of the entity. Mention the initial context + of the investigation, a very short summary of the last observation if applicable, and pieces + of data that can be relevant for the investigation into the entity, such as timestamps or + keywords`, + }, + entity: { + type: 'object', + description: `The entity you want to investigate, such as a service. Use + the Elasticsearch field names and values. For example, for services, use + the following structure: ${JSON.stringify({ + entity: { field: 'service.name', value: 'opbeans-java' }, + })}`, + properties: { + field: { + type: 'string', + }, + value: { + type: 'string', + }, + }, + required: ['field', 'value'], + }, + }, + required: ['context', 'entity'], + }, + }, +} as const; diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/types.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/types.ts new file mode 100644 index 000000000000..6b6fa1886309 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/types.ts @@ -0,0 +1,101 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + ToolMessage, + UserMessage, + ToolCallsOf, + ToolChoice, + AssistantMessageOf, +} from '@kbn/inference-common'; +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { Logger } from '@kbn/logging'; +import { AlertsClient } from '@kbn/rule-registry-plugin/server'; +import { RulesClient } from '@kbn/alerting-plugin/server'; +import { ObservabilityAIAssistantClient } from '@kbn/observability-ai-assistant-plugin/server'; +import { ObservabilityElasticsearchClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { + RCA_END_PROCESS_TOOL_NAME, + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from '@kbn/observability-ai-common/root_cause_analysis'; +import { ObservationStepSummary } from './tasks/observe_investigation_results'; +import { EntityInvestigation } from './tasks/investigate_entity'; +import { SignificantEventsTimeline } from './tasks/generate_timeline'; +import { RCA_TOOLS } from './tools'; + +export type EndProcessToolMessage = ToolMessage< + typeof RCA_END_PROCESS_TOOL_NAME, + { + report: string; + timeline: SignificantEventsTimeline; + } +>; + +export type ObservationToolMessage = ToolMessage< + typeof RCA_OBSERVE_TOOL_NAME, + { + content: string; + }, + ObservationStepSummary +>; + +export type InvestigateEntityToolMessage = ToolMessage< + typeof RCA_INVESTIGATE_ENTITY_TOOL_NAME, + Pick, + { attachments: EntityInvestigation['attachments'] } +>; + +export type ToolErrorMessage = ToolMessage< + 'error', + { + error: { + message: string; + }; + } +>; + +export type RootCauseAnalysisEvent = + | RootCauseAnalysisToolMessage + | ToolErrorMessage + | UserMessage + | AssistantMessageOf<{ + tools: typeof RCA_TOOLS; + toolChoice?: ToolChoice; + }>; + +export type RootCauseAnalysisToolRequest< + TToolName extends keyof typeof RCA_TOOLS = keyof typeof RCA_TOOLS +> = ToolCallsOf<{ + tools: Pick; +}>['toolCalls'][number]; + +export type RootCauseAnalysisToolMessage = + | EndProcessToolMessage + | InvestigateEntityToolMessage + | ObservationToolMessage; + +export interface RootCauseAnalysisContext { + initialContext: string; + start: number; + end: number; + events: RootCauseAnalysisEvent[]; + indices: { + logs: string[]; + traces: string[]; + sloSummaries: string[]; + }; + inferenceClient: InferenceClient; + tokenLimit: number; + connectorId: string; + esClient: ObservabilityElasticsearchClient; + alertsClient: AlertsClient; + rulesClient: RulesClient; + logger: Logger; + spaceId: string; + observabilityAIAssistantClient: ObservabilityAIAssistantClient; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/call_tools.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/call_tools.ts new file mode 100644 index 000000000000..046d6d401c33 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/call_tools.ts @@ -0,0 +1,177 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + Message, + ToolDefinition, + ToolChoice, + ToolCallsOf, + withoutChunkEvents, + withoutTokenCountEvents, + ToolMessage, + MessageOf, + MessageRole, +} from '@kbn/inference-common'; +import { InferenceClient } from '@kbn/inference-plugin/server'; +import { Logger } from '@kbn/logging'; +import { + defer, + last, + merge, + Observable, + of, + OperatorFunction, + share, + switchMap, + toArray, +} from 'rxjs'; + +interface CallToolOptions extends CallToolTools { + system: string; + messages: Message[]; + inferenceClient: InferenceClient; + connectorId: string; + logger: Logger; +} + +interface CallToolTools { + tools: Record; + toolChoice?: ToolChoice; +} + +type CallbackOf< + TCallToolTools extends CallToolTools, + TEmittedMessage extends Message +> = (parameters: { + messages: Message[]; + toolCalls: ToolCallsOf['toolCalls']; +}) => Observable; + +type GetNextRequestCallback = ({ + messages, + system, +}: { + messages: Message[]; + system: string; +}) => { system: string; messages: Message[] } & TCallToolTools; + +export function callTools( + { system, messages, inferenceClient, connectorId, tools, toolChoice, logger }: TCallToolOptions, + callback: CallbackOf +): Observable>; + +export function callTools< + TCallToolOptions extends Omit = never, + TCallToolTools extends CallToolTools = never, + TEmittedMessage extends Message = never +>( + options: TCallToolOptions, + getNextRequest: GetNextRequestCallback, + callback: CallbackOf +): Observable; + +export function callTools( + { system, messages, inferenceClient, connectorId, tools, toolChoice, logger }: CallToolOptions, + ...callbacks: + | [GetNextRequestCallback, CallbackOf] + | [CallbackOf] +): Observable { + const callback = callbacks.length === 2 ? callbacks[1] : callbacks[0]; + + const getNextRequest = + callbacks.length === 2 + ? callbacks[0] + : (next: { messages: Message[]; system: string }) => { + return { + ...next, + tools, + toolChoice, + }; + }; + + const nextRequest = getNextRequest({ system, messages }); + + const chatComplete$ = defer(() => + inferenceClient.chatComplete({ + connectorId, + stream: true, + ...nextRequest, + }) + ); + + const asCompletedMessages$ = chatComplete$.pipe( + withoutChunkEvents(), + withoutTokenCountEvents(), + switchMap((event) => { + return of({ + role: MessageRole.Assistant as const, + content: event.content, + toolCalls: event.toolCalls, + }); + }) + ); + + const withToolResponses$ = asCompletedMessages$ + .pipe( + switchMap((message) => { + if (message.toolCalls.length) { + return merge( + of(message), + callback({ toolCalls: message.toolCalls, messages: messages.concat(message) }) + ); + } + return of(message); + }) + ) + .pipe(handleNext()); + + return withToolResponses$; + + function handleNext(): OperatorFunction { + return (source$) => { + const shared$ = source$.pipe(share()); + + const next$ = merge( + shared$, + shared$.pipe( + toArray(), + last(), + switchMap((nextMessages) => { + logger.debug(() => + JSON.stringify( + nextMessages.map((message) => { + return { + role: message.role, + toolCalls: 'toolCalls' in message ? message.toolCalls : undefined, + toolCallId: 'toolCallId' in message ? message.toolCallId : undefined, + }; + }) + ) + ); + + if (nextMessages[nextMessages.length - 1].role !== MessageRole.Assistant) { + const options: CallToolOptions = { + system, + connectorId, + inferenceClient, + messages: messages.concat(nextMessages), + tools, + toolChoice, + logger, + }; + const after$ = callTools(options, getNextRequest, callback); + return after$; + } + return of(); + }) + ) + ); + + return next$; + }; + } +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/chunk_output_calls.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/chunk_output_calls.ts new file mode 100644 index 000000000000..0a174b645160 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/chunk_output_calls.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 { encode } from 'gpt-tokenizer'; +import { uniqueId } from 'lodash'; + +interface TextWithId { + id: string; + text: string; +} + +interface Parameters { + system: string; + input: string; + tokenLimit: number; +} + +interface ChunkedOutputRequest { + input: string; + system: string; +} + +export function chunkOutputCalls({}: Parameters & { texts: string[] }): Array< + ChunkedOutputRequest & { + texts: string[]; + } +>; + +export function chunkOutputCalls({}: Parameters & { texts: TextWithId[] }): Array< + ChunkedOutputRequest & { + texts: TextWithId[]; + } +>; + +export function chunkOutputCalls({ + system, + input, + texts, + tokenLimit, +}: Parameters & { + texts: string[] | TextWithId[]; +}) { + const inputAndSystemPromptCount = encode(system).length + encode(input).length; + + if (!texts.length) { + return [{ system, input, texts: [] }]; + } + + const textWithIds = texts.map((text) => { + if (typeof text === 'string') { + return { + id: uniqueId(), + text, + }; + } + return text; + }); + + const textsWithCount = textWithIds.map(({ text, id }) => ({ + tokenCount: encode(text).length, + text, + id, + })); + + const chunks: Array<{ tokenCount: number; texts: TextWithId[] }> = []; + + textsWithCount.forEach(({ text, id, tokenCount }) => { + let chunkWithRoomLeft = chunks.find((chunk) => { + return chunk.tokenCount + tokenCount <= tokenLimit; + }); + + if (!chunkWithRoomLeft) { + chunkWithRoomLeft = { texts: [], tokenCount: inputAndSystemPromptCount }; + chunks.push(chunkWithRoomLeft); + } + chunkWithRoomLeft.texts.push({ text, id }); + chunkWithRoomLeft.tokenCount += tokenCount; + }); + + const hasTextWithIds = texts.some((text) => typeof text !== 'string'); + + return chunks.map((chunk) => { + const textsForChunk = hasTextWithIds + ? chunk.texts + : chunk.texts.map((text) => (typeof text === 'string' ? text : text.text)); + + return { + system, + input, + texts: textsForChunk, + }; + }); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/format_entity.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/format_entity.ts new file mode 100644 index 000000000000..d4fa1e545653 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/format_entity.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 function formatEntity(entity: Record) { + return Object.entries(entity) + .map(([field, value]) => `${field}:${value}`) + .join('/'); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/get_previously_investigated_entities.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/get_previously_investigated_entities.ts new file mode 100644 index 000000000000..e42a6a8039e2 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/get_previously_investigated_entities.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 { MessageRole } from '@kbn/inference-common'; +import { RCA_INVESTIGATE_ENTITY_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { InvestigateEntityToolMessage, RootCauseAnalysisContext } from '../types'; + +export function getPreviouslyInvestigatedEntities({ + events, +}: Pick) { + const investigationToolResponses = events.filter( + (event): event is InvestigateEntityToolMessage => { + return event.role === MessageRole.Tool && event.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME; + } + ); + + return investigationToolResponses.map((event) => event.response.entity); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/serialize_knowledge_base_entries.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/serialize_knowledge_base_entries.ts new file mode 100644 index 000000000000..39bc1a5b9a60 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/serialize_knowledge_base_entries.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { ScoredKnowledgeBaseEntry } from '../tasks/get_knowledge_base_entries'; +import { toBlockquote } from './to_blockquote'; + +export function serializeKnowledgeBaseEntries(entries: ScoredKnowledgeBaseEntry[]) { + if (!entries.length) { + return `## Knowledge base + + No relevant knowledge base entries were found. + `; + } + + const serializedEntries = entries + .filter((entry) => entry.score >= 3) + .map( + (entry) => `## Entry \`${entry.id}\ (score: ${entry.score}, ${ + entry.truncated ? `truncated` : `not truncated` + }) + + ${toBlockquote(entry.text)}` + ); + + return `## Knowledge base + + The following relevant entries were found in the knowledge base + + ${serializedEntries.join('\n\n')}`; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/stringify_summaries.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/stringify_summaries.ts new file mode 100644 index 000000000000..80e2ab85a408 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/stringify_summaries.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { compact } from 'lodash'; +import { MessageRole } from '@kbn/inference-common'; +import { RCA_OBSERVE_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { formatEntity } from './format_entity'; +import { toBlockquote } from './to_blockquote'; +import { ObservationToolMessage, RootCauseAnalysisContext } from '../types'; + +export function stringifySummaries({ events }: RootCauseAnalysisContext): string { + const summaries = events + .filter((event): event is ObservationToolMessage => { + return event.role === MessageRole.Tool && event.name === RCA_OBSERVE_TOOL_NAME; + }) + .map((event) => event.data); + + if (!summaries.length) { + return `# Previous observations + + No previous observations`; + } + + return `# Previous observations + + ${summaries.map((summary, index) => { + const header = `## Observation #${index + 1}`; + + const entitiesHeader = summary.investigations.length + ? `### Investigated entities + + ${summary.investigations + .map((investigation) => `- ${formatEntity(investigation.entity)}`) + .join('\n')}` + : undefined; + + const summaryBody = `### Summary + + ${toBlockquote(summary.content)}`; + + return compact([header, entitiesHeader, summaryBody]).join('\n\n'); + })}`; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/to_blockquote.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/to_blockquote.ts new file mode 100644 index 000000000000..38af158de611 --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/to_blockquote.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 function toBlockquote(input: string): string { + return input + .split('\n') + .map((line) => `> ${line}`) + .join('\n'); +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts new file mode 100644 index 000000000000..76fa0fcc379a --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/root_cause_analysis/util/validate_investigate_entity_tool_call.ts @@ -0,0 +1,124 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { MessageRole, ToolCallsOf } from '@kbn/inference-common'; +import { entityQuery } from '@kbn/observability-utils-common/es/queries/entity_query'; +import { RCA_INVESTIGATE_ENTITY_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { isEqual } from 'lodash'; +import { getEntitiesByFuzzySearch } from '@kbn/observability-utils-server/entities/get_entities_by_fuzzy_search'; +import { RCA_TOOLS } from '../tools'; +import { + InvestigateEntityToolMessage, + RootCauseAnalysisContext, + RootCauseAnalysisToolRequest, +} from '../types'; +import { formatEntity } from './format_entity'; + +interface EntityExistsResultExists { + exists: true; + entity: Record; +} + +interface EntityExistsResultDoesNotExist { + exists: false; + entity: Record; + suggestions: string[]; +} + +type EntityExistsResult = EntityExistsResultExists | EntityExistsResultDoesNotExist; + +export async function validateInvestigateEntityToolCalls({ + rcaContext, + toolCalls, +}: { + rcaContext: Pick; + toolCalls: RootCauseAnalysisToolRequest[]; +}) { + const { events, esClient, indices, start, end } = rcaContext; + + const previouslyInvestigatedEntities = events + .filter( + (event): event is InvestigateEntityToolMessage => + event.role === MessageRole.Tool && event.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME + ) + .map((toolResponse) => toolResponse.response.entity); + + const investigateEntityToolCalls = toolCalls.filter( + ( + toolCall + ): toolCall is ToolCallsOf<{ + tools: Pick; + }>['toolCalls'][number] => toolCall.function.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME + ); + + if (!investigateEntityToolCalls.length) { + return []; + } + + const entitiesToInvestigate = investigateEntityToolCalls.map((toolCall) => { + const { entity: entityToInvestigate } = toolCall.function.arguments; + return { + [entityToInvestigate.field]: entityToInvestigate.value, + }; + }); + const entityExistsResponses: EntityExistsResult[] = await Promise.all( + entitiesToInvestigate.map(async (entity) => { + const response = await esClient.search('find_data_for_entity', { + track_total_hits: 1, + size: 0, + timeout: '1ms', + index: indices.logs.concat(indices.traces), + query: { + bool: { + filter: [...entityQuery(entity)], + }, + }, + }); + + const exists = response.hits.total.value > 0; + if (!exists) { + return getEntitiesByFuzzySearch({ + start, + end, + esClient, + index: indices.logs.concat(indices.traces), + entity, + }).then((suggestions) => { + return { + entity, + exists, + suggestions, + }; + }); + } + + return { entity, exists }; + }) + ); + + const alreadyInvestigatedEntities = entitiesToInvestigate.filter((entity) => { + return previouslyInvestigatedEntities.some((prevEntity) => isEqual(entity, prevEntity)); + }); + + const errors = [ + ...entityExistsResponses + .filter( + (entityExistsResult): entityExistsResult is EntityExistsResultDoesNotExist => + !entityExistsResult.exists + ) + .map(({ suggestions, entity }) => { + return `Entity ${formatEntity( + entity + )} does not exist. Did you mean one of ${suggestions.join(', ')}?`; + }), + ...alreadyInvestigatedEntities.map((entity) => { + return `Entity ${formatEntity(entity)} was already investigated before.`; + }), + ]; + + return errors; +} diff --git a/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/tsconfig.json b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/tsconfig.json new file mode 100644 index 000000000000..59f73df4273c --- /dev/null +++ b/x-pack/solutions/observability/packages/observability_ai/observability_ai_server/tsconfig.json @@ -0,0 +1,29 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/observability-utils-common", + "@kbn/alerting-plugin", + "@kbn/rule-registry-plugin", + "@kbn/inference-plugin", + "@kbn/logging", + "@kbn/calculate-auto", + "@kbn/observability-ai-assistant-plugin", + "@kbn/inference-common", + "@kbn/observability-ai-common", + "@kbn/observability-utils-server", + ] +} diff --git a/x-pack/packages/observability/synthetics_test_data/README.md b/x-pack/solutions/observability/packages/synthetics_test_data/README.md similarity index 100% rename from x-pack/packages/observability/synthetics_test_data/README.md rename to x-pack/solutions/observability/packages/synthetics_test_data/README.md diff --git a/x-pack/solutions/observability/packages/synthetics_test_data/index.ts b/x-pack/solutions/observability/packages/synthetics_test_data/index.ts new file mode 100644 index 000000000000..bf58a63025aa --- /dev/null +++ b/x-pack/solutions/observability/packages/synthetics_test_data/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 { makeUpSummary, makeDownSummary } from './src/make_summaries'; +export * from './src/e2e'; diff --git a/x-pack/solutions/observability/packages/synthetics_test_data/jest.config.js b/x-pack/solutions/observability/packages/synthetics_test_data/jest.config.js new file mode 100644 index 000000000000..1d9e9717d3e4 --- /dev/null +++ b/x-pack/solutions/observability/packages/synthetics_test_data/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/solutions/observability/packages/synthetics_test_data'], +}; diff --git a/x-pack/packages/observability/synthetics_test_data/kibana.jsonc b/x-pack/solutions/observability/packages/synthetics_test_data/kibana.jsonc similarity index 100% rename from x-pack/packages/observability/synthetics_test_data/kibana.jsonc rename to x-pack/solutions/observability/packages/synthetics_test_data/kibana.jsonc diff --git a/x-pack/packages/observability/synthetics_test_data/package.json b/x-pack/solutions/observability/packages/synthetics_test_data/package.json similarity index 100% rename from x-pack/packages/observability/synthetics_test_data/package.json rename to x-pack/solutions/observability/packages/synthetics_test_data/package.json diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/parse_args_params.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/parse_args_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/parse_args_params.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/parse_args_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/record_video.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/record_video.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/record_video.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/record_video.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/synthetics_runner.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/synthetics_runner.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/test_reporter.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/test_reporter.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/e2e/test_reporter.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/test_reporter.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/utils.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/e2e/utils.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/helpers/utils.ts diff --git a/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/index.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/index.ts new file mode 100644 index 000000000000..89a1c34e3258 --- /dev/null +++ b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/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 { recordVideo } from './helpers/record_video'; +export { SyntheticsRunner } from './helpers/synthetics_runner'; +export { argv } from './helpers/parse_args_params'; +export { readKibanaConfig } from './tasks/read_kibana_config'; diff --git a/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/es_archiver.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/es_archiver.ts new file mode 100644 index 000000000000..46000acd32e9 --- /dev/null +++ b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/es_archiver.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 Path from 'path'; +import { execSync } from 'child_process'; +import { REPO_ROOT } from '@kbn/repo-info'; + +const ES_ARCHIVE_DIR = './fixtures/es_archiver'; + +// Otherwise execSync would inject NODE_TLS_REJECT_UNAUTHORIZED=0 and node would abort if used over https +const NODE_TLS_REJECT_UNAUTHORIZED = '1'; + +export const esArchiverLoad = (folder: string) => { + const path = Path.join(ES_ARCHIVE_DIR, folder); + execSync( + `node ${REPO_ROOT}/scripts/es_archiver load "${path}" --config ${REPO_ROOT}/test/functional/config.base.js`, + { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } + ); +}; + +export const esArchiverUnload = (folder: string) => { + const path = Path.join(ES_ARCHIVE_DIR, folder); + execSync( + `node ${REPO_ROOT}/scripts/es_archiver unload "${path}" --config ${REPO_ROOT}/test/functional/config.base.js`, + { env: { ...process.env, NODE_TLS_REJECT_UNAUTHORIZED }, stdio: 'inherit' } + ); +}; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/read_kibana_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/tasks/read_kibana_config.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/e2e/tasks/read_kibana_config.ts diff --git a/x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts similarity index 99% rename from x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts index a44ffc15c28e..21272cfe792e 100644 --- a/x-pack/packages/observability/synthetics_test_data/src/make_summaries.ts +++ b/x-pack/solutions/observability/packages/synthetics_test_data/src/make_summaries.ts @@ -235,4 +235,7 @@ const commons = { }, }, }, + meta: { + space_id: 'default', + }, }; diff --git a/x-pack/packages/observability/synthetics_test_data/src/utils.ts b/x-pack/solutions/observability/packages/synthetics_test_data/src/utils.ts similarity index 100% rename from x-pack/packages/observability/synthetics_test_data/src/utils.ts rename to x-pack/solutions/observability/packages/synthetics_test_data/src/utils.ts diff --git a/x-pack/solutions/observability/packages/synthetics_test_data/tsconfig.json b/x-pack/solutions/observability/packages/synthetics_test_data/tsconfig.json new file mode 100644 index 000000000000..957d814a9aa9 --- /dev/null +++ b/x-pack/solutions/observability/packages/synthetics_test_data/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/apm-plugin", + "@kbn/es-archiver", + "@kbn/repo-info", + ] +} diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/exploratory_view/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/exploratory_view/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/main.js b/x-pack/solutions/observability/plugins/exploratory_view/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/main.js rename to x-pack/solutions/observability/plugins/exploratory_view/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/observability/.storybook/preview.js b/x-pack/solutions/observability/plugins/exploratory_view/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/observability/.storybook/preview.js rename to x-pack/solutions/observability/plugins/exploratory_view/.storybook/preview.js diff --git a/x-pack/solutions/observability/plugins/exploratory_view/README.md b/x-pack/solutions/observability/plugins/exploratory_view/README.md new file mode 100644 index 000000000000..c3aa6d2d36c7 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/README.md @@ -0,0 +1,27 @@ +# Exploratory View plugin + +A shared component for visualizing observability data types via lens embeddable. [For further details.](./public/components/exploratory_view/README.md) + +## Unit testing + +Note: Run the following commands from `kibana/x-pack/solutions/observability/plugins/exploratory_view`. + +### Run unit tests + +```bash +npx jest --watch +``` + +### Update snapshots + +```bash +npx jest --updateSnapshot +``` + +### Coverage + +HTML coverage report can be found in target/coverage/jest after tests have run. + +```bash +open target/coverage/jest/index.html +``` diff --git a/x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts b/x-pack/solutions/observability/plugins/exploratory_view/common/annotations.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/common/annotations.ts rename to x-pack/solutions/observability/plugins/exploratory_view/common/annotations.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/common/i18n.ts b/x-pack/solutions/observability/plugins/exploratory_view/common/i18n.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/common/i18n.ts rename to x-pack/solutions/observability/plugins/exploratory_view/common/i18n.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/common/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/common/index.ts rename to x-pack/solutions/observability/plugins/exploratory_view/common/index.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/common/processor_event.ts b/x-pack/solutions/observability/plugins/exploratory_view/common/processor_event.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/common/processor_event.ts rename to x-pack/solutions/observability/plugins/exploratory_view/common/processor_event.ts diff --git a/x-pack/solutions/observability/plugins/exploratory_view/e2e/README.md b/x-pack/solutions/observability/plugins/exploratory_view/e2e/README.md new file mode 100644 index 000000000000..58dd5d0f8957 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/README.md @@ -0,0 +1,15 @@ +## How to run these tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/exploratory_view/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From this directory, `~/x-pack/solutions/observability/plugins/exploratory_view/e2e`, you can now run `node ../../../../../scripts/functional_test_runner --config synthetics_run.ts`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/exploratory_view.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/exploratory_view.ts similarity index 98% rename from x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/exploratory_view.ts rename to x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/exploratory_view.ts index 877c13e93c37..99324d0fa921 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/exploratory_view.ts +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/exploratory_view.ts @@ -6,7 +6,7 @@ */ import { journey, step, before } from '@elastic/synthetics'; -import { recordVideo } from '../record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { createExploratoryViewUrl } from '../../public/components/shared/exploratory_view/configurations/exploratory_view_url'; import { loginToKibana, TIMEOUT_60_SEC, waitForLoadingToFinish } from '../utils'; diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/index.ts rename to x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/index.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/single_metric.journey.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/single_metric.journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/single_metric.journey.ts rename to x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/single_metric.journey.ts index 6fcdb71ccffa..23f847784308 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/e2e/journeys/single_metric.journey.ts +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/single_metric.journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, before } from '@elastic/synthetics'; -import { recordVideo } from '../record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { createExploratoryViewUrl } from '../../public/components/shared/exploratory_view/configurations/exploratory_view_url'; import { loginToKibana, TIMEOUT_60_SEC, waitForLoadingToFinish } from '../utils'; diff --git a/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/step_duration.journey.ts new file mode 100644 index 000000000000..861f4036b9ec --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/journeys/step_duration.journey.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 { journey, step } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; +import moment from 'moment'; +import { createExploratoryViewUrl } from '../../public/components/shared/exploratory_view/configurations/exploratory_view_url'; +import { loginToKibana, TIMEOUT_60_SEC, waitForLoadingToFinish } from '../utils'; + +journey('Step Duration series', async ({ page, params }) => { + recordVideo(page); + + page.setDefaultTimeout(TIMEOUT_60_SEC.timeout); + + const expUrl = createExploratoryViewUrl({ + reportType: 'kpi-over-time', + allSeries: [ + { + dataType: 'uptime', + time: { + from: moment().subtract(10, 'y').toISOString(), + to: moment().toISOString(), + }, + name: 'synthetics-series-1', + breakdown: 'monitor.type', + selectedMetricField: 'monitor.duration.us', + reportDefinitions: { + 'url.full': ['ALL_VALUES'], + }, + }, + ], + }); + + const baseUrl = `${params.kibanaUrl}${expUrl}`; + + step('Go to Exploratory view', async () => { + await page.goto(baseUrl, { + waitUntil: 'networkidle', + }); + await loginToKibana({ + page, + user: { username: 'elastic', password: 'changeme' }, + }); + }); + + step('build series with monitor duration', async () => { + await page.waitForNavigation(TIMEOUT_60_SEC); + + await waitForLoadingToFinish({ page }); + await page.click('text=browser'); + await page.click('text=http'); + await page.click('[aria-label="Remove report metric"]'); + await page.click('button:has-text("Select report metric")'); + await page.click('button:has-text("Step duration")'); + await page.waitForSelector('[data-test-subj=seriesBreakdown]'); + await page.getByTestId('seriesBreakdown').click(); + await page.click('button[role="option"]:has-text("Step name")'); + await page.click('.euiComboBox__inputWrap'); + await page.click('[role="combobox"][placeholder="Search Monitor name"]'); + await page.click('button[role="option"]:has-text("test-monitor - inline")'); + await page.click('button:has-text("Apply changes")'); + }); + + step('Verify that changes are applied', async () => { + await waitForLoadingToFinish({ page }); + + await page.click('[aria-label="series color: #54b399"]'); + await page.click('[aria-label="series color: #6092c0"]'); + await page.click('[aria-label="series color: #d36086"] path'); + await page.click('[aria-label="series color: #9170b8"]'); + await page.click('[aria-label="series color: #ca8eae"]'); + await page.click('[aria-label="series color: #d6bf57"]'); + await page.click('text=load homepage'); + await page.click('text=load homepage'); + await page.click('text=load github'); + await page.click('text=load github'); + await page.click('text=load google'); + await page.click('text=load google'); + await page.click('text=hover over products menu'); + await page.click('text=hover over products menu'); + await page.click('text=load homepage 1'); + await page.click('text=load homepage 1'); + await page.click('text=load homepage 2'); + await page.click('text=load homepage 2'); + }); +}); diff --git a/x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.ts new file mode 100644 index 000000000000..8ca6504d3498 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/synthetics_run.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 { FtrConfigProviderContext } from '@kbn/test'; +import path from 'path'; +import { REPO_ROOT } from '@kbn/repo-info'; +import { SyntheticsRunner, argv } from '@kbn/observability-synthetics-test-data'; + +const { headless, grep, bail: pauseOnError } = argv; + +async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { + const kibanaConfig = await readConfigFile(require.resolve('@kbn/synthetics-e2e/config')); + + return { + ...kibanaConfig.getAll(), + testRunner: async ({ getService }: any) => { + const syntheticsRunner = new SyntheticsRunner(getService, { + headless, + match: grep, + pauseOnError, + }); + + await syntheticsRunner.setup(); + await syntheticsRunner.loadTestData( + `${REPO_ROOT}/x-pack/solutions/observability/plugins/ux/e2e/fixtures/`, + ['rum_8.0.0', 'rum_test_data'] + ); + await syntheticsRunner.loadTestData( + `${REPO_ROOT}/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/`, + ['full_heartbeat', 'browser'] + ); + await syntheticsRunner.loadTestFiles(async () => { + require(path.join(__dirname, './journeys')); + }); + await syntheticsRunner.run(); + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default runE2ETests; diff --git a/x-pack/solutions/observability/plugins/exploratory_view/e2e/tsconfig.json b/x-pack/solutions/observability/plugins/exploratory_view/e2e/tsconfig.json new file mode 100644 index 000000000000..43b0ddc6b6f9 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/e2e/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "exclude": ["tmp", "target/**/*"], + "include": ["./**/*"], + "compilerOptions": { + "outDir": "target/types", + "types": ["node"] + }, + "kbn_references": [ + "@kbn/test", + "@kbn/repo-info", + "@kbn/observability-synthetics-test-data", + ] +} diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/utils.ts b/x-pack/solutions/observability/plugins/exploratory_view/e2e/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/utils.ts rename to x-pack/solutions/observability/plugins/exploratory_view/e2e/utils.ts diff --git a/x-pack/solutions/observability/plugins/exploratory_view/jest.config.js b/x-pack/solutions/observability/plugins/exploratory_view/jest.config.js new file mode 100644 index 000000000000..5a879be3d92c --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/exploratory_view'], + setupFiles: [ + '/x-pack/solutions/observability/plugins/exploratory_view/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/exploratory_view', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/exploratory_view/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/exploratory_view/kibana.jsonc b/x-pack/solutions/observability/plugins/exploratory_view/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/kibana.jsonc rename to x-pack/solutions/observability/plugins/exploratory_view/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/application/application.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/application/application.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/application/application.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/application/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/application/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/application/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/application/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/application/types.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/application/types.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/mobile_add_data.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/mobile_add_data.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/mobile_add_data.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/mobile_add_data.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/synthetics_add_data.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/synthetics_add_data.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/synthetics_add_data.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/synthetics_add_data.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/ux_add_data.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/ux_add_data.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/add_data_buttons/ux_add_data.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/add_data_buttons/ux_add_data.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/date_picker.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/date_picker.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/date_picker.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/date_picker.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/typings.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/typings.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/date_picker/typings.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/date_picker/typings.ts diff --git a/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/README.md b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/README.md new file mode 100644 index 000000000000..23d370cd2702 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/README.md @@ -0,0 +1,161 @@ +# Exploratory view component + +This component is used in observability plugin to show lens embeddable based observability visualizations. +The view is populated using configs stored as json within the view for each data type. + +This readme file contains few of the concepts being used in the component. + +Basic workflow for how exploratory view works, it looks like this + + +![Exploratory view workflow](https://i.imgur.com/Kgyfd29.png) + + +## Report Type + +The exploratory view report type controls how the data is visualized in the lens embeddable. The report type defines a set of constraints over the x and y axis. For example, the `kpi-over-time` report type is a time series chart type that plots key performance indicators over time, while the `data-distribution` chart plots the percentage of documents over key performance indicators. Current available data types can be found at `exploratory_view/configurations/constants`. + +Each report type has one or more available visualizations to plot data from one or more data types. + +## Data Types + +Each available visualization is backed by a data type. A data type consists of a set of configuration for displaying domain-specific visualizations for observability data. Some example data types include apm, metrics, and logs. + +For each respective data type, we fetch index pattern string from the app plugin contract, leveraging existing hasData API we have to return the index pattern string as well as a `hasData` boolean from each plugin. + +In most cases, there will be a 1-1 relation between apps and data types. + +### Observability `dataViews` + +Once we have index pattern string for each data type, a respective `dataView` is created. If there is an existing dataView for an index pattern, we will fetch and reuse it. + +After the dataView is created we also set field formats to promote human-readability. For example, we set format for monitor duration field, which is monitor.duration.us, from microseconds to seconds for browser monitors. + +### Visualization Configuration + +Each data type may have one or more visualization configurations. The data type to visualization configuration can be found in [`exploratory_view/obs_exploratory_view`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/observability/public/components/shared/exploratory_view/obsv_exploratory_view.tsx#L86) + +Each visualization configuration is mapped to a single report type. + +Visualization configurations are used to define the UI we display for each report type and data type combination in the series builder. +Visualization configuration define UI options and display, including available `metrics`, available `filters`, available `breakdown` options, definitions for human-readable `labels`, and more. +The configuration also defines any custom base filters, which usually get pushed to a query, but are not displayed on the UI. You can also set more custom options on the configuration like colors which get used while rendering the chart. + +Visualization configuration can be found at [`exploratory_view/configurations`](https://github.com/elastic/kibana/tree/main/x-pack/plugins/observability/public/components/shared/exploratory_view/configurations), where each data type typically has a folder that holds one or more visualization configurations. + +The configuration defined ultimately influences the lens embeddable attributes which get pushed to lens embeddable, rendering the chart. + +Some options in configuration are: + +#### Definition fields +They are also filters, but usually main filters, around which usually app UI is based. +For apm, it could be service name and for uptime, monitor name. + +#### Filters +You can define base filters in kql form or data plugin filter format, filters are strongly typed. + +#### Breakdown fields +List of fields from an index pattern, UI will use this to populate breakdown option select. + +#### Labels +You can set key/value map for your field labels. UI will use these to set labels for data view fields. + +Sample config +``` +{ + reportType: ReportTypes.KPI, + defaultSeriesType: 'bar_stacked', + xAxisColumn: { + sourceField: '@timestamp', + }, + yAxisColumns: [ + { + sourceField: REPORT_METRIC_FIELD, + operationType: 'median', + }, + ], + hasOperationType: false, + filterFields: ['observer.geo.name', 'monitor.type', 'tags'], // these fields get's resolved from relevant dataView + breakdownFields: [ + 'observer.geo.name', + 'monitor.type', + 'monitor.name', + PERCENTILE, + ], // these fields get's resolved from relevant dataView + baseFilters: [], + palette: { type: 'palette', name: 'status' }, + definitionFields: [ + { field: 'monitor.name', nested: SYNTHETICS_STEP_NAME, singleSelection: true }, + { field: 'url.full', filters: buildExistsFilter('summary.up', dataView) }, + ], + metricOptions: [ + { + label: MONITORS_DURATION_LABEL, + field: 'monitor.duration.us', + columnType: OPERATION_COLUMN, + } + ], + labels: { ...FieldLabels, [SUMMARY_UP]: UP_LABEL, [SUMMARY_DOWN]: DOWN_LABEL }, + } +``` + + + +## Lens Embeddable + +Lens embeddable is what actually renders the chart in exploratory view. + +Exploratory view generates the lens embeddable attributes as json and pass it to the component. + +Based on configuration, exploratory view generates layers and columns. + +Add a link to lens embeddable readme + +#### Example +A simple usage of lens embeddable example and playground options +[embedded_lens_example](../../../../../../../examples/embedded_lens_example) + +## Exploratory view Embeddable + +The primary purpose of the exploratory view is to embed it in observability solutions like uptime to replace +existing static visualizations, + +For that purpose, all the configuration options we define in the exploratory view can be used as an embeddable +via a component that is exposed using observability plugin contract, +usage looks like this + +`const ExploratoryViewComponent = props.plugins.observability.ExploratoryViewEmbeddable; +` + +``` + +``` + +there is an example in kibana example which you can view using +`yarn start --run-examples` and view the code at [Exploratory view embeddable](../../../../../../../examples/exploratory_view_example) + +#### Example +A simple usage of lens embeddable example and playground options, run kibana with +`yarn start --run-example` to see this example in action +source code is defined at [embedded_lens_example](../../../../../../../examples/embedded_lens_example) \ No newline at end of file diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/action_menu.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/action_menu/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/action_menu/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/date_range_picker.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/date_range_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/date_range_picker.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/date_range_picker.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/empty_view.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/empty_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/empty_view.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/empty_view.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/filter_label.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/filter_label.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/filter_label.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/filter_label.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/filter_label.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/filter_label.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/filter_label.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/filter_label.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_color_picker.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_color_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_color_picker.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_color_picker.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/series_date_picker.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/series_date_picker.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/series_date_picker.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/series_date_picker/series_date_picker.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/selectable_url_list.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/translations.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/translations.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/translations.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/url_search.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/url_search.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/url_search.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/url_search.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/use_url_search.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/use_url_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/components/url_search/use_url_search.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components/url_search/use_url_search.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/single_metric_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/single_metric_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/single_metric_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/alerts_configs/single_metric_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/apm/field_formats.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/apm/field_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/apm/field_formats.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/apm/field_formats.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/constants.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/elasticsearch_fieldnames.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/elasticsearch_fieldnames.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/elasticsearch_fieldnames.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/elasticsearch_fieldnames.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_logs.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_logs.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_logs.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_logs.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_metrics.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_metrics.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/infra_metrics.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/synthetics.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/synthetics.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/synthetics.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/field_names/synthetics.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/index.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/index.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/labels.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/labels.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/labels.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/constants/url_constants.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/default_configs.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/default_configs.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/default_configs.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/default_configs.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/exploratory_view_url.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_logs/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_logs/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_logs/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_logs/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/field_formats.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/field_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/field_formats.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/field_formats.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/infra_metrics/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/heatmap_attributes.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_attributes/single_metric_attributes.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_columns/overall_column.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_columns/overall_column.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/lens_columns/overall_column.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/lens_columns/overall_column.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/device_distribution_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/distribution_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_fields.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_fields.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_fields.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_fields.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/mobile/mobile_kpi_config.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/core_web_vitals_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/data_distribution_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/field_formats.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/field_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/field_formats.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/field_formats.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/single_metric_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/single_metric_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/rum/single_metric_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/rum/single_metric_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/data_distribution_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/field_formats.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/field_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/field_formats.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/field_formats.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/heatmap_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/kpi_over_time_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/runtime_fields.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/runtime_fields.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/runtime_fields.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/runtime_fields.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/synthetics/single_metric_config.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/mobile_test_attribute.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_cwv.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_kpi.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/sample_attribute_with_reference_lines.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_data_view.json diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/test_data/test_formula_metric_attribute.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/utils.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/configurations/utils.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/configurations/utils.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/contexts/exploratory_view_config.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/embeddable.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_actions.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_actions.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_actions.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts similarity index 97% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts index f4b73e16fbc4..e7441ef0c45c 100644 --- a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts +++ b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_app_data_view.ts @@ -45,7 +45,6 @@ export const useAppDataView = ({ setDataViews((prevState) => ({ ...(prevState ?? {}), [seriesDataType]: indPattern })); } } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [dataViewTitle, seriesDataType, JSON.stringify(series)]); return { dataViews, loading: loading && !dataViews[seriesDataType] }; diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_embeddable_attributes.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_embeddable_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_embeddable_attributes.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_embeddable_attributes.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_local_data_view.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_local_data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/embeddable/use_local_data_view.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/embeddable/use_local_data_view.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/exploratory_view.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/add_to_case_action.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/chart_creation_info.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/embed_action.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/embed_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/embed_action.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/embed_action.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/last_updated.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/last_updated.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/last_updated.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/last_updated.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/refresh_button.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/refresh_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/header/refresh_button.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/header/refresh_button.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_add_to_case.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_app_data_view.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_discover_link.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_ebt_telemetry.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_ebt_telemetry.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_ebt_telemetry.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_ebt_telemetry.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_attributes.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_formula_helper.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_formula_helper.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_formula_helper.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_lens_formula_helper.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_filters.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_filters.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_filters.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_series_storage.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/hooks/use_time_range.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/labels.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/labels.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/labels.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/lens_embeddable.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/obsv_exploratory_view.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/obsv_exploratory_view.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/obsv_exploratory_view.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/obsv_exploratory_view.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/rtl_helpers.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/breakdowns.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/breakdown/label_breakdown.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_type_select.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_type_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_type_select.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_type_select.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/chart_types.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/data_type_select.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/date_picker_col.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_expanded.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/filter_value_btn.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/incomplete_badge.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/operation_type_select.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_col.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_definition_field.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/report_type_select.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/selected_filters.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_actions.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_filter.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_filter.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_filter.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_info.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_info.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_info.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/series_name.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/text_report_definition_field.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/text_report_definition_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/text_report_definition_field.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/columns/text_report_definition_field.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/filter_values_list.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/components/labels_filter.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/expanded_series_row.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/report_metric_options.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/series.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/series.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/series_editor.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/series_editor/use_filter_values.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/types.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/types.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/stringify_kueries.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/telemetry.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/utils.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/utils/utils.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/utils/utils.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/add_series_button.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/series_views.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/series_views.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/series_views.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/series_views.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/view_actions.test.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/view_actions.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/view_actions.test.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/view_actions.test.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/view_actions.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/view_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/exploratory_view/views/view_actions.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/views/view_actions.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/filter_value_label/filter_value_label.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/filter_value_label/filter_value_label.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/filter_value_label/filter_value_label.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/filter_value_label/filter_value_label.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/components/shared/types.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/components/shared/types.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/types.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/constants.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/constants.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/constants.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/context/date_picker_context.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/context/date_picker_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/context/date_picker_context.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/context/date_picker_context.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/context/plugin_context.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/context/plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/context/plugin_context.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/context/plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/data_handler.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/data_handler.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/data_handler.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/data_handler.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/data_handler.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/data_handler.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/data_handler.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/data_handler.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/hooks/use_date_picker_context.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/hooks/use_date_picker_context.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/hooks/use_date_picker_context.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/hooks/use_date_picker_context.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/hooks/use_plugin_context.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/hooks/use_plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/hooks/use_plugin_context.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/hooks/use_plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/index.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/index.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/plugin.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/routes/index.tsx b/x-pack/solutions/observability/plugins/exploratory_view/public/routes/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/routes/index.tsx rename to x-pack/solutions/observability/plugins/exploratory_view/public/routes/index.tsx diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/routes/json_rt.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/routes/json_rt.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/routes/json_rt.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/routes/json_rt.ts diff --git a/x-pack/solutions/observability/plugins/exploratory_view/public/typings/fetch_overview_data/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/typings/fetch_overview_data/index.ts new file mode 100644 index 000000000000..f338354d5226 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/public/typings/fetch_overview_data/index.ts @@ -0,0 +1,166 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { ApmIndicesConfig, UXMetrics } from '@kbn/observability-shared-plugin/public'; +import { ObservabilityApp } from '@kbn/observability-shared-plugin/typings/common'; + +export interface Stat { + type: 'number' | 'percent' | 'bytesPerSecond'; + value: number; +} + +export interface Coordinates { + x: number; + y?: number | null; +} + +export interface Series { + coordinates: Coordinates[]; +} + +export interface FetchDataParams { + absoluteTime: { start: number; end: number }; + relativeTime: { start: string; end: string }; + serviceName?: string; + // Bucket size in seconds (number) + bucketSize: number; + // Bucket size in seconds (string) + intervalString: string; + timeZone?: string; +} + +export interface HasDataParams { + absoluteTime: { start: number; end: number }; +} + +export interface HasDataResponse { + hasData: boolean; +} + +export interface UXHasDataResponse extends HasDataResponse { + serviceName?: string | number; + indices?: string; +} + +export interface SyntheticsHasDataResponse extends HasDataResponse { + indices: string; +} + +export interface APMHasDataResponse { + hasData: boolean; + indices: ApmIndicesConfig; +} + +export interface InfraMetricsHasDataResponse { + hasData: boolean; + indices: string; +} + +export interface InfraLogsHasDataResponse { + hasData: boolean; + indices: string; +} + +export type FetchData = ( + fetchDataParams: FetchDataParams +) => Promise; + +export type HasData = ( + params?: HasDataParams +) => Promise; + +export type ObservabilityFetchDataPlugins = Exclude< + ObservabilityApp, + 'observability-overview' | 'fleet' | 'synthetics' | 'profiling' | 'observability-onboarding' +>; + +export interface DataHandler< + T extends ObservabilityFetchDataPlugins = ObservabilityFetchDataPlugins +> { + fetchData: FetchData; + hasData: HasData; +} + +export interface FetchDataResponse { + appLink: string; +} + +export interface LogsFetchDataResponse extends FetchDataResponse { + stats: Record; + series: Record; +} + +export type StringOrNull = string | null; +export type NumberOrNull = number | null; + +export interface MetricsFetchDataSeries { + id: string; + name: StringOrNull; + platform: StringOrNull; + provider: StringOrNull; + cpu: NumberOrNull; + iowait: NumberOrNull; + load: NumberOrNull; + uptime: NumberOrNull; + rx: NumberOrNull; + tx: NumberOrNull; + timeseries: Array<{ + timestamp: number; + cpu: NumberOrNull; + iowait: NumberOrNull; + load: NumberOrNull; + rx: NumberOrNull; + tx: NumberOrNull; + }>; +} + +export interface MetricsFetchDataResponse extends FetchDataResponse { + sort: (by: string, direction: string) => Promise; + series: MetricsFetchDataSeries[]; +} + +export interface UptimeFetchDataResponse extends FetchDataResponse { + stats: { + monitors: Stat; + up: Stat; + down: Stat; + }; + series: { + up: Series; + down: Series; + }; +} + +export interface ApmFetchDataResponse extends FetchDataResponse { + stats: { + services: Stat; + transactions: Stat; + }; + series: { + transactions: Series; + }; +} + +export interface UxFetchDataResponse extends FetchDataResponse { + coreWebVitals: UXMetrics; +} + +export interface ObservabilityFetchDataResponse { + apm: ApmFetchDataResponse; + infra_metrics: MetricsFetchDataResponse; + infra_logs: LogsFetchDataResponse; + uptime: UptimeFetchDataResponse; + ux: UxFetchDataResponse; +} + +export interface ObservabilityHasDataResponse { + apm: APMHasDataResponse; + infra_metrics: InfraMetricsHasDataResponse; + infra_logs: InfraLogsHasDataResponse; + uptime: SyntheticsHasDataResponse; + ux: UXHasDataResponse; +} diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/date.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/date.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/date.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/date.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/get_app_data_view.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/get_app_data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/get_app_data_view.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/get_app_data_view.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/index.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/index.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/index.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/observability_data_views/observability_data_views.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/observability_data_views/observability_data_views.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/url.test.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/url.test.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.test.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts b/x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/public/utils/url.ts rename to x-pack/solutions/observability/plugins/exploratory_view/public/utils/url.ts diff --git a/x-pack/plugins/observability_solution/exploratory_view/scripts/e2e.js b/x-pack/solutions/observability/plugins/exploratory_view/scripts/e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/scripts/e2e.js rename to x-pack/solutions/observability/plugins/exploratory_view/scripts/e2e.js diff --git a/x-pack/plugins/observability_solution/exploratory_view/scripts/storybook.js b/x-pack/solutions/observability/plugins/exploratory_view/scripts/storybook.js similarity index 100% rename from x-pack/plugins/observability_solution/exploratory_view/scripts/storybook.js rename to x-pack/solutions/observability/plugins/exploratory_view/scripts/storybook.js diff --git a/x-pack/solutions/observability/plugins/exploratory_view/tsconfig.json b/x-pack/solutions/observability/plugins/exploratory_view/tsconfig.json new file mode 100644 index 000000000000..cfe8deebbcc5 --- /dev/null +++ b/x-pack/solutions/observability/plugins/exploratory_view/tsconfig.json @@ -0,0 +1,50 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": ["common/**/*", "public/**/*", "public/**/*.json", "../../../../../typings/**/*"], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/usage-collection-plugin", + "@kbn/licensing-plugin", + "@kbn/cases-plugin", + "@kbn/lens-plugin", + "@kbn/spaces-plugin", + "@kbn/unified-search-plugin", + "@kbn/discover-plugin", + "@kbn/i18n", + "@kbn/data-views-plugin", + "@kbn/embeddable-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/security-plugin", + "@kbn/navigation-plugin", + "@kbn/i18n-react", + "@kbn/es-types", + "@kbn/rison", + "@kbn/datemath", + "@kbn/es-query", + "@kbn/field-formats-plugin", + "@kbn/coloring", + "@kbn/ui-actions-plugin", + "@kbn/visualizations-plugin", + "@kbn/core-http-browser", + "@kbn/share-plugin", + "@kbn/charts-plugin", + "@kbn/shared-ux-router", + "@kbn/observability-shared-plugin", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/observability-ai-assistant-plugin", + "@kbn/shared-ux-link-redirect-app", + "@kbn/react-kibana-context-render", + "@kbn/react-kibana-mount", + "@kbn/core-analytics-browser", + "@kbn/expressions-plugin", + "@kbn/ebt-tools" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/investigate/README.md b/x-pack/solutions/observability/plugins/investigate/README.md similarity index 100% rename from x-pack/plugins/observability_solution/investigate/README.md rename to x-pack/solutions/observability/plugins/investigate/README.md diff --git a/x-pack/plugins/observability_solution/investigate/common/index.ts b/x-pack/solutions/observability/plugins/investigate/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/common/index.ts rename to x-pack/solutions/observability/plugins/investigate/common/index.ts diff --git a/x-pack/plugins/observability_solution/investigate/common/types.ts b/x-pack/solutions/observability/plugins/investigate/common/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/common/types.ts rename to x-pack/solutions/observability/plugins/investigate/common/types.ts diff --git a/x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts b/x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/common/utils/merge_plain_objects.ts rename to x-pack/solutions/observability/plugins/investigate/common/utils/merge_plain_objects.ts diff --git a/x-pack/solutions/observability/plugins/investigate/jest.config.js b/x-pack/solutions/observability/plugins/investigate/jest.config.js new file mode 100644 index 000000000000..34bb5b698813 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: [ + '/x-pack/solutions/observability/plugins/investigate/public', + '/x-pack/solutions/observability/plugins/investigate/common', + '/x-pack/solutions/observability/plugins/investigate/server', + ], + setupFiles: [], + collectCoverage: true, + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/investigate/{common,public,server}/**/*.{js,ts,tsx}', + ], + + coverageReporters: ['html'], +}; diff --git a/x-pack/plugins/observability_solution/investigate/kibana.jsonc b/x-pack/solutions/observability/plugins/investigate/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/investigate/kibana.jsonc rename to x-pack/solutions/observability/plugins/investigate/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/investigate/public/index.ts b/x-pack/solutions/observability/plugins/investigate/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/public/index.ts rename to x-pack/solutions/observability/plugins/investigate/public/index.ts diff --git a/x-pack/plugins/observability_solution/investigate/public/investigation/item_definition_registry.ts b/x-pack/solutions/observability/plugins/investigate/public/investigation/item_definition_registry.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/public/investigation/item_definition_registry.ts rename to x-pack/solutions/observability/plugins/investigate/public/investigation/item_definition_registry.ts diff --git a/x-pack/plugins/observability_solution/investigate/public/plugin.tsx b/x-pack/solutions/observability/plugins/investigate/public/plugin.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate/public/plugin.tsx rename to x-pack/solutions/observability/plugins/investigate/public/plugin.tsx diff --git a/x-pack/plugins/observability_solution/investigate/public/types.ts b/x-pack/solutions/observability/plugins/investigate/public/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/public/types.ts rename to x-pack/solutions/observability/plugins/investigate/public/types.ts diff --git a/x-pack/plugins/observability_solution/investigate/public/util/get_es_filters_from_global_parameters.ts b/x-pack/solutions/observability/plugins/investigate/public/util/get_es_filters_from_global_parameters.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/public/util/get_es_filters_from_global_parameters.ts rename to x-pack/solutions/observability/plugins/investigate/public/util/get_es_filters_from_global_parameters.ts diff --git a/x-pack/plugins/observability_solution/investigate/server/config.ts b/x-pack/solutions/observability/plugins/investigate/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/server/config.ts rename to x-pack/solutions/observability/plugins/investigate/server/config.ts diff --git a/x-pack/plugins/observability_solution/investigate/server/index.ts b/x-pack/solutions/observability/plugins/investigate/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/server/index.ts rename to x-pack/solutions/observability/plugins/investigate/server/index.ts diff --git a/x-pack/plugins/observability_solution/investigate/server/plugin.ts b/x-pack/solutions/observability/plugins/investigate/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/server/plugin.ts rename to x-pack/solutions/observability/plugins/investigate/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/investigate/server/types.ts b/x-pack/solutions/observability/plugins/investigate/server/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate/server/types.ts rename to x-pack/solutions/observability/plugins/investigate/server/types.ts diff --git a/x-pack/solutions/observability/plugins/investigate/tsconfig.json b/x-pack/solutions/observability/plugins/investigate/tsconfig.json new file mode 100644 index 000000000000..14a188c1a0ca --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../typings/**/*", + "common/**/*", + "public/**/*", + "typings/**/*", + "public/**/*.json", + "server/**/*", ], + "kbn_references": [ + "@kbn/core", + "@kbn/logging", + "@kbn/config-schema", + "@kbn/es-query", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/extend_props.ts b/x-pack/solutions/observability/plugins/investigate_app/.storybook/extend_props.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/extend_props.ts rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/extend_props.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/get_mock_investigate_app_services.tsx b/x-pack/solutions/observability/plugins/investigate_app/.storybook/get_mock_investigate_app_services.tsx similarity index 95% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/get_mock_investigate_app_services.tsx rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/get_mock_investigate_app_services.tsx index 42ccc20d52a7..d0e9e936dd59 100644 --- a/x-pack/plugins/observability_solution/investigate_app/.storybook/get_mock_investigate_app_services.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/.storybook/get_mock_investigate_app_services.tsx @@ -17,6 +17,7 @@ import { SearchBar, IUnifiedSearchPluginServices } from '@kbn/unified-search-plu import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public'; import { merge } from 'lodash'; import { Storage } from '@kbn/kibana-utils-plugin/public'; +import { of } from 'rxjs'; import type { EsqlQueryMeta } from '../public/services/esql'; import type { InvestigateAppServices } from '../public/services/types'; import { InvestigateAppKibanaContext } from '../public/hooks/use_kibana'; @@ -54,6 +55,10 @@ export function getMockInvestigateAppContext(): DeeplyMockedKeys Promise.resolve()), + stream: jest.fn().mockImplementation(() => of()) as any, + }, }; const core = coreMock.createStart(); diff --git a/x-pack/plugins/observability_solution/observability/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/investigate_app/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/observability/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/observability/.storybook/main.js b/x-pack/solutions/observability/plugins/investigate_app/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/observability/.storybook/main.js rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/mock_kibana_services.ts b/x-pack/solutions/observability/plugins/investigate_app/.storybook/mock_kibana_services.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/mock_kibana_services.ts rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/mock_kibana_services.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/preview.js b/x-pack/solutions/observability/plugins/investigate_app/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/preview.js rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/preview.js diff --git a/x-pack/plugins/observability_solution/investigate_app/.storybook/storybook_decorator.tsx b/x-pack/solutions/observability/plugins/investigate_app/.storybook/storybook_decorator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/.storybook/storybook_decorator.tsx rename to x-pack/solutions/observability/plugins/investigate_app/.storybook/storybook_decorator.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/README.md b/x-pack/solutions/observability/plugins/investigate_app/README.md similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/README.md rename to x-pack/solutions/observability/plugins/investigate_app/README.md diff --git a/x-pack/plugins/observability_solution/investigate_app/common/paths.ts b/x-pack/solutions/observability/plugins/investigate_app/common/paths.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/common/paths.ts rename to x-pack/solutions/observability/plugins/investigate_app/common/paths.ts diff --git a/x-pack/solutions/observability/plugins/investigate_app/jest.config.js b/x-pack/solutions/observability/plugins/investigate_app/jest.config.js new file mode 100644 index 000000000000..fdd824900e3f --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: [ + '/x-pack/solutions/observability/plugins/investigate_app/public', + '/x-pack/solutions/observability/plugins/investigate_app/server', + ], + setupFiles: [ + '/x-pack/solutions/observability/plugins/investigate_app/.storybook/jest_setup.js', + ], + collectCoverage: true, + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/investigate_app/{public,server}/**/*.{js,ts,tsx}', + ], + + coverageReporters: ['html'], +}; diff --git a/x-pack/solutions/observability/plugins/investigate_app/kibana.jsonc b/x-pack/solutions/observability/plugins/investigate_app/kibana.jsonc new file mode 100644 index 000000000000..eb69c6f9ea53 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/kibana.jsonc @@ -0,0 +1,45 @@ +{ + "type": "plugin", + "id": "@kbn/investigate-app-plugin", + "owner": "@elastic/obs-ux-management-team", + "visibility": "private", + "group": "observability", + "plugin": { + "id": "investigateApp", + "server": true, + "browser": true, + "configPath": ["xpack", "investigateApp"], + "requiredPlugins": [ + "investigate", + "observabilityShared", + "lens", + "charts", + "dataViews", + "data", + "embeddable", + "contentManagement", + "datasetQuality", + "unifiedSearch", + "security", + "observability", + "licensing", + "ruleRegistry", + "inference", + "alerting", + "spaces", + "slo", + "apmDataAccess", + "usageCollection" + ], + "optionalPlugins": [ + "observabilityAIAssistant", + "observabilityAIAssistantApp" + ], + "requiredBundles": [ + "esql", + "kibanaReact", + "kibanaUtils" + ], + "extraPublicDirs": [] + } +} diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/api/index.ts b/x-pack/solutions/observability/plugins/investigate_app/public/api/index.ts new file mode 100644 index 000000000000..21f3251bd0d3 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/api/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { CoreSetup, CoreStart, HttpFetchOptions } from '@kbn/core/public'; +import type { + ClientRequestParamsOf, + ReturnOf, + RouteRepositoryClient, +} from '@kbn/server-route-repository'; +import { createRepositoryClient } from '@kbn/server-route-repository-client'; +import type { InvestigateAppServerRouteRepository } from '../../server'; + +type FetchOptions = Omit & { + body?: any; +}; + +export type InvestigateAppAPIClientOptions = Omit< + FetchOptions, + 'query' | 'body' | 'pathname' | 'signal' +> & { + signal: AbortSignal | null; +}; + +export type InvestigateAppRepositoryClient = RouteRepositoryClient< + InvestigateAppServerRouteRepository, + InvestigateAppAPIClientOptions +>; + +export type AutoAbortedInvestigateAppRepositoryClient = RouteRepositoryClient< + InvestigateAppServerRouteRepository, + Omit +>; + +export type InvestigateAppAPIEndpoint = keyof InvestigateAppServerRouteRepository; + +export type APIReturnType = ReturnOf< + InvestigateAppServerRouteRepository, + TEndpoint +>; + +export type InvestigateAppAPIClientRequestParamsOf = + ClientRequestParamsOf; + +export function createInvestigateAppRepositoryClient(core: CoreStart | CoreSetup) { + return createRepositoryClient(core) as InvestigateAppRepositoryClient; +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/application.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/application.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/application.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/application.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/error_message/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/error_message/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/error_message/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/error_message/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_app_context_provider/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigate_app_context_provider/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigate_app_context_provider/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigate_app_context_provider/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_text_button/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigate_text_button/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigate_text_button/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigate_text_button/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/external_incident_field.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/external_incident_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/external_incident_field.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/external_incident_field.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/status_field.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/status_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/status_field.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/status_field.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/tags_field.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/tags_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/fields/tags_field.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/fields/tags_field.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/form_helper.ts b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/form_helper.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/form_helper.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/form_helper.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/investigation_edit_form.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/investigation_edit_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_edit_form/investigation_edit_form.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_edit_form/investigation_edit_form.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_not_found/investigation_not_found.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_not_found/investigation_not_found.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_not_found/investigation_not_found.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_not_found/investigation_not_found.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_status_badge/investigation_status_badge.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_status_badge/investigation_status_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_status_badge/investigation_status_badge.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_status_badge/investigation_status_badge.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigation_tag/investigation_tag.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_tag/investigation_tag.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/investigation_tag/investigation_tag.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/investigation_tag/investigation_tag.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/preview_lens_suggestion/index.stories.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/preview_lens_suggestion/index.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/preview_lens_suggestion/index.stories.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/preview_lens_suggestion/index.stories.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/preview_lens_suggestion/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/preview_lens_suggestion/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/preview_lens_suggestion/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/preview_lens_suggestion/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/index.stories.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/index.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/index.stories.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/index.stories.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/suggestions.mock.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/suggestions.mock.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/components/suggest_visualization_list/suggestions.mock.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/components/suggest_visualization_list/suggestions.mock.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/constants/index.ts b/x-pack/solutions/observability/plugins/investigate_app/public/constants/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/constants/index.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/constants/index.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/query_key_factory.ts similarity index 89% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/query_key_factory.ts index 38e4c90aebe0..494b2b134aac 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/query_key_factory.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/query_key_factory.ts @@ -12,8 +12,12 @@ export const investigationKeys = { userProfiles: (profileIds: Set) => [...investigationKeys.all, 'userProfiles', ...profileIds] as const, tags: () => [...investigationKeys.all, 'tags'] as const, - events: (rangeFrom?: string, rangeTo?: string, filter?: string) => - [...investigationKeys.all, 'events', rangeFrom, rangeTo, filter] as const, + events: (params: { + rangeFrom?: string; + rangeTo?: string; + filter?: string; + eventTypes?: string[]; + }) => [...investigationKeys.all, 'events', params] as const, stats: () => [...investigationKeys.all, 'stats'] as const, lists: () => [...investigationKeys.all, 'list'] as const, list: (params: { page: number; perPage: number; search?: string; filter?: string }) => diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_add_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_add_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_add_investigation_note.ts similarity index 83% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_add_investigation_note.ts index 3f349238c73f..659e56b9172d 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_add_investigation_note.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_add_investigation_note.ts @@ -11,8 +11,9 @@ import { CreateInvestigationNoteParams, CreateInvestigationNoteResponse, } from '@kbn/investigation-shared'; -import { useMutation } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { useKibana } from './use_kibana'; +import { investigationKeys } from './query_key_factory'; type ServerError = IHttpFetchError; @@ -23,6 +24,7 @@ export function useAddInvestigationNote() { notifications: { toasts }, }, } = useKibana(); + const queryClient = useQueryClient(); return useMutation< CreateInvestigationNoteResponse, @@ -39,7 +41,12 @@ export function useAddInvestigationNote() { ); }, { - onSuccess: (response, {}) => { + onSuccess: (_, { investigationId }) => { + queryClient.invalidateQueries({ + queryKey: investigationKeys.detailNotes(investigationId), + exact: false, + }); + toasts.addSuccess( i18n.translate('xpack.investigateApp.addInvestigationNote.successMessage', { defaultMessage: 'Note saved', diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_create_investigation.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_create_investigation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_create_investigation.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_create_investigation.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation_note.ts similarity index 82% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation_note.ts index 8eaeea2d67b8..5b4e6e6d6128 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_delete_investigation_note.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_delete_investigation_note.ts @@ -6,13 +6,15 @@ */ import { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public'; -import { useMutation } from '@tanstack/react-query'; +import { useMutation, useQueryClient } from '@tanstack/react-query'; import { i18n } from '@kbn/i18n'; import { useKibana } from './use_kibana'; +import { investigationKeys } from './query_key_factory'; type ServerError = IHttpFetchError; export function useDeleteInvestigationNote() { + const queryClient = useQueryClient(); const { core: { http, @@ -34,7 +36,12 @@ export function useDeleteInvestigationNote() { ); }, { - onSuccess: (response, {}) => { + onSuccess: (response, { investigationId }) => { + queryClient.invalidateQueries({ + queryKey: investigationKeys.detailNotes(investigationId), + exact: false, + }); + toasts.addSuccess( i18n.translate('xpack.investigateApp.useDeleteInvestigationNote.successMessage', { defaultMessage: 'Note deleted', diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_alert.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_alert.tsx similarity index 99% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_alert.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_alert.tsx index 7d2245ac3861..76f22d2ccff3 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_alert.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_alert.tsx @@ -44,6 +44,7 @@ export function useFetchAlert({ investigation }: UseFetchAlertParams): UseFetchA }); }, staleTime: 60 * 1000, + retry: false, refetchOnWindowFocus: false, onError: (error: Error) => { toasts.addError(error, { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts similarity index 97% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts index 2b2c8b92b0d4..8b5ad9f8abd7 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_stats.ts @@ -51,8 +51,7 @@ export function useFetchAllInvestigationStats(): Response { }; }, retry: false, - cacheTime: 600 * 1000, // 10 minutes - staleTime: 0, + staleTime: 15 * 1000, onError: (error: Error) => { toasts.addError(error, { title: i18n.translate('xpack.investigateApp.useFetchAllInvestigationStats.errorTitle', { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts similarity index 96% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts index 083742f09b68..be912df75644 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_all_investigation_tags.ts @@ -35,8 +35,7 @@ export function useFetchAllInvestigationTags(): Response { signal, }); }, - cacheTime: 600 * 1000, // 10_minutes - staleTime: 0, + staleTime: 15 * 1000, refetchOnWindowFocus: false, retry: false, onError: (error: Error) => { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_entities.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_entities.ts similarity index 96% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_entities.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_entities.ts index a8cee1a9c185..5d99d9ed906e 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_entities.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_entities.ts @@ -50,9 +50,7 @@ export function useFetchEntities({ }); }, refetchOnWindowFocus: false, - onError: (error: Error) => { - // ignore error - }, + retry: false, enabled: Boolean(investigationId && (serviceName || hostName || containerId)), }); diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_events.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_events.ts similarity index 76% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_events.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_events.ts index 5b885fc664b1..8447789562fa 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_events.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_events.ts @@ -6,16 +6,14 @@ */ import { i18n } from '@kbn/i18n'; -import { useQuery } from '@tanstack/react-query'; import { GetEventsResponse } from '@kbn/investigation-shared'; +import { useQuery } from '@tanstack/react-query'; +import { isArray } from 'lodash'; import { investigationKeys } from './query_key_factory'; import { useKibana } from './use_kibana'; export interface Response { - isInitialLoading: boolean; isLoading: boolean; - isRefetching: boolean; - isSuccess: boolean; isError: boolean; data?: GetEventsResponse; } @@ -24,10 +22,12 @@ export function useFetchEvents({ rangeFrom, rangeTo, filter, + eventTypes, }: { rangeFrom?: string; rangeTo?: string; filter?: string; + eventTypes?: string[]; }): Response { const { core: { @@ -36,21 +36,20 @@ export function useFetchEvents({ }, } = useKibana(); - const { isInitialLoading, isLoading, isError, isSuccess, isRefetching, data } = useQuery({ - queryKey: investigationKeys.events(rangeFrom, rangeTo, filter), + const { isLoading, isError, data } = useQuery({ + queryKey: investigationKeys.events({ rangeFrom, rangeTo, filter, eventTypes }), queryFn: async ({ signal }) => { - return await http.get(`/api/observability/events`, { + return http.get(`/api/observability/events`, { query: { rangeFrom, rangeTo, filter, + ...(isArray(eventTypes) && eventTypes.length > 0 && { eventTypes: eventTypes.join(',') }), }, version: '2023-10-31', signal, }); }, - cacheTime: 600 * 1000, // 10_minutes - staleTime: 0, refetchOnWindowFocus: false, retry: false, onError: (error: Error) => { @@ -64,10 +63,7 @@ export function useFetchEvents({ return { data, - isInitialLoading, isLoading, - isRefetching, - isSuccess, isError, }; } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_items.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_items.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_items.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_items.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_list.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_list.ts similarity index 97% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_list.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_list.ts index cadd0de89a8e..9d19d4d4cc04 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_list.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_list.ts @@ -64,8 +64,6 @@ export function useFetchInvestigationList({ retry: false, refetchInterval: 60 * 1000, refetchOnWindowFocus: false, - cacheTime: 600 * 1000, // 10 minutes - staleTime: 0, onError: (error: Error) => { toasts.addError(error, { title: i18n.translate('xpack.investigateApp.useFetchInvestigationList.errorTitle', { diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_notes.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_notes.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_investigation_notes.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_investigation_notes.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_user_profiles.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_user_profiles.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_fetch_user_profiles.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_fetch_user_profiles.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_kibana.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_kibana.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_screen_context.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_screen_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_screen_context.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_screen_context.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_theme.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_theme.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_theme.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_update_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_update_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_update_investigation_note.ts similarity index 93% rename from x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_update_investigation_note.ts index 14da1ec22fee..a66aedb4611c 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/hooks/use_update_investigation_note.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/hooks/use_update_investigation_note.ts @@ -39,12 +39,16 @@ export function useUpdateInvestigationNote() { }, { onSuccess: (response, { investigationId }) => { + queryClient.invalidateQueries({ + queryKey: investigationKeys.detailNotes(investigationId), + exact: false, + }); + toasts.addSuccess( i18n.translate('xpack.investigateApp.useUpdateInvestigationNote.successMessage', { defaultMessage: 'Note updated', }) ); - queryClient.invalidateQueries({ queryKey: investigationKeys.detailNotes(investigationId) }); }, onError: (error, {}, context) => { toasts.addError( diff --git a/x-pack/plugins/observability_solution/investigate_app/public/index.ts b/x-pack/solutions/observability/plugins/investigate_app/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/index.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/index.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/README.md b/x-pack/solutions/observability/plugins/investigate_app/public/items/README.md similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/items/README.md rename to x-pack/solutions/observability/plugins/investigate_app/public/items/README.md diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/items/embeddable_item/register_embeddable_item.tsx new file mode 100644 index 000000000000..8507ec8944c7 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/items/embeddable_item/register_embeddable_item.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiFlexItem } from '@elastic/eui'; +import { css } from '@emotion/css'; +import { ReactEmbeddableRenderer } from '@kbn/embeddable-plugin/public'; +import type { GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; +import React, { useMemo, useRef } from 'react'; +import { Options } from '../register_items'; + +export const EMBEDDABLE_ITEM_TYPE = 'embeddable'; + +const embeddableClassName = css` + height: 100%; + > [data-shared-item] { + height: 100%; + } +`; + +type Props = EmbeddableItemParams & GlobalWidgetParameters; + +type ParentApi = ReturnType['getParentApi']>; + +function ReactEmbeddable({ type, config, timeRange: { from, to }, savedObjectId }: Props) { + const configWithOverrides = useMemo(() => { + return { + ...config, + timeRange: { + from, + to, + }, + savedObjectId, + }; + }, [config, from, to, savedObjectId]); + + const configWithOverridesRef = useRef(configWithOverrides); + + configWithOverridesRef.current = configWithOverrides; + + const api = useMemo(() => { + return { + getSerializedStateForChild: () => ({ rawState: configWithOverridesRef.current }), + }; + }, []); + + return ( +
+ api} + maybeId={savedObjectId} + hidePanelChrome + /> +
+ ); +} + +interface EmbeddableItemParams { + type: string; + config: Record; + savedObjectId?: string; +} + +export function registerEmbeddableItem({ + dependencies: { + setup: { investigate }, + }, + services, +}: Options) { + investigate.registerItemDefinition({ + type: EMBEDDABLE_ITEM_TYPE, + generate: async (option: { + itemParams: EmbeddableItemParams; + globalParams: GlobalWidgetParameters; + }) => { + return {}; + }, + render: (option: { + itemParams: EmbeddableItemParams; + globalParams: GlobalWidgetParameters; + }) => { + const parameters = { + type: option.itemParams.type, + config: option.itemParams.config, + savedObjectId: option.itemParams.savedObjectId, + timeRange: option.globalParams.timeRange, + }; + + return ( + div { + height: 128px; + } + `} + > + + + ); + }, + }); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/get_date_histogram_results.ts b/x-pack/solutions/observability/plugins/investigate_app/public/items/esql_item/get_date_histogram_results.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/get_date_histogram_results.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/items/esql_item/get_date_histogram_results.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/items/esql_item/register_esql_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/items/esql_item/register_esql_item.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/items/esql_item/register_esql_item.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/items/lens_item/register_lens_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/items/lens_item/register_lens_item.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/items/lens_item/register_lens_item.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/items/register_items.ts b/x-pack/solutions/observability/plugins/investigate_app/public/items/register_items.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/items/register_items.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/items/register_items.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_from_library_button/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_from_library_button/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_from_library_button/index.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_from_library_button/index.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx index 0516bc7d9190..341b9d441cb6 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_investigation_item/add_investigation_item.tsx @@ -10,8 +10,8 @@ import { css } from '@emotion/css'; import { ESQLLangEditor } from '@kbn/esql/public'; import { i18n } from '@kbn/i18n'; import React from 'react'; -import { AddFromLibraryButton } from '../add_from_library_button'; import { useInvestigation } from '../../contexts/investigation_context'; +import { AddFromLibraryButton } from '../add_from_library_button'; import { EsqlWidgetPreview } from './esql_widget_preview'; const emptyPreview = css` diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/add_investigation_item/esql_widget_preview.tsx diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.tsx new file mode 100644 index 000000000000..57ced473922d --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/assistant_hypothesis/assistant_hypothesis.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { i18n } from '@kbn/i18n'; +import type { RootCauseAnalysisEvent } from '@kbn/observability-ai-server/root_cause_analysis'; +import { EcsFieldsResponse } from '@kbn/rule-registry-plugin/common'; +import { + ALERT_FLAPPING_HISTORY, + ALERT_RULE_EXECUTION_TIMESTAMP, + ALERT_RULE_EXECUTION_UUID, + EVENT_ACTION, + EVENT_KIND, +} from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names'; +import { isRequestAbortedError } from '@kbn/server-route-repository-client'; +import { omit } from 'lodash'; +import React, { useEffect, useRef, useState } from 'react'; +import { useKibana } from '../../../../hooks/use_kibana'; +import { useUpdateInvestigation } from '../../../../hooks/use_update_investigation'; +import { useInvestigation } from '../../contexts/investigation_context'; + +export interface InvestigationContextualInsight { + key: string; + description: string; + data: unknown; +} + +export function AssistantHypothesis() { + const { + alert, + globalParams: { timeRange }, + investigation, + } = useInvestigation(); + const { + core: { notifications }, + services: { investigateAppRepositoryClient }, + dependencies: { + start: { + observabilityAIAssistant: { useGenAIConnectors }, + observabilityAIAssistantApp: { RootCauseAnalysisContainer }, + }, + }, + } = useKibana(); + + const { mutateAsync: updateInvestigation } = useUpdateInvestigation(); + + const { loading: loadingConnector, selectedConnector } = useGenAIConnectors(); + + const serviceName = alert?.['service.name'] as string | undefined; + + const [events, setEvents] = useState([]); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(undefined); + + const controllerRef = useRef(new AbortController()); + + useEffect(() => { + if (investigation?.rootCauseAnalysis) { + setEvents(investigation.rootCauseAnalysis.events); + } + }, [investigation?.rootCauseAnalysis]); + + const [completeInBackground, setCompleteInBackground] = useState(true); + + const runRootCauseAnalysis = ({ + alert: nonNullishAlert, + connectorId, + serviceName: nonNullishServiceName, + }: { + alert: EcsFieldsResponse; + connectorId: string; + serviceName: string; + }) => { + const rangeFrom = timeRange.from; + + const rangeTo = timeRange.to; + + setLoading(true); + + setError(undefined); + + setEvents([]); + + investigateAppRepositoryClient + .stream('POST /internal/observability/investigation/root_cause_analysis', { + params: { + body: { + investigationId: investigation!.id, + connectorId, + context: `The user is investigating an alert for the ${serviceName} service, + and wants to find the root cause. Here is the alert: + + ${JSON.stringify(sanitizeAlert(nonNullishAlert))}`, + rangeFrom, + rangeTo, + serviceName: nonNullishServiceName, + completeInBackground, + }, + }, + signal: controllerRef.current.signal, + }) + .subscribe({ + next: (event) => { + setEvents((prev) => { + return prev.concat(event.event); + }); + }, + error: (nextError) => { + if (!isRequestAbortedError(nextError)) { + notifications.toasts.addError(nextError, { + title: i18n.translate( + 'xpack.investigateApp.assistantHypothesis.failedToLoadAnalysis', + { + defaultMessage: `Failed to load analysis`, + } + ), + }); + setError(nextError); + } else { + setError( + new Error( + i18n.translate('xpack.investigateApp.assistantHypothesis.analysisAborted', { + defaultMessage: `Analysis was aborted`, + }) + ) + ); + } + + setLoading(false); + }, + complete: () => { + setLoading(false); + }, + }); + }; + + if (!serviceName) { + return null; + } + + return ( + { + setCompleteInBackground(() => !completeInBackground); + }} + onStopAnalysisClick={() => { + controllerRef.current.abort(); + controllerRef.current = new AbortController(); + }} + onClearAnalysisClick={() => { + setEvents([]); + if (investigation?.rootCauseAnalysis) { + updateInvestigation({ + investigationId: investigation!.id, + payload: { + rootCauseAnalysis: { + events: [], + }, + }, + }); + } + }} + onResetAnalysisClick={() => { + controllerRef.current.abort(); + controllerRef.current = new AbortController(); + if (alert && selectedConnector && serviceName) { + runRootCauseAnalysis({ + alert, + connectorId: selectedConnector, + serviceName, + }); + } + }} + error={error} + onStartAnalysisClick={() => { + if (alert && selectedConnector && serviceName) { + runRootCauseAnalysis({ + alert, + connectorId: selectedConnector, + serviceName, + }); + } + }} + /> + ); +} + +function sanitizeAlert(alert: EcsFieldsResponse) { + return omit( + alert, + ALERT_RULE_EXECUTION_TIMESTAMP, + '_index', + ALERT_FLAPPING_HISTORY, + EVENT_ACTION, + EVENT_KIND, + ALERT_RULE_EXECUTION_UUID, + '@timestamp' + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.stories.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/grid_item/index.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/grid_item/index.stories.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/grid_item/index.stories.tsx diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/grid_item/index.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/grid_item/index.tsx new file mode 100644 index 000000000000..443190a7d16c --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/grid_item/index.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 { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiText } from '@elastic/eui'; +import { css } from '@emotion/css'; +import React from 'react'; +import { InvestigateTextButton } from '../../../../components/investigate_text_button'; +import { useTheme } from '../../../../hooks/use_theme'; + +export const GRID_ITEM_HEADER_HEIGHT = 40; + +interface GridItemProps { + id: string; + title: string; + children: React.ReactNode; + onCopy: () => void; + onDelete: () => void; + loading: boolean; +} + +const titleContainerClassName = css` + overflow: hidden; +`; +const titleItemClassName = css` + max-width: 100%; + .euiText { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +`; + +const panelClassName = css` + overflow-y: auto; +`; + +const panelContentClassName = css` + overflow-y: auto; + height: 100%; +`; + +export function GridItem({ id, title, children, onDelete, onCopy, loading }: GridItemProps) { + const theme = useTheme(); + + const headerClassName = css` + padding: 0 ${theme.size.s} 0 ${theme.size.s}}; +`; + + const containerClassName = css` + height: 100%; + max-width: 100%; + transition: opacity ${theme.animation.normal} ${theme.animation.resistance}; + overflow: auto; + `; + + return ( + + + + + + +
{title}
+
+
+ + + + { + onCopy(); + }} + disabled={loading} + /> + + + { + onDelete(); + }} + disabled={loading} + /> + + + +
+
+ {children} +
+
+ ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_details/index.stories.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx similarity index 96% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx index 5c9682348ee2..55b264eeb09e 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_details/investigation_details.tsx @@ -72,12 +72,11 @@ export function InvestigationDetails({ user }: Props) { ], }} > - - + + - - + diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/alert_details_button.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/alert_details_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/alert_details_button.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/alert_details_button.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/external_incident_button.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/external_incident_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/external_incident_button.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/external_incident_button.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/investigation_header.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/investigation_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_header/investigation_header.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_header/investigation_header.tsx diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items/investigation_items.tsx new file mode 100644 index 000000000000..8acc4831aa68 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items/investigation_items.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 { EuiFlexGroup } from '@elastic/eui'; +import React from 'react'; +import { AddInvestigationItem } from '../add_investigation_item/add_investigation_item'; +import { AssistantHypothesis } from '../assistant_hypothesis/assistant_hypothesis'; +import { InvestigationItemsList } from '../investigation_items_list/investigation_items_list'; +import { InvestigationTimeline } from '../investigation_timeline/investigation_timeline'; + +export function InvestigationItems() { + return ( + + + + + + + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx similarity index 95% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx index e65b29e2c376..227ea5f91b24 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_items_list/investigation_items_list.tsx @@ -18,7 +18,7 @@ export function InvestigationItemsList() { } return ( - + {renderableItems.map((item) => { return ( diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx similarity index 84% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx index ccf1f0ab20df..bd509fb26bc9 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/edit_note_form.tsx @@ -11,6 +11,7 @@ import { InvestigationNoteResponse } from '@kbn/investigation-shared'; import React, { useState } from 'react'; import { ResizableTextInput } from './resizable_text_input'; import { useInvestigation } from '../../contexts/investigation_context'; +import { useUpdateInvestigationNote } from '../../../../hooks/use_update_investigation_note'; interface Props { note: InvestigationNoteResponse; @@ -19,11 +20,22 @@ interface Props { export function EditNoteForm({ note, onClose }: Props) { const [noteInput, setNoteInput] = useState(note.content); - const { updateNote, isUpdatingNote } = useInvestigation(); + const { investigation } = useInvestigation(); + const { mutate: updateNote, isLoading: isUpdatingNote } = useUpdateInvestigationNote(); - const onUpdate = async () => { - await updateNote(note.id, noteInput.trim()); - onClose(); + const onUpdate = () => { + updateNote( + { + investigationId: investigation!.id, + noteId: note.id, + note: { content: noteInput.trim() }, + }, + { + onSuccess: () => { + onClose(); + }, + } + ); }; return ( diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx similarity index 85% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx index ec63b0935815..50ec61bc4555 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/investigation_notes.tsx @@ -18,6 +18,8 @@ import { i18n } from '@kbn/i18n'; import { InvestigationNoteResponse } from '@kbn/investigation-shared'; import { AuthenticatedUser } from '@kbn/security-plugin/common'; import React, { useState } from 'react'; +import { useAddInvestigationNote } from '../../../../hooks/use_add_investigation_note'; +import { useFetchInvestigationNotes } from '../../../../hooks/use_fetch_investigation_notes'; import { useFetchUserProfiles } from '../../../../hooks/use_fetch_user_profiles'; import { useTheme } from '../../../../hooks/use_theme'; import { useInvestigation } from '../../contexts/investigation_context'; @@ -30,15 +32,25 @@ export interface Props { export function InvestigationNotes({ user }: Props) { const theme = useTheme(); - const { investigation, addNote, isAddingNote } = useInvestigation(); + const { investigation } = useInvestigation(); + const { data: notes } = useFetchInvestigationNotes({ + investigationId: investigation!.id, + }); + const { mutate: addNote, isLoading: isAddingNote } = useAddInvestigationNote(); const { data: userProfiles, isLoading: isLoadingUserProfiles } = useFetchUserProfiles({ profileIds: new Set(investigation?.notes.map((note) => note.createdBy)), }); const [noteInput, setNoteInput] = useState(''); - const onAddNote = async (content: string) => { - await addNote(content); - setNoteInput(''); + const onAddNote = (content: string) => { + addNote( + { investigationId: investigation!.id, note: { content } }, + { + onSuccess: () => { + setNoteInput(''); + }, + } + ); }; const panelClassName = css` @@ -58,7 +70,7 @@ export function InvestigationNotes({ user }: Props) { - {investigation?.notes.map((currNote: InvestigationNoteResponse) => { + {notes?.map((currNote: InvestigationNoteResponse) => { return ( { + deleteNote({ investigationId: investigation!.id, noteId: note.id }); + }; const timelineContainerClassName = css` padding-bottom: 16px; @@ -98,7 +104,7 @@ export function Note({ note, isOwner, userProfile, userProfileLoading }: Props) iconSize="s" iconType="trash" disabled={isDeletingNote} - onClick={async () => await deleteNote(note.id)} + onClick={onDeleteNote} data-test-subj="deleteInvestigationNoteButton" className={actionButtonClassname} /> diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/resizable_text_input.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/resizable_text_input.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/investigation_notes/resizable_text_input.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_notes/resizable_text_input.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/alert_event.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/alert_event.tsx similarity index 80% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/alert_event.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/alert_event.tsx index 2e5ab220054e..4c39efd9019b 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/alert_event.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/alert_event.tsx @@ -5,13 +5,13 @@ * 2.0. */ -import { LineAnnotation, AnnotationDomainType } from '@elastic/charts'; +import { AnnotationDomainType, LineAnnotation } from '@elastic/charts'; import { EuiIcon } from '@elastic/eui'; -import React from 'react'; +import { AlertEventResponse } from '@kbn/investigation-shared'; import moment from 'moment'; -import { EventSchema } from '@kbn/investigation-shared'; +import React from 'react'; -export const AlertEvent = ({ event }: { event: EventSchema }) => { +export const AlertEvent = ({ event }: { event: AlertEventResponse }) => { return ( { + const { dependencies } = useKibana(); + const baseTheme = dependencies.start.charts.theme.useChartsBaseTheme(); + const { globalParams, updateInvestigationParams } = useInvestigation(); + const chartRef = useRef(null); + + const { data: events, isLoading } = useFetchEvents({ + rangeFrom: globalParams.timeRange.from, + rangeTo: globalParams.timeRange.to, + eventTypes, + }); + + const handleCursorUpdate = useActiveCursor(dependencies.start.charts.activeCursor, chartRef, { + isDateHistogram: true, + }); + + const data = useMemo(() => { + const points = [ + { x: moment(globalParams.timeRange.from).valueOf(), y: 0 }, + { x: moment(globalParams.timeRange.to).valueOf(), y: 0 }, + ]; + + // adding 100 fake points to the chart so the chart shows cursor on hover + for (let i = 0; i < 100; i++) { + const diff = + moment(globalParams.timeRange.to).valueOf() - moment(globalParams.timeRange.from).valueOf(); + points.push({ x: moment(globalParams.timeRange.from).valueOf() + (diff / 100) * i, y: 0 }); + } + return points; + }, [globalParams.timeRange.from, globalParams.timeRange.to]); + + if (isLoading) { + return ; + } + + return ( + + { + const { from, to } = getBrushData(brush); + updateInvestigationParams({ + timeRange: { from, to }, + }); + }} + /> + + moment(d).format('LTS')} + style={{ + tickLine: { + visible: true, + strokeWidth: 1, + stroke: '#98A2B3', + }, + }} + /> + + {events?.map((event) => { + if (event.eventType === 'alert') { + return ; + } + if (event.eventType === 'annotation') { + return ; + } + assertNever(event); + })} + + false} + /> + + ); +}; diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/timeline_theme.ts b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/timeline_theme.ts similarity index 94% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/timeline_theme.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/timeline_theme.ts index a1d7441fee53..21ad1240ca8e 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/components/events_timeline/timeline_theme.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/events_timeline/timeline_theme.ts @@ -7,7 +7,7 @@ import { PartialTheme } from '@elastic/charts'; -export const TIME_LINE_THEME: PartialTheme = { +export const TIMELINE_THEME: PartialTheme = { highlighter: { point: { opacity: 0, diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline.tsx new file mode 100644 index 000000000000..f02fde7d43fa --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline.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 { EuiFlexGroup, EuiPanel } from '@elastic/eui'; +import React, { useState } from 'react'; +import { EventsTimeline } from './events_timeline/events_timeline'; +import { InvestigationTimelineFilterBar } from './investigation_timeline_filter_bar/investigation_timeline_filter_bar'; + +export function InvestigationTimeline() { + const [eventTypes, setEventTypes] = useState([]); + + return ( + + + setEventTypes(selected)} + /> + + + + + ); +} diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_event_types_filter.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_event_types_filter.tsx new file mode 100644 index 000000000000..e66425f60d54 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_event_types_filter.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EuiFilterButton, + EuiFilterGroup, + EuiPopover, + EuiPopoverTitle, + EuiSelectable, + EuiSelectableOption, + useGeneratedHtmlId, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useState } from 'react'; + +interface Props { + onSelected: (eventTypes: string[]) => void; +} + +export function InvestigationEventTypesFilter({ onSelected }: Props) { + const [isPopoverOpen, setIsPopoverOpen] = useState(false); + const [items, setItems] = useState([ + { + key: 'alert', + label: i18n.translate('xpack.investigateApp.investigationEventTypesFilter.alertLabel', { + defaultMessage: 'Alert', + }), + checked: 'on', + }, + { + key: 'annotation', + label: i18n.translate('xpack.investigateApp.investigationEventTypesFilter.annotationLabel', { + defaultMessage: 'Annotation', + }), + checked: 'on', + }, + ]); + + const togglePopover = () => { + setIsPopoverOpen(!isPopoverOpen); + }; + const closePopover = () => { + setIsPopoverOpen(false); + }; + + const filterGroupPopoverId = useGeneratedHtmlId({ + prefix: 'filterGroupPopover', + }); + + const handleChange = (newOptions: EuiSelectableOption[]) => { + setItems(newOptions); + + const selected = newOptions + .filter((option) => option.checked === 'on') + .map((option) => option.key!); + onSelected(selected); + }; + + const button = ( + item.checked !== 'off').length} + hasActiveFilters={!!items.find((item) => item.checked === 'on')} + numActiveFilters={items.filter((item) => item.checked === 'on').length} + > + {i18n.translate( + 'xpack.investigateApp.investigationEventTypesFilter.filtersFilterButtonLabel', + { defaultMessage: 'Filters' } + )} + + ); + + return ( + + + + {(list) => ( +
+ + {i18n.translate( + 'xpack.investigateApp.investigationEventTypesFilter.filterEventTypePopoverTitleLabel', + { defaultMessage: 'Filter event type' } + )} + + {list} +
+ )} +
+
+
+ ); +} diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_timeline_filter_bar.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_timeline_filter_bar.tsx new file mode 100644 index 000000000000..16ecb2bd42a4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/components/investigation_timeline/investigation_timeline_filter_bar/investigation_timeline_filter_bar.tsx @@ -0,0 +1,71 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { EuiDatePicker, EuiDatePickerRange, EuiFlexGroup } from '@elastic/eui'; +import { css } from '@emotion/react'; +import moment from 'moment'; +import React from 'react'; +import { useInvestigation } from '../../../contexts/investigation_context'; +import { InvestigationEventTypesFilter } from './investigation_event_types_filter'; + +interface Props { + onEventTypesSelected: (eventTypes: string[]) => void; +} + +export function InvestigationTimelineFilterBar({ onEventTypesSelected }: Props) { + const { globalParams, updateInvestigationParams } = useInvestigation(); + + return ( + + + + { + if (!date) return; + + updateInvestigationParams({ + timeRange: { + from: date.toISOString(), + to: globalParams.timeRange.to, + }, + }); + }} + showTimeSelect + /> + } + endDateControl={ + { + if (!date) return; + + updateInvestigationParams({ + timeRange: { + from: globalParams.timeRange.from, + to: date.toISOString(), + }, + }); + }} + showTimeSelect + /> + } + /> + + ); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/contexts/investigation_context.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/contexts/investigation_context.tsx similarity index 77% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/contexts/investigation_context.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/contexts/investigation_context.tsx index ec571d0e2db8..f086e4866556 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/contexts/investigation_context.tsx +++ b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/contexts/investigation_context.tsx @@ -7,19 +7,16 @@ import { i18n } from '@kbn/i18n'; import { type GlobalWidgetParameters } from '@kbn/investigate-plugin/public'; -import { EcsFieldsResponse } from '@kbn/rule-registry-plugin/common'; import { GetInvestigationResponse, InvestigationItem, Item } from '@kbn/investigation-shared'; +import { EcsFieldsResponse } from '@kbn/rule-registry-plugin/common'; import { isEqual } from 'lodash'; import React, { createContext, useContext, useEffect, useRef, useState } from 'react'; import { useAddInvestigationItem } from '../../../hooks/use_add_investigation_item'; -import { useAddInvestigationNote } from '../../../hooks/use_add_investigation_note'; import { useDeleteInvestigationItem } from '../../../hooks/use_delete_investigation_item'; -import { useDeleteInvestigationNote } from '../../../hooks/use_delete_investigation_note'; -import { useFetchInvestigation } from '../../../hooks/use_fetch_investigation'; import { useFetchAlert } from '../../../hooks/use_fetch_alert'; +import { useFetchInvestigation } from '../../../hooks/use_fetch_investigation'; import { useKibana } from '../../../hooks/use_kibana'; import { useUpdateInvestigation } from '../../../hooks/use_update_investigation'; -import { useUpdateInvestigationNote } from '../../../hooks/use_update_investigation_note'; export type RenderedInvestigationItem = InvestigationItem & { loading: boolean; @@ -36,13 +33,6 @@ interface InvestigationContextProps { deleteItem: (itemId: string) => Promise; isAddingItem: boolean; isDeletingItem: boolean; - // note - addNote: (content: string) => Promise; - updateNote: (noteId: string, content: string) => Promise; - deleteNote: (noteId: string) => Promise; - isAddingNote: boolean; - isUpdatingNote: boolean; - isDeletingNote: boolean; } export const InvestigationContext = createContext({ @@ -54,13 +44,6 @@ export const InvestigationContext = createContext({ deleteItem: async () => {}, isAddingItem: false, isDeletingItem: false, - // note - addNote: async () => {}, - updateNote: async (noteId: string, content: string) => {}, - deleteNote: async (noteId: string) => {}, - isAddingNote: false, - isUpdatingNote: false, - isDeletingNote: false, }); export function useInvestigation() { @@ -90,32 +73,6 @@ export function InvestigationProvider({ Record >({}); - const { mutateAsync: addInvestigationNote, isLoading: isAddingNote } = useAddInvestigationNote(); - const { mutateAsync: updateInvestigationNote, isLoading: isUpdatingNote } = - useUpdateInvestigationNote(); - const { mutateAsync: deleteInvestigationNote, isLoading: isDeletingNote } = - useDeleteInvestigationNote(); - - const addNote = async (content: string) => { - await addInvestigationNote({ investigationId: initialInvestigation.id, note: { content } }); - refetch(); - }; - - const updateNote = async (noteId: string, content: string) => { - await updateInvestigationNote({ - investigationId: initialInvestigation.id, - noteId, - note: { content: content.trim() }, - }); - - refetch(); - }; - - const deleteNote = async (noteId: string) => { - await deleteInvestigationNote({ investigationId: initialInvestigation.id, noteId }); - refetch(); - }; - const { mutateAsync: updateInvestigation } = useUpdateInvestigation(); const { mutateAsync: addInvestigationItem, isLoading: isAddingItem } = useAddInvestigationItem(); const { mutateAsync: deleteInvestigationItem, isLoading: isDeletingItem } = @@ -221,12 +178,6 @@ export function InvestigationProvider({ deleteItem, isAddingItem, isDeletingItem, - addNote, - updateNote, - deleteNote, - isAddingNote, - isUpdatingNote, - isDeletingNote, }} > {children} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/investigation_details_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/investigation_details_page.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/investigation_details_page.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/details/types.ts b/x-pack/solutions/observability/plugins/investigate_app/public/pages/details/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/details/types.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/details/types.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_list.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_list.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_list.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_list_actions.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_list_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_list_actions.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_list_actions.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_stats.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_stats.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigation_stats.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigation_stats.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigations_error.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigations_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/investigations_error.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/investigations_error.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/search_bar.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/search_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/search_bar.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/search_bar.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/status_filter.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/status_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/status_filter.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/status_filter.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/tags_filter.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/tags_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/components/search_bar/tags_filter.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/components/search_bar/tags_filter.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/pages/list/investigation_list_page.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/pages/list/investigation_list_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/pages/list/investigation_list_page.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/pages/list/investigation_list_page.tsx diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/plugin.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/plugin.tsx new file mode 100644 index 000000000000..92c94cef9452 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/plugin.tsx @@ -0,0 +1,155 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + AppMountParameters, + AppStatus, + CoreSetup, + CoreStart, + DEFAULT_APP_CATEGORIES, + Plugin, + PluginInitializerContext, +} from '@kbn/core/public'; +import { INVESTIGATE_APP_ID } from '@kbn/deeplinks-observability/constants'; +import { i18n } from '@kbn/i18n'; +import type { Logger } from '@kbn/logging'; +import { once } from 'lodash'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import type { InvestigateAppServices } from './services/types'; +import type { + ConfigSchema, + InvestigateAppPublicSetup, + InvestigateAppPublicStart, + InvestigateAppSetupDependencies, + InvestigateAppStartDependencies, +} from './types'; +import { createInvestigateAppRepositoryClient, InvestigateAppRepositoryClient } from './api'; + +const getCreateEsqlService = once(() => import('./services/esql').then((m) => m.createEsqlService)); + +export class InvestigateAppPlugin + implements + Plugin< + InvestigateAppPublicSetup, + InvestigateAppPublicStart, + InvestigateAppSetupDependencies, + InvestigateAppStartDependencies + > +{ + logger: Logger; + config: ConfigSchema; + repositoryClient!: InvestigateAppRepositoryClient; + + constructor(context: PluginInitializerContext) { + this.logger = context.logger.get(); + this.config = context.config.get(); + } + + setup( + coreSetup: CoreSetup, + pluginsSetup: InvestigateAppSetupDependencies + ): InvestigateAppPublicSetup { + this.repositoryClient = createInvestigateAppRepositoryClient(coreSetup); + + coreSetup.application.register({ + id: INVESTIGATE_APP_ID, + title: i18n.translate('xpack.investigateApp.appTitle', { + defaultMessage: 'Investigations', + }), + euiIconType: 'logoObservability', + appRoute: '/app/investigations', + category: DEFAULT_APP_CATEGORIES.observability, + status: this.config.enabled ? AppStatus.accessible : AppStatus.inaccessible, + visibleIn: [], + deepLinks: [ + { + id: 'investigations', + title: i18n.translate('xpack.investigateApp.investigationsDeepLinkTitle', { + defaultMessage: 'All investigations', + }), + path: '/', + }, + { + id: 'investigationDetails', + title: i18n.translate('xpack.investigateApp.newInvestigateDeepLinkTitle', { + defaultMessage: 'New investigation', + }), + path: '/new', + }, + ], + mount: async (appMountParameters: AppMountParameters) => { + // Load application bundle and Get start services + const [{ Application }, [coreStart, pluginsStart], createEsqlService] = await Promise.all([ + import('./application'), + coreSetup.getStartServices(), + getCreateEsqlService(), + ]); + + const services: InvestigateAppServices = { + ...coreStart, + esql: createEsqlService({ + data: pluginsStart.data, + dataViews: pluginsStart.dataViews, + lens: pluginsStart.lens, + }), + charts: pluginsStart.charts, + investigateAppRepositoryClient: this.repositoryClient, + }; + + ReactDOM.render( + , + appMountParameters.element + ); + + return () => { + ReactDOM.unmountComponentAtNode(appMountParameters.element); + }; + }, + }); + + const pluginsStartPromise = coreSetup + .getStartServices() + .then(([, pluginsStart]) => pluginsStart); + + Promise.all([ + pluginsStartPromise, + import('./items/register_items').then((m) => m.registerItems), + getCreateEsqlService(), + ]).then(([pluginsStart, registerItems, createEsqlService]) => { + registerItems({ + dependencies: { + setup: pluginsSetup, + start: pluginsStart, + }, + services: { + investigateAppRepositoryClient: this.repositoryClient, + esql: createEsqlService({ + data: pluginsStart.data, + dataViews: pluginsStart.dataViews, + lens: pluginsStart.lens, + }), + charts: pluginsStart.charts, + }, + }); + }); + + return {}; + } + + start( + coreStart: CoreStart, + pluginsStart: InvestigateAppStartDependencies + ): InvestigateAppPublicStart { + return {}; + } +} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/routes/config.tsx b/x-pack/solutions/observability/plugins/investigate_app/public/routes/config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/routes/config.tsx rename to x-pack/solutions/observability/plugins/investigate_app/public/routes/config.tsx diff --git a/x-pack/plugins/observability_solution/investigate_app/public/services/esql.ts b/x-pack/solutions/observability/plugins/investigate_app/public/services/esql.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/services/esql.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/services/esql.ts diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/services/types.ts b/x-pack/solutions/observability/plugins/investigate_app/public/services/types.ts new file mode 100644 index 000000000000..04a2a7d063e9 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/services/types.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. + */ + +import { ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { EsqlService } from './esql'; +import type { InvestigateAppRepositoryClient } from '../api'; + +export interface InvestigateAppServices { + esql: EsqlService; + charts: ChartsPluginStart; + investigateAppRepositoryClient: InvestigateAppRepositoryClient; +} diff --git a/x-pack/solutions/observability/plugins/investigate_app/public/types.ts b/x-pack/solutions/observability/plugins/investigate_app/public/types.ts new file mode 100644 index 000000000000..da81bcdbc0c9 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/public/types.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import type { + ObservabilityAIAssistantPublicSetup, + ObservabilityAIAssistantPublicStart, +} from '@kbn/observability-ai-assistant-plugin/public'; +import type { + ObservabilityAIAssistantAppPublicSetup, + ObservabilityAIAssistantAppPublicStart, +} from '@kbn/observability-ai-assistant-app-plugin/public'; +import { ChartsPluginStart } from '@kbn/charts-plugin/public'; +import type { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; +import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { + DataViewsPublicPluginSetup, + DataViewsPublicPluginStart, +} from '@kbn/data-views-plugin/public'; +import type { + DatasetQualityPluginSetup, + DatasetQualityPluginStart, +} from '@kbn/dataset-quality-plugin/public'; +import type { EmbeddableSetup, EmbeddableStart } from '@kbn/embeddable-plugin/public'; +import type { + InvestigatePublicSetup, + InvestigatePublicStart, +} from '@kbn/investigate-plugin/public'; +import type { LensPublicSetup, LensPublicStart } from '@kbn/lens-plugin/public'; +import type { + ObservabilitySharedPluginSetup, + ObservabilitySharedPluginStart, +} from '@kbn/observability-shared-plugin/public'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/public'; +import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public'; + +/* eslint-disable @typescript-eslint/no-empty-interface*/ + +export interface ConfigSchema { + enabled: boolean; +} + +export interface InvestigateAppSetupDependencies { + investigate: InvestigatePublicSetup; + observabilityShared: ObservabilitySharedPluginSetup; + observabilityAIAssistant: ObservabilityAIAssistantPublicSetup; + observabilityAIAssistantApp: ObservabilityAIAssistantAppPublicSetup; + lens: LensPublicSetup; + dataViews: DataViewsPublicPluginSetup; + data: DataPublicPluginSetup; + embeddable: EmbeddableSetup; + contentManagement: {}; + datasetQuality: DatasetQualityPluginSetup; + unifiedSearch: {}; + uiActions: UiActionsSetup; + security: SecurityPluginSetup; +} + +export interface InvestigateAppStartDependencies { + investigate: InvestigatePublicStart; + observabilityShared: ObservabilitySharedPluginStart; + observabilityAIAssistant: ObservabilityAIAssistantPublicStart; + observabilityAIAssistantApp: ObservabilityAIAssistantAppPublicStart; + lens: LensPublicStart; + dataViews: DataViewsPublicPluginStart; + data: DataPublicPluginStart; + embeddable: EmbeddableStart; + contentManagement: ContentManagementPublicStart; + datasetQuality: DatasetQualityPluginStart; + unifiedSearch: UnifiedSearchPublicPluginStart; + uiActions: UiActionsStart; + security: SecurityPluginStart; + charts: ChartsPluginStart; +} + +export interface InvestigateAppPublicSetup {} + +export interface InvestigateAppPublicStart {} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/find_scrollable_parent.ts b/x-pack/solutions/observability/plugins/investigate_app/public/utils/find_scrollable_parent.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/utils/find_scrollable_parent.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/utils/find_scrollable_parent.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_data_table_from_esql_response.ts b/x-pack/solutions/observability/plugins/investigate_app/public/utils/get_data_table_from_esql_response.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/utils/get_data_table_from_esql_response.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/utils/get_data_table_from_esql_response.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_es_filter_from_overrides.ts b/x-pack/solutions/observability/plugins/investigate_app/public/utils/get_es_filter_from_overrides.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/utils/get_es_filter_from_overrides.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/utils/get_es_filter_from_overrides.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_kibana_columns.ts b/x-pack/solutions/observability/plugins/investigate_app/public/utils/get_kibana_columns.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/utils/get_kibana_columns.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/utils/get_kibana_columns.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts b/x-pack/solutions/observability/plugins/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts rename to x-pack/solutions/observability/plugins/investigate_app/public/utils/get_lens_attrs_for_suggestion.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/clients/create_entities_es_client.ts b/x-pack/solutions/observability/plugins/investigate_app/server/clients/create_entities_es_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/clients/create_entities_es_client.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/clients/create_entities_es_client.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/config.ts b/x-pack/solutions/observability/plugins/investigate_app/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/config.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/config.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/index.ts b/x-pack/solutions/observability/plugins/investigate_app/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/index.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/index.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/fetcher.test.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/fetcher.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/fetcher.test.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/fetcher.test.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/fetcher.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/fetcher.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/fetcher.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/fetcher.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/helpers/metrics.test.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/helpers/metrics.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/helpers/metrics.test.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/helpers/metrics.test.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/helpers/metrics.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/helpers/metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/helpers/metrics.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/helpers/metrics.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/register.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/register.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/register.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/register.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/type.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/type.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/collectors/type.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/collectors/type.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/get_document_categories.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/get_document_categories.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/get_document_categories.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/get_document_categories.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/get_sample_documents.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/get_sample_documents.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/get_sample_documents.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/get_sample_documents.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/lib/queries/index.ts b/x-pack/solutions/observability/plugins/investigate_app/server/lib/queries/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/lib/queries/index.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/lib/queries/index.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/models/investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/models/investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/models/investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/models/investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/models/investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/server/models/investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/models/investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/models/investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/models/investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/server/models/investigation_note.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/models/investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/models/investigation_note.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/models/pagination.ts b/x-pack/solutions/observability/plugins/investigate_app/server/models/pagination.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/models/pagination.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/models/pagination.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/plugin.ts b/x-pack/solutions/observability/plugins/investigate_app/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/plugin.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/routes/create_investigate_app_server_route.ts b/x-pack/solutions/observability/plugins/investigate_app/server/routes/create_investigate_app_server_route.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/routes/create_investigate_app_server_route.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/routes/create_investigate_app_server_route.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts b/x-pack/solutions/observability/plugins/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts similarity index 97% rename from x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts index 494e13efcba9..397401803382 100644 --- a/x-pack/plugins/observability_solution/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts +++ b/x-pack/solutions/observability/plugins/investigate_app/server/routes/get_global_investigate_app_server_route_repository.ts @@ -6,6 +6,8 @@ */ import { + GetEntitiesResponse, + GetEventsResponse, createInvestigationItemParamsSchema, createInvestigationNoteParamsSchema, createInvestigationParamsSchema, @@ -15,18 +17,17 @@ import { findInvestigationsParamsSchema, getAllInvestigationStatsParamsSchema, getAllInvestigationTagsParamsSchema, + getEntitiesParamsSchema, + getEventsParamsSchema, getInvestigationItemsParamsSchema, getInvestigationNotesParamsSchema, getInvestigationParamsSchema, updateInvestigationItemParamsSchema, updateInvestigationNoteParamsSchema, updateInvestigationParamsSchema, - getEventsParamsSchema, - GetEventsResponse, - getEntitiesParamsSchema, - GetEntitiesResponse, } from '@kbn/investigation-shared'; import { ScopedAnnotationsClient } from '@kbn/observability-plugin/server'; +import { createEntitiesESClient } from '../clients/create_entities_es_client'; import { createInvestigation } from '../services/create_investigation'; import { createInvestigationItem } from '../services/create_investigation_item'; import { createInvestigationNote } from '../services/create_investigation_note'; @@ -34,20 +35,20 @@ import { deleteInvestigation } from '../services/delete_investigation'; import { deleteInvestigationItem } from '../services/delete_investigation_item'; import { deleteInvestigationNote } from '../services/delete_investigation_note'; import { findInvestigations } from '../services/find_investigations'; +import { AlertsClient, getAlertsClient } from '../services/get_alerts_client'; +import { getAllInvestigationStats } from '../services/get_all_investigation_stats'; import { getAllInvestigationTags } from '../services/get_all_investigation_tags'; +import { getEntitiesWithSource } from '../services/get_entities'; +import { getAlertEvents, getAnnotationEvents } from '../services/get_events'; import { getInvestigation } from '../services/get_investigation'; import { getInvestigationItems } from '../services/get_investigation_items'; import { getInvestigationNotes } from '../services/get_investigation_notes'; import { investigationRepositoryFactory } from '../services/investigation_repository'; import { updateInvestigation } from '../services/update_investigation'; -import { getAlertEvents, getAnnotationEvents } from '../services/get_events'; -import { AlertsClient, getAlertsClient } from '../services/get_alerts_client'; import { updateInvestigationItem } from '../services/update_investigation_item'; import { updateInvestigationNote } from '../services/update_investigation_note'; import { createInvestigateAppServerRoute } from './create_investigate_app_server_route'; -import { getAllInvestigationStats } from '../services/get_all_investigation_stats'; -import { getEntitiesWithSource } from '../services/get_entities'; -import { createEntitiesESClient } from '../clients/create_entities_es_client'; +import { rootCauseAnalysisRoute } from './rca/route'; const createInvestigationRoute = createInvestigateAppServerRoute({ endpoint: 'POST /api/observability/investigations 2023-10-31', @@ -334,12 +335,17 @@ const getEventsRoute = createInvestigateAppServerRoute({ const alertsClient: AlertsClient = await getAlertsClient({ plugins, request }); const events: GetEventsResponse = []; - if (annotationsClient) { + const includeAllEventTypes = !params?.query?.eventTypes || params.query.eventTypes.length === 0; + + if ( + annotationsClient && + (includeAllEventTypes || params?.query?.eventTypes?.includes('annotation')) + ) { const annotationEvents = await getAnnotationEvents(params?.query ?? {}, annotationsClient); events.push(...annotationEvents); } - if (alertsClient) { + if (alertsClient && (includeAllEventTypes || params?.query?.eventTypes?.includes('alert'))) { const alertEvents = await getAlertEvents(params?.query ?? {}, alertsClient); events.push(...alertEvents); } @@ -400,6 +406,7 @@ export function getGlobalInvestigateAppServerRouteRepository() { ...getEntitiesRoute, ...getAllInvestigationStatsRoute, ...getAllInvestigationTagsRoute, + ...rootCauseAnalysisRoute, }; } diff --git a/x-pack/solutions/observability/plugins/investigate_app/server/routes/rca/route.ts b/x-pack/solutions/observability/plugins/investigate_app/server/routes/rca/route.ts new file mode 100644 index 000000000000..c4b71d7faa4b --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/server/routes/rca/route.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 { Observable, catchError, from, of, share, switchMap, toArray } from 'rxjs'; +import { ServerSentEventBase } from '@kbn/sse-utils'; +import { + RootCauseAnalysisEvent, + runRootCauseAnalysis, +} from '@kbn/observability-ai-server/root_cause_analysis'; +import { z } from '@kbn/zod'; +import datemath from '@elastic/datemath'; +import { OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID } from '@kbn/management-settings-ids'; +import { createObservabilityEsClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { preconditionFailed } from '@hapi/boom'; +import { createInvestigateAppServerRoute } from '../create_investigate_app_server_route'; +import { investigationRepositoryFactory } from '../../services/investigation_repository'; + +export const rootCauseAnalysisRoute = createInvestigateAppServerRoute({ + endpoint: 'POST /internal/observability/investigation/root_cause_analysis', + options: { + tags: [], + }, + params: z.object({ + body: z.object({ + investigationId: z.string(), + rangeFrom: z.string(), + rangeTo: z.string(), + serviceName: z.string(), + context: z.string(), + connectorId: z.string(), + completeInBackground: z.boolean().optional(), + }), + }), + handler: async ({ + params, + plugins, + request, + context: requestContext, + logger, + }): Promise>> => { + const { + body: { + investigationId, + context, + rangeFrom, + rangeTo, + serviceName, + connectorId, + completeInBackground, + }, + } = params; + + if (!plugins.observabilityAIAssistant) { + throw preconditionFailed('Observability AI Assistant plugin is not available'); + } + + const start = datemath.parse(rangeFrom)?.valueOf()!; + const end = datemath.parse(rangeTo)?.valueOf()!; + + const coreContext = await requestContext.core; + + const coreEsClient = coreContext.elasticsearch.client.asCurrentUser; + const soClient = coreContext.savedObjects.client; + const uiSettingsClient = coreContext.uiSettings.client; + + const repository = investigationRepositoryFactory({ soClient, logger }); + + const esClient = createObservabilityEsClient({ + client: coreEsClient, + logger, + plugin: 'investigateApp', + }); + + const [ + investigation, + rulesClient, + alertsClient, + inferenceClient, + observabilityAIAssistantClient, + spaceId = 'default', + apmIndices, + logSources, + sloSummaryIndices, + ] = await Promise.all([ + repository.findById(investigationId), + (await plugins.alerting.start()).getRulesClientWithRequest(request), + (await plugins.ruleRegistry.start()).getRacClientWithRequest(request), + (await plugins.inference.start()).getClient({ request }), + plugins + .observabilityAIAssistant!.start() + .then((observabilityAIAssistantStart) => + observabilityAIAssistantStart.service.getClient({ request, scopes: ['observability'] }) + ), + (await plugins.spaces?.start())?.spacesService.getSpaceId(request), + plugins.apmDataAccess.setup.getApmIndices(soClient), + uiSettingsClient.get(OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID) as Promise, + (await plugins.slo.start()).getSloClientWithRequest(request).getSummaryIndices(), + ]); + + const next$ = runRootCauseAnalysis({ + alertsClient, + connectorId, + start, + end, + esClient, + inferenceClient, + indices: { + logs: logSources, + traces: [apmIndices.span, apmIndices.error, apmIndices.transaction], + sloSummaries: sloSummaryIndices, + }, + rulesClient, + observabilityAIAssistantClient, + serviceName, + spaceId, + context, + logger, + }).pipe( + switchMap((event) => { + return of({ + type: 'event' as const, + event, + }); + }) + ); + + if (completeInBackground) { + const shared$ = next$.pipe(share()); + + shared$ + .pipe( + toArray(), + catchError(() => { + return of(); + }), + switchMap((events) => { + return from( + repository.save({ + ...investigation, + rootCauseAnalysis: { + events: events.map(({ event }) => event), + }, + }) + ); + }) + ) + .subscribe({ + error: (error) => { + logger.error(`Failed to update investigation: ${error.message}`); + logger.error(error); + }, + }); + + return shared$; + } + + return next$; + }, +}); diff --git a/x-pack/plugins/observability_solution/investigate_app/server/routes/register_routes.ts b/x-pack/solutions/observability/plugins/investigate_app/server/routes/register_routes.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/routes/register_routes.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/routes/register_routes.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/routes/types.ts b/x-pack/solutions/observability/plugins/investigate_app/server/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/routes/types.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/routes/types.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/saved_objects/investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/saved_objects/investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/saved_objects/investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/saved_objects/investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation_note.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/create_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/create_investigation_note.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation_note.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/delete_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/delete_investigation_note.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/find_investigations.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/find_investigations.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/find_investigations.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/find_investigations.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_alerts_client.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_alerts_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_alerts_client.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_alerts_client.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_all_investigation_stats.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_all_investigation_stats.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_all_investigation_stats.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_all_investigation_stats.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_all_investigation_tags.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_all_investigation_tags.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_all_investigation_tags.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_all_investigation_tags.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_entities.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_entities.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_entities.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_entities.ts diff --git a/x-pack/solutions/observability/plugins/investigate_app/server/services/get_events.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_events.ts new file mode 100644 index 000000000000..3cf87dc54b87 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_events.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import datemath from '@elastic/datemath'; +import { + AlertEventResponse, + AnnotationEventResponse, + GetEventsParams, + alertEventSchema, + annotationEventSchema, +} from '@kbn/investigation-shared'; +import { ScopedAnnotationsClient } from '@kbn/observability-plugin/server'; +import { + ALERT_REASON, + ALERT_RULE_CATEGORY, + ALERT_START, + ALERT_STATUS, + ALERT_UUID, +} from '@kbn/rule-data-utils'; +import { rangeQuery } from '../lib/queries'; +import { AlertsClient } from './get_alerts_client'; + +export async function getAnnotationEvents( + params: GetEventsParams, + annotationsClient: ScopedAnnotationsClient +): Promise { + const response = await annotationsClient.find({ + start: params?.rangeFrom, + end: params?.rangeTo, + filter: params?.filter, + size: 100, + }); + + // we will return only "point_in_time" annotations + const events = response.items + .filter((item) => !item.event?.end) + .map((item) => { + const hostName = item.host?.name; + const serviceName = item.service?.name; + const serviceVersion = item.service?.version; + const sloId = item.slo?.id; + const sloInstanceId = item.slo?.instanceId; + + return { + id: item.id, + title: item.annotation.title, + description: item.message, + timestamp: new Date(item['@timestamp']).getTime(), + eventType: 'annotation', + annotationType: item.annotation.type, + source: { + ...(hostName ? { 'host.name': hostName } : undefined), + ...(serviceName ? { 'service.name': serviceName } : undefined), + ...(serviceVersion ? { 'service.version': serviceVersion } : undefined), + ...(sloId ? { 'slo.id': sloId } : undefined), + ...(sloInstanceId ? { 'slo.instanceId': sloInstanceId } : undefined), + }, + }; + }); + + return annotationEventSchema.array().parse(events); +} + +export async function getAlertEvents( + params: GetEventsParams, + alertsClient: AlertsClient +): Promise { + const startInMs = datemath.parse(params?.rangeFrom ?? 'now-15m')!.valueOf(); + const endInMs = datemath.parse(params?.rangeTo ?? 'now')!.valueOf(); + const filterJSON = params?.filter ? JSON.parse(params.filter) : {}; + + const body = { + size: 100, + track_total_hits: false, + query: { + bool: { + filter: [ + ...rangeQuery(startInMs, endInMs, ALERT_START), + ...Object.keys(filterJSON).map((filterKey) => ({ + term: { [filterKey]: filterJSON[filterKey] }, + })), + ], + }, + }, + }; + + const response = await alertsClient.search(body); + + const events = response.hits.hits.map((hit) => { + const _source = hit._source; + + return { + id: _source[ALERT_UUID], + title: `${_source[ALERT_RULE_CATEGORY]} breached`, + description: _source[ALERT_REASON], + timestamp: new Date(_source[ALERT_START] as string).getTime(), + eventType: 'alert', + alertStatus: _source[ALERT_STATUS], + }; + }); + + return alertEventSchema.array().parse(events); +} diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation_items.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation_items.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation_items.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation_items.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation_notes.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation_notes.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/get_investigation_notes.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/get_investigation_notes.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/investigation_repository.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/investigation_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/investigation_repository.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/investigation_repository.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_item.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_item.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_note.ts b/x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation_note.ts similarity index 100% rename from x-pack/plugins/observability_solution/investigate_app/server/services/update_investigation_note.ts rename to x-pack/solutions/observability/plugins/investigate_app/server/services/update_investigation_note.ts diff --git a/x-pack/solutions/observability/plugins/investigate_app/server/types.ts b/x-pack/solutions/observability/plugins/investigate_app/server/types.ts new file mode 100644 index 000000000000..705339dfbf2e --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/server/types.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 { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; +import type { + RuleRegistryPluginSetupContract, + RuleRegistryPluginStartContract, +} from '@kbn/rule-registry-plugin/server'; +import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server/plugin'; +import type { SLOServerStart, SLOServerSetup } from '@kbn/slo-plugin/server'; +import type { InferenceServerStart, InferenceServerSetup } from '@kbn/inference-plugin/server'; +import type { SpacesPluginSetup, SpacesPluginStart } from '@kbn/spaces-plugin/server'; +import type { + ApmDataAccessPluginStart, + ApmDataAccessPluginSetup, +} from '@kbn/apm-data-access-plugin/server'; +import type { + ObservabilityAIAssistantServerStart, + ObservabilityAIAssistantServerSetup, +} from '@kbn/observability-ai-assistant-plugin/server'; +import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/server'; + +/* eslint-disable @typescript-eslint/no-empty-interface*/ + +export interface ConfigSchema {} + +export interface InvestigateAppSetupDependencies { + observability: ObservabilityPluginSetup; + ruleRegistry: RuleRegistryPluginSetupContract; + slo: SLOServerSetup; + alerting: AlertingServerSetup; + inference: InferenceServerSetup; + spaces?: SpacesPluginSetup; + apmDataAccess: ApmDataAccessPluginSetup; + observabilityAIAssistant?: ObservabilityAIAssistantServerSetup; + usageCollection: UsageCollectionSetup; +} + +export interface InvestigateAppStartDependencies { + ruleRegistry: RuleRegistryPluginStartContract; + slo: SLOServerStart; + alerting: AlertingServerStart; + inference: InferenceServerStart; + spaces?: SpacesPluginStart; + apmDataAccess: ApmDataAccessPluginStart; + observabilityAIAssistant?: ObservabilityAIAssistantServerStart; +} + +export interface InvestigateAppServerSetup {} + +export interface InvestigateAppServerStart {} diff --git a/x-pack/solutions/observability/plugins/investigate_app/tsconfig.json b/x-pack/solutions/observability/plugins/investigate_app/tsconfig.json new file mode 100644 index 000000000000..55e63cfdcf95 --- /dev/null +++ b/x-pack/solutions/observability/plugins/investigate_app/tsconfig.json @@ -0,0 +1,84 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../typings/**/*", + "common/**/*", + "public/**/*", + "typings/**/*", + "public/**/*.json", + "server/**/*", + ".storybook/**/*" + ], + "exclude": [ + "target/**/*", + ".storybook/**/*.js" + ], + "kbn_references": [ + "@kbn/alerting-plugin", + "@kbn/apm-data-access-plugin", + "@kbn/calculate-auto", + "@kbn/charts-plugin", + "@kbn/config-schema", + "@kbn/content-management-plugin", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-server", + "@kbn/core-security-common", + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/dataset-quality-plugin", + "@kbn/deeplinks-observability", + "@kbn/embeddable-plugin", + "@kbn/entities-schema", + "@kbn/es-query", + "@kbn/es-types", + "@kbn/esql-utils", + "@kbn/esql", + "@kbn/expressions-plugin", + "@kbn/field-types", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/inference-common", + "@kbn/inference-plugin", + "@kbn/investigate-plugin", + "@kbn/investigation-shared", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/lens-embeddable-utils", + "@kbn/lens-plugin", + "@kbn/licensing-plugin", + "@kbn/logging", + "@kbn/management-settings-ids", + "@kbn/ml-random-sampler-utils", + "@kbn/observability-ai-assistant-app-plugin", + "@kbn/observability-ai-assistant-plugin", + "@kbn/observability-ai-server", + "@kbn/observability-plugin", + "@kbn/observability-shared-plugin", + "@kbn/observability-utils-browser", + "@kbn/observability-utils-server", + "@kbn/presentation-containers", + "@kbn/react-kibana-context-theme", + "@kbn/rule-data-utils", + "@kbn/rule-registry-plugin", + "@kbn/saved-objects-finder-plugin", + "@kbn/security-plugin", + "@kbn/server-route-repository-client", + "@kbn/server-route-repository", + "@kbn/shared-ux-link-redirect-app", + "@kbn/shared-ux-router", + "@kbn/slo-plugin", + "@kbn/spaces-plugin", + "@kbn/sse-utils", + "@kbn/std", + "@kbn/ui-actions-plugin", + "@kbn/unified-search-plugin", + "@kbn/usage-collection-plugin", + "@kbn/utility-types-jest", + "@kbn/visualization-utils", + "@kbn/zod", + ], +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/observability/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/observability/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/main.js b/x-pack/solutions/observability/plugins/observability/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/main.js rename to x-pack/solutions/observability/plugins/observability/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/preview.js b/x-pack/solutions/observability/plugins/observability/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/.storybook/preview.js rename to x-pack/solutions/observability/plugins/observability/.storybook/preview.js diff --git a/x-pack/plugins/observability_solution/observability/README.md b/x-pack/solutions/observability/plugins/observability/README.md similarity index 100% rename from x-pack/plugins/observability_solution/observability/README.md rename to x-pack/solutions/observability/plugins/observability/README.md diff --git a/x-pack/plugins/observability_solution/observability/common/annotations.ts b/x-pack/solutions/observability/plugins/observability/common/annotations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/annotations.ts rename to x-pack/solutions/observability/plugins/observability/common/annotations.ts diff --git a/x-pack/plugins/observability_solution/observability/common/constants.ts b/x-pack/solutions/observability/plugins/observability/common/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/constants.ts rename to x-pack/solutions/observability/plugins/observability/common/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/color_palette.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/color_palette.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/color_palette.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/color_palette.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/bytes.test.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/bytes.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/bytes.test.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/bytes.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/bytes.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/bytes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/bytes.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/bytes.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/datetime.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/datetime.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/datetime.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/datetime.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/high_precision.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/high_precision.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/high_precision.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/high_precision.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/index.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/index.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/index.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/number.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/number.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/number.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/number.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/percent.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/percent.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/percent.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/percent.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/snapshot_metric_formats.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/snapshot_metric_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/snapshot_metric_formats.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/snapshot_metric_formats.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/types.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/formatters/types.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/formatters/types.ts diff --git a/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts new file mode 100644 index 000000000000..e275a89e18b3 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.test.ts @@ -0,0 +1,298 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { Aggregators } from './types'; +import { LocatorPublic } from '@kbn/share-plugin/common'; +import { LogsExplorerLocatorParams } from '@kbn/deeplinks-observability'; +import { getViewInAppUrl, GetViewInAppUrlArgs } from './get_view_in_app_url'; + +describe('getViewInAppUrl', () => { + const logsExplorerLocator = { + getRedirectUrl: jest.fn(() => 'mockedGetRedirectUrl'), + } as unknown as LocatorPublic; + const startedAt = '2023-12-07T16:30:15.403Z'; + const endedAt = '2023-12-07T20:30:15.403Z'; + const returnedTimeRange = { + // Duration 4 hour, time range will be extended it with 30 minutes from each side + from: '2023-12-07T16:00:15.403Z', + to: '2023-12-07T21:00:15.403Z', + }; + + beforeEach(() => { + jest.clearAllMocks(); + }); + + it('Should return empty string if logsExplorerLocator is not provided', () => { + const args: GetViewInAppUrlArgs = { + metrics: [], + startedAt, + endedAt, + }; + + expect(getViewInAppUrl(args)).toBe(''); + }); + + it('should call getRedirectUrl with data view, time range and filters', () => { + const args: GetViewInAppUrlArgs = { + metrics: [ + { + name: 'A', + aggType: Aggregators.COUNT, + filter: 'mockedCountFilter', + }, + ], + logsExplorerLocator, + startedAt, + endedAt, + searchConfiguration: { + index: {}, + query: { + language: '', + query: 'mockedFilter', + }, + }, + dataViewId: 'mockedDataViewId', + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: args.dataViewId, + timeRange: returnedTimeRange, + filters: [], + query: { + query: 'mockedFilter and mockedCountFilter', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with only count filter', () => { + const args: GetViewInAppUrlArgs = { + metrics: [ + { + name: 'A', + aggType: Aggregators.COUNT, + filter: 'mockedCountFilter', + }, + ], + logsExplorerLocator, + startedAt, + endedAt, + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [], + query: { + query: 'mockedCountFilter', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with only filter', () => { + const args: GetViewInAppUrlArgs = { + logsExplorerLocator, + startedAt, + endedAt, + searchConfiguration: { + index: {}, + query: { + language: '', + query: 'mockedFilter', + }, + }, + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [], + query: { + query: 'mockedFilter', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with empty query if metrics and filter are not not provided', () => { + const args: GetViewInAppUrlArgs = { + logsExplorerLocator, + startedAt, + endedAt, + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [], + query: { + query: '', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with empty if there are multiple metrics', () => { + const args: GetViewInAppUrlArgs = { + metrics: [ + { + name: 'A', + aggType: Aggregators.COUNT, + filter: 'mockedCountFilter', + }, + { + name: 'A', + aggType: Aggregators.AVERAGE, + field: 'mockedAvgField', + }, + ], + logsExplorerLocator, + startedAt, + endedAt, + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [], + query: { + query: '', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with filters if group and searchConfiguration filter are provided', () => { + const args: GetViewInAppUrlArgs = { + metrics: [ + { + name: 'A', + aggType: Aggregators.COUNT, + filter: 'mockedCountFilter', + }, + { + name: 'A', + aggType: Aggregators.AVERAGE, + field: 'mockedAvgField', + }, + ], + logsExplorerLocator, + startedAt, + endedAt, + searchConfiguration: { + index: {}, + query: { + language: '', + query: 'mockedFilter', + }, + filter: [ + { + meta: {}, + query: { + term: { + field: { + value: 'justTesting', + }, + }, + }, + }, + ], + }, + groups: [ + { + field: 'host.name', + value: 'host-1', + }, + ], + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [ + { + meta: {}, + query: { + term: { + field: { + value: 'justTesting', + }, + }, + }, + }, + { + meta: {}, + query: { + match_phrase: { + 'host.name': 'host-1', + }, + }, + }, + ], + query: { + query: 'mockedFilter', + language: 'kuery', + }, + }, + {} + ); + }); + + it('should call getRedirectUrl with spaceId', () => { + const spaceId = 'mockedSpaceId'; + const args: GetViewInAppUrlArgs = { + metrics: [ + { + name: 'A', + aggType: Aggregators.COUNT, + filter: 'mockedCountFilter', + }, + ], + logsExplorerLocator, + startedAt, + endedAt, + spaceId, + }; + + expect(getViewInAppUrl(args)).toBe('mockedGetRedirectUrl'); + expect(logsExplorerLocator.getRedirectUrl).toHaveBeenCalledWith( + { + dataset: undefined, + timeRange: returnedTimeRange, + filters: [], + query: { + query: 'mockedCountFilter', + language: 'kuery', + }, + }, + { spaceId } + ); + }); +}); diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.ts similarity index 90% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.ts index 5411eff43bc3..0d6095f6b520 100644 --- a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/get_view_in_app_url.ts +++ b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/get_view_in_app_url.ts @@ -22,6 +22,7 @@ export interface GetViewInAppUrlArgs { logsExplorerLocator?: LocatorPublic; metrics?: CustomThresholdExpressionMetric[]; startedAt?: string; + spaceId?: string; } export const getViewInAppUrl = ({ @@ -32,6 +33,7 @@ export const getViewInAppUrl = ({ metrics = [], searchConfiguration, startedAt = new Date().toISOString(), + spaceId, }: GetViewInAppUrlArgs) => { if (!logsExplorerLocator) return ''; @@ -56,10 +58,13 @@ export const getViewInAppUrl = ({ query.query = searchConfigurationQuery; } - return logsExplorerLocator?.getRedirectUrl({ - dataset, - timeRange, - query, - filters: [...searchConfigurationFilters, ...groupFilters], - }); + return logsExplorerLocator?.getRedirectUrl( + { + dataset, + timeRange, + query, + filters: [...searchConfigurationFilters, ...groupFilters], + }, + { spaceId } + ); }; diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.test.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.test.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/helpers/get_group.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/helpers/get_group.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/metric_value_formatter.test.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/metric_value_formatter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/metric_value_formatter.test.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/metric_value_formatter.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/metric_value_formatter.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/metric_value_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/metric_value_formatter.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/metric_value_formatter.ts diff --git a/x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/types.ts b/x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/custom_threshold_rule/types.ts rename to x-pack/solutions/observability/plugins/observability/common/custom_threshold_rule/types.ts diff --git a/x-pack/plugins/observability_solution/observability/common/guided_onboarding/kubernetes_guide_config.tsx b/x-pack/solutions/observability/plugins/observability/common/guided_onboarding/kubernetes_guide_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/guided_onboarding/kubernetes_guide_config.tsx rename to x-pack/solutions/observability/plugins/observability/common/guided_onboarding/kubernetes_guide_config.tsx diff --git a/x-pack/plugins/observability_solution/observability/common/i18n.ts b/x-pack/solutions/observability/plugins/observability/common/i18n.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/i18n.ts rename to x-pack/solutions/observability/plugins/observability/common/i18n.ts diff --git a/x-pack/plugins/observability_solution/observability/common/index.ts b/x-pack/solutions/observability/plugins/observability/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/index.ts rename to x-pack/solutions/observability/plugins/observability/common/index.ts diff --git a/x-pack/plugins/observability_solution/observability/common/locators/alerts.test.ts b/x-pack/solutions/observability/plugins/observability/common/locators/alerts.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/locators/alerts.test.ts rename to x-pack/solutions/observability/plugins/observability/common/locators/alerts.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/locators/alerts.ts b/x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/locators/alerts.ts rename to x-pack/solutions/observability/plugins/observability/common/locators/alerts.ts diff --git a/x-pack/plugins/observability_solution/observability/common/locators/paths.ts b/x-pack/solutions/observability/plugins/observability/common/locators/paths.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/locators/paths.ts rename to x-pack/solutions/observability/plugins/observability/common/locators/paths.ts diff --git a/x-pack/plugins/observability_solution/observability/common/processor_event.ts b/x-pack/solutions/observability/plugins/observability/common/processor_event.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/processor_event.ts rename to x-pack/solutions/observability/plugins/observability/common/processor_event.ts diff --git a/x-pack/plugins/observability_solution/observability/common/progressive_loading.ts b/x-pack/solutions/observability/plugins/observability/common/progressive_loading.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/progressive_loading.ts rename to x-pack/solutions/observability/plugins/observability/common/progressive_loading.ts diff --git a/x-pack/plugins/observability_solution/observability/common/typings.ts b/x-pack/solutions/observability/plugins/observability/common/typings.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/typings.ts rename to x-pack/solutions/observability/plugins/observability/common/typings.ts diff --git a/x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts b/x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/ui_settings_keys.ts rename to x-pack/solutions/observability/plugins/observability/common/ui_settings_keys.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts b/x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/alerting/alert_url.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/alerting/alert_url.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/alerting/get_related_alerts_query.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/alerting/get_related_alerts_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/alerting/get_related_alerts_query.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/alerting/get_related_alerts_query.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/alerting/get_related_alerts_query.ts b/x-pack/solutions/observability/plugins/observability/common/utils/alerting/get_related_alerts_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/alerting/get_related_alerts_query.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/alerting/get_related_alerts_query.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/alerting/types.ts b/x-pack/solutions/observability/plugins/observability/common/utils/alerting/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/alerting/types.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/alerting/types.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/array_union_to_callable.ts b/x-pack/solutions/observability/plugins/observability/common/utils/array_union_to_callable.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/array_union_to_callable.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/array_union_to_callable.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/as_mutable_array.ts b/x-pack/solutions/observability/plugins/observability/common/utils/as_mutable_array.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/as_mutable_array.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/as_mutable_array.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.ts b/x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/convert_legacy_outside_comparator.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/convert_legacy_outside_comparator.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/datetime.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/datetime.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/duration.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/duration.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/formatters.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/formatters.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/index.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/index.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/index.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/size.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/size.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/formatters/size.ts b/x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/formatters/size.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/formatters/size.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts b/x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/get_inspect_response.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/get_inspect_response.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/get_interval_in_seconds.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/get_interval_in_seconds.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/get_interval_in_seconds.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/get_interval_in_seconds.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/get_interval_in_seconds.ts b/x-pack/solutions/observability/plugins/observability/common/utils/get_interval_in_seconds.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/get_interval_in_seconds.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/get_interval_in_seconds.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/is_finite_number.ts b/x-pack/solutions/observability/plugins/observability/common/utils/is_finite_number.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/is_finite_number.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/is_finite_number.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/join_by_key/index.test.ts b/x-pack/solutions/observability/plugins/observability/common/utils/join_by_key/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/join_by_key/index.test.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/join_by_key/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/join_by_key/index.ts b/x-pack/solutions/observability/plugins/observability/common/utils/join_by_key/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/join_by_key/index.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/join_by_key/index.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/maybe.ts b/x-pack/solutions/observability/plugins/observability/common/utils/maybe.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/maybe.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/maybe.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/pick_keys.ts b/x-pack/solutions/observability/plugins/observability/common/utils/pick_keys.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/pick_keys.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/pick_keys.ts diff --git a/x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts b/x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/common/utils/unwrap_es_response.ts rename to x-pack/solutions/observability/plugins/observability/common/utils/unwrap_es_response.ts diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/custom_threshold.md b/x-pack/solutions/observability/plugins/observability/dev_docs/custom_threshold.md similarity index 77% rename from x-pack/plugins/observability_solution/observability/dev_docs/custom_threshold.md rename to x-pack/solutions/observability/plugins/observability/dev_docs/custom_threshold.md index cdf986adb621..e8ec5dbbaa05 100644 --- a/x-pack/plugins/observability_solution/observability/dev_docs/custom_threshold.md +++ b/x-pack/solutions/observability/plugins/observability/dev_docs/custom_threshold.md @@ -7,7 +7,7 @@ Custom threshold rule is GA since 8.13. ### With data forge > [!TIP] -> The following commands uses [kbn-data-forge](../../../../packages/kbn-data-forge/README.md) to generate some data for testing Custom threshold rule. +> The following commands uses [kbn-data-forge](../../../../../platform/packages/shared/kbn-data-forge/README.md) to generate some data for testing Custom threshold rule. Basic command to generate host data for 7 hosts: ```sh @@ -33,7 +33,7 @@ Get help with the data forge tool: `node x-pack/scripts/data_forge.js --help` ### With synthtrace > [!TIP] -> The following commands uses [kbn-apm-synthtrace](../../../../packages/kbn-apm-synthtrace) to generate some data for testing Custom threshold rule. +> The following commands uses [kbn-apm-synthtrace](../../../../../packages/kbn-apm-synthtrace) to generate some data for testing Custom threshold rule. Basic command to generate APM data for 3 services: ```sh diff --git a/x-pack/solutions/observability/plugins/observability/dev_docs/feature_flags.md b/x-pack/solutions/observability/plugins/observability/dev_docs/feature_flags.md new file mode 100644 index 000000000000..3b06f83096df --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/dev_docs/feature_flags.md @@ -0,0 +1,16 @@ +## Feature flags and advanced settings + +To set up a flagged feature or other advanced setting, add the name of the feature key (`observability:myFeature`) to [common/ui_settings_keys.ts](../common/ui_settings_keys.ts) and the feature parameters to [server/ui_settings.ts](../server/ui_settings.ts). + +Test for the feature like: + +```js +import { myFeatureEnabled } from '../ui_settings_keys'; +if (core.uiSettings.get(myFeatureEnabled)) { + doStuff(); +} +``` + +In order for telemetry to be collected, the keys and types need to be added in [src/plugins/kibana_usage_collection/server/collectors/management/schema.ts](../../../../../src/plugins/kibana_usage_collection/server/collectors/management/schema.ts) and [src/plugins/kibana_usage_collection/server/collectors/management/types.ts](../../../../src/plugins/kibana_usage_collection/server/collectors/management/types.ts). + +Settings can be managed in Kibana under Stack Management > Advanced Settings > Observability. diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/images/data_forge_custom_threshold_rule_cpu.png b/x-pack/solutions/observability/plugins/observability/dev_docs/images/data_forge_custom_threshold_rule_cpu.png similarity index 100% rename from x-pack/plugins/observability_solution/observability/dev_docs/images/data_forge_custom_threshold_rule_cpu.png rename to x-pack/solutions/observability/plugins/observability/dev_docs/images/data_forge_custom_threshold_rule_cpu.png diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/images/data_forge_data_view.png b/x-pack/solutions/observability/plugins/observability/dev_docs/images/data_forge_data_view.png similarity index 100% rename from x-pack/plugins/observability_solution/observability/dev_docs/images/data_forge_data_view.png rename to x-pack/solutions/observability/plugins/observability/dev_docs/images/data_forge_data_view.png diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/images/synthtrace_custom_threshold_rule.png b/x-pack/solutions/observability/plugins/observability/dev_docs/images/synthtrace_custom_threshold_rule.png similarity index 100% rename from x-pack/plugins/observability_solution/observability/dev_docs/images/synthtrace_custom_threshold_rule.png rename to x-pack/solutions/observability/plugins/observability/dev_docs/images/synthtrace_custom_threshold_rule.png diff --git a/x-pack/plugins/observability_solution/observability/dev_docs/images/synthtrace_data_view.png b/x-pack/solutions/observability/plugins/observability/dev_docs/images/synthtrace_data_view.png similarity index 100% rename from x-pack/plugins/observability_solution/observability/dev_docs/images/synthtrace_data_view.png rename to x-pack/solutions/observability/plugins/observability/dev_docs/images/synthtrace_data_view.png diff --git a/x-pack/solutions/observability/plugins/observability/jest.config.js b/x-pack/solutions/observability/plugins/observability/jest.config.js new file mode 100644 index 000000000000..e79375a9219a --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/observability'], + setupFiles: [ + '/x-pack/solutions/observability/plugins/observability/.storybook/jest_setup.js', + ], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/observability', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/observability/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/observability/kibana.jsonc b/x-pack/solutions/observability/plugins/observability/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/observability/kibana.jsonc rename to x-pack/solutions/observability/plugins/observability/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/observability/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/application/application.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/application/application.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/application/hideable_react_query_dev_tools.tsx b/x-pack/solutions/observability/plugins/observability/public/application/hideable_react_query_dev_tools.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/application/hideable_react_query_dev_tools.tsx rename to x-pack/solutions/observability/plugins/observability/public/application/hideable_react_query_dev_tools.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/application/index.tsx b/x-pack/solutions/observability/plugins/observability/public/application/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/application/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/application/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/assets/illustration_dark.svg b/x-pack/solutions/observability/plugins/observability/public/assets/illustration_dark.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/illustration_dark.svg rename to x-pack/solutions/observability/plugins/observability/public/assets/illustration_dark.svg diff --git a/x-pack/plugins/observability_solution/observability/public/assets/illustration_light.svg b/x-pack/solutions/observability/plugins/observability/public/assets/illustration_light.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/illustration_light.svg rename to x-pack/solutions/observability/plugins/observability/public/assets/illustration_light.svg diff --git a/x-pack/plugins/observability_solution/observability/public/assets/kibana_dashboard_dark.svg b/x-pack/solutions/observability/plugins/observability/public/assets/kibana_dashboard_dark.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/kibana_dashboard_dark.svg rename to x-pack/solutions/observability/plugins/observability/public/assets/kibana_dashboard_dark.svg diff --git a/x-pack/plugins/observability_solution/observability/public/assets/kibana_dashboard_light.svg b/x-pack/solutions/observability/plugins/observability/public/assets/kibana_dashboard_light.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/kibana_dashboard_light.svg rename to x-pack/solutions/observability/plugins/observability/public/assets/kibana_dashboard_light.svg diff --git a/x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_alerts.gif b/x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_alerts.gif similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_alerts.gif rename to x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_alerts.gif diff --git a/x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_logs.gif b/x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_logs.gif similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_logs.gif rename to x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_logs.gif diff --git a/x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_metrics.gif b/x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_metrics.gif similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_metrics.gif rename to x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_metrics.gif diff --git a/x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_services.gif b/x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_services.gif similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/assets/onboarding_tour_step_services.gif rename to x-pack/solutions/observability/plugins/observability/public/assets/onboarding_tour_step_services.gif diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/alert_overview.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/alert_overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/alert_overview.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/alert_overview.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/format_cases.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/format_cases.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/format_cases.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/format_cases.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/is_fields_same_type.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/is_fields_same_type.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/is_fields_same_type.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/is_fields_same_type.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/helpers/map_rules_params_with_flyout.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_overview/overview_columns.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_overview/overview_columns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_overview/overview_columns.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_overview/overview_columns.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar_with_url_sync.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar_with_url_sync.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/alert_search_bar_with_url_sync.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/alert_search_bar_with_url_sync.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/components/alerts_status_filter.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/components/alerts_status_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/components/alerts_status_filter.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/components/alerts_status_filter.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/components/index.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/components/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/components/index.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/components/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/constants.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/index.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/state_container.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/state_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/state_container.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/state_container.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/use_alert_search_bar_state_container.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/use_alert_search_bar_state_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/containers/use_alert_search_bar_state_container.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/containers/use_alert_search_bar_state_container.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/get_alert_search_bar_lazy.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/types.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_search_bar/types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_search_bar/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_severity_badge.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_severity_badge.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_severity_badge.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_severity_badge.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_severity_badge.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_severity_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_severity_badge.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_severity_badge.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_alert_source_links.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_alert_source_links.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_alert_source_links.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_alert_source_links.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_alert_source_links.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_alert_source_links.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_alert_source_links.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_alert_source_links.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_apm_app_url.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_apm_app_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_apm_app_url.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_apm_app_url.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_sources.ts b/x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_sources.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_sources/get_sources.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alert_sources/get_sources.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_sources/groups.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_sources/groups.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_sources/groups.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_sources/groups.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alert_status_indicator.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alert_status_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alert_status_indicator.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alert_status_indicator.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.mock.ts b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_body.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_body.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_body.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_body.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_body.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_body.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_body.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_body.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_footer.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_footer.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_footer.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_footer.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_header.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/alerts_flyout_header.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/alerts_flyout_header.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/use_get_alert_flyout_components.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/use_get_alert_flyout_components.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_flyout/use_get_alert_flyout_components.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_flyout/use_get_alert_flyout_components.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/alerts/get_alerts_page_table_configuration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/alerts/get_alerts_page_table_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/alerts/get_alerts_page_table_configuration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/alerts/get_alerts_page_table_configuration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/alerts/get_persistent_controls.ts b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/alerts/get_persistent_controls.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/alerts/get_persistent_controls.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/alerts/get_persistent_controls.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/cell_tooltip.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_tooltip.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/cell_tooltip.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_tooltip.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/cell_tooltip.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/cell_tooltip.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/cell_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/get_columns.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/get_columns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/get_columns.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/get_columns.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/render_cell_value.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/render_cell_value.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/render_cell_value.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/render_cell_value.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/render_cell_value.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/render_cell_value.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/render_cell_value.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/render_cell_value.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/timestamp_tooltip.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/common/timestamp_tooltip.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/common/timestamp_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/constants.ts b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/get_aggregations_by_grouping_field.ts b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/get_aggregations_by_grouping_field.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/get_aggregations_by_grouping_field.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/get_aggregations_by_grouping_field.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/get_group_stats.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/get_group_stats.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/get_group_stats.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/get_group_stats.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/render_group_panel.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/render_group_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/grouping/render_group_panel.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/grouping/render_group_panel.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/observability/get_alerts_page_table_configuration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/observability/get_alerts_page_table_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/observability/get_alerts_page_table_configuration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/observability/get_alerts_page_table_configuration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/register_alerts_table_configuration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/register_alerts_table_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/register_alerts_table_configuration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/register_alerts_table_configuration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/rule_details/get_rule_details_table_configuration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/slo/default_columns.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/slo/default_columns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/slo/default_columns.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/slo/default_columns.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/slo/get_slo_alerts_table_configuration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/alerts_table/types.ts b/x-pack/solutions/observability/plugins/observability/public/components/alerts_table/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/alerts_table/types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/alerts_table/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/annotation_apearance.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/annotation_apearance.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/annotation_apearance.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/annotation_apearance.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/annotation_form.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/annotation_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/annotation_form.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/annotation_form.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_apply_to.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_apply_to.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_apply_to.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_apply_to.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_icon.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_icon.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_icon.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_range.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_range.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_range.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_range.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_tooltip.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotation_tooltip.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotation_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotations.scss b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotations.scss similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/annotations.scss rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/annotations.scss diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/delete_annotations.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/delete_annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/delete_annotations.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/delete_annotations.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/delete_annotations_modal.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/delete_annotations_modal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/delete_annotations_modal.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/delete_annotations_modal.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/field_selector.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/common/field_selector.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/common/field_selector.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/create_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/create_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/create_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/create_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/fill_option.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/fill_option.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/fill_option.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/fill_option.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/forward_refs.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/forward_refs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/forward_refs.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/forward_refs.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/index.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/new_line_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/new_line_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/new_line_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/new_line_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/new_rect_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/new_rect_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/new_rect_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/new_rect_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/obs_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/obs_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/obs_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/obs_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/observability_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/observability_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/observability_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/observability_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/service_apply_to.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/service_apply_to.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/service_apply_to.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/service_apply_to.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/slo_apply_to.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/slo_apply_to.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/slo_apply_to.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/slo_apply_to.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/slo_selector.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/slo_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/slo_selector.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/slo_selector.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/text_decoration.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/text_decoration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/text_decoration.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/text_decoration.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/components/timestamp_range_label.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/components/timestamp_range_label.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/components/timestamp_range_label.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/components/timestamp_range_label.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/default_annotation.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/default_annotation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/default_annotation.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/default_annotation.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/display_annotations.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/display_annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/display_annotations.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/display_annotations.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_annotation_cruds.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_annotation_cruds.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_annotation_cruds.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_annotation_cruds.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_annotation_permissions.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_annotation_permissions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_annotation_permissions.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_annotation_permissions.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_create_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_create_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_create_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_create_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_delete_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_delete_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_delete_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_delete_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_edit_annotation_helper.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_edit_annotation_helper.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_edit_annotation_helper.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_edit_annotation_helper.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_annotations.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_annotations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_annotations.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_annotations.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_apm_suggestions.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_apm_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_apm_suggestions.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_apm_suggestions.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_slo_list.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_slo_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_fetch_slo_list.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_fetch_slo_list.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_update_annotation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_update_annotation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/hooks/use_update_annotation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/hooks/use_update_annotation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/icon_set.ts b/x-pack/solutions/observability/plugins/observability/public/components/annotations/icon_set.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/icon_set.ts rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/icon_set.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx b/x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/annotations/use_annotations.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/annotations/use_annotations.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/center_justified_spinner.tsx b/x-pack/solutions/observability/plugins/observability/public/components/center_justified_spinner.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/center_justified_spinner.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/center_justified_spinner.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/__snapshots__/alert_details_app_section.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/alert_details_app_section.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/__snapshots__/log_rate_analysis_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/generate_chart_title_and_tooltip.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/generate_chart_title_and_tooltip.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/generate_chart_title_and_tooltip.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/generate_chart_title_and_tooltip.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/helpers/log_rate_analysis_query.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/alert_details_app_section/log_rate_analysis.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/closable_popover_title.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/closable_popover_title.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/closable_popover_title.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/closable_popover_title.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/closable_popover_title.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/closable_popover_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/closable_popover_title.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/closable_popover_title.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/criterion_preview_chart.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/criterion_preview_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/criterion_preview_chart.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/criterion_preview_chart.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/criterion_preview_chart/threshold_annotations.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/custom_equation_editor.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/index.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/metric_row_controls.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/metric_row_controls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/metric_row_controls.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/metric_row_controls.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/metric_row_with_agg.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/metric_row_with_agg.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/metric_row_with_agg.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/metric_row_with_agg.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/types.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_equation/types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_equation/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_threshold.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_threshold.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/custom_threshold.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/custom_threshold.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/expression_row.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/expression_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/expression_row.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/expression_row.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/expression_row.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/expression_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/expression_row.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/expression_row.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/group_by.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/group_by.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/group_by.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/group_by.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/threshold.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/threshold.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/triggers_actions_context.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/triggers_actions_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/triggers_actions_context.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/triggers_actions_context.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/types.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/validation.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/validation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/validation.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/validation.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/validation.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/validation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/components/validation.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/components/validation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/calculate_domain.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/calculate_domain.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/calculate_domain.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/calculate_domain.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/corrected_percent_convert.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/corrected_percent_convert.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/corrected_percent_convert.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/corrected_percent_convert.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/corrected_percent_convert.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/corrected_percent_convert.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/corrected_percent_convert.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/corrected_percent_convert.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/create_formatter_for_metric.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/create_formatter_for_metric.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/create_formatter_for_metric.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/create_formatter_for_metric.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/create_formatter_for_metrics.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/create_formatter_for_metrics.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/create_formatter_for_metrics.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/create_formatter_for_metrics.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/get_search_configuration.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/get_search_configuration.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/get_search_configuration.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/get_search_configuration.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/get_search_configuration.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/get_search_configuration.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/get_search_configuration.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/get_search_configuration.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/kuery.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/kuery.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/kuery.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/kuery.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/metric_to_format.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/metric_to_format.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/metric_to_format.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/metric_to_format.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/notifications.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/notifications.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/notifications.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/notifications.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/runtime_types.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/runtime_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/runtime_types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/runtime_types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/source_errors.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/source_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/source_errors.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/source_errors.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/threshold_unit.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/threshold_unit.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/threshold_unit.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/threshold_unit.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/threshold_unit.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/threshold_unit.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/helpers/threshold_unit.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/helpers/threshold_unit.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_kibana_time_zone_setting.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_kibana_time_zone_setting.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_kibana_time_zone_setting.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_kibana_time_zone_setting.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_kibana_timefilter_time.tsx b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_kibana_timefilter_time.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_kibana_timefilter_time.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_kibana_timefilter_time.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_metric_threshold_alert_prefill.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_metric_threshold_alert_prefill.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_metric_threshold_alert_prefill.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_metric_threshold_alert_prefill.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_tracked_promise.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_tracked_promise.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/hooks/use_tracked_promise.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/hooks/use_tracked_promise.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/i18n_strings.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/i18n_strings.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/i18n_strings.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/i18n_strings.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/mocks/custom_threshold_rule.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/mocks/custom_threshold_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/mocks/custom_threshold_rule.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/mocks/custom_threshold_rule.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/rule_data_formatters.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/rule_data_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/rule_data_formatters.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/rule_data_formatters.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts b/x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/custom_threshold/types.ts rename to x-pack/solutions/observability/plugins/observability/public/components/custom_threshold/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/experimental_badge.tsx b/x-pack/solutions/observability/plugins/observability/public/components/experimental_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/experimental_badge.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/experimental_badge.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/loading_observability.tsx b/x-pack/solutions/observability/plugins/observability/public/components/loading_observability.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/loading_observability.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/loading_observability.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/helpers.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/helpers.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/helpers.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/helpers.ts rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/helpers.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/index.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/painless_tinymath_parser.test.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/painless_tinymath_parser.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/painless_tinymath_parser.test.ts rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/painless_tinymath_parser.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/painless_tinymath_parser.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/painless_tinymath_parser.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/painless_tinymath_parser.ts rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/painless_tinymath_parser.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.test.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.tsx similarity index 97% rename from x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.tsx index 2a9fa2c29527..02dc7bc1f51d 100644 --- a/x-pack/plugins/observability_solution/observability/public/components/rule_condition_chart/rule_condition_chart.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/components/rule_condition_chart/rule_condition_chart.tsx @@ -138,19 +138,21 @@ export function RuleConditionChart({ const errorDiv = document.querySelector('.lnsEmbeddedError'); if (errorDiv) { const paragraphElements = errorDiv.querySelectorAll('p'); - if (!paragraphElements || paragraphElements.length < 2) return; + if (!paragraphElements) return; paragraphElements[0].innerText = i18n.translate( 'xpack.observability.ruleCondition.chart.error_equation.title', { defaultMessage: 'An error occurred while rendering the chart', } ); - paragraphElements[1].innerText = i18n.translate( - 'xpack.observability.ruleCondition.chart.error_equation.description', - { - defaultMessage: 'Check the rule equation.', - } - ); + if (paragraphElements.length > 1) { + paragraphElements[1].innerText = i18n.translate( + 'xpack.observability.ruleCondition.chart.error_equation.description', + { + defaultMessage: 'Check the rule equation.', + } + ); + } } }); }, [chartLoading, attributes]); diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/autocomplete_field.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/autocomplete_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/autocomplete_field.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/autocomplete_field.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/index.ts b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/index.ts rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/suggestion_item.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/suggestion_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/autocomplete_field/suggestion_item.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/autocomplete_field/suggestion_item.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/kuery_bar.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/kuery_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/kuery_bar.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/kuery_bar.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/with_kuery_autocompletion.tsx b/x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/with_kuery_autocompletion.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/rule_kql_filter/with_kuery_autocompletion.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/rule_kql_filter/with_kuery_autocompletion.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/components/tags.tsx b/x-pack/solutions/observability/plugins/observability/public/components/tags.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/components/tags.tsx rename to x-pack/solutions/observability/plugins/observability/public/components/tags.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/constants.ts b/x-pack/solutions/observability/plugins/observability/public/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/constants.ts b/x-pack/solutions/observability/plugins/observability/public/context/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/context/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/date_picker_context/date_picker_context.tsx b/x-pack/solutions/observability/plugins/observability/public/context/date_picker_context/date_picker_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/date_picker_context/date_picker_context.tsx rename to x-pack/solutions/observability/plugins/observability/public/context/date_picker_context/date_picker_context.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/data_handler.test.ts b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/data_handler.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/data_handler.test.ts rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/data_handler.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/data_handler.ts b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/data_handler.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/data_handler.ts rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/data_handler.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/get_observability_alerts.test.ts b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/get_observability_alerts.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/get_observability_alerts.test.ts rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/get_observability_alerts.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/get_observability_alerts.ts b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/get_observability_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/get_observability_alerts.ts rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/get_observability_alerts.ts diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/has_data_context.test.tsx b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/has_data_context.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/has_data_context.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/has_data_context.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/context/has_data_context/has_data_context.tsx b/x-pack/solutions/observability/plugins/observability/public/context/has_data_context/has_data_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/has_data_context/has_data_context.tsx rename to x-pack/solutions/observability/plugins/observability/public/context/has_data_context/has_data_context.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/context/plugin_context/plugin_context.tsx b/x-pack/solutions/observability/plugins/observability/public/context/plugin_context/plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/context/plugin_context/plugin_context.tsx rename to x-pack/solutions/observability/plugins/observability/public/context/plugin_context/plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/__storybook_mocks__/use_fetch_data_views.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/__storybook_mocks__/use_fetch_data_views.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/__storybook_mocks__/use_fetch_data_views.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/__storybook_mocks__/use_fetch_data_views.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/create_use_rules_link.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/create_use_rules_link.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/create_use_rules_link.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/create_use_rules_link.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_case_view_navigation.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_case_view_navigation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_case_view_navigation.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_case_view_navigation.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_chart_themes.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_chart_themes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_chart_themes.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_chart_themes.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_data_fetcher.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_data_fetcher.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_data_fetcher.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_data_fetcher.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_date_picker_context.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_date_picker_context.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_date_picker_context.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_date_picker_context.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_delete_rules.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_delete_rules.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_delete_rules.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_delete_rules.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_data.test.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_data.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_data.test.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_data.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_data.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_data.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_data.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_detail.test.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_detail.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_detail.test.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_detail.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_detail.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_detail.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_alert_detail.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_alert_detail.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_bulk_cases.test.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_bulk_cases.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_bulk_cases.test.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_bulk_cases.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_bulk_cases.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_bulk_cases.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_bulk_cases.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_bulk_cases.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_data_views.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_data_views.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_data_views.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_data_views.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_rule.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_rule.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_rule.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_rule_types.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_rule_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_fetch_rule_types.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_fetch_rule_types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_get_available_rules_with_descriptions.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_get_available_rules_with_descriptions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_get_available_rules_with_descriptions.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_get_available_rules_with_descriptions.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_get_filtered_rule_types.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_get_filtered_rule_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_get_filtered_rule_types.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_get_filtered_rule_types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_guided_setup_progress.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_guided_setup_progress.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_guided_setup_progress.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_guided_setup_progress.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_has_data.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_has_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_has_data.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_has_data.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_kibana_ui_settings.tsx b/x-pack/solutions/observability/plugins/observability/public/hooks/use_kibana_ui_settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_kibana_ui_settings.tsx rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_kibana_ui_settings.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_license.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_license.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_license.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_license.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_observability_onboarding.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_observability_onboarding.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_observability_onboarding.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_observability_onboarding.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_plugin_context.tsx b/x-pack/solutions/observability/plugins/observability/public/hooks/use_plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_plugin_context.tsx rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_summary_time_range.tsx b/x-pack/solutions/observability/plugins/observability/public/hooks/use_summary_time_range.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_summary_time_range.tsx rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_summary_time_range.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_time_buckets.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_time_buckets.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_time_buckets.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_time_buckets.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_timefilter_service.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_timefilter_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_timefilter_service.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_timefilter_service.ts diff --git a/x-pack/plugins/observability_solution/observability/public/hooks/use_toast.ts b/x-pack/solutions/observability/plugins/observability/public/hooks/use_toast.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/hooks/use_toast.ts rename to x-pack/solutions/observability/plugins/observability/public/hooks/use_toast.ts diff --git a/x-pack/solutions/observability/plugins/observability/public/index.ts b/x-pack/solutions/observability/plugins/observability/public/index.ts new file mode 100644 index 000000000000..fa0189dc1df1 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/public/index.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. + */ + +// TODO: https://github.com/elastic/kibana/issues/110905 + +import { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; +import { lazy } from 'react'; +import { + Plugin, + ObservabilityPublicPluginsStart, + ObservabilityPublicPluginsSetup, + ObservabilityPublicStart, + ObservabilityPublicSetup, +} from './plugin'; +export type { + ObservabilityPublicSetup, + ObservabilityPublicStart, + ObservabilityPublicPluginsSetup, + ObservabilityPublicPluginsStart, +}; +export const plugin: PluginInitializer< + ObservabilityPublicSetup, + ObservabilityPublicStart, + ObservabilityPublicPluginsSetup, + ObservabilityPublicPluginsStart +> = (initializerContext: PluginInitializerContext) => { + return new Plugin(initializerContext); +}; + +export type { ConfigSchema } from './plugin'; + +export { + enableLegacyUptimeApp, + syntheticsThrottlingEnabled, + enableInspectEsQueries, + enableComparisonByDefault, + apmServiceGroupMaxNumberOfServices, + enableAgentExplorerView, + apmEnableTableSearchBar, +} from '../common/ui_settings_keys'; +export { + alertsLocatorID, + ruleDetailsLocatorID, + rulesLocatorID, + sloDetailsLocatorID, + sloEditLocatorID, + uptimeOverviewLocatorID, +} from '../common'; + +export type { RulesParams } from './locators/rules'; +export { getCoreVitalsComponent } from './pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy'; +export { ObservabilityAlertSearchBar } from './components/alert_search_bar/get_alert_search_bar_lazy'; +export { DatePicker } from './pages/overview/components/date_picker'; + +export const LazyAlertsFlyout = lazy(() => import('./components/alerts_flyout/alerts_flyout')); + +export * from './typings'; +import { TopAlert } from './typings/alerts'; +export type { TopAlert }; +import type { AlertDetailsAppSectionProps } from './pages/alert_details/types'; +export type { AlertDetailsAppSectionProps }; + +export { observabilityFeatureId, observabilityAppId } from '../common'; + +export { useFetchDataViews } from './hooks/use_fetch_data_views'; +export { useTimeBuckets } from './hooks/use_time_buckets'; +export { createUseRulesLink } from './hooks/create_use_rules_link'; +export { useSummaryTimeRange } from './hooks/use_summary_time_range'; + +export { getApmTraceUrl } from './utils/get_apm_trace_url'; +export { buildEsQuery } from './utils/build_es_query'; + +export type { + ObservabilityRuleTypeFormatter, + ObservabilityRuleTypeModel, + ObservabilityRuleTypeRegistry, +} from './rules/create_observability_rule_type_registry'; +export { createObservabilityRuleTypeRegistryMock } from './rules/observability_rule_type_registry_mock'; + +export { DatePickerContextProvider } from './context/date_picker_context/date_picker_context'; + +export { fromQuery, toQuery } from './utils/url'; +export { getAlertSummaryTimeRange } from './utils/alert_summary_widget'; +export { calculateTimeRangeBucketSize } from './pages/overview/helpers/calculate_bucket_size'; +export type { render } from './utils/test_helper'; + +export { convertTo } from '../common/utils/formatters/duration'; +export { formatAlertEvaluationValue } from './utils/format_alert_evaluation_value'; +export { + RuleFlyoutKueryBar, + AutocompleteField, + WithKueryAutocompletion, +} from './components/rule_kql_filter'; +export { useAnnotations } from './components/annotations/use_annotations'; +export { RuleConditionChart } from './components/rule_condition_chart'; +export { getGroupFilters } from '../common/custom_threshold_rule/helpers/get_group'; +export type { GenericAggType } from './components/rule_condition_chart/rule_condition_chart'; +export { Threshold } from './components/custom_threshold/components/threshold'; diff --git a/x-pack/plugins/observability_solution/observability/public/locators/rule_details.test.ts b/x-pack/solutions/observability/plugins/observability/public/locators/rule_details.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/locators/rule_details.test.ts rename to x-pack/solutions/observability/plugins/observability/public/locators/rule_details.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/locators/rule_details.ts b/x-pack/solutions/observability/plugins/observability/public/locators/rule_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/locators/rule_details.ts rename to x-pack/solutions/observability/plugins/observability/public/locators/rule_details.ts diff --git a/x-pack/plugins/observability_solution/observability/public/locators/rules.test.ts b/x-pack/solutions/observability/plugins/observability/public/locators/rules.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/locators/rules.test.ts rename to x-pack/solutions/observability/plugins/observability/public/locators/rules.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/locators/rules.ts b/x-pack/solutions/observability/plugins/observability/public/locators/rules.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/locators/rules.ts rename to x-pack/solutions/observability/plugins/observability/public/locators/rules.ts diff --git a/x-pack/plugins/observability_solution/observability/public/navigation_tree.ts b/x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/navigation_tree.ts rename to x-pack/solutions/observability/plugins/observability/public/navigation_tree.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/404.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/404.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/404.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/404.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details_contextual_insights.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details_contextual_insights.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/alert_details_contextual_insights.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/alert_details_contextual_insights.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/alert_history.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/alert_history.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/alert_history.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/alert_history.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/assets/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/assets/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/assets/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/assets/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/feedback_button.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/feedback_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/feedback_button.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/feedback_button.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/header_actions.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/header_actions.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/header_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/header_actions.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/header_actions.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/index.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/related_alerts.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/related_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/related_alerts.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/related_alerts.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/source_bar.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/source_bar.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/source_bar.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/source_bar.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/source_bar.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/source_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/source_bar.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/source_bar.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/components/status_bar.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/components/status_bar.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_add_investigation_item.ts b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_add_investigation_item.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_add_investigation_item.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_add_investigation_item.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_bulk_untrack_alerts.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_bulk_untrack_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_bulk_untrack_alerts.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_bulk_untrack_alerts.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_create_investigation.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_create_investigation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_create_investigation.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_create_investigation.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_fetch_investigations_by_alert.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_fetch_investigations_by_alert.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/hooks/use_fetch_investigations_by_alert.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/hooks/use_fetch_investigations_by_alert.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/mock/alert.ts b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/mock/alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/mock/alert.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/mock/alert.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alert_details/types.ts b/x-pack/solutions/observability/plugins/observability/public/pages/alert_details/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alert_details/types.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/alert_details/types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/alerts.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/alerts.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/alerts.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/alerts.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/alerts.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/components/alert_actions.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/components/alert_actions.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/alert_actions.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/components/alert_actions.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/alert_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/components/alert_actions.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/alert_actions.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/components/rule_stats.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/rule_stats.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/components/rule_stats.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/rule_stats.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/components/rule_stats.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/rule_stats.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/components/rule_stats.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/components/rule_stats.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/helpers/merge_bool_queries.ts b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/helpers/merge_bool_queries.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/helpers/merge_bool_queries.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/helpers/merge_bool_queries.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/alerts/helpers/parse_alert.ts b/x-pack/solutions/observability/plugins/observability/public/pages/alerts/helpers/parse_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/alerts/helpers/parse_alert.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/alerts/helpers/parse_alert.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotation_apply_to.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotation_apply_to.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/annotation_apply_to.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotation_apply_to.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_list.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_list.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_list.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_list_chart.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_list_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_list_chart.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_list_chart.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_privileges.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_privileges.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/annotations_privileges.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/annotations_privileges.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/create_annotation_btn.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/create_annotation_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/create_annotation_btn.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/create_annotation_btn.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/annotations/date_picker.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/annotations/date_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/annotations/date_picker.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/annotations/date_picker.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/cases/cases.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/cases/cases.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/cases/cases.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/cases/cases.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/cases/components/cases.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/cases/components/cases.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/cases/components/cases.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/cases/components/cases.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/cases/components/cases.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/cases/components/cases.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/cases/components/cases.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/cases/components/cases.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/cases/components/empty_page.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/cases/components/empty_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/cases/components/empty_page.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/cases/components/empty_page.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/cases/components/feature_no_permissions.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/cases/components/feature_no_permissions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/cases/components/feature_no_permissions.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/cases/components/feature_no_permissions.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/landing/landing.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/landing/landing.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/landing/landing.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/landing/landing.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/chart_container/chart_container.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/chart_container/chart_container.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/chart_container/chart_container.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/chart_container/chart_container.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/chart_container/chart_container.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/chart_container/chart_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/chart_container/chart_container.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/chart_container/chart_container.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/data_assistant_flyout.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/data_assistant_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/data_assistant_flyout.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/data_assistant_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/data_sections.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/data_sections.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/data_sections.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/data_sections.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/date_picker.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/date_picker.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/date_picker.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/date_picker.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/date_picker.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/date_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/date_picker.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/date_picker.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/index.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/date_picker/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/date_picker/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_actions/header_actions.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_actions/header_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_actions/header_actions.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_actions/header_actions.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu.tsx diff --git a/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.test.tsx new file mode 100644 index 000000000000..055c974dcf6d --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.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 { render } from '@testing-library/react'; +import React from 'react'; +import HeaderMenuPortal from './header_menu_portal'; +import { themeServiceMock } from '@kbn/core/public/mocks'; + +describe('HeaderMenuPortal', () => { + describe('when unmounted', () => { + it('calls setHeaderActionMenu with undefined', () => { + const setHeaderActionMenu = jest.fn(); + const theme$ = themeServiceMock.createTheme$(); + + const { unmount } = render( + + test + + ); + + unmount(); + + expect(setHeaderActionMenu).toHaveBeenCalledWith(undefined); + }); + }); +}); diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/header_menu/header_menu_portal.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.test.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.test.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/helpers/get_news_feed.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/news_feed.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/news_feed.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/news_feed.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/news_feed/news_feed.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/news_feed/news_feed.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_onboarding_callout.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_onboarding_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_onboarding_callout.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_onboarding_callout.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/content.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/content.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/content.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/content.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/index.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/index.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/index.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_box.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_box.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_box.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_box.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_box.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_box.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_box.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_box.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_boxes.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_boxes.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_boxes.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_boxes.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_boxes.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_boxes.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_boxes.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_boxes.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_progress.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_progress.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_progress.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_progress.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_progress.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_progress.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/observability_status/observability_status_progress.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/observability_status/observability_status_progress.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/resources.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/resources.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/resources.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/resources.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/resources.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/resources.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/resources.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/resources.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/apm_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx similarity index 99% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/apm_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx index 2535dc07ef23..196e9cd6bd90 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/apm_section.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/apm_section.tsx @@ -72,7 +72,7 @@ export function APMSection({ bucketSize }: Props) { } }, // `forceUpdate` and `lastUpdated` should trigger a reload - // eslint-disable-next-line react-hooks/exhaustive-deps + [bucketSize, relativeStart, relativeEnd, absoluteStart, absoluteEnd, forceUpdate, lastUpdated] ); diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/mock_data/apm.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/mock_data/apm.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/apm/mock_data/apm.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/apm/mock_data/apm.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_section.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_section.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_section.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_section.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_section.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_section.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_sections.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_sections.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/empty/empty_sections.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/empty/empty_sections.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/error_panel/error_panel.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/error_panel/error_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/error_panel/error_panel.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/error_panel/error_panel.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/logs/logs_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/logs/logs_section.tsx similarity index 99% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/logs/logs_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/logs/logs_section.tsx index cc13fd6d1e78..1182e0cbdcb1 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/logs/logs_section.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/logs/logs_section.tsx @@ -72,7 +72,7 @@ export function LogsSection({ bucketSize }: Props) { }, // `forceUpdate` and `lastUpdated` trigger a reload - // eslint-disable-next-line react-hooks/exhaustive-deps + [bucketSize, relativeStart, relativeEnd, absoluteStart, absoluteEnd, forceUpdate, lastUpdated] ); diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/host_link.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/host_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/host_link.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/host_link.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/lib/format_duration.test.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/lib/format_duration.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/lib/format_duration.test.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/lib/format_duration.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/lib/format_duration.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/lib/format_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/lib/format_duration.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/lib/format_duration.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/aix.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/aix.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/aix.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/aix.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/android.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/android.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/android.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/android.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/darwin.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/darwin.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/darwin.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/darwin.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/dragonfly.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/dragonfly.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/dragonfly.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/dragonfly.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/freebsd.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/freebsd.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/freebsd.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/freebsd.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/illumos.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/illumos.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/illumos.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/illumos.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/linux.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/linux.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/linux.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/linux.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/netbsd.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/netbsd.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/netbsd.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/netbsd.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/solaris.svg b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/solaris.svg similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/logos/solaris.svg rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/logos/solaris.svg diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/metric_with_sparkline.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metric_with_sparkline.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/metric_with_sparkline.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metric_with_sparkline.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx similarity index 99% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx index 99d526a66fac..e943d99fbaa4 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/metrics/metrics_section.tsx @@ -67,7 +67,6 @@ export function MetricsSection({ bucketSize }: Props) { }); } // `forceUpdate` and `lastUpdated` should trigger a reload - // eslint-disable-next-line react-hooks/exhaustive-deps }, [ bucketSize, relativeStart, diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/section_container.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/section_container.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/section_container.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/section_container.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/section_container.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/section_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/section_container.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/section_container.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx similarity index 99% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx index 673ee81c9b79..b59a051e48d5 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/uptime/uptime_section.tsx @@ -65,7 +65,7 @@ export function UptimeSection({ bucketSize }: Props) { } }, // `forceUpdate` and `lastUpdated` should trigger a reload - // eslint-disable-next-line react-hooks/exhaustive-deps + [ bucketSize, relativeStart, diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/__stories__/core_vitals.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/__stories__/core_vitals.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/__stories__/core_vitals.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/__stories__/core_vitals.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/color_palette_flex_item.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/color_palette_flex_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/color_palette_flex_item.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/color_palette_flex_item.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vital_item.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vitals.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vitals.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vitals.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/core_vitals.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/get_core_web_vitals_lazy.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/palette_legends.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/palette_legends.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/palette_legends.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/palette_legends.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/service_name.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/service_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/service_name.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/service_name.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/translations.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/translations.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/translations.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/web_core_vitals_title.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/web_core_vitals_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/core_web_vitals/web_core_vitals_title.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/core_web_vitals/web_core_vitals_title.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/mock_data/ux.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/mock_data/ux.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/mock_data/ux.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/mock_data/ux.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/ux_section.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/ux_section.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/ux_section.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/ux_section.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/ux_section.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/ux_section.tsx similarity index 98% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/ux_section.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/ux_section.tsx index ec6aa5a3a902..4267d4ad9872 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/sections/ux/ux_section.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/sections/ux/ux_section.tsx @@ -64,7 +64,7 @@ export function UXSection({ bucketSize }: Props) { } }, // `forceUpdate` and `lastUpdated` should trigger a reload - // eslint-disable-next-line react-hooks/exhaustive-deps + [ bucketSize, relativeStart, diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/components/styled_stat/styled_stat.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/components/styled_stat/styled_stat.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/components/styled_stat/styled_stat.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/components/styled_stat/styled_stat.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.test.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.test.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/calculate_bucket_size.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/calculate_bucket_size.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/on_brush_end.test.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/on_brush_end.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/on_brush_end.test.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/on_brush_end.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/on_brush_end.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/on_brush_end.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/on_brush_end.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/on_brush_end.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/use_overview_metrics.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/helpers/use_overview_metrics.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/helpers/use_overview_metrics.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/alerts.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/alerts.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/alerts.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/alerts.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/apm.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/apm.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/apm.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/apm.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/logs.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/logs.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/logs.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/logs.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/metrics.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/metrics.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/metrics.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/metrics.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/news_feed.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/news_feed.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/news_feed.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/news_feed.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/mock/uptime.mock.ts b/x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/uptime.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/mock/uptime.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/mock/uptime.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/overview.stories.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/overview.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/overview.stories.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/overview.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/overview/overview.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/overview/overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/overview/overview.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/overview/overview.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/delete_confirmation_modal.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/delete_confirmation_modal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/delete_confirmation_modal.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/delete_confirmation_modal.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/header_actions.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/header_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/header_actions.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/header_actions.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/no_rule_found_panel.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/no_rule_found_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/no_rule_found_panel.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/no_rule_found_panel.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title_content.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/page_title_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title_content.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/page_title_content.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/rule_details_tabs.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/rule_details_tabs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/rule_details_tabs.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/components/rule_details_tabs.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/constants.ts b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/helpers/get_health_color.ts b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/helpers/get_health_color.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/helpers/get_health_color.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/helpers/get_health_color.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/helpers/is_rule_editable.ts b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/helpers/is_rule_editable.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/helpers/is_rule_editable.ts rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/helpers/is_rule_editable.ts diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rule_details/rule_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rule_details/rule_details.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rules/global_logs_tab.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rules/global_logs_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rules/global_logs_tab.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rules/global_logs_tab.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rules/rules.test.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rules/rules.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rules/rules.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rules/rules.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rules/rules.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rules/rules.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rules/rules.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rules/rules.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rules/rules_tab.tsx b/x-pack/solutions/observability/plugins/observability/public/pages/rules/rules_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/pages/rules/rules_tab.tsx rename to x-pack/solutions/observability/plugins/observability/public/pages/rules/rules_tab.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/plugin.mock.tsx b/x-pack/solutions/observability/plugins/observability/public/plugin.mock.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/plugin.mock.tsx rename to x-pack/solutions/observability/plugins/observability/public/plugin.mock.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/plugin.ts b/x-pack/solutions/observability/plugins/observability/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/plugin.ts rename to x-pack/solutions/observability/plugins/observability/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/observability/public/routes/routes.tsx b/x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/routes/routes.tsx rename to x-pack/solutions/observability/plugins/observability/public/routes/routes.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts b/x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/rules/create_observability_rule_type_registry.ts rename to x-pack/solutions/observability/plugins/observability/public/rules/create_observability_rule_type_registry.ts diff --git a/x-pack/plugins/observability_solution/observability/public/rules/fixtures/example_alerts.ts b/x-pack/solutions/observability/plugins/observability/public/rules/fixtures/example_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/rules/fixtures/example_alerts.ts rename to x-pack/solutions/observability/plugins/observability/public/rules/fixtures/example_alerts.ts diff --git a/x-pack/plugins/observability_solution/observability/public/rules/observability_rule_type_registry_mock.ts b/x-pack/solutions/observability/plugins/observability/public/rules/observability_rule_type_registry_mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/rules/observability_rule_type_registry_mock.ts rename to x-pack/solutions/observability/plugins/observability/public/rules/observability_rule_type_registry_mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/rules/register_observability_rule_types.ts b/x-pack/solutions/observability/plugins/observability/public/rules/register_observability_rule_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/rules/register_observability_rule_types.ts rename to x-pack/solutions/observability/plugins/observability/public/rules/register_observability_rule_types.ts diff --git a/x-pack/plugins/observability_solution/observability/public/test_utils/use_global_storybook_theme.tsx b/x-pack/solutions/observability/plugins/observability/public/test_utils/use_global_storybook_theme.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/test_utils/use_global_storybook_theme.tsx rename to x-pack/solutions/observability/plugins/observability/public/test_utils/use_global_storybook_theme.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/typings/alerts.ts b/x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/typings/alerts.ts rename to x-pack/solutions/observability/plugins/observability/public/typings/alerts.ts diff --git a/x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts b/x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts new file mode 100644 index 000000000000..7848ab3df3cb --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/public/typings/fetch_overview_data/index.ts @@ -0,0 +1,175 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { UXMetrics } from '@kbn/observability-shared-plugin/public'; +import type { ObservabilityApp } from '../../../typings/common'; +import { ApmIndicesConfig } from '../../../common/typings'; + +export interface Stat { + type: 'number' | 'percent' | 'bytesPerSecond'; + value: number; +} + +export interface Coordinates { + x: number; + y?: number | null; +} + +export interface Series { + coordinates: Coordinates[]; +} + +export interface FetchDataParams { + absoluteTime: { start: number; end: number }; + relativeTime: { start: string; end: string }; + serviceName?: string; + // Bucket size in seconds (number) + bucketSize: number; + // Bucket size in seconds (string) + intervalString: string; + timeZone?: string; +} + +export interface HasDataParams { + absoluteTime: { start: number; end: number }; +} + +export interface HasDataResponse { + hasData: boolean; +} + +export interface UXHasDataResponse extends HasDataResponse { + serviceName?: string | number; + indices?: string; +} + +export interface SyntheticsHasDataResponse extends HasDataResponse { + indices: string; +} + +export interface APMHasDataResponse { + hasData: boolean; + indices: ApmIndicesConfig; +} + +export interface InfraMetricsHasDataResponse { + hasData: boolean; + indices: string; +} + +export interface InfraLogsHasDataResponse { + hasData: boolean; + indices: string; +} + +interface UniversalProfilingHasDataResponse { + hasData: boolean; +} + +export type FetchData = ( + fetchDataParams: FetchDataParams +) => Promise; + +export type HasData = ( + params?: HasDataParams +) => Promise; + +export type ObservabilityFetchDataPlugins = Exclude< + ObservabilityApp, + 'observability-overview' | 'fleet' | 'synthetics' +>; + +export interface DataHandler< + T extends ObservabilityFetchDataPlugins = ObservabilityFetchDataPlugins +> { + fetchData: FetchData; + hasData: HasData; +} + +export interface FetchDataResponse { + appLink: string; +} + +export interface LogsFetchDataResponse extends FetchDataResponse { + stats: Record; + series: Record; +} + +export type StringOrNull = string | null; +export type NumberOrNull = number | null; + +export interface MetricsFetchDataSeries { + id: string; + name: StringOrNull; + platform: StringOrNull; + provider: StringOrNull; + cpu: NumberOrNull; + iowait: NumberOrNull; + load: NumberOrNull; + uptime: NumberOrNull; + rx: NumberOrNull; + tx: NumberOrNull; + timeseries: Array<{ + timestamp: number; + cpu: NumberOrNull; + iowait: NumberOrNull; + load: NumberOrNull; + rx: NumberOrNull; + tx: NumberOrNull; + }>; +} + +export interface MetricsFetchDataResponse extends FetchDataResponse { + sort: (by: string, direction: string) => Promise; + series: MetricsFetchDataSeries[]; +} + +export interface UptimeFetchDataResponse extends FetchDataResponse { + stats: { + monitors: Stat; + up: Stat; + down: Stat; + }; + series: { + up: Series; + down: Series; + }; +} + +export interface ApmFetchDataResponse extends FetchDataResponse { + stats: { + services: Stat; + transactions: Stat; + }; + series: { + transactions: Series; + }; +} + +export interface UxFetchDataResponse extends FetchDataResponse { + coreWebVitals: UXMetrics; +} + +export type UniversalProfilingDataResponse = FetchDataResponse; + +export interface ObservabilityFetchDataResponse { + apm: ApmFetchDataResponse; + infra_metrics: MetricsFetchDataResponse; + infra_logs: LogsFetchDataResponse; + uptime: UptimeFetchDataResponse; + ux: UxFetchDataResponse; + universal_profiling: UniversalProfilingDataResponse; +} + +export interface ObservabilityHasDataResponse { + apm: APMHasDataResponse; + infra_metrics: InfraMetricsHasDataResponse; + infra_logs: InfraLogsHasDataResponse; + uptime: SyntheticsHasDataResponse; + ux: UXHasDataResponse; + universal_profiling: UniversalProfilingHasDataResponse; +} diff --git a/x-pack/plugins/observability_solution/observability/public/typings/index.ts b/x-pack/solutions/observability/plugins/observability/public/typings/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/typings/index.ts rename to x-pack/solutions/observability/plugins/observability/public/typings/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/typings/utils.ts b/x-pack/solutions/observability/plugins/observability/public/typings/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/typings/utils.ts rename to x-pack/solutions/observability/plugins/observability/public/typings/utils.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/constants.ts b/x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/constants.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.test.tsx b/x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.test.tsx rename to x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.test.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx b/x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx rename to x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/get_alert_summary_time_range.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/index.ts b/x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/alert_summary_widget/index.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/alert_summary_widget/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap b/x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap rename to x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/__snapshots__/build_es_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.ts b/x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/build_es_query/build_es_query.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/build_es_query.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/build_es_query/index.ts b/x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/build_es_query/index.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/build_es_query/index.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/date.ts b/x-pack/solutions/observability/plugins/observability/public/utils/date.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/date.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/date.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/datemath.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/datemath.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/datemath.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/datemath.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/datemath.ts b/x-pack/solutions/observability/plugins/observability/public/utils/datemath.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/datemath.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/datemath.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.ts b/x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/format_alert_evaluation_value.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/format_alert_evaluation_value.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/format_stat_value.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/format_stat_value.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/format_stat_value.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/format_stat_value.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/format_stat_value.ts b/x-pack/solutions/observability/plugins/observability/public/utils/format_stat_value.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/format_stat_value.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/format_stat_value.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_alert_evaluation_unit_type_by_rule_type_id.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_alert_evaluation_unit_type_by_rule_type_id.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_alert_evaluation_unit_type_by_rule_type_id.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_alert_evaluation_unit_type_by_rule_type_id.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_apm_trace_url.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_apm_trace_url.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/calculate_auto.js b/x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/calculate_auto.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/calculate_auto.js rename to x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/calculate_auto.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/index.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/unit_to_seconds.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/unit_to_seconds.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant/common/utils/get_bucket_size/unit_to_seconds.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_bucket_size/unit_to_seconds.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/get_time_zone.ts b/x-pack/solutions/observability/plugins/observability/public/utils/get_time_zone.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/get_time_zone.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/get_time_zone.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/investigation_item_helper.ts b/x-pack/solutions/observability/plugins/observability/public/utils/investigation_item_helper.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/investigation_item_helper.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/investigation_item_helper.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/is_alert_details_enabled.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/is_alert_details_enabled.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/is_alert_details_enabled.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/is_alert_details_enabled.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/is_alert_details_enabled.ts b/x-pack/solutions/observability/plugins/observability/public/utils/is_alert_details_enabled.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/is_alert_details_enabled.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/is_alert_details_enabled.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/kibana_react.mock.ts b/x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/kibana_react.mock.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.mock.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/kibana_react.storybook_decorator.tsx b/x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/kibana_react.storybook_decorator.tsx rename to x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.storybook_decorator.tsx diff --git a/x-pack/plugins/observability_solution/observability/public/utils/kibana_react.ts b/x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/kibana_react.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/kibana_react.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/no_data_config.ts b/x-pack/solutions/observability/plugins/observability/public/utils/no_data_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/no_data_config.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/no_data_config.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx b/x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx similarity index 96% rename from x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx rename to x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx index 16184c562159..2612ae556755 100644 --- a/x-pack/plugins/observability_solution/observability/public/utils/test_helper.tsx +++ b/x-pack/solutions/observability/plugins/observability/public/utils/test_helper.tsx @@ -59,7 +59,7 @@ export const render = (component: React.ReactNode, config: Subset exploratoryView: { createExploratoryViewUrl: jest.fn(), getAppDataView: jest.fn(), - // eslint-disable-next-line @kbn/i18n/strings_should_be_translated_with_i18n + ExploratoryViewEmbeddable: () =>
Embeddable exploratory view
, }, }} diff --git a/x-pack/plugins/observability_solution/observability/public/utils/url.test.ts b/x-pack/solutions/observability/plugins/observability/public/utils/url.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/url.test.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/url.test.ts diff --git a/x-pack/plugins/observability_solution/observability/public/utils/url.ts b/x-pack/solutions/observability/plugins/observability/public/utils/url.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/public/utils/url.ts rename to x-pack/solutions/observability/plugins/observability/public/utils/url.ts diff --git a/x-pack/plugins/observability_solution/observability/scripts/storybook.js b/x-pack/solutions/observability/plugins/observability/scripts/storybook.js similarity index 100% rename from x-pack/plugins/observability_solution/observability/scripts/storybook.js rename to x-pack/solutions/observability/plugins/observability/scripts/storybook.js diff --git a/x-pack/plugins/observability_solution/observability/server/common/constants.ts b/x-pack/solutions/observability/plugins/observability/server/common/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/common/constants.ts rename to x-pack/solutions/observability/plugins/observability/server/common/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/server/features/cases_v1.ts b/x-pack/solutions/observability/plugins/observability/server/features/cases_v1.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/features/cases_v1.ts rename to x-pack/solutions/observability/plugins/observability/server/features/cases_v1.ts diff --git a/x-pack/plugins/observability_solution/observability/server/features/cases_v2.ts b/x-pack/solutions/observability/plugins/observability/server/features/cases_v2.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/features/cases_v2.ts rename to x-pack/solutions/observability/plugins/observability/server/features/cases_v2.ts diff --git a/x-pack/solutions/observability/plugins/observability/server/index.ts b/x-pack/solutions/observability/plugins/observability/server/index.ts new file mode 100644 index 000000000000..913b52e7eb6f --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/server/index.ts @@ -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. + */ + +// TODO: https://github.com/elastic/kibana/issues/110905 + +import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema'; +import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; +import { DEFAULT_ANNOTATION_INDEX } from '../common/annotations'; +import type { ObservabilityPluginSetup } from './plugin'; +import { createOrUpdateIndex, Mappings } from './utils/create_or_update_index'; +import { createOrUpdateIndexTemplate } from './utils/create_or_update_index_template'; +import { ScopedAnnotationsClient } from './lib/annotations/bootstrap_annotations'; +import { CustomThresholdLocators } from './lib/rules/custom_threshold/custom_threshold_executor'; +import { + unwrapEsResponse, + WrappedElasticsearchClientError, +} from '../common/utils/unwrap_es_response'; + +export { + rangeQuery, + kqlQuery, + termQuery, + termsQuery, + wildcardQuery, + existsQuery, +} from './utils/queries'; +export { getParsedFilterQuery } from './utils/get_parsed_filtered_query'; +export { getInspectResponse } from '../common/utils/get_inspect_response'; + +export * from './types'; + +const configSchema = schema.object({ + annotations: schema.object({ + enabled: schema.boolean({ defaultValue: true }), + index: schema.string({ defaultValue: DEFAULT_ANNOTATION_INDEX }), + }), + unsafe: schema.object({ + alertDetails: schema.object({ + metrics: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + logs: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + uptime: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + observability: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + }), + thresholdRule: schema.object({ + enabled: offeringBasedSchema({ + serverless: schema.boolean({ defaultValue: false }), + traditional: schema.boolean({ defaultValue: false }), + }), + }), + ruleFormV2: schema.object({ + enabled: schema.boolean({ defaultValue: false }), + }), + }), + customThresholdRule: schema.object({ + groupByPageSize: schema.number({ defaultValue: 10_000 }), + }), + enabled: schema.boolean({ defaultValue: true }), + createO11yGenericFeatureId: schema.boolean({ defaultValue: false }), +}); + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + unsafe: true, + aiAssistant: { + enabled: true, + feedback: { + enabled: true, + }, + }, + }, + schema: configSchema, + deprecations: ({ unused }) => [ + unused('unsafe.thresholdRule.enabled', { level: 'warning' }), + unused('unsafe.alertDetails.logs.enabled', { level: 'warning' }), + unused('unsafe.alertDetails.metrics.enabled', { level: 'warning' }), + unused('unsafe.alertDetails.observability.enabled', { level: 'warning' }), + ], +}; + +export type ObservabilityConfig = TypeOf; + +export const plugin = async (initContext: PluginInitializerContext) => { + const { ObservabilityPlugin } = await import('./plugin'); + return new ObservabilityPlugin(initContext); +}; + +export type { + Mappings, + ObservabilityPluginSetup, + ScopedAnnotationsClient, + CustomThresholdLocators, +}; +export { + createOrUpdateIndex, + createOrUpdateIndexTemplate, + unwrapEsResponse, + WrappedElasticsearchClientError, +}; + +export { uiSettings } from './ui_settings'; diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/bootstrap_annotations.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/bootstrap_annotations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/bootstrap_annotations.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/bootstrap_annotations.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/create_annotations_client.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/create_annotations_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/create_annotations_client.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/create_annotations_client.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/format_annotations.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/format_annotations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/format_annotations.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/format_annotations.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/mappings/annotation_mappings.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/mappings/annotation_mappings.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/mappings/annotation_mappings.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/mappings/annotation_mappings.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/permissions.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/permissions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/permissions.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/permissions.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts b/x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/annotations/register_annotation_apis.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/annotations/register_annotation_apis.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/constants.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/constants.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/constants.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts similarity index 99% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts index b8dff520ff11..fb5aef4e3ddc 100644 --- a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts +++ b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.test.ts @@ -38,6 +38,7 @@ const initialRuleState: TestRuleState = { }; const fakeLogger = (msg: string, meta?: Meta) => {}; +const MOCKED_SPACE_ID = 'mockedSpaceId'; const logger = { trace: fakeLogger, @@ -90,7 +91,7 @@ const mockOptions = { }, trackedAlertsRecovered: {}, }, - spaceId: '', + spaceId: MOCKED_SPACE_ID, rule: { id: '', name: '', @@ -1563,7 +1564,7 @@ describe('The custom threshold alert type', () => { expect(services.alertsClient.setAlertData).toBeCalledTimes(1); expect(services.alertsClient.setAlertData).toBeCalledWith({ context: { - alertDetailsUrl: 'http://localhost:5601/app/observability/alerts/uuid-a', + alertDetailsUrl: `http://localhost:5601/s/${MOCKED_SPACE_ID}/app/observability/alerts/uuid-a`, viewInAppUrl: 'mockedViewInApp', group: [ { @@ -1584,6 +1585,7 @@ describe('The custom threshold alert type', () => { }); expect(getViewInAppUrl).lastCalledWith({ dataViewId: 'c34a7c79-a88b-4b4a-ad19-72f6d24104e4', + spaceId: MOCKED_SPACE_ID, groups: [ { field: 'host.name', @@ -1800,7 +1802,7 @@ describe('The custom threshold alert type', () => { await execute(true); const recentAlert = getLastReportedAlert(instanceID); expect(recentAlert?.context).toEqual({ - alertDetailsUrl: 'http://localhost:5601/app/observability/alerts/uuid-*', + alertDetailsUrl: `http://localhost:5601/s/${MOCKED_SPACE_ID}/app/observability/alerts/uuid-*`, reason: 'Average test.metric.3 reported no data in the last 1m', timestamp: STARTED_AT_MOCK_DATE.toISOString(), value: ['[NO DATA]', null], @@ -3438,6 +3440,7 @@ describe('The custom threshold alert type', () => { const execute = (alertOnNoData: boolean, sourceId: string = 'default') => executor({ ...mockOptions, + spaceId: '', services, params: { ...mockOptions.params, diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts similarity index 99% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts index 591e8062d5ca..72c9795122dc 100644 --- a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts +++ b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/custom_threshold_executor.ts @@ -285,6 +285,7 @@ export const createCustomThresholdExecutor = ({ metrics: alertResults.length === 1 ? alertResults[0][group].metrics : [], searchConfiguration: params.searchConfiguration, startedAt: indexedStartedAt, + spaceId, }), ...additionalContext, }, diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/check_missing_group.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/check_missing_group.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/check_missing_group.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/check_missing_group.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_bucket_selector.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_condition_script.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_condition_script.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_condition_script.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_condition_script.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_custom_metrics_aggregations.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_custom_metrics_aggregations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_custom_metrics_aggregations.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_custom_metrics_aggregations.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_last_value_aggregation.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_last_value_aggregation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_last_value_aggregation.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_last_value_aggregation.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_rate_aggregation.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_rate_aggregation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_rate_aggregation.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_rate_aggregation.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_timerange.test.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_timerange.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_timerange.test.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_timerange.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_timerange.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_timerange.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/create_timerange.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/create_timerange.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/evaluate_rule.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/format_alert_result.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/format_alert_result.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/format_alert_result.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/format_alert_result.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_data.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_data.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_data.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_values.test.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_values.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_values.test.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_values.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_values.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/get_values.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/get_values.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/metric_query.test.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/metric_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/metric_query.test.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/metric_query.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/metric_query.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/metric_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/metric_query.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/metric_query.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/wrap_in_period.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/wrap_in_period.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/lib/wrap_in_period.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/lib/wrap_in_period.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/messages.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/messages.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/messages.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/messages.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_alert_result.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_alert_result.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_alert_result.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_alert_result.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_metric_params.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_metric_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_metric_params.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/mocks/custom_threshold_metric_params.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/register_custom_threshold_rule_type.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/translations.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/translations.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/translations.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/types.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/types.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/types.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/utils.test.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/utils.test.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/utils.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/utils.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/custom_threshold/utils.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/custom_threshold/utils.ts diff --git a/x-pack/plugins/observability_solution/observability/server/lib/rules/register_rule_types.ts b/x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/lib/rules/register_rule_types.ts rename to x-pack/solutions/observability/plugins/observability/server/lib/rules/register_rule_types.ts diff --git a/x-pack/plugins/observability_solution/observability/server/plugin.ts b/x-pack/solutions/observability/plugins/observability/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/plugin.ts rename to x-pack/solutions/observability/plugins/observability/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/assistant/route.ts b/x-pack/solutions/observability/plugins/observability/server/routes/assistant/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/assistant/route.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/assistant/route.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/create_observability_server_route.ts b/x-pack/solutions/observability/plugins/observability/server/routes/create_observability_server_route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/create_observability_server_route.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/create_observability_server_route.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/get_global_observability_server_route_repository.ts b/x-pack/solutions/observability/plugins/observability/server/routes/get_global_observability_server_route_repository.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/get_global_observability_server_route_repository.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/get_global_observability_server_route_repository.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/register_routes.ts b/x-pack/solutions/observability/plugins/observability/server/routes/register_routes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/register_routes.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/register_routes.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/rules/route.ts b/x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/rules/route.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/rules/route.ts diff --git a/x-pack/plugins/observability_solution/observability/server/routes/types.ts b/x-pack/solutions/observability/plugins/observability/server/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/routes/types.ts rename to x-pack/solutions/observability/plugins/observability/server/routes/types.ts diff --git a/x-pack/plugins/observability_solution/observability/server/saved_objects/threshold.ts b/x-pack/solutions/observability/plugins/observability/server/saved_objects/threshold.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/saved_objects/threshold.ts rename to x-pack/solutions/observability/plugins/observability/server/saved_objects/threshold.ts diff --git a/x-pack/plugins/observability_solution/observability/server/services/index.test.ts b/x-pack/solutions/observability/plugins/observability/server/services/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/services/index.test.ts rename to x-pack/solutions/observability/plugins/observability/server/services/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/services/index.ts b/x-pack/solutions/observability/plugins/observability/server/services/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/services/index.ts rename to x-pack/solutions/observability/plugins/observability/server/services/index.ts diff --git a/x-pack/plugins/observability_solution/observability/server/types.ts b/x-pack/solutions/observability/plugins/observability/server/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/types.ts rename to x-pack/solutions/observability/plugins/observability/server/types.ts diff --git a/x-pack/plugins/observability_solution/observability/server/ui_settings.ts b/x-pack/solutions/observability/plugins/observability/server/ui_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/ui_settings.ts rename to x-pack/solutions/observability/plugins/observability/server/ui_settings.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts b/x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts b/x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/create_or_update_index_template.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/create_or_update_index_template.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/get_es_query_config.test.ts b/x-pack/solutions/observability/plugins/observability/server/utils/get_es_query_config.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/get_es_query_config.test.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/get_es_query_config.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/get_es_query_config.ts b/x-pack/solutions/observability/plugins/observability/server/utils/get_es_query_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/get_es_query_config.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/get_es_query_config.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/get_parsed_filtered_query.ts b/x-pack/solutions/observability/plugins/observability/server/utils/get_parsed_filtered_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/get_parsed_filtered_query.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/get_parsed_filtered_query.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/number.ts b/x-pack/solutions/observability/plugins/observability/server/utils/number.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/number.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/number.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/queries.test.ts b/x-pack/solutions/observability/plugins/observability/server/utils/queries.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/queries.test.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/queries.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/queries.ts b/x-pack/solutions/observability/plugins/observability/server/utils/queries.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/queries.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/queries.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/retry.test.ts b/x-pack/solutions/observability/plugins/observability/server/utils/retry.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/retry.test.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/retry.test.ts diff --git a/x-pack/plugins/observability_solution/observability/server/utils/retry.ts b/x-pack/solutions/observability/plugins/observability/server/utils/retry.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability/server/utils/retry.ts rename to x-pack/solutions/observability/plugins/observability/server/utils/retry.ts diff --git a/x-pack/solutions/observability/plugins/observability/tsconfig.json b/x-pack/solutions/observability/plugins/observability/tsconfig.json new file mode 100644 index 000000000000..7ae72a4bf995 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability/tsconfig.json @@ -0,0 +1,118 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "public/**/*.json", + "server/**/*", + "typings/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/rule-data-utils", + "@kbn/triggers-actions-ui-plugin", + "@kbn/i18n", + "@kbn/deeplinks-observability", + "@kbn/es-query", + "@kbn/observability-get-padded-alert-time-range-util", + "@kbn/share-plugin", + "@kbn/data-plugin", + "@kbn/alerting-comparators", + "@kbn/guided-onboarding", + "@kbn/rison", + "@kbn/kibana-utils-plugin", + "@kbn/spaces-plugin", + "@kbn/utility-types", + "@kbn/core-http-server", + "@kbn/core", + "@kbn/inspector-plugin", + "@kbn/shared-ux-page-kibana-template", + "@kbn/observability-ai-assistant-plugin", + "@kbn/shared-ux-router", + "@kbn/kibana-react-plugin", + "@kbn/react-kibana-context-render", + "@kbn/observability-shared-plugin", + "@kbn/react-kibana-context-theme", + "@kbn/shared-ux-link-redirect-app", + "@kbn/usage-collection-plugin", + "@kbn/cases-components", + "@kbn/cases-plugin", + "@kbn/stack-alerts-plugin", + "@kbn/core-ui-settings-browser-mocks", + "@kbn/alerts-ui-shared", + "@kbn/core-notifications-browser", + "@kbn/core-ui-settings-browser", + "@kbn/rule-registry-plugin", + "@kbn/alerts-grouping", + "@kbn/grouping", + "@kbn/data-views-plugin", + "@kbn/core-http-browser", + "@kbn/visualization-ui-components", + "@kbn/event-annotation-components", + "@kbn/slo-schema", + "@kbn/event-annotation-common", + "@kbn/react-kibana-mount", + "@kbn/i18n-react", + "@kbn/expression-metric-vis-plugin", + "@kbn/charts-plugin", + "@kbn/alerting-plugin", + "@kbn/aiops-log-rate-analysis", + "@kbn/aiops-plugin", + "@kbn/field-types", + "@kbn/test-jest-helpers", + "@kbn/discover-plugin", + "@kbn/embeddable-plugin", + "@kbn/lens-plugin", + "@kbn/ui-actions-plugin", + "@kbn/unified-search-plugin", + "@kbn/lens-embeddable-utils", + "@kbn/std", + "@kbn/actions-plugin", + "@kbn/licensing-plugin", + "@kbn/core-chrome-browser", + "@kbn/navigation-plugin", + "@kbn/observability-alert-details", + "@kbn/investigation-shared", + "@kbn/observability-alerting-rule-utils", + "@kbn/ui-theme", + "@kbn/core-application-common", + "@kbn/securitysolution-ecs", + "@kbn/alerts-as-data-utils", + "@kbn/datemath", + "@kbn/logs-shared-plugin", + "@kbn/exploratory-view-plugin", + "@kbn/core-capabilities-common", + "@kbn/content-management-plugin", + "@kbn/cloud-plugin", + "@kbn/data-view-editor-plugin", + "@kbn/field-formats-plugin", + "@kbn/home-plugin", + "@kbn/data-view-field-editor-plugin", + "@kbn/guided-onboarding-plugin", + "@kbn/investigate-plugin", + "@kbn/license-management-plugin", + "@kbn/presentation-util-plugin", + "@kbn/security-plugin", + "@kbn/serverless", + "@kbn/core-application-browser", + "@kbn/core-theme-browser", + "@kbn/config-schema", + "@kbn/securitysolution-io-ts-utils", + "@kbn/core-elasticsearch-server", + "@kbn/logging", + "@kbn/safer-lodash-set", + "@kbn/features-plugin", + "@kbn/files-plugin", + "@kbn/server-route-repository", + "@kbn/io-ts-utils", + "@kbn/core-ui-settings-server-mocks", + "@kbn/es-types", + "@kbn/logging-mocks", + "@kbn/response-ops-rule-form", + "@kbn/streams-plugin" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/observability/typings/common.ts b/x-pack/solutions/observability/plugins/observability/typings/common.ts similarity index 96% rename from x-pack/plugins/observability_solution/observability/typings/common.ts rename to x-pack/solutions/observability/plugins/observability/typings/common.ts index 06e78c4ec6e6..ccc58c89077b 100644 --- a/x-pack/plugins/observability_solution/observability/typings/common.ts +++ b/x-pack/solutions/observability/plugins/observability/typings/common.ts @@ -15,7 +15,6 @@ export type ObservabilityApp = | 'uptime' | 'synthetics' | 'observability-overview' - | 'stack_monitoring' | 'ux' | 'fleet' | 'universal_profiling'; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/main.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/main.js rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/preview.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/preview.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/.storybook/preview.js rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/preview.js diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/storybook_decorator.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/storybook_decorator.tsx new file mode 100644 index 000000000000..ce283bbeccf0 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/storybook_decorator.tsx @@ -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. + */ +import React, { ComponentType } from 'react'; + +export function KibanaReactStorybookDecorator(Story: ComponentType) { + return ; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/README.md b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/README.md similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/README.md rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/README.md diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/changes/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/changes/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/changes/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/changes/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/lens.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/lens.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/lens.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/lens.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/visualize_esql.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/visualize_esql.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/common/functions/visualize_esql.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/functions/visualize_esql.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/common/rule_connector.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/rule_connector.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/common/rule_connector.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/common/rule_connector.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/jest.config.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/jest.config.js new file mode 100644 index 000000000000..5238f7a7cd88 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: [ + '/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public', + '/x-pack/solutions/observability/plugins/observability_ai_assistant_app/common', + '/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server', + ], + setupFiles: [ + '/x-pack/solutions/observability/plugins/observability_ai_assistant_app/.storybook/jest_setup.js', + ], + collectCoverage: true, + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/observability_ai_assistant_app/{common,public,server}/**/*.{js,ts,tsx}', + ], + + coverageReporters: ['html'], +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/kibana.jsonc b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/kibana.jsonc new file mode 100644 index 000000000000..8d509e50059a --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/kibana.jsonc @@ -0,0 +1,49 @@ +{ + "type": "plugin", + "id": "@kbn/observability-ai-assistant-app-plugin", + "owner": [ + "@elastic/obs-ai-assistant" + ], + "group": "observability", + "visibility": "private", + "plugin": { + "id": "observabilityAIAssistantApp", + "browser": true, + "server": true, + "configPath": [ + "xpack", + "observabilityAIAssistantApp" + ], + "requiredPlugins": [ + "aiAssistantManagementSelection", + "observabilityAIAssistant", + "observabilityShared", + "observability", + "actions", + "data", + "dataViews", + "lens", + "ruleRegistry", + "uiActions", + "triggersActionsUi", + "share", + "licensing", + "ml", + "alerting", + "features", + "inference", + "logsDataAccess", + "spaces", + "slo", + "llmTasks" + ], + "optionalPlugins": [ + "cloud" + ], + "requiredBundles": [ + "kibanaReact", + "esqlDataGrid" + ], + "extraPublicDirs": [] + } +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/application.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/application.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/application.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/application.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/assets/elastic_ai_assistant.png b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/assets/elastic_ai_assistant.png similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/assets/elastic_ai_assistant.png rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/assets/elastic_ai_assistant.png diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/changes/change_list.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/changes/change_list.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/changes/change_list.stories.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/changes/change_list.stories.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/changes/change_list.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/changes/change_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/changes/change_list.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/changes/change_list.tsx diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/charts/spark_plot.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/charts/spark_plot.tsx new file mode 100644 index 000000000000..afd7e9f4bceb --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/charts/spark_plot.tsx @@ -0,0 +1,137 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + AnnotationDomainType, + BarSeries, + Chart, + CurveType, + LineAnnotation, + LineSeries, + PartialTheme, + Position, + ScaleType, + Settings, + Tooltip, +} from '@elastic/charts'; +import { EuiFlexGroup, EuiPanel, EuiText } from '@elastic/eui'; +import { UI_SETTINGS } from '@kbn/data-service'; +import { i18n } from '@kbn/i18n'; +import moment from 'moment'; +import React from 'react'; +import { useChartTheme } from '../../hooks/use_chart_theme'; +import { useKibana } from '../../hooks/use_kibana'; + +function AnnotationTooltip({ timestamp, label }: { timestamp: number; label: React.ReactNode }) { + const dateFormat = useKibana().services.uiSettings.get(UI_SETTINGS.DATE_FORMAT); + const formattedTime = moment(timestamp).format(dateFormat); + + return ( + + + {formattedTime} + {label} + + + ); +} + +export function SparkPlot({ + type, + timeseries, + annotations, + compressed, +}: { + type: 'line' | 'bar'; + timeseries: Array<{ x: number; y: number | null }>; + annotations?: Array<{ + id: string; + x: number; + color: string; + icon: React.ReactNode; + label: React.ReactNode; + }>; + compressed?: boolean; +}) { + const defaultChartTheme = useChartTheme(); + + const sparkplotChartTheme: PartialTheme = { + chartMargins: { left: 0, right: 0, top: 0, bottom: 0 }, + chartPaddings: { + top: 12, + bottom: 12, + }, + lineSeriesStyle: { + point: { opacity: 0 }, + }, + areaSeriesStyle: { + point: { opacity: 0 }, + }, + }; + + return ( + + + + {type && type === 'bar' ? ( + + ) : ( + + )} + {annotations?.map((annotation) => { + return ( + { + return ( + + ); + }} + /> + ); + })} + + ); +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/index.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/index.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/nav_control/lazy_nav_control.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/page_template.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/page_template.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/page_template.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/page_template.tsx diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/entity_badge/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/entity_badge/index.tsx new file mode 100644 index 000000000000..edfc956a448d --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/entity_badge/index.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 { EuiBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; + +export function EntityBadge({ + entity, + color, +}: { + entity: Record; + color?: React.ComponentProps['color']; +}) { + return ( + + {Object.entries(entity).map(([field, value]) => ( + + {`${field}:${value}`} + + ))} + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/complete_root_cause_analysis.json b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/complete_root_cause_analysis.json new file mode 100644 index 000000000000..ec2ce7810bc9 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/complete_root_cause_analysis.json @@ -0,0 +1,19532 @@ +[ + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_IURenJnAu7MGepsXonmWtEbx", + "function": { + "name": "observe", + "arguments": { + "observe": true + } + } + } + ] + }, + { + "name": "observe", + "response": { + "content": "## Observations\n\nThe alert indicates that the `controller` service is experiencing a high number of 500 errors for the `/api/cart` endpoint. The error rate is 98.78%, significantly above the threshold of 1% over a 1-minute period. This is a pronounced and rapid onset of errors that suggests a severe and immediate issue with the `controller` service or its dependencies starting at `2024-11-02T10:56:42.498Z`.\n\n## Symptoms\n\n- **Onset**: Rapid\n- **Severity**: Pronounced\n- **Time of Change**: `2024-11-02T10:56:42.498Z`\n\nGiven the sudden and high volume of errors, the symptoms suggest a significant event such as a deployment, configuration change, or a failure in a critical dependency.\n\n## Next Steps\n\nThe next step is to further investigate the logs for the `controller` service to identify any changes or error patterns around the specified time.\n\n**Entity to Investigate**:\n- `service.name`: `controller`" + }, + "data": { + "content": "## Observations\n\nThe alert indicates that the `controller` service is experiencing a high number of 500 errors for the `/api/cart` endpoint. The error rate is 98.78%, significantly above the threshold of 1% over a 1-minute period. This is a pronounced and rapid onset of errors that suggests a severe and immediate issue with the `controller` service or its dependencies starting at `2024-11-02T10:56:42.498Z`.\n\n## Symptoms\n\n- **Onset**: Rapid\n- **Severity**: Pronounced\n- **Time of Change**: `2024-11-02T10:56:42.498Z`\n\nGiven the sudden and high volume of errors, the symptoms suggest a significant event such as a deployment, configuration change, or a failure in a critical dependency.\n\n## Next Steps\n\nThe next step is to further investigate the logs for the `controller` service to identify any changes or error patterns around the specified time.\n\n**Entity to Investigate**:\n- `service.name`: `controller`", + "investigations": [] + }, + "role": "tool", + "toolCallId": "call_IURenJnAu7MGepsXonmWtEbx" + }, + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_6Vcfeg2e2IUC0gSX0bwejZl1", + "function": { + "name": "investigateEntity", + "arguments": { + "context": "Investigating the alert for the controller service, which indicates a high number of 500 errors for the /api/cart endpoint. Error rate is 98.78%, above the threshold of 1% over a 1-minute duration. Start time of the issue is 2024-11-02T10:56:42.498Z. Will review controller service logs for changes or error patterns around this time.", + "entity": { + "field": "service.name", + "value": "controller" + } + } + } + } + ] + }, + { + "name": "investigateEntity", + "role": "tool", + "toolCallId": "call_6Vcfeg2e2IUC0gSX0bwejZl1", + "response": { + "entity": { + "service.name": "controller" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "frontend" + }, + "reason": "The frontend service interacts closely with the controller (ingress-nginx-controller). Requests directed to /api/cart initiate from frontendproxy which routes to frontend. Given the high error rate at the /api/cart endpoint, the issue might involve downstream calls from frontend to dependent services.", + "confidence": "high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The /api/cart endpoint directly involves manipulating or retrieving data from cartservice. Given the 500 errors on requests routed via the controller, it's likely that cartservice might be either causing or being affected by these failures.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend-web" + }, + "reason": "URL referrer and path fragments suggest client-side interactions impacting the controller's ingress. Issues in the client's request construction or timing might be indirectly impacting how the controller handles these requests.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "Though the controller deals directly with cart interactions, completion of cart actions could trigger subsequent processes in checkoutservice. Errors during cart operations could thereby propagate issues if mismanaged upstream.", + "confidence": "low" + }, + { + "entity": { + "service.name": "coredns" + }, + "reason": "DNS resolution issues could lead to inability to locate the correct backend service IP for controller, causing errors in routing HTTP requests.", + "confidence": "low" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service is called by the `frontendproxy`, which is indicated as the `attributes.upstream.name` in `controller` logs. In the context provided, the `frontend` communicates with other backend services to process user interactions and might be an upstream dependency for the `controller`. The problem might cascade from `frontendproxy` to `frontend`.", + "confidence": "high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The `cartservice` handles shopping cart actions which map the `controller`'s `/api/cart` endpoint. If the `cartservice` has issues, they would cascade to the `controller` /api/cart endpoint that depends on this service for cart management functions.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "Handling currency conversions, indirectly connected to cart operations. The issues might arise if currency conversion fails during cart operations, contributing to the 500 errors in the `controller`.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "frauddetectionservice" + }, + "reason": "No specific logs point directly; contextual relevance due to transaction handling. If fraud detection triggers false flags, it can affect cart transactions.", + "confidence": "low" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The `cartservice` directly manages shopping cart operations over the gRPC protocol, and errors here could lead to repeated 500 errors in the `controller`.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service handles user interactions that are passed to the `controller`. Issues in `frontend` could lead to failures in `controller`, resulting in 500 errors.", + "confidence": "medium to high" + }, + { + "entity": { + "service.name": "loadgenerator" + }, + "reason": "The `loadgenerator` simulates high user traffic which might strain other services and indirectly cause 500 errors in the `controller`.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "etcd" + }, + "reason": "As a control plane activity tracker for Ingress, indirect impacts from `etcd` inconsistencies can propagate as issues in services interacting via Ingress, including `controller`.", + "confidence": "medium" + } + ], + "summary": "### Characteristics of the `controller` Entity\n\n**1. Infrastructure & Environment:**\n\nThe `controller` service is deployed within a Kubernetes environment, specifically in the `ingress-nginx` namespace. The service is associated with a `controller` container running within the `ingress-nginx-controller-bc57996ff-r6blf` pod. This pod is scheduled on a node identified as `minikube`, and the service is part of the `ingress-nginx-controller` deployment. Additionally, the infrastructure is based on an ARM64 architecture, running Ubuntu 24.04.1 LTS, with deployment environment set to `opentelemetry-demo`.\n\n**2. Communication Characteristics:**\n\nThe `controller` service functions as an Ingress controller, managing incoming traffic and routing it to backend services. It processes HTTP requests, typically version 1.1, and communicates with other services via HTTP protocols. Key endpoints involved in the communication include:\n- Inbound requests are received at endpoints like `/api/cart` and `/api/checkout`.\n- Outbound requests are routed primarily to the `frontendproxy` service, evidenced by the upstream address `10.244.0.26:8080`.\n\nThe service handles both `GET` and `POST` requests, and its communication paths include requests from user agents like \"HeadlessChrome\" and \"python-requests\".\n\n**3. Context of Entity in Investigation:**\n\n**Reason for Investigation:**\nThe `controller` service is currently under investigation due to an alert triggered by a high number of 500 errors (98.78% error rate) occurring at the `/api/cart` endpoint. The significant spike in error rates is concerning and suggests a potential issue within the service or its interaction with dependencies.\n\n**Relation to Other Entities:**\nThe high error rates on the `controller` are likely impacting the overall user experience of the application, notably through the `/api/cart` functionality, which interacts with the `cartservice`. As the `controller` service forwards requests to the `frontendproxy`, which in turn interacts with various backend services like `cartservice`, `checkoutservice`, `currencyservice`, and others, the ripple effect of these errors might be felt across multiple services in the architecture. This interconnectedness necessitates thorough investigation of `controller's` logs and error patterns to isolate the root cause and mitigate the disruption in the flow of HTTP requests.\n\nBy understanding the behavior and interaction of the `controller` service within the broader microservices architecture, we aim to identify and resolve the underlying issue causing the increase in 500 errors. This involves examining logs for patterns, determining if recent changes or specific conditions triggered the fault, and analyzing dependencies that could contribute to the error rates observed. This step is integral to restoring normal operation and maintaining service reliability and user satisfaction.\n\n### Analysis of Log Patterns for service.name:controller\n\n#### Pattern Group: Request Errors\n- **Pattern:**\n ```\n .*?10\\\\.244\\\\.0\\\\.38.+?02.+?2024.+?10.+?0000.+?api.+?HTTP.+?1\\\\.1.+?python.+?requests.+?2\\\\.31\\\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\\\.244\\\\.0\\\\.26.+?8080.*?\n ```\n - **Sample:**\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n - **Description:** This pattern represents request logs where an HTTP POST request to the `/api/cart` endpoint resulted in a `500 Internal Server Error`. The requests are from a client using `python-requests/2.31.0`.\n\n- **Count:** 263 occurrences\n\n- **Timeseries Analysis:**\n - **Trend:** The number of occurrences show fluctuation with no significant change in the pattern.\n - **Log Counts:** \n - Example timestamps and counts:\n - `2024-11-02T10:56:00.000Z: 6`\n - `2024-11-02T10:56:30.000Z: 2`\n - `2024-11-02T10:57:00.000Z: 0`\n\n### Summary\nBased on the provided logs patterns, the `controller` service is experiencing a high number of `500 Internal Server Errors` when handling POST requests to the `/api/cart` endpoint. This is evident from the consistent error logs observed at different timestamps. The alert threshold breach likely correlates with these error occurrences.\n\nNo other unusual patterns such as connection issues, startup messages, or garbage collection messages were identified in the logs around the error events. Further investigation on the backend or potential dependency issues (e.g., `cartservice`) might be needed to determine the exact cause of these errors.\n\n### Timeline of significant events\n\n- **2024-11-02T10:56:42.498Z**\n - **Alert Triggered**: High number of 500 errors for the /api/cart endpoint. Error rate is 98.78%, above the threshold of 1% over a 1-minute duration.\n \n- **2024-11-02T10:56:00.000Z**\n - **Log Entry**: 6 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - **Example Log**:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n \n- **2024-11-02T10:56:30.000Z**\n - **Log Entry**: 2 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - **Example Log**:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:35 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n### Context and reasoning\n\nThe `controller` service plays a critical role in handling incoming HTTP requests within the Kubernetes environment, specifically acting as an Ingress controller within the `ingress-nginx` namespace. The recent alert, triggered by a high number of 500 errors, indicates a significant disruption in the normal operations of the `controller` service, particularly impacting the `/api/cart` endpoint. The log entries leading up to and following the alert highlight a pattern of consistent `500 Internal Server Error` responses, specifically around the timestamp in question.\n\nThe pattern group identified, related to request errors, shows repeated failures for HTTP POST requests from a client using `python-requests/2.31.0`, likely directed towards the `cartservice` via the `frontendproxy`. This high error rate suggests an underlying issue either within the `controller` service itself, its communication path to the `frontendproxy`, or potentially further downstream with the backend services like `cartservice`.\n\nNo other unusual log patterns, such as connection issues or any system degradation messages were noted, indicating the problem is likely concentrated around the interaction between `controller` and its immediate dependencies rather than a broader system-wide issue. By correlating the timestamps and repeated error logs, a clear link can be drawn between the `500 Internal Server Error` responses and the timeline, further supporting the hypothesis of a specific fault affecting the `/api/cart` endpoint.\n\nFurther investigation into the dependencies of the `controller` service, especially focusing on the interactions with the `frontendproxy` and subsequently `cartservice`, is warranted to isolate and rectify the root cause of these error patterns." + }, + "data": { + "attachments": { + "alerts": [ + { + "kibana.alert.reason": "500 Errors is 98.78049, above the threshold of 1. (duration: 1 min, data view: otel_logs_data (Automated by Demo CLI), group: controller,/api/cart)", + "kibana.alert.evaluation.values": [ + 98.78048780487805 + ], + "kibana.alert.evaluation.threshold": [ + 1 + ], + "kibana.alert.group": [ + { + "field": "service.name", + "value": "controller" + }, + { + "field": "url.path", + "value": "/api/cart" + } + ], + "tags": [ + "demo", + "cli-created" + ], + "service.name": "controller", + "kibana.alert.rule.category": "Custom threshold", + "kibana.alert.rule.consumer": "logs", + "kibana.alert.rule.execution.uuid": "4187827d-686e-4098-98e3-21e13495798e", + "kibana.alert.rule.name": "NGINX 500s", + "kibana.alert.rule.parameters": { + "criteria": [ + { + "comparator": ">", + "metrics": [ + { + "name": "A", + "filter": "http.response.status_code:*", + "aggType": "count" + }, + { + "name": "B", + "filter": "http.response.status_code>=500", + "aggType": "count" + } + ], + "threshold": [ + 1 + ], + "timeSize": 1, + "timeUnit": "m", + "equation": "(B/A) * 100", + "label": "500 Errors" + } + ], + "alertOnNoData": false, + "alertOnGroupDisappear": false, + "searchConfiguration": { + "query": { + "query": "k8s.namespace.name: \"ingress-nginx\" AND url.path: /api/*", + "language": "kuery" + }, + "index": "otel_logs_data" + }, + "groupBy": [ + "service.name", + "url.path" + ] + }, + "kibana.alert.rule.producer": "observability", + "kibana.alert.rule.revision": 0, + "kibana.alert.rule.rule_type_id": "observability.rules.custom_threshold", + "kibana.alert.rule.tags": [ + "demo", + "cli-created" + ], + "kibana.alert.rule.uuid": "9055220c-8fb1-4f9f-be7c-0a33eb2bafc5", + "kibana.space_ids": [ + "default" + ], + "@timestamp": "2024-11-02T10:56:42.498Z", + "event.action": "open", + "event.kind": "signal", + "kibana.alert.rule.execution.timestamp": "2024-11-02T10:56:42.498Z", + "kibana.alert.action_group": "custom_threshold.fired", + "kibana.alert.flapping": false, + "kibana.alert.flapping_history": [ + true + ], + "kibana.alert.instance.id": "controller,/api/cart", + "kibana.alert.maintenance_window_ids": [], + "kibana.alert.consecutive_matches": 1, + "kibana.alert.status": "active", + "kibana.alert.uuid": "b97a1b20-d14b-4835-b948-bd7a423284eb", + "kibana.alert.severity_improving": false, + "kibana.alert.workflow_status": "open", + "kibana.alert.duration.us": 0, + "kibana.alert.start": "2024-11-02T10:56:42.498Z", + "kibana.alert.time_range": { + "gte": "2024-11-02T10:56:42.498Z" + }, + "kibana.version": "9.0.0" + }, + { + "kibana.alert.reason": "500 Errors is 100, above the threshold of 1. (duration: 1 min, data view: otel_logs_data (Automated by Demo CLI), group: controller,/api/checkout)", + "kibana.alert.evaluation.values": [ + 100 + ], + "kibana.alert.evaluation.threshold": [ + 1 + ], + "kibana.alert.group": [ + { + "field": "service.name", + "value": "controller" + }, + { + "field": "url.path", + "value": "/api/checkout" + } + ], + "tags": [ + "demo", + "cli-created" + ], + "service.name": "controller", + "kibana.alert.rule.category": "Custom threshold", + "kibana.alert.rule.consumer": "logs", + "kibana.alert.rule.execution.uuid": "4187827d-686e-4098-98e3-21e13495798e", + "kibana.alert.rule.name": "NGINX 500s", + "kibana.alert.rule.parameters": { + "criteria": [ + { + "comparator": ">", + "metrics": [ + { + "name": "A", + "filter": "http.response.status_code:*", + "aggType": "count" + }, + { + "name": "B", + "filter": "http.response.status_code>=500", + "aggType": "count" + } + ], + "threshold": [ + 1 + ], + "timeSize": 1, + "timeUnit": "m", + "equation": "(B/A) * 100", + "label": "500 Errors" + } + ], + "alertOnNoData": false, + "alertOnGroupDisappear": false, + "searchConfiguration": { + "query": { + "query": "k8s.namespace.name: \"ingress-nginx\" AND url.path: /api/*", + "language": "kuery" + }, + "index": "otel_logs_data" + }, + "groupBy": [ + "service.name", + "url.path" + ] + }, + "kibana.alert.rule.producer": "observability", + "kibana.alert.rule.revision": 0, + "kibana.alert.rule.rule_type_id": "observability.rules.custom_threshold", + "kibana.alert.rule.tags": [ + "demo", + "cli-created" + ], + "kibana.alert.rule.uuid": "9055220c-8fb1-4f9f-be7c-0a33eb2bafc5", + "kibana.space_ids": [ + "default" + ], + "@timestamp": "2024-11-02T10:56:42.498Z", + "event.action": "open", + "event.kind": "signal", + "kibana.alert.rule.execution.timestamp": "2024-11-02T10:56:42.498Z", + "kibana.alert.action_group": "custom_threshold.fired", + "kibana.alert.flapping": false, + "kibana.alert.flapping_history": [ + true + ], + "kibana.alert.instance.id": "controller,/api/checkout", + "kibana.alert.maintenance_window_ids": [], + "kibana.alert.consecutive_matches": 1, + "kibana.alert.status": "active", + "kibana.alert.uuid": "78472a9c-63a2-41ba-9812-47cebd48d833", + "kibana.alert.severity_improving": false, + "kibana.alert.workflow_status": "open", + "kibana.alert.duration.us": 0, + "kibana.alert.start": "2024-11-02T10:56:42.498Z", + "kibana.alert.time_range": { + "gte": "2024-11-02T10:56:42.498Z" + }, + "kibana.version": "9.0.0" + } + ], + "slos": [], + "analysis": { + "total": 56181, + "sampled": 1000, + "fields": [ + "@timestamp:date - 994 distinct values", + "app.label.component:keyword - 1 distinct values (`controller`)", + "attributes.event.name.text:text - 1 distinct values (`nginx.ingress.controller.error`)", + "attributes.event.name:keyword - 1 distinct values (`nginx.ingress.controller.error`)", + "attributes.http.request.id:keyword - 1000 distinct values (`87c973a800b3bd34d3679f0a12263c40`, `ee99fada68450d77be61deaae1f04008`, `80312e7e98e9171c8010e442784e7a04`, `a931c4f7d964f91f0a0750f3221dfa50`, `8c2e99672e225b279a7741671c976c93`, `eed4ff70db044f81adeda15bc1f3ad4c`, `dd730f83b894fc2adedfaf950cf5884c`, `4e35653560a824d6693d1e024906e9ce`, `36d6dfae2fe5d6fecbfaadd4fac5bde1`, `43c774bea806c21478f7ee57a449222b`, 990 more values)", + "attributes.http.request.method:keyword - 2 distinct values (`POST`, `GET`)", + "attributes.http.request.referrer:keyword - 2 distinct values (`http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/`, `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`)", + "attributes.http.request.size:long - 61 distinct values (`351`, `374`, `373`, `809`, `383`, `506`, `342`, `350`, `538`, `479`, 51 more values)", + "attributes.http.request.time:float - 90 distinct values (`3.172`, `1.103`, `0.053`, `4.434`, `0.019`, `3.328`, `1.01`, `3.197`, `3.133`, `2.566`, 80 more values)", + "attributes.http.response.body.size:long - 130 distinct values (`1144`, `1120`, `1024`, `19`, `1336`, `1198`, `1070`, `111157`, `111163`, `1271`, 120 more values)", + "attributes.http.response.status_code:long - 4 distinct values (`499`, `500`, `308`, `200`)", + "attributes.http.version:keyword - 1 distinct values (`1.1`)", + "attributes.log.file.path.text:text - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "attributes.log.file.path:keyword - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "attributes.log.iostream:keyword - 1 distinct values (`stdout`)", + "attributes.network.protocol.name.text:text - 1 distinct values (`http`)", + "attributes.network.protocol.name:keyword - 1 distinct values (`http`)", + "attributes.source.address:keyword - 1 distinct values (`10.244.0.38`)", + "attributes.upstream.address:keyword - 1 distinct values (`10.244.0.26:8080`)", + "attributes.upstream.name.text:text - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "attributes.upstream.name:keyword - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "attributes.upstream.response.size:keyword - 117 distinct values (`1149`, `1120`, `1029`, `19`, `1336`, `1203`, `1070`, `1276`, `1356`, `1105`, 107 more values)", + "attributes.upstream.response.status_code:keyword - 3 distinct values (`500`, `308`, `200`)", + "attributes.upstream.response.time:keyword - 89 distinct values (`3.171`, `1.007`, `1.103`, `0.053`, `4.434`, `3.328`, `1.010`, `3.197`, `3.132`, `2.565`, 79 more values)", + "attributes.url.domain:keyword - 2 distinct values (`icons`, ``)", + "attributes.url.extension:keyword - 7 distinct values (`css`, `Service/ResolveAll`, `Service/EventStream`, `png`, `svg`, `jpg`, `js`)", + "attributes.url.original.text:text - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, 165 more values)", + "attributes.url.original:keyword - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `/api/recommendations?productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `/api/cart?sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `/api/recommendations?productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `/api/data/`, `/api/cart?sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `/api/recommendations?productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `/api/recommendations?productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `/api/cart?sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, 157 more values)", + "attributes.url.path:keyword - 43 distinct values (`/api/products/0PUK6V6EV0`, `/api/products/9SIQT8TOJO`, `/api/products/LS4PSXUNUM`, `/api/data/`, `/api/products/L9ECAV7KIM`, `/api/data`, `/api/products/66VCHSJNUP`, `/api/products/2ZYFJ3GM2N`, `/cart`, `/images/products/NationalParkFoundationExplorascope.jpg`, 33 more values)", + "attributes.url.query:keyword - 126 distinct values (`productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, `productIds=&sessionId=0c122e28-e8fb-4ab5-9889-ac797b5f17cf¤cyCode=USD`, 116 more values)", + "attributes.url.scheme:keyword - 1 distinct values (``)", + "attributes.user_agent.name.text:text - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "attributes.user_agent.name:keyword - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "attributes.user_agent.original.text:text - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "attributes.user_agent.original:keyword - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "attributes.user_agent.version:keyword - 2 distinct values (`2.31`, `120.0.6099`)", + "body.text:text - 1000 distinct values (`10.244.0.38 - - [02/Nov/2024:10:37:56 +0000] \"GET /api/currency? HTTP/1.1\" 200 199 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 598 0.007 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 199 0.007 200 87c973a800b3bd34d3679f0a12263c40\n`, `10.244.0.38 - - [02/Nov/2024:10:46:11 +0000] \"GET /_next/static/chunks/pages/_app-c923ae378a182a07.js HTTP/1.1\" 200 111150 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 484 0.017 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 111008 0.018 200 ee99fada68450d77be61deaae1f04008\n`, 998 more values)", + "data_stream.dataset:keyword - 1 distinct values (`nginx_ingress_controller.error.otel`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`logs`)", + "deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "dropped_attributes_count:long - 1 distinct values (`0`)", + "event.dataset:keyword - 1 distinct values (`nginx_ingress_controller.error.otel`)", + "event.name:keyword - 1 distinct values (`nginx.ingress.controller.error`)", + "host.arch:keyword - 1 distinct values (`arm64`)", + "host.architecture:keyword - 1 distinct values (`arm64`)", + "host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "host.cpu.family:keyword - 1 distinct values (``)", + "host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "host.cpu.model.name:keyword - 1 distinct values (``)", + "host.cpu.stepping:keyword - 1 distinct values (`0`)", + "host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "host.os.full:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "host.os.platform:keyword - 1 distinct values (`linux`)", + "http.request.id:keyword - 1000 distinct values (`87c973a800b3bd34d3679f0a12263c40`, `ee99fada68450d77be61deaae1f04008`, `80312e7e98e9171c8010e442784e7a04`, `a931c4f7d964f91f0a0750f3221dfa50`, `8c2e99672e225b279a7741671c976c93`, `eed4ff70db044f81adeda15bc1f3ad4c`, `dd730f83b894fc2adedfaf950cf5884c`, `4e35653560a824d6693d1e024906e9ce`, `36d6dfae2fe5d6fecbfaadd4fac5bde1`, `43c774bea806c21478f7ee57a449222b`, 990 more values)", + "http.request.method:keyword - 2 distinct values (`POST`, `GET`)", + "http.request.referrer:keyword - 2 distinct values (`http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/`, `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`)", + "http.request.size:long - 61 distinct values (`351`, `374`, `373`, `809`, `383`, `506`, `342`, `350`, `538`, `479`, 51 more values)", + "http.request.time:float - 90 distinct values (`3.172`, `1.103`, `0.053`, `4.434`, `0.019`, `3.328`, `1.01`, `3.197`, `3.133`, `2.566`, 80 more values)", + "http.response.body.size:long - 130 distinct values (`1144`, `1120`, `1024`, `19`, `1336`, `1198`, `1070`, `111157`, `111163`, `1271`, 120 more values)", + "http.response.status_code:long - 4 distinct values (`499`, `500`, `308`, `200`)", + "http.version:keyword - 1 distinct values (`1.1`)", + "k8s.container.name:keyword - 1 distinct values (`controller`)", + "k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "k8s.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "k8s.namespace.name:keyword - 1 distinct values (`ingress-nginx`)", + "k8s.node.name:keyword - 1 distinct values (`minikube`)", + "k8s.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T08:56:56Z`)", + "k8s.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "kubernetes.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "kubernetes.namespace:keyword - 1 distinct values (`ingress-nginx`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "log.file.path:keyword - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "log.iostream:keyword - 1 distinct values (`stdout`)", + "message:text - 1000 distinct values (`10.244.0.38 - - [02/Nov/2024:10:37:56 +0000] \"GET /api/currency? HTTP/1.1\" 200 199 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 598 0.007 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 199 0.007 200 87c973a800b3bd34d3679f0a12263c40\n`, `10.244.0.38 - - [02/Nov/2024:10:46:11 +0000] \"GET /_next/static/chunks/pages/_app-c923ae378a182a07.js HTTP/1.1\" 200 111150 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 484 0.017 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 111008 0.018 200 ee99fada68450d77be61deaae1f04008\n`, 998 more values)", + "network.protocol.name:keyword - 1 distinct values (`http`)", + "observed_timestamp:date_nanos - 1000 distinct values (`2024-11-02T10:37:56.158731715Z`, `2024-11-02T10:46:11.961228541Z`, `2024-11-02T10:38:02.758802635Z`, `2024-11-02T10:54:51.563521629Z`, `2024-11-02T10:37:05.149442469Z`, `2024-11-02T10:49:01.961126259Z`, `2024-11-02T10:56:19.96308167Z`, `2024-11-02T10:42:06.760264887Z`, `2024-11-02T10:49:45.76210446Z`, `2024-11-02T10:54:02.562840801Z`, 990 more values)", + "os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.app.label.component:keyword - 1 distinct values (`controller`)", + "resource.attributes.deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "resource.attributes.host.arch:keyword - 1 distinct values (`arm64`)", + "resource.attributes.host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "resource.attributes.host.cpu.family:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "resource.attributes.host.cpu.model.name.text:text - 1 distinct values (``)", + "resource.attributes.host.cpu.model.name:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.stepping:keyword - 1 distinct values (`0`)", + "resource.attributes.host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "resource.attributes.host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "resource.attributes.host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "resource.attributes.host.name:keyword - 1 distinct values (`otel-daemonset-opentelemetry-collector-agent-7jlpk`)", + "resource.attributes.k8s.container.name.text:text - 1 distinct values (`controller`)", + "resource.attributes.k8s.container.name:keyword - 1 distinct values (`controller`)", + "resource.attributes.k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "resource.attributes.k8s.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "resource.attributes.k8s.namespace.name:keyword - 1 distinct values (`ingress-nginx`)", + "resource.attributes.k8s.node.name:keyword - 1 distinct values (`minikube`)", + "resource.attributes.k8s.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "resource.attributes.k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T08:56:56Z`)", + "resource.attributes.k8s.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "resource.attributes.os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "resource.attributes.os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.service.name.text:text - 1 distinct values (`controller`)", + "resource.attributes.service.name:keyword - 1 distinct values (`controller`)", + "resource.dropped_attributes_count:long - 1 distinct values (`0`)", + "resource.schema_url:keyword - 1 distinct values (`https://opentelemetry.io/schemas/1.6.1`)", + "scope.dropped_attributes_count:long - 1 distinct values (`0`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.name:keyword - 1 distinct values (`controller`)", + "severity_number:byte - 1 distinct values (`0`)", + "source.address:keyword - 1 distinct values (`10.244.0.38`)", + "upstream.address:keyword - 1 distinct values (`10.244.0.26:8080`)", + "upstream.name:keyword - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "upstream.response.size:keyword - 117 distinct values (`1149`, `1120`, `1029`, `19`, `1336`, `1203`, `1070`, `1276`, `1356`, `1105`, 107 more values)", + "upstream.response.status_code:keyword - 3 distinct values (`500`, `308`, `200`)", + "upstream.response.time:keyword - 89 distinct values (`3.171`, `1.007`, `1.103`, `0.053`, `4.434`, `3.328`, `1.010`, `3.197`, `3.132`, `2.565`, 79 more values)", + "url.domain:keyword - 2 distinct values (`icons`, ``)", + "url.extension:keyword - 7 distinct values (`css`, `Service/ResolveAll`, `Service/EventStream`, `png`, `svg`, `jpg`, `js`)", + "url.original:keyword - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `/api/recommendations?productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `/api/cart?sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `/api/recommendations?productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `/api/data/`, `/api/cart?sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `/api/recommendations?productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `/api/recommendations?productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `/api/cart?sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, 157 more values)", + "url.path:keyword - 43 distinct values (`/api/products/0PUK6V6EV0`, `/api/products/9SIQT8TOJO`, `/api/products/LS4PSXUNUM`, `/api/data/`, `/api/products/L9ECAV7KIM`, `/api/data`, `/api/products/66VCHSJNUP`, `/api/products/2ZYFJ3GM2N`, `/cart`, `/images/products/NationalParkFoundationExplorascope.jpg`, 33 more values)", + "url.query:keyword - 126 distinct values (`productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, `productIds=&sessionId=0c122e28-e8fb-4ab5-9889-ac797b5f17cf¤cyCode=USD`, 116 more values)", + "url.scheme:keyword - 1 distinct values (``)", + "user_agent.name:keyword - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "user_agent.original:keyword - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "user_agent.version:keyword - 2 distinct values (`2.31`, `120.0.6099`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 54850, + "pattern": "HTTP/1.1 Mozilla/5.0 X11 Linux aarch64 AppleWebKit/537.36 KHTML like Gecko HeadlessChrome/120.0.6099.28 Safari/537.36 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?HTTP/1\\.1.+?Mozilla/5\\.0.+?X11.+?Linux.+?aarch64.+?AppleWebKit/537\\.36.+?KHTML.+?like.+?Gecko.+?HeadlessChrome/120\\.0\\.6099\\.28.+?Safari/537\\.36.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:54:54 +0000] \"GET /icons/Chevron.svg HTTP/1.1\" 200 805 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 508 0.001 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 810 0.001 200 8693bfefd0668ca27fff0e929785a2c5\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:54:54 +0000] \"GET /icons/Chevron.svg HTTP/1.1\" 200 805 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 508 0.001 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 810 0.001 200 8693bfefd0668ca27fff0e929785a2c5\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.057Z", + "lastOccurrence": "2024-11-02T10:56:59.420Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1385 + }, + { + "x": 1730543820000, + "y": 1172 + }, + { + "x": 1730543850000, + "y": 1520 + }, + { + "x": 1730543880000, + "y": 1312 + }, + { + "x": 1730543910000, + "y": 986 + }, + { + "x": 1730543940000, + "y": 1030 + }, + { + "x": 1730543970000, + "y": 1248 + }, + { + "x": 1730544000000, + "y": 1395 + }, + { + "x": 1730544030000, + "y": 1371 + }, + { + "x": 1730544060000, + "y": 1289 + }, + { + "x": 1730544090000, + "y": 1467 + }, + { + "x": 1730544120000, + "y": 1223 + }, + { + "x": 1730544150000, + "y": 1429 + }, + { + "x": 1730544180000, + "y": 1329 + }, + { + "x": 1730544210000, + "y": 1224 + }, + { + "x": 1730544240000, + "y": 1424 + }, + { + "x": 1730544270000, + "y": 1409 + }, + { + "x": 1730544300000, + "y": 1405 + }, + { + "x": 1730544330000, + "y": 1322 + }, + { + "x": 1730544360000, + "y": 1326 + }, + { + "x": 1730544390000, + "y": 1416 + }, + { + "x": 1730544420000, + "y": 1391 + }, + { + "x": 1730544450000, + "y": 1320 + }, + { + "x": 1730544480000, + "y": 1384 + }, + { + "x": 1730544510000, + "y": 1457 + }, + { + "x": 1730544540000, + "y": 1415 + }, + { + "x": 1730544570000, + "y": 1386 + }, + { + "x": 1730544600000, + "y": 1337 + }, + { + "x": 1730544630000, + "y": 1315 + }, + { + "x": 1730544660000, + "y": 1259 + }, + { + "x": 1730544690000, + "y": 1403 + }, + { + "x": 1730544720000, + "y": 1352 + }, + { + "x": 1730544750000, + "y": 1396 + }, + { + "x": 1730544780000, + "y": 1325 + }, + { + "x": 1730544810000, + "y": 1365 + }, + { + "x": 1730544840000, + "y": 1387 + }, + { + "x": 1730544870000, + "y": 1414 + }, + { + "x": 1730544900000, + "y": 1210 + }, + { + "x": 1730544930000, + "y": 1344 + }, + { + "x": 1730544960000, + "y": 1444 + }, + { + "x": 1730544990000, + "y": 1264 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "dip", + "significance": "medium", + "change_point": 4, + "p_value": 0.00005345763188668862, + "timestamp": "2024-11-02T10:38:30.000Z" + }, + "shortId": "hhpu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1069, + "pattern": "GET HTTP/1.1 python-requests/2.31.0 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?GET.+?HTTP/1\\.1.+?python-requests/2\\.31\\.0.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:01 +0000] \"GET /api/data HTTP/1.1\" 200 177 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 177 0.003 200 6cf0fcfd1259f68166701125d3c9761c\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:01 +0000] \"GET /api/data HTTP/1.1\" 200 177 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 177 0.003 200 6cf0fcfd1259f68166701125d3c9761c\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:32.391Z", + "lastOccurrence": "2024-11-02T10:56:57.316Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 25 + }, + { + "x": 1730543820000, + "y": 27 + }, + { + "x": 1730543850000, + "y": 26 + }, + { + "x": 1730543880000, + "y": 26 + }, + { + "x": 1730543910000, + "y": 26 + }, + { + "x": 1730543940000, + "y": 27 + }, + { + "x": 1730543970000, + "y": 24 + }, + { + "x": 1730544000000, + "y": 25 + }, + { + "x": 1730544030000, + "y": 22 + }, + { + "x": 1730544060000, + "y": 27 + }, + { + "x": 1730544090000, + "y": 20 + }, + { + "x": 1730544120000, + "y": 23 + }, + { + "x": 1730544150000, + "y": 29 + }, + { + "x": 1730544180000, + "y": 25 + }, + { + "x": 1730544210000, + "y": 23 + }, + { + "x": 1730544240000, + "y": 27 + }, + { + "x": 1730544270000, + "y": 26 + }, + { + "x": 1730544300000, + "y": 27 + }, + { + "x": 1730544330000, + "y": 25 + }, + { + "x": 1730544360000, + "y": 31 + }, + { + "x": 1730544390000, + "y": 21 + }, + { + "x": 1730544420000, + "y": 27 + }, + { + "x": 1730544450000, + "y": 25 + }, + { + "x": 1730544480000, + "y": 29 + }, + { + "x": 1730544510000, + "y": 23 + }, + { + "x": 1730544540000, + "y": 27 + }, + { + "x": 1730544570000, + "y": 24 + }, + { + "x": 1730544600000, + "y": 31 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 24 + }, + { + "x": 1730544690000, + "y": 27 + }, + { + "x": 1730544720000, + "y": 27 + }, + { + "x": 1730544750000, + "y": 27 + }, + { + "x": 1730544780000, + "y": 24 + }, + { + "x": 1730544810000, + "y": 25 + }, + { + "x": 1730544840000, + "y": 26 + }, + { + "x": 1730544870000, + "y": 29 + }, + { + "x": 1730544900000, + "y": 33 + }, + { + "x": 1730544930000, + "y": 34 + }, + { + "x": 1730544960000, + "y": 25 + }, + { + "x": 1730544990000, + "y": 28 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jmoh", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1068, + "pattern": "10.244.0.38 02 2024 10 0000 GET HTTP 1.1 python requests 2.31.0 default my otel demo frontendproxy 8080 10.244.0.26 8080", + "regex": ".*?10\\.244\\.0\\.38.+?02.+?2024.+?10.+?0000.+?GET.+?HTTP.+?1\\.1.+?python.+?requests.+?2\\.31\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\.244\\.0\\.26.+?8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:06 +0000] \"GET /api/cart HTTP/1.1\" 200 24 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 24 0.003 200 33934468a35902ed5b6dde14b1aca6a0\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:06 +0000] \"GET /api/cart HTTP/1.1\" 200 24 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 24 0.003 200 33934468a35902ed5b6dde14b1aca6a0\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:32.391Z", + "lastOccurrence": "2024-11-02T10:56:57.316Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 25 + }, + { + "x": 1730543820000, + "y": 27 + }, + { + "x": 1730543850000, + "y": 26 + }, + { + "x": 1730543880000, + "y": 26 + }, + { + "x": 1730543910000, + "y": 26 + }, + { + "x": 1730543940000, + "y": 27 + }, + { + "x": 1730543970000, + "y": 24 + }, + { + "x": 1730544000000, + "y": 25 + }, + { + "x": 1730544030000, + "y": 22 + }, + { + "x": 1730544060000, + "y": 27 + }, + { + "x": 1730544090000, + "y": 20 + }, + { + "x": 1730544120000, + "y": 23 + }, + { + "x": 1730544150000, + "y": 29 + }, + { + "x": 1730544180000, + "y": 25 + }, + { + "x": 1730544210000, + "y": 23 + }, + { + "x": 1730544240000, + "y": 27 + }, + { + "x": 1730544270000, + "y": 26 + }, + { + "x": 1730544300000, + "y": 27 + }, + { + "x": 1730544330000, + "y": 25 + }, + { + "x": 1730544360000, + "y": 31 + }, + { + "x": 1730544390000, + "y": 21 + }, + { + "x": 1730544420000, + "y": 27 + }, + { + "x": 1730544450000, + "y": 25 + }, + { + "x": 1730544480000, + "y": 29 + }, + { + "x": 1730544510000, + "y": 23 + }, + { + "x": 1730544540000, + "y": 27 + }, + { + "x": 1730544570000, + "y": 24 + }, + { + "x": 1730544600000, + "y": 31 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 24 + }, + { + "x": 1730544690000, + "y": 27 + }, + { + "x": 1730544720000, + "y": 27 + }, + { + "x": 1730544750000, + "y": 27 + }, + { + "x": 1730544780000, + "y": 24 + }, + { + "x": 1730544810000, + "y": 25 + }, + { + "x": 1730544840000, + "y": 26 + }, + { + "x": 1730544870000, + "y": 29 + }, + { + "x": 1730544900000, + "y": 32 + }, + { + "x": 1730544930000, + "y": 34 + }, + { + "x": 1730544960000, + "y": 25 + }, + { + "x": 1730544990000, + "y": 28 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "vzwi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 262, + "pattern": "POST HTTP/1.1 python-requests/2.31.0 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?POST.+?HTTP/1\\.1.+?python-requests/2\\.31\\.0.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:03 +0000] \"POST /api/checkout HTTP/1.1\" 200 984 \"-\" \"python-requests/2.31.0\" 780 0.068 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 984 0.069 200 f87d6397ec8b5740f05f1f3ca07adf50\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:03 +0000] \"POST /api/checkout HTTP/1.1\" 200 984 \"-\" \"python-requests/2.31.0\" 780 0.068 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 984 0.069 200 f87d6397ec8b5740f05f1f3ca07adf50\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.220Z", + "lastOccurrence": "2024-11-02T10:56:45.575Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 5 + }, + { + "x": 1730543820000, + "y": 10 + }, + { + "x": 1730543850000, + "y": 14 + }, + { + "x": 1730543880000, + "y": 3 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 12 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 7 + }, + { + "x": 1730544060000, + "y": 5 + }, + { + "x": 1730544090000, + "y": 5 + }, + { + "x": 1730544120000, + "y": 5 + }, + { + "x": 1730544150000, + "y": 5 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 9 + }, + { + "x": 1730544240000, + "y": 5 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 14 + }, + { + "x": 1730544330000, + "y": 7 + }, + { + "x": 1730544360000, + "y": 10 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 4 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 3 + }, + { + "x": 1730544570000, + "y": 9 + }, + { + "x": 1730544600000, + "y": 5 + }, + { + "x": 1730544630000, + "y": 9 + }, + { + "x": 1730544660000, + "y": 3 + }, + { + "x": 1730544690000, + "y": 14 + }, + { + "x": 1730544720000, + "y": 13 + }, + { + "x": 1730544750000, + "y": 2 + }, + { + "x": 1730544780000, + "y": 5 + }, + { + "x": 1730544810000, + "y": 3 + }, + { + "x": 1730544840000, + "y": 7 + }, + { + "x": 1730544870000, + "y": 5 + }, + { + "x": 1730544900000, + "y": 11 + }, + { + "x": 1730544930000, + "y": 11 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 2 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "vdjm", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 263, + "pattern": "10.244.0.38 02 2024 10 0000 api HTTP 1.1 python requests 2.31.0 default my otel demo frontendproxy 8080 10.244.0.26 8080", + "regex": ".*?10\\.244\\.0\\.38.+?02.+?2024.+?10.+?0000.+?api.+?HTTP.+?1\\.1.+?python.+?requests.+?2\\.31\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\.244\\.0\\.26.+?8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.220Z", + "lastOccurrence": "2024-11-02T10:56:45.575Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 5 + }, + { + "x": 1730543820000, + "y": 10 + }, + { + "x": 1730543850000, + "y": 14 + }, + { + "x": 1730543880000, + "y": 3 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 12 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 7 + }, + { + "x": 1730544060000, + "y": 5 + }, + { + "x": 1730544090000, + "y": 5 + }, + { + "x": 1730544120000, + "y": 5 + }, + { + "x": 1730544150000, + "y": 5 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 9 + }, + { + "x": 1730544240000, + "y": 5 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 14 + }, + { + "x": 1730544330000, + "y": 7 + }, + { + "x": 1730544360000, + "y": 10 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 4 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 3 + }, + { + "x": 1730544570000, + "y": 9 + }, + { + "x": 1730544600000, + "y": 5 + }, + { + "x": 1730544630000, + "y": 9 + }, + { + "x": 1730544660000, + "y": 3 + }, + { + "x": 1730544690000, + "y": 14 + }, + { + "x": 1730544720000, + "y": 13 + }, + { + "x": 1730544750000, + "y": 2 + }, + { + "x": 1730544780000, + "y": 5 + }, + { + "x": 1730544810000, + "y": 3 + }, + { + "x": 1730544840000, + "y": 7 + }, + { + "x": 1730544870000, + "y": 5 + }, + { + "x": 1730544900000, + "y": 12 + }, + { + "x": 1730544930000, + "y": 11 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 2 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "hxyo", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [], + "searches": [ + { + "fragments": [ + "10.244.0.38:8080", + "10.244.0.38", + "8080" + ], + "appearsAs": "This IP address and port are referenced as attributes.source.address, attributes.upstream.address in the investigated entity service.name:controller." + }, + { + "fragments": [ + "http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart", + "/api/cart" + ], + "appearsAs": "These URL fragments appear as attributes.http.request.referrer, attributes.url.original in the investigated entity service.name:controller." + }, + { + "fragments": [ + "/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF", + "sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57", + "currencyCode=CHF" + ], + "appearsAs": "These URL fragments appear as attributes.url.query in the investigated entity service.name:controller." + }, + { + "fragments": [ + "default-my-otel-demo-frontendproxy-8080", + "frontendproxy", + "frontend" + ], + "appearsAs": "These service names appear as attributes.upstream.name in the investigated entity service.name:controller." + }, + { + "fragments": [ + "e6bae77cfb5b598f1d725bc6cc52d06d", + "506" + ], + "appearsAs": " These fragments appear as attributes.http.request.time, attributes.http.response.status_code in the investigated entity service.name:controller." + } + ], + "relatedEntitiesSummaries": [ + "### Related Entities Analysis\n\n#### 1. Entity: service.name:frontend\n- **Indicators (Strength: Average to Strong):**\n - Field: `attributes.upstream.name` in service.name:controller - `default-my-otel-demo-frontendproxy-8080`\n - Field: `kubernetes.pod.name.text` in service.name:frontend - `my-otel-demo-frontend-5bbf4d78bc-qtwdr`\n - URL paths in logs that suggest interactions with the frontend service, specifically `/api/cart`.\n- **Reasoning:** The `frontend` service interacts closely with the `controller` (ingress-nginx-controller). Requests directed to `/api/cart` initiate from `frontendproxy` which routes to `frontend`. Given the high error rate at the `/api/cart` endpoint, the issue might involve downstream calls from `frontend` to dependent services.\n- **Overall Likeliness:** High. The `frontend` service is one of the primary services processing requests (user interactions) that subsequently hit the `controller`.\n\n#### 2. Entity: service.name:cartservice\n- **Indicators (Strength: Strong):**\n - Correspondence of session IDs in the request URLs or logs between controller and cartservice.\n - Mention of cart failures in `frontend` interactions - indicated by error logs involving failed RPC calls to `cartservice`.\n - Logs for service.name:cartservice with messages such as `GetCartAsync called with userId=1d9f48dd`.\n- **Reasoning:** The `/api/cart` endpoint directly involves manipulating or retrieving data from `cartservice`. Given the 500 errors on requests routed via the `controller`, it's likely that `cartservice` might be either causing or being affected by these failures.\n- **Overall Likeliness:** High. Direct involvement of `cartservice` is plausible given the issue is associated specifically with cart interactions.\n\n#### 3. Entity: service.name:frontend-web\n- **Indicators (Strength: Average):**\n - URL referrer and path fragments suggest client-side interactions impact the controller’s ingress.\n - URL fields from both controller logs and frontend-web logs such as `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`.\n- **Reasoning:** `frontend-web` represents the client-side application layer. Issues in the client's request construction or timing might be indirectly impacting how the `controller` handles these requests.\n- **Overall Likeliness:** Moderate. While not directly involved in backend processing, interactions originating from the frontend-web could potentially impact the backend flow.\n\n#### 4. Entity: service.name:checkoutservice\n- **Indicators (Strength: Weak):**\n - Shared URL fragments related to the checkout process (`/api/cart` could be an intermediate step).\n - Common use of `sessionId` and `currencyCode` seen in request attributes.\n- **Reasoning:** Though the controller deals directly with cart interactions, completion of cart actions could trigger subsequent processes in `checkoutservice`. Errors during cart operations could thereby propagate issues if mismanaged upstream.\n- **Overall Likeliness:** Low to Moderate. Contextually relevant but perhaps indirectly linked unless specific error propagation is identified.\n\n#### 5. Entity: service.name:coredns\n- **Indicators (Strength: Weak to Average):**\n - DNS logs showing interactions such as `10.244.0.38:45693 - 8080 \"A IN ingress-nginx-controller.ingress-nginx.svc.cluster.local. UDP 74`.\n- **Reasoning:** DNS resolution issues could lead to inability to locate the correct backend service IP for `controller`, causing errors in routing HTTP requests.\n- **Overall Likeliness:** Low. Potential indirect influence but less likely to be the primary cause.\n\n#### Possible Relationship Summary\nGiven these findings:\n\n1. **frontend** and **cartservice** are the most relevant entities with strong indicators of their dependencies and direct involvement in handling requests relevant to the `/api/cart` endpoint. Investigating these services in conjunction with `controller` will likely reveal root causes.\n2. **frontend-web** could be examined for potential client-side initiation issues leading to increased errors, but it remains secondary.\n3. **checkoutservice** may be potentially linked through a sequence of dependencies initiated post-cart operations but is less immediate.\n4. **coredns** could be impacting resolution, yet this remains an unlikely principal cause unless supported by specific DNS errors.\n\nFocus on examining logs and dependencies from `cartservice` and `frontend` to pinpoint exact causes for the reported 500 errors at the `/api/cart` endpoint managed by the controller service.", + "## Analysis and Identification of Related Entities\n\n### Relationship 1: `frontendproxy` (default-my-otel-demo-frontendproxy-8080)\n- **Related entity:** `service.name:frontendproxy`\n- **Indicator strength:** Strong, based on the matching `attributes.upstream.name` field.\n - **Indications:**\n - From `controller` logs: `attributes.upstream.name` = `default-my-otel-demo-frontendproxy-8080`\n - Upstream IP address: `attributes.upstream.address` = `10.244.0.26:8080` in controller logs coinciding with requests that resulted in `500` errors.\n- **Reason:** The `frontendproxy` service routes traffic to the backend services, including the `controller`. Since the `controller` service receives requests and directs traffic to `frontendproxy`, it points to a possible upstream dependency causing the 500 errors during the requests to `/api/cart`.\n- **Overall likeliness:** High. This entity is directly involved since it routes traffic within the system, and its downstream performance or errors reflect on the `controller`.\n\n### Relationship 2: `frontend`\n- **Related entity:** `service.name:frontend`\n- **Indicator strength:** Moderate, observing the infrastructure context and the dependency chain.\n - **Indications:** \n - The `frontend` service is called by the `frontendproxy`, which is indicated as the `attributes.upstream.name` in `controller` logs.\n- **Reason:** In the context provided, the `frontend` communicates with other backend services to process user interactions and might be an upstream dependency for the `controller`. The problem might cascade from `frontendproxy` to `frontend`.\n- **Overall likeliness:** High. This service is critical in handling user interactions, and problems here could cause issue propagation to `controller`.\n\n### Relationship 3: `cartservice`\n- **Related entity:** `service.name:cartservice`\n- **Indicator strength:** Moderate, based on its role in the architecture and likely correlation.\n - **Indications:**\n - The `cartservice` handles shopping cart actions which map the `controller`'s `/api/cart` endpoint.\n - **Reason:** If the `cartservice` has issues, they would cascade to the `controller` /api/cart endpoint that depends on this service for cart management functions.\n- **Overall likeliness:** High. It closely correlates with the endpoint's functionality and possible 500 errors due to backend service inconsistencies.\n\n### Relationship 4: `currencyservice`\n- **Related entity:** `service.name:currencyservice`\n- **Indicator strength:** Weak, contextual dependency but crucial interplay with `cart` operations.\n - **Indications:**\n - Handling currency conversions, indirectly connected to cart operations.\n- **Reason:** The issues might arise if currency conversion fails during cart operations, contributing to the 500 errors in the `controller`.\n- **Overall likeliness:** Moderate. Essential for part of the request chains during cart operations, but primary errors might occur upstream.\n\n### Relationship 5: `productcatalogservice`\n- **Related entity:** `service.name:productcatalogservice`\n- **Indicator strength:** Weak, as no direct log correlation but relevant in the context.\n - **Indications:**\n - Provides product data, indirectly required during cart operations.\n- **Reason:** Cart operations fetching/validating product data might fail, contributing to the `controller` errors when /api/cart requests involve fetching product data.\n- **Overall likeliness:** Moderate. Possible issues here can impact `cartservice` processes and propagate as 500 errors.\n\n### Relationship 6: `frauddetectionservice`\n- **Related entity:** `service.name:frauddetectionservice`\n- **Indicator strength:** Weak, speculative and based more on potential correlation.\n - **Indications:**\n - No specific logs point directly; contextual relevance due to transaction handling.\n- **Reason:** If fraud detection triggers false flags, it can affect cart transactions.\n- **Overall likeliness:** Low. Unlikely direct contributor and more as a consequential involvement in transaction failures.\n\n### Summary\n\nThe `frontendproxy`, `frontend`, and `cartservice` are the most probable related entities with high relevance to the errors indicated in the `controller` service. Investigations should focus on these first, focusing on log patterns and errors cascading through these entities causing the 500 errors on `/api/cart`. Indirect relations like `currencyservice`, `productcatalogservice`, and `frauddetectionservice` can also be explored as part of the broader context.", + "During the investigation of the alert for the `controller` service, we are identifying possible relationships to other entities. We will meticulously examine the evidence from logs, traces, and other relevant data to uncover dependencies and potential causes for the high number of 500 errors on the `/api/cart` endpoint.\n\n### Highly Relevant Entities and Relationships\n\n#### 1. Entity: service.name:frontendproxy\n\n- **Indicators of Evidence**\n - **Strong Indicator**: `attributes.upstream.name: default-my-otel-demo-frontendproxy-8080`\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"attributes.upstream.name\": \"default-my-otel-demo-frontendproxy-8080\"`\n - `\"attributes.upstream.response.status_code\": [\"500\", \"200\", \"308\"]`\n - **Fingerprinting Evidence**:\n - `\"message\": \"10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \\\"POST /api/cart HTTP/1.1\\\" 500 32 \\\"-\\\" \\\"python-requests/2.31.0\\\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\"`\n\n- **Relationship and Context**\n - The `frontendproxy` service acts as the reverse proxy, routing incoming HTTP traffic to different backend services, including the `controller`. The errors appearing in the `controller` log indicate communication issues between the `controller` and the `frontendproxy`.\n\n- **Overall Likeliness**: High\n - Given the primary role of the `frontendproxy` in routing traffic to `controller`, coupled with the direct evidence in the logs, this entity is crucial to the situation at hand.\n\n#### 2. Entity: service.name:frontend\n\n- **Indicators of Evidence**\n - **Average Indicator**: `features.service.name: frontend`\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"attributes.http.request.origin\": \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\"`\n - `\"/api/cart` endpoint related queries`\n\n- **Relationship and Context**:\n - The `frontend` service handles key operations related to user interactions before requests are passed to various backend services, including the `controller`. Issues in `frontend`, like poor handling of requests or incorrect data forwarding, might cascade downstream, resulting in 500 errors in the `controller`.\n\n- **Overall Likeliness**: Medium to High\n - Given the data pathway from user interactions handled by `frontend`, it’s essential to determine if `frontend` anomalies are contributing to the failure in `controller`.\n\n#### 3. Entity: service.name:cartservice\n\n- **Indicators of Evidence**\n - **Average Indicator**: `/api/cart` requests typically involving `cartservice`\n - **Field Values in Investigated Entity (`controller`)**:\n - `500 errors at \"/api/cart\"`\n\n- **Relationship and Context**:\n - The `cartservice` directly manages shopping cart operations over the gRPC protocol. While the HTTP API from `controller` might indicate communication failures with `cartservice`, these errors could also originate from improper data requests or transaction handling within `cartservice`.\n\n- **Overall Likeliness**: High\n - Investigating the interaction with `cartservice` can help distinguish if business logic errors or miscommunication between services lead to repeated 500 errors.\n\n### Moderately Relevant Entities\n\n#### 4. Entity: service.name:loadgenerator\n\n- **Indicators of Evidence**\n - **Weak Indicator**: Simulated high traffic which might put strain on other services causing errors.\n - **Field Values in Investigated Entity (`controller`)**:\n - General logged high traffic instances or increased load around the alert time.\n\n- **Relationship and Context**:\n - The `loadgenerator` mimics external user traffic managed by the Ingress and ultimately passed through nodes like `controller`. Excessive load can manifest as backend service overloads or timeouts, indirectly causing 500 errors in `controller`.\n\n- **Overall Likeliness**: Medium\n - Given the traffic simulation aspect, its role is probable but direct correlation to specific error occurrences in `controller` needs corroboration with other data points.\n\n### Less Likely but Contextually Relevant Entities\n\n#### 5. Entity: service.name:etcd\n\n- **Indicators of Evidence**\n - **Weak Indicator**: General mention in logs for Ingress control plane activity\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"response count\": 0`, signifying Ingress data handling might be amiss during high traffic\n\n- **Relationship and Context**:\n - Possible indirect impact wherein control plane malfunctions or data inconsistencies in the `etcd` state can propagate as issues dispersed across services interacting via Ingress, including `controller`.\n\n- **Overall Likeliness**: Medium\n - This needs verifying integration with upstream Ingress state logs to validate contributions to observed `controller` issues.\n\n### Further Investigations and Likelihood Summary\n\nBased on logs and identified relationships, we will prioritize looking into:\n\n1. **Frontendproxy** - Checking its health, routing efficiency, and connections to `controller`.\n2. **Frontend** - Verifying its data handling during user interactions that lead to API cart errors.\n3. **Cartservice** - Ensuring logical transactions and gRPC communications, ruling out core service bugs.\n\nWe will cross-reference error logs, API traces, and dependency interactions tightly intertwined with the `controller` to form a comprehensive approach to resolution." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 3 + } + ] + } + } + }, + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_DB13TclS3Gc9zUgCrWLrvDuu", + "function": { + "name": "observe", + "arguments": { + "observe": true + } + } + } + ] + }, + { + "name": "observe", + "response": { + "content": "### Context and Ongoing Investigation\n\nThe initial context indicated that the `controller` service was experiencing an alert due to a high number of `500 Internal Server Errors` on the `/api/cart` endpoint. The error rate was significantly high (98.78%), suggesting a severe issue within the `controller` service or its dependencies. During the initial investigation of the `controller` service, it was determined that the errors resulted from HTTP POST requests to the `/api/cart` endpoint emanating from a client using `python-requests/2.31.0`.\n\n### Key Observations and Analysis from Investigations\n\n#### 1. `controller` Service Characteristics\n\n- **Environment**: The `controller` service runs in a Kubernetes environment (`ingress-nginx` namespace), with the pod named `ingress-nginx-controller-bc57996ff-r6blf` on node `minikube`.\n- **Functionality**: Acts as an Ingress controller managing HTTP requests routing to backend services including the `frontendproxy`.\n- **Observations**:\n - Pattern showing consistent `500 Internal Server Error` for POST requests to `/api/cart`.\n - Most of these errors originate from requests routed through the `frontendproxy`.\n\n#### 2. Related Entities and Their Possible Impact\n\nEntities that closely interact with `controller` or are otherwise significant to `controller’s` functionality were assessed:\n\n1. **`frontend`**:\n - Interacts with the `controller` for routing requests.\n - Downstream dependencies and interactions might propagate errors.\n\n2. **`cartservice`**:\n - Directly involved in handling requests for the `/api/cart` endpoint.\n - Any issues here could cause `controller` errors.\n\n3. **`frontend-web`**:\n - Client-side interactions leading to requests to `/api/cart` via `controller`.\n - Potential timing or construction issues in requests.\n\n4. **Other entities (`checkoutservice`, `coredns`)**:\n - Indirectly related with varying degrees of confidence on impact.\n\n### Timeline of Significant Events\n\n1. **2024-11-02T10:56:00.000Z**:\n - **Observation**:\n - 6 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - Example Log:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n2. **2024-11-02T10:56:30.000Z**:\n - **Observation**:\n - 2 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - Example Log:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:35 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n3. **2024-11-02T10:56:42.498Z**:\n - **Alert Triggered**:\n - High number of 500 errors for the /api/cart endpoint. Error rate is 98.78%, above the threshold of 1% over a 1-minute duration.\n\n### Context and Reasoning\n\nThe `controller` service functions as the main ingress gateway, routing HTTP requests to the appropriate backend services including the `frontendproxy`, and more specifically the downstream `cartservice`. The nature of the high error rates observed at `/api/cart`, particularly for POST requests, suggests the problem could originate either at the `cartservice` backend or along the routing path between `controller`, `frontendproxy`, and `cartservice`.\n\n#### Potential Root Causes\n- **Backend Service Issue**:\n Given the direct involvement of `cartservice` in `/api/cart` operations, issues here could easily propagate into repeated 500 errors seen by the `controller`.\n- **Routing/Network Issues**:\n Communication path issues (e.g., `frontendproxy` to `cartservice`) causing errors in routing HTTP requests could result in these errors.\n\n### Next Steps\n\nGiven the strong patterns:\n\n1. **Investigate `cartservice`**:\n - As the downstream service handling `/api/cart` requests, issues here would directly contribute to the observed error patterns in `controller`.\n\n2. **Investigate `frontendproxy`**:\n - Since requests are routed through this service to `cartservice`, any routing or network issues here might also contribute to the errors.\n\nUpon investigating both entities, performing more detailed inspections of the logs and interactions might reveal issues that propagate these failures. This should help isolate the fault in the communication path or within the specific services causing the `500 Internal Server Errors` seen in `controller`.\n\n**Entities to Investigate Next**:\n- **cartservice**\n- **frontendproxy**\n\nThese investigations will provide further insights into whether the root cause is localized to `cartservice` itself or issues are emergent from the routing path involving `frontendproxy`." + }, + "data": { + "content": "### Context and Ongoing Investigation\n\nThe initial context indicated that the `controller` service was experiencing an alert due to a high number of `500 Internal Server Errors` on the `/api/cart` endpoint. The error rate was significantly high (98.78%), suggesting a severe issue within the `controller` service or its dependencies. During the initial investigation of the `controller` service, it was determined that the errors resulted from HTTP POST requests to the `/api/cart` endpoint emanating from a client using `python-requests/2.31.0`.\n\n### Key Observations and Analysis from Investigations\n\n#### 1. `controller` Service Characteristics\n\n- **Environment**: The `controller` service runs in a Kubernetes environment (`ingress-nginx` namespace), with the pod named `ingress-nginx-controller-bc57996ff-r6blf` on node `minikube`.\n- **Functionality**: Acts as an Ingress controller managing HTTP requests routing to backend services including the `frontendproxy`.\n- **Observations**:\n - Pattern showing consistent `500 Internal Server Error` for POST requests to `/api/cart`.\n - Most of these errors originate from requests routed through the `frontendproxy`.\n\n#### 2. Related Entities and Their Possible Impact\n\nEntities that closely interact with `controller` or are otherwise significant to `controller’s` functionality were assessed:\n\n1. **`frontend`**:\n - Interacts with the `controller` for routing requests.\n - Downstream dependencies and interactions might propagate errors.\n\n2. **`cartservice`**:\n - Directly involved in handling requests for the `/api/cart` endpoint.\n - Any issues here could cause `controller` errors.\n\n3. **`frontend-web`**:\n - Client-side interactions leading to requests to `/api/cart` via `controller`.\n - Potential timing or construction issues in requests.\n\n4. **Other entities (`checkoutservice`, `coredns`)**:\n - Indirectly related with varying degrees of confidence on impact.\n\n### Timeline of Significant Events\n\n1. **2024-11-02T10:56:00.000Z**:\n - **Observation**:\n - 6 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - Example Log:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n2. **2024-11-02T10:56:30.000Z**:\n - **Observation**:\n - 2 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - Example Log:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:35 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n3. **2024-11-02T10:56:42.498Z**:\n - **Alert Triggered**:\n - High number of 500 errors for the /api/cart endpoint. Error rate is 98.78%, above the threshold of 1% over a 1-minute duration.\n\n### Context and Reasoning\n\nThe `controller` service functions as the main ingress gateway, routing HTTP requests to the appropriate backend services including the `frontendproxy`, and more specifically the downstream `cartservice`. The nature of the high error rates observed at `/api/cart`, particularly for POST requests, suggests the problem could originate either at the `cartservice` backend or along the routing path between `controller`, `frontendproxy`, and `cartservice`.\n\n#### Potential Root Causes\n- **Backend Service Issue**:\n Given the direct involvement of `cartservice` in `/api/cart` operations, issues here could easily propagate into repeated 500 errors seen by the `controller`.\n- **Routing/Network Issues**:\n Communication path issues (e.g., `frontendproxy` to `cartservice`) causing errors in routing HTTP requests could result in these errors.\n\n### Next Steps\n\nGiven the strong patterns:\n\n1. **Investigate `cartservice`**:\n - As the downstream service handling `/api/cart` requests, issues here would directly contribute to the observed error patterns in `controller`.\n\n2. **Investigate `frontendproxy`**:\n - Since requests are routed through this service to `cartservice`, any routing or network issues here might also contribute to the errors.\n\nUpon investigating both entities, performing more detailed inspections of the logs and interactions might reveal issues that propagate these failures. This should help isolate the fault in the communication path or within the specific services causing the `500 Internal Server Errors` seen in `controller`.\n\n**Entities to Investigate Next**:\n- **cartservice**\n- **frontendproxy**\n\nThese investigations will provide further insights into whether the root cause is localized to `cartservice` itself or issues are emergent from the routing path involving `frontendproxy`.", + "investigations": [ + { + "attachments": { + "alerts": [ + { + "kibana.alert.reason": "500 Errors is 98.78049, above the threshold of 1. (duration: 1 min, data view: otel_logs_data (Automated by Demo CLI), group: controller,/api/cart)", + "kibana.alert.evaluation.values": [ + 98.78048780487805 + ], + "kibana.alert.evaluation.threshold": [ + 1 + ], + "kibana.alert.group": [ + { + "field": "service.name", + "value": "controller" + }, + { + "field": "url.path", + "value": "/api/cart" + } + ], + "tags": [ + "demo", + "cli-created" + ], + "service.name": "controller", + "kibana.alert.rule.category": "Custom threshold", + "kibana.alert.rule.consumer": "logs", + "kibana.alert.rule.execution.uuid": "4187827d-686e-4098-98e3-21e13495798e", + "kibana.alert.rule.name": "NGINX 500s", + "kibana.alert.rule.parameters": { + "criteria": [ + { + "comparator": ">", + "metrics": [ + { + "name": "A", + "filter": "http.response.status_code:*", + "aggType": "count" + }, + { + "name": "B", + "filter": "http.response.status_code>=500", + "aggType": "count" + } + ], + "threshold": [ + 1 + ], + "timeSize": 1, + "timeUnit": "m", + "equation": "(B/A) * 100", + "label": "500 Errors" + } + ], + "alertOnNoData": false, + "alertOnGroupDisappear": false, + "searchConfiguration": { + "query": { + "query": "k8s.namespace.name: \"ingress-nginx\" AND url.path: /api/*", + "language": "kuery" + }, + "index": "otel_logs_data" + }, + "groupBy": [ + "service.name", + "url.path" + ] + }, + "kibana.alert.rule.producer": "observability", + "kibana.alert.rule.revision": 0, + "kibana.alert.rule.rule_type_id": "observability.rules.custom_threshold", + "kibana.alert.rule.tags": [ + "demo", + "cli-created" + ], + "kibana.alert.rule.uuid": "9055220c-8fb1-4f9f-be7c-0a33eb2bafc5", + "kibana.space_ids": [ + "default" + ], + "@timestamp": "2024-11-02T10:56:42.498Z", + "event.action": "open", + "event.kind": "signal", + "kibana.alert.rule.execution.timestamp": "2024-11-02T10:56:42.498Z", + "kibana.alert.action_group": "custom_threshold.fired", + "kibana.alert.flapping": false, + "kibana.alert.flapping_history": [ + true + ], + "kibana.alert.instance.id": "controller,/api/cart", + "kibana.alert.maintenance_window_ids": [], + "kibana.alert.consecutive_matches": 1, + "kibana.alert.status": "active", + "kibana.alert.uuid": "b97a1b20-d14b-4835-b948-bd7a423284eb", + "kibana.alert.severity_improving": false, + "kibana.alert.workflow_status": "open", + "kibana.alert.duration.us": 0, + "kibana.alert.start": "2024-11-02T10:56:42.498Z", + "kibana.alert.time_range": { + "gte": "2024-11-02T10:56:42.498Z" + }, + "kibana.version": "9.0.0" + }, + { + "kibana.alert.reason": "500 Errors is 100, above the threshold of 1. (duration: 1 min, data view: otel_logs_data (Automated by Demo CLI), group: controller,/api/checkout)", + "kibana.alert.evaluation.values": [ + 100 + ], + "kibana.alert.evaluation.threshold": [ + 1 + ], + "kibana.alert.group": [ + { + "field": "service.name", + "value": "controller" + }, + { + "field": "url.path", + "value": "/api/checkout" + } + ], + "tags": [ + "demo", + "cli-created" + ], + "service.name": "controller", + "kibana.alert.rule.category": "Custom threshold", + "kibana.alert.rule.consumer": "logs", + "kibana.alert.rule.execution.uuid": "4187827d-686e-4098-98e3-21e13495798e", + "kibana.alert.rule.name": "NGINX 500s", + "kibana.alert.rule.parameters": { + "criteria": [ + { + "comparator": ">", + "metrics": [ + { + "name": "A", + "filter": "http.response.status_code:*", + "aggType": "count" + }, + { + "name": "B", + "filter": "http.response.status_code>=500", + "aggType": "count" + } + ], + "threshold": [ + 1 + ], + "timeSize": 1, + "timeUnit": "m", + "equation": "(B/A) * 100", + "label": "500 Errors" + } + ], + "alertOnNoData": false, + "alertOnGroupDisappear": false, + "searchConfiguration": { + "query": { + "query": "k8s.namespace.name: \"ingress-nginx\" AND url.path: /api/*", + "language": "kuery" + }, + "index": "otel_logs_data" + }, + "groupBy": [ + "service.name", + "url.path" + ] + }, + "kibana.alert.rule.producer": "observability", + "kibana.alert.rule.revision": 0, + "kibana.alert.rule.rule_type_id": "observability.rules.custom_threshold", + "kibana.alert.rule.tags": [ + "demo", + "cli-created" + ], + "kibana.alert.rule.uuid": "9055220c-8fb1-4f9f-be7c-0a33eb2bafc5", + "kibana.space_ids": [ + "default" + ], + "@timestamp": "2024-11-02T10:56:42.498Z", + "event.action": "open", + "event.kind": "signal", + "kibana.alert.rule.execution.timestamp": "2024-11-02T10:56:42.498Z", + "kibana.alert.action_group": "custom_threshold.fired", + "kibana.alert.flapping": false, + "kibana.alert.flapping_history": [ + true + ], + "kibana.alert.instance.id": "controller,/api/checkout", + "kibana.alert.maintenance_window_ids": [], + "kibana.alert.consecutive_matches": 1, + "kibana.alert.status": "active", + "kibana.alert.uuid": "78472a9c-63a2-41ba-9812-47cebd48d833", + "kibana.alert.severity_improving": false, + "kibana.alert.workflow_status": "open", + "kibana.alert.duration.us": 0, + "kibana.alert.start": "2024-11-02T10:56:42.498Z", + "kibana.alert.time_range": { + "gte": "2024-11-02T10:56:42.498Z" + }, + "kibana.version": "9.0.0" + } + ], + "slos": [], + "analysis": { + "total": 56181, + "sampled": 1000, + "fields": [ + "@timestamp:date - 994 distinct values", + "app.label.component:keyword - 1 distinct values (`controller`)", + "attributes.event.name.text:text - 1 distinct values (`nginx.ingress.controller.error`)", + "attributes.event.name:keyword - 1 distinct values (`nginx.ingress.controller.error`)", + "attributes.http.request.id:keyword - 1000 distinct values (`87c973a800b3bd34d3679f0a12263c40`, `ee99fada68450d77be61deaae1f04008`, `80312e7e98e9171c8010e442784e7a04`, `a931c4f7d964f91f0a0750f3221dfa50`, `8c2e99672e225b279a7741671c976c93`, `eed4ff70db044f81adeda15bc1f3ad4c`, `dd730f83b894fc2adedfaf950cf5884c`, `4e35653560a824d6693d1e024906e9ce`, `36d6dfae2fe5d6fecbfaadd4fac5bde1`, `43c774bea806c21478f7ee57a449222b`, 990 more values)", + "attributes.http.request.method:keyword - 2 distinct values (`POST`, `GET`)", + "attributes.http.request.referrer:keyword - 2 distinct values (`http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/`, `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`)", + "attributes.http.request.size:long - 61 distinct values (`351`, `374`, `373`, `809`, `383`, `506`, `342`, `350`, `538`, `479`, 51 more values)", + "attributes.http.request.time:float - 90 distinct values (`3.172`, `1.103`, `0.053`, `4.434`, `0.019`, `3.328`, `1.01`, `3.197`, `3.133`, `2.566`, 80 more values)", + "attributes.http.response.body.size:long - 130 distinct values (`1144`, `1120`, `1024`, `19`, `1336`, `1198`, `1070`, `111157`, `111163`, `1271`, 120 more values)", + "attributes.http.response.status_code:long - 4 distinct values (`499`, `500`, `308`, `200`)", + "attributes.http.version:keyword - 1 distinct values (`1.1`)", + "attributes.log.file.path.text:text - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "attributes.log.file.path:keyword - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "attributes.log.iostream:keyword - 1 distinct values (`stdout`)", + "attributes.network.protocol.name.text:text - 1 distinct values (`http`)", + "attributes.network.protocol.name:keyword - 1 distinct values (`http`)", + "attributes.source.address:keyword - 1 distinct values (`10.244.0.38`)", + "attributes.upstream.address:keyword - 1 distinct values (`10.244.0.26:8080`)", + "attributes.upstream.name.text:text - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "attributes.upstream.name:keyword - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "attributes.upstream.response.size:keyword - 117 distinct values (`1149`, `1120`, `1029`, `19`, `1336`, `1203`, `1070`, `1276`, `1356`, `1105`, 107 more values)", + "attributes.upstream.response.status_code:keyword - 3 distinct values (`500`, `308`, `200`)", + "attributes.upstream.response.time:keyword - 89 distinct values (`3.171`, `1.007`, `1.103`, `0.053`, `4.434`, `3.328`, `1.010`, `3.197`, `3.132`, `2.565`, 79 more values)", + "attributes.url.domain:keyword - 2 distinct values (`icons`, ``)", + "attributes.url.extension:keyword - 7 distinct values (`css`, `Service/ResolveAll`, `Service/EventStream`, `png`, `svg`, `jpg`, `js`)", + "attributes.url.original.text:text - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, 165 more values)", + "attributes.url.original:keyword - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `/api/recommendations?productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `/api/cart?sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `/api/recommendations?productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `/api/data/`, `/api/cart?sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `/api/recommendations?productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `/api/recommendations?productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `/api/cart?sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, 157 more values)", + "attributes.url.path:keyword - 43 distinct values (`/api/products/0PUK6V6EV0`, `/api/products/9SIQT8TOJO`, `/api/products/LS4PSXUNUM`, `/api/data/`, `/api/products/L9ECAV7KIM`, `/api/data`, `/api/products/66VCHSJNUP`, `/api/products/2ZYFJ3GM2N`, `/cart`, `/images/products/NationalParkFoundationExplorascope.jpg`, 33 more values)", + "attributes.url.query:keyword - 126 distinct values (`productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, `productIds=&sessionId=0c122e28-e8fb-4ab5-9889-ac797b5f17cf¤cyCode=USD`, 116 more values)", + "attributes.url.scheme:keyword - 1 distinct values (``)", + "attributes.user_agent.name.text:text - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "attributes.user_agent.name:keyword - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "attributes.user_agent.original.text:text - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "attributes.user_agent.original:keyword - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "attributes.user_agent.version:keyword - 2 distinct values (`2.31`, `120.0.6099`)", + "body.text:text - 1000 distinct values (`10.244.0.38 - - [02/Nov/2024:10:37:56 +0000] \"GET /api/currency? HTTP/1.1\" 200 199 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 598 0.007 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 199 0.007 200 87c973a800b3bd34d3679f0a12263c40\n`, `10.244.0.38 - - [02/Nov/2024:10:46:11 +0000] \"GET /_next/static/chunks/pages/_app-c923ae378a182a07.js HTTP/1.1\" 200 111150 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 484 0.017 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 111008 0.018 200 ee99fada68450d77be61deaae1f04008\n`, 998 more values)", + "data_stream.dataset:keyword - 1 distinct values (`nginx_ingress_controller.error.otel`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`logs`)", + "deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "dropped_attributes_count:long - 1 distinct values (`0`)", + "event.dataset:keyword - 1 distinct values (`nginx_ingress_controller.error.otel`)", + "event.name:keyword - 1 distinct values (`nginx.ingress.controller.error`)", + "host.arch:keyword - 1 distinct values (`arm64`)", + "host.architecture:keyword - 1 distinct values (`arm64`)", + "host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "host.cpu.family:keyword - 1 distinct values (``)", + "host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "host.cpu.model.name:keyword - 1 distinct values (``)", + "host.cpu.stepping:keyword - 1 distinct values (`0`)", + "host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "host.os.full:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "host.os.platform:keyword - 1 distinct values (`linux`)", + "http.request.id:keyword - 1000 distinct values (`87c973a800b3bd34d3679f0a12263c40`, `ee99fada68450d77be61deaae1f04008`, `80312e7e98e9171c8010e442784e7a04`, `a931c4f7d964f91f0a0750f3221dfa50`, `8c2e99672e225b279a7741671c976c93`, `eed4ff70db044f81adeda15bc1f3ad4c`, `dd730f83b894fc2adedfaf950cf5884c`, `4e35653560a824d6693d1e024906e9ce`, `36d6dfae2fe5d6fecbfaadd4fac5bde1`, `43c774bea806c21478f7ee57a449222b`, 990 more values)", + "http.request.method:keyword - 2 distinct values (`POST`, `GET`)", + "http.request.referrer:keyword - 2 distinct values (`http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/`, `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`)", + "http.request.size:long - 61 distinct values (`351`, `374`, `373`, `809`, `383`, `506`, `342`, `350`, `538`, `479`, 51 more values)", + "http.request.time:float - 90 distinct values (`3.172`, `1.103`, `0.053`, `4.434`, `0.019`, `3.328`, `1.01`, `3.197`, `3.133`, `2.566`, 80 more values)", + "http.response.body.size:long - 130 distinct values (`1144`, `1120`, `1024`, `19`, `1336`, `1198`, `1070`, `111157`, `111163`, `1271`, 120 more values)", + "http.response.status_code:long - 4 distinct values (`499`, `500`, `308`, `200`)", + "http.version:keyword - 1 distinct values (`1.1`)", + "k8s.container.name:keyword - 1 distinct values (`controller`)", + "k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "k8s.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "k8s.namespace.name:keyword - 1 distinct values (`ingress-nginx`)", + "k8s.node.name:keyword - 1 distinct values (`minikube`)", + "k8s.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T08:56:56Z`)", + "k8s.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "kubernetes.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "kubernetes.namespace:keyword - 1 distinct values (`ingress-nginx`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "log.file.path:keyword - 1 distinct values (`/var/log/pods/ingress-nginx_ingress-nginx-controller-bc57996ff-r6blf_35200065-5cde-4a7e-9018-0f0a4e2c5bb4/controller/0.log`)", + "log.iostream:keyword - 1 distinct values (`stdout`)", + "message:text - 1000 distinct values (`10.244.0.38 - - [02/Nov/2024:10:37:56 +0000] \"GET /api/currency? HTTP/1.1\" 200 199 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 598 0.007 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 199 0.007 200 87c973a800b3bd34d3679f0a12263c40\n`, `10.244.0.38 - - [02/Nov/2024:10:46:11 +0000] \"GET /_next/static/chunks/pages/_app-c923ae378a182a07.js HTTP/1.1\" 200 111150 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 484 0.017 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 111008 0.018 200 ee99fada68450d77be61deaae1f04008\n`, 998 more values)", + "network.protocol.name:keyword - 1 distinct values (`http`)", + "observed_timestamp:date_nanos - 1000 distinct values (`2024-11-02T10:37:56.158731715Z`, `2024-11-02T10:46:11.961228541Z`, `2024-11-02T10:38:02.758802635Z`, `2024-11-02T10:54:51.563521629Z`, `2024-11-02T10:37:05.149442469Z`, `2024-11-02T10:49:01.961126259Z`, `2024-11-02T10:56:19.96308167Z`, `2024-11-02T10:42:06.760264887Z`, `2024-11-02T10:49:45.76210446Z`, `2024-11-02T10:54:02.562840801Z`, 990 more values)", + "os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.app.label.component:keyword - 1 distinct values (`controller`)", + "resource.attributes.deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "resource.attributes.host.arch:keyword - 1 distinct values (`arm64`)", + "resource.attributes.host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "resource.attributes.host.cpu.family:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "resource.attributes.host.cpu.model.name.text:text - 1 distinct values (``)", + "resource.attributes.host.cpu.model.name:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.stepping:keyword - 1 distinct values (`0`)", + "resource.attributes.host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "resource.attributes.host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "resource.attributes.host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "resource.attributes.host.name:keyword - 1 distinct values (`otel-daemonset-opentelemetry-collector-agent-7jlpk`)", + "resource.attributes.k8s.container.name.text:text - 1 distinct values (`controller`)", + "resource.attributes.k8s.container.name:keyword - 1 distinct values (`controller`)", + "resource.attributes.k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "resource.attributes.k8s.deployment.name:keyword - 1 distinct values (`ingress-nginx-controller`)", + "resource.attributes.k8s.namespace.name:keyword - 1 distinct values (`ingress-nginx`)", + "resource.attributes.k8s.node.name:keyword - 1 distinct values (`minikube`)", + "resource.attributes.k8s.pod.name:keyword - 1 distinct values (`ingress-nginx-controller-bc57996ff-r6blf`)", + "resource.attributes.k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T08:56:56Z`)", + "resource.attributes.k8s.pod.uid:keyword - 1 distinct values (`35200065-5cde-4a7e-9018-0f0a4e2c5bb4`)", + "resource.attributes.os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "resource.attributes.os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.service.name.text:text - 1 distinct values (`controller`)", + "resource.attributes.service.name:keyword - 1 distinct values (`controller`)", + "resource.dropped_attributes_count:long - 1 distinct values (`0`)", + "resource.schema_url:keyword - 1 distinct values (`https://opentelemetry.io/schemas/1.6.1`)", + "scope.dropped_attributes_count:long - 1 distinct values (`0`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.name:keyword - 1 distinct values (`controller`)", + "severity_number:byte - 1 distinct values (`0`)", + "source.address:keyword - 1 distinct values (`10.244.0.38`)", + "upstream.address:keyword - 1 distinct values (`10.244.0.26:8080`)", + "upstream.name:keyword - 1 distinct values (`default-my-otel-demo-frontendproxy-8080`)", + "upstream.response.size:keyword - 117 distinct values (`1149`, `1120`, `1029`, `19`, `1336`, `1203`, `1070`, `1276`, `1356`, `1105`, 107 more values)", + "upstream.response.status_code:keyword - 3 distinct values (`500`, `308`, `200`)", + "upstream.response.time:keyword - 89 distinct values (`3.171`, `1.007`, `1.103`, `0.053`, `4.434`, `3.328`, `1.010`, `3.197`, `3.132`, `2.565`, 79 more values)", + "url.domain:keyword - 2 distinct values (`icons`, ``)", + "url.extension:keyword - 7 distinct values (`css`, `Service/ResolveAll`, `Service/EventStream`, `png`, `svg`, `jpg`, `js`)", + "url.original:keyword - 167 distinct values (`/api/recommendations?productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `/api/recommendations?productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `/api/cart?sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `/api/recommendations?productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `/api/data/`, `/api/cart?sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `/api/recommendations?productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `/api/recommendations?productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `/api/cart?sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, 157 more values)", + "url.path:keyword - 43 distinct values (`/api/products/0PUK6V6EV0`, `/api/products/9SIQT8TOJO`, `/api/products/LS4PSXUNUM`, `/api/data/`, `/api/products/L9ECAV7KIM`, `/api/data`, `/api/products/66VCHSJNUP`, `/api/products/2ZYFJ3GM2N`, `/cart`, `/images/products/NationalParkFoundationExplorascope.jpg`, 33 more values)", + "url.query:keyword - 126 distinct values (`productIds=&sessionId=cc71f7a4-0303-4404-8864-820628e21ca0¤cyCode=USD`, `sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF`, `productIds=&sessionId=389794a9-8298-4921-a2fd-523803ed73c3¤cyCode=`, `sessionId=140befa2-624a-4e98-a1c2-fa9d9ccbfbdd¤cyCode=`, `productIds=&sessionId=4cbd2d72-6719-4619-b0a8-09415f9ea500¤cyCode=USD`, `sessionId=b9f19d90-1824-463c-b9f6-95c894a8fc64¤cyCode=`, `productIds=&sessionId=933d52cf-c574-49e7-8432-86f958764dbe¤cyCode=`, `productIds=&sessionId=213624a6-bf31-46c4-aa67-8e2c102a8763¤cyCode=USD`, `sessionId=221a8b46-29b7-4d66-9536-62e1a0d3ad75¤cyCode=CHF`, `productIds=&sessionId=0c122e28-e8fb-4ab5-9889-ac797b5f17cf¤cyCode=USD`, 116 more values)", + "url.scheme:keyword - 1 distinct values (``)", + "user_agent.name:keyword - 2 distinct values (`Python Requests`, `HeadlessChrome`)", + "user_agent.original:keyword - 2 distinct values (`python-requests/2.31.0`, `Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36`)", + "user_agent.version:keyword - 2 distinct values (`2.31`, `120.0.6099`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 54850, + "pattern": "HTTP/1.1 Mozilla/5.0 X11 Linux aarch64 AppleWebKit/537.36 KHTML like Gecko HeadlessChrome/120.0.6099.28 Safari/537.36 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?HTTP/1\\.1.+?Mozilla/5\\.0.+?X11.+?Linux.+?aarch64.+?AppleWebKit/537\\.36.+?KHTML.+?like.+?Gecko.+?HeadlessChrome/120\\.0\\.6099\\.28.+?Safari/537\\.36.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:54:54 +0000] \"GET /icons/Chevron.svg HTTP/1.1\" 200 805 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 508 0.001 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 810 0.001 200 8693bfefd0668ca27fff0e929785a2c5\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:54:54 +0000] \"GET /icons/Chevron.svg HTTP/1.1\" 200 805 \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/\" \"Mozilla/5.0 (X11; Linux aarch64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/120.0.6099.28 Safari/537.36\" 508 0.001 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 810 0.001 200 8693bfefd0668ca27fff0e929785a2c5\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.057Z", + "lastOccurrence": "2024-11-02T10:56:59.420Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1385 + }, + { + "x": 1730543820000, + "y": 1172 + }, + { + "x": 1730543850000, + "y": 1520 + }, + { + "x": 1730543880000, + "y": 1312 + }, + { + "x": 1730543910000, + "y": 986 + }, + { + "x": 1730543940000, + "y": 1030 + }, + { + "x": 1730543970000, + "y": 1248 + }, + { + "x": 1730544000000, + "y": 1395 + }, + { + "x": 1730544030000, + "y": 1371 + }, + { + "x": 1730544060000, + "y": 1289 + }, + { + "x": 1730544090000, + "y": 1467 + }, + { + "x": 1730544120000, + "y": 1223 + }, + { + "x": 1730544150000, + "y": 1429 + }, + { + "x": 1730544180000, + "y": 1329 + }, + { + "x": 1730544210000, + "y": 1224 + }, + { + "x": 1730544240000, + "y": 1424 + }, + { + "x": 1730544270000, + "y": 1409 + }, + { + "x": 1730544300000, + "y": 1405 + }, + { + "x": 1730544330000, + "y": 1322 + }, + { + "x": 1730544360000, + "y": 1326 + }, + { + "x": 1730544390000, + "y": 1416 + }, + { + "x": 1730544420000, + "y": 1391 + }, + { + "x": 1730544450000, + "y": 1320 + }, + { + "x": 1730544480000, + "y": 1384 + }, + { + "x": 1730544510000, + "y": 1457 + }, + { + "x": 1730544540000, + "y": 1415 + }, + { + "x": 1730544570000, + "y": 1386 + }, + { + "x": 1730544600000, + "y": 1337 + }, + { + "x": 1730544630000, + "y": 1315 + }, + { + "x": 1730544660000, + "y": 1259 + }, + { + "x": 1730544690000, + "y": 1403 + }, + { + "x": 1730544720000, + "y": 1352 + }, + { + "x": 1730544750000, + "y": 1396 + }, + { + "x": 1730544780000, + "y": 1325 + }, + { + "x": 1730544810000, + "y": 1365 + }, + { + "x": 1730544840000, + "y": 1387 + }, + { + "x": 1730544870000, + "y": 1414 + }, + { + "x": 1730544900000, + "y": 1210 + }, + { + "x": 1730544930000, + "y": 1344 + }, + { + "x": 1730544960000, + "y": 1444 + }, + { + "x": 1730544990000, + "y": 1264 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "dip", + "significance": "medium", + "change_point": 4, + "p_value": 0.00005345763188668862, + "timestamp": "2024-11-02T10:38:30.000Z" + }, + "shortId": "hhpu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1069, + "pattern": "GET HTTP/1.1 python-requests/2.31.0 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?GET.+?HTTP/1\\.1.+?python-requests/2\\.31\\.0.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:01 +0000] \"GET /api/data HTTP/1.1\" 200 177 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 177 0.003 200 6cf0fcfd1259f68166701125d3c9761c\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:01 +0000] \"GET /api/data HTTP/1.1\" 200 177 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 177 0.003 200 6cf0fcfd1259f68166701125d3c9761c\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:32.391Z", + "lastOccurrence": "2024-11-02T10:56:57.316Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 25 + }, + { + "x": 1730543820000, + "y": 27 + }, + { + "x": 1730543850000, + "y": 26 + }, + { + "x": 1730543880000, + "y": 26 + }, + { + "x": 1730543910000, + "y": 26 + }, + { + "x": 1730543940000, + "y": 27 + }, + { + "x": 1730543970000, + "y": 24 + }, + { + "x": 1730544000000, + "y": 25 + }, + { + "x": 1730544030000, + "y": 22 + }, + { + "x": 1730544060000, + "y": 27 + }, + { + "x": 1730544090000, + "y": 20 + }, + { + "x": 1730544120000, + "y": 23 + }, + { + "x": 1730544150000, + "y": 29 + }, + { + "x": 1730544180000, + "y": 25 + }, + { + "x": 1730544210000, + "y": 23 + }, + { + "x": 1730544240000, + "y": 27 + }, + { + "x": 1730544270000, + "y": 26 + }, + { + "x": 1730544300000, + "y": 27 + }, + { + "x": 1730544330000, + "y": 25 + }, + { + "x": 1730544360000, + "y": 31 + }, + { + "x": 1730544390000, + "y": 21 + }, + { + "x": 1730544420000, + "y": 27 + }, + { + "x": 1730544450000, + "y": 25 + }, + { + "x": 1730544480000, + "y": 29 + }, + { + "x": 1730544510000, + "y": 23 + }, + { + "x": 1730544540000, + "y": 27 + }, + { + "x": 1730544570000, + "y": 24 + }, + { + "x": 1730544600000, + "y": 31 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 24 + }, + { + "x": 1730544690000, + "y": 27 + }, + { + "x": 1730544720000, + "y": 27 + }, + { + "x": 1730544750000, + "y": 27 + }, + { + "x": 1730544780000, + "y": 24 + }, + { + "x": 1730544810000, + "y": 25 + }, + { + "x": 1730544840000, + "y": 26 + }, + { + "x": 1730544870000, + "y": 29 + }, + { + "x": 1730544900000, + "y": 33 + }, + { + "x": 1730544930000, + "y": 34 + }, + { + "x": 1730544960000, + "y": 25 + }, + { + "x": 1730544990000, + "y": 28 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jmoh", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1068, + "pattern": "10.244.0.38 02 2024 10 0000 GET HTTP 1.1 python requests 2.31.0 default my otel demo frontendproxy 8080 10.244.0.26 8080", + "regex": ".*?10\\.244\\.0\\.38.+?02.+?2024.+?10.+?0000.+?GET.+?HTTP.+?1\\.1.+?python.+?requests.+?2\\.31\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\.244\\.0\\.26.+?8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:06 +0000] \"GET /api/cart HTTP/1.1\" 200 24 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 24 0.003 200 33934468a35902ed5b6dde14b1aca6a0\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:06 +0000] \"GET /api/cart HTTP/1.1\" 200 24 \"-\" \"python-requests/2.31.0\" 350 0.003 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 24 0.003 200 33934468a35902ed5b6dde14b1aca6a0\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:32.391Z", + "lastOccurrence": "2024-11-02T10:56:57.316Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 25 + }, + { + "x": 1730543820000, + "y": 27 + }, + { + "x": 1730543850000, + "y": 26 + }, + { + "x": 1730543880000, + "y": 26 + }, + { + "x": 1730543910000, + "y": 26 + }, + { + "x": 1730543940000, + "y": 27 + }, + { + "x": 1730543970000, + "y": 24 + }, + { + "x": 1730544000000, + "y": 25 + }, + { + "x": 1730544030000, + "y": 22 + }, + { + "x": 1730544060000, + "y": 27 + }, + { + "x": 1730544090000, + "y": 20 + }, + { + "x": 1730544120000, + "y": 23 + }, + { + "x": 1730544150000, + "y": 29 + }, + { + "x": 1730544180000, + "y": 25 + }, + { + "x": 1730544210000, + "y": 23 + }, + { + "x": 1730544240000, + "y": 27 + }, + { + "x": 1730544270000, + "y": 26 + }, + { + "x": 1730544300000, + "y": 27 + }, + { + "x": 1730544330000, + "y": 25 + }, + { + "x": 1730544360000, + "y": 31 + }, + { + "x": 1730544390000, + "y": 21 + }, + { + "x": 1730544420000, + "y": 27 + }, + { + "x": 1730544450000, + "y": 25 + }, + { + "x": 1730544480000, + "y": 29 + }, + { + "x": 1730544510000, + "y": 23 + }, + { + "x": 1730544540000, + "y": 27 + }, + { + "x": 1730544570000, + "y": 24 + }, + { + "x": 1730544600000, + "y": 31 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 24 + }, + { + "x": 1730544690000, + "y": 27 + }, + { + "x": 1730544720000, + "y": 27 + }, + { + "x": 1730544750000, + "y": 27 + }, + { + "x": 1730544780000, + "y": 24 + }, + { + "x": 1730544810000, + "y": 25 + }, + { + "x": 1730544840000, + "y": 26 + }, + { + "x": 1730544870000, + "y": 29 + }, + { + "x": 1730544900000, + "y": 32 + }, + { + "x": 1730544930000, + "y": 34 + }, + { + "x": 1730544960000, + "y": 25 + }, + { + "x": 1730544990000, + "y": 28 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "vzwi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 262, + "pattern": "POST HTTP/1.1 python-requests/2.31.0 default-my-otel-demo-frontendproxy-8080", + "regex": ".*?POST.+?HTTP/1\\.1.+?python-requests/2\\.31\\.0.+?default-my-otel-demo-frontendproxy-8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:55:03 +0000] \"POST /api/checkout HTTP/1.1\" 200 984 \"-\" \"python-requests/2.31.0\" 780 0.068 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 984 0.069 200 f87d6397ec8b5740f05f1f3ca07adf50\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:55:03 +0000] \"POST /api/checkout HTTP/1.1\" 200 984 \"-\" \"python-requests/2.31.0\" 780 0.068 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 984 0.069 200 f87d6397ec8b5740f05f1f3ca07adf50\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.220Z", + "lastOccurrence": "2024-11-02T10:56:45.575Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 5 + }, + { + "x": 1730543820000, + "y": 10 + }, + { + "x": 1730543850000, + "y": 14 + }, + { + "x": 1730543880000, + "y": 3 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 12 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 7 + }, + { + "x": 1730544060000, + "y": 5 + }, + { + "x": 1730544090000, + "y": 5 + }, + { + "x": 1730544120000, + "y": 5 + }, + { + "x": 1730544150000, + "y": 5 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 9 + }, + { + "x": 1730544240000, + "y": 5 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 14 + }, + { + "x": 1730544330000, + "y": 7 + }, + { + "x": 1730544360000, + "y": 10 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 4 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 3 + }, + { + "x": 1730544570000, + "y": 9 + }, + { + "x": 1730544600000, + "y": 5 + }, + { + "x": 1730544630000, + "y": 9 + }, + { + "x": 1730544660000, + "y": 3 + }, + { + "x": 1730544690000, + "y": 14 + }, + { + "x": 1730544720000, + "y": 13 + }, + { + "x": 1730544750000, + "y": 2 + }, + { + "x": 1730544780000, + "y": 5 + }, + { + "x": 1730544810000, + "y": 3 + }, + { + "x": 1730544840000, + "y": 7 + }, + { + "x": 1730544870000, + "y": 5 + }, + { + "x": 1730544900000, + "y": 11 + }, + { + "x": 1730544930000, + "y": 11 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 2 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "vdjm", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 263, + "pattern": "10.244.0.38 02 2024 10 0000 api HTTP 1.1 python requests 2.31.0 default my otel demo frontendproxy 8080 10.244.0.26 8080", + "regex": ".*?10\\.244\\.0\\.38.+?02.+?2024.+?10.+?0000.+?api.+?HTTP.+?1\\.1.+?python.+?requests.+?2\\.31\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\.244\\.0\\.26.+?8080.*?", + "sample": "10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n", + "highlight": { + "service.name": [ + "controller" + ], + "resource.attributes.service.name": [ + "controller" + ] + }, + "metadata": { + "message": [ + "10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.220Z", + "lastOccurrence": "2024-11-02T10:56:45.575Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 5 + }, + { + "x": 1730543820000, + "y": 10 + }, + { + "x": 1730543850000, + "y": 14 + }, + { + "x": 1730543880000, + "y": 3 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 12 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 7 + }, + { + "x": 1730544060000, + "y": 5 + }, + { + "x": 1730544090000, + "y": 5 + }, + { + "x": 1730544120000, + "y": 5 + }, + { + "x": 1730544150000, + "y": 5 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 9 + }, + { + "x": 1730544240000, + "y": 5 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 14 + }, + { + "x": 1730544330000, + "y": 7 + }, + { + "x": 1730544360000, + "y": 10 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 4 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 3 + }, + { + "x": 1730544570000, + "y": 9 + }, + { + "x": 1730544600000, + "y": 5 + }, + { + "x": 1730544630000, + "y": 9 + }, + { + "x": 1730544660000, + "y": 3 + }, + { + "x": 1730544690000, + "y": 14 + }, + { + "x": 1730544720000, + "y": 13 + }, + { + "x": 1730544750000, + "y": 2 + }, + { + "x": 1730544780000, + "y": 5 + }, + { + "x": 1730544810000, + "y": 3 + }, + { + "x": 1730544840000, + "y": 7 + }, + { + "x": 1730544870000, + "y": 5 + }, + { + "x": 1730544900000, + "y": 12 + }, + { + "x": 1730544930000, + "y": 11 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 2 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "hxyo", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [], + "searches": [ + { + "fragments": [ + "10.244.0.38:8080", + "10.244.0.38", + "8080" + ], + "appearsAs": "This IP address and port are referenced as attributes.source.address, attributes.upstream.address in the investigated entity service.name:controller." + }, + { + "fragments": [ + "http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart", + "/api/cart" + ], + "appearsAs": "These URL fragments appear as attributes.http.request.referrer, attributes.url.original in the investigated entity service.name:controller." + }, + { + "fragments": [ + "/api/cart?sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57¤cyCode=CHF", + "sessionId=1d9f48dd-3313-4f9f-b83b-ff87635eca57", + "currencyCode=CHF" + ], + "appearsAs": "These URL fragments appear as attributes.url.query in the investigated entity service.name:controller." + }, + { + "fragments": [ + "default-my-otel-demo-frontendproxy-8080", + "frontendproxy", + "frontend" + ], + "appearsAs": "These service names appear as attributes.upstream.name in the investigated entity service.name:controller." + }, + { + "fragments": [ + "e6bae77cfb5b598f1d725bc6cc52d06d", + "506" + ], + "appearsAs": " These fragments appear as attributes.http.request.time, attributes.http.response.status_code in the investigated entity service.name:controller." + } + ], + "relatedEntitiesSummaries": [ + "### Related Entities Analysis\n\n#### 1. Entity: service.name:frontend\n- **Indicators (Strength: Average to Strong):**\n - Field: `attributes.upstream.name` in service.name:controller - `default-my-otel-demo-frontendproxy-8080`\n - Field: `kubernetes.pod.name.text` in service.name:frontend - `my-otel-demo-frontend-5bbf4d78bc-qtwdr`\n - URL paths in logs that suggest interactions with the frontend service, specifically `/api/cart`.\n- **Reasoning:** The `frontend` service interacts closely with the `controller` (ingress-nginx-controller). Requests directed to `/api/cart` initiate from `frontendproxy` which routes to `frontend`. Given the high error rate at the `/api/cart` endpoint, the issue might involve downstream calls from `frontend` to dependent services.\n- **Overall Likeliness:** High. The `frontend` service is one of the primary services processing requests (user interactions) that subsequently hit the `controller`.\n\n#### 2. Entity: service.name:cartservice\n- **Indicators (Strength: Strong):**\n - Correspondence of session IDs in the request URLs or logs between controller and cartservice.\n - Mention of cart failures in `frontend` interactions - indicated by error logs involving failed RPC calls to `cartservice`.\n - Logs for service.name:cartservice with messages such as `GetCartAsync called with userId=1d9f48dd`.\n- **Reasoning:** The `/api/cart` endpoint directly involves manipulating or retrieving data from `cartservice`. Given the 500 errors on requests routed via the `controller`, it's likely that `cartservice` might be either causing or being affected by these failures.\n- **Overall Likeliness:** High. Direct involvement of `cartservice` is plausible given the issue is associated specifically with cart interactions.\n\n#### 3. Entity: service.name:frontend-web\n- **Indicators (Strength: Average):**\n - URL referrer and path fragments suggest client-side interactions impact the controller’s ingress.\n - URL fields from both controller logs and frontend-web logs such as `http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart`.\n- **Reasoning:** `frontend-web` represents the client-side application layer. Issues in the client's request construction or timing might be indirectly impacting how the `controller` handles these requests.\n- **Overall Likeliness:** Moderate. While not directly involved in backend processing, interactions originating from the frontend-web could potentially impact the backend flow.\n\n#### 4. Entity: service.name:checkoutservice\n- **Indicators (Strength: Weak):**\n - Shared URL fragments related to the checkout process (`/api/cart` could be an intermediate step).\n - Common use of `sessionId` and `currencyCode` seen in request attributes.\n- **Reasoning:** Though the controller deals directly with cart interactions, completion of cart actions could trigger subsequent processes in `checkoutservice`. Errors during cart operations could thereby propagate issues if mismanaged upstream.\n- **Overall Likeliness:** Low to Moderate. Contextually relevant but perhaps indirectly linked unless specific error propagation is identified.\n\n#### 5. Entity: service.name:coredns\n- **Indicators (Strength: Weak to Average):**\n - DNS logs showing interactions such as `10.244.0.38:45693 - 8080 \"A IN ingress-nginx-controller.ingress-nginx.svc.cluster.local. UDP 74`.\n- **Reasoning:** DNS resolution issues could lead to inability to locate the correct backend service IP for `controller`, causing errors in routing HTTP requests.\n- **Overall Likeliness:** Low. Potential indirect influence but less likely to be the primary cause.\n\n#### Possible Relationship Summary\nGiven these findings:\n\n1. **frontend** and **cartservice** are the most relevant entities with strong indicators of their dependencies and direct involvement in handling requests relevant to the `/api/cart` endpoint. Investigating these services in conjunction with `controller` will likely reveal root causes.\n2. **frontend-web** could be examined for potential client-side initiation issues leading to increased errors, but it remains secondary.\n3. **checkoutservice** may be potentially linked through a sequence of dependencies initiated post-cart operations but is less immediate.\n4. **coredns** could be impacting resolution, yet this remains an unlikely principal cause unless supported by specific DNS errors.\n\nFocus on examining logs and dependencies from `cartservice` and `frontend` to pinpoint exact causes for the reported 500 errors at the `/api/cart` endpoint managed by the controller service.", + "## Analysis and Identification of Related Entities\n\n### Relationship 1: `frontendproxy` (default-my-otel-demo-frontendproxy-8080)\n- **Related entity:** `service.name:frontendproxy`\n- **Indicator strength:** Strong, based on the matching `attributes.upstream.name` field.\n - **Indications:**\n - From `controller` logs: `attributes.upstream.name` = `default-my-otel-demo-frontendproxy-8080`\n - Upstream IP address: `attributes.upstream.address` = `10.244.0.26:8080` in controller logs coinciding with requests that resulted in `500` errors.\n- **Reason:** The `frontendproxy` service routes traffic to the backend services, including the `controller`. Since the `controller` service receives requests and directs traffic to `frontendproxy`, it points to a possible upstream dependency causing the 500 errors during the requests to `/api/cart`.\n- **Overall likeliness:** High. This entity is directly involved since it routes traffic within the system, and its downstream performance or errors reflect on the `controller`.\n\n### Relationship 2: `frontend`\n- **Related entity:** `service.name:frontend`\n- **Indicator strength:** Moderate, observing the infrastructure context and the dependency chain.\n - **Indications:** \n - The `frontend` service is called by the `frontendproxy`, which is indicated as the `attributes.upstream.name` in `controller` logs.\n- **Reason:** In the context provided, the `frontend` communicates with other backend services to process user interactions and might be an upstream dependency for the `controller`. The problem might cascade from `frontendproxy` to `frontend`.\n- **Overall likeliness:** High. This service is critical in handling user interactions, and problems here could cause issue propagation to `controller`.\n\n### Relationship 3: `cartservice`\n- **Related entity:** `service.name:cartservice`\n- **Indicator strength:** Moderate, based on its role in the architecture and likely correlation.\n - **Indications:**\n - The `cartservice` handles shopping cart actions which map the `controller`'s `/api/cart` endpoint.\n - **Reason:** If the `cartservice` has issues, they would cascade to the `controller` /api/cart endpoint that depends on this service for cart management functions.\n- **Overall likeliness:** High. It closely correlates with the endpoint's functionality and possible 500 errors due to backend service inconsistencies.\n\n### Relationship 4: `currencyservice`\n- **Related entity:** `service.name:currencyservice`\n- **Indicator strength:** Weak, contextual dependency but crucial interplay with `cart` operations.\n - **Indications:**\n - Handling currency conversions, indirectly connected to cart operations.\n- **Reason:** The issues might arise if currency conversion fails during cart operations, contributing to the 500 errors in the `controller`.\n- **Overall likeliness:** Moderate. Essential for part of the request chains during cart operations, but primary errors might occur upstream.\n\n### Relationship 5: `productcatalogservice`\n- **Related entity:** `service.name:productcatalogservice`\n- **Indicator strength:** Weak, as no direct log correlation but relevant in the context.\n - **Indications:**\n - Provides product data, indirectly required during cart operations.\n- **Reason:** Cart operations fetching/validating product data might fail, contributing to the `controller` errors when /api/cart requests involve fetching product data.\n- **Overall likeliness:** Moderate. Possible issues here can impact `cartservice` processes and propagate as 500 errors.\n\n### Relationship 6: `frauddetectionservice`\n- **Related entity:** `service.name:frauddetectionservice`\n- **Indicator strength:** Weak, speculative and based more on potential correlation.\n - **Indications:**\n - No specific logs point directly; contextual relevance due to transaction handling.\n- **Reason:** If fraud detection triggers false flags, it can affect cart transactions.\n- **Overall likeliness:** Low. Unlikely direct contributor and more as a consequential involvement in transaction failures.\n\n### Summary\n\nThe `frontendproxy`, `frontend`, and `cartservice` are the most probable related entities with high relevance to the errors indicated in the `controller` service. Investigations should focus on these first, focusing on log patterns and errors cascading through these entities causing the 500 errors on `/api/cart`. Indirect relations like `currencyservice`, `productcatalogservice`, and `frauddetectionservice` can also be explored as part of the broader context.", + "During the investigation of the alert for the `controller` service, we are identifying possible relationships to other entities. We will meticulously examine the evidence from logs, traces, and other relevant data to uncover dependencies and potential causes for the high number of 500 errors on the `/api/cart` endpoint.\n\n### Highly Relevant Entities and Relationships\n\n#### 1. Entity: service.name:frontendproxy\n\n- **Indicators of Evidence**\n - **Strong Indicator**: `attributes.upstream.name: default-my-otel-demo-frontendproxy-8080`\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"attributes.upstream.name\": \"default-my-otel-demo-frontendproxy-8080\"`\n - `\"attributes.upstream.response.status_code\": [\"500\", \"200\", \"308\"]`\n - **Fingerprinting Evidence**:\n - `\"message\": \"10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \\\"POST /api/cart HTTP/1.1\\\" 500 32 \\\"-\\\" \\\"python-requests/2.31.0\\\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\"`\n\n- **Relationship and Context**\n - The `frontendproxy` service acts as the reverse proxy, routing incoming HTTP traffic to different backend services, including the `controller`. The errors appearing in the `controller` log indicate communication issues between the `controller` and the `frontendproxy`.\n\n- **Overall Likeliness**: High\n - Given the primary role of the `frontendproxy` in routing traffic to `controller`, coupled with the direct evidence in the logs, this entity is crucial to the situation at hand.\n\n#### 2. Entity: service.name:frontend\n\n- **Indicators of Evidence**\n - **Average Indicator**: `features.service.name: frontend`\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"attributes.http.request.origin\": \"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart\"`\n - `\"/api/cart` endpoint related queries`\n\n- **Relationship and Context**:\n - The `frontend` service handles key operations related to user interactions before requests are passed to various backend services, including the `controller`. Issues in `frontend`, like poor handling of requests or incorrect data forwarding, might cascade downstream, resulting in 500 errors in the `controller`.\n\n- **Overall Likeliness**: Medium to High\n - Given the data pathway from user interactions handled by `frontend`, it’s essential to determine if `frontend` anomalies are contributing to the failure in `controller`.\n\n#### 3. Entity: service.name:cartservice\n\n- **Indicators of Evidence**\n - **Average Indicator**: `/api/cart` requests typically involving `cartservice`\n - **Field Values in Investigated Entity (`controller`)**:\n - `500 errors at \"/api/cart\"`\n\n- **Relationship and Context**:\n - The `cartservice` directly manages shopping cart operations over the gRPC protocol. While the HTTP API from `controller` might indicate communication failures with `cartservice`, these errors could also originate from improper data requests or transaction handling within `cartservice`.\n\n- **Overall Likeliness**: High\n - Investigating the interaction with `cartservice` can help distinguish if business logic errors or miscommunication between services lead to repeated 500 errors.\n\n### Moderately Relevant Entities\n\n#### 4. Entity: service.name:loadgenerator\n\n- **Indicators of Evidence**\n - **Weak Indicator**: Simulated high traffic which might put strain on other services causing errors.\n - **Field Values in Investigated Entity (`controller`)**:\n - General logged high traffic instances or increased load around the alert time.\n\n- **Relationship and Context**:\n - The `loadgenerator` mimics external user traffic managed by the Ingress and ultimately passed through nodes like `controller`. Excessive load can manifest as backend service overloads or timeouts, indirectly causing 500 errors in `controller`.\n\n- **Overall Likeliness**: Medium\n - Given the traffic simulation aspect, its role is probable but direct correlation to specific error occurrences in `controller` needs corroboration with other data points.\n\n### Less Likely but Contextually Relevant Entities\n\n#### 5. Entity: service.name:etcd\n\n- **Indicators of Evidence**\n - **Weak Indicator**: General mention in logs for Ingress control plane activity\n - **Field Values in Investigated Entity (`controller`)**:\n - `\"response count\": 0`, signifying Ingress data handling might be amiss during high traffic\n\n- **Relationship and Context**:\n - Possible indirect impact wherein control plane malfunctions or data inconsistencies in the `etcd` state can propagate as issues dispersed across services interacting via Ingress, including `controller`.\n\n- **Overall Likeliness**: Medium\n - This needs verifying integration with upstream Ingress state logs to validate contributions to observed `controller` issues.\n\n### Further Investigations and Likelihood Summary\n\nBased on logs and identified relationships, we will prioritize looking into:\n\n1. **Frontendproxy** - Checking its health, routing efficiency, and connections to `controller`.\n2. **Frontend** - Verifying its data handling during user interactions that lead to API cart errors.\n3. **Cartservice** - Ensuring logical transactions and gRPC communications, ruling out core service bugs.\n\nWe will cross-reference error logs, API traces, and dependency interactions tightly intertwined with the `controller` to form a comprehensive approach to resolution." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 3 + } + ] + }, + "entity": { + "service.name": "controller" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "frontend" + }, + "reason": "The frontend service interacts closely with the controller (ingress-nginx-controller). Requests directed to /api/cart initiate from frontendproxy which routes to frontend. Given the high error rate at the /api/cart endpoint, the issue might involve downstream calls from frontend to dependent services.", + "confidence": "high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The /api/cart endpoint directly involves manipulating or retrieving data from cartservice. Given the 500 errors on requests routed via the controller, it's likely that cartservice might be either causing or being affected by these failures.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend-web" + }, + "reason": "URL referrer and path fragments suggest client-side interactions impacting the controller's ingress. Issues in the client's request construction or timing might be indirectly impacting how the controller handles these requests.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "Though the controller deals directly with cart interactions, completion of cart actions could trigger subsequent processes in checkoutservice. Errors during cart operations could thereby propagate issues if mismanaged upstream.", + "confidence": "low" + }, + { + "entity": { + "service.name": "coredns" + }, + "reason": "DNS resolution issues could lead to inability to locate the correct backend service IP for controller, causing errors in routing HTTP requests.", + "confidence": "low" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service is called by the `frontendproxy`, which is indicated as the `attributes.upstream.name` in `controller` logs. In the context provided, the `frontend` communicates with other backend services to process user interactions and might be an upstream dependency for the `controller`. The problem might cascade from `frontendproxy` to `frontend`.", + "confidence": "high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The `cartservice` handles shopping cart actions which map the `controller`'s `/api/cart` endpoint. If the `cartservice` has issues, they would cascade to the `controller` /api/cart endpoint that depends on this service for cart management functions.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "Handling currency conversions, indirectly connected to cart operations. The issues might arise if currency conversion fails during cart operations, contributing to the 500 errors in the `controller`.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "frauddetectionservice" + }, + "reason": "No specific logs point directly; contextual relevance due to transaction handling. If fraud detection triggers false flags, it can affect cart transactions.", + "confidence": "low" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "The `cartservice` directly manages shopping cart operations over the gRPC protocol, and errors here could lead to repeated 500 errors in the `controller`.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service handles user interactions that are passed to the `controller`. Issues in `frontend` could lead to failures in `controller`, resulting in 500 errors.", + "confidence": "medium to high" + }, + { + "entity": { + "service.name": "loadgenerator" + }, + "reason": "The `loadgenerator` simulates high user traffic which might strain other services and indirectly cause 500 errors in the `controller`.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "etcd" + }, + "reason": "As a control plane activity tracker for Ingress, indirect impacts from `etcd` inconsistencies can propagate as issues in services interacting via Ingress, including `controller`.", + "confidence": "medium" + } + ], + "summary": "### Characteristics of the `controller` Entity\n\n**1. Infrastructure & Environment:**\n\nThe `controller` service is deployed within a Kubernetes environment, specifically in the `ingress-nginx` namespace. The service is associated with a `controller` container running within the `ingress-nginx-controller-bc57996ff-r6blf` pod. This pod is scheduled on a node identified as `minikube`, and the service is part of the `ingress-nginx-controller` deployment. Additionally, the infrastructure is based on an ARM64 architecture, running Ubuntu 24.04.1 LTS, with deployment environment set to `opentelemetry-demo`.\n\n**2. Communication Characteristics:**\n\nThe `controller` service functions as an Ingress controller, managing incoming traffic and routing it to backend services. It processes HTTP requests, typically version 1.1, and communicates with other services via HTTP protocols. Key endpoints involved in the communication include:\n- Inbound requests are received at endpoints like `/api/cart` and `/api/checkout`.\n- Outbound requests are routed primarily to the `frontendproxy` service, evidenced by the upstream address `10.244.0.26:8080`.\n\nThe service handles both `GET` and `POST` requests, and its communication paths include requests from user agents like \"HeadlessChrome\" and \"python-requests\".\n\n**3. Context of Entity in Investigation:**\n\n**Reason for Investigation:**\nThe `controller` service is currently under investigation due to an alert triggered by a high number of 500 errors (98.78% error rate) occurring at the `/api/cart` endpoint. The significant spike in error rates is concerning and suggests a potential issue within the service or its interaction with dependencies.\n\n**Relation to Other Entities:**\nThe high error rates on the `controller` are likely impacting the overall user experience of the application, notably through the `/api/cart` functionality, which interacts with the `cartservice`. As the `controller` service forwards requests to the `frontendproxy`, which in turn interacts with various backend services like `cartservice`, `checkoutservice`, `currencyservice`, and others, the ripple effect of these errors might be felt across multiple services in the architecture. This interconnectedness necessitates thorough investigation of `controller's` logs and error patterns to isolate the root cause and mitigate the disruption in the flow of HTTP requests.\n\nBy understanding the behavior and interaction of the `controller` service within the broader microservices architecture, we aim to identify and resolve the underlying issue causing the increase in 500 errors. This involves examining logs for patterns, determining if recent changes or specific conditions triggered the fault, and analyzing dependencies that could contribute to the error rates observed. This step is integral to restoring normal operation and maintaining service reliability and user satisfaction.\n\n### Analysis of Log Patterns for service.name:controller\n\n#### Pattern Group: Request Errors\n- **Pattern:**\n ```\n .*?10\\\\.244\\\\.0\\\\.38.+?02.+?2024.+?10.+?0000.+?api.+?HTTP.+?1\\\\.1.+?python.+?requests.+?2\\\\.31\\\\.0.+?default.+?my.+?otel.+?demo.+?frontendproxy.+?8080.+?10\\\\.244\\\\.0\\\\.26.+?8080.*?\n ```\n - **Sample:**\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n - **Description:** This pattern represents request logs where an HTTP POST request to the `/api/cart` endpoint resulted in a `500 Internal Server Error`. The requests are from a client using `python-requests/2.31.0`.\n\n- **Count:** 263 occurrences\n\n- **Timeseries Analysis:**\n - **Trend:** The number of occurrences show fluctuation with no significant change in the pattern.\n - **Log Counts:** \n - Example timestamps and counts:\n - `2024-11-02T10:56:00.000Z: 6`\n - `2024-11-02T10:56:30.000Z: 2`\n - `2024-11-02T10:57:00.000Z: 0`\n\n### Summary\nBased on the provided logs patterns, the `controller` service is experiencing a high number of `500 Internal Server Errors` when handling POST requests to the `/api/cart` endpoint. This is evident from the consistent error logs observed at different timestamps. The alert threshold breach likely correlates with these error occurrences.\n\nNo other unusual patterns such as connection issues, startup messages, or garbage collection messages were identified in the logs around the error events. Further investigation on the backend or potential dependency issues (e.g., `cartservice`) might be needed to determine the exact cause of these errors.\n\n### Timeline of significant events\n\n- **2024-11-02T10:56:42.498Z**\n - **Alert Triggered**: High number of 500 errors for the /api/cart endpoint. Error rate is 98.78%, above the threshold of 1% over a 1-minute duration.\n \n- **2024-11-02T10:56:00.000Z**\n - **Log Entry**: 6 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - **Example Log**:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:08 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n \n- **2024-11-02T10:56:30.000Z**\n - **Log Entry**: 2 occurrences of HTTP POST requests to the `/api/cart` endpoint resulting in `500 Internal Server Error`.\n - **Example Log**:\n ```\n 10.244.0.38 - - [02/Nov/2024:10:56:35 +0000] \"POST /api/cart HTTP/1.1\" 500 32 \"-\" \"python-requests/2.31.0\" 506 0.002 [default-my-otel-demo-frontendproxy-8080] [] 10.244.0.26:8080 32 0.002 500 e6bae77cfb5b598f1d725bc6cc52d06d\n ```\n\n### Context and reasoning\n\nThe `controller` service plays a critical role in handling incoming HTTP requests within the Kubernetes environment, specifically acting as an Ingress controller within the `ingress-nginx` namespace. The recent alert, triggered by a high number of 500 errors, indicates a significant disruption in the normal operations of the `controller` service, particularly impacting the `/api/cart` endpoint. The log entries leading up to and following the alert highlight a pattern of consistent `500 Internal Server Error` responses, specifically around the timestamp in question.\n\nThe pattern group identified, related to request errors, shows repeated failures for HTTP POST requests from a client using `python-requests/2.31.0`, likely directed towards the `cartservice` via the `frontendproxy`. This high error rate suggests an underlying issue either within the `controller` service itself, its communication path to the `frontendproxy`, or potentially further downstream with the backend services like `cartservice`.\n\nNo other unusual log patterns, such as connection issues or any system degradation messages were noted, indicating the problem is likely concentrated around the interaction between `controller` and its immediate dependencies rather than a broader system-wide issue. By correlating the timestamps and repeated error logs, a clear link can be drawn between the `500 Internal Server Error` responses and the timeline, further supporting the hypothesis of a specific fault affecting the `/api/cart` endpoint.\n\nFurther investigation into the dependencies of the `controller` service, especially focusing on the interactions with the `frontendproxy` and subsequently `cartservice`, is warranted to isolate and rectify the root cause of these error patterns." + } + ] + }, + "role": "tool", + "toolCallId": "call_DB13TclS3Gc9zUgCrWLrvDuu" + }, + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_kstyq8qXoaWRX4CJQkC6wbhR", + "function": { + "name": "investigateEntity", + "arguments": { + "context": "As the downstream service handling /api/cart requests, issues here would directly contribute to error patterns in controller. High errors were observed in the controller for POST requests to the /api/cart endpoint resulting in '500 Internal Server Error'. Starting error rate was significantly high (98.78%), around 2024-11-02T10:56:42.498Z.", + "entity": { + "field": "service.name", + "value": "cartservice" + } + } + } + }, + { + "toolCallId": "call_zNoUwjdb2DJhxjhshLkgqlZw", + "function": { + "name": "investigateEntity", + "arguments": { + "context": "Requests are routed through this service to cartservice. Any routing or network issues here might also contribute to the 500 errors seen in controller. High error rate (98.78%) in controller for POST requests to the /api/cart endpoint starting at 2024-11-02T10:56:42.498Z.", + "entity": { + "field": "service.name", + "value": "frontend" + } + } + } + } + ] + }, + { + "name": "investigateEntity", + "role": "tool", + "toolCallId": "call_zNoUwjdb2DJhxjhshLkgqlZw", + "response": { + "entity": { + "service.name": "frontend" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "controller" + }, + "reason": "`controller` service handles endpoints like `/api/cart`, which corresponds to failed transactions. They share common IP address and port patterns, indicating network interaction.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "`frontend` service attempts to interact with `cartservice`. Connection errors from `frontend` indicate it is calling `cartservice` and facing issues getting responses, potentially causing the 500 errors.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "frontend-web" + }, + "reason": "`frontend-web` captures real user interactions with the `/api/cart` endpoint. Helps trace the errors and delays externally perceived by users.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "coredns" + }, + "reason": "`coredns` is responsible for DNS resolution within the cluster and issues here could result in connectivity problems seen in `frontend`.", + "confidence": "moderate" + } + ], + "summary": "### Investigation of Entity `service.name:frontend`\n\n#### Context of Investigation\n\nThe `frontend` service is critical in this investigation due to its role in the overall request handling and the observed high error rate (98.78%) in the `controller` service for POST requests to the `/api/cart` endpoint. This issue began at `2024-11-02T10:56:42.498Z`. The `frontend` service routes requests to `cartservice`, a key interaction in this error occurrence.\n\n#### Infrastructure & Environment\n\n- **Environment**: The `frontend` operates within the `opentelemetry-demo` deployment environment.\n- **Deployment**: It is deployed on Kubernetes (k8s), specifically within the `default` namespace. \n- **Pod Information**: The pod name is `my-otel-demo-frontend-5bbf4d78bc-qtwdr`, on the `minikube` node. Each pod has a unique UID (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`), with logs stored at `/var/log/pods/`.\n- **Resource Attributes**: Hosts `Apple` Arm64 architecture processor (`host.cpu.vendor.id: Apple`), running `Ubuntu 24.04.1 LTS (Noble Numbat)`, indicating a Linux-based system.\n\n#### Communication Characteristics \n\n- **Protocols**: \n - The `frontend` service communicates primarily using HTTP for inbound requests and gRPC for backend service interactions. \n - gRPC is specifically used when the `frontend` communicates with `cartservice`, highlighted by recorded RPC errors in the logs.\n- **Endpoints**:\n - The `frontend` gets requests from `frontendproxy` (Envoy), acting as the reverse proxy.\n - The service then routes these requests to different backend services, including `cartservice`, via gRPC.\n - The critical IP noted in logs is `10.110.191.164:8080`, pointing to a potential endpoint for the `cartservice`.\n\n#### Context of Entity in Investigation\n\n- **Reason for Investigation**: The `frontend` service is under scrutiny due to its pivotal role in processing and routing incoming user requests. Any disruption in its communication or processing mechanism directly affects the functionality of connected services, notably `cartservice`, leading to high error rates observed in the `controller`.\n- **Relation to Other Entities**:\n - **Previous Entity**: `controller` - The `controller` service logs indicate a high number of 500 errors were triggered during POST requests to `/api/cart`.\n - **Dependencies**: `frontend` relies on successful communication with `cartservice` to fulfill these cart-related requests.\n- **Architectural Role**: The `frontend` is the nucleus for user interactions within this microservices architecture. Any network or communication issue in `frontend` can cascade, influencing its backend dependencies like `cartservice` and leading to broader service disruptions.\n\nThis comprehensive analysis of the `frontend` service’s infrastructure, communication protocols, and its investigative context emphasizes its critical position in the service chain responsible for the reported errors. Further scrutiny of the communication logs, particularly focusing on the gRPC interactions with `cartservice`, is essential to identify and mitigate the root cause of these failures.\n\nObservations for service `frontend`.\n\n### Connection Issues to Upstream Dependency\n\n1. **Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Sample**: \"14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)\"\n - **Timeseries Observations**: \n - No occurrences before 2024-11-02T10:55:30.000Z.\n - Sharp increase at 2024-11-02T10:55:30.000Z (291 occurrences).\n - Further increase at 2024-11-02T10:56:00.000Z (381 occurrences).\n - Next timestamp at 2024-11-02T10:57:00.000Z showing a return to 0 occurrences.\n\n2. **Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"\n - **Sample**: \"13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"\n - **Timeseries Observations**:\n - No occurrences before 2024-11-02T10:55:30.000Z.\n - Slight increase at 2024-11-02T10:55:30.000Z (2 occurrences).\n - One more occurrence at 2024-11-02T10:56:00.000Z (1 occurrence).\n - No occurrences after 2024-11-02T10:56:30.000Z.\n\nThe significant spike in connection errors starting from 2024-11-02T10:55:30.000Z aligns with the high error rate in the `controller` service, suggesting a strong correlation between these established connection issues in the `frontend` service and the 500 errors seen in the `controller` service for POST requests to the `/api/cart` endpoint around the same time.\n\n### Possibly Relevant Log Patterns from coredns\n\n1. **Pattern**: \"INFO 10.244.0.26 AAAA IN my-otel-demo-frontend udp 39 false 512 NXDOMAIN qr,rd,ra 39\"\n - **Sample**: \"[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\"\n - **Timeseries Observations**:\n - Frequent steady occurrences of 6 events every 30 seconds.\n - No notable changes or spikes coinciding with the connection issues observed in the `frontend` service.\n\nFrom these observations, it appears that the connection refusal errors in the `frontend` service are likely caused by issues in communication with the `cartservice`, potentially as a result of intermittent network disruptions or dependency service failures at the IP 10.110.191.164. Further investigation should focus on the health and connectivity status of the `cartservice` around the specified time period.\n\n### Timeline of Significant Events\n\n1. **2024-11-02T10:55:30.000Z**\n - **Event**: Sharp increase in connection error logs.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 291 occurrences reported.\n\n2. **2024-11-02T10:55:30.000Z**\n - **Event**: Appearance of an internal error in accessing cart services.\n - **Log Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error\"\n - **Details**: 2 occurrences reported.\n\n3. **2024-11-02T10:56:00.000Z**\n - **Event**: Further increase in connection error logs.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 381 occurrences reported.\n\n4. **2024-11-02T10:56:00.000Z**\n - **Event**: Additional occurrence of an internal error in accessing cart services.\n - **Log Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error\"\n - **Details**: 1 occurrence reported.\n\n5. **2024-11-02T10:56:42.498Z**\n - **Event**: High error rate (98.78%) in the `controller` service for POST requests to the `/api/cart` endpoint begins.\n - **Details**: Corresponds to the timing of observed spikes in connection errors in the `frontend` service.\n\n6. **2024-11-02T10:57:00.000Z**\n - **Event**: Connection error logs return to zero occurrences.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 0 occurrences reported.\n\n### Context and Reasoning\n\nThe `frontend` service is critical in this investigation due to its role in routing requests to the `cartservice`. The high error rates observed in the `controller` service's POST requests to the `/api/cart` endpoint started precisely at 2024-11-02T10:56:42.498Z, which is within the timeframe when the `frontend` service experienced significant connection issues with the `cartservice`.\n\nUpon analyzing log patterns, it is evident that the communication disruptions between the `frontend` service and the `cartservice` began at 2024-11-02T10:55:30.000Z with a sharp increase in connection errors, and these errors persisted until approximately 2024-11-02T10:57:00.000Z. During this period, numerous `ECONNREFUSED` errors were logged, indicating the `frontend` service's inability to establish a connection to the `cartservice` (IP 10.110.191.164:8080). This aligns with the timeline of the high error rates in the `controller` service, suggesting a direct correlation.\n\nFurthermore, the internal errors logged by the `frontend` service related to RPC errors and failed attempts to get the user cart during checkout reaffirm these connection problems. These errors underscore an impaired communication pathway to the `cartservice`, affecting the `controller` service's ability to process POST requests to the `/api/cart` endpoint.\n\nTherefore, the evidence strongly indicates that network or connection failures between the `frontend` service and its upstream dependency, `cartservice`, are the principal cause of the cascading 500 errors seen in the `controller` service. This highlights the critical position of the `frontend` service in ensuring stable communication pathways within the microservice architecture." + }, + "data": { + "attachments": { + "alerts": [], + "slos": [], + "analysis": { + "total": 98017, + "sampled": 1000, + "fields": [ + "@timestamp:date - 327 distinct values", + "app.label.component:keyword - 1 distinct values (`frontend`)", + "attributes.log.file.path.text:text - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "attributes.log.file.path:keyword - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "attributes.log.iostream:keyword - 1 distinct values (`stderr`)", + "body.text:text - 36 distinct values (` code: 13,\n`, ` details: 'cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"',\n`, 34 more values)", + "data_stream.dataset:keyword - 1 distinct values (`generic.otel`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`logs`)", + "deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "dropped_attributes_count:long - 1 distinct values (`0`)", + "event.dataset:keyword - 1 distinct values (`generic.otel`)", + "host.arch:keyword - 1 distinct values (`arm64`)", + "host.architecture:keyword - 1 distinct values (`arm64`)", + "host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "host.cpu.family:keyword - 1 distinct values (``)", + "host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "host.cpu.model.name:keyword - 1 distinct values (``)", + "host.cpu.stepping:keyword - 1 distinct values (`0`)", + "host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "host.os.full:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "host.os.platform:keyword - 1 distinct values (`linux`)", + "k8s.container.name:keyword - 1 distinct values (`frontend`)", + "k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "k8s.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "k8s.namespace.name:keyword - 1 distinct values (`default`)", + "k8s.node.name:keyword - 1 distinct values (`minikube`)", + "k8s.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T09:00:25Z`)", + "k8s.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "kubernetes.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "kubernetes.namespace:keyword - 1 distinct values (`default`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "log.file.path:keyword - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "log.iostream:keyword - 1 distinct values (`stderr`)", + "message:text - 36 distinct values (` code: 13,\n`, ` details: 'cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"',\n`, 34 more values)", + "observed_timestamp:date_nanos - 1000 distinct values (`2024-11-02T10:56:50.564274379Z`, `2024-11-02T10:55:46.563453752Z`, `2024-11-02T10:56:52.76272763Z`, `2024-11-02T10:56:14.764728626Z`, `2024-11-02T10:55:51.964080879Z`, `2024-11-02T10:55:51.764216463Z`, `2024-11-02T10:56:50.564063629Z`, `2024-11-02T10:55:38.563141804Z`, `2024-11-02T10:55:53.963540672Z`, `2024-11-02T10:56:32.762493176Z`, 990 more values)", + "os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.app.label.component:keyword - 1 distinct values (`frontend`)", + "resource.attributes.deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "resource.attributes.host.arch:keyword - 1 distinct values (`arm64`)", + "resource.attributes.host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "resource.attributes.host.cpu.family:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "resource.attributes.host.cpu.model.name.text:text - 1 distinct values (``)", + "resource.attributes.host.cpu.model.name:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.stepping:keyword - 1 distinct values (`0`)", + "resource.attributes.host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "resource.attributes.host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "resource.attributes.host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "resource.attributes.host.name:keyword - 1 distinct values (`otel-daemonset-opentelemetry-collector-agent-7jlpk`)", + "resource.attributes.k8s.container.name.text:text - 1 distinct values (`frontend`)", + "resource.attributes.k8s.container.name:keyword - 1 distinct values (`frontend`)", + "resource.attributes.k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "resource.attributes.k8s.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "resource.attributes.k8s.namespace.name:keyword - 1 distinct values (`default`)", + "resource.attributes.k8s.node.name:keyword - 1 distinct values (`minikube`)", + "resource.attributes.k8s.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "resource.attributes.k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T09:00:25Z`)", + "resource.attributes.k8s.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "resource.attributes.os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "resource.attributes.os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.service.name.text:text - 1 distinct values (`frontend`)", + "resource.attributes.service.name:keyword - 1 distinct values (`frontend`)", + "resource.dropped_attributes_count:long - 1 distinct values (`0`)", + "resource.schema_url:keyword - 1 distinct values (`https://opentelemetry.io/schemas/1.6.1`)", + "scope.dropped_attributes_count:long - 1 distinct values (`0`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.name:keyword - 1 distinct values (`frontend`)", + "severity_number:byte - 1 distinct values (`0`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 3756, + "pattern": "at", + "regex": ".*?at.*?", + "sample": " at /app/.next/server/pages/api/cart.js:1:1025\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at /app/.next/server/pages/api/cart.js:1:1025\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1103 + }, + { + "x": 1730544960000, + "y": 1411 + }, + { + "x": 1730544990000, + "y": 1242 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "qlqu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 2366, + "pattern": "at app node_modules grpc grpc js build src", + "regex": ".*?at.+?app.+?node_modules.+?grpc.+?grpc.+?js.+?build.+?src.*?", + "sample": " at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 693 + }, + { + "x": 1730544960000, + "y": 896 + }, + { + "x": 1730544990000, + "y": 777 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "roms", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1014, + "pattern": "at app node_modules opentelemetry instrumentation grpc build src", + "regex": ".*?at.+?app.+?node_modules.+?opentelemetry.+?instrumentation.+?grpc.+?build.+?src.*?", + "sample": " at ServiceClientImpl.clientMethodTrace [as getCart] (/app/node_modules/@opentelemetry/instrumentation-grpc/build/src/instrumentation.js:211:42)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl.clientMethodTrace [as getCart] (/app/node_modules/@opentelemetry/instrumentation-grpc/build/src/instrumentation.js:211:42)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 297 + }, + { + "x": 1730544960000, + "y": 384 + }, + { + "x": 1730544990000, + "y": 333 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "eyqk", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 351, + "pattern": "at node:internal process task_queues", + "regex": ".*?at.+?node:internal.+?process.+?task_queues.*?", + "sample": " at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 104 + }, + { + "x": 1730544960000, + "y": 129 + }, + { + "x": 1730544990000, + "y": 118 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "mpyi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at AsyncLocalStorage.run node:async_hooks 346 14", + "regex": ".*?at.+?AsyncLocalStorage\\.run.+?node:async_hooks.+?346.+?14.*?", + "sample": " at AsyncLocalStorage.run (node:async_hooks:346:14)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at AsyncLocalStorage.run (node:async_hooks:346:14)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jsoq", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at AsyncLocalStorageContextManager.with app node_modules opentelemetry context async hooks build src AsyncLocalStorageContextManager.js 33 40", + "regex": ".*?at.+?AsyncLocalStorageContextManager\\.with.+?app.+?node_modules.+?opentelemetry.+?context.+?async.+?hooks.+?build.+?src.+?AsyncLocalStorageContextManager\\.js.+?33.+?40.*?", + "sample": " at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "viwd", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ContextAPI.with app node_modules opentelemetry api build src api context.js 60 46", + "regex": ".*?at.+?ContextAPI\\.with.+?app.+?node_modules.+?opentelemetry.+?api.+?build.+?src.+?api.+?context\\.js.+?60.+?46.*?", + "sample": " at ContextAPI.with (/app/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ContextAPI.with (/app/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "agsa", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at new ZoneAwarePromise app node_modules zone.js bundles zone.umd.js 1340 33", + "regex": ".*?at.+?new.+?ZoneAwarePromise.+?app.+?node_modules.+?zone\\.js.+?bundles.+?zone\\.umd\\.js.+?1340.+?33.*?", + "sample": " at new ZoneAwarePromise (/app/node_modules/zone.js/bundles/zone.umd.js:1340:33) {\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at new ZoneAwarePromise (/app/node_modules/zone.js/bundles/zone.umd.js:1340:33) {\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "dhes", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "code", + "regex": ".*?code.*?", + "sample": " code: 14,\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " code: 14,\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "feod", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "for call at", + "regex": ".*?for.+?call.+?at.*?", + "sample": "for call at\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + "for call at\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "enzg", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ServiceClientImpl anonymous /app/node_modules/@grpc/grpc-js/build/src/make-client.js", + "regex": ".*?at.+?ServiceClientImpl.+?anonymous.+?/app/node_modules/@grpc/grpc-js/build/src/make-client\\.js.*?", + "sample": " at ServiceClientImpl. (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl. (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "iook", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ServiceClientImpl.makeUnaryRequest /app/node_modules/@grpc/grpc-js/build/src/client.js", + "regex": ".*?at.+?ServiceClientImpl\\.makeUnaryRequest.+?/app/node_modules/@grpc/grpc-js/build/src/client\\.js.*?", + "sample": " at ServiceClientImpl.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jvlx", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 335, + "pattern": "metadata Metadata internalRepr Map 0 options", + "regex": ".*?metadata.+?Metadata.+?internalRepr.+?Map.+?0.+?options.*?", + "sample": " metadata: Metadata { internalRepr: Map(0) {}, options: {} }\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " metadata: Metadata { internalRepr: Map(0) {}, options: {} }\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 97 + }, + { + "x": 1730544960000, + "y": 127 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "wczz", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "internalRepr Map content-type Array", + "regex": ".*?internalRepr.+?Map.+?content-type.+?Array.*?", + "sample": " internalRepr: Map(1) { 'content-type' => [Array] },\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " internalRepr: Map(1) { 'content-type' => [Array] },\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "pcyb", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "metadata Metadata", + "regex": ".*?metadata.+?Metadata.*?", + "sample": " metadata: Metadata {\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " metadata: Metadata {\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "tcak", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "options", + "regex": ".*?options.*?", + "sample": " options: {}\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " options: {}\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "xbsw", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1005, + "pattern": "No connection established Last error connect ECONNREFUSED 10.110.191.164 8080 2024 11 02T10", + "regex": ".*?No.+?connection.+?established.+?Last.+?error.+?connect.+?ECONNREFUSED.+?10\\.110\\.191\\.164.+?8080.+?2024.+?11.+?02T10.*?", + "sample": "14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)", + "highlight": { + "service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + "14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.676Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 291 + }, + { + "x": 1730544960000, + "y": 381 + }, + { + "x": 1730544990000, + "y": 333 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "pssf", + "relevance": "critical", + "interesting": true + }, + { + "field": "error.exception.message", + "count": 3, + "pattern": "INTERNAL cart failure failed to get user cart during checkout rpc error code Unavailable desc connection error desc transport Error while dialing dial tcp connect connection refused", + "regex": ".*?INTERNAL.+?cart.+?failure.+?failed.+?to.+?get.+?user.+?cart.+?during.+?checkout.+?rpc.+?error.+?code.+?Unavailable.+?desc.+?connection.+?error.+?desc.+?transport.+?Error.+?while.+?dialing.+?dial.+?tcp.+?connect.+?connection.+?refused.*?", + "sample": "13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"", + "highlight": { + "service.name": [ + "frontend" + ] + }, + "metadata": { + "error.exception.message": [ + "13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.038Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "crai", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [ + { + "field": "message", + "count": 246, + "pattern": "INFO 10.244.0.26 AAAA IN my otel demo frontend udp 39 false 512 NXDOMAIN qr rd ra 39", + "regex": ".*?INFO.+?10\\.244\\.0\\.26.+?AAAA.+?IN.+?my.+?otel.+?demo.+?frontend.+?udp.+?39.+?false.+?512.+?NXDOMAIN.+?qr.+?rd.+?ra.+?39.*?", + "sample": "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\n", + "highlight": { + "body.text": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra" + ], + "message": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra" + ] + }, + "metadata": { + "service.name": [ + "coredns" + ], + "message": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.917Z", + "lastOccurrence": "2024-11-02T10:56:58.646Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 6 + }, + { + "x": 1730543820000, + "y": 6 + }, + { + "x": 1730543850000, + "y": 6 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 6 + }, + { + "x": 1730543970000, + "y": 6 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 6 + }, + { + "x": 1730544060000, + "y": 6 + }, + { + "x": 1730544090000, + "y": 6 + }, + { + "x": 1730544120000, + "y": 6 + }, + { + "x": 1730544150000, + "y": 6 + }, + { + "x": 1730544180000, + "y": 6 + }, + { + "x": 1730544210000, + "y": 6 + }, + { + "x": 1730544240000, + "y": 6 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 6 + }, + { + "x": 1730544330000, + "y": 6 + }, + { + "x": 1730544360000, + "y": 6 + }, + { + "x": 1730544390000, + "y": 6 + }, + { + "x": 1730544420000, + "y": 6 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 6 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 6 + }, + { + "x": 1730544600000, + "y": 6 + }, + { + "x": 1730544630000, + "y": 6 + }, + { + "x": 1730544660000, + "y": 6 + }, + { + "x": 1730544690000, + "y": 6 + }, + { + "x": 1730544720000, + "y": 6 + }, + { + "x": 1730544750000, + "y": 6 + }, + { + "x": 1730544780000, + "y": 6 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 6 + }, + { + "x": 1730544870000, + "y": 6 + }, + { + "x": 1730544900000, + "y": 6 + }, + { + "x": 1730544930000, + "y": 6 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 6 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "rlzf", + "relevance": "normal", + "interesting": false + } + ], + "searches": [ + { + "fragments": [ + "10.110.191.164:8080", + "10.110.191.164", + "8080" + ], + "appearsAs": "This IP address and port are referenced in the investigated entity 'frontend'." + }, + { + "fragments": [ + "/api/cart", + "cartservice", + "/api" + ], + "appearsAs": "These URL fragments appear as attributes.request.url in the investigated entity 'frontend'. They could be related to 'cartservice'." + }, + { + "fragments": [ + "000aa", + "000bbb" + ], + "appearsAs": "These ids appear as span.id and parent.id in the investigated entity 'frontend'. They could be referring to spans found on upstream or downstream services" + } + ], + "relatedEntitiesSummaries": [ + "## Possible Relationships to `service.name:frontend`\n\n### 1. Entity: `service.name:controller`\n- **Indicators:**\n - #### Average Indicator:\n - **IP Address and Port:**\n - `frontend`: `10.110.191.164:8080`\n - `controller`: `10.244.0.26:8080`\n - **URL Fragment:**\n - `frontend`: `/api/cart`\n - `controller`: `/api/cart?session`\n- **Relationship Reasoning:**\n - The `controller` service is highly likely to be making requests to, or routing through, the `frontend` service as evidenced by the URL fragments referring to the `/api/cart` endpoint seen in both entities. Additionally, they share common IP address and port patterns indicating network interaction.\n- **Relevance Assessment:**\n - **Very High**: Given that the `controller` service handles endpoints like `/api/cart`, which directly correspond to transactions failing with a high error rate, this entity is a critical part of the interaction chain and should be closely examined.\n\n### 2. Entity: `service.name:cartservice`\n- **Indicators:**\n - #### Strong Indicator:\n - **Direct Call References:**\n - `frontend`: `details: 'cart failure: failed to get user cart during checkout: rpc error: ... desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"'\n - `cartservice`: `url.full.text:\"http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart\"`\n- **Relationship Reasoning:**\n - The `frontend` service attempts to interact with the `cartservice` as observed by the endpoint `/oteldemo.CartService/GetCart`. Connection errors from `frontend` indicate it is calling `cartservice` and facing issues getting responses, potentially causing the 500 errors.\n- **Relevance Assessment:**\n - **Very High**: Since `cartservice` manages user cart data and the connection errors reported in `frontend` logs directly correspond to attempts to communicate with `cartservice`, this entity is a probable cause of the service failures being observed.\n\n### 3. Entity: `service.name:frontend-web`\n- **Indicators:**\n - #### Average Indicator:\n - **URL Fragment:**\n - `frontend`: `/api/cart`\n - `frontend-web`: `/api/cart`\n - #### Weak Indicator:\n - **RUM Layer Mentions:**\n - `frontend`: `frontend-web (RUM)`\n - `frontend-web`: Described in System Architecture.\n- **Relationship Reasoning:**\n - `frontend-web` captures real user interactions with the `/api/cart` endpoint providing insights into the `frontend` service which might help trace the errors and delays externally perceived by users.\n- **Relevance Assessment:**\n - **Moderate**: While `frontend-web` can show the surface errors users are experiencing, it is more of an observability layer rather than directly causing the 500 errors or impacting the service interactions upstream.\n\n### 4. Entity: `service.name:frontendproxy`\n- **Indicators:**\n - #### Average Indicator:\n - **Network Routing Indicator:**\n - `frontend`: Receives traffic from `frontendproxy`\n - `frontendproxy`: Directs traffic to `frontend`\n - #### IP Address Mention:\n - Both services reference `8080`, indicating shared routing or proxying.\n- **Relationship Reasoning:**\n - `frontendproxy` routes traffic from external sources, including simulated user requests, to `frontend`. Any issues in this proxy layer could impact the incoming traffic to `frontend`, causing errors.\n- **Relevance Assessment:**\n - **High**: Considering `frontendproxy` handles traffic routing, any misconfiguration or failures here could lead to the issues observed on the `frontend`.\n\n### 5. Entity: `service.name:coredns`\n- **Indicators:**\n - #### Weak Indicators:\n - **DNS Resolution Events:**\n - Logs showing DNS queries involving `frontend`.\n - **IP Address and Port:**\n - Shared network interactions over common ports like `8080`.\n- **Relationship Reasoning:**\n - While not directly related to application logic, `coredns` is responsible for DNS resolution within the cluster, and issues here could result in connectivity problems seen in `frontend` when trying to reach `cartservice`.\n- **Relevance Assessment:**\n - **Moderate**: While less likely to be the root cause, DNS misconfigurations or failures could indirectly contribute to connectivity issues within services like `frontend`.\n\n### Summary\n\n1. **service.name:controller** - Very High relevance due to direct endpoint interaction.\n2. **service.name:cartservice** - Very High relevance for being the direct interaction target with observed failures.\n3. **service.name:frontend-web** - Moderate relevance in monitoring layer but not direct interaction.\n4. **service.name:frontendproxy** - High relevance for routing traffic to `frontend`.\n5. **service.name:coredns** - Moderate relevance for possible DNS resolution issues." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 5 + } + ] + } + } + }, + { + "name": "investigateEntity", + "role": "tool", + "toolCallId": "call_kstyq8qXoaWRX4CJQkC6wbhR", + "response": { + "entity": { + "service.name": "cartservice" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "controller" + }, + "reason": "The controller service is responsible for managing /api/cart requests. Thus, it acts as a direct upstream service to cartservice. High errors were observed in the controller when interacting with cartservice.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The frontend service interacts directly with the controller, handling user interactions that lead to /api/cart requests which are eventually processed by cartservice.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "The currencyservice interacts with cartservice to handle currency conversions, acting as an upstream dependency for cartservice when performing currency-related operations on cart items.", + "confidence": "medium-high" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "The checkoutservice relies on cart data from cartservice during the checkout process, making it a downstream service dependent on the correct functioning of cartservice.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "loadgenerator" + }, + "reason": "The loadgenerator service generates simulated traffic which impacts cartservice directly when testing the system's resilience.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "adservice" + }, + "reason": "The adservice might indirectly impact cartservice through the frontend service by affecting the overall user experience and potentially causing indirect latency.", + "confidence": "low-medium" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service is highly likely to be relevant as it has a direct interaction with the `cartservice` and would be significantly impacted by any issues within the `cartservice`.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "valkey" + }, + "reason": "The `valkey` service is highly relevant because it is the data store for `cartservice`, directly affecting its behavior and performance.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "The `currencyservice` may interact with `cartservice` to handle price conversions for the items in the cart. Problems with currency conversion could cause unexpected data formats or communication failures, leading to `500 Internal Server Error` in `cartservice`.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "The `checkoutservice` could potentially depend on `cartservice` to validate and finalize items in the user's cart as part of the checkout process. If the `cartservice` fails during these operations, it could propagate errors back up to the user level through `checkoutservice`.", + "confidence": "moderate" + } + ], + "summary": "Based on the context provided, including the system architecture and data samples, the entity `service.name:cartservice` can be described as follows:\n\n### Infrastructure & Environment\n`cartservice` operates within a microservices-based architecture. It is containerized and runs within a Kubernetes environment. Specifically, the data sample indicates that the service is deployed in the `default` Kubernetes namespace and is running on a pod named `my-otel-demo-cartservice-67575c6f84-vngzw` with an IP address of `10.244.0.61`. The service environment is tagged as `opentelemetry-demo`, indicating the use of OpenTelemetry for observability purposes. The infrastructure includes a Redis cache used by the cart service for data persistence.\n\n### Communication Characteristics (Protocols and Endpoints)\n`cartservice` primarily communicates using gRPC. It handles shopping cart data including adding and removing items. The service interacts with Redis (as indicated by the `labels.db_redis_flags` attribute). Additionally, the service integrates with external feature flag providers as seen from the `feature_flag_key` and `feature_flag_provider_name` attributes, which suggests it evaluates feature flags, possibly targeting the feature key `cartServiceFailure`. \n\nThe communication endpoints and protocols from the sample data are:\n- gRPC methods: `/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`\n- HTTP endpoint: `http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`\n- Redis database interactions: `HGET`, `HMSET`, `EXPIRE` commands targeting various identifiers like `my-otel-demo-valkey:6379`.\n\n### Context of Entity in Investigation\nThe cart service (`cartservice`) is being investigated as it is the downstream service handling `/api/cart` requests. Issues in `cartservice` are directly contributing to the error patterns in the controller layer for the `/api/cart` endpoint. A high error rate, culminating in `500 Internal Server Error` responses, started around `2024-11-02T10:56:42.498Z`. The context indicates that the cart service plays a crucial role in managing shopping cart operations.\n\nGiven the observed high error rates and the 500 errors, `cartservice` may be experiencing issues in processing gRPC calls, feature flag evaluations, or Redis caching, which could be causing failures that propagate upstream to the controller.\n\n### Related Entities and Previous Investigations\nPreviously, errors in the controller for POST requests to `/api/cart` have been observed. This investigation is a continuation, focusing on the downstream `cartservice` which is responsible for handling these requests. This service's interaction with other entities such as Redis (for caching cart data) and external feature flag services (potentially toggling functionality) suggest that any issues in these integrations could impact the `cartservice` performance and result in the observed errors upstream in the controller.\n\nThis detailed analysis moves us to further inspect specific logs, traces, and any interdependent service metrics that may provide clues about the root cause of the high error rate in `cartservice`.\n\n### Observations for service.name:cartservice\n\n#### Startup Messages\n1. **Pattern: \"OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.\"**\n - **Count:** 78\n - **Trend:** There was a spike at **2024-11-02T10:55:30.000Z** with 78 occurrences. Before this timestamp, the value was consistently 0.\n\n2. **Pattern: \"OTEL-SDK: [224] 'MeterProvider' Disposed.\"**\n - **Count:** 4\n - **Trend:** Occurrences were persistently recorded as 0 until a brief spike at **2024-11-02T10:55:30.000Z** with 4 instances.\n\n3. **Pattern: \"exiting...\"**\n - **Count:** 3\n - **Trend:** Consistently 0 until a minor rise at **2024-11-02T10:55:30.000Z**, with 3 instances recorded.\n\n4. **Pattern: \"Application is shutting down...\"**\n - **Count:** 2\n - **Trend:** Log entries were consistently at 0 with a brief spike at **2024-11-02T10:55:30.000Z** showing 2 instances.\n\n#### Fatal Errors\n5. **Pattern: \"FATAL: Could not start, bad entrypoint!\"**\n - **Count:** 3\n - **Trend:** This pattern shows a significant change at **2024-11-02T10:55:30.000Z** with 2 occurrences at the change point and one additional at **2024-11-02T10:56:30.000Z**. Before this period, the occurrence rate was consistently 0.\n\n### Conclusion\n\nThe patterns observed indicate that there were significant startup issues with the `cartservice` around the **2024-11-02T10:55:30.000Z** mark. Specifically, the `cartservice` encountered a fatal error (\"FATAL: Could not start, bad entrypoint!\") that aligns precisely with the rise in errors noted during this period. This error indicates that the service failed to start due to a misconfiguration or issues with the entry point. This corresponds with the sudden spike in errors and `500 Internal Server Error` responses observed in the downstream controller making POST requests to the `/api/cart` endpoint. Furthermore, logs related to the service's deactivation and shutdown support the perspective that the service was not running successfully or consistently after this time.\n\n### Timeline of significant events\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.”\n - **Description**: Spike detected with 78 occurrences, suggesting a potential issue within the service's runtime environment.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “OTEL-SDK: [224] 'MeterProvider' Disposed.”\n - **Description**: Sudden spike of 4 occurrences suggesting a significant change in the service’s telemetry setup or a potential abnormal shutdown initiation.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “exiting...”\n - **Description**: Log entries rose to 3 incidences, signaling the cart service may be initiating an unexpected exit.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “Application is shutting down...”\n - **Description**: 2 instances of this log message indicating the application is attempting to shut down around this time.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “FATAL: Could not start, bad entrypoint!”\n - **Description**: Abrupt fatal error occurs 2 times, implying a critical misconfiguration or startup failure.\n\n- **2024-11-02T10:56:30.000Z**: \n - **Log Message**: “FATAL: Could not start, bad entrypoint!”\n - **Description**: Another occurrence of the critical fatal error, indicating the issue persisted beyond the initial spike and may have contributed to continued disruptions.\n\n- **2024-11-02T10:56:42.498Z**: \n - **Alert**: High error rate observed in the controller (98.78% error rate for POST requests to /api/cart).\n - **Description**: Starts the period of significantly high error rates contributing to 500 Internal Server Error responses. \n\n### Context and reasoning\n\nGiven the high error rate (98.78%) starting from **2024-11-02T10:56:42.498Z** for POST requests to `/api/cart`, the `cartservice` is a critical component for investigation as it handles these requests directly. From logs, there is a clear indication that significant problems began around **2024-11-02T10:55:30.000Z**, approximately one minute before the heightened error rate was observed in the upstream controller.\n\n**1. Startup Issues**: Multiple startup-related log patterns such as instruments deactivation, disposal of the MeterProvider, and application exit/shutdown messages indicate that cartservice experienced troubles initializing. Notably, the log entries “FATAL: Could not start, bad entrypoint!” directly show critical failures in service entry points likely causing the downstream failures.\n\n**2. Fatal Errors**: The fatal errors precisely correlate with the timeframe where errors spiked in the upstream service (controller). The error messages “FATAL: Could not start, bad entrypoint!” occurring multiple times reflect a misconfiguration or critical code issue that prevented the service from running properly.\n\nThus, the evidence from log patterns strongly suggests that startup and initialization problems in `cartservice`, resulting in its inconsistent availability and operational failures, is the root cause of the observed high error rates and 500 Internal Server Errors in the controller's POST requests to `/api/cart`." + }, + "data": { + "attachments": { + "alerts": [], + "slos": [], + "analysis": { + "total": 41440, + "sampled": 1000, + "fields": [ + "@timestamp:date - 964 distinct values", + "agent.name.text:text - 1 distinct values (`opentelemetry/dotnet/elastic-dotnet`)", + "agent.name:keyword - 1 distinct values (`opentelemetry/dotnet/elastic-dotnet`)", + "agent.version:keyword - 1 distinct values (`1.0.0-alpha.4`)", + "container.id:keyword - 1 distinct values (`577d6250ad96a5d0016a42ed87bd5c3a63b86edd2af0a0c04b54a1cec2a1a50a`)", + "data_stream.dataset:keyword - 1 distinct values (`apm`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`traces`)", + "destination.address:keyword - 2 distinct values (`my-otel-demo-flagd`, `my-otel-demo-valkey`)", + "destination.port:long - 2 distinct values (`8013`, `6379`)", + "event.outcome:keyword - 1 distinct values (`success`)", + "event.success_count:byte - 1 distinct values (`1`)", + "host.hostname:keyword - 1 distinct values (`minikube`)", + "host.name.text:text - 1 distinct values (`minikube`)", + "host.name:keyword - 1 distinct values (`minikube`)", + "http.request.method:keyword - 1 distinct values (`POST`)", + "http.response.status_code:long - 1 distinct values (`200`)", + "kubernetes.namespace:keyword - 1 distinct values (`default`)", + "kubernetes.node.name.text:text - 1 distinct values (`minikube`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name.text:text - 1 distinct values (`my-otel-demo-cartservice-67575c6f84-vngzw`)", + "kubernetes.pod.name:keyword - 1 distinct values (`my-otel-demo-cartservice-67575c6f84-vngzw`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "labels.app_product_id:keyword - 8 distinct values (`66VCHSJNUP`, `L9ECAV7KIM`, `OLJCESPC7Z`, `0PUK6V6EV0`, `9SIQT8TOJO`, `LS4PSXUNUM`, `HQTGWGPNH4`, `6E92ZMYYFZ`)", + "labels.app_user_id:keyword - 418 distinct values (`11c5f5d4-37b4-46d4-a04e-a97fd71b8597`, `9017f637-12af-4671-b18c-0f86a58a7bbe`, `349478d0-862e-4b14-9d54-3120dd57865f`, `2a55d360-40c5-4a32-844b-4182e8050ca3`, `b9944e91-18d6-430c-90a5-4969e1917a2d`, `1ffeffe2-4e4a-47c4-8b33-e691f116c8cc`, `92ac0a92-4a23-4aa7-866b-44cd6b5d6e26`, `76765dfc-80f8-49db-8377-249e6930dd35`, `d5c375cc-6e38-45f8-b121-30fcb3ae1001`, `bdc5ebd9-a2ee-4dbf-8dae-b88a2b2b3643`, 408 more values)", + "labels.db_redis_flags:keyword - 2 distinct values (`DemandMaster`, `None`)", + "labels.feature_flag_key:keyword - 1 distinct values (`cartServiceFailure`)", + "labels.feature_flag_provider_name:keyword - 1 distinct values (`flagd Provider`)", + "labels.feature_flag_variant:keyword - 1 distinct values (`off`)", + "labels.grpc_method:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "labels.grpc_status_code:keyword - 1 distinct values (`0`)", + "labels.http_route:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "labels.k8s_deployment_name:keyword - 1 distinct values (`my-otel-demo-cartservice`)", + "labels.k8s_pod_ip:ip - 1 distinct values (`10.244.0.61`)", + "labels.k8s_pod_start_time:keyword - 1 distinct values (`2024-11-02T10:23:09Z`)", + "labels.network_protocol_version:keyword - 1 distinct values (`2`)", + "labels.service_namespace:keyword - 1 distinct values (`opentelemetry-demo`)", + "labels.transaction_id:keyword - 995 distinct values (`6b71cc6a08847a01`, `796c855656f17eb0`, `aaa6049d68006044`, `60ad645003eda9b7`, `be3e883fd0dd1a58`, `47247987037e78b3`, `180228f348c3d599`, `587dca65bb2463f3`, `c438d3e7c15d9a4f`, `0a9f738aa8e11c7e`, 985 more values)", + "numeric_labels.app_cart_items_count:scaled_float - 10 distinct values (`8`, `1`, `16`, `2`, `20`, `5`, `4`, `10`, `3`, `0`)", + "numeric_labels.app_product_quantity:scaled_float - 6 distinct values (`5`, `1`, `2`, `10`, `3`, `4`)", + "numeric_labels.db_redis_database_index:scaled_float - 1 distinct values (`0`)", + "observer.hostname:keyword - 1 distinct values (`Darios-MacBook-Pro-2.local`)", + "observer.type:keyword - 1 distinct values (`apm-server`)", + "observer.version:keyword - 1 distinct values (`8.15.0`)", + "parent.id:keyword - 999 distinct values (`76a22c35a2b363fb`, `6e363f007dd857fc`, `499ee35b7e0dc791`, `f05ead7365bb815b`, `46709d74aeb1ac57`, `c1e7aeb4f3b66351`, `d6e80a03ce62827e`, `5eff08ed000af546`, `80be4180f1c8985e`, `9154a028a223da28`, 989 more values)", + "processor.event:keyword - 2 distinct values (`transaction`, `span`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.framework.name.text:text - 1 distinct values (`Microsoft.AspNetCore`)", + "service.framework.name:keyword - 1 distinct values (`Microsoft.AspNetCore`)", + "service.language.name.text:text - 1 distinct values (`dotnet`)", + "service.language.name:keyword - 1 distinct values (`dotnet`)", + "service.name.text:text - 1 distinct values (`cartservice`)", + "service.name:keyword - 1 distinct values (`cartservice`)", + "service.node.name.text:text - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "service.node.name:keyword - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "service.target.name.text:text - 3 distinct values (`my-otel-demo-flagd:8013`, `flagd.evaluation.v1.Service`, 1 more values)", + "service.target.name:keyword - 3 distinct values (`my-otel-demo-flagd:8013`, `flagd.evaluation.v1.Service`, `my-otel-demo-valkey:6379`)", + "service.target.type:keyword - 3 distinct values (`http`, `grpc`, `redis`)", + "span.db.statement:keyword - 455 distinct values (`HGET dd1f04f3-aaf1-4a76-85e4-8c64a930684e`, `EXPIRE 2538c162-9908-11ef-8217-d64fba5f23b1`, `HGET 958266ce-2169-4a2a-bcd5-090fd75cf50b`, `HGET ba92c7a8-6623-4267-8512-9cf0cb23bbf8`, `HGET d96a9e44-a9ed-4f64-8f46-5d4acd05a1fa`, `HGET 4a0d4f33-09ee-4008-a826-027dd6e889c6`, `HGET 5bc59fca-3c11-4d71-9496-c9c29b9d37d1`, `HGET 0497c8a8-2da2-4ff7-80a7-ce647916277c`, `HGET 87d37a8f-cc58-483a-aad0-fc0c91421544`, `HGET 4dea82bc-1c58-4f0a-97fd-3a1369544dc0`, 445 more values)", + "span.db.type:keyword - 1 distinct values (`redis`)", + "span.destination.service.name.text:text - 3 distinct values (`http://my-otel-demo-flagd:8013`, `my-otel-demo-flagd:8013`, 1 more values)", + "span.destination.service.name:keyword - 3 distinct values (`http://my-otel-demo-flagd:8013`, `my-otel-demo-flagd:8013`, `my-otel-demo-valkey:6379`)", + "span.destination.service.resource:keyword - 2 distinct values (`my-otel-demo-flagd:8013`, `my-otel-demo-valkey:6379`)", + "span.destination.service.type:keyword - 2 distinct values (`external`, `db`)", + "span.duration.us:long - 399 distinct values (`501`, `154`, `355`, `3766`, `818`, `657`, `203`, `127`, `715`, `1092`, 389 more values)", + "span.id:keyword - 1000 distinct values (`6b71cc6a08847a01`, `796c855656f17eb0`, `aaa6049d68006044`, `60ad645003eda9b7`, `be3e883fd0dd1a58`, `47247987037e78b3`, `180228f348c3d599`, `587dca65bb2463f3`, `c438d3e7c15d9a4f`, `0a9f738aa8e11c7e`, 990 more values)", + "span.name.text:text - 5 distinct values (`POST`, `flagd.evaluation.v1.Service/ResolveBoolean`, 3 more values)", + "span.name:keyword - 5 distinct values (`POST`, `flagd.evaluation.v1.Service/ResolveBoolean`, `HMSET`, `EXPIRE`, `HGET`)", + "span.representative_count:scaled_float - 1 distinct values (`1`)", + "span.subtype:keyword - 3 distinct values (`http`, `grpc`, `redis`)", + "span.type:keyword - 2 distinct values (`external`, `db`)", + "tags:keyword - 1 distinct values (`_geoip_database_unavailable_GeoLite2-City.mmdb`)", + "timestamp.us:long - 1000 distinct values (`1730544111451828`, `1730544606786118`, `1730544573583321`, `1730544068214001`, `1730543971566630`, `1730544035740835`, `1730543892242334`, `1730544845301548`, `1730543919324800`, `1730544697032712`, 990 more values)", + "trace.id:keyword - 920 distinct values (`de1ed71d39ca87650a8401ae46f2cac0`, `1283785f372e3335e30ab82c53008ea6`, `be3fc18a45763f00d43954ef09300042`, `bffb395c41d9a23aa7acc6b1993f64c6`, `68df2f10f7b09e787c688046ae76f6ff`, `3ba13e99d34a48133415c71b9b523321`, `6405704384b681e891e1067b1c1e6e68`, `b137359ec568679804d48c699dd49df5`, `cce045bbbdbb711a2f5cae192c337cb3`, `85743f477e557162900c88409231222a`, 910 more values)", + "transaction.duration.us:long - 441 distinct values (`2497`, `2659`, `610`, `458`, `3158`, `1484`, `436`, `536`, `2602`, `3472`, 431 more values)", + "transaction.id:keyword - 469 distinct values (`60ad645003eda9b7`, `be3e883fd0dd1a58`, `180228f348c3d599`, `0a9f738aa8e11c7e`, `66622c930742b62b`, `2493315b88140ec7`, `7950f85af72baaa0`, `0fda0e8c0af2a975`, `0504e94fae4dd7f8`, `25ec77d0c132ceef`, 459 more values)", + "transaction.name.text:text - 3 distinct values (`POST /oteldemo.CartService/EmptyCart`, `POST /oteldemo.CartService/AddItem`, 1 more values)", + "transaction.name:keyword - 3 distinct values (`POST /oteldemo.CartService/EmptyCart`, `POST /oteldemo.CartService/AddItem`, `POST /oteldemo.CartService/GetCart`)", + "transaction.representative_count:scaled_float - 1 distinct values (`1`)", + "transaction.result:keyword - 1 distinct values (`HTTP 2xx`)", + "transaction.sampled:boolean - 1 distinct values (`true`)", + "transaction.type:keyword - 1 distinct values (`request`)", + "url.domain:keyword - 1 distinct values (`my-otel-demo-cartservice`)", + "url.full.text:text - 3 distinct values (`http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`, 1 more values)", + "url.full:keyword - 3 distinct values (`http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart`)", + "url.original.text:text - 4 distinct values (`http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`, `/oteldemo.CartService/EmptyCart`, 2 more values)", + "url.original:keyword - 4 distinct values (`http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`, `/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "url.path:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "url.port:long - 1 distinct values (`8080`)", + "url.scheme:keyword - 1 distinct values (`http`)", + "user_agent.device.name.text:text - 1 distinct values (`Other`)", + "user_agent.device.name:keyword - 1 distinct values (`Other`)", + "user_agent.name.text:text - 1 distinct values (`Other`)", + "user_agent.name:keyword - 1 distinct values (`Other`)", + "user_agent.original.text:text - 2 distinct values (`grpc-go/1.64.0`, `grpc-node-js/1.10.11`)", + "user_agent.original:keyword - 2 distinct values (`grpc-go/1.64.0`, `grpc-node-js/1.10.11`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 8414, + "pattern": "called with userId", + "regex": ".*?called.+?with.+?userId.*?", + "sample": "GetCartAsync called with userId=f96ee88a-4745-45f1-885a-16c3de0c668a", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=f96ee88a-4745-45f1-885a-16c3de0c668a" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 226 + }, + { + "x": 1730543820000, + "y": 194 + }, + { + "x": 1730543850000, + "y": 270 + }, + { + "x": 1730543880000, + "y": 200 + }, + { + "x": 1730543910000, + "y": 164 + }, + { + "x": 1730543940000, + "y": 198 + }, + { + "x": 1730543970000, + "y": 192 + }, + { + "x": 1730544000000, + "y": 228 + }, + { + "x": 1730544030000, + "y": 230 + }, + { + "x": 1730544060000, + "y": 212 + }, + { + "x": 1730544090000, + "y": 222 + }, + { + "x": 1730544120000, + "y": 210 + }, + { + "x": 1730544150000, + "y": 240 + }, + { + "x": 1730544180000, + "y": 200 + }, + { + "x": 1730544210000, + "y": 204 + }, + { + "x": 1730544240000, + "y": 222 + }, + { + "x": 1730544270000, + "y": 216 + }, + { + "x": 1730544300000, + "y": 254 + }, + { + "x": 1730544330000, + "y": 218 + }, + { + "x": 1730544360000, + "y": 228 + }, + { + "x": 1730544390000, + "y": 214 + }, + { + "x": 1730544420000, + "y": 220 + }, + { + "x": 1730544450000, + "y": 218 + }, + { + "x": 1730544480000, + "y": 224 + }, + { + "x": 1730544510000, + "y": 228 + }, + { + "x": 1730544540000, + "y": 228 + }, + { + "x": 1730544570000, + "y": 232 + }, + { + "x": 1730544600000, + "y": 218 + }, + { + "x": 1730544630000, + "y": 232 + }, + { + "x": 1730544660000, + "y": 212 + }, + { + "x": 1730544690000, + "y": 236 + }, + { + "x": 1730544720000, + "y": 246 + }, + { + "x": 1730544750000, + "y": 218 + }, + { + "x": 1730544780000, + "y": 214 + }, + { + "x": 1730544810000, + "y": 210 + }, + { + "x": 1730544840000, + "y": 228 + }, + { + "x": 1730544870000, + "y": 228 + }, + { + "x": 1730544900000, + "y": 224 + }, + { + "x": 1730544930000, + "y": 56 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "bfeu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "Enqueued", + "regex": ".*?Enqueued.*?", + "sample": "Enqueued", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Enqueued" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "oacl", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "ResponseReceived", + "regex": ".*?ResponseReceived.*?", + "sample": "ResponseReceived", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "ResponseReceived" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "hhud", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "Sent", + "regex": ".*?Sent.*?", + "sample": "Sent", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Sent" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ttbh", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4441, + "pattern": "info 0", + "regex": ".*?info.+?0.*?", + "sample": "info: cartservice.cartstore.ValkeyCartStore[0]\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "info: cartservice.cartstore.ValkeyCartStore[0]\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 117 + }, + { + "x": 1730543820000, + "y": 104 + }, + { + "x": 1730543850000, + "y": 146 + }, + { + "x": 1730543880000, + "y": 103 + }, + { + "x": 1730543910000, + "y": 86 + }, + { + "x": 1730543940000, + "y": 110 + }, + { + "x": 1730543970000, + "y": 97 + }, + { + "x": 1730544000000, + "y": 119 + }, + { + "x": 1730544030000, + "y": 120 + }, + { + "x": 1730544060000, + "y": 110 + }, + { + "x": 1730544090000, + "y": 116 + }, + { + "x": 1730544120000, + "y": 109 + }, + { + "x": 1730544150000, + "y": 124 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 109 + }, + { + "x": 1730544240000, + "y": 115 + }, + { + "x": 1730544270000, + "y": 113 + }, + { + "x": 1730544300000, + "y": 137 + }, + { + "x": 1730544330000, + "y": 114 + }, + { + "x": 1730544360000, + "y": 122 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 113 + }, + { + "x": 1730544450000, + "y": 114 + }, + { + "x": 1730544480000, + "y": 117 + }, + { + "x": 1730544510000, + "y": 116 + }, + { + "x": 1730544540000, + "y": 117 + }, + { + "x": 1730544570000, + "y": 121 + }, + { + "x": 1730544600000, + "y": 112 + }, + { + "x": 1730544630000, + "y": 123 + }, + { + "x": 1730544660000, + "y": 108 + }, + { + "x": 1730544690000, + "y": 129 + }, + { + "x": 1730544720000, + "y": 132 + }, + { + "x": 1730544750000, + "y": 111 + }, + { + "x": 1730544780000, + "y": 111 + }, + { + "x": 1730544810000, + "y": 108 + }, + { + "x": 1730544840000, + "y": 120 + }, + { + "x": 1730544870000, + "y": 118 + }, + { + "x": 1730544900000, + "y": 120 + }, + { + "x": 1730544930000, + "y": 73 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "eahn", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4152, + "pattern": "Fetch cart", + "regex": ".*?Fetch.+?cart.*?", + "sample": "Fetch cart", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Fetch cart" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 112 + }, + { + "x": 1730543820000, + "y": 94 + }, + { + "x": 1730543850000, + "y": 132 + }, + { + "x": 1730543880000, + "y": 100 + }, + { + "x": 1730543910000, + "y": 80 + }, + { + "x": 1730543940000, + "y": 97 + }, + { + "x": 1730543970000, + "y": 96 + }, + { + "x": 1730544000000, + "y": 113 + }, + { + "x": 1730544030000, + "y": 113 + }, + { + "x": 1730544060000, + "y": 105 + }, + { + "x": 1730544090000, + "y": 111 + }, + { + "x": 1730544120000, + "y": 104 + }, + { + "x": 1730544150000, + "y": 119 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 100 + }, + { + "x": 1730544240000, + "y": 110 + }, + { + "x": 1730544270000, + "y": 107 + }, + { + "x": 1730544300000, + "y": 123 + }, + { + "x": 1730544330000, + "y": 107 + }, + { + "x": 1730544360000, + "y": 112 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 109 + }, + { + "x": 1730544450000, + "y": 108 + }, + { + "x": 1730544480000, + "y": 111 + }, + { + "x": 1730544510000, + "y": 114 + }, + { + "x": 1730544540000, + "y": 114 + }, + { + "x": 1730544570000, + "y": 112 + }, + { + "x": 1730544600000, + "y": 107 + }, + { + "x": 1730544630000, + "y": 114 + }, + { + "x": 1730544660000, + "y": 105 + }, + { + "x": 1730544690000, + "y": 115 + }, + { + "x": 1730544720000, + "y": 119 + }, + { + "x": 1730544750000, + "y": 109 + }, + { + "x": 1730544780000, + "y": 106 + }, + { + "x": 1730544810000, + "y": 105 + }, + { + "x": 1730544840000, + "y": 113 + }, + { + "x": 1730544870000, + "y": 113 + }, + { + "x": 1730544900000, + "y": 109 + }, + { + "x": 1730544930000, + "y": 27 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "xpjx", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 602, + "pattern": "called with userId 11ef 8217 d64fba5f23b1", + "regex": ".*?called.+?with.+?userId.+?11ef.+?8217.+?d64fba5f23b1.*?", + "sample": "GetCartAsync called with userId=fb462b14-9908-11ef-8217-d64fba5f23b1", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=fb462b14-9908-11ef-8217-d64fba5f23b1" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.219Z", + "lastOccurrence": "2024-11-02T10:55:34.364Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 12 + }, + { + "x": 1730543820000, + "y": 26 + }, + { + "x": 1730543850000, + "y": 34 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 16 + }, + { + "x": 1730543940000, + "y": 30 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 14 + }, + { + "x": 1730544030000, + "y": 18 + }, + { + "x": 1730544060000, + "y": 12 + }, + { + "x": 1730544090000, + "y": 10 + }, + { + "x": 1730544120000, + "y": 12 + }, + { + "x": 1730544150000, + "y": 12 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 22 + }, + { + "x": 1730544240000, + "y": 12 + }, + { + "x": 1730544270000, + "y": 14 + }, + { + "x": 1730544300000, + "y": 36 + }, + { + "x": 1730544330000, + "y": 18 + }, + { + "x": 1730544360000, + "y": 24 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 10 + }, + { + "x": 1730544450000, + "y": 14 + }, + { + "x": 1730544480000, + "y": 14 + }, + { + "x": 1730544510000, + "y": 4 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 26 + }, + { + "x": 1730544600000, + "y": 14 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 8 + }, + { + "x": 1730544690000, + "y": 34 + }, + { + "x": 1730544720000, + "y": 34 + }, + { + "x": 1730544750000, + "y": 4 + }, + { + "x": 1730544780000, + "y": 12 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 16 + }, + { + "x": 1730544870000, + "y": 12 + }, + { + "x": 1730544900000, + "y": 28 + }, + { + "x": 1730544930000, + "y": 8 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ckdv", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 382, + "pattern": "AddItemAsync called with userId 11ef 8217 d64fba5f23b1 productId quantity", + "regex": ".*?AddItemAsync.+?called.+?with.+?userId.+?11ef.+?8217.+?d64fba5f23b1.+?productId.+?quantity.*?", + "sample": "AddItemAsync called with userId=fc4e8196-9908-11ef-8217-d64fba5f23b1, productId=1YMWWN1N4O, quantity=10", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "AddItemAsync called with userId=fc4e8196-9908-11ef-8217-d64fba5f23b1, productId=1YMWWN1N4O, quantity=10" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.216Z", + "lastOccurrence": "2024-11-02T10:55:34.363Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 8 + }, + { + "x": 1730543820000, + "y": 14 + }, + { + "x": 1730543850000, + "y": 22 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 8 + }, + { + "x": 1730543940000, + "y": 22 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 10 + }, + { + "x": 1730544030000, + "y": 10 + }, + { + "x": 1730544060000, + "y": 8 + }, + { + "x": 1730544090000, + "y": 10 + }, + { + "x": 1730544120000, + "y": 8 + }, + { + "x": 1730544150000, + "y": 8 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 14 + }, + { + "x": 1730544240000, + "y": 8 + }, + { + "x": 1730544270000, + "y": 10 + }, + { + "x": 1730544300000, + "y": 20 + }, + { + "x": 1730544330000, + "y": 10 + }, + { + "x": 1730544360000, + "y": 16 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 6 + }, + { + "x": 1730544450000, + "y": 10 + }, + { + "x": 1730544480000, + "y": 10 + }, + { + "x": 1730544510000, + "y": 4 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 10 + }, + { + "x": 1730544600000, + "y": 6 + }, + { + "x": 1730544630000, + "y": 14 + }, + { + "x": 1730544660000, + "y": 4 + }, + { + "x": 1730544690000, + "y": 22 + }, + { + "x": 1730544720000, + "y": 18 + }, + { + "x": 1730544750000, + "y": 4 + }, + { + "x": 1730544780000, + "y": 8 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 12 + }, + { + "x": 1730544870000, + "y": 8 + }, + { + "x": 1730544900000, + "y": 16 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "habq", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 216, + "pattern": "GetCartAsync called with userId", + "regex": ".*?GetCartAsync.+?called.+?with.+?userId.*?", + "sample": "GetCartAsync called with userId=", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=" + ] + }, + "firstOccurrence": "2024-11-02T10:36:36.912Z", + "lastOccurrence": "2024-11-02T10:55:33.022Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 10 + }, + { + "x": 1730543820000, + "y": 4 + }, + { + "x": 1730543850000, + "y": 6 + }, + { + "x": 1730543880000, + "y": 4 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 4 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 10 + }, + { + "x": 1730544030000, + "y": 10 + }, + { + "x": 1730544060000, + "y": 6 + }, + { + "x": 1730544090000, + "y": 2 + }, + { + "x": 1730544120000, + "y": 8 + }, + { + "x": 1730544150000, + "y": 8 + }, + { + "x": 1730544180000, + "y": 4 + }, + { + "x": 1730544210000, + "y": 6 + }, + { + "x": 1730544240000, + "y": 2 + }, + { + "x": 1730544270000, + "y": 4 + }, + { + "x": 1730544300000, + "y": 8 + }, + { + "x": 1730544330000, + "y": 4 + }, + { + "x": 1730544360000, + "y": 4 + }, + { + "x": 1730544390000, + "y": 2 + }, + { + "x": 1730544420000, + "y": 8 + }, + { + "x": 1730544450000, + "y": 4 + }, + { + "x": 1730544480000, + "y": 10 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 12 + }, + { + "x": 1730544570000, + "y": 8 + }, + { + "x": 1730544600000, + "y": 8 + }, + { + "x": 1730544630000, + "y": 6 + }, + { + "x": 1730544660000, + "y": 6 + }, + { + "x": 1730544690000, + "y": 2 + }, + { + "x": 1730544720000, + "y": 6 + }, + { + "x": 1730544750000, + "y": 6 + }, + { + "x": 1730544780000, + "y": 4 + }, + { + "x": 1730544810000, + "y": 2 + }, + { + "x": 1730544840000, + "y": 6 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 8 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "tzfi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 55, + "pattern": "Empty cart", + "regex": ".*?Empty.+?cart.*?", + "sample": "Empty cart", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Empty cart" + ] + }, + "firstOccurrence": "2024-11-02T10:36:41.806Z", + "lastOccurrence": "2024-11-02T10:55:32.654Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1 + }, + { + "x": 1730543820000, + "y": 3 + }, + { + "x": 1730543850000, + "y": 3 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 2 + }, + { + "x": 1730543940000, + "y": 2 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 1 + }, + { + "x": 1730544030000, + "y": 2 + }, + { + "x": 1730544060000, + "y": 1 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 1 + }, + { + "x": 1730544150000, + "y": 1 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 2 + }, + { + "x": 1730544240000, + "y": 1 + }, + { + "x": 1730544270000, + "y": 1 + }, + { + "x": 1730544300000, + "y": 4 + }, + { + "x": 1730544330000, + "y": 2 + }, + { + "x": 1730544360000, + "y": 2 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 1 + }, + { + "x": 1730544450000, + "y": 1 + }, + { + "x": 1730544480000, + "y": 1 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 4 + }, + { + "x": 1730544600000, + "y": 2 + }, + { + "x": 1730544630000, + "y": 2 + }, + { + "x": 1730544660000, + "y": 1 + }, + { + "x": 1730544690000, + "y": 3 + }, + { + "x": 1730544720000, + "y": 4 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 1 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 1 + }, + { + "x": 1730544870000, + "y": 1 + }, + { + "x": 1730544900000, + "y": 3 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ldwf", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 55, + "pattern": "feature_flag", + "regex": ".*?feature_flag.*?", + "sample": "feature_flag", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "feature_flag" + ] + }, + "firstOccurrence": "2024-11-02T10:36:41.809Z", + "lastOccurrence": "2024-11-02T10:55:32.655Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1 + }, + { + "x": 1730543820000, + "y": 3 + }, + { + "x": 1730543850000, + "y": 3 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 2 + }, + { + "x": 1730543940000, + "y": 2 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 1 + }, + { + "x": 1730544030000, + "y": 2 + }, + { + "x": 1730544060000, + "y": 1 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 1 + }, + { + "x": 1730544150000, + "y": 1 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 2 + }, + { + "x": 1730544240000, + "y": 1 + }, + { + "x": 1730544270000, + "y": 1 + }, + { + "x": 1730544300000, + "y": 4 + }, + { + "x": 1730544330000, + "y": 2 + }, + { + "x": 1730544360000, + "y": 2 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 1 + }, + { + "x": 1730544450000, + "y": 1 + }, + { + "x": 1730544480000, + "y": 1 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 4 + }, + { + "x": 1730544600000, + "y": 2 + }, + { + "x": 1730544630000, + "y": 2 + }, + { + "x": 1730544660000, + "y": 1 + }, + { + "x": 1730544690000, + "y": 3 + }, + { + "x": 1730544720000, + "y": 4 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 1 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 1 + }, + { + "x": 1730544870000, + "y": 1 + }, + { + "x": 1730544900000, + "y": 3 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "noer", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 2, + "pattern": "OTEL-SDK BatchActivityExportProcessor exporting to OtlpTraceExporter dropped items", + "regex": ".*?OTEL-SDK.+?BatchActivityExportProcessor.+?exporting.+?to.+?OtlpTraceExporter.+?dropped.+?items.*?", + "sample": "OTEL-SDK: [224] 'BatchActivityExportProcessor' exporting to 'OtlpTraceExporter' dropped '0' items.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] 'BatchActivityExportProcessor' exporting to 'OtlpTraceExporter' dropped '0' items." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.580Z", + "lastOccurrence": "2024-11-02T10:55:36.580Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "fiia", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1, + "pattern": "my-otel-demo-valkey open", + "regex": ".*?my-otel-demo-valkey.+?open.*?", + "sample": "my-otel-demo-valkey (10.106.38.244:6379) open\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "my-otel-demo-valkey (10.106.38.244:6379) open\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:34.993Z", + "lastOccurrence": "2024-11-02T10:55:34.993Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "uzyf", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 78, + "pattern": "OTEL-SDK Instrument Meter has been deactivated", + "regex": ".*?OTEL-SDK.+?Instrument.+?Meter.+?has.+?been.+?deactivated.*?", + "sample": "OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.585Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 78 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "lciw", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 4, + "pattern": "OTEL-SDK Disposed", + "regex": ".*?OTEL-SDK.+?Disposed.*?", + "sample": "OTEL-SDK: [224] 'MeterProvider' Disposed.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] 'MeterProvider' Disposed." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.581Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "woqa", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 3, + "pattern": "exiting", + "regex": ".*?exiting.*?", + "sample": "exiting...\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "exiting...\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:55.622Z", + "lastOccurrence": "2024-11-02T10:56:51.618Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 1 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ucuj", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 2, + "pattern": "Application is shutting down", + "regex": ".*?Application.+?is.+?shutting.+?down.*?", + "sample": "Application is shutting down...", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Application is shutting down..." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.560Z", + "lastOccurrence": "2024-11-02T10:55:36.560Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "cgip", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 3, + "pattern": "FATAL Could not start entrypoint", + "regex": ".*?FATAL.+?Could.+?not.+?start.+?entrypoint.*?", + "sample": "FATAL: Could not start, bad entrypoint!\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "FATAL: Could not start, bad entrypoint!\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:35.618Z", + "lastOccurrence": "2024-11-02T10:56:31.617Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 1 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 1.8274885276877215e-20, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "reqc", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [ + { + "field": "message", + "count": 26, + "pattern": "I1102 replica_set.go Finished syncing logger replicaset-controller kind ReplicaSet key duration", + "regex": ".*?I1102.+?replica_set\\.go.+?Finished.+?syncing.+?logger.+?replicaset-controller.+?kind.+?ReplicaSet.+?key.+?duration.*?", + "sample": "I1102 10:55:33.013871 1 replica_set.go:679] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice-7b585f4fb7\" duration=\"101.333µs\"\n", + "highlight": { + "body.text": [ + "] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice" + ], + "message": [ + "] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice" + ] + }, + "metadata": { + "service.name": [ + "kube-controller-manager" + ], + "message": [ + "I1102 10:55:33.013871 1 replica_set.go:679] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice-7b585f4fb7\" duration=\"101.333µs\"\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:33.014Z", + "lastOccurrence": "2024-11-02T10:56:52.568Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 19 + }, + { + "x": 1730544960000, + "y": 2 + }, + { + "x": 1730544990000, + "y": 5 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 7.313742705200763e-147, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "ofdx", + "relevance": "normal", + "interesting": true + }, + { + "field": "message", + "count": 21, + "pattern": "object apiVersion events.k8s.io/v1 deprecatedCount deprecatedFirstTimestamp deprecatedLastTimestamp deprecatedSource component eventTime null kind Event metadata creationTimestamp managedFields apiVersion v1 fieldsType FieldsV1 fieldsV1", + "regex": ".*?object.+?apiVersion.+?events\\.k8s\\.io/v1.+?deprecatedCount.+?deprecatedFirstTimestamp.+?deprecatedLastTimestamp.+?deprecatedSource.+?component.+?eventTime.+?null.+?kind.+?Event.+?metadata.+?creationTimestamp.+?managedFields.+?apiVersion.+?v1.+?fieldsType.+?FieldsV1.+?fieldsV1.*?", + "sample": "{\"object\":{\"apiVersion\":\"events.k8s.io/v1\",\"deprecatedCount\":2,\"deprecatedFirstTimestamp\":\"2024-11-02T10:56:17Z\",\"deprecatedLastTimestamp\":\"2024-11-02T10:56:52Z\",\"deprecatedSource\":{\"component\":\"kubelet\",\"host\":\"minikube\"},\"eventTime\":null,\"kind\":\"Event\",\"metadata\":{\"creationTimestamp\":\"2024-11-02T10:56:17Z\",\"managedFields\":[{\"apiVersion\":\"v1\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:count\":{},\"f:firstTimestamp\":{},\"f:involvedObject\":{},\"f:lastTimestamp\":{},\"f:message\":{},\"f:reason\":{},\"f:reportingComponent\":{},\"f:reportingInstance\":{},\"f:source\":{\"f:component\":{},\"f:host\":{}},\"f:type\":{}},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz.1804217ce2cb3041\",\"namespace\":\"default\",\"resourceVersion\":\"375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":\"9580334a-7ef9-4ad5-baf6-0ad10ae49853\"},\"reportingController\":\"kubelet\",\"reportingInstance\":\"minikube\",\"type\":\"Warning\"},\"type\":\"MODIFIED\"}", + "highlight": { + "message": [ + "},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice", + "375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice", + "in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason", + "\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name", + "\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":" + ] + }, + "metadata": { + "service.name": [ + "unknown" + ], + "message": [ + "{\"object\":{\"apiVersion\":\"events.k8s.io/v1\",\"deprecatedCount\":2,\"deprecatedFirstTimestamp\":\"2024-11-02T10:56:17Z\",\"deprecatedLastTimestamp\":\"2024-11-02T10:56:52Z\",\"deprecatedSource\":{\"component\":\"kubelet\",\"host\":\"minikube\"},\"eventTime\":null,\"kind\":\"Event\",\"metadata\":{\"creationTimestamp\":\"2024-11-02T10:56:17Z\",\"managedFields\":[{\"apiVersion\":\"v1\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:count\":{},\"f:firstTimestamp\":{},\"f:involvedObject\":{},\"f:lastTimestamp\":{},\"f:message\":{},\"f:reason\":{},\"f:reportingComponent\":{},\"f:reportingInstance\":{},\"f:source\":{\"f:component\":{},\"f:host\":{}},\"f:type\":{}},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz.1804217ce2cb3041\",\"namespace\":\"default\",\"resourceVersion\":\"375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":\"9580334a-7ef9-4ad5-baf6-0ad10ae49853\"},\"reportingController\":\"kubelet\",\"reportingInstance\":\"minikube\",\"type\":\"Warning\"},\"type\":\"MODIFIED\"}" + ] + }, + "firstOccurrence": "2024-11-02T10:55:33.051Z", + "lastOccurrence": "2024-11-02T10:56:52.563Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 16 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 4 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 2.9750218550484796e-168, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "lqan", + "relevance": "critical", + "interesting": true + } + ], + "searches": [ + { + "fragments": [ + "AddItemAsync called with userId", + "productId", + "quantity" + ], + "appearsAs": "userId, productId, and quantity are referenced in the request handling log entries in cartservice." + }, + { + "fragments": [ + "GetCartAsync called with userId" + ], + "appearsAs": "userId is referenced in the request handling log entries in cartservice." + }, + { + "fragments": [ + "Empty cart" + ], + "appearsAs": "Empty cart operation logs in cartservice." + }, + { + "fragments": [ + "cartServiceFailure" + ], + "appearsAs": "Feature flag 'cartServiceFailure' in cartservice." + }, + { + "fragments": [ + "10.244.0.61" + ], + "appearsAs": "IP address of the cartservice pod." + }, + { + "fragments": [ + "my-otel-demo-cartservice-67575c6f84-vngzw" + ], + "appearsAs": "Pod name of cartservice." + }, + { + "fragments": [ + "my-otel-demo-valkey:6379" + ], + "appearsAs": "Redis service used by cartservice." + }, + { + "fragments": [ + "/oteldemo.CartService/AddItem", + "/oteldemo.CartService/GetCart", + "/oteldemo.CartService/EmptyCart" + ], + "appearsAs": "Endpoints handled by cartservice." + }, + { + "fragments": [ + "flagd.evaluation.v1.Service" + ], + "appearsAs": "gRPC service involved in feature flag evaluation by cartservice." + }, + { + "fragments": [ + "HGET", + "EXPIRE", + "HMSET" + ], + "appearsAs": "Redis commands executed by cartservice." + } + ], + "relatedEntitiesSummaries": [ + "Based on the context provided, the following entities are potentially related to `service.name:cartservice` as either upstream or downstream dependencies. Below is a detailed analysis based on the indicators of relationships obtained from the observability data:\n\n### 1. Related Entity: `service.name:controller`\n- **Indicators**: \n - **Average Indicator**: The logs highlight high error rates (500 Internal Server Error) in the controller when POST requests to the `/api/cart` endpoint are made.\n - **Field values**: In controller logs, `message` contains references to the `/api/cart` endpoint, which is handled by `cartservice`.\n- **Reasoning**: \n - The `controller` service is responsible for managing /api/cart requests. Thus, it acts as a direct upstream service to `cartservice`.\n - It implies `controller` calls `cartservice` as part of handling requests, leading to the observed errors.\n- **Likeliness**: High\n - The `controller` service is likely a highly relevant entity since it directly interfaces with `cartservice`, with the errors surfacing in it when interacting with `cartservice`.\n\n### 2. Related Entity: `service.name:frontend`\n- **Indicators**:\n - **Strong Indicator**: The system architecture documentation shows that `frontend` interacts with various backend services, including those for user interactions such as adding items to the cart.\n - **Field values**: In the knowledge base, `frontend` receives HTTP traffic routed through `frontendproxy` and interacts with `cartservice`.\n- **Reasoning**:\n - `frontend` would act as a direct upstream service that communicates with `controller`, providing requests that eventually hit `cartservice`.\n- **Likeliness**: High\n - As `frontend` handles initial user interactions and routes requests to `cartservice`, it is essential in the request flow leading to `/api/cart` errors.\n\n### 3. Related Entity: `service.name:currencyservice`\n- **Indicators**:\n - **Strong Indicator**: The architecture description indicates `currencyservice` interacts with `cartservice` to handle currency conversions.\n - **Field values**: The entries show gRPC calls between `cartservice` and `currencyservice` for conversion operations.\n- **Reasoning**:\n - `currencyservice` may be an upstream dependency for `cartservice` for any currency-related manipulations on cart items.\n- **Likeliness**: Medium-High\n - While `currencyservice` interacts with `cartservice`, its exact influence on the direct issue might not be as strong as `controller` or `frontend`.\n\n### 4. Related Entity: `service.name:checkoutservice`\n- **Indicators**:\n - **Strong Indicator**: The architecture documentation lists `checkoutservice` as coordinating the checkout process involving interactions with `cartservice`.\n - **Field values**: Distributed tracing data could show `checkoutservice` making gRPC or HTTP calls to `cartservice`.\n- **Reasoning**:\n - `checkoutservice` is likely a downstream service that relies on the correct functioning of `cartservice` to gather cart data before proceeding to checkout operations.\n- **Likeliness**: Medium\n - Although primarily a downstream dependency, it processes important data from `cartservice`.\n\n### 5. Related Entity: `service.name:adservice`\n- **Indicators**:\n - **Weak Indicator**: `adservice` interfaces with `frontend` via gRPC to deliver ad content, it also might indirectly influence `cartservice` interactions if ads are part of the cart page.\n - **Field values**: Architectural details state `adservice` operates in the background to enhance user experience but no direct interaction with `cartservice`.\n- **Reasoning**:\n - While not directly connected, any latency in `adservice` may affect the overall user experience, causing indirect latency in calls that reach `cartservice`.\n- **Likeliness**: Low-Medium\n - Indirect connection and latent repercussions on user interactions with cart functionality.\n\n### 6. Related Entity: `service.name:loadgenerator`\n- **Indicators**:\n - **Average Indicator**: The `loadgenerator` service generates simulated traffic, handled by `frontendproxy` to stress-test services like `cartservice`.\n - **Field values**: Traffic from `loadgenerator` is routed through `frontendproxy` to reach core services, including `cartservice`.\n- **Reasoning**:\n - As an external input simulator, its traffic generation directly impacts `cartservice` when testing load resilience.\n- **Likeliness**: Medium\n - The errors can be a result of load tests conducted by `loadgenerator` surfacing bottlenecks in `cartservice`.\n\n### Summary\n\nTo conclude, the following entities are likely relevant to the issue in `service.name:cartservice`:\n\n1. **controller**: Direct upstream causing the 500 errors - High relevance.\n2. **frontend**: Upstream service initiating user interactions - High relevance.\n3. **currencyservice**: Upstream service for currency conversion - Medium-High relevance.\n4. **checkoutservice**: Downstream service relying on cart data - Medium relevance.\n5. **adservice**: Possible indirect impact due to latency - Low-Medium relevance.\n6. **loadgenerator**: Simulated traffic testing the system's resilience - Medium relevance.\n\nBy analyzing these entities, you can prioritize investigating `controller`, `frontend`, and `currencyservice` first, as they have the most direct and potentially impactful interactions with `cartservice`.", + "Based on the context provided, the architecture outlined in the knowledge base entry, the document analysis for the `cartservice`, and search keywords, several possible relationships with the `cartservice` can be identified. Below are the entities identified as highly relevant to the `cartservice`, along with the indicators, evidence, reasoning, and overall relevance.\n\n### 1. Entity: `service.name:frontend`\n\n#### Indicators and Evidence\n- **Average Indicator - URL Paths:**\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart`\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`\n- **Average Indicator - Logs:**\n - Observed in the search highlights for `service.name:frontend`: `@opentelemetry/api/build/src/api/context.js:60:46) at ServiceClientImpl.clientMethodTrace [as getCart]`\n- **Knowledge Base:**\n - The `frontend` is the core service for user interactions, receiving HTTP traffic and making requests to the `cartservice`.\n\n#### Relationship and Reasoning\nThe `frontend` service interacts directly with the `cartservice` by making requests to handle user shopping cart operations, such as adding items, retrieving the cart, and emptying the cart. Given the observed log entries and URL paths, it is reasonable to infer that the `frontend` service acts as a caller, while the `cartservice` acts as the callee. The high error rates observed in the context likely originate from the `frontend` making POST requests to the `/api/cart` endpoint handled by the `cartservice`.\n\n#### Likelihood of Relevance\n- **Very High:** The `frontend` service is highly likely to be relevant as it has a direct interaction with the `cartservice` and would be significantly impacted by any issues within the `cartservice`.\n\n### 2. Entity: `service.name:valkey`\n\n#### Indicators and Evidence\n- **Average Indicator - Redis Service:**\n - `my-otel-demo-valkey:6379`\n- **Average Indicator - Log Entries:**\n - Log patterns show Redis command execution by `cartservice`: `HGET`, `EXPIRE`, `HMSET`\n\n#### Relationship and Reasoning\nThe `valkey` service corresponds to the Redis instance that `cartservice` uses for data persistence. The `cartservice` makes frequent calls to Redis to perform operations such as fetching, expiring, and setting data, which is crucial for managing shopping cart state. As Redis is an upstream dependency, connection or data integrity issues here could directly contribute to the `500 Internal Server Errors` observed in the `cartservice`.\n\n#### Likelihood of Relevance\n- **High:** The `valkey` service is highly relevant because it is the data store for `cartservice`, directly affecting its behavior and performance.\n\n### 3. Entity: `service.name:currencyservice`\n\n#### Indicators and Evidence\n- **Average Indicator - gRPC Services:**\n - Mentioned in the architecture as handling currency conversions.\n- **Knowledge Base:**\n - Communicates with `cartservice` over gRPC to facilitate currency operations.\n\n#### Relationship and Reasoning\nThe `currencyservice` may interact with `cartservice` to handle price conversions for the items in the cart. Problems with currency conversion could cause unexpected data formats or communication failures, leading to `500 Internal Server Errors` in `cartservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** While the interaction exists, whether it directly contributes to the 500 errors specifically observed at `/api/cart` endpoints would require further investigation.\n\n### 4. Entity: `service.name:checkoutservice`\n\n#### Indicators and Evidence\n- **Strong Indicator - gRPC Services:**\n - Interacts with `checkoutservice` during the checkout process.\n- **Knowledge Base:**\n - Handles interactions including calls to `cartservice` for finalizing orders.\n\n#### Relationship and Reasoning\nThe `checkoutservice` could potentially depend on `cartservice` to validate and finalize items in the user's cart as part of the checkout process. If the `cartservice` fails during these operations, it could propagate errors back up to the user level through `checkoutservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** The relevance depends on whether the observed errors are occurring during checkout processes or general cart manipulations.\n\n### 5. Entity: `service.name:flagd`\n\n#### Indicators and Evidence\n- **Average Indicator - Feature Flag Evaluation:**\n - `flagd.evaluation.v1.Service`\n- **Log Metadata:**\n - `labels.feature_flag_key:keyword - cartServiceFailure`\n- **Trace Destination Service:**\n - `my-otel-demo-flagd:8013`\n\n#### Relationship and Reasoning\nThe `flagd` service is responsible for evaluating feature flags, such as the `cartServiceFailure`. If the feature flagging system is improperly toggled (e.g.: feature flag set to fail operations), it might contribute to the high error rates observed in `cartservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** The feature flags might be causing or amplifying existing issues within the `cartservice`.\n\n### Summary\nFrom the observed data, the following entities are highly likely to be related to `cartservice` with respect to the given context:\n\n1. **`frontend`** - High relevance due to direct HTTP interaction with `cartservice`.\n2. **`valkey`** - High relevance as the Redis data store for `cartservice`.\n\nEntities with moderate likelihood:\n\n1. **`currencyservice`** - Related via gRPC for currency operations.\n2. **`checkoutservice`** - Potentially related during checkout processes.\n3. **`flagd`** - Related to feature flag evaluations involving `cartservice`.\n\nThese relationships cover both upstream dependencies affecting `cartservice` and downstream services impacted by `cartservice` issues, aiding in comprehensive issue diagnosis." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 5 + } + ] + } + } + }, + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_KJwmI3xgY1gcstI4MVd4Olcf", + "function": { + "name": "observe", + "arguments": { + "observe": true + } + } + } + ] + }, + { + "name": "observe", + "response": { + "content": "### Acknowledgement of Investigations\n\nThe investigations of the `cartservice` and `frontend` services have provided valuable insights into the root cause of the high error rates observed in the `controller` service for POST requests to the `/api/cart` endpoint. The initial context indicated a severe and rapid onset of errors beginning at `2024-11-02T10:56:42.498Z`.\n\n### Key Observations\n\n**Investigation of Service `cartservice`**:\n- **Infrastructure & Environment**: The `cartservice` runs in a Kubernetes environment within the `default` namespace and uses Redis for data persistence.\n- **Log Patterns**:\n - Significant startup issues and fatal errors around `2024-11-02T10:55:30.000Z`.\n - A fatal \"bad entrypoint\" error prevented the service from starting correctly, leading to high error rates.\n- **Communication Endpoints**:\n - gRPC methods targeting shopping cart data.\n- **Critical Errors**:\n - \"FATAL: Could not start, bad entrypoint!\" log messages indicate critical failure.\n- **Implications**:\n - Startup issues likely prevented `cartservice` from responding to requests, causing downstream problems observed in the `controller` service.\n\n**Investigation of Service `frontend`**:\n- **Infrastructure & Environment**: The `frontend` service operates within a Kubernetes environment, communicating primarily via HTTP and gRPC.\n- **Log Patterns**:\n - Sharp increase in connection errors to the `cartservice` starting around `2024-11-02T10:55:30.000Z`.\n - \"ECONNREFUSED\" errors indicate failed attempts to connect to the `cartservice`.\n- **Communication Endpoints**:\n - Interacts with `cartservice` via gRPC.\n- **Critical Errors**:\n - \"No connection established\" and \"failed to get user cart during checkout\" errors.\n- **Implications**:\n - Communication failures between `frontend` and `cartservice` are strongly correlated with the high error rates in the `controller` service.\n\n### Timeline of Significant Events\n\n**2024-11-02T10:55:30.000Z**:\n- **`cartservice` Logs**:\n - \"OTEL-SDK: Instrument deactivation\" (78 occurrences), \"MeterProvider Disposed\" (4 occurrences), \"exiting...\" (3 occurrences), \"Application is shutting down...\" (2 occurrences), \"FATAL: Could not start, bad entrypoint!\" (2 occurrences).\n - **Meaning**: Indicates various startup and shutdown issues, especially the fatal entrypoint error that likely prevented the service from running correctly.\n\n**2024-11-02T10:55:30.000Z**:\n- **`frontend` Logs**:\n - \"No connection established\" errors (291 occurrences) and \"cart failure due to connection error\" (2 occurrences).\n - **Meaning**: Indicates immediate connection issues between `frontend` and `cartservice`.\n\n**2024-11-02T10:56:00.000Z**:\n- **`frontend` Logs**:\n - Further increase in \"No connection established\" errors (381 occurrences).\n - **Meaning**: Continued significant connection issues.\n\n**2024-11-02T10:56:30.000Z**:\n- **`cartservice` Logs**:\n - Another \"bad entrypoint\" fatal error (1 additional occurrence).\n - **Meaning**: Persistent startup issues continue to cause service failures.\n\n**2024-11-02T10:56:42.498Z**:\n- **Alert Triggered**:\n - High error rate (98.78%) in `controller` for POST requests to `/api/cart`.\n - **Meaning**: The timing aligns closely with the observed spikes in connection errors and startup issues, indicating a direct correlation.\n\n**2024-11-02T10:57:00.000Z**:\n- **`frontend` Logs**:\n - Connection errors return to zero occurrences.\n - **Meaning**: The immediate spike in connection issues appears to have subsided.\n\n### Context and Reasoning\n\nThe investigations reveal a clear temporal correlation and a logical causal pathway leading from the critical errors in `cartservice` to the observed high error rates in the `controller` service. The startup and initialization issues in `cartservice` around `2024-11-02T10:55:30.000Z` prevented it from functioning correctly, leading to connection refusal errors when `frontend` tried to access it. In turn, these failures propagated upstream, causing the `controller` to report high error rates for POST requests to the `/api/cart` endpoint.\n\n### Next Steps and Conclusion\n\n**Conclusion**:\n- The root cause of the high error rates in the `controller` service is the startup failure and persistent initialization issues in the `cartservice`.\n- These failures led to widespread connection refusal errors in `frontend`, which directly affected the ability of the `controller` to process requests to the `/api/cart` endpoint.\n\n**Recommendation**:\n- Address the misconfiguration or code issues in `cartservice` that are causing the fatal startup errors.\n- Ensure `cartservice` can reliably start and maintain stable communication with `frontend`.\n\nHaving thoroughly investigated the involved services, identified the key issues, and established the root cause, there is no need to further investigate other entities at this time. Conclude the investigation upon resolving the identified startup and initialization issues in `cartservice`." + }, + "data": { + "content": "### Acknowledgement of Investigations\n\nThe investigations of the `cartservice` and `frontend` services have provided valuable insights into the root cause of the high error rates observed in the `controller` service for POST requests to the `/api/cart` endpoint. The initial context indicated a severe and rapid onset of errors beginning at `2024-11-02T10:56:42.498Z`.\n\n### Key Observations\n\n**Investigation of Service `cartservice`**:\n- **Infrastructure & Environment**: The `cartservice` runs in a Kubernetes environment within the `default` namespace and uses Redis for data persistence.\n- **Log Patterns**:\n - Significant startup issues and fatal errors around `2024-11-02T10:55:30.000Z`.\n - A fatal \"bad entrypoint\" error prevented the service from starting correctly, leading to high error rates.\n- **Communication Endpoints**:\n - gRPC methods targeting shopping cart data.\n- **Critical Errors**:\n - \"FATAL: Could not start, bad entrypoint!\" log messages indicate critical failure.\n- **Implications**:\n - Startup issues likely prevented `cartservice` from responding to requests, causing downstream problems observed in the `controller` service.\n\n**Investigation of Service `frontend`**:\n- **Infrastructure & Environment**: The `frontend` service operates within a Kubernetes environment, communicating primarily via HTTP and gRPC.\n- **Log Patterns**:\n - Sharp increase in connection errors to the `cartservice` starting around `2024-11-02T10:55:30.000Z`.\n - \"ECONNREFUSED\" errors indicate failed attempts to connect to the `cartservice`.\n- **Communication Endpoints**:\n - Interacts with `cartservice` via gRPC.\n- **Critical Errors**:\n - \"No connection established\" and \"failed to get user cart during checkout\" errors.\n- **Implications**:\n - Communication failures between `frontend` and `cartservice` are strongly correlated with the high error rates in the `controller` service.\n\n### Timeline of Significant Events\n\n**2024-11-02T10:55:30.000Z**:\n- **`cartservice` Logs**:\n - \"OTEL-SDK: Instrument deactivation\" (78 occurrences), \"MeterProvider Disposed\" (4 occurrences), \"exiting...\" (3 occurrences), \"Application is shutting down...\" (2 occurrences), \"FATAL: Could not start, bad entrypoint!\" (2 occurrences).\n - **Meaning**: Indicates various startup and shutdown issues, especially the fatal entrypoint error that likely prevented the service from running correctly.\n\n**2024-11-02T10:55:30.000Z**:\n- **`frontend` Logs**:\n - \"No connection established\" errors (291 occurrences) and \"cart failure due to connection error\" (2 occurrences).\n - **Meaning**: Indicates immediate connection issues between `frontend` and `cartservice`.\n\n**2024-11-02T10:56:00.000Z**:\n- **`frontend` Logs**:\n - Further increase in \"No connection established\" errors (381 occurrences).\n - **Meaning**: Continued significant connection issues.\n\n**2024-11-02T10:56:30.000Z**:\n- **`cartservice` Logs**:\n - Another \"bad entrypoint\" fatal error (1 additional occurrence).\n - **Meaning**: Persistent startup issues continue to cause service failures.\n\n**2024-11-02T10:56:42.498Z**:\n- **Alert Triggered**:\n - High error rate (98.78%) in `controller` for POST requests to `/api/cart`.\n - **Meaning**: The timing aligns closely with the observed spikes in connection errors and startup issues, indicating a direct correlation.\n\n**2024-11-02T10:57:00.000Z**:\n- **`frontend` Logs**:\n - Connection errors return to zero occurrences.\n - **Meaning**: The immediate spike in connection issues appears to have subsided.\n\n### Context and Reasoning\n\nThe investigations reveal a clear temporal correlation and a logical causal pathway leading from the critical errors in `cartservice` to the observed high error rates in the `controller` service. The startup and initialization issues in `cartservice` around `2024-11-02T10:55:30.000Z` prevented it from functioning correctly, leading to connection refusal errors when `frontend` tried to access it. In turn, these failures propagated upstream, causing the `controller` to report high error rates for POST requests to the `/api/cart` endpoint.\n\n### Next Steps and Conclusion\n\n**Conclusion**:\n- The root cause of the high error rates in the `controller` service is the startup failure and persistent initialization issues in the `cartservice`.\n- These failures led to widespread connection refusal errors in `frontend`, which directly affected the ability of the `controller` to process requests to the `/api/cart` endpoint.\n\n**Recommendation**:\n- Address the misconfiguration or code issues in `cartservice` that are causing the fatal startup errors.\n- Ensure `cartservice` can reliably start and maintain stable communication with `frontend`.\n\nHaving thoroughly investigated the involved services, identified the key issues, and established the root cause, there is no need to further investigate other entities at this time. Conclude the investigation upon resolving the identified startup and initialization issues in `cartservice`.", + "investigations": [ + { + "attachments": { + "alerts": [], + "slos": [], + "analysis": { + "total": 41440, + "sampled": 1000, + "fields": [ + "@timestamp:date - 964 distinct values", + "agent.name.text:text - 1 distinct values (`opentelemetry/dotnet/elastic-dotnet`)", + "agent.name:keyword - 1 distinct values (`opentelemetry/dotnet/elastic-dotnet`)", + "agent.version:keyword - 1 distinct values (`1.0.0-alpha.4`)", + "container.id:keyword - 1 distinct values (`577d6250ad96a5d0016a42ed87bd5c3a63b86edd2af0a0c04b54a1cec2a1a50a`)", + "data_stream.dataset:keyword - 1 distinct values (`apm`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`traces`)", + "destination.address:keyword - 2 distinct values (`my-otel-demo-flagd`, `my-otel-demo-valkey`)", + "destination.port:long - 2 distinct values (`8013`, `6379`)", + "event.outcome:keyword - 1 distinct values (`success`)", + "event.success_count:byte - 1 distinct values (`1`)", + "host.hostname:keyword - 1 distinct values (`minikube`)", + "host.name.text:text - 1 distinct values (`minikube`)", + "host.name:keyword - 1 distinct values (`minikube`)", + "http.request.method:keyword - 1 distinct values (`POST`)", + "http.response.status_code:long - 1 distinct values (`200`)", + "kubernetes.namespace:keyword - 1 distinct values (`default`)", + "kubernetes.node.name.text:text - 1 distinct values (`minikube`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name.text:text - 1 distinct values (`my-otel-demo-cartservice-67575c6f84-vngzw`)", + "kubernetes.pod.name:keyword - 1 distinct values (`my-otel-demo-cartservice-67575c6f84-vngzw`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "labels.app_product_id:keyword - 8 distinct values (`66VCHSJNUP`, `L9ECAV7KIM`, `OLJCESPC7Z`, `0PUK6V6EV0`, `9SIQT8TOJO`, `LS4PSXUNUM`, `HQTGWGPNH4`, `6E92ZMYYFZ`)", + "labels.app_user_id:keyword - 418 distinct values (`11c5f5d4-37b4-46d4-a04e-a97fd71b8597`, `9017f637-12af-4671-b18c-0f86a58a7bbe`, `349478d0-862e-4b14-9d54-3120dd57865f`, `2a55d360-40c5-4a32-844b-4182e8050ca3`, `b9944e91-18d6-430c-90a5-4969e1917a2d`, `1ffeffe2-4e4a-47c4-8b33-e691f116c8cc`, `92ac0a92-4a23-4aa7-866b-44cd6b5d6e26`, `76765dfc-80f8-49db-8377-249e6930dd35`, `d5c375cc-6e38-45f8-b121-30fcb3ae1001`, `bdc5ebd9-a2ee-4dbf-8dae-b88a2b2b3643`, 408 more values)", + "labels.db_redis_flags:keyword - 2 distinct values (`DemandMaster`, `None`)", + "labels.feature_flag_key:keyword - 1 distinct values (`cartServiceFailure`)", + "labels.feature_flag_provider_name:keyword - 1 distinct values (`flagd Provider`)", + "labels.feature_flag_variant:keyword - 1 distinct values (`off`)", + "labels.grpc_method:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "labels.grpc_status_code:keyword - 1 distinct values (`0`)", + "labels.http_route:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "labels.k8s_deployment_name:keyword - 1 distinct values (`my-otel-demo-cartservice`)", + "labels.k8s_pod_ip:ip - 1 distinct values (`10.244.0.61`)", + "labels.k8s_pod_start_time:keyword - 1 distinct values (`2024-11-02T10:23:09Z`)", + "labels.network_protocol_version:keyword - 1 distinct values (`2`)", + "labels.service_namespace:keyword - 1 distinct values (`opentelemetry-demo`)", + "labels.transaction_id:keyword - 995 distinct values (`6b71cc6a08847a01`, `796c855656f17eb0`, `aaa6049d68006044`, `60ad645003eda9b7`, `be3e883fd0dd1a58`, `47247987037e78b3`, `180228f348c3d599`, `587dca65bb2463f3`, `c438d3e7c15d9a4f`, `0a9f738aa8e11c7e`, 985 more values)", + "numeric_labels.app_cart_items_count:scaled_float - 10 distinct values (`8`, `1`, `16`, `2`, `20`, `5`, `4`, `10`, `3`, `0`)", + "numeric_labels.app_product_quantity:scaled_float - 6 distinct values (`5`, `1`, `2`, `10`, `3`, `4`)", + "numeric_labels.db_redis_database_index:scaled_float - 1 distinct values (`0`)", + "observer.hostname:keyword - 1 distinct values (`Darios-MacBook-Pro-2.local`)", + "observer.type:keyword - 1 distinct values (`apm-server`)", + "observer.version:keyword - 1 distinct values (`8.15.0`)", + "parent.id:keyword - 999 distinct values (`76a22c35a2b363fb`, `6e363f007dd857fc`, `499ee35b7e0dc791`, `f05ead7365bb815b`, `46709d74aeb1ac57`, `c1e7aeb4f3b66351`, `d6e80a03ce62827e`, `5eff08ed000af546`, `80be4180f1c8985e`, `9154a028a223da28`, 989 more values)", + "processor.event:keyword - 2 distinct values (`transaction`, `span`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.framework.name.text:text - 1 distinct values (`Microsoft.AspNetCore`)", + "service.framework.name:keyword - 1 distinct values (`Microsoft.AspNetCore`)", + "service.language.name.text:text - 1 distinct values (`dotnet`)", + "service.language.name:keyword - 1 distinct values (`dotnet`)", + "service.name.text:text - 1 distinct values (`cartservice`)", + "service.name:keyword - 1 distinct values (`cartservice`)", + "service.node.name.text:text - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "service.node.name:keyword - 1 distinct values (`8e441d5c-4d52-42f2-937e-1f3b84a6baed`)", + "service.target.name.text:text - 3 distinct values (`my-otel-demo-flagd:8013`, `flagd.evaluation.v1.Service`, 1 more values)", + "service.target.name:keyword - 3 distinct values (`my-otel-demo-flagd:8013`, `flagd.evaluation.v1.Service`, `my-otel-demo-valkey:6379`)", + "service.target.type:keyword - 3 distinct values (`http`, `grpc`, `redis`)", + "span.db.statement:keyword - 455 distinct values (`HGET dd1f04f3-aaf1-4a76-85e4-8c64a930684e`, `EXPIRE 2538c162-9908-11ef-8217-d64fba5f23b1`, `HGET 958266ce-2169-4a2a-bcd5-090fd75cf50b`, `HGET ba92c7a8-6623-4267-8512-9cf0cb23bbf8`, `HGET d96a9e44-a9ed-4f64-8f46-5d4acd05a1fa`, `HGET 4a0d4f33-09ee-4008-a826-027dd6e889c6`, `HGET 5bc59fca-3c11-4d71-9496-c9c29b9d37d1`, `HGET 0497c8a8-2da2-4ff7-80a7-ce647916277c`, `HGET 87d37a8f-cc58-483a-aad0-fc0c91421544`, `HGET 4dea82bc-1c58-4f0a-97fd-3a1369544dc0`, 445 more values)", + "span.db.type:keyword - 1 distinct values (`redis`)", + "span.destination.service.name.text:text - 3 distinct values (`http://my-otel-demo-flagd:8013`, `my-otel-demo-flagd:8013`, 1 more values)", + "span.destination.service.name:keyword - 3 distinct values (`http://my-otel-demo-flagd:8013`, `my-otel-demo-flagd:8013`, `my-otel-demo-valkey:6379`)", + "span.destination.service.resource:keyword - 2 distinct values (`my-otel-demo-flagd:8013`, `my-otel-demo-valkey:6379`)", + "span.destination.service.type:keyword - 2 distinct values (`external`, `db`)", + "span.duration.us:long - 399 distinct values (`501`, `154`, `355`, `3766`, `818`, `657`, `203`, `127`, `715`, `1092`, 389 more values)", + "span.id:keyword - 1000 distinct values (`6b71cc6a08847a01`, `796c855656f17eb0`, `aaa6049d68006044`, `60ad645003eda9b7`, `be3e883fd0dd1a58`, `47247987037e78b3`, `180228f348c3d599`, `587dca65bb2463f3`, `c438d3e7c15d9a4f`, `0a9f738aa8e11c7e`, 990 more values)", + "span.name.text:text - 5 distinct values (`POST`, `flagd.evaluation.v1.Service/ResolveBoolean`, 3 more values)", + "span.name:keyword - 5 distinct values (`POST`, `flagd.evaluation.v1.Service/ResolveBoolean`, `HMSET`, `EXPIRE`, `HGET`)", + "span.representative_count:scaled_float - 1 distinct values (`1`)", + "span.subtype:keyword - 3 distinct values (`http`, `grpc`, `redis`)", + "span.type:keyword - 2 distinct values (`external`, `db`)", + "tags:keyword - 1 distinct values (`_geoip_database_unavailable_GeoLite2-City.mmdb`)", + "timestamp.us:long - 1000 distinct values (`1730544111451828`, `1730544606786118`, `1730544573583321`, `1730544068214001`, `1730543971566630`, `1730544035740835`, `1730543892242334`, `1730544845301548`, `1730543919324800`, `1730544697032712`, 990 more values)", + "trace.id:keyword - 920 distinct values (`de1ed71d39ca87650a8401ae46f2cac0`, `1283785f372e3335e30ab82c53008ea6`, `be3fc18a45763f00d43954ef09300042`, `bffb395c41d9a23aa7acc6b1993f64c6`, `68df2f10f7b09e787c688046ae76f6ff`, `3ba13e99d34a48133415c71b9b523321`, `6405704384b681e891e1067b1c1e6e68`, `b137359ec568679804d48c699dd49df5`, `cce045bbbdbb711a2f5cae192c337cb3`, `85743f477e557162900c88409231222a`, 910 more values)", + "transaction.duration.us:long - 441 distinct values (`2497`, `2659`, `610`, `458`, `3158`, `1484`, `436`, `536`, `2602`, `3472`, 431 more values)", + "transaction.id:keyword - 469 distinct values (`60ad645003eda9b7`, `be3e883fd0dd1a58`, `180228f348c3d599`, `0a9f738aa8e11c7e`, `66622c930742b62b`, `2493315b88140ec7`, `7950f85af72baaa0`, `0fda0e8c0af2a975`, `0504e94fae4dd7f8`, `25ec77d0c132ceef`, 459 more values)", + "transaction.name.text:text - 3 distinct values (`POST /oteldemo.CartService/EmptyCart`, `POST /oteldemo.CartService/AddItem`, 1 more values)", + "transaction.name:keyword - 3 distinct values (`POST /oteldemo.CartService/EmptyCart`, `POST /oteldemo.CartService/AddItem`, `POST /oteldemo.CartService/GetCart`)", + "transaction.representative_count:scaled_float - 1 distinct values (`1`)", + "transaction.result:keyword - 1 distinct values (`HTTP 2xx`)", + "transaction.sampled:boolean - 1 distinct values (`true`)", + "transaction.type:keyword - 1 distinct values (`request`)", + "url.domain:keyword - 1 distinct values (`my-otel-demo-cartservice`)", + "url.full.text:text - 3 distinct values (`http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`, 1 more values)", + "url.full:keyword - 3 distinct values (`http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`, `http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart`)", + "url.original.text:text - 4 distinct values (`http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`, `/oteldemo.CartService/EmptyCart`, 2 more values)", + "url.original:keyword - 4 distinct values (`http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`, `/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "url.path:keyword - 3 distinct values (`/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`)", + "url.port:long - 1 distinct values (`8080`)", + "url.scheme:keyword - 1 distinct values (`http`)", + "user_agent.device.name.text:text - 1 distinct values (`Other`)", + "user_agent.device.name:keyword - 1 distinct values (`Other`)", + "user_agent.name.text:text - 1 distinct values (`Other`)", + "user_agent.name:keyword - 1 distinct values (`Other`)", + "user_agent.original.text:text - 2 distinct values (`grpc-go/1.64.0`, `grpc-node-js/1.10.11`)", + "user_agent.original:keyword - 2 distinct values (`grpc-go/1.64.0`, `grpc-node-js/1.10.11`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 8414, + "pattern": "called with userId", + "regex": ".*?called.+?with.+?userId.*?", + "sample": "GetCartAsync called with userId=f96ee88a-4745-45f1-885a-16c3de0c668a", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=f96ee88a-4745-45f1-885a-16c3de0c668a" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 226 + }, + { + "x": 1730543820000, + "y": 194 + }, + { + "x": 1730543850000, + "y": 270 + }, + { + "x": 1730543880000, + "y": 200 + }, + { + "x": 1730543910000, + "y": 164 + }, + { + "x": 1730543940000, + "y": 198 + }, + { + "x": 1730543970000, + "y": 192 + }, + { + "x": 1730544000000, + "y": 228 + }, + { + "x": 1730544030000, + "y": 230 + }, + { + "x": 1730544060000, + "y": 212 + }, + { + "x": 1730544090000, + "y": 222 + }, + { + "x": 1730544120000, + "y": 210 + }, + { + "x": 1730544150000, + "y": 240 + }, + { + "x": 1730544180000, + "y": 200 + }, + { + "x": 1730544210000, + "y": 204 + }, + { + "x": 1730544240000, + "y": 222 + }, + { + "x": 1730544270000, + "y": 216 + }, + { + "x": 1730544300000, + "y": 254 + }, + { + "x": 1730544330000, + "y": 218 + }, + { + "x": 1730544360000, + "y": 228 + }, + { + "x": 1730544390000, + "y": 214 + }, + { + "x": 1730544420000, + "y": 220 + }, + { + "x": 1730544450000, + "y": 218 + }, + { + "x": 1730544480000, + "y": 224 + }, + { + "x": 1730544510000, + "y": 228 + }, + { + "x": 1730544540000, + "y": 228 + }, + { + "x": 1730544570000, + "y": 232 + }, + { + "x": 1730544600000, + "y": 218 + }, + { + "x": 1730544630000, + "y": 232 + }, + { + "x": 1730544660000, + "y": 212 + }, + { + "x": 1730544690000, + "y": 236 + }, + { + "x": 1730544720000, + "y": 246 + }, + { + "x": 1730544750000, + "y": 218 + }, + { + "x": 1730544780000, + "y": 214 + }, + { + "x": 1730544810000, + "y": 210 + }, + { + "x": 1730544840000, + "y": 228 + }, + { + "x": 1730544870000, + "y": 228 + }, + { + "x": 1730544900000, + "y": 224 + }, + { + "x": 1730544930000, + "y": 56 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "bfeu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "Enqueued", + "regex": ".*?Enqueued.*?", + "sample": "Enqueued", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Enqueued" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "oacl", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "ResponseReceived", + "regex": ".*?ResponseReceived.*?", + "sample": "ResponseReceived", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "ResponseReceived" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "hhud", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4835, + "pattern": "Sent", + "regex": ".*?Sent.*?", + "sample": "Sent", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Sent" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 126 + }, + { + "x": 1730543820000, + "y": 121 + }, + { + "x": 1730543850000, + "y": 171 + }, + { + "x": 1730543880000, + "y": 109 + }, + { + "x": 1730543910000, + "y": 96 + }, + { + "x": 1730543940000, + "y": 134 + }, + { + "x": 1730543970000, + "y": 99 + }, + { + "x": 1730544000000, + "y": 130 + }, + { + "x": 1730544030000, + "y": 132 + }, + { + "x": 1730544060000, + "y": 119 + }, + { + "x": 1730544090000, + "y": 126 + }, + { + "x": 1730544120000, + "y": 118 + }, + { + "x": 1730544150000, + "y": 133 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 125 + }, + { + "x": 1730544240000, + "y": 124 + }, + { + "x": 1730544270000, + "y": 124 + }, + { + "x": 1730544300000, + "y": 161 + }, + { + "x": 1730544330000, + "y": 126 + }, + { + "x": 1730544360000, + "y": 140 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 120 + }, + { + "x": 1730544450000, + "y": 125 + }, + { + "x": 1730544480000, + "y": 128 + }, + { + "x": 1730544510000, + "y": 120 + }, + { + "x": 1730544540000, + "y": 123 + }, + { + "x": 1730544570000, + "y": 135 + }, + { + "x": 1730544600000, + "y": 120 + }, + { + "x": 1730544630000, + "y": 139 + }, + { + "x": 1730544660000, + "y": 113 + }, + { + "x": 1730544690000, + "y": 154 + }, + { + "x": 1730544720000, + "y": 154 + }, + { + "x": 1730544750000, + "y": 115 + }, + { + "x": 1730544780000, + "y": 120 + }, + { + "x": 1730544810000, + "y": 114 + }, + { + "x": 1730544840000, + "y": 133 + }, + { + "x": 1730544870000, + "y": 127 + }, + { + "x": 1730544900000, + "y": 139 + }, + { + "x": 1730544930000, + "y": 35 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ttbh", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4441, + "pattern": "info 0", + "regex": ".*?info.+?0.*?", + "sample": "info: cartservice.cartstore.ValkeyCartStore[0]\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "info: cartservice.cartstore.ValkeyCartStore[0]\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 117 + }, + { + "x": 1730543820000, + "y": 104 + }, + { + "x": 1730543850000, + "y": 146 + }, + { + "x": 1730543880000, + "y": 103 + }, + { + "x": 1730543910000, + "y": 86 + }, + { + "x": 1730543940000, + "y": 110 + }, + { + "x": 1730543970000, + "y": 97 + }, + { + "x": 1730544000000, + "y": 119 + }, + { + "x": 1730544030000, + "y": 120 + }, + { + "x": 1730544060000, + "y": 110 + }, + { + "x": 1730544090000, + "y": 116 + }, + { + "x": 1730544120000, + "y": 109 + }, + { + "x": 1730544150000, + "y": 124 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 109 + }, + { + "x": 1730544240000, + "y": 115 + }, + { + "x": 1730544270000, + "y": 113 + }, + { + "x": 1730544300000, + "y": 137 + }, + { + "x": 1730544330000, + "y": 114 + }, + { + "x": 1730544360000, + "y": 122 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 113 + }, + { + "x": 1730544450000, + "y": 114 + }, + { + "x": 1730544480000, + "y": 117 + }, + { + "x": 1730544510000, + "y": 116 + }, + { + "x": 1730544540000, + "y": 117 + }, + { + "x": 1730544570000, + "y": 121 + }, + { + "x": 1730544600000, + "y": 112 + }, + { + "x": 1730544630000, + "y": 123 + }, + { + "x": 1730544660000, + "y": 108 + }, + { + "x": 1730544690000, + "y": 129 + }, + { + "x": 1730544720000, + "y": 132 + }, + { + "x": 1730544750000, + "y": 111 + }, + { + "x": 1730544780000, + "y": 111 + }, + { + "x": 1730544810000, + "y": 108 + }, + { + "x": 1730544840000, + "y": 120 + }, + { + "x": 1730544870000, + "y": 118 + }, + { + "x": 1730544900000, + "y": 120 + }, + { + "x": 1730544930000, + "y": 73 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "eahn", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 4152, + "pattern": "Fetch cart", + "regex": ".*?Fetch.+?cart.*?", + "sample": "Fetch cart", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Fetch cart" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.398Z", + "lastOccurrence": "2024-11-02T10:55:36.349Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 112 + }, + { + "x": 1730543820000, + "y": 94 + }, + { + "x": 1730543850000, + "y": 132 + }, + { + "x": 1730543880000, + "y": 100 + }, + { + "x": 1730543910000, + "y": 80 + }, + { + "x": 1730543940000, + "y": 97 + }, + { + "x": 1730543970000, + "y": 96 + }, + { + "x": 1730544000000, + "y": 113 + }, + { + "x": 1730544030000, + "y": 113 + }, + { + "x": 1730544060000, + "y": 105 + }, + { + "x": 1730544090000, + "y": 111 + }, + { + "x": 1730544120000, + "y": 104 + }, + { + "x": 1730544150000, + "y": 119 + }, + { + "x": 1730544180000, + "y": 100 + }, + { + "x": 1730544210000, + "y": 100 + }, + { + "x": 1730544240000, + "y": 110 + }, + { + "x": 1730544270000, + "y": 107 + }, + { + "x": 1730544300000, + "y": 123 + }, + { + "x": 1730544330000, + "y": 107 + }, + { + "x": 1730544360000, + "y": 112 + }, + { + "x": 1730544390000, + "y": 107 + }, + { + "x": 1730544420000, + "y": 109 + }, + { + "x": 1730544450000, + "y": 108 + }, + { + "x": 1730544480000, + "y": 111 + }, + { + "x": 1730544510000, + "y": 114 + }, + { + "x": 1730544540000, + "y": 114 + }, + { + "x": 1730544570000, + "y": 112 + }, + { + "x": 1730544600000, + "y": 107 + }, + { + "x": 1730544630000, + "y": 114 + }, + { + "x": 1730544660000, + "y": 105 + }, + { + "x": 1730544690000, + "y": 115 + }, + { + "x": 1730544720000, + "y": 119 + }, + { + "x": 1730544750000, + "y": 109 + }, + { + "x": 1730544780000, + "y": 106 + }, + { + "x": 1730544810000, + "y": 105 + }, + { + "x": 1730544840000, + "y": 113 + }, + { + "x": 1730544870000, + "y": 113 + }, + { + "x": 1730544900000, + "y": 109 + }, + { + "x": 1730544930000, + "y": 27 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "xpjx", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 602, + "pattern": "called with userId 11ef 8217 d64fba5f23b1", + "regex": ".*?called.+?with.+?userId.+?11ef.+?8217.+?d64fba5f23b1.*?", + "sample": "GetCartAsync called with userId=fb462b14-9908-11ef-8217-d64fba5f23b1", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=fb462b14-9908-11ef-8217-d64fba5f23b1" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.219Z", + "lastOccurrence": "2024-11-02T10:55:34.364Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 12 + }, + { + "x": 1730543820000, + "y": 26 + }, + { + "x": 1730543850000, + "y": 34 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 16 + }, + { + "x": 1730543940000, + "y": 30 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 14 + }, + { + "x": 1730544030000, + "y": 18 + }, + { + "x": 1730544060000, + "y": 12 + }, + { + "x": 1730544090000, + "y": 10 + }, + { + "x": 1730544120000, + "y": 12 + }, + { + "x": 1730544150000, + "y": 12 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 22 + }, + { + "x": 1730544240000, + "y": 12 + }, + { + "x": 1730544270000, + "y": 14 + }, + { + "x": 1730544300000, + "y": 36 + }, + { + "x": 1730544330000, + "y": 18 + }, + { + "x": 1730544360000, + "y": 24 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 10 + }, + { + "x": 1730544450000, + "y": 14 + }, + { + "x": 1730544480000, + "y": 14 + }, + { + "x": 1730544510000, + "y": 4 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 26 + }, + { + "x": 1730544600000, + "y": 14 + }, + { + "x": 1730544630000, + "y": 22 + }, + { + "x": 1730544660000, + "y": 8 + }, + { + "x": 1730544690000, + "y": 34 + }, + { + "x": 1730544720000, + "y": 34 + }, + { + "x": 1730544750000, + "y": 4 + }, + { + "x": 1730544780000, + "y": 12 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 16 + }, + { + "x": 1730544870000, + "y": 12 + }, + { + "x": 1730544900000, + "y": 28 + }, + { + "x": 1730544930000, + "y": 8 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ckdv", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 382, + "pattern": "AddItemAsync called with userId 11ef 8217 d64fba5f23b1 productId quantity", + "regex": ".*?AddItemAsync.+?called.+?with.+?userId.+?11ef.+?8217.+?d64fba5f23b1.+?productId.+?quantity.*?", + "sample": "AddItemAsync called with userId=fc4e8196-9908-11ef-8217-d64fba5f23b1, productId=1YMWWN1N4O, quantity=10", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "AddItemAsync called with userId=fc4e8196-9908-11ef-8217-d64fba5f23b1, productId=1YMWWN1N4O, quantity=10" + ] + }, + "firstOccurrence": "2024-11-02T10:36:34.216Z", + "lastOccurrence": "2024-11-02T10:55:34.363Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 8 + }, + { + "x": 1730543820000, + "y": 14 + }, + { + "x": 1730543850000, + "y": 22 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 8 + }, + { + "x": 1730543940000, + "y": 22 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 10 + }, + { + "x": 1730544030000, + "y": 10 + }, + { + "x": 1730544060000, + "y": 8 + }, + { + "x": 1730544090000, + "y": 10 + }, + { + "x": 1730544120000, + "y": 8 + }, + { + "x": 1730544150000, + "y": 8 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 14 + }, + { + "x": 1730544240000, + "y": 8 + }, + { + "x": 1730544270000, + "y": 10 + }, + { + "x": 1730544300000, + "y": 20 + }, + { + "x": 1730544330000, + "y": 10 + }, + { + "x": 1730544360000, + "y": 16 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 6 + }, + { + "x": 1730544450000, + "y": 10 + }, + { + "x": 1730544480000, + "y": 10 + }, + { + "x": 1730544510000, + "y": 4 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 10 + }, + { + "x": 1730544600000, + "y": 6 + }, + { + "x": 1730544630000, + "y": 14 + }, + { + "x": 1730544660000, + "y": 4 + }, + { + "x": 1730544690000, + "y": 22 + }, + { + "x": 1730544720000, + "y": 18 + }, + { + "x": 1730544750000, + "y": 4 + }, + { + "x": 1730544780000, + "y": 8 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 12 + }, + { + "x": 1730544870000, + "y": 8 + }, + { + "x": 1730544900000, + "y": 16 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "habq", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 216, + "pattern": "GetCartAsync called with userId", + "regex": ".*?GetCartAsync.+?called.+?with.+?userId.*?", + "sample": "GetCartAsync called with userId=", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "GetCartAsync called with userId=" + ] + }, + "firstOccurrence": "2024-11-02T10:36:36.912Z", + "lastOccurrence": "2024-11-02T10:55:33.022Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 10 + }, + { + "x": 1730543820000, + "y": 4 + }, + { + "x": 1730543850000, + "y": 6 + }, + { + "x": 1730543880000, + "y": 4 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 4 + }, + { + "x": 1730543970000, + "y": 2 + }, + { + "x": 1730544000000, + "y": 10 + }, + { + "x": 1730544030000, + "y": 10 + }, + { + "x": 1730544060000, + "y": 6 + }, + { + "x": 1730544090000, + "y": 2 + }, + { + "x": 1730544120000, + "y": 8 + }, + { + "x": 1730544150000, + "y": 8 + }, + { + "x": 1730544180000, + "y": 4 + }, + { + "x": 1730544210000, + "y": 6 + }, + { + "x": 1730544240000, + "y": 2 + }, + { + "x": 1730544270000, + "y": 4 + }, + { + "x": 1730544300000, + "y": 8 + }, + { + "x": 1730544330000, + "y": 4 + }, + { + "x": 1730544360000, + "y": 4 + }, + { + "x": 1730544390000, + "y": 2 + }, + { + "x": 1730544420000, + "y": 8 + }, + { + "x": 1730544450000, + "y": 4 + }, + { + "x": 1730544480000, + "y": 10 + }, + { + "x": 1730544510000, + "y": 2 + }, + { + "x": 1730544540000, + "y": 12 + }, + { + "x": 1730544570000, + "y": 8 + }, + { + "x": 1730544600000, + "y": 8 + }, + { + "x": 1730544630000, + "y": 6 + }, + { + "x": 1730544660000, + "y": 6 + }, + { + "x": 1730544690000, + "y": 2 + }, + { + "x": 1730544720000, + "y": 6 + }, + { + "x": 1730544750000, + "y": 6 + }, + { + "x": 1730544780000, + "y": 4 + }, + { + "x": 1730544810000, + "y": 2 + }, + { + "x": 1730544840000, + "y": 6 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 8 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "tzfi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 55, + "pattern": "Empty cart", + "regex": ".*?Empty.+?cart.*?", + "sample": "Empty cart", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Empty cart" + ] + }, + "firstOccurrence": "2024-11-02T10:36:41.806Z", + "lastOccurrence": "2024-11-02T10:55:32.654Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1 + }, + { + "x": 1730543820000, + "y": 3 + }, + { + "x": 1730543850000, + "y": 3 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 2 + }, + { + "x": 1730543940000, + "y": 2 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 1 + }, + { + "x": 1730544030000, + "y": 2 + }, + { + "x": 1730544060000, + "y": 1 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 1 + }, + { + "x": 1730544150000, + "y": 1 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 2 + }, + { + "x": 1730544240000, + "y": 1 + }, + { + "x": 1730544270000, + "y": 1 + }, + { + "x": 1730544300000, + "y": 4 + }, + { + "x": 1730544330000, + "y": 2 + }, + { + "x": 1730544360000, + "y": 2 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 1 + }, + { + "x": 1730544450000, + "y": 1 + }, + { + "x": 1730544480000, + "y": 1 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 4 + }, + { + "x": 1730544600000, + "y": 2 + }, + { + "x": 1730544630000, + "y": 2 + }, + { + "x": 1730544660000, + "y": 1 + }, + { + "x": 1730544690000, + "y": 3 + }, + { + "x": 1730544720000, + "y": 4 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 1 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 1 + }, + { + "x": 1730544870000, + "y": 1 + }, + { + "x": 1730544900000, + "y": 3 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ldwf", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 55, + "pattern": "feature_flag", + "regex": ".*?feature_flag.*?", + "sample": "feature_flag", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "feature_flag" + ] + }, + "firstOccurrence": "2024-11-02T10:36:41.809Z", + "lastOccurrence": "2024-11-02T10:55:32.655Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 1 + }, + { + "x": 1730543820000, + "y": 3 + }, + { + "x": 1730543850000, + "y": 3 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 2 + }, + { + "x": 1730543940000, + "y": 2 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 1 + }, + { + "x": 1730544030000, + "y": 2 + }, + { + "x": 1730544060000, + "y": 1 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 1 + }, + { + "x": 1730544150000, + "y": 1 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 2 + }, + { + "x": 1730544240000, + "y": 1 + }, + { + "x": 1730544270000, + "y": 1 + }, + { + "x": 1730544300000, + "y": 4 + }, + { + "x": 1730544330000, + "y": 2 + }, + { + "x": 1730544360000, + "y": 2 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 1 + }, + { + "x": 1730544450000, + "y": 1 + }, + { + "x": 1730544480000, + "y": 1 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 4 + }, + { + "x": 1730544600000, + "y": 2 + }, + { + "x": 1730544630000, + "y": 2 + }, + { + "x": 1730544660000, + "y": 1 + }, + { + "x": 1730544690000, + "y": 3 + }, + { + "x": 1730544720000, + "y": 4 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 1 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 1 + }, + { + "x": 1730544870000, + "y": 1 + }, + { + "x": 1730544900000, + "y": 3 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "noer", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 2, + "pattern": "OTEL-SDK BatchActivityExportProcessor exporting to OtlpTraceExporter dropped items", + "regex": ".*?OTEL-SDK.+?BatchActivityExportProcessor.+?exporting.+?to.+?OtlpTraceExporter.+?dropped.+?items.*?", + "sample": "OTEL-SDK: [224] 'BatchActivityExportProcessor' exporting to 'OtlpTraceExporter' dropped '0' items.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] 'BatchActivityExportProcessor' exporting to 'OtlpTraceExporter' dropped '0' items." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.580Z", + "lastOccurrence": "2024-11-02T10:55:36.580Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "fiia", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1, + "pattern": "my-otel-demo-valkey open", + "regex": ".*?my-otel-demo-valkey.+?open.*?", + "sample": "my-otel-demo-valkey (10.106.38.244:6379) open\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "my-otel-demo-valkey (10.106.38.244:6379) open\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:34.993Z", + "lastOccurrence": "2024-11-02T10:55:34.993Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "uzyf", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 78, + "pattern": "OTEL-SDK Instrument Meter has been deactivated", + "regex": ".*?OTEL-SDK.+?Instrument.+?Meter.+?has.+?been.+?deactivated.*?", + "sample": "OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.585Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 78 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "lciw", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 4, + "pattern": "OTEL-SDK Disposed", + "regex": ".*?OTEL-SDK.+?Disposed.*?", + "sample": "OTEL-SDK: [224] 'MeterProvider' Disposed.", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "OTEL-SDK: [224] 'MeterProvider' Disposed." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.581Z", + "lastOccurrence": "2024-11-02T10:55:36.586Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 4 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "woqa", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 3, + "pattern": "exiting", + "regex": ".*?exiting.*?", + "sample": "exiting...\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "exiting...\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:55.622Z", + "lastOccurrence": "2024-11-02T10:56:51.618Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 1 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "ucuj", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 2, + "pattern": "Application is shutting down", + "regex": ".*?Application.+?is.+?shutting.+?down.*?", + "sample": "Application is shutting down...", + "highlight": { + "service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "Application is shutting down..." + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.560Z", + "lastOccurrence": "2024-11-02T10:55:36.560Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "cgip", + "relevance": "unusual", + "interesting": true + }, + { + "field": "message", + "count": 3, + "pattern": "FATAL Could not start entrypoint", + "regex": ".*?FATAL.+?Could.+?not.+?start.+?entrypoint.*?", + "sample": "FATAL: Could not start, bad entrypoint!\n", + "highlight": { + "service.name": [ + "cartservice" + ], + "resource.attributes.service.name": [ + "cartservice" + ] + }, + "metadata": { + "message": [ + "FATAL: Could not start, bad entrypoint!\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:35.618Z", + "lastOccurrence": "2024-11-02T10:56:31.617Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 0 + }, + { + "x": 1730544990000, + "y": 1 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 1.8274885276877215e-20, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "reqc", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [ + { + "field": "message", + "count": 26, + "pattern": "I1102 replica_set.go Finished syncing logger replicaset-controller kind ReplicaSet key duration", + "regex": ".*?I1102.+?replica_set\\.go.+?Finished.+?syncing.+?logger.+?replicaset-controller.+?kind.+?ReplicaSet.+?key.+?duration.*?", + "sample": "I1102 10:55:33.013871 1 replica_set.go:679] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice-7b585f4fb7\" duration=\"101.333µs\"\n", + "highlight": { + "body.text": [ + "] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice" + ], + "message": [ + "] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice" + ] + }, + "metadata": { + "service.name": [ + "kube-controller-manager" + ], + "message": [ + "I1102 10:55:33.013871 1 replica_set.go:679] \"Finished syncing\" logger=\"replicaset-controller\" kind=\"ReplicaSet\" key=\"default/my-otel-demo-cartservice-7b585f4fb7\" duration=\"101.333µs\"\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:33.014Z", + "lastOccurrence": "2024-11-02T10:56:52.568Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 19 + }, + { + "x": 1730544960000, + "y": 2 + }, + { + "x": 1730544990000, + "y": 5 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 7.313742705200763e-147, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "ofdx", + "relevance": "normal", + "interesting": true + }, + { + "field": "message", + "count": 21, + "pattern": "object apiVersion events.k8s.io/v1 deprecatedCount deprecatedFirstTimestamp deprecatedLastTimestamp deprecatedSource component eventTime null kind Event metadata creationTimestamp managedFields apiVersion v1 fieldsType FieldsV1 fieldsV1", + "regex": ".*?object.+?apiVersion.+?events\\.k8s\\.io/v1.+?deprecatedCount.+?deprecatedFirstTimestamp.+?deprecatedLastTimestamp.+?deprecatedSource.+?component.+?eventTime.+?null.+?kind.+?Event.+?metadata.+?creationTimestamp.+?managedFields.+?apiVersion.+?v1.+?fieldsType.+?FieldsV1.+?fieldsV1.*?", + "sample": "{\"object\":{\"apiVersion\":\"events.k8s.io/v1\",\"deprecatedCount\":2,\"deprecatedFirstTimestamp\":\"2024-11-02T10:56:17Z\",\"deprecatedLastTimestamp\":\"2024-11-02T10:56:52Z\",\"deprecatedSource\":{\"component\":\"kubelet\",\"host\":\"minikube\"},\"eventTime\":null,\"kind\":\"Event\",\"metadata\":{\"creationTimestamp\":\"2024-11-02T10:56:17Z\",\"managedFields\":[{\"apiVersion\":\"v1\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:count\":{},\"f:firstTimestamp\":{},\"f:involvedObject\":{},\"f:lastTimestamp\":{},\"f:message\":{},\"f:reason\":{},\"f:reportingComponent\":{},\"f:reportingInstance\":{},\"f:source\":{\"f:component\":{},\"f:host\":{}},\"f:type\":{}},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz.1804217ce2cb3041\",\"namespace\":\"default\",\"resourceVersion\":\"375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":\"9580334a-7ef9-4ad5-baf6-0ad10ae49853\"},\"reportingController\":\"kubelet\",\"reportingInstance\":\"minikube\",\"type\":\"Warning\"},\"type\":\"MODIFIED\"}", + "highlight": { + "message": [ + "},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice", + "375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice", + "in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason", + "\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name", + "\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":" + ] + }, + "metadata": { + "service.name": [ + "unknown" + ], + "message": [ + "{\"object\":{\"apiVersion\":\"events.k8s.io/v1\",\"deprecatedCount\":2,\"deprecatedFirstTimestamp\":\"2024-11-02T10:56:17Z\",\"deprecatedLastTimestamp\":\"2024-11-02T10:56:52Z\",\"deprecatedSource\":{\"component\":\"kubelet\",\"host\":\"minikube\"},\"eventTime\":null,\"kind\":\"Event\",\"metadata\":{\"creationTimestamp\":\"2024-11-02T10:56:17Z\",\"managedFields\":[{\"apiVersion\":\"v1\",\"fieldsType\":\"FieldsV1\",\"fieldsV1\":{\"f:count\":{},\"f:firstTimestamp\":{},\"f:involvedObject\":{},\"f:lastTimestamp\":{},\"f:message\":{},\"f:reason\":{},\"f:reportingComponent\":{},\"f:reportingInstance\":{},\"f:source\":{\"f:component\":{},\"f:host\":{}},\"f:type\":{}},\"manager\":\"kubelet\",\"operation\":\"Update\",\"time\":\"2024-11-02T10:56:52Z\"}],\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz.1804217ce2cb3041\",\"namespace\":\"default\",\"resourceVersion\":\"375301\",\"uid\":\"cf211b63-a5e4-40c4-bed3-fe90aea76a38\"},\"note\":\"Back-off restarting failed container cartservice in pod my-otel-demo-cartservice-7b585f4fb7-79ccz_default(9580334a-7ef9-4ad5-baf6-0ad10ae49853)\",\"reason\":\"BackOff\",\"regarding\":{\"apiVersion\":\"v1\",\"fieldPath\":\"spec.containers{cartservice}\",\"kind\":\"Pod\",\"name\":\"my-otel-demo-cartservice-7b585f4fb7-79ccz\",\"namespace\":\"default\",\"resourceVersion\":\"375163\",\"uid\":\"9580334a-7ef9-4ad5-baf6-0ad10ae49853\"},\"reportingController\":\"kubelet\",\"reportingInstance\":\"minikube\",\"type\":\"Warning\"},\"type\":\"MODIFIED\"}" + ] + }, + "firstOccurrence": "2024-11-02T10:55:33.051Z", + "lastOccurrence": "2024-11-02T10:56:52.563Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 16 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 4 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "spike", + "significance": "high", + "change_point": 38, + "p_value": 2.9750218550484796e-168, + "timestamp": "2024-11-02T10:55:30.000Z" + }, + "shortId": "lqan", + "relevance": "critical", + "interesting": true + } + ], + "searches": [ + { + "fragments": [ + "AddItemAsync called with userId", + "productId", + "quantity" + ], + "appearsAs": "userId, productId, and quantity are referenced in the request handling log entries in cartservice." + }, + { + "fragments": [ + "GetCartAsync called with userId" + ], + "appearsAs": "userId is referenced in the request handling log entries in cartservice." + }, + { + "fragments": [ + "Empty cart" + ], + "appearsAs": "Empty cart operation logs in cartservice." + }, + { + "fragments": [ + "cartServiceFailure" + ], + "appearsAs": "Feature flag 'cartServiceFailure' in cartservice." + }, + { + "fragments": [ + "10.244.0.61" + ], + "appearsAs": "IP address of the cartservice pod." + }, + { + "fragments": [ + "my-otel-demo-cartservice-67575c6f84-vngzw" + ], + "appearsAs": "Pod name of cartservice." + }, + { + "fragments": [ + "my-otel-demo-valkey:6379" + ], + "appearsAs": "Redis service used by cartservice." + }, + { + "fragments": [ + "/oteldemo.CartService/AddItem", + "/oteldemo.CartService/GetCart", + "/oteldemo.CartService/EmptyCart" + ], + "appearsAs": "Endpoints handled by cartservice." + }, + { + "fragments": [ + "flagd.evaluation.v1.Service" + ], + "appearsAs": "gRPC service involved in feature flag evaluation by cartservice." + }, + { + "fragments": [ + "HGET", + "EXPIRE", + "HMSET" + ], + "appearsAs": "Redis commands executed by cartservice." + } + ], + "relatedEntitiesSummaries": [ + "Based on the context provided, the following entities are potentially related to `service.name:cartservice` as either upstream or downstream dependencies. Below is a detailed analysis based on the indicators of relationships obtained from the observability data:\n\n### 1. Related Entity: `service.name:controller`\n- **Indicators**: \n - **Average Indicator**: The logs highlight high error rates (500 Internal Server Error) in the controller when POST requests to the `/api/cart` endpoint are made.\n - **Field values**: In controller logs, `message` contains references to the `/api/cart` endpoint, which is handled by `cartservice`.\n- **Reasoning**: \n - The `controller` service is responsible for managing /api/cart requests. Thus, it acts as a direct upstream service to `cartservice`.\n - It implies `controller` calls `cartservice` as part of handling requests, leading to the observed errors.\n- **Likeliness**: High\n - The `controller` service is likely a highly relevant entity since it directly interfaces with `cartservice`, with the errors surfacing in it when interacting with `cartservice`.\n\n### 2. Related Entity: `service.name:frontend`\n- **Indicators**:\n - **Strong Indicator**: The system architecture documentation shows that `frontend` interacts with various backend services, including those for user interactions such as adding items to the cart.\n - **Field values**: In the knowledge base, `frontend` receives HTTP traffic routed through `frontendproxy` and interacts with `cartservice`.\n- **Reasoning**:\n - `frontend` would act as a direct upstream service that communicates with `controller`, providing requests that eventually hit `cartservice`.\n- **Likeliness**: High\n - As `frontend` handles initial user interactions and routes requests to `cartservice`, it is essential in the request flow leading to `/api/cart` errors.\n\n### 3. Related Entity: `service.name:currencyservice`\n- **Indicators**:\n - **Strong Indicator**: The architecture description indicates `currencyservice` interacts with `cartservice` to handle currency conversions.\n - **Field values**: The entries show gRPC calls between `cartservice` and `currencyservice` for conversion operations.\n- **Reasoning**:\n - `currencyservice` may be an upstream dependency for `cartservice` for any currency-related manipulations on cart items.\n- **Likeliness**: Medium-High\n - While `currencyservice` interacts with `cartservice`, its exact influence on the direct issue might not be as strong as `controller` or `frontend`.\n\n### 4. Related Entity: `service.name:checkoutservice`\n- **Indicators**:\n - **Strong Indicator**: The architecture documentation lists `checkoutservice` as coordinating the checkout process involving interactions with `cartservice`.\n - **Field values**: Distributed tracing data could show `checkoutservice` making gRPC or HTTP calls to `cartservice`.\n- **Reasoning**:\n - `checkoutservice` is likely a downstream service that relies on the correct functioning of `cartservice` to gather cart data before proceeding to checkout operations.\n- **Likeliness**: Medium\n - Although primarily a downstream dependency, it processes important data from `cartservice`.\n\n### 5. Related Entity: `service.name:adservice`\n- **Indicators**:\n - **Weak Indicator**: `adservice` interfaces with `frontend` via gRPC to deliver ad content, it also might indirectly influence `cartservice` interactions if ads are part of the cart page.\n - **Field values**: Architectural details state `adservice` operates in the background to enhance user experience but no direct interaction with `cartservice`.\n- **Reasoning**:\n - While not directly connected, any latency in `adservice` may affect the overall user experience, causing indirect latency in calls that reach `cartservice`.\n- **Likeliness**: Low-Medium\n - Indirect connection and latent repercussions on user interactions with cart functionality.\n\n### 6. Related Entity: `service.name:loadgenerator`\n- **Indicators**:\n - **Average Indicator**: The `loadgenerator` service generates simulated traffic, handled by `frontendproxy` to stress-test services like `cartservice`.\n - **Field values**: Traffic from `loadgenerator` is routed through `frontendproxy` to reach core services, including `cartservice`.\n- **Reasoning**:\n - As an external input simulator, its traffic generation directly impacts `cartservice` when testing load resilience.\n- **Likeliness**: Medium\n - The errors can be a result of load tests conducted by `loadgenerator` surfacing bottlenecks in `cartservice`.\n\n### Summary\n\nTo conclude, the following entities are likely relevant to the issue in `service.name:cartservice`:\n\n1. **controller**: Direct upstream causing the 500 errors - High relevance.\n2. **frontend**: Upstream service initiating user interactions - High relevance.\n3. **currencyservice**: Upstream service for currency conversion - Medium-High relevance.\n4. **checkoutservice**: Downstream service relying on cart data - Medium relevance.\n5. **adservice**: Possible indirect impact due to latency - Low-Medium relevance.\n6. **loadgenerator**: Simulated traffic testing the system's resilience - Medium relevance.\n\nBy analyzing these entities, you can prioritize investigating `controller`, `frontend`, and `currencyservice` first, as they have the most direct and potentially impactful interactions with `cartservice`.", + "Based on the context provided, the architecture outlined in the knowledge base entry, the document analysis for the `cartservice`, and search keywords, several possible relationships with the `cartservice` can be identified. Below are the entities identified as highly relevant to the `cartservice`, along with the indicators, evidence, reasoning, and overall relevance.\n\n### 1. Entity: `service.name:frontend`\n\n#### Indicators and Evidence\n- **Average Indicator - URL Paths:**\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/AddItem`\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart`\n - `http://my-otel-demo-cartservice:8080/oteldemo.CartService/EmptyCart`\n- **Average Indicator - Logs:**\n - Observed in the search highlights for `service.name:frontend`: `@opentelemetry/api/build/src/api/context.js:60:46) at ServiceClientImpl.clientMethodTrace [as getCart]`\n- **Knowledge Base:**\n - The `frontend` is the core service for user interactions, receiving HTTP traffic and making requests to the `cartservice`.\n\n#### Relationship and Reasoning\nThe `frontend` service interacts directly with the `cartservice` by making requests to handle user shopping cart operations, such as adding items, retrieving the cart, and emptying the cart. Given the observed log entries and URL paths, it is reasonable to infer that the `frontend` service acts as a caller, while the `cartservice` acts as the callee. The high error rates observed in the context likely originate from the `frontend` making POST requests to the `/api/cart` endpoint handled by the `cartservice`.\n\n#### Likelihood of Relevance\n- **Very High:** The `frontend` service is highly likely to be relevant as it has a direct interaction with the `cartservice` and would be significantly impacted by any issues within the `cartservice`.\n\n### 2. Entity: `service.name:valkey`\n\n#### Indicators and Evidence\n- **Average Indicator - Redis Service:**\n - `my-otel-demo-valkey:6379`\n- **Average Indicator - Log Entries:**\n - Log patterns show Redis command execution by `cartservice`: `HGET`, `EXPIRE`, `HMSET`\n\n#### Relationship and Reasoning\nThe `valkey` service corresponds to the Redis instance that `cartservice` uses for data persistence. The `cartservice` makes frequent calls to Redis to perform operations such as fetching, expiring, and setting data, which is crucial for managing shopping cart state. As Redis is an upstream dependency, connection or data integrity issues here could directly contribute to the `500 Internal Server Errors` observed in the `cartservice`.\n\n#### Likelihood of Relevance\n- **High:** The `valkey` service is highly relevant because it is the data store for `cartservice`, directly affecting its behavior and performance.\n\n### 3. Entity: `service.name:currencyservice`\n\n#### Indicators and Evidence\n- **Average Indicator - gRPC Services:**\n - Mentioned in the architecture as handling currency conversions.\n- **Knowledge Base:**\n - Communicates with `cartservice` over gRPC to facilitate currency operations.\n\n#### Relationship and Reasoning\nThe `currencyservice` may interact with `cartservice` to handle price conversions for the items in the cart. Problems with currency conversion could cause unexpected data formats or communication failures, leading to `500 Internal Server Errors` in `cartservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** While the interaction exists, whether it directly contributes to the 500 errors specifically observed at `/api/cart` endpoints would require further investigation.\n\n### 4. Entity: `service.name:checkoutservice`\n\n#### Indicators and Evidence\n- **Strong Indicator - gRPC Services:**\n - Interacts with `checkoutservice` during the checkout process.\n- **Knowledge Base:**\n - Handles interactions including calls to `cartservice` for finalizing orders.\n\n#### Relationship and Reasoning\nThe `checkoutservice` could potentially depend on `cartservice` to validate and finalize items in the user's cart as part of the checkout process. If the `cartservice` fails during these operations, it could propagate errors back up to the user level through `checkoutservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** The relevance depends on whether the observed errors are occurring during checkout processes or general cart manipulations.\n\n### 5. Entity: `service.name:flagd`\n\n#### Indicators and Evidence\n- **Average Indicator - Feature Flag Evaluation:**\n - `flagd.evaluation.v1.Service`\n- **Log Metadata:**\n - `labels.feature_flag_key:keyword - cartServiceFailure`\n- **Trace Destination Service:**\n - `my-otel-demo-flagd:8013`\n\n#### Relationship and Reasoning\nThe `flagd` service is responsible for evaluating feature flags, such as the `cartServiceFailure`. If the feature flagging system is improperly toggled (e.g.: feature flag set to fail operations), it might contribute to the high error rates observed in `cartservice`.\n\n#### Likelihood of Relevance\n- **Moderate:** The feature flags might be causing or amplifying existing issues within the `cartservice`.\n\n### Summary\nFrom the observed data, the following entities are highly likely to be related to `cartservice` with respect to the given context:\n\n1. **`frontend`** - High relevance due to direct HTTP interaction with `cartservice`.\n2. **`valkey`** - High relevance as the Redis data store for `cartservice`.\n\nEntities with moderate likelihood:\n\n1. **`currencyservice`** - Related via gRPC for currency operations.\n2. **`checkoutservice`** - Potentially related during checkout processes.\n3. **`flagd`** - Related to feature flag evaluations involving `cartservice`.\n\nThese relationships cover both upstream dependencies affecting `cartservice` and downstream services impacted by `cartservice` issues, aiding in comprehensive issue diagnosis." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 5 + } + ] + }, + "entity": { + "service.name": "cartservice" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "controller" + }, + "reason": "The controller service is responsible for managing /api/cart requests. Thus, it acts as a direct upstream service to cartservice. High errors were observed in the controller when interacting with cartservice.", + "confidence": "high" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The frontend service interacts directly with the controller, handling user interactions that lead to /api/cart requests which are eventually processed by cartservice.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "The currencyservice interacts with cartservice to handle currency conversions, acting as an upstream dependency for cartservice when performing currency-related operations on cart items.", + "confidence": "medium-high" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "The checkoutservice relies on cart data from cartservice during the checkout process, making it a downstream service dependent on the correct functioning of cartservice.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "loadgenerator" + }, + "reason": "The loadgenerator service generates simulated traffic which impacts cartservice directly when testing the system's resilience.", + "confidence": "medium" + }, + { + "entity": { + "service.name": "adservice" + }, + "reason": "The adservice might indirectly impact cartservice through the frontend service by affecting the overall user experience and potentially causing indirect latency.", + "confidence": "low-medium" + }, + { + "entity": { + "service.name": "frontend" + }, + "reason": "The `frontend` service is highly likely to be relevant as it has a direct interaction with the `cartservice` and would be significantly impacted by any issues within the `cartservice`.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "valkey" + }, + "reason": "The `valkey` service is highly relevant because it is the data store for `cartservice`, directly affecting its behavior and performance.", + "confidence": "high" + }, + { + "entity": { + "service.name": "currencyservice" + }, + "reason": "The `currencyservice` may interact with `cartservice` to handle price conversions for the items in the cart. Problems with currency conversion could cause unexpected data formats or communication failures, leading to `500 Internal Server Error` in `cartservice`.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "checkoutservice" + }, + "reason": "The `checkoutservice` could potentially depend on `cartservice` to validate and finalize items in the user's cart as part of the checkout process. If the `cartservice` fails during these operations, it could propagate errors back up to the user level through `checkoutservice`.", + "confidence": "moderate" + } + ], + "summary": "Based on the context provided, including the system architecture and data samples, the entity `service.name:cartservice` can be described as follows:\n\n### Infrastructure & Environment\n`cartservice` operates within a microservices-based architecture. It is containerized and runs within a Kubernetes environment. Specifically, the data sample indicates that the service is deployed in the `default` Kubernetes namespace and is running on a pod named `my-otel-demo-cartservice-67575c6f84-vngzw` with an IP address of `10.244.0.61`. The service environment is tagged as `opentelemetry-demo`, indicating the use of OpenTelemetry for observability purposes. The infrastructure includes a Redis cache used by the cart service for data persistence.\n\n### Communication Characteristics (Protocols and Endpoints)\n`cartservice` primarily communicates using gRPC. It handles shopping cart data including adding and removing items. The service interacts with Redis (as indicated by the `labels.db_redis_flags` attribute). Additionally, the service integrates with external feature flag providers as seen from the `feature_flag_key` and `feature_flag_provider_name` attributes, which suggests it evaluates feature flags, possibly targeting the feature key `cartServiceFailure`. \n\nThe communication endpoints and protocols from the sample data are:\n- gRPC methods: `/oteldemo.CartService/EmptyCart`, `/oteldemo.CartService/AddItem`, `/oteldemo.CartService/GetCart`\n- HTTP endpoint: `http://my-otel-demo-flagd:8013/flagd.evaluation.v1.Service/ResolveBoolean`\n- Redis database interactions: `HGET`, `HMSET`, `EXPIRE` commands targeting various identifiers like `my-otel-demo-valkey:6379`.\n\n### Context of Entity in Investigation\nThe cart service (`cartservice`) is being investigated as it is the downstream service handling `/api/cart` requests. Issues in `cartservice` are directly contributing to the error patterns in the controller layer for the `/api/cart` endpoint. A high error rate, culminating in `500 Internal Server Error` responses, started around `2024-11-02T10:56:42.498Z`. The context indicates that the cart service plays a crucial role in managing shopping cart operations.\n\nGiven the observed high error rates and the 500 errors, `cartservice` may be experiencing issues in processing gRPC calls, feature flag evaluations, or Redis caching, which could be causing failures that propagate upstream to the controller.\n\n### Related Entities and Previous Investigations\nPreviously, errors in the controller for POST requests to `/api/cart` have been observed. This investigation is a continuation, focusing on the downstream `cartservice` which is responsible for handling these requests. This service's interaction with other entities such as Redis (for caching cart data) and external feature flag services (potentially toggling functionality) suggest that any issues in these integrations could impact the `cartservice` performance and result in the observed errors upstream in the controller.\n\nThis detailed analysis moves us to further inspect specific logs, traces, and any interdependent service metrics that may provide clues about the root cause of the high error rate in `cartservice`.\n\n### Observations for service.name:cartservice\n\n#### Startup Messages\n1. **Pattern: \"OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.\"**\n - **Count:** 78\n - **Trend:** There was a spike at **2024-11-02T10:55:30.000Z** with 78 occurrences. Before this timestamp, the value was consistently 0.\n\n2. **Pattern: \"OTEL-SDK: [224] 'MeterProvider' Disposed.\"**\n - **Count:** 4\n - **Trend:** Occurrences were persistently recorded as 0 until a brief spike at **2024-11-02T10:55:30.000Z** with 4 instances.\n\n3. **Pattern: \"exiting...\"**\n - **Count:** 3\n - **Trend:** Consistently 0 until a minor rise at **2024-11-02T10:55:30.000Z**, with 3 instances recorded.\n\n4. **Pattern: \"Application is shutting down...\"**\n - **Count:** 2\n - **Trend:** Log entries were consistently at 0 with a brief spike at **2024-11-02T10:55:30.000Z** showing 2 instances.\n\n#### Fatal Errors\n5. **Pattern: \"FATAL: Could not start, bad entrypoint!\"**\n - **Count:** 3\n - **Trend:** This pattern shows a significant change at **2024-11-02T10:55:30.000Z** with 2 occurrences at the change point and one additional at **2024-11-02T10:56:30.000Z**. Before this period, the occurrence rate was consistently 0.\n\n### Conclusion\n\nThe patterns observed indicate that there were significant startup issues with the `cartservice` around the **2024-11-02T10:55:30.000Z** mark. Specifically, the `cartservice` encountered a fatal error (\"FATAL: Could not start, bad entrypoint!\") that aligns precisely with the rise in errors noted during this period. This error indicates that the service failed to start due to a misconfiguration or issues with the entry point. This corresponds with the sudden spike in errors and `500 Internal Server Error` responses observed in the downstream controller making POST requests to the `/api/cart` endpoint. Furthermore, logs related to the service's deactivation and shutdown support the perspective that the service was not running successfully or consistently after this time.\n\n### Timeline of significant events\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “OTEL-SDK: [224] Instrument 'process.runtime.dotnet.jit.compilation_time', Meter 'OpenTelemetry.Instrumentation.Runtime' has been deactivated.”\n - **Description**: Spike detected with 78 occurrences, suggesting a potential issue within the service's runtime environment.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “OTEL-SDK: [224] 'MeterProvider' Disposed.”\n - **Description**: Sudden spike of 4 occurrences suggesting a significant change in the service’s telemetry setup or a potential abnormal shutdown initiation.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “exiting...”\n - **Description**: Log entries rose to 3 incidences, signaling the cart service may be initiating an unexpected exit.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “Application is shutting down...”\n - **Description**: 2 instances of this log message indicating the application is attempting to shut down around this time.\n\n- **2024-11-02T10:55:30.000Z**: \n - **Log Message**: “FATAL: Could not start, bad entrypoint!”\n - **Description**: Abrupt fatal error occurs 2 times, implying a critical misconfiguration or startup failure.\n\n- **2024-11-02T10:56:30.000Z**: \n - **Log Message**: “FATAL: Could not start, bad entrypoint!”\n - **Description**: Another occurrence of the critical fatal error, indicating the issue persisted beyond the initial spike and may have contributed to continued disruptions.\n\n- **2024-11-02T10:56:42.498Z**: \n - **Alert**: High error rate observed in the controller (98.78% error rate for POST requests to /api/cart).\n - **Description**: Starts the period of significantly high error rates contributing to 500 Internal Server Error responses. \n\n### Context and reasoning\n\nGiven the high error rate (98.78%) starting from **2024-11-02T10:56:42.498Z** for POST requests to `/api/cart`, the `cartservice` is a critical component for investigation as it handles these requests directly. From logs, there is a clear indication that significant problems began around **2024-11-02T10:55:30.000Z**, approximately one minute before the heightened error rate was observed in the upstream controller.\n\n**1. Startup Issues**: Multiple startup-related log patterns such as instruments deactivation, disposal of the MeterProvider, and application exit/shutdown messages indicate that cartservice experienced troubles initializing. Notably, the log entries “FATAL: Could not start, bad entrypoint!” directly show critical failures in service entry points likely causing the downstream failures.\n\n**2. Fatal Errors**: The fatal errors precisely correlate with the timeframe where errors spiked in the upstream service (controller). The error messages “FATAL: Could not start, bad entrypoint!” occurring multiple times reflect a misconfiguration or critical code issue that prevented the service from running properly.\n\nThus, the evidence from log patterns strongly suggests that startup and initialization problems in `cartservice`, resulting in its inconsistent availability and operational failures, is the root cause of the observed high error rates and 500 Internal Server Errors in the controller's POST requests to `/api/cart`." + }, + { + "attachments": { + "alerts": [], + "slos": [], + "analysis": { + "total": 98017, + "sampled": 1000, + "fields": [ + "@timestamp:date - 327 distinct values", + "app.label.component:keyword - 1 distinct values (`frontend`)", + "attributes.log.file.path.text:text - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "attributes.log.file.path:keyword - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "attributes.log.iostream:keyword - 1 distinct values (`stderr`)", + "body.text:text - 36 distinct values (` code: 13,\n`, ` details: 'cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"',\n`, 34 more values)", + "data_stream.dataset:keyword - 1 distinct values (`generic.otel`)", + "data_stream.namespace:keyword - 1 distinct values (`default`)", + "data_stream.type:keyword - 1 distinct values (`logs`)", + "deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "dropped_attributes_count:long - 1 distinct values (`0`)", + "event.dataset:keyword - 1 distinct values (`generic.otel`)", + "host.arch:keyword - 1 distinct values (`arm64`)", + "host.architecture:keyword - 1 distinct values (`arm64`)", + "host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "host.cpu.family:keyword - 1 distinct values (``)", + "host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "host.cpu.model.name:keyword - 1 distinct values (``)", + "host.cpu.stepping:keyword - 1 distinct values (`0`)", + "host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "host.os.full:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "host.os.platform:keyword - 1 distinct values (`linux`)", + "k8s.container.name:keyword - 1 distinct values (`frontend`)", + "k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "k8s.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "k8s.namespace.name:keyword - 1 distinct values (`default`)", + "k8s.node.name:keyword - 1 distinct values (`minikube`)", + "k8s.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T09:00:25Z`)", + "k8s.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "kubernetes.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "kubernetes.namespace:keyword - 1 distinct values (`default`)", + "kubernetes.node.name:keyword - 1 distinct values (`minikube`)", + "kubernetes.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "kubernetes.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "log.file.path:keyword - 1 distinct values (`/var/log/pods/default_my-otel-demo-frontend-5bbf4d78bc-qtwdr_a9fcfff9-3524-411e-8ac9-4e4341c1a121/frontend/0.log`)", + "log.iostream:keyword - 1 distinct values (`stderr`)", + "message:text - 36 distinct values (` code: 13,\n`, ` details: 'cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"',\n`, 34 more values)", + "observed_timestamp:date_nanos - 1000 distinct values (`2024-11-02T10:56:50.564274379Z`, `2024-11-02T10:55:46.563453752Z`, `2024-11-02T10:56:52.76272763Z`, `2024-11-02T10:56:14.764728626Z`, `2024-11-02T10:55:51.964080879Z`, `2024-11-02T10:55:51.764216463Z`, `2024-11-02T10:56:50.564063629Z`, `2024-11-02T10:55:38.563141804Z`, `2024-11-02T10:55:53.963540672Z`, `2024-11-02T10:56:32.762493176Z`, 990 more values)", + "os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.app.label.component:keyword - 1 distinct values (`frontend`)", + "resource.attributes.deployment.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "resource.attributes.host.arch:keyword - 1 distinct values (`arm64`)", + "resource.attributes.host.cpu.cache.l2.size:long - 1 distinct values (`0`)", + "resource.attributes.host.cpu.family:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.model.id:keyword - 1 distinct values (`0x000`)", + "resource.attributes.host.cpu.model.name.text:text - 1 distinct values (``)", + "resource.attributes.host.cpu.model.name:keyword - 1 distinct values (``)", + "resource.attributes.host.cpu.stepping:keyword - 1 distinct values (`0`)", + "resource.attributes.host.cpu.vendor.id:keyword - 1 distinct values (`Apple`)", + "resource.attributes.host.ip:ip - 2 distinct values (`10.244.0.19`, `fe80::28ce:acff:fe42:368e`)", + "resource.attributes.host.mac:keyword - 1 distinct values (`2A-CE-AC-42-36-8E`)", + "resource.attributes.host.name:keyword - 1 distinct values (`otel-daemonset-opentelemetry-collector-agent-7jlpk`)", + "resource.attributes.k8s.container.name.text:text - 1 distinct values (`frontend`)", + "resource.attributes.k8s.container.name:keyword - 1 distinct values (`frontend`)", + "resource.attributes.k8s.container.restart_count:keyword - 1 distinct values (`0`)", + "resource.attributes.k8s.deployment.name:keyword - 1 distinct values (`my-otel-demo-frontend`)", + "resource.attributes.k8s.namespace.name:keyword - 1 distinct values (`default`)", + "resource.attributes.k8s.node.name:keyword - 1 distinct values (`minikube`)", + "resource.attributes.k8s.pod.name:keyword - 1 distinct values (`my-otel-demo-frontend-5bbf4d78bc-qtwdr`)", + "resource.attributes.k8s.pod.start_time:keyword - 1 distinct values (`2024-10-26T09:00:25Z`)", + "resource.attributes.k8s.pod.uid:keyword - 1 distinct values (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`)", + "resource.attributes.os.description:keyword - 1 distinct values (`Ubuntu 24.04.1 LTS (Noble Numbat) (Linux otel-daemonset-opentelemetry-collector-agent-7jlpk 6.10.4-linuxkit #1 SMP Wed Oct 2 16:38:00 UTC 2024 aarch64)`)", + "resource.attributes.os.type:keyword - 1 distinct values (`linux`)", + "resource.attributes.service.name.text:text - 1 distinct values (`frontend`)", + "resource.attributes.service.name:keyword - 1 distinct values (`frontend`)", + "resource.dropped_attributes_count:long - 1 distinct values (`0`)", + "resource.schema_url:keyword - 1 distinct values (`https://opentelemetry.io/schemas/1.6.1`)", + "scope.dropped_attributes_count:long - 1 distinct values (`0`)", + "service.environment:keyword - 1 distinct values (`opentelemetry-demo`)", + "service.name:keyword - 1 distinct values (`frontend`)", + "severity_number:byte - 1 distinct values (`0`)" + ] + }, + "ownPatterns": [ + { + "field": "message", + "count": 3756, + "pattern": "at", + "regex": ".*?at.*?", + "sample": " at /app/.next/server/pages/api/cart.js:1:1025\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at /app/.next/server/pages/api/cart.js:1:1025\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 1103 + }, + { + "x": 1730544960000, + "y": 1411 + }, + { + "x": 1730544990000, + "y": 1242 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "qlqu", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 2366, + "pattern": "at app node_modules grpc grpc js build src", + "regex": ".*?at.+?app.+?node_modules.+?grpc.+?grpc.+?js.+?build.+?src.*?", + "sample": " at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at Object.onReceiveStatus (/app/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:360:141)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 693 + }, + { + "x": 1730544960000, + "y": 896 + }, + { + "x": 1730544990000, + "y": 777 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "roms", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1014, + "pattern": "at app node_modules opentelemetry instrumentation grpc build src", + "regex": ".*?at.+?app.+?node_modules.+?opentelemetry.+?instrumentation.+?grpc.+?build.+?src.*?", + "sample": " at ServiceClientImpl.clientMethodTrace [as getCart] (/app/node_modules/@opentelemetry/instrumentation-grpc/build/src/instrumentation.js:211:42)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl.clientMethodTrace [as getCart] (/app/node_modules/@opentelemetry/instrumentation-grpc/build/src/instrumentation.js:211:42)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 297 + }, + { + "x": 1730544960000, + "y": 384 + }, + { + "x": 1730544990000, + "y": 333 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "eyqk", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 351, + "pattern": "at node:internal process task_queues", + "regex": ".*?at.+?node:internal.+?process.+?task_queues.*?", + "sample": " at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at process.processTicksAndRejections (node:internal/process/task_queues:77:11)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 104 + }, + { + "x": 1730544960000, + "y": 129 + }, + { + "x": 1730544990000, + "y": 118 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "mpyi", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at AsyncLocalStorage.run node:async_hooks 346 14", + "regex": ".*?at.+?AsyncLocalStorage\\.run.+?node:async_hooks.+?346.+?14.*?", + "sample": " at AsyncLocalStorage.run (node:async_hooks:346:14)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at AsyncLocalStorage.run (node:async_hooks:346:14)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jsoq", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at AsyncLocalStorageContextManager.with app node_modules opentelemetry context async hooks build src AsyncLocalStorageContextManager.js 33 40", + "regex": ".*?at.+?AsyncLocalStorageContextManager\\.with.+?app.+?node_modules.+?opentelemetry.+?context.+?async.+?hooks.+?build.+?src.+?AsyncLocalStorageContextManager\\.js.+?33.+?40.*?", + "sample": " at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at AsyncLocalStorageContextManager.with (/app/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "viwd", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ContextAPI.with app node_modules opentelemetry api build src api context.js 60 46", + "regex": ".*?at.+?ContextAPI\\.with.+?app.+?node_modules.+?opentelemetry.+?api.+?build.+?src.+?api.+?context\\.js.+?60.+?46.*?", + "sample": " at ContextAPI.with (/app/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ContextAPI.with (/app/node_modules/@opentelemetry/api/build/src/api/context.js:60:46)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "agsa", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at new ZoneAwarePromise app node_modules zone.js bundles zone.umd.js 1340 33", + "regex": ".*?at.+?new.+?ZoneAwarePromise.+?app.+?node_modules.+?zone\\.js.+?bundles.+?zone\\.umd\\.js.+?1340.+?33.*?", + "sample": " at new ZoneAwarePromise (/app/node_modules/zone.js/bundles/zone.umd.js:1340:33) {\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at new ZoneAwarePromise (/app/node_modules/zone.js/bundles/zone.umd.js:1340:33) {\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "dhes", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "code", + "regex": ".*?code.*?", + "sample": " code: 14,\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " code: 14,\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "feod", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "for call at", + "regex": ".*?for.+?call.+?at.*?", + "sample": "for call at\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + "for call at\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "enzg", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ServiceClientImpl anonymous /app/node_modules/@grpc/grpc-js/build/src/make-client.js", + "regex": ".*?at.+?ServiceClientImpl.+?anonymous.+?/app/node_modules/@grpc/grpc-js/build/src/make-client\\.js.*?", + "sample": " at ServiceClientImpl. (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl. (/app/node_modules/@grpc/grpc-js/build/src/make-client.js:105:19)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "iook", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 338, + "pattern": "at ServiceClientImpl.makeUnaryRequest /app/node_modules/@grpc/grpc-js/build/src/client.js", + "regex": ".*?at.+?ServiceClientImpl\\.makeUnaryRequest.+?/app/node_modules/@grpc/grpc-js/build/src/client\\.js.*?", + "sample": " at ServiceClientImpl.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " at ServiceClientImpl.makeUnaryRequest (/app/node_modules/@grpc/grpc-js/build/src/client.js:161:32)\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 99 + }, + { + "x": 1730544960000, + "y": 128 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "jvlx", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 335, + "pattern": "metadata Metadata internalRepr Map 0 options", + "regex": ".*?metadata.+?Metadata.+?internalRepr.+?Map.+?0.+?options.*?", + "sample": " metadata: Metadata { internalRepr: Map(0) {}, options: {} }\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " metadata: Metadata { internalRepr: Map(0) {}, options: {} }\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.678Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 97 + }, + { + "x": 1730544960000, + "y": 127 + }, + { + "x": 1730544990000, + "y": 111 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "wczz", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "internalRepr Map content-type Array", + "regex": ".*?internalRepr.+?Map.+?content-type.+?Array.*?", + "sample": " internalRepr: Map(1) { 'content-type' => [Array] },\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " internalRepr: Map(1) { 'content-type' => [Array] },\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "pcyb", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "metadata Metadata", + "regex": ".*?metadata.+?Metadata.*?", + "sample": " metadata: Metadata {\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " metadata: Metadata {\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "tcak", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 3, + "pattern": "options", + "regex": ".*?options.*?", + "sample": " options: {}\n", + "highlight": { + "service.name": [ + "frontend" + ], + "resource.attributes.service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + " options: {}\n" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.039Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "xbsw", + "relevance": "normal", + "interesting": false + }, + { + "field": "message", + "count": 1005, + "pattern": "No connection established Last error connect ECONNREFUSED 10.110.191.164 8080 2024 11 02T10", + "regex": ".*?No.+?connection.+?established.+?Last.+?error.+?connect.+?ECONNREFUSED.+?10\\.110\\.191\\.164.+?8080.+?2024.+?11.+?02T10.*?", + "sample": "14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)", + "highlight": { + "service.name": [ + "frontend" + ] + }, + "metadata": { + "message": [ + "14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)" + ] + }, + "firstOccurrence": "2024-11-02T10:55:36.676Z", + "lastOccurrence": "2024-11-02T10:56:59.370Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 291 + }, + { + "x": 1730544960000, + "y": 381 + }, + { + "x": 1730544990000, + "y": 333 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "pssf", + "relevance": "critical", + "interesting": true + }, + { + "field": "error.exception.message", + "count": 3, + "pattern": "INTERNAL cart failure failed to get user cart during checkout rpc error code Unavailable desc connection error desc transport Error while dialing dial tcp connect connection refused", + "regex": ".*?INTERNAL.+?cart.+?failure.+?failed.+?to.+?get.+?user.+?cart.+?during.+?checkout.+?rpc.+?error.+?code.+?Unavailable.+?desc.+?connection.+?error.+?desc.+?transport.+?Error.+?while.+?dialing.+?dial.+?tcp.+?connect.+?connection.+?refused.*?", + "sample": "13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"", + "highlight": { + "service.name": [ + "frontend" + ] + }, + "metadata": { + "error.exception.message": [ + "13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"" + ] + }, + "firstOccurrence": "2024-11-02T10:55:43.710Z", + "lastOccurrence": "2024-11-02T10:56:15.038Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 0 + }, + { + "x": 1730543820000, + "y": 0 + }, + { + "x": 1730543850000, + "y": 0 + }, + { + "x": 1730543880000, + "y": 0 + }, + { + "x": 1730543910000, + "y": 0 + }, + { + "x": 1730543940000, + "y": 0 + }, + { + "x": 1730543970000, + "y": 0 + }, + { + "x": 1730544000000, + "y": 0 + }, + { + "x": 1730544030000, + "y": 0 + }, + { + "x": 1730544060000, + "y": 0 + }, + { + "x": 1730544090000, + "y": 0 + }, + { + "x": 1730544120000, + "y": 0 + }, + { + "x": 1730544150000, + "y": 0 + }, + { + "x": 1730544180000, + "y": 0 + }, + { + "x": 1730544210000, + "y": 0 + }, + { + "x": 1730544240000, + "y": 0 + }, + { + "x": 1730544270000, + "y": 0 + }, + { + "x": 1730544300000, + "y": 0 + }, + { + "x": 1730544330000, + "y": 0 + }, + { + "x": 1730544360000, + "y": 0 + }, + { + "x": 1730544390000, + "y": 0 + }, + { + "x": 1730544420000, + "y": 0 + }, + { + "x": 1730544450000, + "y": 0 + }, + { + "x": 1730544480000, + "y": 0 + }, + { + "x": 1730544510000, + "y": 0 + }, + { + "x": 1730544540000, + "y": 0 + }, + { + "x": 1730544570000, + "y": 0 + }, + { + "x": 1730544600000, + "y": 0 + }, + { + "x": 1730544630000, + "y": 0 + }, + { + "x": 1730544660000, + "y": 0 + }, + { + "x": 1730544690000, + "y": 0 + }, + { + "x": 1730544720000, + "y": 0 + }, + { + "x": 1730544750000, + "y": 0 + }, + { + "x": 1730544780000, + "y": 0 + }, + { + "x": 1730544810000, + "y": 0 + }, + { + "x": 1730544840000, + "y": 0 + }, + { + "x": 1730544870000, + "y": 0 + }, + { + "x": 1730544900000, + "y": 0 + }, + { + "x": 1730544930000, + "y": 2 + }, + { + "x": 1730544960000, + "y": 1 + }, + { + "x": 1730544990000, + "y": 0 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "crai", + "relevance": "critical", + "interesting": true + } + ], + "patternsFromOtherEntities": [ + { + "field": "message", + "count": 246, + "pattern": "INFO 10.244.0.26 AAAA IN my otel demo frontend udp 39 false 512 NXDOMAIN qr rd ra 39", + "regex": ".*?INFO.+?10\\.244\\.0\\.26.+?AAAA.+?IN.+?my.+?otel.+?demo.+?frontend.+?udp.+?39.+?false.+?512.+?NXDOMAIN.+?qr.+?rd.+?ra.+?39.*?", + "sample": "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\n", + "highlight": { + "body.text": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra" + ], + "message": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra" + ] + }, + "metadata": { + "service.name": [ + "coredns" + ], + "message": [ + "[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\n" + ] + }, + "firstOccurrence": "2024-11-02T10:36:30.917Z", + "lastOccurrence": "2024-11-02T10:56:58.646Z", + "timeseries": [ + { + "x": 1730543790000, + "y": 6 + }, + { + "x": 1730543820000, + "y": 6 + }, + { + "x": 1730543850000, + "y": 6 + }, + { + "x": 1730543880000, + "y": 6 + }, + { + "x": 1730543910000, + "y": 6 + }, + { + "x": 1730543940000, + "y": 6 + }, + { + "x": 1730543970000, + "y": 6 + }, + { + "x": 1730544000000, + "y": 6 + }, + { + "x": 1730544030000, + "y": 6 + }, + { + "x": 1730544060000, + "y": 6 + }, + { + "x": 1730544090000, + "y": 6 + }, + { + "x": 1730544120000, + "y": 6 + }, + { + "x": 1730544150000, + "y": 6 + }, + { + "x": 1730544180000, + "y": 6 + }, + { + "x": 1730544210000, + "y": 6 + }, + { + "x": 1730544240000, + "y": 6 + }, + { + "x": 1730544270000, + "y": 6 + }, + { + "x": 1730544300000, + "y": 6 + }, + { + "x": 1730544330000, + "y": 6 + }, + { + "x": 1730544360000, + "y": 6 + }, + { + "x": 1730544390000, + "y": 6 + }, + { + "x": 1730544420000, + "y": 6 + }, + { + "x": 1730544450000, + "y": 6 + }, + { + "x": 1730544480000, + "y": 6 + }, + { + "x": 1730544510000, + "y": 6 + }, + { + "x": 1730544540000, + "y": 6 + }, + { + "x": 1730544570000, + "y": 6 + }, + { + "x": 1730544600000, + "y": 6 + }, + { + "x": 1730544630000, + "y": 6 + }, + { + "x": 1730544660000, + "y": 6 + }, + { + "x": 1730544690000, + "y": 6 + }, + { + "x": 1730544720000, + "y": 6 + }, + { + "x": 1730544750000, + "y": 6 + }, + { + "x": 1730544780000, + "y": 6 + }, + { + "x": 1730544810000, + "y": 6 + }, + { + "x": 1730544840000, + "y": 6 + }, + { + "x": 1730544870000, + "y": 6 + }, + { + "x": 1730544900000, + "y": 6 + }, + { + "x": 1730544930000, + "y": 6 + }, + { + "x": 1730544960000, + "y": 6 + }, + { + "x": 1730544990000, + "y": 6 + }, + { + "x": 1730545020000, + "y": 0 + } + ], + "change": { + "type": "stationary", + "significance": null + }, + "shortId": "rlzf", + "relevance": "normal", + "interesting": false + } + ], + "searches": [ + { + "fragments": [ + "10.110.191.164:8080", + "10.110.191.164", + "8080" + ], + "appearsAs": "This IP address and port are referenced in the investigated entity 'frontend'." + }, + { + "fragments": [ + "/api/cart", + "cartservice", + "/api" + ], + "appearsAs": "These URL fragments appear as attributes.request.url in the investigated entity 'frontend'. They could be related to 'cartservice'." + }, + { + "fragments": [ + "000aa", + "000bbb" + ], + "appearsAs": "These ids appear as span.id and parent.id in the investigated entity 'frontend'. They could be referring to spans found on upstream or downstream services" + } + ], + "relatedEntitiesSummaries": [ + "## Possible Relationships to `service.name:frontend`\n\n### 1. Entity: `service.name:controller`\n- **Indicators:**\n - #### Average Indicator:\n - **IP Address and Port:**\n - `frontend`: `10.110.191.164:8080`\n - `controller`: `10.244.0.26:8080`\n - **URL Fragment:**\n - `frontend`: `/api/cart`\n - `controller`: `/api/cart?session`\n- **Relationship Reasoning:**\n - The `controller` service is highly likely to be making requests to, or routing through, the `frontend` service as evidenced by the URL fragments referring to the `/api/cart` endpoint seen in both entities. Additionally, they share common IP address and port patterns indicating network interaction.\n- **Relevance Assessment:**\n - **Very High**: Given that the `controller` service handles endpoints like `/api/cart`, which directly correspond to transactions failing with a high error rate, this entity is a critical part of the interaction chain and should be closely examined.\n\n### 2. Entity: `service.name:cartservice`\n- **Indicators:**\n - #### Strong Indicator:\n - **Direct Call References:**\n - `frontend`: `details: 'cart failure: failed to get user cart during checkout: rpc error: ... desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"'\n - `cartservice`: `url.full.text:\"http://my-otel-demo-cartservice:8080/oteldemo.CartService/GetCart\"`\n- **Relationship Reasoning:**\n - The `frontend` service attempts to interact with the `cartservice` as observed by the endpoint `/oteldemo.CartService/GetCart`. Connection errors from `frontend` indicate it is calling `cartservice` and facing issues getting responses, potentially causing the 500 errors.\n- **Relevance Assessment:**\n - **Very High**: Since `cartservice` manages user cart data and the connection errors reported in `frontend` logs directly correspond to attempts to communicate with `cartservice`, this entity is a probable cause of the service failures being observed.\n\n### 3. Entity: `service.name:frontend-web`\n- **Indicators:**\n - #### Average Indicator:\n - **URL Fragment:**\n - `frontend`: `/api/cart`\n - `frontend-web`: `/api/cart`\n - #### Weak Indicator:\n - **RUM Layer Mentions:**\n - `frontend`: `frontend-web (RUM)`\n - `frontend-web`: Described in System Architecture.\n- **Relationship Reasoning:**\n - `frontend-web` captures real user interactions with the `/api/cart` endpoint providing insights into the `frontend` service which might help trace the errors and delays externally perceived by users.\n- **Relevance Assessment:**\n - **Moderate**: While `frontend-web` can show the surface errors users are experiencing, it is more of an observability layer rather than directly causing the 500 errors or impacting the service interactions upstream.\n\n### 4. Entity: `service.name:frontendproxy`\n- **Indicators:**\n - #### Average Indicator:\n - **Network Routing Indicator:**\n - `frontend`: Receives traffic from `frontendproxy`\n - `frontendproxy`: Directs traffic to `frontend`\n - #### IP Address Mention:\n - Both services reference `8080`, indicating shared routing or proxying.\n- **Relationship Reasoning:**\n - `frontendproxy` routes traffic from external sources, including simulated user requests, to `frontend`. Any issues in this proxy layer could impact the incoming traffic to `frontend`, causing errors.\n- **Relevance Assessment:**\n - **High**: Considering `frontendproxy` handles traffic routing, any misconfiguration or failures here could lead to the issues observed on the `frontend`.\n\n### 5. Entity: `service.name:coredns`\n- **Indicators:**\n - #### Weak Indicators:\n - **DNS Resolution Events:**\n - Logs showing DNS queries involving `frontend`.\n - **IP Address and Port:**\n - Shared network interactions over common ports like `8080`.\n- **Relationship Reasoning:**\n - While not directly related to application logic, `coredns` is responsible for DNS resolution within the cluster, and issues here could result in connectivity problems seen in `frontend` when trying to reach `cartservice`.\n- **Relevance Assessment:**\n - **Moderate**: While less likely to be the root cause, DNS misconfigurations or failures could indirectly contribute to connectivity issues within services like `frontend`.\n\n### Summary\n\n1. **service.name:controller** - Very High relevance due to direct endpoint interaction.\n2. **service.name:cartservice** - Very High relevance for being the direct interaction target with observed failures.\n3. **service.name:frontend-web** - Moderate relevance in monitoring layer but not direct interaction.\n4. **service.name:frontendproxy** - High relevance for routing traffic to `frontend`.\n5. **service.name:coredns** - Moderate relevance for possible DNS resolution issues." + ], + "kbEntries": [ + { + "id": "System architecture", + "text": "The architecture described here outlines a microservices-based system, where each service is implemented in a distinct programming language and communicates via gRPC, HTTP, or TCP. This system is designed to handle simulated user traffic, supported by a variety of interconnected services and components.\n\n### System Architecture\n\n1. **`loadgenerator`** - Simulates external user traffic by sending HTTP requests, which are managed by an Nginx ingress controller. This ingress directs traffic to the `frontendproxy` service.\n\n2. **`frontendproxy` (Envoy)** - Acts as a reverse proxy, routing incoming traffic from `loadgenerator` to `frontend`.\n\n3. **`frontend` (Node.js)** - The core service for user interactions, receiving HTTP traffic from `frontendproxy` and interfacing with various backend services to fulfill requests.\n\n4. **`frontend-web` (RUM)** - A Real User Monitoring (RUM) layer that runs in the user's browser, enabling insights into end-user experiences and frontend performance.\n\n5. **`adservice`** - Delivers advertisements to the `frontend` using gRPC, enhancing the user experience with relevant ad content.\n\n6. **`cartservice`** - Manages shopping cart data, including adding and removing items. It communicates over gRPC and leverages a Redis cache for data persistence.\n\n7. **`currencyservice`** - Handles currency conversions and facilitates interactions between `cartservice` and `checkoutservice` over gRPC.\n\n8. **`checkoutservice`** - Coordinates the checkout process, calling various services for payments, shipping, and emails. It utilizes both gRPC and HTTP protocols to aggregate the necessary information for order completion.\n\n9. **`emailservice`** - Sends order confirmation emails to users via gRPC, triggered by interactions with `checkoutservice`.\n\n10. **`productcatalogservice`** - Maintains the product catalog, storing details about available items and providing this data to other services via gRPC.\n\n11. **`recommendationservice`** - Generates personalized product recommendations, accessed by `frontend` over gRPC.\n\n12. **`shippingservice`** - Manages shipping information, providing essential data to `checkoutservice` over gRPC.\n\n13. **`quoteservice`** - Supplies shipping quotes over HTTP, which are accessed by `shippingservice` to estimate shipping costs.\n\n14. **`paymentservice`** - Processes payment transactions through gRPC, enabling secure and efficient payments for `checkoutservice`.\n\n15. **`accountingservice`** - Responsible for recording transactions, it connects to a Kafka queue and interacts over TCP.\n\n16. **`frauddetectionservice`** - Monitors orders for potential fraud, also interfacing with the Kafka queue over TCP to receive relevant transaction data.\n\n17. **`imageprovider` (Nginx)** - Serves static images for the frontend interface, accessible over HTTP.\n\n18. **`queue` (Kafka)** - Acts as a central message broker, facilitating communication between `accountingservice` and `frauddetectionservice`.\n\n### Key Components\nThe system is structured to enable robust, distributed communication across services, allowing each component to focus on a specific aspect of the user experience or business logic. The ingress controller, in particular, plays a critical role in directing traffic, ensuring that incoming requests from `loadgenerator` are correctly routed through `frontendproxy` and into the system’s core services.\n\nThis architecture ensures that the system can handle high traffic loads and provides a modular, flexible framework to meet user demands while monitoring for performance and security.\n", + "tokens": 733, + "score": 5 + } + ] + }, + "entity": { + "service.name": "frontend" + }, + "relatedEntities": [ + { + "entity": { + "service.name": "controller" + }, + "reason": "`controller` service handles endpoints like `/api/cart`, which corresponds to failed transactions. They share common IP address and port patterns, indicating network interaction.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "cartservice" + }, + "reason": "`frontend` service attempts to interact with `cartservice`. Connection errors from `frontend` indicate it is calling `cartservice` and facing issues getting responses, potentially causing the 500 errors.", + "confidence": "very high" + }, + { + "entity": { + "service.name": "frontend-web" + }, + "reason": "`frontend-web` captures real user interactions with the `/api/cart` endpoint. Helps trace the errors and delays externally perceived by users.", + "confidence": "moderate" + }, + { + "entity": { + "service.name": "coredns" + }, + "reason": "`coredns` is responsible for DNS resolution within the cluster and issues here could result in connectivity problems seen in `frontend`.", + "confidence": "moderate" + } + ], + "summary": "### Investigation of Entity `service.name:frontend`\n\n#### Context of Investigation\n\nThe `frontend` service is critical in this investigation due to its role in the overall request handling and the observed high error rate (98.78%) in the `controller` service for POST requests to the `/api/cart` endpoint. This issue began at `2024-11-02T10:56:42.498Z`. The `frontend` service routes requests to `cartservice`, a key interaction in this error occurrence.\n\n#### Infrastructure & Environment\n\n- **Environment**: The `frontend` operates within the `opentelemetry-demo` deployment environment.\n- **Deployment**: It is deployed on Kubernetes (k8s), specifically within the `default` namespace. \n- **Pod Information**: The pod name is `my-otel-demo-frontend-5bbf4d78bc-qtwdr`, on the `minikube` node. Each pod has a unique UID (`a9fcfff9-3524-411e-8ac9-4e4341c1a121`), with logs stored at `/var/log/pods/`.\n- **Resource Attributes**: Hosts `Apple` Arm64 architecture processor (`host.cpu.vendor.id: Apple`), running `Ubuntu 24.04.1 LTS (Noble Numbat)`, indicating a Linux-based system.\n\n#### Communication Characteristics \n\n- **Protocols**: \n - The `frontend` service communicates primarily using HTTP for inbound requests and gRPC for backend service interactions. \n - gRPC is specifically used when the `frontend` communicates with `cartservice`, highlighted by recorded RPC errors in the logs.\n- **Endpoints**:\n - The `frontend` gets requests from `frontendproxy` (Envoy), acting as the reverse proxy.\n - The service then routes these requests to different backend services, including `cartservice`, via gRPC.\n - The critical IP noted in logs is `10.110.191.164:8080`, pointing to a potential endpoint for the `cartservice`.\n\n#### Context of Entity in Investigation\n\n- **Reason for Investigation**: The `frontend` service is under scrutiny due to its pivotal role in processing and routing incoming user requests. Any disruption in its communication or processing mechanism directly affects the functionality of connected services, notably `cartservice`, leading to high error rates observed in the `controller`.\n- **Relation to Other Entities**:\n - **Previous Entity**: `controller` - The `controller` service logs indicate a high number of 500 errors were triggered during POST requests to `/api/cart`.\n - **Dependencies**: `frontend` relies on successful communication with `cartservice` to fulfill these cart-related requests.\n- **Architectural Role**: The `frontend` is the nucleus for user interactions within this microservices architecture. Any network or communication issue in `frontend` can cascade, influencing its backend dependencies like `cartservice` and leading to broader service disruptions.\n\nThis comprehensive analysis of the `frontend` service’s infrastructure, communication protocols, and its investigative context emphasizes its critical position in the service chain responsible for the reported errors. Further scrutiny of the communication logs, particularly focusing on the gRPC interactions with `cartservice`, is essential to identify and mitigate the root cause of these failures.\n\nObservations for service `frontend`.\n\n### Connection Issues to Upstream Dependency\n\n1. **Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Sample**: \"14 UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080 (2024-11-02T10:56:12.143Z)\"\n - **Timeseries Observations**: \n - No occurrences before 2024-11-02T10:55:30.000Z.\n - Sharp increase at 2024-11-02T10:55:30.000Z (291 occurrences).\n - Further increase at 2024-11-02T10:56:00.000Z (381 occurrences).\n - Next timestamp at 2024-11-02T10:57:00.000Z showing a return to 0 occurrences.\n\n2. **Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"\n - **Sample**: \"13 INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp 10.110.191.164:8080: connect: connection refused\"\n - **Timeseries Observations**:\n - No occurrences before 2024-11-02T10:55:30.000Z.\n - Slight increase at 2024-11-02T10:55:30.000Z (2 occurrences).\n - One more occurrence at 2024-11-02T10:56:00.000Z (1 occurrence).\n - No occurrences after 2024-11-02T10:56:30.000Z.\n\nThe significant spike in connection errors starting from 2024-11-02T10:55:30.000Z aligns with the high error rate in the `controller` service, suggesting a strong correlation between these established connection issues in the `frontend` service and the 500 errors seen in the `controller` service for POST requests to the `/api/cart` endpoint around the same time.\n\n### Possibly Relevant Log Patterns from coredns\n\n1. **Pattern**: \"INFO 10.244.0.26 AAAA IN my-otel-demo-frontend udp 39 false 512 NXDOMAIN qr,rd,ra 39\"\n - **Sample**: \"[INFO] 10.244.0.26:59273 - 48617 \"AAAA IN my-otel-demo-frontend. udp 39 false 512\" NXDOMAIN qr,rd,ra 39 0.003716084s\"\n - **Timeseries Observations**:\n - Frequent steady occurrences of 6 events every 30 seconds.\n - No notable changes or spikes coinciding with the connection issues observed in the `frontend` service.\n\nFrom these observations, it appears that the connection refusal errors in the `frontend` service are likely caused by issues in communication with the `cartservice`, potentially as a result of intermittent network disruptions or dependency service failures at the IP 10.110.191.164. Further investigation should focus on the health and connectivity status of the `cartservice` around the specified time period.\n\n### Timeline of Significant Events\n\n1. **2024-11-02T10:55:30.000Z**\n - **Event**: Sharp increase in connection error logs.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 291 occurrences reported.\n\n2. **2024-11-02T10:55:30.000Z**\n - **Event**: Appearance of an internal error in accessing cart services.\n - **Log Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error\"\n - **Details**: 2 occurrences reported.\n\n3. **2024-11-02T10:56:00.000Z**\n - **Event**: Further increase in connection error logs.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 381 occurrences reported.\n\n4. **2024-11-02T10:56:00.000Z**\n - **Event**: Additional occurrence of an internal error in accessing cart services.\n - **Log Pattern**: \"INTERNAL: cart failure: failed to get user cart during checkout: rpc error: code = Unavailable desc = connection error\"\n - **Details**: 1 occurrence reported.\n\n5. **2024-11-02T10:56:42.498Z**\n - **Event**: High error rate (98.78%) in the `controller` service for POST requests to the `/api/cart` endpoint begins.\n - **Details**: Corresponds to the timing of observed spikes in connection errors in the `frontend` service.\n\n6. **2024-11-02T10:57:00.000Z**\n - **Event**: Connection error logs return to zero occurrences.\n - **Log Pattern**: \"No connection established. Last error: connect ECONNREFUSED 10.110.191.164:8080\"\n - **Details**: 0 occurrences reported.\n\n### Context and Reasoning\n\nThe `frontend` service is critical in this investigation due to its role in routing requests to the `cartservice`. The high error rates observed in the `controller` service's POST requests to the `/api/cart` endpoint started precisely at 2024-11-02T10:56:42.498Z, which is within the timeframe when the `frontend` service experienced significant connection issues with the `cartservice`.\n\nUpon analyzing log patterns, it is evident that the communication disruptions between the `frontend` service and the `cartservice` began at 2024-11-02T10:55:30.000Z with a sharp increase in connection errors, and these errors persisted until approximately 2024-11-02T10:57:00.000Z. During this period, numerous `ECONNREFUSED` errors were logged, indicating the `frontend` service's inability to establish a connection to the `cartservice` (IP 10.110.191.164:8080). This aligns with the timeline of the high error rates in the `controller` service, suggesting a direct correlation.\n\nFurthermore, the internal errors logged by the `frontend` service related to RPC errors and failed attempts to get the user cart during checkout reaffirm these connection problems. These errors underscore an impaired communication pathway to the `cartservice`, affecting the `controller` service's ability to process POST requests to the `/api/cart` endpoint.\n\nTherefore, the evidence strongly indicates that network or connection failures between the `frontend` service and its upstream dependency, `cartservice`, are the principal cause of the cascading 500 errors seen in the `controller` service. This highlights the critical position of the `frontend` service in ensuring stable communication pathways within the microservice architecture." + } + ] + }, + "role": "tool", + "toolCallId": "call_KJwmI3xgY1gcstI4MVd4Olcf" + }, + { + "role": "assistant", + "content": "", + "toolCalls": [ + { + "toolCallId": "call_1Y45Vw3lRUFLsImFilvrXPos", + "function": { + "name": "endProcessAndWriteReport", + "arguments": { + "endProcess": true + } + } + } + ] + }, + { + "name": "endProcessAndWriteReport", + "role": "tool", + "toolCallId": "call_1Y45Vw3lRUFLsImFilvrXPos", + "response": { + "report": "# Root Cause Analysis (RCA) Report\n\n## 1. Introduction\n\n### Overview\nThis RCA report investigates the elevated error rates in the `controller` service and its downstream dependencies. The incident was first detected by an alert indicating an unusually high number of 500 Internal Server Errors on the `/api/cart` endpoint, with an error rate of 98.78%, significantly exceeding the 1% threshold over a 1-minute period. The primary entities investigated were the `controller`, `cartservice`, and `frontend` services.\n\n### Initial Hypothesis\nThe initial hypothesis proposed that either a deployment, a critical configuration change, or a dependency failure caused the high error rate in the `controller` service.\n\n## 2. Investigation Summary\n\n### Proposed Hypotheses\n1. **Resource exhaustion in `controller`**:\n - **Evidence**:\n - **Strong:** High error rate specifically for POST requests to the `/api/cart` endpoint.\n - **Weak:** No indications of resource limits being exceeded in the `controller` service.\n2. **Upstream latency or failure from `frontendproxy`**:\n - **Evidence**:\n - **Strong:** Error patterns suggested connectivity issues starting from the `frontendproxy`.\n - **Weak:** Eventually ruled out as communication problems upstream of the `controller`.\n3. **Backend service issue or configuration error in `cartservice`**:\n - **Evidence**:\n - **Strong:** Identified startup issues and fatal errors in `cartservice`.\n - **Weak:** None.\n\n### Discarded Hypotheses\n- **Resource exhaustion in `controller`**: Ruled out due to stable resource usage.\n- **Upstream latency or failure from `frontendproxy`**: Connectivity issues traced further downstream to `cartservice`.\n\n### Investigated Entities\n- `controller`\n- `frontend`\n- `cartservice`\n\n## 3. Cause and Effect\n\n### Cause\nThe root cause was identified as a startup failure in the `cartservice`, with fatal \"bad entrypoint\" errors preventing the service from starting correctly.\n\n### Effect\nThe startup issues in `cartservice` caused connection failures, leading to `frontend` being unable to establish connections. This resulted in `controller` reporting a high number of 500 errors for POST requests to the `/api/cart` endpoint, thus impacting user-facing services relying on this endpoint.\n\n## 4. Evidence for Root Cause\n\n### Log Patterns\n- **`cartservice` Logs**: Repeated \"FATAL: Could not start, bad entrypoint!\" errors indicating startup failures.\n- **`frontend` Logs**: \"ECONNREFUSED\" errors and spikes in \"No connection established\" errors to `cartservice`.\n- **`controller` Logs**: High frequency of 500 errors for HTTP POST requests to `/api/cart`.\n\n### Alerts and SLOs\n- An alert was triggered at `2024-11-02T10:56:42.498Z` due to a high error rate of 98.78% for the `/api/cart` endpoint.\n\n### Data Analysis\n- **Memory and CPU usage** of `controller` remained stable, ruling out resource exhaustion.\n- **Network traffic** analysis showed no abnormalities at the `controller` level but issues at the connectivity to `cartservice`.\n\n## 5. Proposed Impact\n\n### Affected Services\n- `controller`\n- `frontend`\n- `cartservice`\n\n### Performance Degradation\n- High error rate and degraded performance for the `/api/cart` endpoint.\n- Impact on downstream services and user-facing operations reliant on `cartservice`.\n\n### User Impact\n- Elevated latency and failed transactions affecting users trying to access and modify shopping cart data.\n\n## 6. Timeline of Significant Events\n\n- **2024-11-02T10:55:30.000Z**:\n - `cartservice` logs indicate a series of startup issues, marked by \"FATAL: Could not start, bad entrypoint!\" errors.\n - `frontend` logs show initial \"No connection established\" errors to `cartservice`.\n\n- **2024-11-02T10:56:00.000Z**:\n - `frontend` logs continue to show increased \"No connection established\" errors.\n\n- **2024-11-02T10:56:30.000Z**:\n - Additional \"bad entrypoint\" errors recorded in `cartservice` logs.\n\n- **2024-11-02T10:56:42.498Z**:\n - Alert triggered due to a high error rate of 98.78% for `/api/cart` in `controller`.\n\n- **2024-11-02T10:57:00.000Z**:\n - `frontend` logs show a return to zero connection errors as the startup issue in `cartservice` stabilizes.\n\n## 7. Conclusion and Next Steps\n\n### Conclusion\nThe investigation concludes that the root cause of the incident was the startup failure and persistent initialization issues in `cartservice`. This prevented `cartservice` from functioning correctly, causing connection refusal errors in `frontend`, which in turn resulted in the `controller` reporting high error rates for POST requests to the `/api/cart` endpoint.\n\n### Next Steps\n1. **Fixes or Mitigations**:\n - Address and rectify the misconfiguration or code issues in `cartservice` causing fatal startup errors.\n - Ensure proper configuration and reliable startup for `cartservice` moving forward.\n\n2. **Monitoring Improvements**:\n - Implement more granular alerts and monitoring for `cartservice` startup and initialization errors.\n - Enhance network error monitoring between `frontend` and `cartservice`.\n\n3. **Further Investigations**:\n - Monitor `cartservice` and observe for any recurrent patterns indicating startup issues.\n - Investigate the potential for automated failover or redundancy mechanisms to handle startup failures in critical services.\n\nThis concluded RCA encapsulates the findings from the investigations and provides clear guidance on addressing identified issues.\n\n---\n\n**Prepared by:**\nElastic Observability Support Team", + "timeline": { + "events": [ + { + "@timestamp": "2024-11-02T10:55:30.000Z", + "severity": "unusual", + "type": "event", + "description": "`cartservice` logs indicate a series of startup issues, marked by 'FATAL: Could not start, bad entrypoint!' errors." + }, + { + "@timestamp": "2024-11-02T10:55:30.000Z", + "severity": "unusual", + "type": "event", + "description": "`frontend` logs show initial 'No connection established' errors to `cartservice`." + }, + { + "@timestamp": "2024-11-02T10:56:00.000Z", + "severity": "unusual", + "type": "event", + "description": "`frontend` logs continue to show increased 'No connection established' errors." + }, + { + "@timestamp": "2024-11-02T10:56:30.000Z", + "severity": "unusual", + "type": "event", + "description": "Additional 'bad entrypoint' errors recorded in `cartservice` logs." + }, + { + "@timestamp": "2024-11-02T10:56:42.498Z", + "severity": "critical", + "type": "alert", + "description": "Alert triggered due to a high error rate of 98.78% for `/api/cart` in `controller`." + }, + { + "@timestamp": "2024-11-02T10:57:00.000Z", + "severity": "info", + "type": "event", + "description": "`frontend` logs show a return to zero connection errors as the startup issue in `cartservice` stabilizes." + } + ] + } + } + } +] diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/index.ts new file mode 100644 index 000000000000..5068c8d5055f --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/mock/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 type { + InvestigateEntityToolMessage, + RootCauseAnalysisEvent, +} from '@kbn/observability-ai-server/root_cause_analysis'; +import { RCA_INVESTIGATE_ENTITY_TOOL_NAME } from '@kbn/observability-ai-common/root_cause_analysis'; +import { MessageRole } from '@kbn/inference-common'; +import { Required } from 'utility-types'; +// @ts-ignore +import completeRootCauseAnalysisJson from './complete_root_cause_analysis.json'; + +export const completeRootCauseAnalysis = completeRootCauseAnalysisJson as RootCauseAnalysisEvent[]; + +export const controllerEntityHealthAnalysis = completeRootCauseAnalysis.find( + (event) => + 'role' in event && + event.role === MessageRole.Tool && + event.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME && + event.response.entity['service.name'] === 'cartservice' +) as Required; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.stories.tsx new file mode 100644 index 000000000000..6328835af1f6 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { RootCauseAnalysisCallout } from '.'; + +const stories: Meta<{}> = { + title: 'RCA/Callout', + component: RootCauseAnalysisCallout, +}; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + {}} + onCompleteInBackgroundClick={() => {}} + completeInBackground + /> + ); +}; + +export const CompleteInBackgroundDisabled: Story<{}> = () => { + return ( + {}} + onCompleteInBackgroundClick={() => {}} + completeInBackground={false} + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.tsx new file mode 100644 index 000000000000..0487172aca6a --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_callout/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { + EuiButton, + EuiCallOut, + EuiCheckbox, + EuiFlexGroup, + EuiFlexItem, + EuiFormLabel, + EuiPanel, + EuiText, + EuiTitle, + useGeneratedHtmlId, +} from '@elastic/eui'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { AssistantAvatar } from '@kbn/observability-ai-assistant-plugin/public'; +import { css } from '@emotion/css'; + +export function RootCauseAnalysisCallout({ + onClick, + onCompleteInBackgroundClick, + completeInBackground, +}: { + onClick: () => void; + onCompleteInBackgroundClick: () => void; + completeInBackground: boolean; +}) { + const checkboxId = useGeneratedHtmlId(); + + return ( + + + + + + + + +

+ {i18n.translate('xpack.observabilityAiAssistant.rca.calloutTitle', { + defaultMessage: 'AI-assisted root cause analysis', + })} +

+
+
+
+ + + {i18n.translate('xpack.observabilityAiAssistant.rca.calloutText', { + defaultMessage: `Start an automated investigation that will analyze + log patterns, SLOs and alerts for entities and provide an evidence- + based root cause analysis of issues in your system.`, + })} + + + + + { + onCompleteInBackgroundClick(); + }} + checked={completeInBackground} + /> + + {i18n.translate( + 'xpack.observabilityAiAssistant.rootCauseAnalysisCallout.keepAnalysisRunningInFormLabelLabel', + { defaultMessage: 'Keep analysis running in background' } + )} + + + + {i18n.translate('xpack.observabilityAiAssistant.rca.calloutText', { + defaultMessage: 'Start analysis', + })} + + +
+
+
+
+ ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_collapsible_panel/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_collapsible_panel/index.tsx new file mode 100644 index 000000000000..8cdf518f84ab --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_collapsible_panel/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 { EuiAccordion, EuiPanel, EuiSpacer, useGeneratedHtmlId } from '@elastic/eui'; +import React from 'react'; +import { RootCauseAnalysisPanel } from '../rca_panel'; + +export function RootCauseAnalysisCollapsiblePanel({ + title, + content, + color, + isDisabled, +}: { + title: React.ReactNode; + content: React.ReactNode; + color?: React.ComponentProps['color']; + isDisabled?: boolean; +}) { + const htmlId = useGeneratedHtmlId(); + return ( + + + + {content} + + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.stories.tsx new file mode 100644 index 000000000000..492d6ecc5938 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { noop } from 'lodash'; +import { RootCauseAnalysisContainer } from '.'; +// @ts-ignore +import fullAnalysis from '../mock/complete_root_cause_analysis.json'; + +const stories: Meta<{}> = { + title: 'RCA/Container', + component: RootCauseAnalysisContainer, +}; + +export default stories; + +const handlers = { + onStartAnalysisClick: noop, + onStopAnalysisClick: noop, + onResetAnalysisClick: noop, + onCompleteInBackgroundClick: noop, + onClearAnalysisClick: noop, +}; + +export const Empty: Story<{}> = () => { + return ; +}; + +export const Loading: Story<{}> = () => { + return ; +}; + +export const LoadingWithoutCompleteInBackground: Story<{}> = () => { + return ; +}; + +const error = new Error('Failed to load analysis'); + +export const WithError: Story<{}> = () => { + return ( + + ); +}; + +export const Completed: Story<{}> = () => { + return ( + + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.tsx new file mode 100644 index 000000000000..1651f039bdbf --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_container/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { + RCA_END_PROCESS_TOOL_NAME, + RCA_INVESTIGATE_ENTITY_TOOL_NAME, + RCA_OBSERVE_TOOL_NAME, +} from '@kbn/observability-ai-common/root_cause_analysis'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiText, useEuiTheme } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { AssistantMessage, MessageRole, ToolMessage } from '@kbn/inference-common'; +import type { + RootCauseAnalysisEvent, + RootCauseAnalysisToolMessage, + RootCauseAnalysisToolRequest, + ToolErrorMessage, +} from '@kbn/observability-ai-server/root_cause_analysis'; +import { findLast } from 'lodash'; +import React from 'react'; +import { css } from '@emotion/css'; +import { EntityBadge } from '../entity_badge'; +import { RootCauseAnalysisCallout } from '../rca_callout'; +import { RootCauseAnalysisEntityInvestigation } from '../rca_entity_investigation'; +import { RootCauseAnalysisObservationPanel } from '../rca_observation_panel'; +import { RootCauseAnalysisReport } from '../rca_report'; +import { RootCauseAnalysisStepItem } from '../rca_step'; +import { RootCauseAnalysisStopButton } from '../rca_stop_button'; + +export function RootCauseAnalysisContainer({ + events, + completeInBackground, + onStartAnalysisClick, + onStopAnalysisClick, + onResetAnalysisClick, + onClearAnalysisClick, + onCompleteInBackgroundClick, + loading, + error, +}: { + events?: RootCauseAnalysisEvent[]; + completeInBackground: boolean; + onStartAnalysisClick: () => void; + onStopAnalysisClick: () => void; + onResetAnalysisClick: () => void; + onClearAnalysisClick: () => void; + onCompleteInBackgroundClick: () => void; + loading: boolean; + error?: Error; +}) { + const theme = useEuiTheme(); + + if (!events?.length && !loading && !error) { + return ( + + ); + } + + const elements: React.ReactElement[] = []; + + const toolResponsesById = new Map( + events + ?.filter( + (event): event is Extract => + event.role === MessageRole.Tool + ) + .map((event) => [event.toolCallId, event]) + ); + + events?.forEach((event) => { + if (event.role === MessageRole.Assistant) { + event.toolCalls.forEach((toolCall) => { + switch (toolCall.function.name) { + case RCA_OBSERVE_TOOL_NAME: + elements.push( + getObservationItem( + toolCall.function.arguments.title, + toolResponsesById.get(toolCall.toolCallId) + ) + ); + break; + + case RCA_INVESTIGATE_ENTITY_TOOL_NAME: + case RCA_END_PROCESS_TOOL_NAME: + const response = toolResponsesById.get(toolCall.toolCallId); + const element = response ? getToolResponseItem(response) : undefined; + if (element) { + elements.push(element); + } + break; + } + }); + } + }); + + const clearButton = ( + { + onClearAnalysisClick(); + }} + iconType="crossInCircle" + > + {i18n.translate('xpack.observabilityAiAssistant.rca.clearButtonLabel', { + defaultMessage: 'Clear', + })} + + ); + + const restartButton = ( + { + onResetAnalysisClick(); + }} + iconType="refresh" + > + {i18n.translate('xpack.observabilityAiAssistant.rca.restartButtonLabel', { + defaultMessage: 'Restart', + })} + + ); + + if (loading) { + const label = getLoadingLabel(events); + elements.push( + { + onStopAnalysisClick(); + }} + /> + ) + } + loading + /> + ); + } else if (error) { + elements.push( + + {clearButton} + {restartButton} +
+ } + /> + ); + } else { + // completed + elements.push( + + {i18n.translate('xpack.observabilityAiAssistant.rca.analysisCompleted', { + defaultMessage: 'Completed analysis', + })} + + } + iconType="checkInCircleFilled" + color="primary" + button={ + + {clearButton} + {restartButton} + + } + /> + ); + } + + return ( + + {elements.map((element, index) => { + return React.cloneElement(element, { key: index }); + })} + + ); +} + +function getLoadingLabel(events?: RootCauseAnalysisEvent[]) { + const lastAssistantMessage = findLast( + events, + (event): event is Extract => + event.role === MessageRole.Assistant + ); + + if (lastAssistantMessage) { + const toolResponsesByToolCallId = new Map( + events + ?.filter( + (event): event is Extract => + event.role === MessageRole.Tool + ) + .map((event) => [event.toolCallId, event]) + ); + const pendingToolCalls = lastAssistantMessage.toolCalls.filter((event) => { + const response = toolResponsesByToolCallId.get(event.toolCallId); + + return !response; + }); + + const allInvestigateEntityToolCalls = pendingToolCalls.filter( + (event): event is RootCauseAnalysisToolRequest => + event.function.name === RCA_INVESTIGATE_ENTITY_TOOL_NAME + ); + + if (allInvestigateEntityToolCalls.length) { + return ( + + + {i18n.translate('xpack.observabilityAiAssistant.rca.investigatingEntitiesTextLabel', { + defaultMessage: 'Investigating entities', + })} + + + + {allInvestigateEntityToolCalls.map((toolCall) => { + return ( + + + + ); + })} + + + + ); + } + + if (pendingToolCalls[0]?.function.name === RCA_END_PROCESS_TOOL_NAME) { + return i18n.translate('xpack.observabilityAiAssistant.rca.finalizingReport', { + defaultMessage: 'Finalizing report', + }); + } + } + + return i18n.translate('xpack.observabilityAiAssistant.rca.analysisLoadingLabel', { + defaultMessage: 'Thinking...', + }); +} + +function getToolResponseErrorItem(response: ToolErrorMessage['response']) { + return ( + + ); +} + +function getToolResponseItem( + message: RootCauseAnalysisToolMessage | ToolErrorMessage +): React.ReactElement | null { + if (message.name === 'observe') { + return null; + } + + if (message.name === 'error') { + return getToolResponseErrorItem(message.response); + } + + if (message.name === 'investigateEntity') { + return ( + + ); + } + + return ( + + ); +} + +function getObservationItem( + title: React.ReactNode, + toolResponse?: RootCauseAnalysisToolMessage | ToolErrorMessage +) { + let content: string | undefined; + switch (toolResponse?.name) { + case 'observe': + content = toolResponse.response.content; + break; + + case 'error': + content = i18n.translate('xpack.observabilityAiAssistant.rca.failedObservation', { + defaultMessage: 'Failed to generate observations', + }); + break; + } + + return ( + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/index.stories.tsx new file mode 100644 index 000000000000..0601a0cdf1f6 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { RootCauseAnalysisEntityInvestigation } from '.'; +import { controllerEntityHealthAnalysis } from '../mock'; + +const stories: Meta<{}> = { + title: 'RCA/EntityInvestigation', + component: RootCauseAnalysisEntityInvestigation, +}; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/index.tsx new file mode 100644 index 000000000000..b74f5969fa08 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_investigation/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 { EuiFlexGroup, EuiFlexItem, EuiMarkdownFormat, EuiPanel, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import type { EntityInvestigation } from '@kbn/observability-ai-server/root_cause_analysis/tasks/investigate_entity/types'; +import React from 'react'; +import { EntityBadge } from '../entity_badge'; +import { RootCauseAnalysisCollapsiblePanel } from '../rca_collapsible_panel'; +import { RootCauseAnalysisEntityLogPatternTable } from '../rca_entity_log_pattern_table'; + +export function RootCauseAnalysisEntityInvestigation({ + summary, + entity, + ownPatterns, + patternsFromOtherEntities, +}: { + summary: string; + entity: Record; +} & Pick) { + return ( + + +

+ {i18n.translate( + 'xpack.observabilityAiAssistant.rootCauseAnalysisEntityInvestigation.title', + { + defaultMessage: 'Investigation', + } + )} +

+
+ + + +
+ } + content={ + + + {summary} + + + + } + /> + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.stories.tsx new file mode 100644 index 000000000000..16596832eff8 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { RootCauseAnalysisEntityLogPatternTable } from '.'; +import { controllerEntityHealthAnalysis } from '../mock'; + +const stories: Meta<{}> = { + title: 'RCA/EntityLogPatternTable', + component: RootCauseAnalysisEntityLogPatternTable, +}; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.tsx new file mode 100644 index 000000000000..10d78eef6d47 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_entity_log_pattern_table/index.tsx @@ -0,0 +1,299 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, + EuiBasicTable, + EuiBasicTableColumn, + EuiCheckbox, + EuiFlexGroup, + EuiFlexItem, + EuiText, + EuiThemeComputed, +} from '@elastic/eui'; +import { css } from '@emotion/css'; +import { i18n } from '@kbn/i18n'; +import { formatInteger } from '@kbn/observability-utils-common/format/integer'; +import { highlightPatternFromRegex } from '@kbn/observability-utils-common/llm/log_analysis/highlight_patterns_from_regex'; +import type { EntityInvestigation } from '@kbn/observability-ai-server/root_cause_analysis/tasks/investigate_entity/types'; +import React, { useMemo, useState } from 'react'; +import { orderBy } from 'lodash'; +import type { AnalyzedLogPattern } from '@kbn/observability-ai-server/root_cause_analysis/tasks/analyze_log_patterns'; +import { useTheme } from '../../../hooks/use_theme'; +import { SparkPlot } from '../../charts/spark_plot'; + +const badgeClassName = css` + width: 100%; + .euiBadge__content { + justify-content: center; + } +`; + +const PER_PAGE = 5; + +export function RootCauseAnalysisEntityLogPatternTable({ + entity, + ownPatterns, + patternsFromOtherEntities, +}: Pick & { + entity: Record; +}) { + const theme = useTheme(); + + const [showUsualPatterns, setShowUsualPatterns] = useState(false); + + const [pageIndex, setPageIndex] = useState(0); + + const columns = useMemo((): Array> => { + return [ + { + field: 'relevance', + name: '', + width: '128px', + render: (_, { relevance, metadata }) => { + const color = getRelevanceColor(relevance); + + return ( + + {relevance} + + ); + }, + }, + { + field: 'pattern', + name: i18n.translate( + 'xpack.observabilityAiAssistant.rca.logPatternTable.messageColumnTitle', + { defaultMessage: 'Message' } + ), + render: (_, { regex, sample }) => { + return ( + + ); + }, + }, + { + field: 'count', + name: i18n.translate( + 'xpack.observabilityAiAssistant.rca.logPatternTable.countColumnTitle', + { defaultMessage: 'Count' } + ), + width: '96px', + render: (_, { count }) => { + return ( + + {formatInteger(count)} + + ); + }, + }, + { + field: 'change', + name: i18n.translate( + 'xpack.observabilityAiAssistant.rca.logPatternTable.changeColumnTitle', + { defaultMessage: 'Change' } + ), + width: '128px', + render: (_, { change }) => { + return getChangeBadge(change); + }, + }, + { + field: 'timeseries', + width: '128px', + name: i18n.translate( + 'xpack.observabilityAiAssistant.rca.logPatternTable.trendColumnTitle', + { defaultMessage: 'Trend' } + ), + render: (_, { timeseries, change }) => { + return ( + + ); + }, + }, + ]; + }, [theme]); + + const allPatterns = useMemo(() => { + return [...ownPatterns, ...patternsFromOtherEntities]; + }, [ownPatterns, patternsFromOtherEntities]); + + const items = useMemo(() => { + return allPatterns.filter((pattern) => { + if (!showUsualPatterns) { + return pattern.relevance !== 'normal'; + } + return pattern; + }); + }, [allPatterns, showUsualPatterns]); + + const visibleItems = useMemo(() => { + const start = pageIndex * PER_PAGE; + return orderBy(items, (item) => relevanceToInt(item.relevance), 'desc').slice( + start, + start + PER_PAGE + ); + }, [pageIndex, items]); + + const paginationOptions = useMemo(() => { + return { + pageIndex, + totalItemCount: items.length, + pageSize: PER_PAGE, + }; + }, [pageIndex, items.length]); + + return ( + + + + + {i18n.translate( + 'xpack.observabilityAiAssistant.rootCauseAnalysisEntityInvestigation.logPatternsTableTitle', + { + defaultMessage: 'Showing {count} of {total} log patterns', + values: { + total: items.length, + count: visibleItems.length, + }, + } + )} + + + + + { + setShowUsualPatterns((prev) => !prev); + }} + /> + + {i18n.translate( + 'xpack.observabilityAiAssistant.rca.logPatternTable.showUsualPatternsCheckbox', + { + defaultMessage: 'Show unremarkable patterns', + } + )} + + + + + { + setPageIndex(criteria.page.index); + }} + /> + + ); +} + +function getRelevanceColor(relevance: 'normal' | 'unusual' | 'warning' | 'critical') { + switch (relevance) { + case 'normal': + return 'plain'; + + case 'critical': + return 'danger'; + + case 'warning': + return 'warning'; + + case 'unusual': + return 'primary'; + } +} + +function getSignificanceColor(significance: 'high' | 'medium' | 'low' | null) { + switch (significance) { + case 'high': + return 'danger'; + + case 'medium': + return 'warning'; + + case 'low': + case null: + return 'plain'; + } +} + +function relevanceToInt(relevance: 'normal' | 'unusual' | 'warning' | 'critical') { + switch (relevance) { + case 'normal': + return 0; + case 'unusual': + return 1; + case 'warning': + return 2; + case 'critical': + return 3; + } +} + +function getAnnotationsFromChangePoint({ + change, + theme, + timeseries, +}: { + change: AnalyzedLogPattern['change']; + theme: EuiThemeComputed<{}>; + timeseries: Array<{ x: number; y: number }>; +}): Required['annotations']> { + if (!change.change_point || !change.type) { + return []; + } + + const color = getSignificanceColor(change.significance); + + return [ + { + color: color === 'plain' ? theme.colors.subduedText : theme.colors[color], + id: '1', + icon: '*', + label: {change.type}, + x: timeseries[change.change_point].x, + }, + ]; +} + +export function getChangeBadge(change: AnalyzedLogPattern['change']) { + return ( + + {change.significance ?? 'No change'} + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.stories.tsx new file mode 100644 index 000000000000..5ec46729e7c7 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { RootCauseAnalysisObservationPanel } from '.'; + +const stories: Meta<{}> = { + title: 'RCA/ObservationPanel', + component: RootCauseAnalysisObservationPanel, +}; + +const content = + 'The high rate of HTTP 500 errors in the controller service for the /api/cart endpoint is likely due to issues with the upstream service default-my-otel-demo-frontendproxy-8080, as indicated by logs showing upstream prematurely closed connections. The next step is to investigate the health and performance of the upstream service default-my-otel-demo-frontendproxy-8080.'; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + + ); +}; + +export const Loading: Story<{}> = () => { + return ( + + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.tsx new file mode 100644 index 000000000000..ee00f568ca68 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_observation_panel/index.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 { + EuiFlexGroup, + EuiFlexItem, + EuiLoadingSpinner, + EuiMarkdownFormat, + EuiText, + EuiTitle, + useEuiTheme, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { css } from '@emotion/css'; +import { RootCauseAnalysisCollapsiblePanel } from '../rca_collapsible_panel'; + +export function RootCauseAnalysisObservationPanel({ + content, + title, + loading, +}: { + content?: string; + title: React.ReactNode; + loading?: boolean; +}) { + const theme = useEuiTheme().euiTheme; + return ( + + +

+ {i18n.translate('xpack.observabilityAiAssistant.rca.observationPanelTitle', { + defaultMessage: 'Observations', + })} +

+
+ + + + {title} + + {loading ? : null} + + +
+ } + color="success" + content={content ? {content} : null} + /> + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/index.tsx new file mode 100644 index 000000000000..2ad1225a10f7 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_panel/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 { EuiPanel } from '@elastic/eui'; +import { css } from '@emotion/css'; +import { rgba } from 'polished'; +import React from 'react'; +import { useTheme } from '../../../hooks/use_theme'; + +export function RootCauseAnalysisPanel({ + children, + color, +}: { + children: React.ReactElement; + color?: React.ComponentProps['color']; +}) { + const theme = useTheme(); + + const panelClassName = + color && color !== 'transparent' && color !== 'plain' && color !== 'subdued' + ? css` + border: 1px solid; + border-color: ${rgba(theme.colors[color], 0.25)}; + ` + : undefined; + + return ( + + {children} + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.stories.tsx new file mode 100644 index 000000000000..cb32631fc7a7 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { RootCauseAnalysisReport } from '.'; + +const report = + '## 1. Understanding the Context and Hypothesis\n\n### Context:\n- **Issue:** High rate of HTTP 500 errors for the `/api/cart` endpoint in the `controller` service.\n- **Objective:** Investigate internal issues or anomalies that could explain the alert.\n\n### Hypothesis:\n- The high rate of HTTP 500 errors could be due to internal issues within the `controller` service, such as resource exhaustion, misconfigurations, or upstream service failures.\n\n## 2. Entity Overview\n\n### Entity: `controller`\n- **Environment:** Kubernetes pod, running in `opentelemetry-demo`\n- **Language:** Not specified\n- **Communication:** HTTP\n- **Cloud Provider:** Not specified, but running on `minikube`\n\n## 3. Identifying Related Entities\n\n### Upstream Dependencies:\n- **Upstream Service:** `default-my-otel-demo-frontendproxy-8080`\n - **Evidence:** Log entries show frequent API calls to `default-my-otel-demo-frontendproxy-8080` for various endpoints, including `/api/cart`.\n\n### Downstream Dependencies:\n- **Downstream Service:** Not explicitly mentioned, but the `controller` service is likely serving multiple endpoints, including `/api/cart`.\n\n### Infrastructure:\n- **Pod:** `ingress-nginx-controller-bc57996ff-qrd25`\n - **Evidence:** Logs and metadata indicate the `controller` service is running in this pod.\n\n## 4. Health Status Assessment\n\n### Active Alerts:\n- **Alert:** Custom threshold alert for HTTP 500 errors on `/api/cart` endpoint.\n - **Reason:** Custom equation is 100, above the threshold of 5.\n - **Duration:** 1 min\n - **Data View:** logs-*\n - **Group:** `controller`, `/api/cart`\n - **Evaluation Values:** [100]\n - **Threshold:** [5]\n - **Status:** Active\n - **Start Time:** 2024-10-21T08:51:51.846Z\n\n### SLO Performance:\n- **No SLOs** specified for this entity.\n\n### Log Patterns and Anomalies:\n- **Normal Logs:**\n - Logs show normal GET and POST requests with HTTP 200 responses.\n- **Critical Logs:**\n - Logs indicate upstream prematurely closed connection while reading upstream, leading to HTTP 500 errors.\n - Example: `2024/10/21 08:37:11 [error] 36#36: *3518505 upstream prematurely closed connection while reading upstream, client: 10.244.0.117, server: otel-demo.internal, request: "POST /flagservice/flagd.evaluation.v1.Service/EventStream HTTP/1.1", upstream: "http://10.244.0.119:8080/flagservice/flagd.evaluation.v1.Service/EventStream", host: "ingress-nginx-controller.ingress-nginx.svc.cluster.local", referrer: "http://ingress-nginx-controller.ingress-nginx.svc.cluster.local/cart"`\n\n## 5. Relevance of Entity to the Investigation\n\n### Relevance:\n- The `controller` service is directly related to the investigation due to the elevated HTTP 500 error rate on the `/api/cart` endpoint.\n- The critical log entries suggest that the issue might be related to upstream service failures, specifically the `default-my-otel-demo-frontendproxy-8080` service.\n\n### Signs Aligning with Hypothesis:\n- **Resource Exhaustion:** Not explicitly indicated in the logs, but the high rate of HTTP 500 errors could be a symptom.\n- **Upstream Service Failures:** Logs indicate upstream prematurely closed connections, which aligns with the hypothesis of upstream service issues.\n\n## 6. Timeline of Significant Events\n\n### Timeline:\n1. **2024-10-21T08:37:11.050Z:** Critical log entry indicating upstream prematurely closed connection while reading upstream.\n2. **2024-10-21T08:51:51.846Z:** Alert for high rate of HTTP 500 errors on `/api/cart` endpoint becomes active.\n3. **2024-10-21T09:34:52.720Z:** Alert status remains active with a custom equation value of 100, above the threshold of 5.\n\n## 7. Next Steps or Root Cause Identification\n\n### Next Steps:\n1. **Investigate Upstream Service (`default-my-otel-demo-frontendproxy-8080`):**\n - Check the health and performance of the upstream service.\n - Look for any signs of resource exhaustion, connection issues, or misconfigurations.\n2. **Review Recent Changes:**\n - Check for any recent deployments or configuration changes in the `controller` service and its upstream dependencies.\n3. **Analyze Resource Usage:**\n - Monitor CPU, memory, and network usage for the `controller` service to identify any resource-related issues.\n\n### Potential Root Cause:\n- **Upstream Service Failures:** The critical log entries indicating upstream prematurely closed connections suggest that the root cause might be related to issues in the upstream service (`default-my-otel-demo-frontendproxy-8080`), leading to HTTP 500 errors in the `controller` service.\n\nBy following these steps, we can further narrow down the root cause and take appropriate actions to resolve the issue.'; + +const stories: Meta<{}> = { + title: 'RCA/Report', + component: RootCauseAnalysisReport, +}; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.tsx new file mode 100644 index 000000000000..cd793786eb6c --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_report/index.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 React from 'react'; +import { i18n } from '@kbn/i18n'; +import { + EuiFlexGroup, + EuiHorizontalRule, + EuiMarkdownFormat, + EuiPanel, + EuiTitle, +} from '@elastic/eui'; +import type { SignificantEventsTimeline } from '@kbn/observability-ai-server/root_cause_analysis'; + +export function RootCauseAnalysisReport({ + report, + timeline, +}: { + report: string; + timeline: SignificantEventsTimeline; +}) { + return ( + + + + +

+ {i18n.translate('xpack.observabilityAiAssistant.rootCauseAnalysisReport.title', { + defaultMessage: 'Report', + })} +

+
+
+
+ + {report} +
+ ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/index.stories.tsx new file mode 100644 index 000000000000..fa5b18480021 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { EuiBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { RootCauseAnalysisStepItem } from '.'; + +const stories: Meta<{}> = { + title: 'RCA/StepItem', + component: RootCauseAnalysisStepItem, +}; + +export default stories; + +export const Default: Story<{}> = () => { + return ( + + Investigating + service.name:controller +
+ } + /> + ); +}; + +export const Loading: Story<{}> = () => { + return ( + + Investigating + service.name:controller + + } + /> + ); +}; + +export const WithColor: Story<{}> = () => { + return ( + + Investigating + service.name:controller + + } + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/index.tsx new file mode 100644 index 000000000000..d887c75c1b4a --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_step/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, + EuiIcon, + EuiLoadingSpinner, + EuiPanel, + EuiText, +} from '@elastic/eui'; +import { css } from '@emotion/css'; +import React from 'react'; +import { RootCauseAnalysisPanel } from '../rca_panel'; + +export interface RootCauseAnalysisStepItemProps { + label: React.ReactNode; + loading?: boolean; + color?: React.ComponentProps['color']; + button?: React.ReactElement; + iconType?: React.ComponentProps['type']; +} + +export function RootCauseAnalysisStepItem({ + label, + loading, + color, + iconType, + button, +}: RootCauseAnalysisStepItemProps) { + return ( + + + + + {loading ? ( + + ) : ( + + )} + + + + + {label} + + + {button ? {button} : null} + + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_stop_button/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_stop_button/index.tsx new file mode 100644 index 000000000000..7ef0b175b636 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_stop_button/index.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 React from 'react'; +import { i18n } from '@kbn/i18n'; +import { EuiButton } from '@elastic/eui'; + +export function RootCauseAnalysisStopButton({ onClick }: { onClick: () => void }) { + return ( + { + onClick(); + }} + iconType="stopFilled" + color="text" + > + {i18n.translate('xpack.observabilityAiAssistant.rca.stopAnalysisButtonLabel', { + defaultMessage: 'Stop', + })} + + ); +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/index.stories.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/index.stories.tsx new file mode 100644 index 000000000000..4bc31dcf7cc4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/index.stories.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 { Meta, Story } from '@storybook/react'; +import React from 'react'; +import { EuiBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import { RootCauseAnalysisTaskStepItem } from '.'; +import { EntityBadge } from '../entity_badge'; + +const stories: Meta<{}> = { + title: 'RCA/TaskStepItem', + component: RootCauseAnalysisTaskStepItem, +}; + +export default stories; + +export const Pending: Story<{}> = () => { + return ( + + Investigating + + + + + } + /> + ); +}; + +export const Completed: Story<{}> = () => { + return ( + + Completed investigation + + + + + } + /> + ); +}; + +export const Failure: Story<{}> = () => { + return ( + + Failed investigating + service.name:controller + + } + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/index.tsx new file mode 100644 index 000000000000..b29d8a834745 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/rca/rca_task_step/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 React from 'react'; +import { RootCauseAnalysisStepItem } from '../rca_step'; + +export function RootCauseAnalysisTaskStepItem({ + label, + status, +}: { + label: React.ReactNode; + status: 'pending' | 'completed' | 'failure'; +}) { + let color: React.ComponentProps['color']; + let iconType: React.ComponentProps['iconType']; + + let loading: boolean | undefined; + + if (status === 'failure') { + color = 'danger'; + iconType = 'alert'; + } else if (status === 'completed') { + color = 'success'; + iconType = 'checkInCircleFilled'; + } else { + color = 'primary'; + loading = true; + } + + return ( + + ); +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/technical_preview_badge.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/technical_preview_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/components/technical_preview_badge.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/components/technical_preview_badge.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/changes/index.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/changes/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/changes/index.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/changes/index.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/lens.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/lens.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/lens.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/lens.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/visualize_esql.test.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/visualize_esql.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/visualize_esql.test.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/visualize_esql.test.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/visualize_esql.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/visualize_esql.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/functions/visualize_esql.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/functions/visualize_esql.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_kibana.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_kibana.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_license.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_license.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_license.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_license.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_app_service.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_app_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_app_service.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_app_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_chat_service.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_chat_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_chat_service.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_chat_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_router.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_router.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_router.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/__storybook_mocks__/use_observability_ai_assistant_router.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/is_nav_control_visible.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/is_nav_control_visible.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/is_nav_control_visible.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/is_nav_control_visible.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_chart_theme.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_chart_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_chart_theme.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_chart_theme.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_force_update.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_force_update.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_force_update.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_force_update.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_kibana.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_kibana.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_kibana.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_license.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_license.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_license.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_license.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_local_storage.test.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_local_storage.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_local_storage.test.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_local_storage.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_local_storage.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_local_storage.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_local_storage.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_local_storage.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_nav_control_scope.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_nav_control_scope.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_nav_control_scope.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_nav_control_scope.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_nav_control_screen_context.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_nav_control_screen_context.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_nav_control_screen_context.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_nav_control_screen_context.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_chat_service.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_chat_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_chat_service.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_chat_service.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_params.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_params.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_params.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_router.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_router.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_router.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_observability_ai_assistant_router.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_theme.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/hooks/use_theme.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/hooks/use_theme.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/index.ts new file mode 100644 index 000000000000..9fd8b9158f4c --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/public'; +import { ConfigSchema, ObservabilityAIAssistantAppPlugin } from './plugin'; +import type { + ObservabilityAIAssistantAppPluginSetupDependencies, + ObservabilityAIAssistantAppPluginStartDependencies, + ObservabilityAIAssistantAppPublicSetup, + ObservabilityAIAssistantAppPublicStart, +} from './types'; + +export type { ObservabilityAIAssistantAppPublicSetup, ObservabilityAIAssistantAppPublicStart }; + +export const plugin: PluginInitializer< + ObservabilityAIAssistantAppPublicSetup, + ObservabilityAIAssistantAppPublicStart, + ObservabilityAIAssistantAppPluginSetupDependencies, + ObservabilityAIAssistantAppPluginStartDependencies +> = (pluginInitializerContext: PluginInitializerContext) => + new ObservabilityAIAssistantAppPlugin(pluginInitializerContext); diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/plugin.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/plugin.tsx new file mode 100644 index 000000000000..218b663525db --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/plugin.tsx @@ -0,0 +1,169 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, { lazy } from 'react'; +import ReactDOM from 'react-dom'; +import { + type AppMountParameters, + DEFAULT_APP_CATEGORIES, + type CoreSetup, + type CoreStart, + type Plugin, + type PluginInitializerContext, +} from '@kbn/core/public'; +import type { Logger } from '@kbn/logging'; +import { i18n } from '@kbn/i18n'; +import { AI_ASSISTANT_APP_ID } from '@kbn/deeplinks-observability'; +import { createAppService, AIAssistantAppService } from '@kbn/ai-assistant'; +import { withSuspense } from '@kbn/shared-ux-utility'; +import type { + ObservabilityAIAssistantAppPluginSetupDependencies, + ObservabilityAIAssistantAppPluginStartDependencies, + ObservabilityAIAssistantAppPublicSetup, + ObservabilityAIAssistantAppPublicStart, +} from './types'; +import { getObsAIAssistantConnectorType } from './rule_connector'; +import { NavControlInitiator } from './components/nav_control/lazy_nav_control'; +import { SharedProviders } from './utils/shared_providers'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ConfigSchema {} + +export class ObservabilityAIAssistantAppPlugin + implements + Plugin< + ObservabilityAIAssistantAppPublicSetup, + ObservabilityAIAssistantAppPublicStart, + ObservabilityAIAssistantAppPluginSetupDependencies, + ObservabilityAIAssistantAppPluginStartDependencies + > +{ + logger: Logger; + appService: AIAssistantAppService | undefined; + isServerless: boolean; + + constructor(context: PluginInitializerContext) { + this.logger = context.logger.get(); + this.isServerless = context.env.packageInfo.buildFlavor === 'serverless'; + } + + setup( + coreSetup: CoreSetup, + _: ObservabilityAIAssistantAppPluginSetupDependencies + ): ObservabilityAIAssistantAppPublicSetup { + coreSetup.application.register({ + id: AI_ASSISTANT_APP_ID, + title: i18n.translate('xpack.observabilityAiAssistant.appTitle', { + defaultMessage: 'Observability AI Assistant', + }), + euiIconType: 'logoObservability', + appRoute: '/app/observabilityAIAssistant', + category: DEFAULT_APP_CATEGORIES.observability, + visibleIn: [], + deepLinks: [ + { + id: 'conversations', + title: i18n.translate('xpack.observabilityAiAssistant.conversationsDeepLinkTitle', { + defaultMessage: 'Conversations', + }), + path: '/conversations/new', + }, + ], + mount: async (appMountParameters: AppMountParameters) => { + // Load application bundle and Get start services + const [{ Application }, [coreStart, pluginsStart]] = await Promise.all([ + import('./application'), + coreSetup.getStartServices() as Promise< + [CoreStart, ObservabilityAIAssistantAppPluginStartDependencies, unknown] + >, + ]); + + ReactDOM.render( + , + appMountParameters.element + ); + + return () => { + ReactDOM.unmountComponentAtNode(appMountParameters.element); + }; + }, + }); + + return {}; + } + + start( + coreStart: CoreStart, + pluginsStart: ObservabilityAIAssistantAppPluginStartDependencies + ): ObservabilityAIAssistantAppPublicStart { + const appService = (this.appService = createAppService({ + pluginsStart, + })); + const isEnabled = appService.isEnabled(); + if (isEnabled) { + coreStart.chrome.navControls.registerRight({ + mount: (element) => { + ReactDOM.render( + , + element, + () => {} + ); + + return () => {}; + }, + // right before the user profile + order: 1001, + }); + } + + const service = pluginsStart.observabilityAIAssistant.service; + + service.register(async ({ registerRenderFunction }) => { + const { registerFunctions } = await import('./functions'); + + await registerFunctions({ pluginsStart, registerRenderFunction }); + }); + + const withProviders =

(Component: React.ComponentType

) => + React.forwardRef((props: P, ref: React.Ref) => ( + + + + )); + + const LazilyLoadedRootCauseAnalysisContainer = withSuspense( + withProviders( + lazy(() => + import('./components/rca/rca_container').then((m) => ({ + default: m.RootCauseAnalysisContainer, + })) + ) + ) + ); + + pluginsStart.triggersActionsUi.actionTypeRegistry.register( + getObsAIAssistantConnectorType(service) + ); + return { + RootCauseAnalysisContainer: LazilyLoadedRootCauseAnalysisContainer, + }; + } +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/routes/config.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/routes/config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/routes/config.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/routes/config.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/routes/conversations/conversation_view_with_props.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/routes/conversations/conversation_view_with_props.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/routes/conversations/conversation_view_with_props.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/routes/conversations/conversation_view_with_props.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/ai_assistant_params.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant_params.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/ai_assistant_params.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/ai_assistant_params.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/translations.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/translations.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/translations.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/types.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/rule_connector/types.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/rule_connector/types.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.ts new file mode 100644 index 000000000000..22bdf2b12236 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/types.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 type { LensPublicSetup, LensPublicStart } from '@kbn/lens-plugin/public'; +import type { + DataViewsPublicPluginSetup, + DataViewsPublicPluginStart, +} from '@kbn/data-views-plugin/public'; +import type { UiActionsSetup, UiActionsStart } from '@kbn/ui-actions-plugin/public'; +import type { + ObservabilityAIAssistantPublicSetup, + ObservabilityAIAssistantPublicStart, +} from '@kbn/observability-ai-assistant-plugin/public'; +import type { SharePluginSetup, SharePluginStart } from '@kbn/share-plugin/public'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/public'; +import type { + ObservabilitySharedPluginSetup, + ObservabilitySharedPluginStart, +} from '@kbn/observability-shared-plugin/public'; +import type { MlPluginSetup, MlPluginStart } from '@kbn/ml-plugin/public'; +import type { + TriggersAndActionsUIPublicPluginSetup, + TriggersAndActionsUIPublicPluginStart, +} from '@kbn/triggers-actions-ui-plugin/public'; +import type { DataPublicPluginStart } from '@kbn/data-plugin/public'; +import type { + AIAssistantManagementSelectionPluginPublicStart, + AIAssistantManagementSelectionPluginPublicSetup, +} from '@kbn/ai-assistant-management-plugin/public'; +import type { RootCauseAnalysisContainer } from './components/rca/rca_container'; + +export interface ObservabilityAIAssistantAppPublicStart { + RootCauseAnalysisContainer: React.ExoticComponent< + React.ComponentProps + >; +} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityAIAssistantAppPublicSetup {} + +export interface ObservabilityAIAssistantAppPluginStartDependencies { + licensing: LicensingPluginStart; + share: SharePluginStart; + lens: LensPublicStart; + dataViews: DataViewsPublicPluginStart; + uiActions: UiActionsStart; + observabilityAIAssistant: ObservabilityAIAssistantPublicStart; + observabilityShared: ObservabilitySharedPluginStart; + ml: MlPluginStart; + triggersActionsUi: TriggersAndActionsUIPublicPluginStart; + data: DataPublicPluginStart; + aiAssistantManagementSelection: AIAssistantManagementSelectionPluginPublicStart; +} + +export interface ObservabilityAIAssistantAppPluginSetupDependencies { + licensing: LicensingPluginSetup; + share: SharePluginSetup; + lens: LensPublicSetup; + dataViews: DataViewsPublicPluginSetup; + uiActions: UiActionsSetup; + observabilityAIAssistant: ObservabilityAIAssistantPublicSetup; + observabilityShared: ObservabilitySharedPluginSetup; + ml: MlPluginSetup; + triggersActionsUi: TriggersAndActionsUIPublicPluginSetup; + aiAssistantManagementSelection: AIAssistantManagementSelectionPluginPublicSetup; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/non_nullable.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/non_nullable.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/non_nullable.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/non_nullable.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/safe_json_parse.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/safe_json_parse.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/safe_json_parse.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/safe_json_parse.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/shared_providers.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/shared_providers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/public/utils/shared_providers.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/public/utils/shared_providers.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/.eslintrc.json b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/.eslintrc.json similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/.eslintrc.json rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/.eslintrc.json diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/README.md b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/README.md new file mode 100644 index 000000000000..f8d10c679e62 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/README.md @@ -0,0 +1,37 @@ +# Observability AI Assistant Evaluation Framework + +## Overview + +This tool is developed for our team working on the Elastic Observability platform, specifically focusing on evaluating the Observability AI Assistant. It simplifies scripting and evaluating various scenarios with the Large Language Model (LLM) integration. + +## Setup requirements + +- An Elasticsearch instance +- A Kibana instance +- At least one .gen-ai connector set up + +## Running evaluations + +Run the tool using: + +`$ node x-pack/solutions/observability/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/index.js` + +This will evaluate all existing scenarios, and write the evaluation results to the terminal. + +### Configuration + +#### Kibana and Elasticsearch + +By default, the tool will look for a Kibana instance running locally (at `http://localhost:5601`, which is the default address for running Kibana in development mode). It will also attempt to read the Kibana config file for the Elasticsearch address & credentials. If you want to override these settings, use `--kibana` and `--es`. Only basic auth is supported, e.g. `--kibana http://username:password@localhost:5601`. If you want to use a specific space, use `--spaceId` + +#### Connector + +Use `--connectorId` to specify a `.gen-ai` or `.bedrock` connector to use. If none are given, it will prompt you to select a connector based on the ones that are available. If only a single supported connector is found, it will be used without prompting. + +#### Persisting conversations + +By default, completed conversations are not persisted. If you do want to persist them, for instance for reviewing purposes, set the `--persist` flag to store them. This will also generate a clickable link in the output of the evaluation that takes you to the conversation. + +If you want to clear conversations on startup, use the `--clear` flag. This only works when `--persist` is enabled. If `--spaceId` is set, only conversations for the current space will be cleared. + +When storing conversations, the name of the scenario is used as a title. Set the `--autoTitle` flag to have the LLM generate a title for you. diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/alert_templates/templates.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/alert_templates/templates.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/alert_templates/templates.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/alert_templates/templates.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/cli.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/cli.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/cli.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/cli.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/evaluation.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/evaluation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/evaluation.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/evaluation.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/get_service_urls.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/get_service_urls.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/get_service_urls.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/get_service_urls.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/index.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/index.js similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/index.js rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/index.js diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.ts new file mode 100644 index 000000000000..e6a44cbb4a54 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/read_kibana_config.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 path from 'path'; +import fs from 'fs'; +import yaml from 'js-yaml'; +import { identity, pickBy } from 'lodash'; + +export type KibanaConfig = ReturnType; + +export const readKibanaConfig = () => { + const kibanaConfigDir = path.join(__filename, '../../../../../../../../config'); + const kibanaDevConfig = path.join(kibanaConfigDir, 'kibana.dev.yml'); + const kibanaConfig = path.join(kibanaConfigDir, 'kibana.yml'); + + const loadedKibanaConfig = (yaml.load( + fs.readFileSync(fs.existsSync(kibanaDevConfig) ? kibanaDevConfig : kibanaConfig, 'utf8') + ) || {}) as {}; + + const cliEsCredentials = pickBy( + { + 'elasticsearch.username': process.env.ELASTICSEARCH_USERNAME, + 'elasticsearch.password': process.env.ELASTICSEARCH_PASSWORD, + 'elasticsearch.hosts': process.env.ELASTICSEARCH_HOST, + }, + identity + ) as { + 'elasticsearch.username'?: string; + 'elasticsearch.password'?: string; + 'elasticsearch.hosts'?: string; + }; + + return { + 'elasticsearch.hosts': 'http://localhost:9200', + 'elasticsearch.username': 'elastic', + 'elasticsearch.password': 'changeme', + ...loadedKibanaConfig, + ...cliEsCredentials, + }; +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/alerts/index.spec.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/alerts/index.spec.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/alerts/index.spec.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/alerts/index.spec.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/apm/index.spec.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/apm/index.spec.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/apm/index.spec.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/apm/index.spec.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/elasticsearch/index.spec.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/elasticsearch/index.spec.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/elasticsearch/index.spec.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/elasticsearch/index.spec.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/esql/index.spec.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/esql/index.spec.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/esql/index.spec.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/esql/index.spec.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/kb/index.spec.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/kb/index.spec.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/scenarios/kb/index.spec.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/scenarios/kb/index.spec.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/select_connector.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/select_connector.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/select_connector.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/select_connector.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/services/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/services/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/services/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/services/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/setup_synthtrace.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/setup_synthtrace.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/setup_synthtrace.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/setup_synthtrace.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/types.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/scripts/evaluation/types.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/types.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/clients/create_observability_ai_assistant_app_es_client.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/clients/create_observability_ai_assistant_app_es_client.ts new file mode 100644 index 000000000000..babb6c127337 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/clients/create_observability_ai_assistant_app_es_client.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 { createObservabilityEsClient } from '@kbn/observability-utils-server/es/client/create_observability_es_client'; +import { ElasticsearchClient, Logger } from '@kbn/core/server'; + +export async function createObservabilityAIAssistantAppEsClient({ + client, + logger, +}: { + client: ElasticsearchClient; + logger: Logger; +}) { + const esClient = createObservabilityEsClient({ + client, + logger, + plugin: 'observabilityAIAssistantApp', + }); + + return esClient; +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/clients/elasticsearch/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/clients/elasticsearch/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/clients/elasticsearch/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/clients/elasticsearch/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/config.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/config.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/config.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/alerts.ts similarity index 95% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/alerts.ts index 5408dbbf4ab4..bf797bb17060 100644 --- a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/alerts.ts +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/alerts.ts @@ -196,17 +196,17 @@ export function registerAlertsFunction({ lte: end, }, }, - ...kqlQuery, - ...(!includeRecovered - ? [ - { - term: { - [ALERT_STATUS]: ALERT_STATUS_ACTIVE, - }, - }, - ] - : []), }, + ...kqlQuery, + ...(!includeRecovered + ? [ + { + term: { + [ALERT_STATUS]: ALERT_STATUS_ACTIVE, + }, + }, + ] + : []), ], }, }, diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/get_log_changes.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/get_log_changes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/get_log_changes.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/get_log_changes.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/get_metric_changes.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/get_metric_changes.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/get_metric_changes.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/get_metric_changes.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/changes/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/changes/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/documentation.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/documentation.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/documentation.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/lens.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/lens.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/lens.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/lens.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.test.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.test.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/correct_query_with_actions.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.test.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.test.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/get_errors_with_commands.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/validate_esql_query.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/validate_esql_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/query/validate_esql_query.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/query/validate_esql_query.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/visualize_esql.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/visualize_esql.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/functions/visualize_esql.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/functions/visualize_esql.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/plugin.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/plugin.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/convert_schema_to_open_api.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/convert_schema_to_open_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/convert_schema_to_open_api.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/convert_schema_to_open_api.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/index.test.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/index.test.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.test.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_app/server/rule_connector/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/rule_connector/index.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/types.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/types.ts new file mode 100644 index 000000000000..cd9f578d9909 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/types.ts @@ -0,0 +1,81 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import type { + PluginSetupContract as ActionsPluginSetup, + PluginStartContract as ActionsPluginStart, +} from '@kbn/actions-plugin/server'; +import type { AlertingServerSetup, AlertingServerStart } from '@kbn/alerting-plugin/server'; +import type { + DataViewsServerPluginSetup, + DataViewsServerPluginStart, +} from '@kbn/data-views-plugin/server'; +import type { FeaturesPluginStart, FeaturesPluginSetup } from '@kbn/features-plugin/server'; +import type { LicensingPluginSetup, LicensingPluginStart } from '@kbn/licensing-plugin/server'; +import type { + ObservabilityAIAssistantServerSetup, + ObservabilityAIAssistantServerStart, +} from '@kbn/observability-ai-assistant-plugin/server'; +import type { + RuleRegistryPluginSetupContract, + RuleRegistryPluginStartContract, +} from '@kbn/rule-registry-plugin/server'; +import type { ServerlessPluginSetup, ServerlessPluginStart } from '@kbn/serverless/server'; +import type { + TaskManagerSetupContract, + TaskManagerStartContract, +} from '@kbn/task-manager-plugin/server'; +import type { CloudSetup, CloudStart } from '@kbn/cloud-plugin/server'; +import type { SecurityPluginSetup, SecurityPluginStart } from '@kbn/security-plugin/server'; +import type { ObservabilityPluginSetup } from '@kbn/observability-plugin/server'; +import type { InferenceServerStart, InferenceServerSetup } from '@kbn/inference-plugin/server'; +import type { LogsDataAccessPluginStart } from '@kbn/logs-data-access-plugin/server'; +import type { LlmTasksPluginStart } from '@kbn/llm-tasks-plugin/server'; +import type { SLOServerStart, SLOServerSetup } from '@kbn/slo-plugin/server'; +import type { SpacesPluginStart, SpacesPluginSetup } from '@kbn/spaces-plugin/server'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityAIAssistantAppServerStart {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ObservabilityAIAssistantAppServerSetup {} + +export interface ObservabilityAIAssistantAppPluginStartDependencies { + observabilityAIAssistant: ObservabilityAIAssistantServerStart; + ruleRegistry: RuleRegistryPluginStartContract; + alerting: AlertingServerStart; + licensing: LicensingPluginStart; + actions: ActionsPluginStart; + security: SecurityPluginStart; + features: FeaturesPluginStart; + taskManager: TaskManagerStartContract; + dataViews: DataViewsServerPluginStart; + cloud?: CloudStart; + serverless?: ServerlessPluginStart; + inference: InferenceServerStart; + logsDataAccess: LogsDataAccessPluginStart; + slo: SLOServerStart; + spaces: SpacesPluginStart; + llmTasks: LlmTasksPluginStart; +} + +export interface ObservabilityAIAssistantAppPluginSetupDependencies { + observabilityAIAssistant: ObservabilityAIAssistantServerSetup; + ruleRegistry: RuleRegistryPluginSetupContract; + alerting: AlertingServerSetup; + licensing: LicensingPluginSetup; + actions: ActionsPluginSetup; + security: SecurityPluginSetup; + features: FeaturesPluginSetup; + taskManager: TaskManagerSetupContract; + dataViews: DataViewsServerPluginSetup; + observability: ObservabilityPluginSetup; + cloud?: CloudSetup; + serverless?: ServerlessPluginSetup; + inference: InferenceServerSetup; + slo: SLOServerSetup; + spaces: SpacesPluginSetup; +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/util/get_log_sources.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/util/get_log_sources.ts new file mode 100644 index 000000000000..6532e686a2eb --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/server/util/get_log_sources.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. + */ + +import { IUiSettingsClient } from '@kbn/core/server'; +import { OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID } from '@kbn/management-settings-ids'; + +export function getLogSources({ uiSettings }: { uiSettings: IUiSettingsClient }) { + return uiSettings.get(OBSERVABILITY_LOGS_DATA_ACCESS_LOG_SOURCES_ID) as Promise; +} diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json new file mode 100644 index 000000000000..7e3de7940f22 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_app/tsconfig.json @@ -0,0 +1,87 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../typings/**/*", + "common/**/*", + "public/**/*", + "scripts/**/*", + "typings/**/*", + "public/**/*.json", + "server/**/*", + ".storybook/**/*.tsx" + ], + "kbn_references": [ + "@kbn/es-types", + "@kbn/observability-ai-assistant-plugin", + "@kbn/field-formats-plugin", + "@kbn/core", + "@kbn/typed-react-router-config", + "@kbn/i18n", + "@kbn/management-settings-ids", + "@kbn/triggers-actions-ui-plugin", + "@kbn/shared-ux-utility", + "@kbn/data-views-plugin", + "@kbn/lens-embeddable-utils", + "@kbn/lens-plugin", + "@kbn/expressions-plugin", + "@kbn/ui-actions-plugin", + "@kbn/esql-utils", + "@kbn/visualization-utils", + "@kbn/ai-assistant-management-plugin", + "@kbn/kibana-react-plugin", + "@kbn/licensing-plugin", + "@kbn/logging", + "@kbn/deeplinks-observability", + "@kbn/share-plugin", + "@kbn/observability-shared-plugin", + "@kbn/ml-plugin", + "@kbn/data-plugin", + "@kbn/react-kibana-context-theme", + "@kbn/shared-ux-link-redirect-app", + "@kbn/dev-cli-runner", + "@kbn/tooling-log", + "@kbn/babel-register", + "@kbn/expect", + "@kbn/apm-synthtrace-client", + "@kbn/alerting-plugin", + "@kbn/apm-synthtrace", + "@kbn/esql-datagrid", + "@kbn/alerting-comparators", + "@kbn/core-lifecycle-browser", + "@kbn/inference-plugin", + "@kbn/ai-assistant", + "@kbn/apm-utils", + "@kbn/config-schema", + "@kbn/es-query", + "@kbn/rule-registry-plugin", + "@kbn/esql-validation-autocomplete", + "@kbn/esql-ast", + "@kbn/field-types", + "@kbn/security-plugin", + "@kbn/observability-plugin", + "@kbn/actions-plugin", + "@kbn/stack-connectors-plugin", + "@kbn/features-plugin", + "@kbn/serverless", + "@kbn/task-manager-plugin", + "@kbn/cloud-plugin", + "@kbn/logs-data-access-plugin", + "@kbn/ai-assistant-common", + "@kbn/observability-utils-server", + "@kbn/observability-utils-common", + "@kbn/slo-plugin", + "@kbn/spaces-plugin", + "@kbn/data-service", + "@kbn/inference-common", + "@kbn/observability-ai-server", + "@kbn/observability-ai-common", + "@kbn/llm-tasks-plugin", + "@kbn/product-doc-common", + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/README.md b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/README.md similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/README.md rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/README.md diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/common/ui_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/common/ui_settings.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/common/ui_settings.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_management/jest.config.js b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/jest.config.js new file mode 100644 index 000000000000..99b1d23eb5bd --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/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 = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/observability_ai_assistant_management'], + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/observability_ai_assistant_management/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/kibana.jsonc b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/kibana.jsonc rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/app.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/app.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/constants.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/constants.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/constants.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/context/app_context.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/context/app_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/context/app_context.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/context/app_context.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/helpers/categorize_entries.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/helpers/categorize_entries.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/helpers/categorize_entries.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/helpers/categorize_entries.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/helpers/test_helper.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/helpers/test_helper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/helpers/test_helper.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/helpers/test_helper.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_app_context.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_app_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_app_context.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_app_context.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_entry.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_entry.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_entry.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_entry.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_user_instruction.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_user_instruction.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_user_instruction.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_create_knowledge_base_user_instruction.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_delete_knowledge_base_entry.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_delete_knowledge_base_entry.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_delete_knowledge_base_entry.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_delete_knowledge_base_entry.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_knowledge_base_entries.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_knowledge_base_entries.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_knowledge_base_entries.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_knowledge_base_entries.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_product_doc_status.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_user_instructions.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_user_instructions.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_get_user_instructions.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_get_user_instructions.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_import_knowledge_base_entries.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_import_knowledge_base_entries.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_import_knowledge_base_entries.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_import_knowledge_base_entries.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_install_product_doc.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_install_product_doc.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_install_product_doc.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_install_product_doc.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_kibana.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_kibana.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_kibana.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_kibana.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_observability_management_params.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_observability_management_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_observability_management_params.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_observability_management_params.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_observability_management_router.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_observability_management_router.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_observability_management_router.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_observability_management_router.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_uninstall_product_doc.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_uninstall_product_doc.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/hooks/use_uninstall_product_doc.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/hooks/use_uninstall_product_doc.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/plugin.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/plugin.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_category_flyout.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_category_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_category_flyout.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_category_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_manual_entry_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_user_instruction_flyout.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_user_instruction_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_user_instruction_flyout.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_edit_user_instruction_flyout.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.test.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.test.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.test.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_tab.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/redirect_to_home_if_unauthorized.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/redirect_to_home_if_unauthorized.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/redirect_to_home_if_unauthorized.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/redirect_to_home_if_unauthorized.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/search_connector_tab.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_page.test.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_page.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_page.test.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_page.test.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_page.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_page.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_page.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/product_doc_entry.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/product_doc_entry.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/product_doc_entry.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/product_doc_entry.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.test.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/settings_tab.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/settings_tab/ui_settings.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/config.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/public/routes/config.tsx rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/config.tsx diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/server/config.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/server/config.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/config.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/server/index.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/server/index.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/index.ts diff --git a/x-pack/plugins/observability_solution/observability_ai_assistant_management/server/plugin.ts b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/observability_ai_assistant_management/server/plugin.ts rename to x-pack/solutions/observability/plugins/observability_ai_assistant_management/server/plugin.ts diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_management/tsconfig.json b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/tsconfig.json new file mode 100644 index 000000000000..982fda386cc1 --- /dev/null +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/home-plugin", + "@kbn/kibana-react-plugin", + "@kbn/management-plugin", + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/typed-react-router-config", + "@kbn/core-chrome-browser", + "@kbn/observability-ai-assistant-plugin", + "@kbn/serverless", + "@kbn/management-settings-components-field-row", + "@kbn/observability-shared-plugin", + "@kbn/config-schema", + "@kbn/core-ui-settings-common", + "@kbn/logs-data-access-plugin", + "@kbn/core-plugins-browser", + "@kbn/ai-assistant", + "@kbn/core-plugins-server", + "@kbn/product-doc-base-plugin" + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/x-pack/plugins/serverless_observability/.gitignore b/x-pack/solutions/observability/plugins/serverless_observability/.gitignore similarity index 100% rename from x-pack/plugins/serverless_observability/.gitignore rename to x-pack/solutions/observability/plugins/serverless_observability/.gitignore diff --git a/x-pack/plugins/serverless_observability/README.mdx b/x-pack/solutions/observability/plugins/serverless_observability/README.mdx similarity index 100% rename from x-pack/plugins/serverless_observability/README.mdx rename to x-pack/solutions/observability/plugins/serverless_observability/README.mdx diff --git a/x-pack/plugins/serverless_observability/common/index.ts b/x-pack/solutions/observability/plugins/serverless_observability/common/index.ts similarity index 100% rename from x-pack/plugins/serverless_observability/common/index.ts rename to x-pack/solutions/observability/plugins/serverless_observability/common/index.ts diff --git a/x-pack/plugins/serverless_observability/kibana.jsonc b/x-pack/solutions/observability/plugins/serverless_observability/kibana.jsonc similarity index 100% rename from x-pack/plugins/serverless_observability/kibana.jsonc rename to x-pack/solutions/observability/plugins/serverless_observability/kibana.jsonc diff --git a/x-pack/solutions/observability/plugins/serverless_observability/package.json b/x-pack/solutions/observability/plugins/serverless_observability/package.json new file mode 100644 index 000000000000..8097ad8f5b8b --- /dev/null +++ b/x-pack/solutions/observability/plugins/serverless_observability/package.json @@ -0,0 +1,11 @@ +{ + "name": "@kbn/serverless-observability", + "version": "1.0.0", + "license": "Elastic License 2.0", + "private": true, + "scripts": { + "build": "yarn plugin-helpers build", + "plugin-helpers": "node ../../../../../scripts/plugin_helpers", + "kbn": "node ../../../../../scripts/kbn" + } +} \ No newline at end of file diff --git a/x-pack/plugins/serverless_observability/public/index.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/index.ts similarity index 100% rename from x-pack/plugins/serverless_observability/public/index.ts rename to x-pack/solutions/observability/plugins/serverless_observability/public/index.ts diff --git a/x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/logs_signal/overview_registration.ts similarity index 100% rename from x-pack/plugins/serverless_observability/public/logs_signal/overview_registration.ts rename to x-pack/solutions/observability/plugins/serverless_observability/public/logs_signal/overview_registration.ts diff --git a/x-pack/plugins/serverless_observability/public/navigation_tree.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts similarity index 100% rename from x-pack/plugins/serverless_observability/public/navigation_tree.ts rename to x-pack/solutions/observability/plugins/serverless_observability/public/navigation_tree.ts diff --git a/x-pack/plugins/serverless_observability/public/plugin.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts similarity index 100% rename from x-pack/plugins/serverless_observability/public/plugin.ts rename to x-pack/solutions/observability/plugins/serverless_observability/public/plugin.ts diff --git a/x-pack/plugins/serverless_observability/public/types.ts b/x-pack/solutions/observability/plugins/serverless_observability/public/types.ts similarity index 100% rename from x-pack/plugins/serverless_observability/public/types.ts rename to x-pack/solutions/observability/plugins/serverless_observability/public/types.ts diff --git a/x-pack/plugins/serverless_observability/server/config.ts b/x-pack/solutions/observability/plugins/serverless_observability/server/config.ts similarity index 100% rename from x-pack/plugins/serverless_observability/server/config.ts rename to x-pack/solutions/observability/plugins/serverless_observability/server/config.ts diff --git a/x-pack/plugins/serverless_observability/server/index.ts b/x-pack/solutions/observability/plugins/serverless_observability/server/index.ts similarity index 100% rename from x-pack/plugins/serverless_observability/server/index.ts rename to x-pack/solutions/observability/plugins/serverless_observability/server/index.ts diff --git a/x-pack/plugins/serverless_observability/server/plugin.ts b/x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts similarity index 100% rename from x-pack/plugins/serverless_observability/server/plugin.ts rename to x-pack/solutions/observability/plugins/serverless_observability/server/plugin.ts diff --git a/x-pack/plugins/serverless_observability/server/types.ts b/x-pack/solutions/observability/plugins/serverless_observability/server/types.ts similarity index 100% rename from x-pack/plugins/serverless_observability/server/types.ts rename to x-pack/solutions/observability/plugins/serverless_observability/server/types.ts diff --git a/x-pack/solutions/observability/plugins/serverless_observability/tsconfig.json b/x-pack/solutions/observability/plugins/serverless_observability/tsconfig.json new file mode 100644 index 000000000000..11bf6220cf12 --- /dev/null +++ b/x-pack/solutions/observability/plugins/serverless_observability/tsconfig.json @@ -0,0 +1,35 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "index.ts", + "common/**/*.ts", + "public/**/*.ts", + "public/**/*.tsx", + "server/**/*.ts", + "../../../../../typings/**/*" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/config-schema", + "@kbn/management-plugin", + "@kbn/serverless", + "@kbn/observability-shared-plugin", + "@kbn/i18n", + "@kbn/management-cards-navigation", + "@kbn/data-plugin", + "@kbn/observability-plugin", + "@kbn/io-ts-utils", + "@kbn/serverless-observability-settings", + "@kbn/core-chrome-browser", + "@kbn/discover-plugin", + "@kbn/security-plugin", + "@kbn/search-types", + "@kbn/streams-plugin", + ] +} diff --git a/x-pack/plugins/streams/README.md b/x-pack/solutions/observability/plugins/streams/README.md similarity index 100% rename from x-pack/plugins/streams/README.md rename to x-pack/solutions/observability/plugins/streams/README.md diff --git a/x-pack/plugins/streams/common/config.ts b/x-pack/solutions/observability/plugins/streams/common/config.ts similarity index 100% rename from x-pack/plugins/streams/common/config.ts rename to x-pack/solutions/observability/plugins/streams/common/config.ts diff --git a/x-pack/plugins/streams/common/constants.ts b/x-pack/solutions/observability/plugins/streams/common/constants.ts similarity index 100% rename from x-pack/plugins/streams/common/constants.ts rename to x-pack/solutions/observability/plugins/streams/common/constants.ts diff --git a/x-pack/plugins/streams/common/index.ts b/x-pack/solutions/observability/plugins/streams/common/index.ts similarity index 100% rename from x-pack/plugins/streams/common/index.ts rename to x-pack/solutions/observability/plugins/streams/common/index.ts diff --git a/x-pack/solutions/observability/plugins/streams/common/types.ts b/x-pack/solutions/observability/plugins/streams/common/types.ts new file mode 100644 index 000000000000..7917864706c2 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/common/types.ts @@ -0,0 +1,118 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; + +const stringOrNumberOrBoolean = z.union([z.string(), z.number(), z.boolean()]); + +export const binaryConditionSchema = z.object({ + field: z.string(), + operator: z.enum(['eq', 'neq', 'lt', 'lte', 'gt', 'gte', 'contains', 'startsWith', 'endsWith']), + value: stringOrNumberOrBoolean, +}); + +export const unaryFilterConditionSchema = z.object({ + field: z.string(), + operator: z.enum(['exists', 'notExists']), +}); + +export const filterConditionSchema = z.discriminatedUnion('operator', [ + unaryFilterConditionSchema, + binaryConditionSchema, +]); + +export type FilterCondition = z.infer; +export type BinaryFilterCondition = z.infer; +export type UnaryFilterCondition = z.infer; + +export interface AndCondition { + and: Condition[]; +} + +export interface OrCondition { + or: Condition[]; +} + +export type Condition = FilterCondition | AndCondition | OrCondition | undefined; + +export const conditionSchema: z.ZodType = z.lazy(() => + z.union([ + filterConditionSchema, + z.object({ and: z.array(conditionSchema) }), + z.object({ or: z.array(conditionSchema) }), + ]) +); + +export const grokProcessingDefinitionSchema = z.object({ + type: z.literal('grok'), + field: z.string(), + patterns: z.array(z.string()), + pattern_definitions: z.optional(z.record(z.string())), +}); + +export const dissectProcessingDefinitionSchema = z.object({ + type: z.literal('dissect'), + field: z.string(), + pattern: z.string(), +}); + +export const processingDefinitionSchema = z.object({ + condition: z.optional(conditionSchema), + config: z.discriminatedUnion('type', [ + grokProcessingDefinitionSchema, + dissectProcessingDefinitionSchema, + ]), +}); + +export type ProcessingDefinition = z.infer; + +export const fieldDefinitionSchema = z.object({ + name: z.string(), + type: z.enum(['keyword', 'match_only_text', 'long', 'double', 'date', 'boolean', 'ip']), + format: z.optional(z.string()), +}); + +export type FieldDefinition = z.infer; + +export const streamChildSchema = z.object({ + id: z.string(), + condition: z.optional(conditionSchema), +}); + +export type StreamChild = z.infer; + +export const streamWithoutIdDefinitonSchema = z.object({ + processing: z.array(processingDefinitionSchema).default([]), + fields: z.array(fieldDefinitionSchema).default([]), + managed: z.boolean().default(true), + children: z.array(streamChildSchema).default([]), +}); + +export type StreamWithoutIdDefinition = z.infer; + +export const unmanagedElasticsearchAsset = z.object({ + type: z.enum(['ingest_pipeline', 'component_template', 'index_template', 'data_stream']), + id: z.string(), +}); +export type UnmanagedElasticsearchAsset = z.infer; + +export const streamDefinitonSchema = streamWithoutIdDefinitonSchema.extend({ + id: z.string(), + unmanaged_elasticsearch_assets: z.optional(z.array(unmanagedElasticsearchAsset)), +}); + +export type StreamDefinition = z.infer; + +export const streamDefinitonWithoutChildrenSchema = streamDefinitonSchema.omit({ children: true }); + +export type StreamWithoutChildrenDefinition = z.infer; + +export const readStreamDefinitonSchema = streamDefinitonSchema.extend({ + inheritedFields: z.array(fieldDefinitionSchema.extend({ from: z.string() })).default([]), +}); + +export type ReadStreamDefinition = z.infer; diff --git a/x-pack/solutions/observability/plugins/streams/jest.config.js b/x-pack/solutions/observability/plugins/streams/jest.config.js new file mode 100644 index 000000000000..12f11c9482d5 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/streams'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/streams', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/streams/{common,public,server}/**/*.{js,ts,tsx}', + ], +}; diff --git a/x-pack/plugins/streams/kibana.jsonc b/x-pack/solutions/observability/plugins/streams/kibana.jsonc similarity index 100% rename from x-pack/plugins/streams/kibana.jsonc rename to x-pack/solutions/observability/plugins/streams/kibana.jsonc diff --git a/x-pack/plugins/streams/public/api/index.ts b/x-pack/solutions/observability/plugins/streams/public/api/index.ts similarity index 100% rename from x-pack/plugins/streams/public/api/index.ts rename to x-pack/solutions/observability/plugins/streams/public/api/index.ts diff --git a/x-pack/plugins/streams/public/index.ts b/x-pack/solutions/observability/plugins/streams/public/index.ts similarity index 100% rename from x-pack/plugins/streams/public/index.ts rename to x-pack/solutions/observability/plugins/streams/public/index.ts diff --git a/x-pack/plugins/streams/public/plugin.ts b/x-pack/solutions/observability/plugins/streams/public/plugin.ts similarity index 100% rename from x-pack/plugins/streams/public/plugin.ts rename to x-pack/solutions/observability/plugins/streams/public/plugin.ts diff --git a/x-pack/plugins/streams/public/types.ts b/x-pack/solutions/observability/plugins/streams/public/types.ts similarity index 100% rename from x-pack/plugins/streams/public/types.ts rename to x-pack/solutions/observability/plugins/streams/public/types.ts diff --git a/x-pack/plugins/streams/server/index.ts b/x-pack/solutions/observability/plugins/streams/server/index.ts similarity index 100% rename from x-pack/plugins/streams/server/index.ts rename to x-pack/solutions/observability/plugins/streams/server/index.ts diff --git a/x-pack/plugins/streams/server/lib/streams/component_templates/generate_layer.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/generate_layer.ts similarity index 92% rename from x-pack/plugins/streams/server/lib/streams/component_templates/generate_layer.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/generate_layer.ts index a99b9be26191..04dcc8c5dafc 100644 --- a/x-pack/plugins/streams/server/lib/streams/component_templates/generate_layer.ts +++ b/x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/generate_layer.ts @@ -29,6 +29,9 @@ export function generateLayer( // @timestamp can't ignore malformed dates as it's used for sorting in logsdb (property as MappingDateProperty).ignore_malformed = false; } + if (field.type === 'date' && field.format) { + (property as MappingDateProperty).format = field.format; + } properties[field.name] = property; }); return { diff --git a/x-pack/plugins/streams/server/lib/streams/component_templates/logs_layer.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/logs_layer.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/component_templates/logs_layer.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/logs_layer.ts diff --git a/x-pack/plugins/streams/server/lib/streams/component_templates/manage_component_templates.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/manage_component_templates.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/component_templates/manage_component_templates.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/manage_component_templates.ts diff --git a/x-pack/plugins/streams/server/lib/streams/component_templates/name.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/name.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/component_templates/name.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/component_templates/name.ts diff --git a/x-pack/plugins/streams/server/lib/streams/data_streams/manage_data_streams.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/data_streams/manage_data_streams.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/data_streams/manage_data_streams.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/data_streams/manage_data_streams.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/component_template_not_found.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/component_template_not_found.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/component_template_not_found.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/component_template_not_found.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/definition_id_invalid.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/definition_id_invalid.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/definition_id_invalid.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/definition_id_invalid.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/definition_not_found.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/definition_not_found.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/definition_not_found.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/definition_not_found.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/fork_condition_missing.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/fork_condition_missing.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/fork_condition_missing.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/fork_condition_missing.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/id_conflict_error.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/id_conflict_error.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/id_conflict_error.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/id_conflict_error.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/index.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/index.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/index.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/index.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/index_template_not_found.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/index_template_not_found.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/index_template_not_found.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/index_template_not_found.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/ingest_pipeline_not_found.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/ingest_pipeline_not_found.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/ingest_pipeline_not_found.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/ingest_pipeline_not_found.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/malformed_children.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_children.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/malformed_children.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_children.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/malformed_fields.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_fields.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/malformed_fields.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_fields.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/malformed_stream_id.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_stream_id.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/malformed_stream_id.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/malformed_stream_id.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/permission_denied.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/permission_denied.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/permission_denied.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/permission_denied.ts diff --git a/x-pack/plugins/streams/server/lib/streams/errors/security_exception.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/security_exception.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/errors/security_exception.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/errors/security_exception.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_fields.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_fields.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/condition_fields.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_fields.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_guards.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_guards.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/condition_guards.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_guards.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.test.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_painless.test.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.test.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_painless.test.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_painless.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/condition_to_query_dsl.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_query_dsl.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/condition_to_query_dsl.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/condition_to_query_dsl.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/hierarchy.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/hierarchy.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/hierarchy.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/hierarchy.ts diff --git a/x-pack/plugins/streams/server/lib/streams/helpers/retry.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/retry.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/helpers/retry.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/helpers/retry.ts diff --git a/x-pack/plugins/streams/server/lib/streams/index_templates/generate_index_template.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/generate_index_template.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/index_templates/generate_index_template.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/generate_index_template.ts diff --git a/x-pack/plugins/streams/server/lib/streams/index_templates/manage_index_templates.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/manage_index_templates.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/index_templates/manage_index_templates.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/manage_index_templates.ts diff --git a/x-pack/plugins/streams/server/lib/streams/index_templates/name.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/name.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/index_templates/name.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/index_templates/name.ts diff --git a/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.ts new file mode 100644 index 000000000000..e7c9c784a812 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/generate_ingest_pipeline.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 { StreamDefinition } from '../../../../common/types'; +import { ASSET_VERSION } from '../../../../common/constants'; +import { conditionToPainless } from '../helpers/condition_to_painless'; +import { logsDefaultPipelineProcessors } from './logs_default_pipeline'; +import { isRoot } from '../helpers/hierarchy'; +import { getProcessingPipelineName } from './name'; + +function generateProcessingSteps(definition: StreamDefinition) { + return definition.processing.map((processor) => { + const { type, ...config } = processor.config; + return { + [type]: { + ...config, + if: processor.condition ? conditionToPainless(processor.condition) : undefined, + }, + }; + }); +} + +export function generateIngestPipeline(id: string, definition: StreamDefinition) { + return { + id: getProcessingPipelineName(id), + processors: [ + ...(isRoot(definition.id) ? logsDefaultPipelineProcessors : []), + ...generateProcessingSteps(definition), + { + pipeline: { + name: `${id}@stream.reroutes`, + ignore_missing_pipeline: true, + }, + }, + ], + _meta: { + description: `Default pipeline for the ${id} stream`, + managed: true, + }, + version: ASSET_VERSION, + }; +} + +export function generateClassicIngestPipelineBody(definition: StreamDefinition) { + return { + processors: generateProcessingSteps(definition), + _meta: { + description: `Stream-managed pipeline for the ${definition.id} stream`, + managed: true, + }, + version: ASSET_VERSION, + }; +} diff --git a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/generate_reroute_pipeline.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/generate_reroute_pipeline.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/ingest_pipelines/generate_reroute_pipeline.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/generate_reroute_pipeline.ts diff --git a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/logs_default_pipeline.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/logs_default_pipeline.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/ingest_pipelines/logs_default_pipeline.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/logs_default_pipeline.ts diff --git a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/manage_ingest_pipelines.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/manage_ingest_pipelines.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/ingest_pipelines/manage_ingest_pipelines.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/manage_ingest_pipelines.ts diff --git a/x-pack/plugins/streams/server/lib/streams/ingest_pipelines/name.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/name.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/ingest_pipelines/name.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/ingest_pipelines/name.ts diff --git a/x-pack/plugins/streams/server/lib/streams/internal_stream_mapping.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/internal_stream_mapping.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/internal_stream_mapping.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/internal_stream_mapping.ts diff --git a/x-pack/plugins/streams/server/lib/streams/root_stream_definition.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/root_stream_definition.ts similarity index 100% rename from x-pack/plugins/streams/server/lib/streams/root_stream_definition.ts rename to x-pack/solutions/observability/plugins/streams/server/lib/streams/root_stream_definition.ts diff --git a/x-pack/solutions/observability/plugins/streams/server/lib/streams/stream_crud.ts b/x-pack/solutions/observability/plugins/streams/server/lib/streams/stream_crud.ts new file mode 100644 index 000000000000..5066ecd61a60 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/lib/streams/stream_crud.ts @@ -0,0 +1,672 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; +import { Logger } from '@kbn/logging'; +import { IngestPipeline, IngestProcessorContainer } from '@elastic/elasticsearch/lib/api/types'; +import { set } from '@kbn/safer-lodash-set'; +import { IndicesDataStream } from '@elastic/elasticsearch/lib/api/types'; +import { STREAMS_INDEX } from '../../../common/constants'; +import { FieldDefinition, StreamDefinition } from '../../../common/types'; +import { generateLayer } from './component_templates/generate_layer'; +import { deleteComponent, upsertComponent } from './component_templates/manage_component_templates'; +import { getComponentTemplateName } from './component_templates/name'; +import { + deleteDataStream, + rolloverDataStreamIfNecessary, + upsertDataStream, +} from './data_streams/manage_data_streams'; +import { DefinitionNotFound } from './errors'; +import { MalformedFields } from './errors/malformed_fields'; +import { getAncestors } from './helpers/hierarchy'; +import { generateIndexTemplate } from './index_templates/generate_index_template'; +import { deleteTemplate, upsertTemplate } from './index_templates/manage_index_templates'; +import { getIndexTemplateName } from './index_templates/name'; +import { + generateClassicIngestPipelineBody, + generateIngestPipeline, +} from './ingest_pipelines/generate_ingest_pipeline'; +import { generateReroutePipeline } from './ingest_pipelines/generate_reroute_pipeline'; +import { + deleteIngestPipeline, + upsertIngestPipeline, +} from './ingest_pipelines/manage_ingest_pipelines'; +import { getProcessingPipelineName, getReroutePipelineName } from './ingest_pipelines/name'; + +interface BaseParams { + scopedClusterClient: IScopedClusterClient; +} + +interface BaseParamsWithDefinition extends BaseParams { + definition: StreamDefinition; +} + +interface DeleteStreamParams extends BaseParams { + id: string; + logger: Logger; +} + +export async function deleteUnmanagedStreamObjects({ + id, + scopedClusterClient, + logger, +}: DeleteStreamParams) { + const unmanagedAssets = await getUnmanagedElasticsearchAssets({ + name: id, + scopedClusterClient, + }); + const pipelineName = unmanagedAssets.find((asset) => asset.type === 'ingest_pipeline')?.id; + if (pipelineName) { + const { targetPipelineName, targetPipeline, referencesStreamManagedPipeline } = + await findStreamManagedPipelineReference(scopedClusterClient, pipelineName, id); + if (referencesStreamManagedPipeline) { + const streamManagedPipelineName = getProcessingPipelineName(id); + const updatedProcessors = targetPipeline.processors!.filter( + (processor) => + !(processor.pipeline && processor.pipeline.name === streamManagedPipelineName) + ); + await scopedClusterClient.asCurrentUser.ingest.putPipeline({ + id: targetPipelineName, + body: { + processors: updatedProcessors, + }, + }); + } + } + await deleteDataStream({ + esClient: scopedClusterClient.asCurrentUser, + name: id, + logger, + }); + try { + await deleteIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + id: getProcessingPipelineName(id), + logger, + }); + } catch (e) { + // if the pipeline doesn't exist, we don't need to delete it + if (!(e.meta?.statusCode === 404)) { + throw e; + } + } + try { + await scopedClusterClient.asInternalUser.delete({ + id, + index: STREAMS_INDEX, + refresh: 'wait_for', + }); + } catch (e) { + if (e.meta?.statusCode !== 404) { + throw e; + } + } +} + +export async function deleteStreamObjects({ id, scopedClusterClient, logger }: DeleteStreamParams) { + await deleteDataStream({ + esClient: scopedClusterClient.asCurrentUser, + name: id, + logger, + }); + await deleteTemplate({ + esClient: scopedClusterClient.asCurrentUser, + name: getIndexTemplateName(id), + logger, + }); + await deleteComponent({ + esClient: scopedClusterClient.asCurrentUser, + name: getComponentTemplateName(id), + logger, + }); + await deleteIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + id: getProcessingPipelineName(id), + logger, + }); + await deleteIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + id: getReroutePipelineName(id), + logger, + }); + await scopedClusterClient.asInternalUser.delete({ + id, + index: STREAMS_INDEX, + refresh: 'wait_for', + }); +} + +async function upsertInternalStream({ definition, scopedClusterClient }: BaseParamsWithDefinition) { + return scopedClusterClient.asInternalUser.index({ + id: definition.id, + index: STREAMS_INDEX, + document: { ...definition }, + refresh: 'wait_for', + }); +} + +type ListStreamsParams = BaseParams; + +export interface ListStreamResponse { + definitions: StreamDefinition[]; +} + +export async function listStreams({ + scopedClusterClient, +}: ListStreamsParams): Promise { + const response = await scopedClusterClient.asInternalUser.search({ + index: STREAMS_INDEX, + size: 10000, + sort: [{ id: 'asc' }], + }); + + const dataStreams = await listDataStreamsAsStreams({ scopedClusterClient }); + let definitions = response.hits.hits.map((hit) => ({ ...hit._source! })); + const hasAccess = await Promise.all( + definitions.map((definition) => checkReadAccess({ id: definition.id, scopedClusterClient })) + ); + definitions = definitions.filter((_, index) => hasAccess[index]); + const definitionMap = new Map(definitions.map((definition) => [definition.id, definition])); + dataStreams.forEach((dataStream) => { + if (!definitionMap.has(dataStream.id)) { + definitionMap.set(dataStream.id, dataStream); + } + }); + + return { + definitions: Array.from(definitionMap.values()), + }; +} + +export async function listDataStreamsAsStreams({ + scopedClusterClient, +}: ListStreamsParams): Promise { + const response = await scopedClusterClient.asInternalUser.indices.getDataStream(); + return response.data_streams + .filter((dataStream) => dataStream.template.endsWith('@stream') === false) + .map((dataStream) => ({ + id: dataStream.name, + managed: false, + children: [], + fields: [], + processing: [], + })); +} + +interface ReadStreamParams extends BaseParams { + id: string; + skipAccessCheck?: boolean; +} + +export interface ReadStreamResponse { + definition: StreamDefinition; +} + +export async function readStream({ + id, + scopedClusterClient, + skipAccessCheck, +}: ReadStreamParams): Promise { + try { + const response = await scopedClusterClient.asInternalUser.get({ + id, + index: STREAMS_INDEX, + }); + const definition = response._source as StreamDefinition; + if (!skipAccessCheck) { + const hasAccess = await checkReadAccess({ id, scopedClusterClient }); + if (!hasAccess) { + throw new DefinitionNotFound(`Stream definition for ${id} not found.`); + } + } + return { + definition: { + ...definition, + }, + }; + } catch (e) { + if (e.meta?.statusCode === 404) { + return readDataStreamAsStream({ id, scopedClusterClient, skipAccessCheck }); + } + throw e; + } +} + +export async function readDataStreamAsStream({ id, scopedClusterClient }: ReadStreamParams) { + const definition: StreamDefinition = { + id, + managed: false, + children: [], + fields: [], + processing: [], + }; + + definition.unmanaged_elasticsearch_assets = await getUnmanagedElasticsearchAssets({ + name: id, + scopedClusterClient, + }); + + return { definition }; +} + +interface ReadUnmanagedAssetsParams extends BaseParams { + name: string; +} + +async function getUnmanagedElasticsearchAssets({ + name, + scopedClusterClient, +}: ReadUnmanagedAssetsParams) { + let dataStream: IndicesDataStream; + try { + const response = await scopedClusterClient.asInternalUser.indices.getDataStream({ name }); + dataStream = response.data_streams[0]; + } catch (e) { + if (e.meta?.statusCode === 404) { + throw new DefinitionNotFound(`Stream definition for ${name} not found.`); + } + throw e; + } + + // retrieve linked index template, component template and ingest pipeline + const templateName = dataStream.template; + const componentTemplates: string[] = []; + const template = await scopedClusterClient.asInternalUser.indices.getIndexTemplate({ + name: templateName, + }); + if (template.index_templates.length) { + template.index_templates[0].index_template.composed_of.forEach((componentTemplateName) => { + componentTemplates.push(componentTemplateName); + }); + } + const writeIndexName = dataStream.indices.at(-1)?.index_name!; + const currentIndex = await scopedClusterClient.asInternalUser.indices.get({ + index: writeIndexName, + }); + const ingestPipelineId = currentIndex[writeIndexName].settings?.index?.default_pipeline!; + + return [ + { + type: 'ingest_pipeline' as const, + id: ingestPipelineId, + }, + ...componentTemplates.map((componentTemplateName) => ({ + type: 'component_template' as const, + id: componentTemplateName, + })), + { + type: 'index_template' as const, + id: templateName, + }, + { + type: 'data_stream' as const, + id: name, + }, + ]; +} + +interface ReadAncestorsParams extends BaseParams { + id: string; +} + +export interface ReadAncestorsResponse { + ancestors: Array<{ definition: StreamDefinition }>; +} + +export async function readAncestors({ + id, + scopedClusterClient, +}: ReadAncestorsParams): Promise { + const ancestorIds = getAncestors(id); + + return { + ancestors: await Promise.all( + ancestorIds.map((ancestorId) => + readStream({ scopedClusterClient, id: ancestorId, skipAccessCheck: true }) + ) + ), + }; +} + +interface ReadDescendantsParams extends BaseParams { + id: string; +} + +export async function readDescendants({ id, scopedClusterClient }: ReadDescendantsParams) { + const response = await scopedClusterClient.asInternalUser.search({ + index: STREAMS_INDEX, + size: 10000, + body: { + query: { + bool: { + filter: { + prefix: { + id, + }, + }, + must_not: { + term: { + id, + }, + }, + }, + }, + }, + }); + return response.hits.hits.map((hit) => hit._source as StreamDefinition); +} + +export async function validateAncestorFields( + scopedClusterClient: IScopedClusterClient, + id: string, + fields: FieldDefinition[] +) { + const { ancestors } = await readAncestors({ + id, + scopedClusterClient, + }); + for (const ancestor of ancestors) { + for (const field of fields) { + if ( + ancestor.definition.fields.some( + (ancestorField) => ancestorField.type !== field.type && ancestorField.name === field.name + ) + ) { + throw new MalformedFields( + `Field ${field.name} is already defined with incompatible type in the parent stream ${ancestor.definition.id}` + ); + } + } + } +} + +export async function validateDescendantFields( + scopedClusterClient: IScopedClusterClient, + id: string, + fields: FieldDefinition[] +) { + const descendants = await readDescendants({ + id, + scopedClusterClient, + }); + for (const descendant of descendants) { + for (const field of fields) { + if ( + descendant.fields.some( + (descendantField) => + descendantField.type !== field.type && descendantField.name === field.name + ) + ) { + throw new MalformedFields( + `Field ${field.name} is already defined with incompatible type in the child stream ${descendant.id}` + ); + } + } + } +} + +export async function checkStreamExists({ id, scopedClusterClient }: ReadStreamParams) { + try { + await readStream({ id, scopedClusterClient }); + return true; + } catch (e) { + if (e instanceof DefinitionNotFound) { + return false; + } + throw e; + } +} + +interface CheckReadAccessParams extends BaseParams { + id: string; +} + +export async function checkReadAccess({ + id, + scopedClusterClient, +}: CheckReadAccessParams): Promise { + try { + return await scopedClusterClient.asCurrentUser.indices.exists({ index: id }); + } catch (e) { + return false; + } +} + +interface SyncStreamParams { + scopedClusterClient: IScopedClusterClient; + definition: StreamDefinition; + rootDefinition?: StreamDefinition; + logger: Logger; +} + +export async function syncStream({ + scopedClusterClient, + definition, + rootDefinition, + logger, +}: SyncStreamParams) { + if (!definition.managed) { + await syncUnmanagedStream({ scopedClusterClient, definition, logger }); + await upsertInternalStream({ + scopedClusterClient, + definition, + }); + return; + } + const componentTemplate = generateLayer(definition.id, definition); + await upsertComponent({ + esClient: scopedClusterClient.asCurrentUser, + logger, + component: componentTemplate, + }); + await upsertIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + logger, + pipeline: generateIngestPipeline(definition.id, definition), + }); + const reroutePipeline = await generateReroutePipeline({ + definition, + }); + await upsertIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + logger, + pipeline: reroutePipeline, + }); + await upsertTemplate({ + esClient: scopedClusterClient.asCurrentUser, + logger, + template: generateIndexTemplate(definition.id), + }); + if (rootDefinition) { + const parentReroutePipeline = await generateReroutePipeline({ + definition: rootDefinition, + }); + await upsertIngestPipeline({ + esClient: scopedClusterClient.asCurrentUser, + logger, + pipeline: parentReroutePipeline, + }); + } + await upsertDataStream({ + esClient: scopedClusterClient.asCurrentUser, + logger, + name: definition.id, + }); + await upsertInternalStream({ + scopedClusterClient, + definition, + }); + await rolloverDataStreamIfNecessary({ + esClient: scopedClusterClient.asCurrentUser, + name: definition.id, + logger, + mappings: componentTemplate.template.mappings?.properties, + }); +} + +interface ExecutionPlanStep { + method: string; + path: string; + body?: Record; +} + +async function syncUnmanagedStream({ scopedClusterClient, definition, logger }: SyncStreamParams) { + if (definition.managed) { + throw new Error('Got an unmanaged stream that is marked as managed'); + } + if (definition.fields.length) { + throw new Error( + 'Unmanaged streams cannot have managed fields, please edit the component templates directly' + ); + } + if (definition.children.length) { + throw new Error('Unmanaged streams cannot have managed children, coming soon'); + } + const unmanagedAssets = await getUnmanagedElasticsearchAssets({ + name: definition.id, + scopedClusterClient, + }); + const executionPlan: ExecutionPlanStep[] = []; + const streamManagedPipelineName = getProcessingPipelineName(definition.id); + const pipelineName = unmanagedAssets.find((asset) => asset.type === 'ingest_pipeline')?.id; + if (!pipelineName) { + throw new Error('Unmanaged stream needs a default ingest pipeline'); + } + if (pipelineName === streamManagedPipelineName) { + throw new Error('Unmanaged stream cannot have the @stream pipeline as the default pipeline'); + } + await ensureStreamManagedPipelineReference( + scopedClusterClient, + pipelineName, + definition, + executionPlan + ); + + if (definition.processing.length) { + // if the stream has processing, we need to create or update the stream managed pipeline + executionPlan.push({ + method: 'PUT', + path: `/_ingest/pipeline/${streamManagedPipelineName}`, + body: generateClassicIngestPipelineBody(definition), + }); + } else { + const pipelineExists = Boolean( + await tryGettingPipeline({ scopedClusterClient, id: streamManagedPipelineName }) + ); + // no processing, just delete the pipeline if it exists. The reference to the pipeline won't break anything + if (pipelineExists) { + executionPlan.push({ + method: 'DELETE', + path: `/_ingest/pipeline/${streamManagedPipelineName}`, + }); + } + } + + await executePlan(executionPlan, scopedClusterClient); +} + +async function executePlan( + executionPlan: ExecutionPlanStep[], + scopedClusterClient: IScopedClusterClient +) { + for (const step of executionPlan) { + await scopedClusterClient.asCurrentUser.transport.request({ + method: step.method, + path: step.path, + body: step.body, + }); + } +} + +async function findStreamManagedPipelineReference( + scopedClusterClient: IScopedClusterClient, + pipelineName: string, + streamId: string +): Promise<{ + targetPipelineName: string; + targetPipeline: IngestPipeline; + referencesStreamManagedPipeline: boolean; +}> { + const streamManagedPipelineName = getProcessingPipelineName(streamId); + const pipeline = (await tryGettingPipeline({ scopedClusterClient, id: pipelineName })) || { + processors: [], + }; + const streamProcessor = pipeline.processors?.find( + (processor) => processor.pipeline && processor.pipeline.name === streamManagedPipelineName + ); + const customProcessor = pipeline.processors?.findLast( + (processor) => processor.pipeline && processor.pipeline.name.endsWith('@custom') + ); + if (streamProcessor) { + return { + targetPipelineName: pipelineName, + targetPipeline: pipeline, + referencesStreamManagedPipeline: true, + }; + } + if (customProcessor) { + // go one level deeper, find the latest @custom leaf pipeline + return await findStreamManagedPipelineReference( + scopedClusterClient, + customProcessor.pipeline!.name, + streamId + ); + } + return { + targetPipelineName: pipelineName, + targetPipeline: pipeline, + referencesStreamManagedPipeline: false, + }; +} + +async function ensureStreamManagedPipelineReference( + scopedClusterClient: IScopedClusterClient, + pipelineName: string, + definition: StreamDefinition, + executionPlan: ExecutionPlanStep[] +) { + const streamManagedPipelineName = getProcessingPipelineName(definition.id); + const { targetPipelineName, targetPipeline, referencesStreamManagedPipeline } = + await findStreamManagedPipelineReference(scopedClusterClient, pipelineName, definition.id); + if (!referencesStreamManagedPipeline) { + const callStreamManagedPipelineProcessor: IngestProcessorContainer = { + pipeline: { + name: streamManagedPipelineName, + if: `ctx._index == '${definition.id}'`, + ignore_missing_pipeline: true, + description: + "Call the stream's managed pipeline - do not change this manually but instead use the streams UI or API", + }, + }; + executionPlan.push({ + method: 'PUT', + path: `/_ingest/pipeline/${targetPipelineName}`, + body: set( + { ...targetPipeline }, + 'processors', + (targetPipeline.processors || []).concat(callStreamManagedPipelineProcessor) + ), + }); + } +} + +async function tryGettingPipeline({ scopedClusterClient, id }: ReadStreamParams) { + try { + return (await scopedClusterClient.asCurrentUser.ingest.getPipeline({ id }))[id]; + } catch (e) { + if (e.meta?.statusCode === 404) { + return; + } + throw e; + } +} + +export async function streamsEnabled({ scopedClusterClient }: BaseParams) { + return await scopedClusterClient.asInternalUser.indices.exists({ + index: STREAMS_INDEX, + }); +} diff --git a/x-pack/plugins/streams/server/plugin.ts b/x-pack/solutions/observability/plugins/streams/server/plugin.ts similarity index 100% rename from x-pack/plugins/streams/server/plugin.ts rename to x-pack/solutions/observability/plugins/streams/server/plugin.ts diff --git a/x-pack/plugins/streams/server/routes/create_server_route.ts b/x-pack/solutions/observability/plugins/streams/server/routes/create_server_route.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/create_server_route.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/create_server_route.ts diff --git a/x-pack/plugins/streams/server/routes/esql/route.ts b/x-pack/solutions/observability/plugins/streams/server/routes/esql/route.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/esql/route.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/esql/route.ts diff --git a/x-pack/solutions/observability/plugins/streams/server/routes/index.ts b/x-pack/solutions/observability/plugins/streams/server/routes/index.ts new file mode 100644 index 000000000000..e6c53e33e217 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/routes/index.ts @@ -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 { esqlRoutes } from './esql/route'; +import { deleteStreamRoute } from './streams/delete'; +import { disableStreamsRoute } from './streams/disable'; +import { editStreamRoute } from './streams/edit'; +import { enableStreamsRoute } from './streams/enable'; +import { forkStreamsRoute } from './streams/fork'; +import { listStreamsRoute } from './streams/list'; +import { readStreamRoute } from './streams/read'; +import { resyncStreamsRoute } from './streams/resync'; +import { sampleStreamRoute } from './streams/sample'; +import { schemaFieldsSimulationRoute } from './streams/schema/fields_simulation'; +import { unmappedFieldsRoute } from './streams/schema/unmapped_fields'; +import { streamsStatusRoutes } from './streams/settings'; + +export const streamsRouteRepository = { + ...enableStreamsRoute, + ...resyncStreamsRoute, + ...forkStreamsRoute, + ...readStreamRoute, + ...editStreamRoute, + ...deleteStreamRoute, + ...listStreamsRoute, + ...streamsStatusRoutes, + ...esqlRoutes, + ...disableStreamsRoute, + ...sampleStreamRoute, + ...unmappedFieldsRoute, + ...schemaFieldsSimulationRoute, +}; + +export type StreamsRouteRepository = typeof streamsRouteRepository; diff --git a/x-pack/solutions/observability/plugins/streams/server/routes/streams/delete.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/delete.ts new file mode 100644 index 000000000000..d6bf5fbb84d8 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/delete.ts @@ -0,0 +1,127 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { IScopedClusterClient } from '@kbn/core-elasticsearch-server'; +import { Logger } from '@kbn/logging'; +import { badRequest, internal, notFound } from '@hapi/boom'; +import { + DefinitionNotFound, + ForkConditionMissing, + IndexTemplateNotFound, + SecurityException, +} from '../../lib/streams/errors'; +import { createServerRoute } from '../create_server_route'; +import { + syncStream, + readStream, + deleteStreamObjects, + deleteUnmanagedStreamObjects, +} from '../../lib/streams/stream_crud'; +import { MalformedStreamId } from '../../lib/streams/errors/malformed_stream_id'; +import { getParentId } from '../../lib/streams/helpers/hierarchy'; + +export const deleteStreamRoute = createServerRoute({ + endpoint: 'DELETE /api/streams/{id}', + options: { + access: 'internal', + }, + security: { + authz: { + enabled: false, + reason: + 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', + }, + }, + params: z.object({ + path: z.object({ + id: z.string(), + }), + }), + handler: async ({ + response, + params, + logger, + request, + getScopedClients, + }): Promise<{ acknowledged: true }> => { + try { + const { scopedClusterClient } = await getScopedClients({ request }); + + await deleteStream(scopedClusterClient, params.path.id, logger); + + return { acknowledged: true }; + } catch (e) { + if (e instanceof IndexTemplateNotFound || e instanceof DefinitionNotFound) { + throw notFound(e); + } + + if ( + e instanceof SecurityException || + e instanceof ForkConditionMissing || + e instanceof MalformedStreamId + ) { + throw badRequest(e); + } + + throw internal(e); + } + }, +}); + +export async function deleteStream( + scopedClusterClient: IScopedClusterClient, + id: string, + logger: Logger +) { + try { + const { definition } = await readStream({ scopedClusterClient, id }); + if (!definition.managed) { + await deleteUnmanagedStreamObjects({ scopedClusterClient, id, logger }); + return; + } + + const parentId = getParentId(id); + if (!parentId) { + throw new MalformedStreamId('Cannot delete root stream'); + } + + // need to update parent first to cut off documents streaming down + await updateParentStream(scopedClusterClient, id, parentId, logger); + for (const child of definition.children) { + await deleteStream(scopedClusterClient, child.id, logger); + } + await deleteStreamObjects({ scopedClusterClient, id, logger }); + } catch (e) { + if (e instanceof DefinitionNotFound) { + logger.debug(`Stream definition for ${id} not found.`); + } else { + throw e; + } + } +} + +async function updateParentStream( + scopedClusterClient: IScopedClusterClient, + id: string, + parentId: string, + logger: Logger +) { + const { definition: parentDefinition } = await readStream({ + scopedClusterClient, + id: parentId, + }); + + parentDefinition.children = parentDefinition.children.filter((child) => child.id !== id); + + await syncStream({ + scopedClusterClient, + definition: parentDefinition, + logger, + }); + return parentDefinition; +} diff --git a/x-pack/plugins/streams/server/routes/streams/disable.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/disable.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/streams/disable.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/disable.ts diff --git a/x-pack/plugins/streams/server/routes/streams/edit.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/edit.ts similarity index 95% rename from x-pack/plugins/streams/server/routes/streams/edit.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/edit.ts index e280796bc978..19867018ce25 100644 --- a/x-pack/plugins/streams/server/routes/streams/edit.ts +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/edit.ts @@ -50,6 +50,17 @@ export const editStreamRoute = createServerRoute({ handler: async ({ response, params, logger, request, getScopedClients }) => { try { const { scopedClusterClient } = await getScopedClients({ request }); + const streamDefinition = { ...params.body, id: params.path.id }; + + if (!streamDefinition.managed) { + await syncStream({ + scopedClusterClient, + definition: { ...streamDefinition, id: params.path.id }, + rootDefinition: undefined, + logger, + }); + return { acknowledged: true }; + } await validateStreamChildren(scopedClusterClient, params.path.id, params.body.children); await validateAncestorFields(scopedClusterClient, params.path.id, params.body.fields); @@ -58,8 +69,6 @@ export const editStreamRoute = createServerRoute({ const parentId = getParentId(params.path.id); let parentDefinition: StreamDefinition | undefined; - const streamDefinition = { ...params.body, id: params.path.id }; - // always need to go from the leaves to the parent when syncing ingest pipelines, otherwise data // will be routed before the data stream is ready diff --git a/x-pack/plugins/streams/server/routes/streams/enable.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/enable.ts similarity index 84% rename from x-pack/plugins/streams/server/routes/streams/enable.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/enable.ts index cfcb97f9b358..ee49a93aaacb 100644 --- a/x-pack/plugins/streams/server/routes/streams/enable.ts +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/enable.ts @@ -31,12 +31,12 @@ export const enableStreamsRoute = createServerRoute({ response, logger, getScopedClients, - }): Promise<{ acknowledged: true }> => { + }): Promise<{ acknowledged: true; message: string }> => { try { const { scopedClusterClient } = await getScopedClients({ request }); const alreadyEnabled = await streamsEnabled({ scopedClusterClient }); if (alreadyEnabled) { - return { acknowledged: true }; + return { acknowledged: true, message: 'Streams was already enabled' }; } await createStreamsIndex(scopedClusterClient); await syncStream({ @@ -44,7 +44,11 @@ export const enableStreamsRoute = createServerRoute({ definition: rootStreamDefinition, logger, }); - return { acknowledged: true }; + return { + acknowledged: true, + message: + 'Streams enabled - reload your browser window to show the streams UI in the navigation', + }; } catch (e) { if (e instanceof SecurityException) { throw badRequest(e); diff --git a/x-pack/plugins/streams/server/routes/streams/fork.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/fork.ts similarity index 96% rename from x-pack/plugins/streams/server/routes/streams/fork.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/fork.ts index 070dc66b9ab1..9ec61d27619e 100644 --- a/x-pack/plugins/streams/server/routes/streams/fork.ts +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/fork.ts @@ -58,7 +58,11 @@ export const forkStreamsRoute = createServerRoute({ id: params.path.id, }); - const childDefinition = { ...params.body.stream, children: [], managed: true }; + if (rootDefinition.managed === false) { + throw new MalformedStreamId('Cannot fork a stream that is not managed'); + } + + const childDefinition = { ...params.body.stream, children: [] }; // check whether root stream has a child of the given name already if (rootDefinition.children.some((child) => child.id === childDefinition.id)) { diff --git a/x-pack/solutions/observability/plugins/streams/server/routes/streams/list.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/list.ts new file mode 100644 index 000000000000..f98c635830bd --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/list.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { notFound, internal } from '@hapi/boom'; +import { createServerRoute } from '../create_server_route'; +import { DefinitionNotFound } from '../../lib/streams/errors'; +import { listStreams } from '../../lib/streams/stream_crud'; +import { StreamDefinition } from '../../../common'; + +export const listStreamsRoute = createServerRoute({ + endpoint: 'GET /api/streams', + options: { + access: 'internal', + }, + security: { + authz: { + enabled: false, + reason: + 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', + }, + }, + params: z.object({}), + handler: async ({ + response, + request, + getScopedClients, + }): Promise<{ definitions: StreamDefinition[] }> => { + try { + const { scopedClusterClient } = await getScopedClients({ request }); + const { definitions } = await listStreams({ scopedClusterClient }); + + return { + definitions, + }; + } catch (e) { + if (e instanceof DefinitionNotFound) { + throw notFound(e); + } + + throw internal(e); + } + }, +}); diff --git a/x-pack/plugins/streams/server/routes/streams/read.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/read.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/streams/read.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/read.ts diff --git a/x-pack/plugins/streams/server/routes/streams/resync.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/resync.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/streams/resync.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/resync.ts diff --git a/x-pack/plugins/streams/server/routes/streams/sample.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/sample.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/streams/sample.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/sample.ts diff --git a/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/fields_simulation.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/fields_simulation.ts new file mode 100644 index 000000000000..01aa61a302a3 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/fields_simulation.ts @@ -0,0 +1,207 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { z } from '@kbn/zod'; +import { notFound, internal } from '@hapi/boom'; +import { getFlattenedObject } from '@kbn/std'; +import { fieldDefinitionSchema } from '../../../../common/types'; +import { createServerRoute } from '../../create_server_route'; +import { DefinitionNotFound } from '../../../lib/streams/errors'; +import { checkReadAccess } from '../../../lib/streams/stream_crud'; + +const SAMPLE_SIZE = 200; + +export const schemaFieldsSimulationRoute = createServerRoute({ + endpoint: 'POST /api/streams/{id}/schema/fields_simulation', + options: { + access: 'internal', + }, + security: { + authz: { + enabled: false, + reason: + 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', + }, + }, + params: z.object({ + path: z.object({ id: z.string() }), + body: z.object({ + field_definitions: z.array(fieldDefinitionSchema), + }), + }), + handler: async ({ + response, + params, + request, + logger, + getScopedClients, + }): Promise<{ + status: 'unknown' | 'success' | 'failure'; + simulationError: string | null; + documentsWithRuntimeFieldsApplied: unknown[] | null; + }> => { + try { + const { scopedClusterClient } = await getScopedClients({ request }); + + const hasAccess = await checkReadAccess({ id: params.path.id, scopedClusterClient }); + if (!hasAccess) { + throw new DefinitionNotFound(`Stream definition for ${params.path.id} not found.`); + } + + const propertiesForSample = Object.fromEntries( + params.body.field_definitions.map((field) => [field.name, { type: 'keyword' }]) + ); + + const documentSamplesSearchBody = { + // Add keyword runtime mappings so we can pair with exists, this is to attempt to "miss" less documents for the simulation. + runtime_mappings: propertiesForSample, + query: { + bool: { + filter: Object.keys(propertiesForSample).map((field) => ({ + exists: { field }, + })), + }, + }, + sort: [ + { + '@timestamp': { + order: 'desc', + }, + }, + ], + size: SAMPLE_SIZE, + }; + + const sampleResults = await scopedClusterClient.asCurrentUser.search({ + index: params.path.id, + ...documentSamplesSearchBody, + }); + + if ( + (typeof sampleResults.hits.total === 'object' && sampleResults.hits.total?.value === 0) || + sampleResults.hits.total === 0 || + !sampleResults.hits.total + ) { + return { + status: 'unknown', + simulationError: null, + documentsWithRuntimeFieldsApplied: null, + }; + } + + const propertiesForSimulation = Object.fromEntries( + params.body.field_definitions.map((field) => [ + field.name, + { type: field.type, ...(field.format ? { format: field.format } : {}) }, + ]) + ); + + const fieldDefinitionKeys = Object.keys(propertiesForSimulation); + + const sampleResultsAsSimulationDocs = sampleResults.hits.hits.map((hit) => ({ + _index: params.path.id, + _id: hit._id, + _source: Object.fromEntries( + Object.entries(getFlattenedObject(hit._source as Record)).filter( + ([k]) => fieldDefinitionKeys.includes(k) || k === '@timestamp' + ) + ), + })); + + const simulationBody = { + docs: sampleResultsAsSimulationDocs, + component_template_substitutions: { + [`${params.path.id}@stream.layer`]: { + template: { + mappings: { + dynamic: 'strict', + properties: propertiesForSimulation, + }, + }, + }, + }, + }; + + // TODO: We should be using scopedClusterClient.asCurrentUser.simulate.ingest() but the ES JS lib currently has a bug. The types also aren't available yet, so we use any. + const simulation = (await scopedClusterClient.asCurrentUser.transport.request({ + method: 'POST', + path: `_ingest/_simulate`, + body: simulationBody, + })) as any; + + const hasErrors = simulation.docs.some((doc: any) => doc.doc.error !== undefined); + + if (hasErrors) { + const documentWithError = simulation.docs.find((doc: any) => { + return doc.doc.error !== undefined; + }); + + return { + status: 'failure', + simulationError: JSON.stringify( + // Use the first error as a representative error + documentWithError.doc.error + ), + documentsWithRuntimeFieldsApplied: null, + }; + } + + // Convert the field definitions to a format that can be used in runtime mappings (match_only_text -> keyword) + const propertiesCompatibleWithRuntimeMappings = Object.fromEntries( + params.body.field_definitions.map((field) => [ + field.name, + { + type: field.type === 'match_only_text' ? 'keyword' : field.type, + ...(field.format ? { format: field.format } : {}), + }, + ]) + ); + + const runtimeFieldsSearchBody = { + runtime_mappings: propertiesCompatibleWithRuntimeMappings, + sort: [ + { + '@timestamp': { + order: 'desc', + }, + }, + ], + size: SAMPLE_SIZE, + fields: params.body.field_definitions.map((field) => field.name), + _source: false, + }; + + // This gives us a "fields" representation rather than _source from the simulation + const runtimeFieldsResult = await scopedClusterClient.asCurrentUser.search({ + index: params.path.id, + ...runtimeFieldsSearchBody, + }); + + return { + status: 'success', + simulationError: null, + documentsWithRuntimeFieldsApplied: runtimeFieldsResult.hits.hits + .map((hit) => { + if (!hit.fields) { + return {}; + } + return Object.keys(hit.fields).reduce>((acc, field) => { + acc[field] = hit.fields![field][0]; + return acc; + }, {}); + }) + .filter((doc) => Object.keys(doc).length > 0), + }; + } catch (e) { + if (e instanceof DefinitionNotFound) { + throw notFound(e); + } + + throw internal(e); + } + }, +}); diff --git a/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/unmapped_fields.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/unmapped_fields.ts new file mode 100644 index 000000000000..15bcb964b8fd --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/server/routes/streams/schema/unmapped_fields.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 { z } from '@kbn/zod'; +import { internal, notFound } from '@hapi/boom'; +import { getFlattenedObject } from '@kbn/std'; +import { DefinitionNotFound } from '../../../lib/streams/errors'; +import { checkReadAccess, readAncestors, readStream } from '../../../lib/streams/stream_crud'; +import { createServerRoute } from '../../create_server_route'; + +const SAMPLE_SIZE = 500; + +export const unmappedFieldsRoute = createServerRoute({ + endpoint: 'GET /api/streams/{id}/schema/unmapped_fields', + options: { + access: 'internal', + }, + security: { + authz: { + enabled: false, + reason: + 'This API delegates security to the currently logged in user and their Elasticsearch permissions.', + }, + }, + params: z.object({ + path: z.object({ id: z.string() }), + }), + handler: async ({ + response, + params, + request, + logger, + getScopedClients, + }): Promise<{ unmappedFields: string[] }> => { + try { + const { scopedClusterClient } = await getScopedClients({ request }); + + const hasAccess = await checkReadAccess({ id: params.path.id, scopedClusterClient }); + if (!hasAccess) { + throw new DefinitionNotFound(`Stream definition for ${params.path.id} not found.`); + } + + const streamEntity = await readStream({ + scopedClusterClient, + id: params.path.id, + }); + + const searchBody = { + sort: [ + { + '@timestamp': { + order: 'desc', + }, + }, + ], + size: SAMPLE_SIZE, + }; + + const results = await scopedClusterClient.asCurrentUser.search({ + index: params.path.id, + ...searchBody, + }); + + const sourceFields = new Set(); + + results.hits.hits.forEach((hit) => { + Object.keys(getFlattenedObject(hit._source as Record)).forEach((field) => { + sourceFields.add(field); + }); + }); + + // Mapped fields from the stream's definition and inherited from ancestors + const mappedFields = new Set(); + + streamEntity.definition.fields.forEach((field) => mappedFields.add(field.name)); + + const { ancestors } = await readAncestors({ + id: params.path.id, + scopedClusterClient, + }); + + for (const ancestor of ancestors) { + ancestor.definition.fields.forEach((field) => mappedFields.add(field.name)); + } + + const unmappedFields = Array.from(sourceFields) + .filter((field) => !mappedFields.has(field)) + .sort(); + + return { unmappedFields }; + } catch (e) { + if (e instanceof DefinitionNotFound) { + throw notFound(e); + } + + throw internal(e); + } + }, +}); diff --git a/x-pack/plugins/streams/server/routes/streams/settings.ts b/x-pack/solutions/observability/plugins/streams/server/routes/streams/settings.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/streams/settings.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/streams/settings.ts diff --git a/x-pack/plugins/streams/server/routes/types.ts b/x-pack/solutions/observability/plugins/streams/server/routes/types.ts similarity index 100% rename from x-pack/plugins/streams/server/routes/types.ts rename to x-pack/solutions/observability/plugins/streams/server/routes/types.ts diff --git a/x-pack/plugins/streams/server/types.ts b/x-pack/solutions/observability/plugins/streams/server/types.ts similarity index 100% rename from x-pack/plugins/streams/server/types.ts rename to x-pack/solutions/observability/plugins/streams/server/types.ts diff --git a/x-pack/solutions/observability/plugins/streams/tsconfig.json b/x-pack/solutions/observability/plugins/streams/tsconfig.json new file mode 100644 index 000000000000..fbb8515998fb --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams/tsconfig.json @@ -0,0 +1,36 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../../typings/**/*", + "common/**/*", + "server/**/*", + "public/**/*", + "types/**/*" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/config-schema", + "@kbn/core", + "@kbn/logging", + "@kbn/core-plugins-server", + "@kbn/core-http-server", + "@kbn/security-plugin", + "@kbn/core-saved-objects-api-server", + "@kbn/core-elasticsearch-server", + "@kbn/task-manager-plugin", + "@kbn/server-route-repository", + "@kbn/zod", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/licensing-plugin", + "@kbn/server-route-repository-client", + "@kbn/observability-utils-server", + "@kbn/observability-utils-common", + "@kbn/std", + "@kbn/safer-lodash-set" + ] +} diff --git a/x-pack/plugins/streams_app/.storybook/get_mock_streams_app_context.tsx b/x-pack/solutions/observability/plugins/streams_app/.storybook/get_mock_streams_app_context.tsx similarity index 100% rename from x-pack/plugins/streams_app/.storybook/get_mock_streams_app_context.tsx rename to x-pack/solutions/observability/plugins/streams_app/.storybook/get_mock_streams_app_context.tsx diff --git a/x-pack/plugins/streams_app/.storybook/jest_setup.js b/x-pack/solutions/observability/plugins/streams_app/.storybook/jest_setup.js similarity index 100% rename from x-pack/plugins/streams_app/.storybook/jest_setup.js rename to x-pack/solutions/observability/plugins/streams_app/.storybook/jest_setup.js diff --git a/x-pack/plugins/observability_solution/ux/.storybook/main.js b/x-pack/solutions/observability/plugins/streams_app/.storybook/main.js similarity index 100% rename from x-pack/plugins/observability_solution/ux/.storybook/main.js rename to x-pack/solutions/observability/plugins/streams_app/.storybook/main.js diff --git a/x-pack/plugins/streams_app/.storybook/preview.js b/x-pack/solutions/observability/plugins/streams_app/.storybook/preview.js similarity index 100% rename from x-pack/plugins/streams_app/.storybook/preview.js rename to x-pack/solutions/observability/plugins/streams_app/.storybook/preview.js diff --git a/x-pack/plugins/streams_app/.storybook/storybook_decorator.tsx b/x-pack/solutions/observability/plugins/streams_app/.storybook/storybook_decorator.tsx similarity index 100% rename from x-pack/plugins/streams_app/.storybook/storybook_decorator.tsx rename to x-pack/solutions/observability/plugins/streams_app/.storybook/storybook_decorator.tsx diff --git a/x-pack/plugins/streams_app/README.md b/x-pack/solutions/observability/plugins/streams_app/README.md similarity index 100% rename from x-pack/plugins/streams_app/README.md rename to x-pack/solutions/observability/plugins/streams_app/README.md diff --git a/x-pack/plugins/streams_app/common/entity_source_query.ts b/x-pack/solutions/observability/plugins/streams_app/common/entity_source_query.ts similarity index 100% rename from x-pack/plugins/streams_app/common/entity_source_query.ts rename to x-pack/solutions/observability/plugins/streams_app/common/entity_source_query.ts diff --git a/x-pack/plugins/streams_app/common/index.ts b/x-pack/solutions/observability/plugins/streams_app/common/index.ts similarity index 100% rename from x-pack/plugins/streams_app/common/index.ts rename to x-pack/solutions/observability/plugins/streams_app/common/index.ts diff --git a/x-pack/solutions/observability/plugins/streams_app/jest.config.js b/x-pack/solutions/observability/plugins/streams_app/jest.config.js new file mode 100644 index 000000000000..f18fb09f5c2f --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: [ + '/x-pack/solutions/observability/plugins/streams_app/public', + '/x-pack/solutions/observability/plugins/streams_app/common', + '/x-pack/solutions/observability/plugins/streams_app/server', + ], + setupFiles: [ + '/x-pack/solutions/observability/plugins/streams_app/.storybook/jest_setup.js', + ], + collectCoverage: true, + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/streams_app/{public,common,server}/**/*.{js,ts,tsx}', + ], + + coverageReporters: ['html'], +}; diff --git a/x-pack/plugins/streams_app/kibana.jsonc b/x-pack/solutions/observability/plugins/streams_app/kibana.jsonc similarity index 100% rename from x-pack/plugins/streams_app/kibana.jsonc rename to x-pack/solutions/observability/plugins/streams_app/kibana.jsonc diff --git a/x-pack/plugins/streams_app/public/application.tsx b/x-pack/solutions/observability/plugins/streams_app/public/application.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/application.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/application.tsx diff --git a/x-pack/plugins/streams_app/public/components/app_root/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/app_root/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/app_root/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/app_root/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/assets/illustration.png b/x-pack/solutions/observability/plugins/streams_app/public/components/assets/illustration.png similarity index 100% rename from x-pack/plugins/streams_app/public/components/assets/illustration.png rename to x-pack/solutions/observability/plugins/streams_app/public/components/assets/illustration.png diff --git a/x-pack/plugins/streams_app/public/components/condition_editor/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/condition_editor/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/condition_editor/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/condition_editor/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/entity_detail_view/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/entity_detail_view/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/entity_detail_view/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/entity_detail_view/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/entity_detail_view_header_section/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/entity_detail_view_header_section/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/entity_detail_view_header_section/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/entity_detail_view_header_section/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/entity_overview_tab_list/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/entity_overview_tab_list/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/entity_overview_tab_list/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/entity_overview_tab_list/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/esql_chart/controlled_esql_chart.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/esql_chart/controlled_esql_chart.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/esql_chart/controlled_esql_chart.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/esql_chart/controlled_esql_chart.tsx diff --git a/x-pack/plugins/streams_app/public/components/loading_panel/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/loading_panel/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/loading_panel/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/loading_panel/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/nested_view/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/nested_view/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/nested_view/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/nested_view/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/not_found/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/not_found/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/not_found/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/not_found/index.tsx diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/preview_table/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/preview_table/index.tsx new file mode 100644 index 000000000000..d200e6b3b40b --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/preview_table/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 { EuiDataGrid } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React, { useEffect, useMemo, useState } from 'react'; + +export function PreviewTable({ + documents, + displayColumns, +}: { + documents: unknown[]; + displayColumns?: string[]; +}) { + const [height, setHeight] = useState('100px'); + useEffect(() => { + // set height to 100% after a short delay otherwise it doesn't calculate correctly + // TODO: figure out a better way to do this + setTimeout(() => { + setHeight(`100%`); + }, 50); + }, []); + + const columns = useMemo(() => { + if (displayColumns) return displayColumns; + + const cols = new Set(); + documents.forEach((doc) => { + if (!doc || typeof doc !== 'object') { + return; + } + Object.keys(doc).forEach((key) => { + cols.add(key); + }); + }); + return Array.from(cols); + }, [displayColumns, documents]); + + const gridColumns = useMemo(() => { + return Array.from(columns).map((column) => ({ + id: column, + displayAsText: column, + })); + }, [columns]); + + return ( + {}, + canDragAndDropColumns: false, + }} + toolbarVisibility={false} + rowCount={documents.length} + height={height} + renderCellValue={({ rowIndex, columnId }) => { + const doc = documents[rowIndex]; + if (!doc || typeof doc !== 'object') { + return ''; + } + const value = (doc as Record)[columnId]; + if (value === undefined || value === null) { + return ''; + } + if (typeof value === 'object') { + return JSON.stringify(value); + } + return String(value); + }} + /> + ); +} diff --git a/x-pack/plugins/streams_app/public/components/redirect_to/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/redirect_to/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/redirect_to/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/redirect_to/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/stream_delete_modal/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_delete_modal/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/stream_delete_modal/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/stream_delete_modal/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/stream_detail_enriching/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_enriching/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/stream_detail_enriching/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_enriching/index.tsx diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/classic.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/classic.tsx new file mode 100644 index 000000000000..1664b322b5a8 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/classic.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ReadStreamDefinition, StreamDefinition } from '@kbn/streams-plugin/common'; +import { EuiFlexGroup, EuiListGroup, EuiText } from '@elastic/eui'; +import { useStreamsAppParams } from '../../hooks/use_streams_app_params'; +import { RedirectTo } from '../redirect_to'; +import { StreamDetailEnriching } from '../stream_detail_enriching'; +import { useKibana } from '../../hooks/use_kibana'; +import { Wrapper } from './wrapper'; + +type ManagementSubTabs = 'enrich' | 'overview'; + +function isValidManagementSubTab(value: string): value is ManagementSubTabs { + return ['enrich', 'overview'].includes(value); +} + +export function ClassicStreamDetailManagement({ + definition, + refreshDefinition, +}: { + definition: ReadStreamDefinition; + refreshDefinition: () => void; +}) { + const { + path: { key, subtab }, + } = useStreamsAppParams('/{key}/management/{subtab}'); + + const tabs = { + overview: { + content: , + label: i18n.translate('xpack.streams.streamDetailView.overviewTab', { + defaultMessage: 'Overview', + }), + }, + enrich: { + content: ( + + ), + label: i18n.translate('xpack.streams.streamDetailView.enrichingTab', { + defaultMessage: 'Extract field', + }), + }, + }; + + if (!isValidManagementSubTab(subtab)) { + return ( + + ); + } + + return ; +} + +function UnmanagedStreamOverview({ definition }: { definition: StreamDefinition }) { + const { + core: { + http: { basePath }, + }, + } = useKibana(); + const groupedAssets = (definition.unmanaged_elasticsearch_assets ?? []).reduce((acc, asset) => { + const title = assetToTitle(asset); + if (title) { + acc[title] = acc[title] ?? []; + acc[title].push(asset); + } + return acc; + }, {} as Record>); + return ( + + +

+ {i18n.translate('xpack.streams.streamDetailView.unmanagedStreamOverview', { + defaultMessage: + 'This stream is not managed. Follow the links to stack management to change the related Elasticsearch objects.', + })} +

+ + {Object.entries(groupedAssets).map(([title, assets]) => ( +
+ +

{title}

+
+ ({ + label: asset.id, + href: basePath.prepend(assetToLink(asset)), + iconType: 'index', + target: '_blank', + }))} + /> +
+ ))} + + ); +} + +function assetToLink(asset: { type: string; id: string }) { + switch (asset.type) { + case 'index_template': + return `/app/management/data/index_management/templates/${asset.id}`; + case 'component_template': + return `/app/management/data/index_management/component_templates/${asset.id}`; + case 'data_stream': + return `/app/management/data/index_management/data_streams/${asset.id}`; + case 'ingest_pipeline': + return `/app/management/ingest/ingest_pipelines?pipeline=${asset.id}`; + default: + return ''; + } +} + +function assetToTitle(asset: { type: string; id: string }) { + switch (asset.type) { + case 'index_template': + return i18n.translate('xpack.streams.streamDetailView.indexTemplate', { + defaultMessage: 'Index template', + }); + case 'component_template': + return i18n.translate('xpack.streams.streamDetailView.componentTemplate', { + defaultMessage: 'Component template', + }); + case 'data_stream': + return i18n.translate('xpack.streams.streamDetailView.dataStream', { + defaultMessage: 'Data stream', + }); + case 'ingest_pipeline': + return i18n.translate('xpack.streams.streamDetailView.ingestPipeline', { + defaultMessage: 'Ingest pipeline', + }); + default: + return ''; + } +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/index.tsx new file mode 100644 index 000000000000..24567fe8d80a --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/index.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 { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { WiredStreamDetailManagement } from './wired'; +import { ClassicStreamDetailManagement } from './classic'; + +export function StreamDetailManagement({ + definition, + refreshDefinition, + isLoadingDefinition, +}: { + definition?: ReadStreamDefinition; + refreshDefinition: () => void; + isLoadingDefinition: boolean; +}) { + if (!definition) { + return null; + } + + if (definition.managed) { + return ( + + ); + } + + return ( + + ); +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wired.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wired.tsx new file mode 100644 index 000000000000..6b4888c8d466 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wired.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 React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { useStreamsAppParams } from '../../hooks/use_streams_app_params'; +import { RedirectTo } from '../redirect_to'; +import { StreamDetailRouting } from '../stream_detail_routing'; +import { StreamDetailEnriching } from '../stream_detail_enriching'; +import { StreamDetailSchemaEditor } from '../stream_detail_schema_editor'; +import { Wrapper } from './wrapper'; + +type ManagementSubTabs = 'route' | 'enrich' | 'schemaEditor'; + +function isValidManagementSubTab(value: string): value is ManagementSubTabs { + return ['route', 'enrich', 'schemaEditor'].includes(value); +} + +export function WiredStreamDetailManagement({ + definition, + refreshDefinition, + isLoadingDefinition, +}: { + definition?: ReadStreamDefinition; + refreshDefinition: () => void; + isLoadingDefinition: boolean; +}) { + const { + path: { key, subtab }, + } = useStreamsAppParams('/{key}/management/{subtab}'); + + const tabs = { + route: { + content: ( + + ), + label: i18n.translate('xpack.streams.streamDetailView.routingTab', { + defaultMessage: 'Streams Partitioning', + }), + }, + enrich: { + content: ( + + ), + label: i18n.translate('xpack.streams.streamDetailView.enrichingTab', { + defaultMessage: 'Extract field', + }), + }, + schemaEditor: { + content: ( + + ), + label: i18n.translate('xpack.streams.streamDetailView.schemaEditorTab', { + defaultMessage: 'Schema editor', + }), + }, + }; + + if (!isValidManagementSubTab(subtab)) { + return ( + + ); + } + + return ; +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wrapper.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wrapper.tsx new file mode 100644 index 000000000000..92d80924298f --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_management/wrapper.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 { EuiButtonGroup, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; +import React from 'react'; +import { css } from '@emotion/css'; +import { useStreamsAppRouter } from '../../hooks/use_streams_app_router'; + +export function Wrapper({ + tabs, + streamId, + subtab, +}: { + tabs: Record; + streamId: string; + subtab: string; +}) { + const router = useStreamsAppRouter(); + return ( + + + { + router.push('/{key}/management/{subtab}', { + path: { key: streamId, subtab: optionId }, + query: {}, + }); + }} + options={Object.keys(tabs).map((id) => ({ + id, + label: tabs[id].label, + }))} + /> + + + {tabs[subtab].content} + + + ); +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_overview/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_overview/index.tsx new file mode 100644 index 000000000000..28af5f4f104c --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_overview/index.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 { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; +import { calculateAuto } from '@kbn/calculate-auto'; +import { i18n } from '@kbn/i18n'; +import { useDateRange } from '@kbn/observability-utils-browser/hooks/use_date_range'; +import moment from 'moment'; +import React, { useMemo } from 'react'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { useKibana } from '../../hooks/use_kibana'; +import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; +import { ControlledEsqlChart } from '../esql_chart/controlled_esql_chart'; +import { StreamsAppSearchBar } from '../streams_app_search_bar'; + +export function StreamDetailOverview({ definition }: { definition?: ReadStreamDefinition }) { + const { + dependencies: { + start: { + data, + dataViews, + streams: { streamsRepositoryClient }, + share, + }, + }, + } = useKibana(); + + const { + timeRange, + absoluteTimeRange: { start, end }, + setTimeRange, + } = useDateRange({ data }); + + const indexPatterns = useMemo(() => { + if (!definition?.id) { + return undefined; + } + + const isRoot = definition.id.indexOf('.') === -1; + + const dataStreamOfDefinition = definition.id; + + return isRoot + ? [dataStreamOfDefinition, `${dataStreamOfDefinition}.*`] + : [`${dataStreamOfDefinition}*`]; + }, [definition?.id]); + + const discoverLocator = useMemo( + () => share.url.locators.get('DISCOVER_APP_LOCATOR'), + [share.url.locators] + ); + + const queries = useMemo(() => { + if (!indexPatterns) { + return undefined; + } + + const baseQuery = `FROM ${indexPatterns.join(', ')}`; + + const bucketSize = Math.round( + calculateAuto.atLeast(50, moment.duration(1, 'minute'))!.asSeconds() + ); + + const histogramQuery = `${baseQuery} | STATS metric = COUNT(*) BY @timestamp = BUCKET(@timestamp, ${bucketSize} seconds)`; + + return { + baseQuery, + histogramQuery, + }; + }, [indexPatterns]); + + const discoverLink = useMemo(() => { + if (!discoverLocator || !queries?.baseQuery) { + return undefined; + } + + return discoverLocator.getRedirectUrl({ + query: { + esql: queries.baseQuery, + }, + }); + }, [queries?.baseQuery, discoverLocator]); + + const histogramQueryFetch = useStreamsAppFetch( + async ({ signal }) => { + if (!queries?.histogramQuery || !indexPatterns) { + return undefined; + } + + const existingIndices = await dataViews.getExistingIndices(indexPatterns); + + if (existingIndices.length === 0) { + return undefined; + } + + return streamsRepositoryClient.fetch('POST /internal/streams/esql', { + params: { + body: { + operationName: 'get_histogram_for_stream', + query: queries.histogramQuery, + start, + end, + }, + }, + signal, + }); + }, + [indexPatterns, dataViews, streamsRepositoryClient, queries?.histogramQuery, start, end] + ); + + return ( + <> + + + + + { + if (!isUpdate) { + histogramQueryFetch.refresh(); + return; + } + + if (dateRange) { + setTimeRange({ from: dateRange.from, to: dateRange?.to, mode: dateRange.mode }); + } + }} + onRefresh={() => { + histogramQueryFetch.refresh(); + }} + placeholder={i18n.translate( + 'xpack.streams.entityDetailOverview.searchBarPlaceholder', + { + defaultMessage: 'Filter data by using KQL', + } + )} + dateRangeFrom={timeRange.from} + dateRangeTo={timeRange.to} + /> + + + {i18n.translate('xpack.streams.streamDetailOverview.openInDiscoverButtonLabel', { + defaultMessage: 'Open in Discover', + })} + + + + + + + + + + + + + ); +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_routing/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_routing/index.tsx new file mode 100644 index 000000000000..2b829aca37b8 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_routing/index.tsx @@ -0,0 +1,786 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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, + EuiButtonEmpty, + EuiButtonIcon, + EuiFieldText, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiIcon, + EuiImage, + EuiLoadingSpinner, + EuiPanel, + EuiResizableContainer, + EuiSpacer, + EuiText, + useEuiTheme, +} from '@elastic/eui'; +import { css } from '@emotion/css'; +import { i18n } from '@kbn/i18n'; +import { useAbortController } from '@kbn/observability-utils-browser/hooks/use_abort_controller'; +import { useDateRange } from '@kbn/observability-utils-browser/hooks/use_date_range'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import React from 'react'; +import { StreamChild } from '@kbn/streams-plugin/common/types'; +import { AbortableAsyncState } from '@kbn/observability-utils-browser/hooks/use_abortable_async'; +import { useKibana } from '../../hooks/use_kibana'; +import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; +import { StreamsAppSearchBar } from '../streams_app_search_bar'; +import { ConditionEditor } from '../condition_editor'; +import { useDebounced } from '../../util/use_debounce'; +import { useStreamsAppRouter } from '../../hooks/use_streams_app_router'; +import { NestedView } from '../nested_view'; +import illustration from '../assets/illustration.png'; +import { PreviewTable } from '../preview_table'; +import { StreamDeleteModal } from '../stream_delete_modal'; + +function useRoutingState() { + const [childUnderEdit, setChildUnderEdit] = React.useState< + { isNew: boolean; child: StreamChild } | undefined + >(); + + const debouncedChildUnderEdit = useDebounced(childUnderEdit, 300); + + const [saveInProgress, setSaveInProgress] = React.useState(false); + const [showDeleteModal, setShowDeleteModal] = React.useState(false); + + return { + debouncedChildUnderEdit, + childUnderEdit, + setChildUnderEdit, + saveInProgress, + setSaveInProgress, + showDeleteModal, + setShowDeleteModal, + }; +} + +export function StreamDetailRouting({ + definition, + refreshDefinition, +}: { + definition?: ReadStreamDefinition; + refreshDefinition: () => void; +}) { + const theme = useEuiTheme().euiTheme; + const routingAppState = useRoutingState(); + + if (!definition) { + return null; + } + + const closeModal = () => routingAppState.setShowDeleteModal(false); + + return ( + + {routingAppState.showDeleteModal && routingAppState.childUnderEdit && ( + routingAppState.setChildUnderEdit(undefined)} + refreshDefinition={refreshDefinition} + id={routingAppState.childUnderEdit.child.id} + /> + )} + + + + {(EuiResizablePanel, EuiResizableButton) => ( + <> + + + + + + + + + + + )} + + + + + + + + ); +} + +function ControlBar({ + definition, + routingAppState, + refreshDefinition, +}: { + definition: ReadStreamDefinition; + routingAppState: ReturnType; + refreshDefinition: () => void; +}) { + const { + core: { notifications }, + dependencies: { + start: { + streams: { streamsRepositoryClient }, + }, + }, + } = useKibana(); + + const { signal } = useAbortController(); + + if (!routingAppState.childUnderEdit) { + return ( + + + {i18n.translate('xpack.streams.streamDetailRouting.save', { + defaultMessage: 'Save', + })} + + + ); + } + + function forkChild() { + if (!routingAppState.childUnderEdit) { + return; + } + return streamsRepositoryClient.fetch('POST /api/streams/{id}/_fork', { + signal, + params: { + path: { + id: definition.id, + }, + body: { + condition: routingAppState.childUnderEdit.child.condition, + stream: { + id: routingAppState.childUnderEdit.child.id, + processing: [], + fields: [], + }, + }, + }, + }); + } + + function updateChild() { + if (!routingAppState.childUnderEdit) { + return; + } + + const childUnderEdit = routingAppState.childUnderEdit.child; + const { inheritedFields, id, ...definitionToUpdate } = definition; + return streamsRepositoryClient.fetch('PUT /api/streams/{id}', { + signal, + params: { + path: { + id: definition.id, + }, + body: { + ...definitionToUpdate, + children: definition.children.map((child) => + child.id === childUnderEdit.id ? childUnderEdit : child + ), + }, + }, + }); + } + + async function saveOrUpdateChild() { + if (!routingAppState.childUnderEdit) { + return; + } + try { + routingAppState.setSaveInProgress(true); + + if (routingAppState.childUnderEdit.isNew) { + await forkChild(); + } else { + await updateChild(); + } + + routingAppState.setSaveInProgress(false); + notifications.toasts.addSuccess({ + title: i18n.translate('xpack.streams.streamDetailRouting.saved', { + defaultMessage: 'Stream saved', + }), + }); + routingAppState.setChildUnderEdit(undefined); + refreshDefinition(); + } catch (error) { + routingAppState.setSaveInProgress(false); + notifications.toasts.addError(error, { + title: i18n.translate('xpack.streams.failedToSave', { + defaultMessage: 'Failed to save', + }), + toastMessage: 'body' in error ? error.body.message : error.message, + }); + } + } + + return ( + + {!routingAppState.childUnderEdit.isNew && ( + <> + { + routingAppState.setShowDeleteModal(true); + }} + > + {i18n.translate('xpack.streams.streamDetailRouting.remove', { + defaultMessage: 'Remove', + })} + + + + )} + { + routingAppState.setChildUnderEdit(undefined); + }} + > + {i18n.translate('xpack.streams.streamDetailRouting.cancel', { + defaultMessage: 'Cancel', + })} + + + {routingAppState.childUnderEdit.isNew + ? i18n.translate('xpack.streams.streamDetailRouting.add', { + defaultMessage: 'Save', + }) + : i18n.translate('xpack.streams.streamDetailRouting.change', { + defaultMessage: 'Change routing', + })} + + + ); +} + +function PreviewPanel({ + definition, + routingAppState, +}: { + definition: ReadStreamDefinition; + routingAppState: ReturnType; +}) { + const { + dependencies: { + start: { + data, + streams: { streamsRepositoryClient }, + }, + }, + } = useKibana(); + + const { + timeRange, + absoluteTimeRange: { start, end }, + setTimeRange, + } = useDateRange({ data }); + + const previewSampleFetch = useStreamsAppFetch( + ({ signal }) => { + if ( + !definition || + !routingAppState.debouncedChildUnderEdit || + !routingAppState.debouncedChildUnderEdit.isNew + ) { + return Promise.resolve({ documents: [] }); + } + return streamsRepositoryClient.fetch('POST /api/streams/{id}/_sample', { + signal, + params: { + path: { + id: definition.id, + }, + body: { + condition: routingAppState.debouncedChildUnderEdit.child.condition, + start: start?.valueOf(), + end: end?.valueOf(), + number: 100, + }, + }, + }); + }, + [definition, routingAppState.debouncedChildUnderEdit, streamsRepositoryClient, start, end], + { + disableToastOnError: true, + } + ); + + let content = ( + + ); + + if (routingAppState.debouncedChildUnderEdit?.isNew) { + if (previewSampleFetch.error) { + content = ( + + + + {i18n.translate('xpack.streams.streamDetail.preview.error', { + defaultMessage: 'Error loading preview', + })} + + + + ); + } else if (previewSampleFetch.value?.documents && previewSampleFetch.value.documents.length) { + content = ( + + + + ); + } + } + + return ( + <> + + + + + + + {i18n.translate('xpack.streams.streamDetail.preview.header', { + defaultMessage: 'Data Preview', + })} + {previewSampleFetch.loading && } + + + + + { + if (!isUpdate) { + previewSampleFetch.refresh(); + return; + } + + if (dateRange) { + setTimeRange({ + from: dateRange.from, + to: dateRange?.to, + mode: dateRange.mode, + }); + } + }} + onRefresh={() => { + previewSampleFetch.refresh(); + }} + dateRangeFrom={timeRange.from} + dateRangeTo={timeRange.to} + /> + + + + + {content} + + ); +} + +function PreviewPanelIllustration({ + previewSampleFetch, + routingAppState, +}: { + routingAppState: ReturnType; + previewSampleFetch: AbortableAsyncState<{ + documents: unknown[]; + }>; +}) { + return ( + + + + {previewSampleFetch.loading ? ( + + + + ) : ( + <> + {routingAppState.debouncedChildUnderEdit && + routingAppState.debouncedChildUnderEdit.isNew && ( + + {i18n.translate('xpack.streams.streamDetail.preview.empty', { + defaultMessage: 'No documents to preview', + })} + + )} + {routingAppState.debouncedChildUnderEdit && + !routingAppState.debouncedChildUnderEdit.isNew && ( + + {i18n.translate('xpack.streams.streamDetail.preview.editPreviewMessage', { + defaultMessage: 'Preview is not available while editing streams', + })} + + )} + {!routingAppState.debouncedChildUnderEdit && ( + <> + + {i18n.translate('xpack.streams.streamDetail.preview.editPreviewMessageEmpty', { + defaultMessage: 'Your preview will appear here', + })} + + + {i18n.translate( + 'xpack.streams.streamDetail.preview.editPreviewMessageEmptyDescription', + { + defaultMessage: + 'Create a new child stream to see what will be routed to it based on the conditions', + } + )} + + + )} + + )} + + + ); +} + +function ChildStreamList({ + definition, + routingAppState: { childUnderEdit, setChildUnderEdit }, +}: { + definition: ReadStreamDefinition; + routingAppState: ReturnType; +}) { + return ( + + + + {i18n.translate('xpack.streams.streamDetailRouting.rules.header', { + defaultMessage: 'Routing rules', + })} + + + + + + {definition.children.map((child, i) => ( + + { + if (child.id === childUnderEdit?.child.id) { + setChildUnderEdit(undefined); + } else { + setChildUnderEdit({ isNew: false, child }); + } + }} + onChildChange={(newChild) => { + setChildUnderEdit({ + isNew: false, + child: newChild, + }); + }} + /> + + ))} + {childUnderEdit?.isNew ? ( + + { + if (!newChild) { + setChildUnderEdit(undefined); + return; + } + setChildUnderEdit({ + isNew: true, + child: newChild, + }); + }} + /> + + ) : ( + + + { + setChildUnderEdit({ + isNew: true, + child: { + id: `${definition.id}.child`, + condition: { + field: '', + operator: 'eq', + value: '', + }, + }, + }); + }} + > + {i18n.translate('xpack.streams.streamDetailRouting.addRule', { + defaultMessage: 'Create a new child stream', + })} + + + + )} + + + ); +} + +function CurrentStreamEntry({ definition }: { definition: ReadStreamDefinition }) { + return ( + + + {definition.id} + + {i18n.translate('xpack.streams.streamDetailRouting.currentStream', { + defaultMessage: 'Current stream', + })} + + + + ); +} + +function PreviousStreamEntry({ definition }: { definition: ReadStreamDefinition }) { + const router = useStreamsAppRouter(); + + const parentId = definition.id.split('.').slice(0, -1).join('.'); + if (parentId === '') { + return null; + } + + return ( + + + + + {i18n.translate('xpack.streams.streamDetailRouting.previousStream', { + defaultMessage: '.. (Previous stream)', + })} + + + + + ); +} + +function RoutingStreamEntry({ + child, + onChildChange, + onEditStateChange, + edit, +}: { + child: StreamChild; + onChildChange: (child: StreamChild) => void; + onEditStateChange: () => void; + edit?: boolean; +}) { + const router = useStreamsAppRouter(); + return ( + + + + {child.id} + + { + onEditStateChange(); + }} + aria-label={i18n.translate('xpack.streams.streamDetailRouting.edit', { + defaultMessage: 'Edit', + })} + /> + + + {child.condition && ( + { + onChildChange({ + ...child, + condition, + }); + }} + /> + )} + {!child.condition && ( + + {i18n.translate('xpack.streams.streamDetailRouting.noCondition', { + defaultMessage: 'No condition, no documents will be routed', + })} + + )} + + ); +} + +function NewRoutingStreamEntry({ + child, + onChildChange, +}: { + child: StreamChild; + onChildChange: (child?: StreamChild) => void; +}) { + return ( + + + + { + onChildChange({ + ...child, + id: e.target.value, + }); + }} + /> + + {child.condition && ( + { + onChildChange({ + ...child, + condition, + }); + }} + /> + )} + {!child.condition && ( + + {i18n.translate('xpack.streams.streamDetailRouting.noCondition', { + defaultMessage: 'No condition, no documents will be routed', + })} + + )} + + + ); +} diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_parent.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_parent.tsx new file mode 100644 index 000000000000..5f8b6f4af0ff --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_parent.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 { EuiBadge } from '@elastic/eui'; +import React from 'react'; +import { useStreamsAppRouter } from '../../hooks/use_streams_app_router'; + +export const FieldParent = ({ + parent, + linkEnabled = false, +}: { + parent: string; + linkEnabled?: boolean; +}) => { + const router = useStreamsAppRouter(); + return linkEnabled ? ( + + {parent} + + ) : ( + {parent} + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_status.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_status.tsx new file mode 100644 index 000000000000..dda456a9f49f --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_status.tsx @@ -0,0 +1,41 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBadge } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; + +export type FieldStatus = 'inherited' | 'mapped' | 'unmapped'; + +export const FIELD_STATUS_MAP = { + inherited: { + color: 'hollow', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorInheritedStatusLabel', { + defaultMessage: 'Inherited', + }), + }, + mapped: { + color: 'success', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorMappedStatusLabel', { + defaultMessage: 'Mapped', + }), + }, + unmapped: { + color: 'default', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorUnmappedStatusLabel', { + defaultMessage: 'Unmapped', + }), + }, +}; + +export const FieldStatus = ({ status }: { status: FieldStatus }) => { + return ( + <> + {FIELD_STATUS_MAP[status].label} + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_type.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_type.tsx new file mode 100644 index 000000000000..a278d22dcd3e --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/field_type.tsx @@ -0,0 +1,67 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiFlexGroup, EuiFlexItem, EuiToken } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FieldDefinition } from '@kbn/streams-plugin/common/types'; +import React from 'react'; + +export const FIELD_TYPE_MAP = { + boolean: { + icon: 'tokenBoolean', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableBooleanType', { + defaultMessage: 'Boolean', + }), + }, + date: { + icon: 'tokenDate', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableDateType', { + defaultMessage: 'Date', + }), + }, + keyword: { + icon: 'tokenKeyword', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableKeywordType', { + defaultMessage: 'Keyword', + }), + }, + match_only_text: { + icon: 'tokenText', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableTextType', { + defaultMessage: 'Text', + }), + }, + long: { + icon: 'tokenNumber', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableNumberType', { + defaultMessage: 'Number', + }), + }, + double: { + icon: 'tokenNumber', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableNumberType', { + defaultMessage: 'Number', + }), + }, + ip: { + icon: 'tokenIP', + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableIpType', { + defaultMessage: 'IP', + }), + }, +}; + +export const FieldType = ({ type }: { type: FieldDefinition['type'] }) => { + return ( + + + + + {`${FIELD_TYPE_MAP[type].label}`} + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/fields_table.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/fields_table.tsx new file mode 100644 index 000000000000..b50fdee7e6ae --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/fields_table.tsx @@ -0,0 +1,355 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { + EuiButtonIcon, + EuiContextMenu, + EuiDataGrid, + EuiPopover, + EuiSearchBar, + useGeneratedHtmlId, +} from '@elastic/eui'; +import type { + EuiContextMenuPanelDescriptor, + EuiContextMenuPanelItemDescriptor, + EuiDataGridProps, + Query, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import useToggle from 'react-use/lib/useToggle'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common/types'; +import { FieldType } from './field_type'; +import { FieldStatus } from './field_status'; +import { FieldEntry, SchemaEditorEditingState } from './hooks/use_editing_state'; +import { SchemaEditorUnpromotingState } from './hooks/use_unpromoting_state'; +import { FieldParent } from './field_parent'; + +interface FieldsTableContainerProps { + definition: ReadStreamDefinition; + unmappedFieldsResult?: string[]; + isLoadingUnmappedFields: boolean; + query?: Query; + editingState: SchemaEditorEditingState; + unpromotingState: SchemaEditorUnpromotingState; +} + +const COLUMNS = { + name: { + display: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTablenameHeader', { + defaultMessage: 'Field', + }), + }, + type: { + display: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTabletypeHeader', { + defaultMessage: 'Type', + }), + }, + format: { + display: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableformatHeader', { + defaultMessage: 'Format', + }), + }, + parent: { + display: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTableFieldParentHeader', { + defaultMessage: 'Field Parent (Stream)', + }), + }, + status: { + display: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldsTablestatusHeader', { + defaultMessage: 'Status', + }), + }, +}; + +export const EMPTY_CONTENT = '-----'; + +export const FieldsTableContainer = ({ + definition, + unmappedFieldsResult, + isLoadingUnmappedFields, + query, + editingState, + unpromotingState, +}: FieldsTableContainerProps) => { + const inheritedFields = useMemo(() => { + return definition.inheritedFields.map((field) => ({ + name: field.name, + type: field.type, + format: field.format, + parent: field.from, + status: 'inherited' as const, + })); + }, [definition]); + + const filteredInheritedFields = useMemo(() => { + if (!query) return inheritedFields; + return EuiSearchBar.Query.execute(query, inheritedFields, { + defaultFields: ['name', 'type'], + }); + }, [inheritedFields, query]); + + const mappedFields = useMemo(() => { + return definition.fields.map((field) => ({ + name: field.name, + type: field.type, + format: field.format, + parent: definition.id, + status: 'mapped' as const, + })); + }, [definition]); + + const filteredMappedFields = useMemo(() => { + if (!query) return mappedFields; + return EuiSearchBar.Query.execute(query, mappedFields, { + defaultFields: ['name', 'type'], + }); + }, [mappedFields, query]); + + const unmappedFields = useMemo(() => { + return unmappedFieldsResult + ? unmappedFieldsResult.map((field) => ({ + name: field, + parent: definition.id, + status: 'unmapped' as const, + })) + : []; + }, [definition.id, unmappedFieldsResult]); + + const filteredUnmappedFields = useMemo(() => { + if (!unmappedFieldsResult) return []; + if (!query) return unmappedFields; + return EuiSearchBar.Query.execute(query, unmappedFields, { + defaultFields: ['name'], + }); + }, [unmappedFieldsResult, query, unmappedFields]); + + const allFilteredFields = useMemo(() => { + return [...filteredInheritedFields, ...filteredMappedFields, ...filteredUnmappedFields]; + }, [filteredInheritedFields, filteredMappedFields, filteredUnmappedFields]); + + return ( + + ); +}; + +interface FieldsTableProps { + definition: ReadStreamDefinition; + fields: FieldEntry[]; + editingState: SchemaEditorEditingState; + unpromotingState: SchemaEditorUnpromotingState; +} + +const FieldsTable = ({ definition, fields, editingState, unpromotingState }: FieldsTableProps) => { + const [visibleColumns, setVisibleColumns] = useState(Object.keys(COLUMNS)); + + const trailingColumns = useMemo(() => { + return [ + { + id: 'actions', + width: 40, + headerCellRender: () => null, + rowCellRender: ({ rowIndex }) => { + const field = fields[rowIndex]; + + let actions: ActionsCellActionsDescriptor[] = []; + + switch (field.status) { + case 'mapped': + actions = [ + { + name: i18n.translate('xpack.streams.actions.viewFieldLabel', { + defaultMessage: 'View field', + }), + disabled: editingState.isSaving, + onClick: (fieldEntry: FieldEntry) => { + editingState.selectField(fieldEntry, false); + }, + }, + { + name: i18n.translate('xpack.streams.actions.editFieldLabel', { + defaultMessage: 'Edit field', + }), + disabled: editingState.isSaving, + onClick: (fieldEntry: FieldEntry) => { + editingState.selectField(fieldEntry, true); + }, + }, + { + name: i18n.translate('xpack.streams.actions.unpromoteFieldLabel', { + defaultMessage: 'Unmap field', + }), + disabled: unpromotingState.isUnpromotingField, + onClick: (fieldEntry: FieldEntry) => { + unpromotingState.setSelectedField(fieldEntry.name); + }, + }, + ]; + break; + case 'unmapped': + actions = [ + { + name: i18n.translate('xpack.streams.actions.viewFieldLabel', { + defaultMessage: 'View field', + }), + disabled: editingState.isSaving, + onClick: (fieldEntry: FieldEntry) => { + editingState.selectField(fieldEntry, false); + }, + }, + { + name: i18n.translate('xpack.streams.actions.mapFieldLabel', { + defaultMessage: 'Map field', + }), + disabled: editingState.isSaving, + onClick: (fieldEntry: FieldEntry) => { + editingState.selectField(fieldEntry, true); + }, + }, + ]; + break; + case 'inherited': + actions = [ + { + name: i18n.translate('xpack.streams.actions.viewFieldLabel', { + defaultMessage: 'View field', + }), + disabled: editingState.isSaving, + onClick: (fieldEntry: FieldEntry) => { + editingState.selectField(fieldEntry, false); + }, + }, + ]; + break; + } + + return ( + ({ + name: action.name, + icon: action.icon, + onClick: (event) => { + action.onClick(field); + }, + })), + }, + ]} + /> + ); + }, + }, + ] as EuiDataGridProps['trailingControlColumns']; + }, [editingState, fields, unpromotingState]); + + return ( + ({ + id: columnId, + ...COLUMNS[columnId as keyof typeof COLUMNS], + }))} + columnVisibility={{ + visibleColumns, + setVisibleColumns, + canDragAndDropColumns: false, + }} + toolbarVisibility={false} + rowCount={fields.length} + renderCellValue={({ rowIndex, columnId }) => { + const field = fields[rowIndex]; + if (columnId === 'type') { + const fieldType = field.type; + if (!fieldType) return EMPTY_CONTENT; + return ; + } else if (columnId === 'parent') { + return ; + } else if (columnId === 'status') { + return ; + } else { + return field[columnId as keyof FieldEntry] || EMPTY_CONTENT; + } + }} + trailingControlColumns={trailingColumns} + gridStyle={{ + border: 'none', + rowHover: 'none', + header: 'underline', + }} + /> + ); +}; + +export const ActionsCell = ({ panels }: { panels: EuiContextMenuPanelDescriptor[] }) => { + const contextMenuPopoverId = useGeneratedHtmlId({ + prefix: 'fieldsTableContextMenuPopover', + }); + + const [popoverIsOpen, togglePopoverIsOpen] = useToggle(false); + + return ( + { + togglePopoverIsOpen(); + }} + /> + } + isOpen={popoverIsOpen} + closePopover={() => togglePopoverIsOpen(false)} + > + ({ + ...panel, + items: panel.items?.map((item) => ({ + name: item.name, + icon: item.icon, + onClick: (event) => { + if (item.onClick) { + item.onClick(event as any); + } + togglePopoverIsOpen(false); + }, + })), + }))} + /> + + ); +}; + +export type ActionsCellActionsDescriptor = Omit & { + onClick: (field: FieldEntry) => void; +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/children_affected_callout.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/children_affected_callout.tsx new file mode 100644 index 000000000000..1cb9cbd2dd04 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/children_affected_callout.tsx @@ -0,0 +1,33 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import React from 'react'; +import { EuiCallOut } from '@elastic/eui'; +import { StreamDefinition } from '@kbn/streams-plugin/common/types'; +import { i18n } from '@kbn/i18n'; + +export const ChildrenAffectedCallout = ({ + childStreams, +}: { + childStreams: StreamDefinition['children']; +}) => { + return ( + + {i18n.translate('xpack.streams.childStreamsWarning.text', { + defaultMessage: "Editing this field will affect it's dependant streams: {affectedStreams} ", + values: { + affectedStreams: childStreams.map((stream) => stream.id).join(', '), + }, + })} + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_format.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_format.tsx new file mode 100644 index 000000000000..98f5d899c107 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_format.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 { EuiFieldText } from '@elastic/eui'; +import React from 'react'; +import { FieldDefinition } from '@kbn/streams-plugin/common/types'; +import { SchemaEditorEditingState } from '../hooks/use_editing_state'; + +type FieldFormFormatProps = Pick< + SchemaEditorEditingState, + 'nextFieldType' | 'nextFieldFormat' | 'setNextFieldFormat' +>; + +export const typeSupportsFormat = (type?: FieldDefinition['type']) => { + if (!type) return false; + return ['date'].includes(type); +}; + +export const FieldFormFormat = ({ + nextFieldType: fieldType, + nextFieldFormat: value, + setNextFieldFormat: onChange, +}: FieldFormFormatProps) => { + if (!typeSupportsFormat(fieldType)) { + return null; + } + return ( + onChange(e.target.value)} + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_type.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_type.tsx new file mode 100644 index 000000000000..c4e601e306f1 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_form_type.tsx @@ -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 { EuiSelect } from '@elastic/eui'; +import React from 'react'; +import { SchemaEditorEditingState } from '../hooks/use_editing_state'; + +type FieldFormTypeProps = Pick; + +const TYPE_OPTIONS = { + long: 'Long', + double: 'Double', + keyword: 'Keyword', + match_only_text: 'Text (match_only_text)', + boolean: 'Boolean', + ip: 'IP', + date: 'Date', +} as const; + +type FieldTypeOption = keyof typeof TYPE_OPTIONS; + +export const FieldFormType = ({ + nextFieldType: value, + setNextFieldType: onChange, +}: FieldFormTypeProps) => { + return ( + { + onChange(event.target.value as FieldTypeOption); + }} + value={value} + options={Object.entries(TYPE_OPTIONS).map(([optionKey, optionValue]) => ({ + text: optionValue, + value: optionKey, + }))} + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_summary.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_summary.tsx new file mode 100644 index 000000000000..796e7531258d --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/field_summary.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 { + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiHorizontalRule, + EuiIconTip, + EuiSpacer, + EuiTitle, +} from '@elastic/eui'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { useStreamsAppRouter } from '../../../hooks/use_streams_app_router'; +import { FieldParent } from '../field_parent'; +import { FieldStatus } from '../field_status'; +import { FieldFormFormat, typeSupportsFormat } from './field_form_format'; +import { FieldFormType } from './field_form_type'; +import { SchemaEditorFlyoutProps } from '.'; +import { FieldType } from '../field_type'; + +const EMPTY_CONTENT = '-----'; + +const title = i18n.translate('xpack.streams.streamDetailSchemaEditorFieldSummaryTitle', { + defaultMessage: 'Field summary', +}); + +const FIELD_SUMMARIES = { + fieldStatus: { + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldSummaryFieldNameHeader', { + defaultMessage: 'Status', + }), + }, + fieldType: { + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldSummaryFieldTypeHeader', { + defaultMessage: 'Type', + }), + }, + fieldFormat: { + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldSummaryFieldFormatHeader', { + defaultMessage: 'Format', + }), + }, + fieldParent: { + label: i18n.translate('xpack.streams.streamDetailSchemaEditorFieldSummaryFieldParentHeader', { + defaultMessage: 'Field Parent', + }), + }, +}; + +export const FieldSummary = (props: SchemaEditorFlyoutProps) => { + const { + selectedField, + isEditing, + nextFieldType, + setNextFieldType, + nextFieldFormat, + setNextFieldFormat, + toggleIsEditing, + } = props; + + const router = useStreamsAppRouter(); + + if (!selectedField) { + return null; + } + + return ( + + + + + {title} + + + {selectedField.status !== 'inherited' && !isEditing ? ( + + + + toggleIsEditing()} + iconType="pencil" + > + {i18n.translate('xpack.streams.fieldSummary.editButtonLabel', { + defaultMessage: 'Edit', + })} + + + + + ) : selectedField.status === 'inherited' ? ( + + + + + {i18n.translate('xpack.streams.fieldSummary.editInParentButtonLabel', { + defaultMessage: 'Edit in parent stream', + })} + + + + + ) : null} + + + + + + + + + {FIELD_SUMMARIES.fieldStatus.label}{' '} + + + + + + + + + + + + + + + + + + + {FIELD_SUMMARIES.fieldType.label} + + + + {isEditing ? ( + + ) : selectedField.type ? ( + + ) : ( + `${EMPTY_CONTENT}` + )} + + + + + + {typeSupportsFormat(nextFieldType) && ( + <> + + + + {FIELD_SUMMARIES.fieldFormat.label} + + + + {isEditing ? ( + + ) : ( + `${selectedField.format ?? EMPTY_CONTENT}` + )} + + + + + )} + + + + + {FIELD_SUMMARIES.fieldParent.label} + + + + + + + + + + + + + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/index.tsx new file mode 100644 index 000000000000..8bbdd6abf9ad --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/index.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { StreamsRepositoryClient } from '@kbn/streams-plugin/public/api'; +import { + EuiButtonEmpty, + EuiFlexGroup, + EuiFlexItem, + EuiFlyout, + EuiFlyoutBody, + EuiFlyoutHeader, + EuiFlyoutFooter, + EuiTitle, + EuiButton, +} from '@elastic/eui'; +import React from 'react'; +import { i18n } from '@kbn/i18n'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { SchemaEditorEditingState } from '../hooks/use_editing_state'; +import { ChildrenAffectedCallout } from './children_affected_callout'; +import { SamplePreviewTable } from './sample_preview_table'; +import { FieldSummary } from './field_summary'; + +export type SchemaEditorFlyoutProps = { + streamsRepositoryClient: StreamsRepositoryClient; + definition: ReadStreamDefinition; +} & SchemaEditorEditingState; + +export const SchemaEditorFlyout = (props: SchemaEditorFlyoutProps) => { + const { + definition, + streamsRepositoryClient, + selectedField, + reset, + nextFieldDefinition, + isEditing, + isSaving, + saveChanges, + } = props; + + return ( + reset()} maxWidth="500px"> + + + + +

{selectedField?.name}

+
+
+
+
+ + + + + {isEditing && definition.children.length > 0 ? ( + + + + ) : null} + + + + + + + + + + reset()} + flush="left" + > + {i18n.translate('xpack.streams.schemaEditorFlyout.closeButtonLabel', { + defaultMessage: 'Cancel', + })} + + + + saveChanges && saveChanges()} + > + {i18n.translate('xpack.streams.fieldForm.saveButtonLabel', { + defaultMessage: 'Save changes', + })} + + + + +
+ ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/sample_preview_table.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/sample_preview_table.tsx new file mode 100644 index 000000000000..8c04a0b70e3b --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/flyout/sample_preview_table.tsx @@ -0,0 +1,116 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { StreamsRepositoryClient } from '@kbn/streams-plugin/public/api'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { FieldDefinition } from '@kbn/streams-plugin/common/types'; +import { css } from '@emotion/react'; +import { i18n } from '@kbn/i18n'; +import { EuiCallOut } from '@elastic/eui'; +import { getFormattedError } from '../../../util/errors'; +import { useStreamsAppFetch } from '../../../hooks/use_streams_app_fetch'; +import { PreviewTable } from '../../preview_table'; +import { isFullFieldDefinition } from '../hooks/use_editing_state'; +import { LoadingPanel } from '../../loading_panel'; + +interface SamplePreviewTableProps { + definition: ReadStreamDefinition; + nextFieldDefinition?: Partial; + streamsRepositoryClient: StreamsRepositoryClient; +} + +export const SamplePreviewTable = (props: SamplePreviewTableProps) => { + const { nextFieldDefinition, ...rest } = props; + if (isFullFieldDefinition(nextFieldDefinition)) { + return ; + } else { + return null; + } +}; + +const SAMPLE_DOCUMENTS_TO_SHOW = 20; + +const SamplePreviewTableContent = ({ + definition, + nextFieldDefinition, + streamsRepositoryClient, +}: SamplePreviewTableProps & { nextFieldDefinition: FieldDefinition }) => { + const { value, loading, error } = useStreamsAppFetch( + ({ signal }) => { + return streamsRepositoryClient.fetch('POST /api/streams/{id}/schema/fields_simulation', { + signal, + params: { + path: { + id: definition.id, + }, + body: { + field_definitions: [nextFieldDefinition], + }, + }, + }); + }, + [definition.id, nextFieldDefinition, streamsRepositoryClient], + { + disableToastOnError: true, + } + ); + + const columns = useMemo(() => { + return [nextFieldDefinition.name]; + }, [nextFieldDefinition.name]); + + if (loading) { + return ; + } + + if ( + value && + (value.status === 'unknown' || value.documentsWithRuntimeFieldsApplied?.length === 0) + ) { + return ( + + {i18n.translate('xpack.streams.samplePreviewTable.unknownStatus', { + defaultMessage: + "Couldn't simulate changes due to a lack of indexed documents with this field", + })} + + ); + } + + if ((value && value.status === 'failure') || error) { + const formattedError = getFormattedError(error); + return ( + + {value?.simulationError ?? formattedError?.message} + + ); + } + + if (value && value.status === 'success' && value.documentsWithRuntimeFieldsApplied) { + return ( +
+ +
+ ); + } + + return null; +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_editing_state.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_editing_state.tsx new file mode 100644 index 000000000000..9fc6288c1daf --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_editing_state.tsx @@ -0,0 +1,180 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { FieldDefinition, ReadStreamDefinition } from '@kbn/streams-plugin/common/types'; +import { StreamsRepositoryClient } from '@kbn/streams-plugin/public/api'; +import { useCallback, useMemo, useState } from 'react'; +import useToggle from 'react-use/lib/useToggle'; +import { useAbortController } from '@kbn/observability-utils-browser/hooks/use_abort_controller'; +import { ToastsStart } from '@kbn/core-notifications-browser'; +import { i18n } from '@kbn/i18n'; +import { FieldStatus } from '../field_status'; + +export type SchemaEditorEditingState = ReturnType; + +export interface FieldEntry { + name: FieldDefinition['name']; + type?: FieldDefinition['type']; + format?: FieldDefinition['format']; + parent: string; + status: FieldStatus; +} + +export type EditableFieldDefinition = FieldEntry; + +export const useEditingState = ({ + streamsRepositoryClient, + definition, + refreshDefinition, + refreshUnmappedFields, + toastsService, +}: { + streamsRepositoryClient: StreamsRepositoryClient; + definition: ReadStreamDefinition; + refreshDefinition: () => void; + refreshUnmappedFields: () => void; + toastsService: ToastsStart; +}) => { + const abortController = useAbortController(); + /* Whether the field is being edited, otherwise it's just displayed. */ + const [isEditing, toggleIsEditing] = useToggle(false); + /* Whether changes are being persisted */ + const [isSaving, toggleIsSaving] = useToggle(false); + /* Holds errors from saving changes */ + const [error, setError] = useState(); + + /* Represents the currently selected field. This should not be edited directly. */ + const [selectedField, setSelectedField] = useState(); + + /** Dirty state */ + /* Dirty state of the field type */ + const [nextFieldType, setNextFieldType] = useState(); + /* Dirty state of the field format */ + const [nextFieldFormat, setNextFieldFormat] = useState< + EditableFieldDefinition['format'] | undefined + >(); + /* Full dirty definition entry that can be persisted against a stream */ + const nextFieldDefinition = useMemo(() => { + return selectedField + ? { + name: selectedField.name, + type: nextFieldType, + ...(nextFieldFormat && nextFieldType === 'date' ? { format: nextFieldFormat } : {}), + } + : undefined; + }, [nextFieldFormat, nextFieldType, selectedField]); + + const selectField = useCallback( + (field: EditableFieldDefinition, selectAndEdit?: boolean) => { + setSelectedField(field); + setNextFieldType(field.type); + setNextFieldFormat(field.format); + toggleIsEditing(selectAndEdit !== undefined ? selectAndEdit : false); + }, + [toggleIsEditing] + ); + + const reset = useCallback(() => { + setSelectedField(undefined); + setNextFieldType(undefined); + setNextFieldFormat(undefined); + toggleIsEditing(false); + toggleIsSaving(false); + setError(undefined); + }, [toggleIsEditing, toggleIsSaving]); + + const saveChanges = useMemo(() => { + return selectedField && + isFullFieldDefinition(nextFieldDefinition) && + hasChanges(selectedField, nextFieldDefinition) + ? async () => { + toggleIsSaving(true); + try { + await streamsRepositoryClient.fetch(`PUT /api/streams/{id}`, { + signal: abortController.signal, + params: { + path: { + id: definition.id, + }, + body: { + processing: definition.processing, + children: definition.children, + fields: [ + ...definition.fields.filter((field) => field.name !== nextFieldDefinition.name), + nextFieldDefinition, + ], + }, + }, + }); + toastsService.addSuccess( + i18n.translate('xpack.streams.streamDetailSchemaEditorEditSuccessToast', { + defaultMessage: '{field} was successfully edited', + values: { field: nextFieldDefinition.name }, + }) + ); + reset(); + refreshDefinition(); + refreshUnmappedFields(); + } catch (e) { + toggleIsSaving(false); + setError(e); + toastsService.addError(e, { + title: i18n.translate('xpack.streams.streamDetailSchemaEditorEditErrorToast', { + defaultMessage: 'Something went wrong editing the {field} field', + values: { field: nextFieldDefinition.name }, + }), + }); + } + } + : undefined; + }, [ + abortController.signal, + definition.children, + definition.fields, + definition.id, + definition.processing, + nextFieldDefinition, + refreshDefinition, + refreshUnmappedFields, + reset, + selectedField, + streamsRepositoryClient, + toastsService, + toggleIsSaving, + ]); + + return { + selectedField, + selectField, + isEditing, + toggleIsEditing, + nextFieldType, + setNextFieldType, + nextFieldFormat, + setNextFieldFormat, + isSaving, + saveChanges, + reset, + error, + nextFieldDefinition, + }; +}; + +export const isFullFieldDefinition = ( + value?: Partial +): value is FieldDefinition => { + return !!value && !!value.name && !!value.type; +}; + +const hasChanges = ( + selectedField: Partial, + nextFieldEntry: Partial +) => { + return ( + selectedField.type !== nextFieldEntry.type || selectedField.format !== nextFieldEntry.format + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_unpromoting_state.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_unpromoting_state.tsx new file mode 100644 index 000000000000..b6e30c87cd7b --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/hooks/use_unpromoting_state.tsx @@ -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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { StreamsRepositoryClient } from '@kbn/streams-plugin/public/api'; +import { useCallback, useState } from 'react'; +import useToggle from 'react-use/lib/useToggle'; +import { useAbortController } from '@kbn/observability-utils-browser/hooks/use_abort_controller'; +import { ToastsStart } from '@kbn/core-notifications-browser'; +import { i18n } from '@kbn/i18n'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; + +export type SchemaEditorUnpromotingState = ReturnType; + +export const useUnpromotingState = ({ + streamsRepositoryClient, + definition, + refreshDefinition, + refreshUnmappedFields, + toastsService, +}: { + streamsRepositoryClient: StreamsRepositoryClient; + definition: ReadStreamDefinition; + refreshDefinition: () => void; + refreshUnmappedFields: () => void; + toastsService: ToastsStart; +}) => { + const abortController = useAbortController(); + /* Represents the currently persisted state of the selected field. This should not be edited directly. */ + const [selectedField, setSelectedField] = useState(); + /* Whether changes are being persisted */ + const [isUnpromotingField, toggleIsUnpromotingField] = useToggle(false); + /* Holds errors from saving changes */ + const [error, setError] = useState(); + + const unpromoteField = useCallback(async () => { + if (!selectedField) { + return; + } + toggleIsUnpromotingField(true); + try { + await streamsRepositoryClient.fetch(`PUT /api/streams/{id}`, { + signal: abortController.signal, + params: { + path: { + id: definition.id, + }, + body: { + processing: definition.processing, + children: definition.children, + fields: definition.fields.filter((field) => field.name !== selectedField), + }, + }, + }); + toggleIsUnpromotingField(false); + setSelectedField(undefined); + refreshDefinition(); + refreshUnmappedFields(); + toastsService.addSuccess( + i18n.translate('xpack.streams.streamDetailSchemaEditorUnmapSuccessToast', { + defaultMessage: '{field} was successfully unmapped', + values: { field: selectedField }, + }) + ); + } catch (e) { + toggleIsUnpromotingField(false); + setError(e); + toastsService.addError(e, { + title: i18n.translate('xpack.streams.streamDetailSchemaEditorUnmapErrorToast', { + defaultMessage: 'Something went wrong unmapping the {field} field', + values: { field: selectedField }, + }), + }); + } + }, [ + abortController.signal, + definition.children, + definition.fields, + definition.id, + definition.processing, + refreshDefinition, + refreshUnmappedFields, + selectedField, + streamsRepositoryClient, + toastsService, + toggleIsUnpromotingField, + ]); + + return { selectedField, setSelectedField, isUnpromotingField, unpromoteField, error }; +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.tsx new file mode 100644 index 000000000000..3ca410e74ffd --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/index.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import React, { useEffect, useState } from 'react'; +import { + EuiFlexGroup, + EuiFlexItem, + EuiProgress, + EuiSearchBar, + EuiPortal, + Query, +} from '@elastic/eui'; +import { ReadStreamDefinition } from '@kbn/streams-plugin/common'; +import { css } from '@emotion/css'; +import { useEditingState } from './hooks/use_editing_state'; +import { SchemaEditorFlyout } from './flyout'; +import { useKibana } from '../../hooks/use_kibana'; +import { useUnpromotingState } from './hooks/use_unpromoting_state'; +import { SimpleSearchBar } from './simple_search_bar'; +import { UnpromoteFieldModal } from './unpromote_field_modal'; +import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; +import { FieldsTableContainer } from './fields_table'; + +interface SchemaEditorProps { + definition?: ReadStreamDefinition; + refreshDefinition: () => void; + isLoadingDefinition: boolean; +} + +export function StreamDetailSchemaEditor(props: SchemaEditorProps) { + if (!props.definition) return null; + return ; +} + +const Content = ({ + definition, + refreshDefinition, + isLoadingDefinition, +}: Required) => { + const { + dependencies: { + start: { + streams: { streamsRepositoryClient }, + }, + }, + core: { + notifications: { toasts }, + }, + } = useKibana(); + + const [query, setQuery] = useState(EuiSearchBar.Query.MATCH_ALL); + + const { + value: unmappedFieldsValue, + loading: isLoadingUnmappedFields, + refresh: refreshUnmappedFields, + } = useStreamsAppFetch( + ({ signal }) => { + return streamsRepositoryClient.fetch('GET /api/streams/{id}/schema/unmapped_fields', { + signal, + params: { + path: { + id: definition.id, + }, + }, + }); + }, + [definition.id, streamsRepositoryClient] + ); + + const editingState = useEditingState({ + definition, + streamsRepositoryClient, + refreshDefinition, + refreshUnmappedFields, + toastsService: toasts, + }); + + const unpromotingState = useUnpromotingState({ + definition, + streamsRepositoryClient, + refreshDefinition, + refreshUnmappedFields, + toastsService: toasts, + }); + + const { reset } = editingState; + + // If the definition changes (e.g. navigating to parent stream), reset the entire editing state. + useEffect(() => { + reset(); + }, [definition.id, reset]); + + return ( + + + {isLoadingDefinition || isLoadingUnmappedFields ? ( + + + + ) : null} + + setQuery(nextQuery.query ?? undefined)} + /> + + + + + + {editingState.selectedField && ( + + )} + + {unpromotingState.selectedField && ( + + )} + + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/simple_search_bar.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/simple_search_bar.tsx new file mode 100644 index 000000000000..93e972c4b999 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/simple_search_bar.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 { EuiSearchBar, EuiSearchBarProps } from '@elastic/eui'; +import React from 'react'; + +/* Simple search bar that doesn't attempt to integrate with unified search */ +export const SimpleSearchBar = ({ + query, + onChange, +}: { + query: EuiSearchBarProps['query']; + onChange: Required['onChange']; +}) => { + return ( + { + onChange(nextQuery); + }} + /> + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/unpromote_field_modal.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/unpromote_field_modal.tsx new file mode 100644 index 000000000000..59d66b44eec4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_schema_editor/unpromote_field_modal.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 { + EuiButton, + EuiModal, + EuiModalBody, + EuiModalFooter, + EuiModalHeader, + EuiModalHeaderTitle, + useGeneratedHtmlId, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import React from 'react'; +import { SchemaEditorUnpromotingState } from './hooks/use_unpromoting_state'; + +export const UnpromoteFieldModal = ({ + unpromotingState, +}: { + unpromotingState: SchemaEditorUnpromotingState; +}) => { + const { setSelectedField, selectedField, unpromoteField, isUnpromotingField } = unpromotingState; + + const modalTitleId = useGeneratedHtmlId(); + + if (!selectedField) return null; + + return ( + setSelectedField(undefined)}> + + {selectedField} + + + + {i18n.translate('xpack.streams.unpromoteFieldModal.unpromoteFieldWarning', { + defaultMessage: 'Are you sure you want to unmap this field from template mappings?', + })} + + + + unpromoteField()} + disabled={isUnpromotingField} + color="danger" + fill + > + {i18n.translate('xpack.streams.unpromoteFieldModal.unpromoteFieldButtonLabel', { + defaultMessage: 'Unmap field', + })} + + + + ); +}; diff --git a/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_view/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_view/index.tsx new file mode 100644 index 000000000000..9ebc5a92f54d --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_detail_view/index.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 React from 'react'; +import { i18n } from '@kbn/i18n'; +import { EntityDetailViewWithoutParams, EntityViewTab } from '../entity_detail_view'; +import { useStreamsAppParams } from '../../hooks/use_streams_app_params'; +import { useStreamsAppFetch } from '../../hooks/use_streams_app_fetch'; +import { useKibana } from '../../hooks/use_kibana'; +import { StreamDetailOverview } from '../stream_detail_overview'; +import { StreamDetailManagement } from '../stream_detail_management'; + +export function StreamDetailView() { + const params1 = useStreamsAppParams('/{key}/{tab}', true); + + const params2 = useStreamsAppParams('/{key}/management/{subtab}', true); + + const key = params1?.path?.key || params2.path.key; + const tab = params1?.path?.tab || 'management'; + + const { + dependencies: { + start: { + streams: { streamsRepositoryClient }, + }, + }, + } = useKibana(); + + const { + value: streamEntity, + refresh, + loading, + } = useStreamsAppFetch( + ({ signal }) => { + return streamsRepositoryClient.fetch('GET /api/streams/{id}', { + signal, + params: { + path: { + id: key, + }, + }, + }); + }, + [streamsRepositoryClient, key] + ); + + const entity = { + id: key, + displayName: key, + }; + + const tabs: EntityViewTab[] = [ + { + name: 'overview', + content: , + label: i18n.translate('xpack.streams.streamDetailView.overviewTab', { + defaultMessage: 'Overview', + }), + }, + { + name: 'management', + content: ( + + ), + label: i18n.translate('xpack.streams.streamDetailView.managementTab', { + defaultMessage: 'Management', + }), + }, + ]; + + return ( + + ); +} diff --git a/x-pack/plugins/streams_app/public/components/stream_list_view/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/stream_list_view/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/stream_list_view/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/stream_list_view/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_context_provider/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_context_provider/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_context_provider/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_context_provider/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_page_body/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_body/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_page_body/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_body/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_page_header/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_header/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_page_header/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_header/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_page_header/streams_app_page_header_title.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_header/streams_app_page_header_title.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_page_header/streams_app_page_header_title.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_header/streams_app_page_header_title.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_page_template/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_template/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_page_template/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_page_template/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_router_breadcrumb/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_router_breadcrumb/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_router_breadcrumb/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_router_breadcrumb/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_app_search_bar/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_search_bar/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_app_search_bar/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_app_search_bar/index.tsx diff --git a/x-pack/plugins/streams_app/public/components/streams_table/index.tsx b/x-pack/solutions/observability/plugins/streams_app/public/components/streams_table/index.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/components/streams_table/index.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/components/streams_table/index.tsx diff --git a/x-pack/plugins/streams_app/public/hooks/use_kibana.tsx b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_kibana.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/hooks/use_kibana.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_kibana.tsx diff --git a/x-pack/plugins/streams_app/public/hooks/use_streams_app_breadcrumbs.ts b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/streams_app/public/hooks/use_streams_app_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_breadcrumbs.ts diff --git a/x-pack/plugins/streams_app/public/hooks/use_streams_app_fetch.ts b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_fetch.ts similarity index 96% rename from x-pack/plugins/streams_app/public/hooks/use_streams_app_fetch.ts rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_fetch.ts index 08b112d4f207..45911cbda851 100644 --- a/x-pack/plugins/streams_app/public/hooks/use_streams_app_fetch.ts +++ b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_fetch.ts @@ -66,7 +66,7 @@ export const useStreamsAppFetch: UseAbortableAsync<{}, { disableToastOnError?: b ({ signal }) => { return callback({ signal }); }, - // eslint-disable-next-line react-hooks/exhaustive-deps + deps, optionsForHook ); diff --git a/x-pack/plugins/streams_app/public/hooks/use_streams_app_params.ts b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_params.ts similarity index 100% rename from x-pack/plugins/streams_app/public/hooks/use_streams_app_params.ts rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_params.ts diff --git a/x-pack/plugins/streams_app/public/hooks/use_streams_app_route_path.ts b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_route_path.ts similarity index 100% rename from x-pack/plugins/streams_app/public/hooks/use_streams_app_route_path.ts rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_route_path.ts diff --git a/x-pack/plugins/streams_app/public/hooks/use_streams_app_router.ts b/x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_router.ts similarity index 100% rename from x-pack/plugins/streams_app/public/hooks/use_streams_app_router.ts rename to x-pack/solutions/observability/plugins/streams_app/public/hooks/use_streams_app_router.ts diff --git a/x-pack/plugins/streams_app/public/index.ts b/x-pack/solutions/observability/plugins/streams_app/public/index.ts similarity index 100% rename from x-pack/plugins/streams_app/public/index.ts rename to x-pack/solutions/observability/plugins/streams_app/public/index.ts diff --git a/x-pack/plugins/streams_app/public/plugin.ts b/x-pack/solutions/observability/plugins/streams_app/public/plugin.ts similarity index 100% rename from x-pack/plugins/streams_app/public/plugin.ts rename to x-pack/solutions/observability/plugins/streams_app/public/plugin.ts diff --git a/x-pack/plugins/streams_app/public/routes/config.tsx b/x-pack/solutions/observability/plugins/streams_app/public/routes/config.tsx similarity index 100% rename from x-pack/plugins/streams_app/public/routes/config.tsx rename to x-pack/solutions/observability/plugins/streams_app/public/routes/config.tsx diff --git a/x-pack/plugins/streams_app/public/services/types.ts b/x-pack/solutions/observability/plugins/streams_app/public/services/types.ts similarity index 100% rename from x-pack/plugins/streams_app/public/services/types.ts rename to x-pack/solutions/observability/plugins/streams_app/public/services/types.ts diff --git a/x-pack/plugins/streams_app/public/types.ts b/x-pack/solutions/observability/plugins/streams_app/public/types.ts similarity index 100% rename from x-pack/plugins/streams_app/public/types.ts rename to x-pack/solutions/observability/plugins/streams_app/public/types.ts diff --git a/x-pack/solutions/observability/plugins/streams_app/public/util/errors.ts b/x-pack/solutions/observability/plugins/streams_app/public/util/errors.ts new file mode 100644 index 000000000000..e215ad1bb7f9 --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/public/util/errors.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const getFormattedError = (error?: Error) => { + if ( + error && + 'body' in error && + typeof error.body === 'object' && + !!error.body && + 'message' in error.body && + typeof error.body.message === 'string' + ) { + return new Error(error.body.message); + } +}; diff --git a/x-pack/plugins/streams_app/public/util/esql_result_to_timeseries.ts b/x-pack/solutions/observability/plugins/streams_app/public/util/esql_result_to_timeseries.ts similarity index 100% rename from x-pack/plugins/streams_app/public/util/esql_result_to_timeseries.ts rename to x-pack/solutions/observability/plugins/streams_app/public/util/esql_result_to_timeseries.ts diff --git a/x-pack/plugins/streams_app/public/util/use_debounce.ts b/x-pack/solutions/observability/plugins/streams_app/public/util/use_debounce.ts similarity index 100% rename from x-pack/plugins/streams_app/public/util/use_debounce.ts rename to x-pack/solutions/observability/plugins/streams_app/public/util/use_debounce.ts diff --git a/x-pack/plugins/streams_app/server/config.ts b/x-pack/solutions/observability/plugins/streams_app/server/config.ts similarity index 100% rename from x-pack/plugins/streams_app/server/config.ts rename to x-pack/solutions/observability/plugins/streams_app/server/config.ts diff --git a/x-pack/plugins/streams_app/server/index.ts b/x-pack/solutions/observability/plugins/streams_app/server/index.ts similarity index 100% rename from x-pack/plugins/streams_app/server/index.ts rename to x-pack/solutions/observability/plugins/streams_app/server/index.ts diff --git a/x-pack/plugins/streams_app/server/plugin.ts b/x-pack/solutions/observability/plugins/streams_app/server/plugin.ts similarity index 100% rename from x-pack/plugins/streams_app/server/plugin.ts rename to x-pack/solutions/observability/plugins/streams_app/server/plugin.ts diff --git a/x-pack/plugins/streams_app/server/types.ts b/x-pack/solutions/observability/plugins/streams_app/server/types.ts similarity index 100% rename from x-pack/plugins/streams_app/server/types.ts rename to x-pack/solutions/observability/plugins/streams_app/server/types.ts diff --git a/x-pack/solutions/observability/plugins/streams_app/tsconfig.json b/x-pack/solutions/observability/plugins/streams_app/tsconfig.json new file mode 100644 index 000000000000..7a77dae1922d --- /dev/null +++ b/x-pack/solutions/observability/plugins/streams_app/tsconfig.json @@ -0,0 +1,41 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../../typings/**/*", + "common/**/*", + "public/**/*", + "typings/**/*", + "public/**/*.json", + "server/**/*", + ".storybook/**/*" + ], + "exclude": ["target/**/*", ".storybook/**/*.js"], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/data-views-plugin", + "@kbn/observability-shared-plugin", + "@kbn/unified-search-plugin", + "@kbn/react-kibana-context-render", + "@kbn/shared-ux-link-redirect-app", + "@kbn/typed-react-router-config", + "@kbn/i18n", + "@kbn/observability-utils-browser", + "@kbn/kibana-react-plugin", + "@kbn/es-query", + "@kbn/logging", + "@kbn/deeplinks-observability", + "@kbn/config-schema", + "@kbn/calculate-auto", + "@kbn/streams-plugin", + "@kbn/share-plugin", + "@kbn/observability-utils-server", + "@kbn/code-editor", + "@kbn/ui-theme", + "@kbn/navigation-plugin", + "@kbn/core-notifications-browser", + ] +} diff --git a/x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js b/x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.js similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/.buildkite/pipelines/flaky.js rename to x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.js diff --git a/x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.sh b/x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.sh new file mode 100755 index 000000000000..9763f45c1101 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +UUID="$(cat /proc/sys/kernel/random/uuid)" +export UUID + +node x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/solutions/observability/plugins/synthetics/README.md b/x-pack/solutions/observability/plugins/synthetics/README.md new file mode 100644 index 000000000000..cde895684459 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/README.md @@ -0,0 +1,121 @@ +# Uptime Monitoring + +## Purpose + +The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening +in their infrastructure. + +## Layout + +There are three sections to the app, `common`, `public`, and `server`. + +### common + +Contains runtime types types, constants and a few other files. + +Notably, we use `io-ts`/`fp-ts` functions and types to help provide +additional runtime safety for our API requests/responses. + +### public + +We use Redux and associated tools for managing our app state. Components come in the usual `connect`ed and +presentational varieties. + +The `lib` directory controls bootstrapping code and adapter types. + +There is a `pages` directory; each view gets its own page component. + +The principal structure of the app is stored in `uptime_app.tsx`. + +### server + +The `lib` directory contains `adapters`, which are connections to external resources like Kibana +Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide +functionality via adapters. + +The `requests` directory contains functions responsible for querying Elasticsearch and parsing its +responses. + +There's also a `rest_api` folder that defines the structure of the RESTful API endpoints. + +## Testing + +### Unit tests + +Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing + +``` +yarn test:jest x-pack/solutions/observability/plugins/synthetics +``` + +### Functional tests + +In one shell, from **~/kibana/x-pack**: +`node scripts/functional_tests_server.js` + +In another shell, from **~kibana/x-pack**: +`node ../scripts/functional_test_runner.js --grep="{TEST_NAME}"`. + +#### API tests + +If instead you need to run API tests, start up the test server and then in another shell, from **~kibana/x-pack**: +`node ../scripts/functional_test_runner.js --config test/api_integration/config.ts --grep="{TEST_NAME}"`. + +You can update snapshots by prefixing the runner command with `env UPDATE_UPTIME_FIXTURES=1` + +You can access the functional test server's Kibana at `http://localhost:5620/`. + +You can login with username `elastic` and password `changeme` by default. + +If you want to freeze a UI or API test you can include an async call like `await new Promise(r => setTimeout(r, 1000 * 60))` +to freeze the execution for 60 seconds if you need to click around or check things in the state that is loaded. + +#### Running --ssl tests + +Some of our tests require there to be an SSL connection between Kibana and Elasticsearch. + +We can run these tests like described above, but with some special config. + +`node scripts/functional_tests_server.js --config=test/functional_with_es_ssl/config.ts` + +`node scripts/functional_test_runner.js --config=test/functional_with_es_ssl/config.ts` + +#### Running accessibility tests + +We maintain a suite of Accessibility tests (you may see them referred to elsewhere as `a11y` tests). + +These tests render each of our pages and ensure that the inputs and other elements contain the +attributes necessary to ensure all users are able to make use of Kibana (for example, users relying +on screen readers). + +The commands for running these tests are very similar to the other functional tests described above. + +From the `~/x-pack` directory: + +Start the server: `node scripts/functional_tests_server --config test/accessibility/config.ts` + +Run the uptime `a11y` tests: `node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=uptime` + + +## Deployment agnostic API Integration Tests +The Synthetics tests are located under `x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics` folder. In order to run the SLO tests of your interest, you can grep accordingly. Use the commands below to run all SLO tests (`grep=SyntheticsAPITests`) on stateful or serverless. + +### Stateful + +``` +# start server +node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts + +# run tests +node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts --grep=SyntheticsAPITests +``` + +### Serverless + +``` +# start server +node scripts/functional_tests_server --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts + +# run tests +node scripts/functional_test_runner --config x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.serverless.config.ts --grep=SyntheticsAPITests +``` diff --git a/x-pack/plugins/observability_solution/synthetics/__mocks__/@kbn/code-editor/index.ts b/x-pack/solutions/observability/plugins/synthetics/__mocks__/@kbn/code-editor/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/__mocks__/@kbn/code-editor/index.ts rename to x-pack/solutions/observability/plugins/synthetics/__mocks__/@kbn/code-editor/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/capabilities.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/capabilities.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/capabilities.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/client_defaults.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/client_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/client_defaults.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/client_defaults.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/context_defaults.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/context_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/context_defaults.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/context_defaults.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/data_filters.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/data_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/data_filters.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/data_filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/data_test_subjects.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/data_test_subjects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/data_test_subjects.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/data_test_subjects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/monitor_defaults.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/monitor_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/monitor_defaults.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/monitor_defaults.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/monitor_management.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/monitor_management.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/monitor_management.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/monitor_management.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/plugin.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/plugin.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/plugin.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/settings_defaults.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/settings_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/settings_defaults.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/settings_defaults.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/client_defaults.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/client_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/client_defaults.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/client_defaults.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/rest_api.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/rest_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/synthetics/rest_api.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics/rest_api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/synthetics_alerts.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/synthetics_alerts.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/synthetics_alerts.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/constants/ui.ts b/x-pack/solutions/observability/plugins/synthetics/common/constants/ui.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/constants/ui.ts rename to x-pack/solutions/observability/plugins/synthetics/common/constants/ui.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/field_names.ts b/x-pack/solutions/observability/plugins/synthetics/common/field_names.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/field_names.ts rename to x-pack/solutions/observability/plugins/synthetics/common/field_names.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/formatters/format_space_name.ts b/x-pack/solutions/observability/plugins/synthetics/common/formatters/format_space_name.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/formatters/format_space_name.ts rename to x-pack/solutions/observability/plugins/synthetics/common/formatters/format_space_name.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/formatters/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/formatters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/formatters/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/formatters/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/combine_filters_and_user_search.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/combine_filters_and_user_search.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/combine_filters_and_user_search.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/combine_filters_and_user_search.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/combine_filters_and_user_search.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/combine_filters_and_user_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/combine_filters_and_user_search.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/combine_filters_and_user_search.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/schedule_to_time.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/schedule_to_time.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/schedule_to_time.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/schedule_to_time.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/schedule_to_time.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/schedule_to_time.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/schedule_to_time.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/schedule_to_time.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/stringify_kueries.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/stringify_kueries.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/stringify_kueries.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/stringify_kueries.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/lib/stringify_kueries.ts b/x-pack/solutions/observability/plugins/synthetics/common/lib/stringify_kueries.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/lib/stringify_kueries.ts rename to x-pack/solutions/observability/plugins/synthetics/common/lib/stringify_kueries.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/requests/get_certs_request_body.ts b/x-pack/solutions/observability/plugins/synthetics/common/requests/get_certs_request_body.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/requests/get_certs_request_body.ts rename to x-pack/solutions/observability/plugins/synthetics/common/requests/get_certs_request_body.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/alert_actions.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/alert_actions.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/alert_actions.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/alert_actions.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/alert_actions.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/alert_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/alert_actions.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/alert_actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/status_rule.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/status_rule.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/status_rule.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/status_rule.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/status_rule.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/status_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/status_rule.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/status_rule.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/synthetics/translations.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/synthetics/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/synthetics/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/synthetics/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/synthetics_rule_field_map.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/synthetics_rule_field_map.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/synthetics_rule_field_map.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/synthetics_rule_field_map.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/rules/types.ts b/x-pack/solutions/observability/plugins/synthetics/common/rules/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/rules/types.ts rename to x-pack/solutions/observability/plugins/synthetics/common/rules/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/alert_rules/common.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alert_rules/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/alert_rules/common.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alert_rules/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/status_check.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/status_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/status_check.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/status_check.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/tls.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/alerts/tls.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/alerts/tls.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/certs.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/certs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/certs.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/certs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/common.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/common.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/dynamic_settings.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor/state.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor/state.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor/state.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor/state.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/alert_config.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/alert_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/alert_config.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/alert_config.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/alert_config_schema.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/alert_config_schema.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/alert_config_schema.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/alert_config_schema.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/config_key.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/config_key.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/config_key.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/config_key.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/filters.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/filters.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/locations.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/locations.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_configs.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_configs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_configs.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_configs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_meta_data.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_meta_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_meta_data.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_meta_data.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_types.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_types.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/monitor_types_project.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/sort_field.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/sort_field.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/sort_field.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/sort_field.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/state.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/state.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/state.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/state.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_overview_status.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_params.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_params.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/monitor_management/synthetics_private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/network_events.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/network_events.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/network_events.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/error_state.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/error_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/error_state.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/error_state.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/histogram.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/histogram.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/histogram.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/observer.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/observer.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/observer.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/observer.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/ping.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/ping.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/ping.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/synthetics.test.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/synthetics.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/synthetics.test.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/synthetics.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/synthetics.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/synthetics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/ping/synthetics.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/ping/synthetics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/snapshot/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/snapshot/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/snapshot/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/snapshot/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/snapshot/snapshot_count.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/snapshot/snapshot_count.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/snapshot/snapshot_count.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/snapshot/snapshot_count.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/runtime_types/synthetics_service_api_key.ts b/x-pack/solutions/observability/plugins/synthetics/common/runtime_types/synthetics_service_api_key.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/runtime_types/synthetics_service_api_key.ts rename to x-pack/solutions/observability/plugins/synthetics/common/runtime_types/synthetics_service_api_key.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/saved_objects/private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/common/saved_objects/private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/saved_objects/private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/common/saved_objects/private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts b/x-pack/solutions/observability/plugins/synthetics/common/translations/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/translations/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/common/translations/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/default_alerts.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/default_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/default_alerts.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/default_alerts.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/index.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/index.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/monitor_validation.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/monitor_validation.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/monitor_validation.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/monitor_validation.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/overview.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/overview.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/overview.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/overview.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/saved_objects.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/saved_objects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/saved_objects.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/saved_objects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/types/synthetics_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/common/types/synthetics_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/types/synthetics_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/common/types/synthetics_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/utils/as_mutable_array.ts b/x-pack/solutions/observability/plugins/synthetics/common/utils/as_mutable_array.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/utils/as_mutable_array.ts rename to x-pack/solutions/observability/plugins/synthetics/common/utils/as_mutable_array.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/utils/es_search.ts b/x-pack/solutions/observability/plugins/synthetics/common/utils/es_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/utils/es_search.ts rename to x-pack/solutions/observability/plugins/synthetics/common/utils/es_search.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/utils/get_synthetics_monitor_url.ts b/x-pack/solutions/observability/plugins/synthetics/common/utils/get_synthetics_monitor_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/utils/get_synthetics_monitor_url.ts rename to x-pack/solutions/observability/plugins/synthetics/common/utils/get_synthetics_monitor_url.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/utils/location_formatter.ts b/x-pack/solutions/observability/plugins/synthetics/common/utils/location_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/utils/location_formatter.ts rename to x-pack/solutions/observability/plugins/synthetics/common/utils/location_formatter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/common/utils/t_enum.ts b/x-pack/solutions/observability/plugins/synthetics/common/utils/t_enum.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/common/utils/t_enum.ts rename to x-pack/solutions/observability/plugins/synthetics/common/utils/t_enum.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/e2e/README.md b/x-pack/solutions/observability/plugins/synthetics/e2e/README.md new file mode 100644 index 000000000000..e3be14c9aced --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/README.md @@ -0,0 +1,32 @@ +## How to run these tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From the same directory you can now run `node e2e.js --runner`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. + + +## Uptime App Tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/synthetics/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From the same directory you can now run `node node uptime_e2e.js --runner`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/solutions/observability/plugins/synthetics/e2e/config.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/config.ts new file mode 100644 index 000000000000..ff04a6d7bf16 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/config.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 { FtrConfigProviderContext } from '@kbn/test'; +import { CA_CERT_PATH } from '@kbn/dev-utils'; +import { get } from 'lodash'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; +import { readKibanaConfig } from '@kbn/observability-synthetics-test-data'; + +const MANIFEST_KEY = 'xpack.uptime.service.manifestUrl'; +const SERVICE_PASSWORD = 'xpack.uptime.service.password'; +const SERVICE_USERNAME = 'xpack.uptime.service.username'; + +async function config({ readConfigFile }: FtrConfigProviderContext) { + const kibanaCommonTestsConfig = await readConfigFile( + require.resolve('@kbn/test-suites-src/common/config') + ); + const xpackFunctionalTestsConfig = await readConfigFile( + require.resolve('@kbn/test-suites-xpack/functional/config.base') + ); + + const kibanaConfig = readKibanaConfig(); + + const manifestUrl = process.env.SYNTHETICS_SERVICE_MANIFEST ?? get(kibanaConfig, MANIFEST_KEY); + const serviceUsername = + process.env.SYNTHETICS_SERVICE_USERNAME ?? get(kibanaConfig, SERVICE_USERNAME); + const servicePassword = + process.env.SYNTHETICS_SERVICE_PASSWORD ?? get(kibanaConfig, SERVICE_PASSWORD); + + return { + ...kibanaCommonTestsConfig.getAll(), + + services: { + ...commonFunctionalServices, + ...commonFunctionalUIServices, + }, + + esTestCluster: { + ...xpackFunctionalTestsConfig.get('esTestCluster'), + serverArgs: [ + ...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'), + // define custom es server here + // API Keys is enabled at the top level + 'xpack.security.enabled=true', + 'xpack.ml.enabled=false', + ], + }, + + kbnTestServer: { + ...xpackFunctionalTestsConfig.get('kbnTestServer'), + sourceArgs: process.env.WATCH_ENABLED + ? [] + : [...xpackFunctionalTestsConfig.get('kbnTestServer.sourceArgs'), '--no-watch'], + serverArgs: [ + ...xpackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), + '--csp.strict=false', + '--home.disableWelcomeScreen=true', + '--csp.warnLegacyBrowsers=false', + // define custom kibana server args here + `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, + // `--elasticsearch.ignoreVersionMismatch=${process.env.CI ? 'false' : 'true'}`, + `--elasticsearch.username=kibana_system`, + `--elasticsearch.password=changeme`, + '--xpack.reporting.enabled=false', + `--xpack.uptime.service.manifestUrl=${manifestUrl}`, + `--xpack.uptime.service.username=${ + process.env.SYNTHETICS_REMOTE_ENABLED + ? serviceUsername + : 'localKibanaIntegrationTestsUser' + }`, + `--xpack.uptime.service.password=${servicePassword}`, + '--uiSettings.overrides.observability:enableLegacyUptimeApp=true', + ], + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default config; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/browser/data.json.gz b/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/browser/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/browser/data.json.gz rename to x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/browser/data.json.gz diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/browser/mappings.json b/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/browser/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/browser/mappings.json rename to x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/browser/mappings.json diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz b/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz rename to x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/full_heartbeat/mappings.json b/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/full_heartbeat/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/full_heartbeat/mappings.json rename to x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/full_heartbeat/mappings.json diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/synthetics_data/data.json.gz b/x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/synthetics_data/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/fixtures/es_archiver/synthetics_data/data.json.gz rename to x-pack/solutions/observability/plugins/synthetics/e2e/fixtures/es_archiver/synthetics_data/data.json.gz diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_checks.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_checks.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_checks.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_checks.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_ping.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_ping.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_ping.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_tls.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/helpers/make_tls.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/helpers/make_tls.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/utils.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/helpers/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/helpers/utils.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/helpers/utils.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/e2e/index.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/index.ts new file mode 100644 index 000000000000..faec8474541d --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/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 { loginPageProvider } from './page_objects/login'; +export { utilsPageProvider } from './page_objects/utils'; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/kibana.jsonc b/x-pack/solutions/observability/plugins/synthetics/e2e/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/kibana.jsonc rename to x-pack/solutions/observability/plugins/synthetics/e2e/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx b/x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/page_objects/login.tsx rename to x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/login.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/page_objects/utils.tsx b/x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/page_objects/utils.tsx rename to x-pack/solutions/observability/plugins/synthetics/e2e/page_objects/utils.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/add_monitor.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/add_monitor.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/add_monitor.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/add_monitor.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/custom_status_alert.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/custom_status_alert.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/custom_status_alert.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/custom_status_alert.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/default_status_alert.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/default_status_alert.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/default_status_alert.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/default_status_alert.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/sample_docs/sample_docs.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/sample_docs/sample_docs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alert_rules/sample_docs/sample_docs.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alert_rules/sample_docs/sample_docs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alerting_default.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alerting_default.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/alerting_default.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/alerting_default.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/data_retention.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/data_retention.journey.ts similarity index 98% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/data_retention.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/data_retention.journey.ts index 1dd2fe3a44ae..4640e2adf9ee 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/data_retention.journey.ts +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/data_retention.journey.ts @@ -7,7 +7,7 @@ import { journey, step, expect, Page } from '@elastic/synthetics'; import { RetryService } from '@kbn/ftr-common-functional-services'; -import { recordVideo } from '../../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { syntheticsAppPageProvider } from '../page_objects/synthetics_app'; import { byTestId, assertText } from '../../helpers/utils'; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/detail_flyout.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/detail_flyout.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/detail_flyout.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/detail_flyout.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/getting_started.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/getting_started.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/getting_started.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/getting_started.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/global_parameters.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/global_parameters.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/global_parameters.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/global_parameters.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/index.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/management_list.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/management_list.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/management_list.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/management_list.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_details_page/monitor_summary.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_details_page/monitor_summary.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_details_page/monitor_summary.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_details_page/monitor_summary.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_form_validation.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_form_validation.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_form_validation.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_form_validation.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_selector.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_selector.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/monitor_selector.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/monitor_selector.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_scrolling.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_scrolling.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_scrolling.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_scrolling.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_search.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_search.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_search.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_search.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_sorting.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_sorting.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/overview_sorting.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/overview_sorting.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/private_locations.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/private_locations.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/private_locations.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/private_locations.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts similarity index 97% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts index 44cfcbebc661..2c1a873b0db5 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/project_api_keys.journey.ts @@ -7,7 +7,7 @@ import { journey, step, expect, before } from '@elastic/synthetics'; import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; -import { recordVideo } from '../../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; journey('ProjectAPIKeys', async ({ page }) => { recordVideo(page); diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/project_monitor_read_only.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/project_monitor_read_only.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/project_monitor_read_only.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/project_monitor_read_only.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/add_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/add_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/add_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/add_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/add_monitor_project.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/add_monitor_project.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/add_monitor_project.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/add_monitor_project.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/data/browser_docs.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/data/browser_docs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/data/browser_docs.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/data/browser_docs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/settings.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/settings.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/synthetics_services.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/synthetics_services.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/services/synthetics_services.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/services/synthetics_services.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/step_details.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/step_details.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/step_details.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/step_details.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/test_now_mode.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/test_now_mode.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/test_now_mode.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/test_now_mode.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/test_run_details.journey.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/test_run_details.journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/journeys/test_run_details.journey.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/journeys/test_run_details.journey.ts diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx similarity index 99% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx index f9eb448615de..2f3d0099192f 100644 --- a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/page_objects/synthetics_app.tsx @@ -7,7 +7,7 @@ import { expect, Page } from '@elastic/synthetics'; import { RetryService } from '@kbn/ftr-common-functional-services'; import { FormMonitorType } from '@kbn/synthetics-plugin/common/runtime_types/monitor_management'; -import { recordVideo } from '../../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { loginPageProvider } from '../../page_objects/login'; import { utilsPageProvider } from '../../page_objects/utils'; diff --git a/x-pack/plugins/observability_solution/synthetics/e2e/synthetics/page_objects/utils.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/page_objects/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/e2e/synthetics/page_objects/utils.ts rename to x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/page_objects/utils.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.ts b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.ts new file mode 100644 index 000000000000..4f097c692687 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/synthetics/synthetics_run.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 { SyntheticsRunner, argv } from '@kbn/observability-synthetics-test-data'; +import { FtrConfigProviderContext } from '@kbn/test'; +import path from 'path'; + +const { headless, grep, bail: pauseOnError } = argv; + +async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { + const kibanaConfig = await readConfigFile(require.resolve('../config.ts')); + return { + ...kibanaConfig.getAll(), + testRunner: async ({ getService }: any) => { + const syntheticsRunner = new SyntheticsRunner(getService, { + headless, + match: grep, + pauseOnError, + }); + + await syntheticsRunner.setup(); + const fixturesDir = path.join(__dirname, '../fixtures/es_archiver/'); + + await syntheticsRunner.loadTestData(fixturesDir, [ + 'synthetics_data', + 'full_heartbeat', + 'browser', + ]); + + await syntheticsRunner.loadTestFiles(async () => { + require('./journeys'); + }); + + await syntheticsRunner.run(); + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default runE2ETests; diff --git a/x-pack/solutions/observability/plugins/synthetics/e2e/tsconfig.json b/x-pack/solutions/observability/plugins/synthetics/e2e/tsconfig.json new file mode 100644 index 000000000000..e7607627a625 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/e2e/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "exclude": ["tmp", "target/**/*"], + "include": ["**/*"], + "compilerOptions": { + "outDir": "target/types", + "types": ["node"], + "isolatedModules": false + }, + "kbn_references": [ + "@kbn/test", + "@kbn/dev-utils", + "@kbn/ux-plugin/e2e", + "@kbn/ftr-common-functional-services", + "@kbn/synthetics-plugin", + "@kbn/observability-synthetics-test-data", + "@kbn/ftr-common-functional-ui-services" + ] +} diff --git a/x-pack/solutions/observability/plugins/synthetics/jest.config.js b/x-pack/solutions/observability/plugins/synthetics/jest.config.js new file mode 100644 index 000000000000..39f032812a29 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/synthetics'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/synthetics', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/synthetics/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/synthetics/kibana.jsonc b/x-pack/solutions/observability/plugins/synthetics/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/kibana.jsonc rename to x-pack/solutions/observability/plugins/synthetics/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/field_selector.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/field_selector.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/field_selector.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitor_configuration.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitor_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitor_configuration.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitor_configuration.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitor_filters_form.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitor_filters_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitor_filters_form.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitor_filters_form.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitors_open_configuration.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitors_open_configuration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/monitors_open_configuration.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/monitors_open_configuration.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/optional_text.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/optional_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/optional_text.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/optional_text.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/show_selected_filters.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/show_selected_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/show_selected_filters.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/show_selected_filters.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/utils.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/common/utils.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/common/utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/constants.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/constants.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/constants.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/hooks/use_fetch_synthetics_suggestions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/hooks/use_fetch_synthetics_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/hooks/use_fetch_synthetics_suggestions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/hooks/use_fetch_synthetics_suggestions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/monitors_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/monitors_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/monitors_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/monitors_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/monitors_grid_component.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/monitors_grid_component.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/monitors_grid_component.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/monitors_grid_component.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/redux_store.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/redux_store.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/redux_store.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/redux_store.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/monitors_overview/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/monitors_overview/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/register_embeddables.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/register_embeddables.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/register_embeddables.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/register_embeddables.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/redux_store.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/redux_store.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/redux_store.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/redux_store.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/stats_overview_component.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/stats_overview_component.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/stats_overview_component.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/stats_overview_component.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/stats_overview_embeddable_factory.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/stats_overview_embeddable_factory.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/stats_overview/stats_overview_embeddable_factory.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/stats_overview/stats_overview_embeddable_factory.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/synthetics_embeddable_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/synthetics_embeddable_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/synthetics_embeddable_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/synthetics_embeddable_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/compatibility_check.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/compatibility_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/compatibility_check.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/compatibility_check.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/create_monitors_overview_panel_action.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/create_monitors_overview_panel_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/create_monitors_overview_panel_action.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/create_monitors_overview_panel_action.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/create_stats_overview_panel_action.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/create_stats_overview_panel_action.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/create_stats_overview_panel_action.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/create_stats_overview_panel_action.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/register_ui_actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/register_ui_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/embeddables/ui_actions/register_ui_actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/embeddables/ui_actions/register_ui_actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/locators/edit_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/locators/edit_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/locators/edit_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/locators/edit_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/locators/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/locators/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/locators/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/locators/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/locators/monitor_detail.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/locators/monitor_detail.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/locators/monitor_detail.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/locators/monitor_detail.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/locators/settings.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/locators/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/locators/settings.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/locators/settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/alert_tls.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/alert_tls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/alert_tls.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/alert_tls.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/condition_locations_value.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/condition_locations_value.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/condition_locations_value.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/condition_locations_value.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/condition_window_value.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/condition_window_value.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/condition_window_value.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/condition_window_value.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_filters.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_filters.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_filters.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_popover_expression.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_popover_expression.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_popover_expression.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_popover_expression.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_selector.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_selector.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_selector.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_selector.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_selector.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/field_selector.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/field_selector.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/for_the_last_expression.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/for_the_last_expression.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/for_the_last_expression.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/for_the_last_expression.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/group_by_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/group_by_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/group_by_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/group_by_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/popover_expression.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/popover_expression.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/common/popover_expression.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/common/popover_expression.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/translations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/use_fetch_synthetics_suggestions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/use_fetch_synthetics_suggestions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/use_fetch_synthetics_suggestions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/use_fetch_synthetics_suggestions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/use_synthetics_rules.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/use_synthetics_rules.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/hooks/use_synthetics_rules.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/hooks/use_synthetics_rules.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/query_bar.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/rule_name_with_loading.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/rule_name_with_loading.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/rule_name_with_loading.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/rule_name_with_loading.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/status_rule_expression.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/status_rule_expression.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/status_rule_expression.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/status_rule_expression.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/status_rule_ui.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/status_rule_ui.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/status_rule_ui.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/status_rule_ui.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/tls_rule_ui.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/tls_rule_ui.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/tls_rule_ui.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/tls_rule_ui.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/alerts/toggle_alert_flyout_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_monitors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_monitors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_monitors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_monitors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_refresh_btn.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_refresh_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_refresh_btn.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_refresh_btn.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_search.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_search.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_search.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_search.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/cert_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/cert_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificate_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificate_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificate_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificate_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates_list.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates_list.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates_list.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/certificates_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/certificates_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/fingerprint_col.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/monitor_page_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/monitor_page_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/monitor_page_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/monitor_page_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/translations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/use_cert_search.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/use_cert_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/use_cert_search.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/use_cert_search.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/use_cert_status.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/use_cert_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/certificates/use_cert_status.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/certificates/use_cert_status.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/alerting_callout/alerting_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/add_to_dashboard.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/add_to_dashboard.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/add_to_dashboard.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/add_to_dashboard.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/auto_refresh_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/auto_refresh_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/auto_refresh_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/auto_refresh_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/embeddable_panel_wrapper.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/embeddable_panel_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/embeddable_panel_wrapper.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/embeddable_panel_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/filter_status_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/filter_status_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/filter_status_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/filter_status_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/last_refreshed.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/last_refreshed.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/last_refreshed.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/last_refreshed.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/location_status_badges.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/location_status_badges.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/location_status_badges.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/location_status_badges.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_details_panel.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_details_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_details_panel.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_details_panel.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx similarity index 99% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx index 90d30606b860..b09d82ab03c5 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_inspect.tsx @@ -72,7 +72,6 @@ const MonitorInspect = ({ isValid, monitorFields }: InspectorProps) => { } // FIXME: Dario couldn't find a solution for monitorFields // which is not memoized downstream - // eslint-disable-next-line react-hooks/exhaustive-deps }, [isInspecting, hideParams]); let flyout; diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_location_select.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_location_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_location_select.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_location_select.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_type_badge.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_type_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/monitor_type_badge.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/monitor_type_badge.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/page_loader.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/page_loader.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/page_loader.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/page_loader.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/panel_with_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/panel_with_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/panel_with_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/panel_with_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/permissions.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/permissions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/permissions.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/permissions.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/refresh_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/refresh_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/refresh_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/refresh_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/stderr_logs.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/table_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/table_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/table_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/table_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/thershold_indicator.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/thershold_indicator.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/thershold_indicator.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/thershold_indicator.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/use_std_error_logs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/use_std_error_logs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/use_std_error_logs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/use_std_error_logs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/view_document.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/view_document.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/components/view_document.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/components/view_document.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/date_picker/synthetics_date_picker.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu_content.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu_content.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/action_menu_content.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/inspector_header_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/inspector_header_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/header/inspector_header_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/header/inspector_header_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/add_monitor.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/add_monitor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/add_monitor.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/add_monitor.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/error_details_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/error_details_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/error_details_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/error_details_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/manage_rules_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/manage_rules_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/manage_rules_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/manage_rules_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/step_details_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/step_details_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/step_details_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/step_details_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/test_details_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/test_details_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/test_details_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/test_details_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_alerts.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/view_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/links/view_alerts.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/links/view_alerts.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/browser_steps_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/journey_screenshot_preview.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx similarity index 97% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx index 25f0ed084347..a0e6d2ca6d29 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/result_details_successful.tsx @@ -39,7 +39,6 @@ export const ResultDetailsSuccessful = ({ }); // FIXME: Dario is not sure what step._id is being used for, // so he'll leave it in place - // eslint-disable-next-line react-hooks/exhaustive-deps }, [timestamp, monitorId, stepIndex, location, step._id]); const { currentStep } = useJourneySteps( diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/single_ping_result.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/status_badge.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/status_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/status_badge.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/status_badge.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/step_duration_text.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/step_duration_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/step_duration_text.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/step_duration_text.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/use_retrieve_step_image.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/use_retrieve_step_image.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/monitor_test_result/use_retrieve_step_image.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/monitor_test_result/use_retrieve_step_image.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/page_template/synthetics_page_template.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/page_template/synthetics_page_template.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/page_template/synthetics_page_template.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/page_template/synthetics_page_template.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_events.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/react_router_helpers/link_for_eui.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/empty_thumbnail.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_last_screenshot.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_last_screenshot.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_last_screenshot.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_last_screenshot.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_screenshot_dialog.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/journey_step_screenshot_container.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_image.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_image.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_image.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_image.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_size.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_size.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_size.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/screenshot/screenshot_size.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/common/step_field_trend/step_field_trend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_duration.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_duration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_duration.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_duration.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_started_at.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_started_at.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_started_at.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_started_at.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_timeline.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_timeline.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/error_timeline.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/error_timeline.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/failed_tests_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/failed_tests_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/failed_tests_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/failed_tests_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/resolved_at.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/resolved_at.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/components/resolved_at.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/components/resolved_at.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/error_details_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/error_details_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/error_details_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/error_details_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_details_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_details_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_details_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_details_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_failed_tests.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_failed_tests.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_failed_tests.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_error_failed_tests.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_find_my_killer_state.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_find_my_killer_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_find_my_killer_state.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_find_my_killer_state.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_step_details.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_step_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/hooks/use_step_details.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/hooks/use_step_details.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/route_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/route_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/error_details/route_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/error_details/route_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/form_fields/service_locations.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/form_fields/service_locations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/form_fields/service_locations.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/form_fields/service_locations.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/getting_started_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/simple_monitor_form.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/getting_started/use_simple_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/advanced/index.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/advanced/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/advanced/index.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/advanced/index.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/constants.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/constants.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/constants.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/edit_monitor_not_found.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/edit_monitor_not_found.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/edit_monitor_not_found.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/edit_monitor_not_found.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/code_editor.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/code_editor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/code_editor.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/code_editor.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/combo_box.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/header_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/index_response_body_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/key_value_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/monitor_type_radio_group.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/monitor_type_radio_group.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/monitor_type_radio_group.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/monitor_type_radio_group.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/optional_label.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/optional_label.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/optional_label.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/optional_label.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/request_body_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/script_recorder_fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/source_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/connection_profile.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/connection_profile.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/connection_profile.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/connection_profile.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_config_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_disabled_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_disabled_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_disabled_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_disabled_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_download_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_download_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_download_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_download_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_exceeded_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_exceeded_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_exceeded_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_exceeded_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_latency_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_latency_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_latency_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_latency_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_upload_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_upload_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_upload_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/throttling_upload_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/use_connection_profiles.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/use_connection_profiles.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/use_connection_profiles.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/throttling/use_connection_profiles.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/uploader.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/uploader.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/uploader.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/fields/uploader.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/controlled_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/controlled_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/controlled_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/controlled_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/defaults.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/disclaimer.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_wrappers.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_wrappers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_wrappers.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/field_wrappers.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/form_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/form_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/form_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/form_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/formatter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/index.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/index.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/index.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/run_test_btn.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/run_test_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/run_test_btn.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/run_test_btn.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/submit.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/submit.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/submit.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/submit.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/form/validation.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_clone_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_clone_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_clone_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_clone_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_is_edit_flow.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_is_edit_flow.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_is_edit_flow.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_is_edit_flow.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_not_found.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_not_found.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_not_found.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_not_found.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx similarity index 98% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx index 4bd8b503a247..b9359b035784 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_monitor_save.tsx @@ -44,7 +44,6 @@ export const useMonitorSave = ({ monitorData }: { monitorData?: SyntheticsMonito } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [monitorData]); useEffect(() => { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_validate_field.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_validate_field.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_validate_field.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/hooks/use_validate_field.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/locations_loading_error.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/locations_loading_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/locations_loading_error.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/locations_loading_error.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_add_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_details_portal.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/monitor_edit_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/portals.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/portals.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/portals.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/portals.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/can_use_public_locations_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/can_use_public_locations_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/can_use_public_locations_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/can_use_public_locations_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/index.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/index.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/index.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/inspect_monitor_portal.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/inspect_monitor_portal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/inspect_monitor_portal.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/inspect_monitor_portal.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type_portal.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type_portal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type_portal.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/monitor_type_portal.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/read_only_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/read_only_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/read_only_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/read_only_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/steps/step_fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/use_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/use_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_add_edit/use_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_add_edit/use_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_error_failed_step.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_error_failed_step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_error_failed_step.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_error_failed_step.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_failed_tests_by_step.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_failed_tests_by_step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_failed_tests_by_step.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_failed_tests_by_step.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_fetch_active_alerts.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_journey_steps.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_errors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_errors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_errors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_errors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_latest_ping.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_pings.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_filters.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_filters.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_id.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_id.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_id.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_query_id.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_range_from.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_range_from.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_range_from.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_monitor_range_from.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_location.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_location.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_location.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_location.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_monitor.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_monitor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_monitor.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/hooks/use_selected_monitor.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/alerts_icon.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/monitor_detail_alerts.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/monitor_detail_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/monitor_detail_alerts.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_alerts/monitor_detail_alerts.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_last_run.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_last_run.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_last_run.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_last_run.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_location.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_location.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_location.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_location.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_page_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_page_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_page_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_page_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_details_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_icon.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_icon.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_icon.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_tab_content.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_tab_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_tab_content.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/errors_tab_content.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_by_step.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_by_step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_by_step.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_by_step.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_count.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_count.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/failed_tests_count.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_errors/monitor_errors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_history/monitor_history.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_history/monitor_history.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_history/monitor_history.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_history/monitor_history.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_not_found_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_not_found_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_not_found_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_not_found_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_pending_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_searchable_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_searchable_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_searchable_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_searchable_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_selector.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_selector.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_selector.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/monitor_selector.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts similarity index 98% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts index 0988e6c2aefc..6e9e8decd7e6 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_selector/use_recently_viewed_monitors.ts @@ -94,7 +94,6 @@ export const useRecentlyViewedMonitors = () => { } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [monitorQueryId]); return useMemo( diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/labels.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/labels.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/labels.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_cell_tooltip.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_cell_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_cell_tooltip.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_cell_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_chart_theme.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_chart_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_chart_theme.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_chart_theme.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_data.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_legend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_legend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_legend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_panel.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_panel.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/monitor_status_panel.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_status/use_monitor_status_data.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/alert_actions.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/alert_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/alert_actions.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/alert_actions.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_panel.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_sparklines.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_sparklines.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_sparklines.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/availability_sparklines.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_panel.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_panel.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_panel.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_sparklines.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_sparklines.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_sparklines.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_sparklines.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_trend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_trend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_trend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/duration_trend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/edit_monitor_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/edit_monitor_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/edit_monitor_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/edit_monitor_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/last_test_run.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/locations_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/locations_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/locations_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/locations_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_alerts.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_alerts.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_alerts.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_count.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_count.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_count.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_sparklines.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_sparklines.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_sparklines.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_complete_sparklines.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel_container.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel_container.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_details_panel_container.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_error_sparklines.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_errors_count.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_summary.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_total_runs_count.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_total_runs_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_total_runs_count.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/monitor_total_runs_count.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/status_filter.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/status_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/status_filter.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/status_filter.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/step_duration_panel.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/step_duration_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/step_duration_panel.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/step_duration_panel.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/monitor_summary/test_runs_table_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/route_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/route_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/route_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/route_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/run_test_manually.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/run_test_manually.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/run_test_manually.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/run_test_manually.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/use_monitor_details_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/use_monitor_details_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitor_details/use_monitor_details_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitor_details/use_monitor_details_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_group.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_group.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_group.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/filter_group.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/list_filters.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/list_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/list_filters.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/list_filters.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/monitor_filters/use_filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/no_monitors_found.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/search_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/show_all_spaces.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/show_all_spaces.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/common/show_all_spaces.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/common/show_all_spaces.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/create_monitor_button.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/create_monitor_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/create_monitor_button.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/create_monitor_button.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_can_use_public_loc_id.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_can_use_public_loc_id.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_can_use_public_loc_id.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_can_use_public_loc_id.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_create_slo.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_create_slo.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_create_slo.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_create_slo.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors_count.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors_count.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors_count.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_inline_errors_count.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_list.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_query_filters.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_query_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_query_filters.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_monitor_query_filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_overview_status.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_overview_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_overview_status.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/hooks/use_overview_status.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/disabled_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/disabled_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/disabled_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/disabled_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/labels.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/labels.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/labels.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/loader/loader.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_errors/monitor_async_error.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_container.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_container.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_container.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/bulk_operations.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/bulk_operations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/bulk_operations.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/bulk_operations.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/columns.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/columns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/columns.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/columns.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/delete_monitor.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/delete_monitor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/delete_monitor.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/delete_monitor.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/labels.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/labels.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/labels.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/labels.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_details_link.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_enabled.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_list_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_locations.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_locations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_locations.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_list_table/monitor_locations.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_stats.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_stats.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_stats.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_stats.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/monitor_stats/monitor_test_runs_sparkline.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/page_header/monitors_page_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/page_header/monitors_page_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/page_header/monitors_page_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/page_header/monitors_page_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/show_sync_errors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/show_sync_errors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/show_sync_errors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/show_sync_errors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/labels.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/labels.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/labels.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/synthetics_enablement.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/synthetics_enablement.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/synthetics_enablement.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/management/synthetics_enablement/synthetics_enablement.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/monitors_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/actions_popover.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_group_item.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_group_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_group_item.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_group_item.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_items_by_group.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_items_by_group.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_items_by_group.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/grid_items_by_group.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_menu.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_menu.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/group_menu.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/use_filtered_group_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/use_filtered_group_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/use_filtered_group_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/grid_by_group/use_filtered_group_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_body.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_body.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_body.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_body.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item/metric_item_extra.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item_icon.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item_icon.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/metric_item_icon.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/monitor_detail_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_alerts.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_alerts.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_alerts.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_count.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_count.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_count.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_count.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_errors/overview_errors_sparklines.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_grid_item_loader.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_loader.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_pagination_info.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/overview_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/quick_filters.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_fields.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/sort_menu.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/overview_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/use_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/use_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/overview/use_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/overview/use_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/route_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/route_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/monitors_page/route_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/monitors_page/route_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/add_connector_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/add_connector_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/add_connector_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/add_connector_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/alert_defaults_form.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/alert_defaults_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/alert_defaults_form.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/alert_defaults_form.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/connector_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/connector_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/connector_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/connector_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/default_email.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/default_email.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/default_email.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/default_email.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/hooks/use_alerting_defaults.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/hooks/use_alerting_defaults.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/hooks/use_alerting_defaults.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/hooks/use_alerting_defaults.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/translations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/validation.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/validation.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/alerting_defaults/validation.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/alerting_defaults/validation.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/components/optional_text.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/components/optional_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/components/optional_text.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/components/optional_text.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/components/tags_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/components/tags_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/components/tags_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/components/tags_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/common.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/common.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/common.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/common.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/common.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/dsl_retention_tab.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/dsl_retention_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/dsl_retention_tab.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/dsl_retention_tab.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/ilm_retention_tab.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/ilm_retention_tab.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/ilm_retention_tab.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/ilm_retention_tab.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/index.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/index.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/index.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/policy_labels.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/policy_labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/policy_labels.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/policy_labels.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/unprivileged.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/unprivileged.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/unprivileged.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/unprivileged.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/use_management_locator.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/use_management_locator.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/data_retention/use_management_locator.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/data_retention/use_management_locator.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/add_param_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/add_param_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/add_param_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/add_param_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/add_param_form.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/add_param_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/add_param_form.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/add_param_form.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/delete_param.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/delete_param.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/delete_param.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/delete_param.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/param_value_field.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/param_value_field.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/param_value_field.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/param_value_field.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/params_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/params_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/params_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/params_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/params_text.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/params_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/global_params/params_text.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/global_params/params_text.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_data_stream_statuses.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_get_ilm_policies.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_params_list.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_params_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/hooks/use_params_list.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/hooks/use_params_list.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/page_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/page_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/page_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/page_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/policy_link.tsx similarity index 97% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/policy_link.tsx index 3918e20bccab..782c8ebd34f6 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/policy_link.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/policy_link.tsx @@ -26,7 +26,6 @@ export const PolicyLink = ({ name }: { name: string }) => { return ilmLocator?.getLocation({ page: 'policy_edit', policyName: name }); // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [name]); if (!data) { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/add_location_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/add_location_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/add_location_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/add_location_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/agent_policy_needed.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/agent_policy_needed.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/agent_policy_needed.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/agent_policy_needed.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/copy_name.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/copy_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/copy_name.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/copy_name.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/delete_location.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/delete_location.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/delete_location.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/delete_location.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/empty_locations.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/empty_locations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/empty_locations.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/empty_locations.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_location_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts similarity index 95% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts index 6b3899a5b44c..4f3790edddec 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/hooks/use_locations_api.ts @@ -46,7 +46,6 @@ export const usePrivateLocationsAPI = () => { } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [formData]); const onSubmit = (data: NewLocation) => { @@ -67,7 +66,6 @@ export const usePrivateLocationsAPI = () => { } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [deleteId]); return { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/location_form.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/location_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/location_form.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/location_form.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/locations_table.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/locations_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/locations_table.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/locations_table.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_empty_state.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_empty_state.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_empty_state.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_empty_state.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/manage_private_locations.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/policy_hosts.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/policy_hosts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/policy_hosts.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/policy_hosts.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/policy_name.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/policy_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/policy_name.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/policy_name.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/view_location_monitors.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/view_location_monitors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/private_locations/view_location_monitors.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/private_locations/view_location_monitors.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/api_key_btn.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/help_commands.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/help_commands.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/help_commands.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/help_commands.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx similarity index 99% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx index 4a8752e8b992..07d0b83c15e5 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/project_api_keys/project_api_keys.tsx @@ -40,7 +40,6 @@ export const ProjectAPIKeys = () => { return null; // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [loadAPIKey, canUsePublicLocations]); useEffect(() => { diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/route_config.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/route_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/route_config.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/route_config.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/settings_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/settings_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/settings_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/settings_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/use_settings_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/use_settings_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/settings/use_settings_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/settings/use_settings_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/data_formatting.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/common/network_data/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/error_callout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/error_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/error_callout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/error_callout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings_prev.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings_prev.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings_prev.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_network_timings_prev.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_object_metrics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_prev_object_metrics.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_prev_object_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_prev_object_metrics.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_prev_object_metrics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_detail_page.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_details_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_metrics.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_metrics.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_metrics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_prev_metrics.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_prev_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_prev_metrics.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/hooks/use_step_prev_metrics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/network_timings_breakdown.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/route_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/route_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/route_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/route_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_detail_page.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_details_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_details_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_details_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_details_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/definitions_popover.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/definitions_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/definitions_popover.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/definitions_popover.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/labels.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/labels.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/labels.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/labels.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/step_metrics.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/step_metrics.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/step_metrics.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_metrics/step_metrics.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_number_nav.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_number_nav.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_number_nav.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_number_nav.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/color_palette.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/color_palette.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/color_palette.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/color_palette.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_count_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_count_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_count_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_count_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_weight_list.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_weight_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_weight_list.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_objects/object_weight_list.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_page_nav.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_page_nav.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_page_nav.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_page_nav.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx similarity index 97% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx index cde0cb93fed1..dfd7d3db1100 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/last_successful_screenshot.tsx @@ -37,7 +37,6 @@ export const LastSuccessfulScreenshot = ({ }); // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [step._id, step['@timestamp']]); return ( diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/step_image.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/step_image.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/step_image.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_screenshot/step_image.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/breakdown_legend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/breakdown_legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/breakdown_legend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/breakdown_legend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/network_timings_donut.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/network_timings_donut.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/network_timings_donut.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_timing_breakdown/network_timings_donut.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/use_step_waterfall_metrics.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/README.md b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/README.md similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/README.md rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/README.md diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/constants.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/constants.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/constants.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/context/waterfall_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/context/waterfall_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/context/waterfall_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/context/waterfall_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/middle_truncated_text.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/sidebar.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/sidebar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/sidebar.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/sidebar.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/styles.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/styles.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/styles.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/styles.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/translations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/use_bar_charts.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_bar_chart.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_container.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_fixed_axis.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_fixed_axis.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_fixed_axis.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_fixed_axis.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_chart_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/use_flyout.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout_table.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout_table.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_flyout/waterfall_flyout_table.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/network_requests_total.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_legend_item.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_legend_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_legend_item.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_legend_item.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_mime_legend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_search.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_tick_axis.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_timing_legend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_timing_legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_timing_legend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_header/waterfall_timing_legend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_icon.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_test_helper.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_test_helper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_test_helper.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_test_helper.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_marker_trend.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_markers.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_markers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_markers.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_marker/waterfall_markers.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_sidebar_item.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/step_details_page/step_waterfall_chart/waterfall/waterfall_tooltip_content.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/browser/browser_test_results.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/browser/browser_test_results.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/browser/browser_test_results.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/browser/browser_test_results.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts similarity index 99% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts index c5b11dc27223..553278f180bd 100644 --- a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts +++ b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_browser_run_once_monitors.ts @@ -189,7 +189,6 @@ export const useBrowserRunOnceMonitors = ({ return Promise.resolve(null); // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Synthetics folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [checkGroupCheckSum, setCheckGroupResults, lastRefresh]); // Whenever a new found document is fetched, update lastUpdated diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_run_once_errors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_run_once_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_run_once_errors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_run_once_errors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_simple_run_once_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_simple_run_once_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_simple_run_once_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_simple_run_once_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_test_flyout_open.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_test_flyout_open.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_test_flyout_open.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_test_flyout_open.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_tick_tick.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_tick_tick.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_tick_tick.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/hooks/use_tick_tick.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/browser_test_results.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/browser_test_results.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/browser_test_results.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/browser_test_results.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/manual_test_run_mode.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/manual_test_run_mode.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/manual_test_run_mode.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/manual_test_run_mode.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/simple_test_results.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/simple_test_results.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/simple_test_results.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/manual_test_run_mode/simple_test_results.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/expand_row.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/expand_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/expand_row.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/expand_row.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_error.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_error.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_error.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/ping_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/response_code.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/response_code.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/response_code.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/columns/response_code.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/expanded_row.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/expanded_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/expanded_row.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/expanded_row.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/headers.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/headers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/headers.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/headers.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_list_table.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_list_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_list_table.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_list_table.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_redirects.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_redirects.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_redirects.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/ping_redirects.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/translations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/use_ping_expanded.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/use_ping_expanded.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/use_ping_expanded.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/ping_list/use_ping_expanded.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/simple_test_results.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/simple_test_results.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/simple/simple_test_results.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/simple/simple_test_results.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout_container.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout_container.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_now_mode_flyout_container.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_result_header.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_result_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_now_mode/test_result_header.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_now_mode/test_result_header.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_details.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_details.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_details.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_info.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_info.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_info.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_number_nav.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_number_nav.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/step_number_nav.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/step_number_nav.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_date.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_date.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_date.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_date.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_details_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_details_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_details_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_details_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_error_info.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_error_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_error_info.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/components/test_run_error_info.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/hooks/use_test_run_details_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/hooks/use_test_run_details_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/hooks/use_test_run_details_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/hooks/use_test_run_details_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/route_config.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/route_config.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/route_config.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/route_config.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/step_screenshot_details.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/step_screenshot_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/step_screenshot_details.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/step_screenshot_details.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/step_tabs.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/step_tabs.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/step_tabs.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/step_tabs.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/test_run_details.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/test_run_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/test_run_details.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/test_run_details.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/test_run_steps.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/test_run_steps.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/components/test_run_details/test_run_steps.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/components/test_run_details/test_run_steps.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_data_view_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_data_view_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_data_view_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_data_view_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_embeddable_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_embeddable_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_embeddable_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_embeddable_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_refresh_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_refresh_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_refresh_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_refresh_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_settings_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_settings_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_settings_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_settings_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_shared_context.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_shared_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/contexts/synthetics_shared_context.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/contexts/synthetics_shared_context.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_absolute_date.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_absolute_date.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_absolute_date.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_absolute_date.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_absolute_date.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_absolute_date.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_absolute_date.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_absolute_date.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_composite_image.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_composite_image.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_composite_image.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_composite_image.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_composite_image.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_composite_image.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_composite_image.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_composite_image.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_dimensions.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_dimensions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_dimensions.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_dimensions.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_edit_monitor_locator.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_edit_monitor_locator.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_edit_monitor_locator.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_edit_monitor_locator.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_enablement.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_enablement.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_enablement.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_enablement.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_fleet_permissions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_fleet_permissions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_fleet_permissions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_fleet_permissions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_location_name.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_location_name.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_location_name.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_location_name.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_location_name.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_location_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_location_name.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_location_name.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_locations.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_alert_enable.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_alert_enable.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_alert_enable.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_alert_enable.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_detail.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_detail.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_detail.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_detail.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_detail_locator.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_detail_locator.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_detail_locator.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_detail_locator.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_enable_handler.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_name.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_name.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_name.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_name.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_name.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_name.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitor_name.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitor_name.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_monitors_sorted_by_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_redux_es_search.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_redux_es_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_redux_es_search.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_redux_es_search.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_status_by_location_overview.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location_overview.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_status_by_location_overview.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_status_by_location_overview.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_synthetics_priviliges.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_url_params.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_url_params.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_url_params.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_url_params.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_url_params.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/hooks/use_url_params.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/hooks/use_url_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/monitor_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/monitor_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/tls_alert.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/tls_alert.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/tls_alert.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/tls_alert.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/validate_tls_alert.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/validate_tls_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/validate_tls_alert.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/lazy_wrapper/validate_tls_alert.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/monitor_status.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/monitor_status.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/tls.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/tls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/tls.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/tls.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/types.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/lib/alert_types/types.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/lib/alert_types/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/render_app.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/render_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/render_app.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/render_app.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/routes.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/routes.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/routes.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/alert_rules/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/alert_rules/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/api.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/api.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/models.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/models.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/models.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/models.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/browser_journey/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/browser_journey/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certificates/certificates.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certificates/certificates.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certificates/certificates.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certificates/certificates.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/certs/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/certs/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/elasticsearch/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/elasticsearch/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/global_params/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/global_params/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/manual_test_runs/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/manual_test_runs/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_details/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/helpers.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/helpers.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/helpers.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/models.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/models.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/models.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/models.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/toast_title.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/toast_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_list/toast_title.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_list/toast_title.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_management/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_management/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/monitor_management/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/monitor_management/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/network_events/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/network_events/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/effects.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/effects.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/effects.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/effects.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/models.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/models.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/models.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/models.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/overview_status/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/overview_status/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/private_locations/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/private_locations/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/root_effect.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/root_effect.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/root_effect.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/root_effect.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/root_reducer.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/root_reducer.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/root_reducer.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/service_locations/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/service_locations/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/settings/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/settings/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/models.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/models.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/models.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/models.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/status_heatmap/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/status_heatmap/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/store.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/store.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/store.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/store.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/api.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/api.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/effects.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/effects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/effects.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/effects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/synthetics_enablement/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/synthetics_enablement/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/selectors.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/selectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/ui/selectors.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/ui/selectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/actions.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/actions.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/actions.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/fetch_effect.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/fetch_effect.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/fetch_effect.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/fetch_effect.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/http_error.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/http_error.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/state/utils/http_error.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/state/utils/http_error.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/synthetics_app.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/synthetics_app.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/adapters/capabilities_adapter.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/adapters/capabilities_adapter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/adapters/capabilities_adapter.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/adapters/capabilities_adapter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/adapters/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/adapters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/adapters/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/adapters/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/filters/filter_fields.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/filters/filter_fields.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/filters/filter_fields.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/filters/filter_fields.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/format.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/format.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/format.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/format.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/formatting/test_helpers.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/check_pings.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/check_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/check_pings.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/check_pings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/compose_screenshot_images.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/sort_pings.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/sort_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/sort_pings.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/sort_pings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/monitor_test_result/test_time_formats.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_plugin_start_mock.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_plugin_start_mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_plugin_start_mock.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_plugin_start_mock.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/synthetics_store.mock.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/__mocks__/ut_router_history.mock.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/helper_with_redux.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/helper_with_redux.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/helper_with_redux.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/helper_with_redux.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/testing/rtl_helpers.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/get_supported_url_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/parse_absolute_date.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/url_params/stringify_url_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/validators/is_url_valid.test.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/validators/is_url_valid.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/validators/is_url_valid.test.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/validators/is_url_valid.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/validators/is_url_valid.ts b/x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/validators/is_url_valid.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/apps/synthetics/utils/validators/is_url_valid.ts rename to x-pack/solutions/observability/plugins/synthetics/public/apps/synthetics/utils/validators/is_url_valid.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_base_chart_theme.ts b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_base_chart_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_base_chart_theme.ts rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_base_chart_theme.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_capabilities.ts b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_capabilities.ts rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_capabilities.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_date_format.test.tsx b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_date_format.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_date_format.test.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_date_format.test.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_date_format.ts b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_date_format.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_date_format.ts rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_date_format.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_form_wrapped.tsx b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_form_wrapped.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_form_wrapped.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_form_wrapped.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/hooks/use_kibana_space.tsx b/x-pack/solutions/observability/plugins/synthetics/public/hooks/use_kibana_space.tsx similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/hooks/use_kibana_space.tsx rename to x-pack/solutions/observability/plugins/synthetics/public/hooks/use_kibana_space.tsx diff --git a/x-pack/plugins/observability_solution/synthetics/public/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/plugin.ts b/x-pack/solutions/observability/plugins/synthetics/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/plugin.ts rename to x-pack/solutions/observability/plugins/synthetics/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts b/x-pack/solutions/observability/plugins/synthetics/public/utils/api_service/api_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/utils/api_service/api_service.ts rename to x-pack/solutions/observability/plugins/synthetics/public/utils/api_service/api_service.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/utils/api_service/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/utils/api_service/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/utils/api_service/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/utils/api_service/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/utils/kibana_service/index.ts b/x-pack/solutions/observability/plugins/synthetics/public/utils/kibana_service/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/utils/kibana_service/index.ts rename to x-pack/solutions/observability/plugins/synthetics/public/utils/kibana_service/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/public/utils/kibana_service/kibana_service.ts b/x-pack/solutions/observability/plugins/synthetics/public/utils/kibana_service/kibana_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/public/utils/kibana_service/kibana_service.ts rename to x-pack/solutions/observability/plugins/synthetics/public/utils/kibana_service/kibana_service.ts diff --git a/x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js b/x-pack/solutions/observability/plugins/synthetics/scripts/base_e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/scripts/base_e2e.js rename to x-pack/solutions/observability/plugins/synthetics/scripts/base_e2e.js diff --git a/x-pack/plugins/observability_solution/synthetics/scripts/e2e.js b/x-pack/solutions/observability/plugins/synthetics/scripts/e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/scripts/e2e.js rename to x-pack/solutions/observability/plugins/synthetics/scripts/e2e.js diff --git a/x-pack/plugins/observability_solution/synthetics/scripts/generate_monitors.js b/x-pack/solutions/observability/plugins/synthetics/scripts/generate_monitors.js similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/scripts/generate_monitors.js rename to x-pack/solutions/observability/plugins/synthetics/scripts/generate_monitors.js diff --git a/x-pack/plugins/observability_solution/synthetics/scripts/tasks/generate_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/scripts/tasks/generate_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/scripts/tasks/generate_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/scripts/tasks/generate_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/action_variables.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/action_variables.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/action_variables.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/action_variables.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/common.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/common.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/common.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/common.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/common.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/message_utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/message_utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/message_utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/message_utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/monitor_status_rule.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/queries/filter_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/queries/filter_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/queries/filter_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/queries/filter_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/queries/query_monitor_status_alert.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/queries/query_monitor_status_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/queries/query_monitor_status_alert.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/queries/query_monitor_status_alert.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/status_rule_executor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/status_rule_executor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/status_rule_executor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/status_rule_executor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/status_rule_executor.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/status_rule_executor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/status_rule_executor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/status_rule_executor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/types.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/types.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/status_rule/utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/status_rule/utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/message_utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/message_utils.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/message_utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/message_utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/message_utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule_executor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule_executor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule_executor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule_executor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule_executor.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule_executor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/tls_rule/tls_rule_executor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/tls_rule/tls_rule_executor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/alert_rules/translations.ts b/x-pack/solutions/observability/plugins/synthetics/server/alert_rules/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/alert_rules/translations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/alert_rules/translations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/common/pings/monitor_status_heatmap.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/pings/monitor_status_heatmap.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/common/pings/monitor_status_heatmap.ts rename to x-pack/solutions/observability/plugins/synthetics/server/common/pings/monitor_status_heatmap.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/common/pings/query_pings.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/pings/query_pings.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/common/pings/query_pings.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/common/pings/query_pings.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/common/pings/query_pings.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/pings/query_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/common/pings/query_pings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/common/pings/query_pings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/common/unzip_project_code.ts b/x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/common/unzip_project_code.ts rename to x-pack/solutions/observability/plugins/synthetics/server/common/unzip_project_code.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/config.ts b/x-pack/solutions/observability/plugins/synthetics/server/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/config.ts rename to x-pack/solutions/observability/plugins/synthetics/server/config.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/constants/settings.ts b/x-pack/solutions/observability/plugins/synthetics/server/constants/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/constants/settings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/constants/settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/feature.ts b/x-pack/solutions/observability/plugins/synthetics/server/feature.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/feature.ts rename to x-pack/solutions/observability/plugins/synthetics/server/feature.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/lib.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/lib.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/lib.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/lib.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/lib.ts b/x-pack/solutions/observability/plugins/synthetics/server/lib.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/lib.ts rename to x-pack/solutions/observability/plugins/synthetics/server/lib.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/plugin.ts b/x-pack/solutions/observability/plugins/synthetics/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/plugin.ts rename to x-pack/solutions/observability/plugins/synthetics/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_certs.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_certs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_certs.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_certs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_index_pattern.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_index_pattern.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_index_pattern.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_index_pattern.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_details.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_details.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_details.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_failed_steps.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_failed_steps.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_failed_steps.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_failed_steps.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_failed_steps.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_failed_steps.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_failed_steps.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_failed_steps.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot_blocks.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot_blocks.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot_blocks.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot_blocks.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot_blocks.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot_blocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_screenshot_blocks.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_screenshot_blocks.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_steps.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_steps.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_steps.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_steps.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_steps.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_steps.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_journey_steps.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_journey_steps.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_last_successful_check.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_last_successful_check.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_last_successful_check.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_last_successful_check.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_last_successful_check.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_last_successful_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_last_successful_check.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_last_successful_check.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_network_events.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_network_events.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_network_events.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_network_events.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/get_network_events.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/get_network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/get_network_events.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/get_network_events.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/journey_screenshots.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/journey_screenshots.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/journey_screenshots.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/journey_screenshots.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/queries/test_helpers.ts b/x-pack/solutions/observability/plugins/synthetics/server/queries/test_helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/queries/test_helpers.ts rename to x-pack/solutions/observability/plugins/synthetics/server/queries/test_helpers.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/certs/get_certificates.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/certs/get_certificates.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/certs/get_certificates.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/certs/get_certificates.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/certs/get_certificates.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/certs/get_certificates.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/certs/get_certificates.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/certs/get_certificates.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/common.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/common.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/common.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/common.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/common.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/create_route_with_auth.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/create_route_with_auth.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/create_route_with_auth.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/create_route_with_auth.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/create_route_with_auth.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/create_route_with_auth.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/create_route_with_auth.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/create_route_with_auth.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/default_alert_service.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/default_alert_service.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/default_alert_service.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/default_alert_service.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/default_alert_service.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/default_alert_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/default_alert_service.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/default_alert_service.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/enable_default_alert.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/enable_default_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/enable_default_alert.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/enable_default_alert.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_action_connectors.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_action_connectors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_action_connectors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_action_connectors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_connector_types.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_connector_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_connector_types.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_connector_types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_default_alert.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_default_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/get_default_alert.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/get_default_alert.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/update_default_alert.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/update_default_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/default_alerts/update_default_alert.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/default_alerts/update_default_alert.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/filters/filters.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/filters/filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/filters/filters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/filters/filters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/fleet/get_has_integration_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/fleet/get_has_integration_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/fleet/get_has_integration_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/fleet/get_has_integration_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/add_monitor_api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/utils.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/utils.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/utils.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor/utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor/utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor_project.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/add_monitor_project.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/add_monitor_project.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/add_monitor_bulk.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/bulk_cruds/edit_monitor_bulk.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_integration.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_integration.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_integration.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_integration.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/delete_monitor_project.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/edit_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/edit_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/formatters/saved_object_to_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_api_key.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_api_key.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_api_key.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_api_key.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor_project.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitor_project.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitor_project.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitors_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/get_monitors_list.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/get_monitors_list.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/inspect_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/inspect_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/monitor_validation.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/monitor_validation.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/monitor_validation.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/services/delete_monitor_api.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/services/delete_monitor_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/services/delete_monitor_api.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/services/delete_monitor_api.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/services/validate_space_id.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/services/validate_space_id.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/services/validate_space_id.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/monitor_cruds/services/validate_space_id.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/network_events/get_network_events.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/network_events/get_network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/network_events/get_network_events.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/network_events/get_network_events.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/network_events/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/network_events/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/network_events/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/network_events/index.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status.ts new file mode 100644 index 000000000000..fb3ff320c8cf --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status.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 { OverviewStatusService } from './overview_status_service'; +import { SyntheticsRestApiRouteFactory } from '../types'; +import { OverviewStatusState } from '../../../common/runtime_types'; +import { SYNTHETICS_API_URLS } from '../../../common/constants'; +import { OverviewStatusSchema } from '../common'; + +export const createGetCurrentStatusRoute: SyntheticsRestApiRouteFactory = () => ({ + method: 'GET', + path: SYNTHETICS_API_URLS.OVERVIEW_STATUS, + validate: { + query: OverviewStatusSchema, + }, + handler: async (routeContext): Promise => { + const statusOverview = new OverviewStatusService(routeContext); + return await statusOverview.getOverviewStatus(); + }, +}); diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.test.ts new file mode 100644 index 000000000000..677f499b2a72 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.test.ts @@ -0,0 +1,793 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; +import * as monitorsFns from '../../saved_objects/synthetics_monitor/get_all_monitors'; +import { EncryptedSyntheticsMonitorAttributes } from '../../../common/runtime_types'; +import { getUptimeESMockClient } from '../../queries/test_helpers'; + +import * as commonLibs from '../common'; +import * as allLocationsFn from '../../synthetics_service/get_all_locations'; +import { OverviewStatusService, SUMMARIES_PAGE_SIZE } from './overview_status_service'; +import times from 'lodash/times'; +import { flatten } from 'lodash'; +const japanLoc = { + id: 'asia_japan', + label: 'Asia/Pacific - Japan', +}; + +const germanyLoc = { + id: 'europe_germany', + label: 'Europe - Germany', +}; + +const allLocations: any = [japanLoc, germanyLoc]; +jest.spyOn(allLocationsFn, 'getAllLocations').mockResolvedValue({ + publicLocations: allLocations, + privateLocations: [], + allLocations, +}); + +jest.mock('../../saved_objects/synthetics_monitor/get_all_monitors', () => ({ + ...jest.requireActual('../../saved_objects/synthetics_monitor/get_all_monitors'), + getAllMonitors: jest.fn(), +})); + +jest.spyOn(commonLibs, 'getMonitors').mockResolvedValue({ + per_page: 10, + saved_objects: [ + { + id: 'mon-1', + attributes: { + enabled: false, + locations: [{ id: 'us-east1' }, { id: 'us-west1' }, { id: 'japan' }], + }, + }, + { + id: 'mon-2', + attributes: { + enabled: true, + locations: [{ id: 'us-east1' }, { id: 'us-west1' }, { id: 'japan' }], + schedule: { + number: '10', + unit: 'm', + }, + }, + }, + ], +} as any); + +describe('current status route', () => { + const testMonitors = [ + { + attributes: { + config_id: 'id1', + id: 'id1', + type: 'browser', + enabled: true, + name: 'test monitor 1', + project_id: 'project-id', + tags: ['tag-1', 'tag-2'], + schedule: { + number: '1', + unit: 'm', + }, + locations: [japanLoc], + }, + }, + { + attributes: { + id: 'id2', + config_id: 'id2', + enabled: true, + type: 'browser', + name: 'test monitor 2', + project_id: 'project-id', + tags: ['tag-1', 'tag-2'], + schedule: { + number: '1', + unit: 'm', + }, + locations: allLocations, + }, + }, + ]; + + describe('OverviewStatusService', () => { + it('parses expected agg fields', async () => { + const { esClient, syntheticsEsClient } = getUptimeESMockClient(); + + esClient.search.mockResponseOnce( + getEsResponse({ + buckets: [ + { + key: { + monitorId: 'id1', + locationId: japanLoc.id, + }, + status: { + key: japanLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'up', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + { + key: { + monitorId: 'id2', + locationId: japanLoc.id, + }, + status: { + key: japanLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'up', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + { + key: { + monitorId: 'id2', + locationId: germanyLoc.id, + }, + status: { + key: germanyLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'down', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + ], + }) + ); + const routeContext: any = { + request: {}, + syntheticsEsClient, + }; + + const overviewStatusService = new OverviewStatusService(routeContext); + overviewStatusService.getMonitorConfigs = jest.fn().mockResolvedValue(testMonitors as any); + expect(await overviewStatusService.getOverviewStatus()).toMatchInlineSnapshot(` + Object { + "allIds": Array [ + "id1", + "id2", + ], + "allMonitorsCount": 2, + "disabledConfigs": Object {}, + "disabledCount": 0, + "disabledMonitorQueryIds": Array [], + "disabledMonitorsCount": 0, + "down": 1, + "downConfigs": Object { + "id2-europe_germany": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "europe_germany", + "locationLabel": "Europe - Germany", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "down", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + }, + "enabledMonitorQueryIds": Array [ + "id1", + "id2", + ], + "pending": 0, + "pendingConfigs": Object {}, + "projectMonitorsCount": 0, + "up": 2, + "upConfigs": Object { + "id1-asia_japan": Object { + "configId": "id1", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id1", + "name": "test monitor 1", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "up", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + "id2-asia_japan": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "up", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + }, + } + `); + }); + + it('handles limits with multiple requests', async () => { + const { esClient, syntheticsEsClient } = getUptimeESMockClient(); + esClient.search.mockResponseOnce( + getEsResponse({ + after: {}, + buckets: flatten( + times(SUMMARIES_PAGE_SIZE).map(() => [ + { + key: { + monitorId: 'id1', + locationId: japanLoc.id, + }, + status: { + key: japanLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'up', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + { + key: { + monitorId: 'id2', + locationId: japanLoc.id, + }, + status: { + key: japanLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'up', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + { + key: { + monitorId: 'id2', + locationId: germanyLoc.id, + }, + status: { + key: germanyLoc.id, + top: [ + { + metrics: { + 'monitor.status': 'down', + }, + sort: ['2022-09-15T16:19:16.724Z'], + }, + ], + }, + }, + ]) + ), + }) + ); + + const routeContext: any = { + request: {}, + syntheticsEsClient, + }; + + const overviewStatusService = new OverviewStatusService(routeContext); + overviewStatusService.getMonitorConfigs = jest.fn().mockResolvedValue(testMonitors as any); + + expect(await overviewStatusService.getOverviewStatus()).toMatchInlineSnapshot(` + Object { + "allIds": Array [ + "id1", + "id2", + ], + "allMonitorsCount": 2, + "disabledConfigs": Object {}, + "disabledCount": 0, + "disabledMonitorQueryIds": Array [], + "disabledMonitorsCount": 0, + "down": 1, + "downConfigs": Object { + "id2-europe_germany": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "europe_germany", + "locationLabel": "Europe - Germany", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "down", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + }, + "enabledMonitorQueryIds": Array [ + "id1", + "id2", + ], + "pending": 0, + "pendingConfigs": Object {}, + "projectMonitorsCount": 0, + "up": 2, + "upConfigs": Object { + "id1-asia_japan": Object { + "configId": "id1", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id1", + "name": "test monitor 1", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "up", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + "id2-asia_japan": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "up", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": "2022-09-15T16:19:16.724Z", + "type": "browser", + "updated_at": undefined, + }, + }, + } + `); + expect(esClient.search).toHaveBeenCalledTimes(2); + }); + + it('handles pending configs', async () => { + const { esClient, syntheticsEsClient } = getUptimeESMockClient(); + esClient.search.mockResponseOnce( + getEsResponse({ + buckets: [], + }) + ); + const routeContext: any = { + request: {}, + syntheticsEsClient, + }; + + const overviewStatusService = new OverviewStatusService(routeContext); + overviewStatusService.getMonitorConfigs = jest.fn().mockResolvedValue(testMonitors as any); + expect(await overviewStatusService.getOverviewStatus()).toMatchInlineSnapshot(` + Object { + "allIds": Array [ + "id1", + "id2", + ], + "allMonitorsCount": 2, + "disabledConfigs": Object {}, + "disabledCount": 0, + "disabledMonitorQueryIds": Array [], + "disabledMonitorsCount": 0, + "down": 0, + "downConfigs": Object {}, + "enabledMonitorQueryIds": Array [ + "id1", + "id2", + ], + "pending": 3, + "pendingConfigs": Object { + "id1-asia_japan": Object { + "configId": "id1", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id1", + "name": "test monitor 1", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "unknown", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": undefined, + "type": "browser", + "updated_at": undefined, + }, + "id2-asia_japan": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "asia_japan", + "locationLabel": "Asia/Pacific - Japan", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "unknown", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": undefined, + "type": "browser", + "updated_at": undefined, + }, + "id2-europe_germany": Object { + "configId": "id2", + "isEnabled": true, + "isStatusAlertEnabled": false, + "locationId": "europe_germany", + "locationLabel": "Europe - Germany", + "monitorQueryId": "id2", + "name": "test monitor 2", + "projectId": "project-id", + "schedule": "1", + "spaceId": undefined, + "status": "unknown", + "tags": Array [ + "tag-1", + "tag-2", + ], + "timestamp": undefined, + "type": "browser", + "updated_at": undefined, + }, + }, + "projectMonitorsCount": 0, + "up": 0, + "upConfigs": Object {}, + } + `); + }); + }); + + describe('getStatus', () => { + jest.spyOn(allLocationsFn, 'getAllLocations').mockResolvedValue({ + publicLocations: allLocations, + privateLocations: [], + allLocations: [ + { + id: 'us_central_qa', + label: 'US Central QA', + }, + { + id: 'us_central', + label: 'North America - US Central', + }, + ] as any, + }); + + it.each([ + [['US Central QA'], 1], + [['North America - US Central'], 1], + [['North America - US Central', 'US Central QA'], 2], + [undefined, 2], + ])('handles disabled count when using location filters', async (locations, disabledCount) => { + jest.spyOn(monitorsFns, 'getAllMonitors').mockResolvedValue([ + { + type: 'synthetics-monitor', + id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', + attributes: { + enabled: false, + schedule: { + number: '3', + unit: 'm', + }, + config_id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', + locations: [ + { + isServiceManaged: true, + label: 'US Central QA', + id: 'us_central_qa', + }, + { + isServiceManaged: true, + label: 'North America - US Central', + id: 'us_central', + }, + ], + origin: 'project', + id: 'a-test2-default', + }, + references: [], + migrationVersion: { + 'synthetics-monitor': '8.6.0', + }, + coreMigrationVersion: '8.0.0', + updated_at: '2023-02-28T14:31:37.641Z', + created_at: '2023-02-28T14:31:37.641Z', + version: 'Wzg0MzkzLDVd', + namespaces: ['default'], + score: null, + sort: ['a', 3013], + } as unknown as SavedObjectsFindResult, + ]); + const { esClient, syntheticsEsClient } = getUptimeESMockClient(); + esClient.msearch.mockResponseOnce({ + responses: [ + getEsResponse({ + buckets: [ + { + key: 'id1', + location: { + buckets: [ + { + key: 'Asia/Pacific - Japan', + status: { + hits: { + hits: [ + { + _source: { + '@timestamp': '2022-09-15T16:08:16.724Z', + monitor: { + status: 'up', + id: 'id1', + }, + summary: { + up: 1, + down: 0, + }, + config_id: 'id1', + observer: { + geo: { + name: 'Asia/Pacific - Japan', + }, + }, + }, + }, + ], + }, + }, + }, + ], + }, + }, + { + key: 'id2', + location: { + buckets: [ + { + key: 'Asia/Pacific - Japan', + status: { + hits: { + hits: [ + { + _source: { + '@timestamp': '2022-09-15T16:09:16.724Z', + monitor: { + status: 'up', + id: 'id2', + }, + summary: { + up: 1, + down: 0, + }, + config_id: 'id2', + observer: { + geo: { + name: 'Asia/Pacific - Japan', + }, + }, + }, + }, + ], + }, + }, + }, + { + key: 'Europe - Germany', + status: { + hits: { + hits: [ + { + _source: { + '@timestamp': '2022-09-15T16:19:16.724Z', + monitor: { + status: 'down', + id: 'id2', + }, + summary: { + down: 1, + up: 0, + }, + config_id: 'id2', + observer: { + geo: { + name: 'Europe - Germany', + }, + }, + }, + }, + ], + }, + }, + }, + ], + }, + }, + ], + }), + ], + took: 605, + }); + + const overviewStatusService = new OverviewStatusService({ + request: { + query: { + locations, + }, + }, + syntheticsEsClient, + } as any); + + const result = await overviewStatusService.getOverviewStatus(); + + expect(result).toEqual( + expect.objectContaining({ + disabledCount, + }) + ); + }); + + it.each([ + [['US Central QA'], 1], + [['North America - US Central'], 1], + [['North America - US Central', 'US Central QA'], 2], + [undefined, 2], + ])('handles pending count when using location filters', async (locations, pending) => { + jest.spyOn(monitorsFns, 'getAllMonitors').mockResolvedValue([ + { + type: 'synthetics-monitor', + id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', + attributes: { + enabled: true, + schedule: { + number: '3', + unit: 'm', + }, + config_id: 'a9a94f2f-47ba-4fe2-afaa-e5cd29b281f1', + locations: [ + { + isServiceManaged: true, + label: 'US Central QA', + id: 'us_central_qa', + }, + { + isServiceManaged: true, + label: 'North America - US Central', + id: 'us_central', + }, + ], + origin: 'project', + id: 'a-test2-default', + }, + references: [], + migrationVersion: { + 'synthetics-monitor': '8.6.0', + }, + coreMigrationVersion: '8.0.0', + updated_at: '2023-02-28T14:31:37.641Z', + created_at: '2023-02-28T14:31:37.641Z', + version: 'Wzg0MzkzLDVd', + namespaces: ['default'], + score: null, + sort: ['a', 3013], + } as unknown as SavedObjectsFindResult, + ]); + const { esClient, syntheticsEsClient } = getUptimeESMockClient(); + esClient.search.mockResponseOnce( + getEsResponse({ + buckets: [], + }) + ); + + const overviewStatusService = new OverviewStatusService({ + request: { + query: { + locations, + }, + }, + syntheticsEsClient, + } as any); + + const result = await overviewStatusService.getOverviewStatus(); + + expect(result.pending).toEqual(pending); + }); + }); +}); + +function getEsResponse({ buckets, after }: { buckets: any[]; after?: any }) { + return { + took: 605, + timed_out: false, + _shards: { + total: 3, + successful: 3, + skipped: 0, + failed: 0, + }, + hits: { + hits: [], + }, + aggregations: { + monitors: { + buckets, + after_key: after, + }, + }, + }; +} diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.ts new file mode 100644 index 000000000000..5ff8a870db9d --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/overview_status_service.ts @@ -0,0 +1,363 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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/moment'; +import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; +import { SavedObjectsFindResult } from '@kbn/core-saved-objects-api-server'; +import { isEmpty } from 'lodash'; +import { withApmSpan } from '@kbn/apm-data-access-plugin/server/utils/with_apm_span'; +import { asMutableArray } from '../../../common/utils/as_mutable_array'; +import { getMonitorFilters, OverviewStatusQuery } from '../common'; +import { + getAllMonitors, + processMonitors, +} from '../../saved_objects/synthetics_monitor/get_all_monitors'; +import { ConfigKey } from '../../../common/constants/monitor_management'; +import { RouteContext } from '../types'; +import { + EncryptedSyntheticsMonitorAttributes, + OverviewStatusMetaData, +} from '../../../common/runtime_types'; +import { isStatusEnabled } from '../../../common/runtime_types/monitor_management/alert_config'; +import { + FINAL_SUMMARY_FILTER, + getRangeFilter, + getTimespanFilter, +} from '../../../common/constants/client_defaults'; + +type LocationStatus = Array<{ + status: string; + locationId: string; + timestamp: string; +}>; + +export const SUMMARIES_PAGE_SIZE = 5000; + +export class OverviewStatusService { + filterData: { + locationFilter?: string[] | string; + filtersStr?: string; + } = {}; + constructor( + private readonly routeContext: RouteContext, OverviewStatusQuery> + ) {} + + async getOverviewStatus() { + const { request } = this.routeContext; + const queryParams = request.query as OverviewStatusQuery; + + this.filterData = await getMonitorFilters({ + ...queryParams, + context: this.routeContext, + }); + + const [allConfigs, statusResult] = await Promise.all([ + this.getMonitorConfigs(), + this.getQueryResult(), + ]); + + const { up, down, pending, upConfigs, downConfigs, pendingConfigs, disabledConfigs } = + this.processOverviewStatus(allConfigs, statusResult); + + const { + enabledMonitorQueryIds, + disabledMonitorQueryIds, + allIds, + disabledCount, + disabledMonitorsCount, + projectMonitorsCount, + } = processMonitors(allConfigs, this.filterData?.locationFilter); + + return { + allIds, + allMonitorsCount: allConfigs.length, + disabledMonitorsCount, + projectMonitorsCount, + enabledMonitorQueryIds, + disabledMonitorQueryIds, + disabledCount, + up, + down, + pending, + upConfigs, + downConfigs, + pendingConfigs, + disabledConfigs, + }; + } + + getEsDataFilters() { + const { spaceId, request } = this.routeContext; + const params = request.query || {}; + const { + scopeStatusByLocation = true, + tags, + monitorTypes, + projects, + showFromAllSpaces, + } = params; + const { locationFilter } = this.filterData; + const getTermFilter = (field: string, value: string | string[] | undefined) => { + if (!value || isEmpty(value)) { + return []; + } + if (Array.isArray(value)) { + return [ + { + terms: { + [field]: value, + }, + }, + ]; + } + return [ + { + term: { + [field]: value, + }, + }, + ]; + }; + const filters: QueryDslQueryContainer[] = [ + ...(showFromAllSpaces ? [] : [{ term: { 'meta.space_id': spaceId } }]), + ...getTermFilter('monitor.type', monitorTypes), + ...getTermFilter('tags', tags), + ...getTermFilter('monitor.project.id', projects), + ]; + + if (scopeStatusByLocation && !isEmpty(locationFilter) && locationFilter) { + filters.push({ + terms: { + 'observer.name': locationFilter, + }, + }); + } + return filters; + } + + async getQueryResult() { + return withApmSpan('monitor_status_data', async () => { + const range = { + // max monitor schedule period is 4 hours, 20 minute subtraction is to be on safe side + from: moment().subtract(4, 'hours').subtract(20, 'minutes').toISOString(), + to: 'now', + }; + + let hasMoreData = true; + const monitorByIds = new Map(); + let afterKey: any; + let count = 0; + + do { + const result = await this.routeContext.syntheticsEsClient.search( + { + body: { + size: 0, + query: { + bool: { + filter: [ + FINAL_SUMMARY_FILTER, + getRangeFilter({ from: range.from, to: range.to }), + getTimespanFilter({ from: 'now-15m', to: 'now' }), + ...this.getEsDataFilters(), + ] as QueryDslQueryContainer[], + }, + }, + aggs: { + monitors: { + composite: { + size: SUMMARIES_PAGE_SIZE, + sources: asMutableArray([ + { + monitorId: { + terms: { + field: 'monitor.id', + }, + }, + }, + { + locationId: { + terms: { + field: 'observer.name', + }, + }, + }, + ] as const), + after: afterKey, + }, + aggs: { + status: { + top_metrics: { + metrics: { + field: 'monitor.status', + }, + sort: { + '@timestamp': 'desc', + }, + }, + }, + }, + }, + }, + }, + }, + 'getCurrentStatusOverview' + count + ); + count += 1; + const data = result.body.aggregations?.monitors; + + hasMoreData = (data?.buckets ?? []).length >= SUMMARIES_PAGE_SIZE; + afterKey = data?.after_key; + + data?.buckets.forEach(({ status: statusAgg, key: bKey }) => { + const monitorId = String(bKey.monitorId); + const locationId = String(bKey.locationId); + const status = String(statusAgg.top?.[0].metrics?.['monitor.status']); + const timestamp = String(statusAgg.top[0].sort[0]); + if (!monitorByIds.has(String(monitorId))) { + monitorByIds.set(monitorId, []); + } + monitorByIds.get(monitorId)?.push({ status, locationId, timestamp }); + }); + } while (hasMoreData && afterKey); + return monitorByIds; + }); + } + + processOverviewStatus( + monitors: Array>, + statusData: Map + ) { + let up = 0; + let down = 0; + const upConfigs: Record = {}; + const downConfigs: Record = {}; + const pendingConfigs: Record = {}; + const disabledConfigs: Record = {}; + + const enabledMonitors = monitors.filter((monitor) => monitor.attributes[ConfigKey.ENABLED]); + const disabledMonitors = monitors.filter((monitor) => !monitor.attributes[ConfigKey.ENABLED]); + + const queryLocIds = this.filterData?.locationFilter; + + disabledMonitors.forEach((monitor) => { + const monitorQueryId = monitor.attributes[ConfigKey.MONITOR_QUERY_ID]; + const meta = this.getMonitorMeta(monitor); + monitor.attributes[ConfigKey.LOCATIONS]?.forEach((location) => { + disabledConfigs[`${meta.configId}-${location.id}`] = { + monitorQueryId, + status: 'disabled', + locationId: location.id, + locationLabel: location.label, + ...meta, + }; + }); + }); + + enabledMonitors.forEach((monitor) => { + const monitorId = monitor.attributes[ConfigKey.MONITOR_QUERY_ID]; + const monitorStatus = statusData.get(monitorId); + + // discard any locations that are not in the monitorLocationsMap for the given monitor as well as those which are + // in monitorLocationsMap but not in listOfLocations + const monLocations = monitor.attributes[ConfigKey.LOCATIONS]; + monLocations?.forEach((monLocation) => { + if (!isEmpty(queryLocIds) && !queryLocIds?.includes(monLocation.id)) { + // filter out location provided via query + return; + } + const locData = monitorStatus?.find((loc) => loc.locationId === monLocation.id); + const meta = { + monitorQueryId: monitorId, + locationId: monLocation.id, + timestamp: locData?.timestamp, + locationLabel: monLocation.label, + ...this.getMonitorMeta(monitor), + }; + const monLocId = `${meta.configId}-${monLocation.id}`; + if (locData) { + if (locData.status === 'down') { + down += 1; + downConfigs[monLocId] = { + ...meta, + status: 'down', + }; + } else if (locData.status === 'up') { + up += 1; + upConfigs[monLocId] = { + ...meta, + status: 'up', + }; + } + } else { + pendingConfigs[monLocId] = { + status: 'unknown', + ...meta, + }; + } + }); + }); + + return { + up, + down, + pending: Object.values(pendingConfigs).length, + upConfigs, + downConfigs, + pendingConfigs, + disabledConfigs, + }; + } + + async getMonitorConfigs() { + const { savedObjectsClient, request } = this.routeContext; + const { query, showFromAllSpaces } = request.query || {}; + /** + * Walk through all monitor saved objects, bucket IDs by disabled/enabled status. + * + * Track max period to make sure the snapshot query should reach back far enough to catch + * latest ping for all enabled monitors. + */ + + const { filtersStr } = this.filterData; + + return await getAllMonitors({ + soClient: savedObjectsClient, + showFromAllSpaces, + search: query ? `${query}*` : '', + filter: filtersStr, + fields: [ + ConfigKey.ENABLED, + ConfigKey.LOCATIONS, + ConfigKey.MONITOR_QUERY_ID, + ConfigKey.CONFIG_ID, + ConfigKey.SCHEDULE, + ConfigKey.MONITOR_SOURCE_TYPE, + ConfigKey.MONITOR_TYPE, + ConfigKey.NAME, + ConfigKey.TAGS, + ConfigKey.PROJECT_ID, + ConfigKey.ALERT_CONFIG, + ], + }); + } + + getMonitorMeta(monitor: SavedObjectsFindResult) { + return { + name: monitor.attributes[ConfigKey.NAME], + configId: monitor.attributes[ConfigKey.CONFIG_ID], + schedule: monitor.attributes[ConfigKey.SCHEDULE].number, + tags: monitor.attributes[ConfigKey.TAGS], + isEnabled: monitor.attributes[ConfigKey.ENABLED], + type: monitor.attributes[ConfigKey.MONITOR_TYPE], + projectId: monitor.attributes[ConfigKey.PROJECT_ID], + isStatusAlertEnabled: isStatusEnabled(monitor.attributes[ConfigKey.ALERT_CONFIG]), + updated_at: monitor.updated_at, + spaceId: monitor.namespaces?.[0], + }; + } +} diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.test.ts new file mode 100644 index 000000000000..fef2927d7bd3 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.test.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { periodToMs } from './utils'; + +describe('periodToMs', () => { + it('returns 0 for unsupported unit type', () => { + // @ts-expect-error Providing invalid value to test handler in function + expect(periodToMs({ number: '10', unit: 'rad' })).toEqual(0); + }); + + it('converts seconds', () => { + expect(periodToMs({ number: '10', unit: 's' })).toEqual(10_000); + }); + + it('converts minutes', () => { + expect(periodToMs({ number: '1', unit: 'm' })).toEqual(60_000); + }); + + it('converts hours', () => { + expect(periodToMs({ number: '1', unit: 'h' })).toEqual(3_600_000); + }); +}); diff --git a/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.ts new file mode 100644 index 000000000000..d02509a70e56 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_status/utils.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. + */ + +/** + * Helper function that converts a monitor's schedule to a value to use to generate + * an appropriate look-back window for snapshot count. + * @param schedule a number/unit pair that represents how often a configured monitor runs + * @returns schedule interval in ms + */ +import datemath, { Unit } from '@kbn/datemath'; + +export function periodToMs(schedule: { number: string; unit: Unit }) { + if (Object.keys(datemath.unitsMap).indexOf(schedule.unit) === -1) return 0; + + return parseInt(schedule.number, 10) * datemath.unitsMap[schedule.unit].base; +} diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/fetch_trends.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/fetch_trends.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/fetch_trends.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/fetch_trends.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/overview_trends.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/overview_trends.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/overview_trends.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/overview_trends.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/overview_trends.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/overview_trends.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/overview_trends/overview_trends.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/overview_trends/overview_trends.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/get_pings.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/get_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/get_pings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/get_pings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshot_blocks.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshot_blocks.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshots.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshots.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/journey_screenshots.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journey_screenshots.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/journeys.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journeys.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/journeys.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/journeys.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/last_successful_check.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/last_successful_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/last_successful_check.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/last_successful_check.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/pings/ping_heatmap.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/pings/ping_heatmap.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/pings/ping_heatmap.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/pings/ping_heatmap.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/dynamic_settings.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/add_param.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/add_param.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/add_param.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/add_param.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/delete_param.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/delete_param.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_params_bulk.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/delete_params_bulk.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_params_bulk.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/delete_params_bulk.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/edit_param.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/edit_param.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/edit_param.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/edit_param.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/params.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/params.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/params/params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/add_private_location.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/add_private_location.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/add_private_location.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/add_private_location.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/delete_private_location.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/delete_private_location.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/delete_private_location.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/delete_private_location.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_agent_policies.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_agent_policies.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_agent_policies.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_agent_policies.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_location_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_location_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_location_monitors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/get_private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/get_private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/helpers.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/helpers.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/helpers.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/helpers.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/helpers.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/helpers.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/helpers.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/private_locations/migrate_legacy_private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/settings.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/settings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/sync_global_params.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/settings/sync_global_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/settings/sync_global_params.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/settings/sync_global_params.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/suggestions/route.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/suggestions/route.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/suggestions/route.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/suggestions/route.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/enablement.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/enablement.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/get_service_allowed.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/get_service_allowed.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/get_service_allowed.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/get_service_allowed.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/get_service_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/get_service_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/get_service_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/get_service_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/install_index_templates.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/install_index_templates.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/install_index_templates.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/install_index_templates.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/run_once_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/run_once_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/run_once_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/run_once_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/service_errors.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/service_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/service_errors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/service_errors.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/test_now_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/synthetics_service/test_now_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/synthetics_service/test_now_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/telemetry/monitor_upgrade_sender.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/types.ts b/x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/routes/types.ts rename to x-pack/solutions/observability/plugins/synthetics/server/routes/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/runtime_types/private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/runtime_types/private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/runtime_types/private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/runtime_types/private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/runtime_types/settings.ts b/x-pack/solutions/observability/plugins/synthetics/server/runtime_types/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/runtime_types/settings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/runtime_types/settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.6.0.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.6.0.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.6.0.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.6.0.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.6.0.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.6.0.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.6.0.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.6.0.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.8.0.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.8.0.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.8.0.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.8.0.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.8.0.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.8.0.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.8.0.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.8.0.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.9.0.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.9.0.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.9.0.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.9.0.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.9.0.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.9.0.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/8.9.0.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/8.9.0.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.5.0.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.5.0.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.5.0.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.5.0.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.7.0.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.7.0.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.7.0.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/monitors/test_fixtures/8.7.0.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/private_locations/model_version_1.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/private_locations/model_version_1.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/private_locations/model_version_1.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/private_locations/model_version_1.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/private_locations/model_version_1.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/private_locations/model_version_1.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/migrations/private_locations/model_version_1.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/migrations/private_locations/model_version_1.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/saved_objects.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/saved_objects.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/saved_objects.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/service_api_key.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/service_api_key.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/service_api_key.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/service_api_key.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts similarity index 75% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts index 8cae1ef32a8c..ebf034d9eb7f 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_monitor/get_all_monitors.ts @@ -11,8 +11,9 @@ import { SavedObjectsFindResult, } from '@kbn/core-saved-objects-api-server'; import { intersection } from 'lodash'; +import { withApmSpan } from '@kbn/apm-data-access-plugin/server/utils'; +import { periodToMs } from '../../routes/overview_status/utils'; import { syntheticsMonitorType } from '../../../common/types/saved_objects'; -import { periodToMs } from '../../routes/overview_status/overview_status'; import { ConfigKey, EncryptedSyntheticsMonitorAttributes, @@ -34,26 +35,28 @@ export const getAllMonitors = async ({ filter?: string; showFromAllSpaces?: boolean; } & Pick) => { - const finder = soClient.createPointInTimeFinder({ - type: syntheticsMonitorType, - perPage: 1000, - search, - sortField, - sortOrder, - fields, - filter, - searchFields, - ...(showFromAllSpaces && { namespaces: ['*'] }), - }); + return withApmSpan('get_all_monitors', async () => { + const finder = soClient.createPointInTimeFinder({ + type: syntheticsMonitorType, + perPage: 5000, + search, + sortField, + sortOrder, + fields, + filter, + searchFields, + ...(showFromAllSpaces && { namespaces: ['*'] }), + }); - const hits: Array> = []; - for await (const result of finder.find()) { - hits.push(...result.saved_objects); - } + const hits: Array> = []; + for await (const result of finder.find()) { + hits.push(...result.saved_objects); + } - finder.close().catch(() => {}); + finder.close().catch(() => {}); - return hits; + return hits; + }); }; export const processMonitors = ( @@ -86,13 +89,13 @@ export const processMonitors = ( monitorQueryIdToConfigIdMap[attrs[ConfigKey.MONITOR_QUERY_ID]] = attrs[ConfigKey.CONFIG_ID]; - const monitorLocations = attrs[ConfigKey.LOCATIONS].map((location) => location.id); + const monitorLocIds = attrs[ConfigKey.LOCATIONS].map((location) => location.id); if (attrs[ConfigKey.ENABLED] === false) { const queriedLocations = Array.isArray(queryLocations) ? queryLocations : [queryLocations]; const intersectingLocations = intersection( - monitorLocations, - queryLocations ? queriedLocations : monitorLocations + monitorLocIds, + queryLocations ? queriedLocations : monitorLocIds ); disabledCount += intersectingLocations.length; disabledMonitorsCount += 1; @@ -101,9 +104,9 @@ export const processMonitors = ( enabledMonitorQueryIds.push(attrs[ConfigKey.MONITOR_QUERY_ID]); monitorLocationsMap[attrs[ConfigKey.MONITOR_QUERY_ID]] = queryLocations - ? intersection(monitorLocations, queryLocations) - : monitorLocations; - listOfLocationsSet = new Set([...listOfLocationsSet, ...monitorLocations]); + ? intersection(monitorLocIds, queryLocations) + : monitorLocIds; + listOfLocationsSet = new Set([...listOfLocationsSet, ...monitorLocIds]); maxPeriod = Math.max(maxPeriod, periodToMs(attrs[ConfigKey.SCHEDULE])); } diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_param.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_param.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_param.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_settings.ts b/x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/saved_objects/synthetics_settings.ts rename to x-pack/solutions/observability/plugins/synthetics/server/saved_objects/synthetics_settings.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/server.ts b/x-pack/solutions/observability/plugins/synthetics/server/server.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/server.ts rename to x-pack/solutions/observability/plugins/synthetics/server/server.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/server/synthetics_route_wrapper.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_route_wrapper.ts new file mode 100644 index 000000000000..24abf55d53c4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_route_wrapper.ts @@ -0,0 +1,117 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { withApmSpan } from '@kbn/apm-data-access-plugin/server/utils/with_apm_span'; +import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; +import { isEmpty } from 'lodash'; +import { isKibanaResponse } from '@kbn/core-http-server'; +import { syntheticsServiceApiKey } from './saved_objects/service_api_key'; +import { isTestUser, SyntheticsEsClient } from './lib'; +import { SYNTHETICS_INDEX_PATTERN } from '../common/constants'; +import { checkIndicesReadPrivileges } from './synthetics_service/authentication/check_has_privilege'; +import { SyntheticsRouteWrapper } from './routes/types'; + +export const syntheticsRouteWrapper: SyntheticsRouteWrapper = ( + syntheticsRoute, + server, + syntheticsMonitorClient +) => ({ + ...syntheticsRoute, + options: { + ...(syntheticsRoute.options ?? {}), + }, + security: { + authz: { + requiredPrivileges: [ + 'uptime-read', + ...(syntheticsRoute.requiredPrivileges ?? []), + ...(syntheticsRoute?.writeAccess ? ['uptime-write'] : []), + ], + }, + }, + handler: async (context, request, response) => { + return withApmSpan('synthetics_route_handler', async () => { + const { elasticsearch, savedObjects, uiSettings } = await context.core; + + const { client: esClient } = elasticsearch; + const savedObjectsClient = savedObjects.getClient({ + includedHiddenTypes: [syntheticsServiceApiKey.name], + }); + + // specifically needed for the synthetics service api key generation + server.authSavedObjectsClient = savedObjectsClient; + + const syntheticsEsClient = new SyntheticsEsClient( + savedObjectsClient, + esClient.asCurrentUser, + { + request, + uiSettings, + isDev: Boolean(server.isDev) && !isTestUser(server), + heartbeatIndices: SYNTHETICS_INDEX_PATTERN, + } + ); + + server.syntheticsEsClient = syntheticsEsClient; + + const spaceId = server.spaces?.spacesService.getSpaceId(request) ?? DEFAULT_SPACE_ID; + + try { + const res = await syntheticsRoute.handler({ + syntheticsEsClient, + savedObjectsClient, + context, + request, + response, + server, + spaceId, + syntheticsMonitorClient, + }); + if (isKibanaResponse(res)) { + return res; + } + + const inspectData = await syntheticsEsClient.getInspectData(syntheticsRoute.path); + + if (Array.isArray(res)) { + if (isEmpty(inspectData)) { + return response.ok({ + body: res, + }); + } else { + return response.ok({ + body: { + result: res, + ...inspectData, + }, + }); + } + } + + return response.ok({ + body: { + ...res, + ...inspectData, + }, + }); + } catch (e) { + if (e.statusCode === 403) { + const privileges = await checkIndicesReadPrivileges(syntheticsEsClient); + if (!privileges.has_all_requested) { + return response.forbidden({ + body: { + message: + 'MissingIndicesPrivileges: You do not have permission to read from the synthetics-* indices. Please contact your administrator.', + }, + }); + } + } + server.logger.error(e); + throw e; + } + }); + }, +}); diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/authentication/check_has_privilege.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/authentication/check_has_privilege.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/authentication/check_has_privilege.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/authentication/check_has_privilege.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/common.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/common.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/formatting_utils.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/formatting_utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/formatting_utils.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/formatting_utils.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/formatting_utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/formatting_utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/formatting_utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/formatting_utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/lightweight_param_formatter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/browser_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/common_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/format_synthetics_policy.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatters.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatters.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatters.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatting_utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatting_utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/formatting_utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/formatting_utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/http_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/http_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/http_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/http_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/icmp_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/icmp_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/icmp_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/icmp_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/processors_formatter.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/processors_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/processors_formatter.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/processors_formatter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/tcp_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/tcp_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/tcp_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/tcp_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/tls_formatters.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/tls_formatters.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/private_formatters/tls_formatters.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/private_formatters/tls_formatters.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/browser.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/browser.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/browser.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/browser.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/browser.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/browser.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/browser.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/browser.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/common.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/common.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/common.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/common.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/common.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/common.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/convert_to_data_stream.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/format_configs.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/formatting_utils.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/formatting_utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/formatting_utils.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/formatting_utils.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/http.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/http.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/http.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/http.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/icmp.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/icmp.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/icmp.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/icmp.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/tcp.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/tcp.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/tcp.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/tcp.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/tls.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/public_formatters/tls.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/public_formatters/tls.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/variable_parser.js b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/variable_parser.js similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/formatters/variable_parser.js rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/formatters/variable_parser.js diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_all_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_all_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_all_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_all_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_api_key.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_api_key.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_es_hosts.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_es_hosts.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_es_hosts.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_es_hosts.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_es_hosts.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_private_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_private_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_private_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_private_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_service_locations.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_service_locations.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_service_locations.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_service_locations.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_service_locations.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_service_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/get_service_locations.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/get_service_locations.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/clean_up_task.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/clean_up_task.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/clean_up_task.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/clean_up_task.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/synthetics_private_location.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/test_policy.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/test_policy.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/private_location/test_policy.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/private_location/test_policy.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/browser_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/common_fields.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/http_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/icmp_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/normalizers/tcp_monitor.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/project_monitor/project_monitor_formatter.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/service_api_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/service_api_client.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/service_api_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/service_api_client.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/service_api_client.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_monitor/synthetics_monitor_client.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_service.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_service.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_service.ts similarity index 97% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_service.ts index c223de84c42d..164515ad76c1 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/synthetics_service.ts +++ b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/synthetics_service.ts @@ -309,9 +309,10 @@ export class SyntheticsService { return this.server.coreStart?.elasticsearch.client.asInternalUser; } - async getOutput() { + async getOutput({ inspect }: { inspect: boolean } = { inspect: false }) { const { apiKey, isValid } = await getAPIKeyForSyntheticsService({ server: this.server }); - if (!isValid) { + // do not check for api key validity if inspecting + if (!isValid && !inspect) { this.server.logger.error( 'API key is not valid. Cannot push monitor configuration to synthetics public testing locations' ); @@ -332,7 +333,7 @@ export class SyntheticsService { const monitors = this.formatConfigs(config); const license = await this.getLicense(); - const output = await this.getOutput(); + const output = await this.getOutput({ inspect: true }); if (output) { return await this.apiClient.inspect({ monitors, @@ -356,11 +357,18 @@ export class SyntheticsService { if (output) { this.logger.debug(`1 monitor will be pushed to synthetics service.`); - this.syncErrors = await this.apiClient.post({ - monitors, - output, - license, - }); + this.apiClient + .post({ + monitors, + output, + license, + }) + .then((res) => { + this.syncErrors = res; + }) + .catch((e) => { + this.logger.error(e); + }); } return this.syncErrors; } catch (e) { diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/fake_kibana_request.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/fake_kibana_request.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/fake_kibana_request.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/fake_kibana_request.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/mocks.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/mocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/mocks.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/mocks.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/secrets.ts b/x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/secrets.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/synthetics_service/utils/secrets.ts rename to x-pack/solutions/observability/plugins/synthetics/server/synthetics_service/utils/secrets.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/__mocks__/index.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/__mocks__/index.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/__mocks__/index.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/constants.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/constants.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/queue.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/queue.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/queue.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/queue.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/queue.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/queue.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/queue.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/queue.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.test.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.test.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.test.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/sender.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/sender.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/telemetry/types.ts b/x-pack/solutions/observability/plugins/synthetics/server/telemetry/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/telemetry/types.ts rename to x-pack/solutions/observability/plugins/synthetics/server/telemetry/types.ts diff --git a/x-pack/plugins/observability_solution/synthetics/server/types.ts b/x-pack/solutions/observability/plugins/synthetics/server/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/synthetics/server/types.ts rename to x-pack/solutions/observability/plugins/synthetics/server/types.ts diff --git a/x-pack/solutions/observability/plugins/synthetics/tsconfig.json b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json new file mode 100644 index 000000000000..ece2a3934e60 --- /dev/null +++ b/x-pack/solutions/observability/plugins/synthetics/tsconfig.json @@ -0,0 +1,113 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "__mocks__/**/*", + "common/**/*", + "scripts/**/*", + "public/**/*", + "server/**/*", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/alerting-plugin", + "@kbn/ml-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/observability-plugin", + "@kbn/fleet-plugin", + "@kbn/unified-search-plugin", + "@kbn/i18n", + "@kbn/core", + "@kbn/config-schema", + "@kbn/server-http-tools", + "@kbn/datemath", + "@kbn/share-plugin", + "@kbn/discover-plugin", + "@kbn/home-plugin", + "@kbn/embeddable-plugin", + "@kbn/data-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/inspector-plugin", + "@kbn/cases-plugin", + "@kbn/cloud-plugin", + "@kbn/data-views-plugin", + "@kbn/spaces-plugin", + "@kbn/core-doc-links-browser", + "@kbn/usage-collection-plugin", + "@kbn/kibana-react-plugin", + "@kbn/i18n-react", + "@kbn/securitysolution-io-ts-utils", + "@kbn/es-query", + "@kbn/stack-connectors-plugin", + "@kbn/rule-data-utils", + "@kbn/core-http-browser", + "@kbn/core-notifications-browser", + "@kbn/rison", + "@kbn/licensing-plugin", + "@kbn/rule-registry-plugin", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/security-plugin", + "@kbn/logging-mocks", + "@kbn/task-manager-plugin", + "@kbn/es-types", + "@kbn/core-http-server-mocks", + "@kbn/utility-types", + "@kbn/telemetry-plugin", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-saved-objects-api-server", + "@kbn/core-saved-objects-common", + "@kbn/features-plugin", + "@kbn/bfetch-plugin", + "@kbn/actions-plugin", + "@kbn/core-elasticsearch-server", + "@kbn/core-saved-objects-api-server-mocks", + "@kbn/core-saved-objects-server", + "@kbn/shared-ux-prompt-not-found", + "@kbn/logging", + "@kbn/shared-ux-router", + "@kbn/alerts-as-data-utils", + "@kbn/exploratory-view-plugin", + "@kbn/observability-shared-plugin", + "@kbn/core-http-server", + "@kbn/std", + "@kbn/core-saved-objects-server-mocks", + "@kbn/shared-ux-page-kibana-template", + "@kbn/observability-ai-assistant-plugin", + "@kbn/unified-doc-viewer-plugin", + "@kbn/code-editor", + "@kbn/code-editor-mock", + "@kbn/securitysolution-io-ts-types", + "@kbn/shared-ux-link-redirect-app", + "@kbn/serverless", + "@kbn/repo-info", + "@kbn/index-management-plugin", + "@kbn/license-management-plugin", + "@kbn/react-kibana-mount", + "@kbn/react-kibana-context-render", + "@kbn/react-kibana-context-theme", + "@kbn/search-types", + "@kbn/core-lifecycle-browser", + "@kbn/ui-actions-browser", + "@kbn/presentation-publishing", + "@kbn/presentation-containers", + "@kbn/ui-actions-plugin", + "@kbn/presentation-util-plugin", + "@kbn/core-application-browser", + "@kbn/dashboard-plugin", + "@kbn/search-types", + "@kbn/slo-schema", + "@kbn/alerting-types", + "@kbn/babel-register", + "@kbn/slo-plugin", + "@kbn/ebt-tools", + "@kbn/alerting-types", + "@kbn/core-chrome-browser", + "@kbn/core-rendering-browser", + "@kbn/index-lifecycle-management-common-shared", + "@kbn/core-http-server-utils", + "@kbn/apm-data-access-plugin" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.js b/x-pack/solutions/observability/plugins/uptime/.buildkite/pipelines/flaky.js similarity index 100% rename from x-pack/plugins/observability_solution/uptime/.buildkite/pipelines/flaky.js rename to x-pack/solutions/observability/plugins/uptime/.buildkite/pipelines/flaky.js diff --git a/x-pack/solutions/observability/plugins/uptime/.buildkite/pipelines/flaky.sh b/x-pack/solutions/observability/plugins/uptime/.buildkite/pipelines/flaky.sh new file mode 100755 index 000000000000..9763f45c1101 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/.buildkite/pipelines/flaky.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +UUID="$(cat /proc/sys/kernel/random/uuid)" +export UUID + +node x-pack/solutions/observability/plugins/synthetics/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/solutions/observability/plugins/uptime/README.md b/x-pack/solutions/observability/plugins/uptime/README.md new file mode 100644 index 000000000000..18ba1830b2a5 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/README.md @@ -0,0 +1,97 @@ +# Uptime Monitoring + +## Purpose + +The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening +in their infrastructure. + +## Layout + +There are three sections to the app, `common`, `public`, and `server`. + +### common + +Contains runtime types types, constants and a few other files. + +Notably, we use `io-ts`/`fp-ts` functions and types to help provide +additional runtime safety for our API requests/responses. + +### public + +We use Redux and associated tools for managing our app state. Components come in the usual `connect`ed and +presentational varieties. + +The `lib` directory controls bootstrapping code and adapter types. + +There is a `pages` directory; each view gets its own page component. + +The principal structure of the app is stored in `uptime_app.tsx`. + +### server + +The `lib` directory contains `adapters`, which are connections to external resources like Kibana +Server, Elasticsearch, etc. In addition, it contains domains, which are libraries that provide +functionality via adapters. + +The `requests` directory contains functions responsible for querying Elasticsearch and parsing its +responses. + +There's also a `rest_api` folder that defines the structure of the RESTful API endpoints. + +## Testing + +### Unit tests + +Documentation: https://www.elastic.co/guide/en/kibana/current/development-tests.html#_unit_testing + +``` +yarn test:jest x-pack/solutions/observability/plugins/synthetics +``` + +### Functional tests + +In one shell, from **~/kibana/x-pack**: +`node scripts/functional_tests_server.js` + +In another shell, from **~kibana/x-pack**: +`node ../scripts/functional_test_runner.js --grep="{TEST_NAME}"`. + +#### API tests + +If instead you need to run API tests, start up the test server and then in another shell, from **~kibana/x-pack**: +`node ../scripts/functional_test_runner.js --config test/api_integration/config.ts --grep="{TEST_NAME}"`. + +You can update snapshots by prefixing the runner command with `env UPDATE_UPTIME_FIXTURES=1` + +You can access the functional test server's Kibana at `http://localhost:5620/`. + +You can login with username `elastic` and password `changeme` by default. + +If you want to freeze a UI or API test you can include an async call like `await new Promise(r => setTimeout(r, 1000 * 60))` +to freeze the execution for 60 seconds if you need to click around or check things in the state that is loaded. + +#### Running --ssl tests + +Some of our tests require there to be an SSL connection between Kibana and Elasticsearch. + +We can run these tests like described above, but with some special config. + +`node scripts/functional_tests_server.js --config=test/functional_with_es_ssl/config.ts` + +`node scripts/functional_test_runner.js --config=test/functional_with_es_ssl/config.ts` + +#### Running accessibility tests + +We maintain a suite of Accessibility tests (you may see them referred to elsewhere as `a11y` tests). + +These tests render each of our pages and ensure that the inputs and other elements contain the +attributes necessary to ensure all users are able to make use of Kibana (for example, users relying +on screen readers). + +The commands for running these tests are very similar to the other functional tests described above. + +From the `~/x-pack` directory: + +Start the server: `node scripts/functional_tests_server --config test/accessibility/config.ts` + +Run the uptime `a11y` tests: `node scripts/functional_test_runner.js --config test/accessibility/config.ts --grep=uptime` diff --git a/x-pack/plugins/observability_solution/uptime/common/config.ts b/x-pack/solutions/observability/plugins/uptime/common/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/config.ts rename to x-pack/solutions/observability/plugins/uptime/common/config.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/capabilities.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/capabilities.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/capabilities.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/capabilities.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/chart_format_limits.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/chart_format_limits.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/chart_format_limits.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/chart_format_limits.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/client_defaults.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/client_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/client_defaults.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/client_defaults.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/context_defaults.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/context_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/context_defaults.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/context_defaults.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/index.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/plugin.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/plugin.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/plugin.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/query.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/query.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/query.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/query.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/rest_api.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/rest_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/rest_api.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/rest_api.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/settings_defaults.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/settings_defaults.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/settings_defaults.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/settings_defaults.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/synthetics_alerts.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/synthetics_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/synthetics_alerts.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/synthetics_alerts.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/ui.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/ui.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/ui.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/ui.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/constants/uptime_alerts.ts b/x-pack/solutions/observability/plugins/uptime/common/constants/uptime_alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/constants/uptime_alerts.ts rename to x-pack/solutions/observability/plugins/uptime/common/constants/uptime_alerts.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/index.ts b/x-pack/solutions/observability/plugins/uptime/common/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/__snapshots__/assert_close_to.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/common/lib/__snapshots__/assert_close_to.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/__snapshots__/assert_close_to.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/common/lib/__snapshots__/assert_close_to.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/assert_close_to.test.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/assert_close_to.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/assert_close_to.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/assert_close_to.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/assert_close_to.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/assert_close_to.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/assert_close_to.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/assert_close_to.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/combine_filters_and_user_search.test.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/combine_filters_and_user_search.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/combine_filters_and_user_search.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/combine_filters_and_user_search.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/combine_filters_and_user_search.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/combine_filters_and_user_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/combine_filters_and_user_search.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/combine_filters_and_user_search.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/get_histogram_interval.test.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/get_histogram_interval.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/get_histogram_interval.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/get_histogram_interval.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/get_histogram_interval.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/get_histogram_interval.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/get_histogram_interval.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/get_histogram_interval.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/index.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/ml.test.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/ml.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/ml.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/ml.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/ml.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/ml.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/ml.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/ml.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/stringify_kueries.test.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/stringify_kueries.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/stringify_kueries.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/stringify_kueries.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/lib/stringify_kueries.ts b/x-pack/solutions/observability/plugins/uptime/common/lib/stringify_kueries.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/lib/stringify_kueries.ts rename to x-pack/solutions/observability/plugins/uptime/common/lib/stringify_kueries.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/requests/get_certs_request_body.ts b/x-pack/solutions/observability/plugins/uptime/common/requests/get_certs_request_body.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/requests/get_certs_request_body.ts rename to x-pack/solutions/observability/plugins/uptime/common/requests/get_certs_request_body.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/alert_actions.test.ts b/x-pack/solutions/observability/plugins/uptime/common/rules/alert_actions.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/rules/alert_actions.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/rules/alert_actions.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/alert_actions.ts b/x-pack/solutions/observability/plugins/uptime/common/rules/alert_actions.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/rules/alert_actions.ts rename to x-pack/solutions/observability/plugins/uptime/common/rules/alert_actions.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/legacy_uptime/translations.ts b/x-pack/solutions/observability/plugins/uptime/common/rules/legacy_uptime/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/rules/legacy_uptime/translations.ts rename to x-pack/solutions/observability/plugins/uptime/common/rules/legacy_uptime/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/types.ts b/x-pack/solutions/observability/plugins/uptime/common/rules/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/rules/types.ts rename to x-pack/solutions/observability/plugins/uptime/common/rules/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/rules/uptime_rule_field_map.ts b/x-pack/solutions/observability/plugins/uptime/common/rules/uptime_rule_field_map.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/rules/uptime_rule_field_map.ts rename to x-pack/solutions/observability/plugins/uptime/common/rules/uptime_rule_field_map.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/common.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/common.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/common.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/index.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/status_check.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/status_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/status_check.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/status_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/tls.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/alerts/tls.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/alerts/tls.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/certs.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/certs.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/certs.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/certs.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/common.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/common.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/common.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/index.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/index.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/locations.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/locations.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/locations.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/state.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/state.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/monitor/state.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/monitor/state.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/network_events.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/network_events.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/error_state.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/error_state.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/error_state.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/error_state.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/histogram.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/histogram.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/histogram.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/index.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/observer.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/observer.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/observer.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/observer.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/ping.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/ping.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/synthetics.test.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/synthetics.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/synthetics.test.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/synthetics.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/synthetics.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/synthetics.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/ping/synthetics.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/ping/synthetics.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/snapshot/index.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/snapshot/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/snapshot/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/snapshot/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/runtime_types/snapshot/snapshot_count.ts b/x-pack/solutions/observability/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/runtime_types/snapshot/snapshot_count.ts rename to x-pack/solutions/observability/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/translations.ts b/x-pack/solutions/observability/plugins/uptime/common/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/translations.ts rename to x-pack/solutions/observability/plugins/uptime/common/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/translations/translations.ts b/x-pack/solutions/observability/plugins/uptime/common/translations/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/translations/translations.ts rename to x-pack/solutions/observability/plugins/uptime/common/translations/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/types/index.ts b/x-pack/solutions/observability/plugins/uptime/common/types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/types/index.ts rename to x-pack/solutions/observability/plugins/uptime/common/types/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/types/integration_deprecation.ts b/x-pack/solutions/observability/plugins/uptime/common/types/integration_deprecation.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/types/integration_deprecation.ts rename to x-pack/solutions/observability/plugins/uptime/common/types/integration_deprecation.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/types/monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/common/types/monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/types/monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/common/types/monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/types/synthetics_monitor.ts b/x-pack/solutions/observability/plugins/uptime/common/types/synthetics_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/types/synthetics_monitor.ts rename to x-pack/solutions/observability/plugins/uptime/common/types/synthetics_monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/utils/as_mutable_array.ts b/x-pack/solutions/observability/plugins/uptime/common/utils/as_mutable_array.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/utils/as_mutable_array.ts rename to x-pack/solutions/observability/plugins/uptime/common/utils/as_mutable_array.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/utils/es_search.ts b/x-pack/solutions/observability/plugins/uptime/common/utils/es_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/utils/es_search.ts rename to x-pack/solutions/observability/plugins/uptime/common/utils/es_search.ts diff --git a/x-pack/plugins/observability_solution/uptime/common/utils/get_monitor_url.ts b/x-pack/solutions/observability/plugins/uptime/common/utils/get_monitor_url.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/common/utils/get_monitor_url.ts rename to x-pack/solutions/observability/plugins/uptime/common/utils/get_monitor_url.ts diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/README.md b/x-pack/solutions/observability/plugins/uptime/e2e/README.md new file mode 100644 index 000000000000..35b3a05f639d --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/README.md @@ -0,0 +1,32 @@ +## How to run these tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/synthetics/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From the same directory you can now run `node e2e.js --runner`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. + + +## Uptime App Tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/uptime/scripts`, run `node uptime_e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From the same directory you can now run `node uptime_e2e.js --runner`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/config.ts b/x-pack/solutions/observability/plugins/uptime/e2e/config.ts new file mode 100644 index 000000000000..f38a590ed150 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/config.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 { FtrConfigProviderContext } from '@kbn/test'; +import { CA_CERT_PATH } from '@kbn/dev-utils'; +import { commonFunctionalServices } from '@kbn/ftr-common-functional-services'; +import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services'; +import { readKibanaConfig } from '@kbn/observability-synthetics-test-data'; +const MANIFEST_KEY = 'xpack.uptime.service.manifestUrl'; +const SERVICE_PASSWORD = 'xpack.uptime.service.password'; +const SERVICE_USERNAME = 'xpack.uptime.service.username'; + +async function config({ readConfigFile }: FtrConfigProviderContext) { + const kibanaCommonTestsConfig = await readConfigFile( + require.resolve('@kbn/test-suites-src/common/config') + ); + const xpackFunctionalTestsConfig = await readConfigFile( + require.resolve('@kbn/test-suites-xpack/functional/config.base') + ); + + const kibanaConfig = readKibanaConfig(); + + const manifestUrl = process.env.SYNTHETICS_SERVICE_MANIFEST ?? kibanaConfig[MANIFEST_KEY]; + const serviceUsername = process.env.SYNTHETICS_SERVICE_USERNAME ?? kibanaConfig[SERVICE_USERNAME]; + const servicePassword = process.env.SYNTHETICS_SERVICE_PASSWORD ?? kibanaConfig[SERVICE_PASSWORD]; + + return { + ...kibanaCommonTestsConfig.getAll(), + + services: { + ...commonFunctionalServices, + ...commonFunctionalUIServices, + }, + + esTestCluster: { + ...xpackFunctionalTestsConfig.get('esTestCluster'), + serverArgs: [ + ...xpackFunctionalTestsConfig.get('esTestCluster.serverArgs'), + // define custom es server here + // API Keys is enabled at the top level + 'xpack.security.enabled=true', + ], + }, + + kbnTestServer: { + ...xpackFunctionalTestsConfig.get('kbnTestServer'), + sourceArgs: process.env.WATCH_ENABLED + ? [] + : [...xpackFunctionalTestsConfig.get('kbnTestServer.sourceArgs'), '--no-watch'], + serverArgs: [ + ...xpackFunctionalTestsConfig.get('kbnTestServer.serverArgs'), + '--csp.strict=false', + '--home.disableWelcomeScreen=true', + '--csp.warnLegacyBrowsers=false', + // define custom kibana server args here + `--elasticsearch.ssl.certificateAuthorities=${CA_CERT_PATH}`, + // `--elasticsearch.ignoreVersionMismatch=${process.env.CI ? 'false' : 'true'}`, + `--elasticsearch.username=kibana_system`, + `--elasticsearch.password=changeme`, + '--xpack.reporting.enabled=false', + `--xpack.uptime.service.manifestUrl=${manifestUrl}`, + `--xpack.uptime.service.username=${ + process.env.SYNTHETICS_REMOTE_ENABLED + ? serviceUsername + : 'localKibanaIntegrationTestsUser' + }`, + `--xpack.uptime.service.password=${servicePassword}`, + '--uiSettings.overrides.observability:enableLegacyUptimeApp=true', + ], + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default config; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/browser/data.json.gz b/x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/browser/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/browser/data.json.gz rename to x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/browser/data.json.gz diff --git a/x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/browser/mappings.json b/x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/browser/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/browser/mappings.json rename to x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/browser/mappings.json diff --git a/x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz b/x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz rename to x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/full_heartbeat/data.json.gz diff --git a/x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/full_heartbeat/mappings.json b/x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/full_heartbeat/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/full_heartbeat/mappings.json rename to x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/full_heartbeat/mappings.json diff --git a/x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/synthetics_data/data.json.gz b/x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/synthetics_data/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/fixtures/es_archiver/synthetics_data/data.json.gz rename to x-pack/solutions/observability/plugins/uptime/e2e/fixtures/es_archiver/synthetics_data/data.json.gz diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/make_checks.ts b/x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_checks.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/helpers/make_checks.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_checks.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/make_ping.ts b/x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/helpers/make_ping.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/helpers/make_tls.ts b/x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/helpers/make_tls.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/helpers/make_tls.ts diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/helpers/utils.ts b/x-pack/solutions/observability/plugins/uptime/e2e/helpers/utils.ts new file mode 100644 index 000000000000..f340ef8b78b3 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/helpers/utils.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { expect, Page } from '@elastic/synthetics'; + +export async function waitForLoadingToFinish({ page }: { page: Page }) { + while (true) { + if (!(await page.isVisible(byTestId('kbnLoadingMessage'), { timeout: 5000 }))) break; + await page.waitForTimeout(1000); + } +} + +export async function loginToKibana({ + page, + user, +}: { + page: Page; + user?: { username: string; password: string }; +}) { + await page.fill('[data-test-subj=loginUsername]', user?.username ?? 'elastic', { + timeout: 60 * 1000, + }); + + await page.fill('[data-test-subj=loginPassword]', user?.password ?? 'changeme'); + + await page.click('[data-test-subj=loginSubmit]'); + + await waitForLoadingToFinish({ page }); +} + +export const byTestId = (testId: string) => { + return `[data-test-subj=${testId}]`; +}; + +export const assertText = async ({ page, text }: { page: Page; text: string }) => { + const element = await page.waitForSelector(`text=${text}`); + expect(await element.isVisible()).toBeTruthy(); +}; + +export const assertNotText = async ({ page, text }: { page: Page; text: string }) => { + expect(await page.$(`text=${text}`)).toBeFalsy(); +}; + +export const getQuerystring = (params: object) => { + return Object.entries(params) + .map(([key, value]) => encodeURIComponent(key) + '=' + encodeURIComponent(value)) + .join('&'); +}; + +export const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +export const TIMEOUT_60_SEC = { + timeout: 60 * 1000, +}; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/page_objects/login.tsx b/x-pack/solutions/observability/plugins/uptime/e2e/page_objects/login.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/page_objects/login.tsx rename to x-pack/solutions/observability/plugins/uptime/e2e/page_objects/login.tsx diff --git a/x-pack/plugins/observability_solution/uptime/e2e/page_objects/utils.tsx b/x-pack/solutions/observability/plugins/uptime/e2e/page_objects/utils.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/page_objects/utils.tsx rename to x-pack/solutions/observability/plugins/uptime/e2e/page_objects/utils.tsx diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/tsconfig.json b/x-pack/solutions/observability/plugins/uptime/e2e/tsconfig.json new file mode 100644 index 000000000000..631b6f419444 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "exclude": ["tmp", "target/**/*"], + "include": ["**/*"], + "compilerOptions": { + "outDir": "target/types", + "types": ["node"], + "isolatedModules": false + }, + "kbn_references": [ + "@kbn/test", + "@kbn/dev-utils", + "@kbn/ux-plugin/e2e", + "@kbn/ftr-common-functional-services", + "@kbn/apm-plugin", + "@kbn/ftr-common-functional-ui-services", + "@kbn/observability-synthetics-test-data" + ] +} diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts similarity index 97% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts index 2865084aa29e..2050134a26d6 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/default_email_settings.ts @@ -6,13 +6,13 @@ */ import { journey, step, before } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { assertNotText, assertText, byTestId, waitForLoadingToFinish, } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { settingsPageProvider } from '../../page_objects/settings'; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/index.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/index.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts similarity index 98% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts index b3cdfbe13493..ddd350124410 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/status_alert_flyouts_in_alerting_app.ts @@ -7,8 +7,8 @@ import { journey, step, expect, before } from '@elastic/synthetics'; import { RetryService } from '@kbn/ftr-common-functional-services'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, assertText, waitForLoadingToFinish } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { loginPageProvider } from '../../../page_objects/login'; journey('StatusFlyoutInAlertingApp', async ({ page, params }) => { diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts similarity index 95% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts index f8ac13ff0361..2209a1b12a80 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/alerts/tls_alert_flyouts_in_alerting_app.ts @@ -6,8 +6,8 @@ */ import { journey, step, before, expect } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, assertText, waitForLoadingToFinish } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { loginPageProvider } from '../../../page_objects/login'; journey('TlsFlyoutInAlertingApp', async ({ page, params }) => { diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/data_view_permissions.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/data_view_permissions.ts similarity index 96% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/data_view_permissions.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/data_view_permissions.ts index f8b74dabc027..ee3ead7d615c 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/data_view_permissions.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/data_view_permissions.ts @@ -7,8 +7,8 @@ import { journey, step, expect, before } from '@elastic/synthetics'; import { callKibana } from '@kbn/apm-plugin/server/test_helpers/create_apm_users/helpers/call_kibana'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, TIMEOUT_60_SEC, waitForLoadingToFinish } from '../../helpers/utils'; -import { recordVideo } from '../../helpers/record_video'; import { loginPageProvider } from '../../page_objects/login'; journey('DataViewPermissions', async ({ page, params }) => { diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/index.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/index.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/locations/index.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/locations/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/locations/index.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/locations/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/locations/locations.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/locations/locations.ts similarity index 97% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/locations/locations.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/locations/locations.ts index afb5ebf0c04a..efda8352d93b 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/locations/locations.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/locations/locations.ts @@ -6,7 +6,7 @@ */ import { journey, step, before, Page } from '@elastic/synthetics'; -import { recordVideo } from '../../../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { makeChecksWithStatus } from '../../../helpers/make_checks'; import { monitorDetailsPageProvider } from '../../page_objects/monitor_details'; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/index.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/index.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts similarity index 97% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts index 88a174f76cc5..6e5ed114d72d 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_alerts.journey.ts @@ -7,8 +7,8 @@ import { journey, step, expect, before, Page } from '@elastic/synthetics'; import { noop } from 'lodash'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, delay } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { monitorDetailsPageProvider } from '../../page_objects/monitor_details'; const dateRangeStart = '2019-09-10T12:40:08.078Z'; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts index f46081c7b382..b54d462cdfaa 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/monitor_details.journey.ts @@ -6,8 +6,8 @@ */ import { journey, step, before, Page } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { monitorDetailsPageProvider } from '../../page_objects/monitor_details'; const dateRangeStart = '2019-09-10T12:40:08.078Z'; diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts similarity index 97% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts index 502217721381..d90438721715 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/monitor_details/ping_redirects.journey.ts @@ -6,8 +6,8 @@ */ import { journey, step, expect, before, Page } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, delay } from '../../../helpers/utils'; -import { recordVideo } from '../../../helpers/record_video'; import { makeChecksWithStatus } from '../../../helpers/make_checks'; import { monitorDetailsPageProvider } from '../../page_objects/monitor_details'; diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/step_duration.journey.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/step_duration.journey.ts new file mode 100644 index 000000000000..41f31681fd06 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/step_duration.journey.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 { journey, step, expect } from '@elastic/synthetics'; +import { RetryService } from '@kbn/ftr-common-functional-services'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; +import { loginPageProvider } from '../../page_objects/login'; + +journey('StepsDuration', async ({ page, params }) => { + recordVideo(page); + + const retry: RetryService = params.getService('retry'); + + const login = loginPageProvider({ page }); + + const queryParams = new URLSearchParams({ + dateRangeStart: '2021-11-21T22:06:06.502Z', + dateRangeEnd: '2021-11-21T22:10:08.203Z', + }).toString(); + + const baseUrl = `${params.kibanaUrl}/app/uptime`; + + step('Go to uptime', async () => { + await page.goto(`${baseUrl}?${queryParams}`, { + waitUntil: 'networkidle', + }); + await login.loginToKibana(); + }); + + step('Go to monitor details', async () => { + await page.click('text="test-monitor - inline"'); + expect(page.url()).toBe(`${baseUrl}/monitor/dGVzdC1tb25pdG9yLWlubGluZQ==/?${queryParams}`); + }); + + step('Go to journey details', async () => { + await page.click('text=18 seconds'); + expect(page.url()).toBe(`${baseUrl}/journey/9f217c22-4b17-11ec-b976-aa665a54da40/steps`); + }); + + step('Check for monitor duration', async () => { + await retry.tryForTime(90 * 1000, async () => { + await page.click('text="6 Steps - 3 succeeded"'); + await page.waitForTimeout(2 * 1000); + await page.hover('text=8.9 sec'); + await page.waitForSelector('text=Explore'); + expect(await page.$('text=Explore')).toBeTruthy(); + await page.waitForSelector('text=area chart'); + expect(await page.$('text=area chart')).toBeTruthy(); + }); + }); +}); diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/uptime.journey.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/uptime.journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/uptime.journey.ts rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/uptime.journey.ts index 81559169deff..f27cd3acba3c 100644 --- a/x-pack/plugins/observability_solution/uptime/e2e/uptime/journeys/uptime.journey.ts +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/journeys/uptime.journey.ts @@ -6,8 +6,8 @@ */ import { journey, step, before } from '@elastic/synthetics'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { byTestId, waitForLoadingToFinish } from '../../helpers/utils'; -import { recordVideo } from '../../helpers/record_video'; journey('UptimeOverview', ({ page, params }) => { recordVideo(page); diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/page_objects/monitor_details.tsx b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/page_objects/monitor_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/page_objects/monitor_details.tsx rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/page_objects/monitor_details.tsx diff --git a/x-pack/plugins/observability_solution/uptime/e2e/uptime/page_objects/settings.tsx b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/page_objects/settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/e2e/uptime/page_objects/settings.tsx rename to x-pack/solutions/observability/plugins/uptime/e2e/uptime/page_objects/settings.tsx diff --git a/x-pack/solutions/observability/plugins/uptime/e2e/uptime/synthetics_run.ts b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/synthetics_run.ts new file mode 100644 index 000000000000..26a3b9e2e27b --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/e2e/uptime/synthetics_run.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 { FtrConfigProviderContext } from '@kbn/test'; +import path from 'path'; +import { SyntheticsRunner, argv } from '@kbn/observability-synthetics-test-data'; + +const { headless, grep, bail: pauseOnError } = argv; + +async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { + const kibanaConfig = await readConfigFile(require.resolve('../config.ts')); + return { + ...kibanaConfig.getAll(), + testRunner: async ({ getService }: any) => { + const syntheticsRunner = new SyntheticsRunner(getService, { + headless, + match: grep, + pauseOnError, + }); + + await syntheticsRunner.setup(); + const fixturesDir = path.join(__dirname, '../fixtures/es_archiver/'); + + await syntheticsRunner.loadTestData(fixturesDir, [ + 'synthetics_data', + 'full_heartbeat', + 'browser', + ]); + + await syntheticsRunner.loadTestFiles(async (reload) => { + if (reload) { + const dirPath = require.resolve('./journeys').replace('index.ts', ''); + Object.keys(require.cache).forEach(function (key) { + if (key.startsWith(dirPath)) { + delete require.cache[key]; + } + }); + } + require(path.join(__dirname, './journeys')); + }); + + await syntheticsRunner.run(); + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default runE2ETests; diff --git a/x-pack/solutions/observability/plugins/uptime/jest.config.js b/x-pack/solutions/observability/plugins/uptime/jest.config.js new file mode 100644 index 000000000000..25cbce3066e4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/observability/plugins/uptime'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/uptime', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/observability/plugins/uptime/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/observability_solution/uptime/kibana.jsonc b/x-pack/solutions/observability/plugins/uptime/kibana.jsonc similarity index 100% rename from x-pack/plugins/observability_solution/uptime/kibana.jsonc rename to x-pack/solutions/observability/plugins/uptime/kibana.jsonc diff --git a/x-pack/plugins/observability_solution/uptime/public/index.ts b/x-pack/solutions/observability/plugins/uptime/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/kibana_services.ts b/x-pack/solutions/observability/plugins/uptime/public/kibana_services.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/kibana_services.ts rename to x-pack/solutions/observability/plugins/uptime/public/kibana_services.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/render_app.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/render_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/render_app.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/render_app.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_app.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_overview_fetcher.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_overview_fetcher.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_overview_fetcher.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_overview_fetcher.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_page_template.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_page_template.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_page_template.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/uptime_page_template.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/use_no_data_config.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/use_no_data_config.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/use_no_data_config.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/app/use_no_data_config.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_monitors.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_search.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/__snapshots__/cert_status.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_monitors.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_monitors.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_monitors.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_monitors.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_monitors.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_monitors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_monitors.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_monitors.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_refresh_btn.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_search.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_search.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_search.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_search.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_search.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_search.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_search.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_search.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_status.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_status.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_status.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_status.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/cert_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/cert_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificate_title.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificate_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificate_title.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificate_title.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificates_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificates_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificates_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificates_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificates_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificates_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/certificates_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/certificates_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/fingerprint_col.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/fingerprint_col.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/fingerprint_col.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/fingerprint_col.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/fingerprint_col.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/use_cert_search.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/use_cert_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/certificates/use_cert_search.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/certificates/use_cert_search.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/location_link.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_page_link.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/__snapshots__/monitor_tags.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/alerts/uptime_edit_alert_flyout.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_empty_state.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/chart_wrapper.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/donut_chart_legend_row.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/__snapshots__/monitor_bar_series.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/annotation_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_empty_state.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/chart_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/chart_wrapper/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/donut_chart_legend_row.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_chart.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_charts.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_charts.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_charts.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_charts.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_line_bar_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/duration_line_series_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/get_tick_format.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/get_tick_format.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/get_tick_format.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/get_tick_format.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/get_tick_format.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/get_tick_format.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/get_tick_format.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/get_tick_format.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/monitor_bar_series.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/ping_histogram.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/utils.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/utils.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/utils.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/utils.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/utils.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/charts/utils.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/charts/utils.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu_content.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu_content.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/action_menu_content.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/inspector_header_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/inspector_header_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/inspector_header_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/inspector_header_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/header/manage_monitors_btn.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/higher_order/responsive_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/location_link.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/location_link.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/location_link.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/location_link.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/location_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/location_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/location_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/location_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_page_link.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_page_link.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_page_link.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_page_link.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_page_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_page_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_page_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_page_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_tags.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_tags.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_tags.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_tags.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_tags.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_tags.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/monitor_tags.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/monitor_tags.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/react_router_helpers/link_for_eui.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/step_detail_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/step_detail_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/step_detail_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/step_detail_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/uptime_date_picker.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/uptime_date_picker.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/uptime_date_picker.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/uptime_date_picker.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/uptime_date_picker.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/uptime_date_picker.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/common/uptime_date_picker.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/common/uptime_date_picker.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/deprecate_notice_modal.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/deprecate_notice_modal.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/deprecate_notice_modal.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/deprecate_notice_modal.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/index.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/index.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/index.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_custom_assets_extension.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_create_extension.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/lazy_synthetics_policy_edit_extension.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_custom_assets_extension.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_edit_policy_extension_wrapper.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_edit_policy_extension_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_edit_policy_extension_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_edit_policy_extension_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_create_extension_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/synthetics_policy_edit_extension_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/use_edit_monitor_locator.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/use_edit_monitor_locator.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/fleet_package/use_edit_monitor_locator.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/fleet_package/use_edit_monitor_locator.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/__snapshots__/monitor_charts.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/confirm_delete.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/__snapshots__/ml_integerations.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_alert_delete.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/confirm_delete.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/license_info.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/license_info.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/license_info.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/license_info.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/license_info.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/license_info.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/license_info.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/license_info.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/manage_ml_job.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_flyout_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_integeration.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_integerations.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_job_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/ml_manage_job.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/translations.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/translations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/translations.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/translations.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ml/use_anomaly_alert.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_charts.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_charts.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_charts.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_charts.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_charts.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_charts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_charts.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_charts.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_duration/monitor_duration_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_title.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_title.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_title.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_title.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_title.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/monitor_title.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/monitor_title.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_histogram/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_histogram/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_histogram/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_histogram/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_histogram/ping_histogram_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/expanded_row.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/__snapshots__/ping_headers.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/expand_row.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/failed_step.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_error.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_available.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/no_image_display.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/ping_timestamp.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_caption.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/step_image_popover.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts similarity index 97% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts index bc85b45857c2..9d3e14431f6b 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/ping_timestamp/use_in_progress_image.ts @@ -45,7 +45,6 @@ export const useInProgressImage = ({ if (hasIntersected && !hasImage) return getJourneyScreenshot(imgPath); // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [hasIntersected, imgPath, skippedStep, retryLoading]); useEffect(() => { diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/columns/response_code.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/doc_link_body.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/expanded_row.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/headers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/headers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/headers.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/headers.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/index.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/index.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/index.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/location_name.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/location_name.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/location_name.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/location_name.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_headers.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_header.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_list_table.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/ping_redirects.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/response_code.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/use_pings.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/use_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/ping_list/use_pings.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/ping_list/use_pings.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/monitor_status.bar.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/ssl_certificate.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/__snapshots__/status_by_location.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/__snapshots__/tag_label.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/availability_reporting.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/location_status_tags.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/availability_reporting/tag_label.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/location_availability/location_availability.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/monitor_status.bar.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/ssl_certificate.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/monitor_redirects.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/ssl_certificate.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_bar.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/status_by_location.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_bar/use_status_bar.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_by_location.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_details.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_details.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_details.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_details.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/status_details_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/status_details/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/status_details/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_detail_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_nav.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/step_page_title.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumb.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_monitor_breadcrumbs.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/use_step_waterfall_metrics.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/data_formatting.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_chart_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_filter.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_flyout.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/step_detail/waterfall/waterfall_sidebar_item.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/README.md diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/constants.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/legend.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/middle_truncated_text.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/network_requests_total.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/sidebar.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/styles.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_bar_charts.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/use_flyout.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_bar_chart.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_chart_fixed_axis.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_flyout_table.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_icon.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_test_helper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_marker_trend.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_markers.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/components/waterfall_tooltip_content.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/context/waterfall_chart.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/index.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/monitor/synthetics/waterfall/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/__snapshots__/snapshot_heading.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_expression_popover.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_field_number.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_query_bar/query_bar.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_tls.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_tls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alert_tls.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alert_tls.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/alert_tls.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/toggle_alert_flyout_button.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/uptime_alerts_flyout_wrapper.tsx diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts new file mode 100644 index 000000000000..99f5aae82377 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/alerts_containers/use_snap_shot.ts @@ -0,0 +1,34 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useFetcher } from '@kbn/observability-shared-plugin/public'; +import { useGenerateUpdatedKueryString } from '../../../../hooks'; +import { fetchSnapshotCount } from '../../../../state/api'; + +export const useSnapShotCount = ({ query, filters }: { query: string; filters?: [] | string }) => { + const parsedFilters = + filters === undefined || typeof filters === 'string' + ? '' + : JSON.stringify(Array.from(Object.entries(filters))); + + const [esKuery, error] = useGenerateUpdatedKueryString(query, parsedFilters, undefined, true); + + const { data, loading } = useFetcher( + () => + fetchSnapshotCount({ + dateRangeStart: 'now-24h', + dateRangeEnd: 'now', + filters: error ? undefined : esKuery, + }), + // FIXME: Dario thinks there is a better way to do this but + // he's getting tired and maybe the Uptime folks can fix it + + [esKuery, query] + ); + + return { count: data || { total: 0, up: 0, down: 0 }, loading }; +}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/anomaly_alert.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/select_severity.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/anomaly_alert/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/down_number_select.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/__snapshots__/time_expression_select.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/availability_expression_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/down_number_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/filters_expression_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/status_expression_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_expression_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/time_unit_selectable.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_expressions/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/add_filter_btn.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/alert_monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_call_out.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/monitor_status_alert/old_alert_callout.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/toggle_alert_flyout_button.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/alerts/uptime_alerts_flyout_wrapper.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_error.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/empty_state_loading.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/empty_state/use_has_data.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/filter_group.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/selected_filters.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/translations.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/translations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/filter_group/translations.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/filter_group/translations.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/index.ts diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.tsx new file mode 100644 index 000000000000..629fa01a034a --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/index.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 React, { useState, useEffect } from 'react'; +import { EuiSpacer } from '@elastic/eui'; +import { useFetcher } from '@kbn/observability-shared-plugin/public'; +import { useSelector } from 'react-redux'; +import { getHasIntegrationMonitors } from '../../../state/api/has_integration_monitors'; +import { monitorListSelector } from '../../../state/selectors'; +import { IntegrationDeprecationCallout } from './integration_deprecation_callout'; + +export const INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY = + 'SYNTHETICS_INTEGRATION_DEPRECATION_HAS_BEEN_DISMISSED'; + +export const IntegrationDeprecation = () => { + const monitorList = useSelector(monitorListSelector); + const noticeHasBeenDismissed = + window.sessionStorage.getItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY) === 'true'; + const { data, loading } = useFetcher(() => { + // load it when list is loaded + if (!noticeHasBeenDismissed && monitorList.isLoaded) { + return getHasIntegrationMonitors(); + } + return undefined; + // FIXME: Dario thinks there is a better way to do this but + // he's getting tired and maybe the Uptime folks can fix it + }, [monitorList.isLoaded]); + const hasIntegrationMonitors = !loading && data && data.hasIntegrationMonitors; + const [shouldShowNotice, setShouldShowNotice] = useState( + Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed) + ); + + const handleDismissDeprecationNotice = () => { + window.sessionStorage.setItem(INTEGRATION_DEPRECATION_SESSION_STORAGE_KEY, 'true'); + setShouldShowNotice(false); + }; + + useEffect(() => { + setShouldShowNotice(Boolean(hasIntegrationMonitors && !noticeHasBeenDismissed)); + }, [hasIntegrationMonitors, noticeHasBeenDismissed]); + + return shouldShowNotice ? ( + <> + + + + ) : null; +}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation_callout.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation_callout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation_callout.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/integration_deprecation/integration_deprecation_callout.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/filter_status_button.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/__snapshots__/status_filter.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/cert_status_column.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/define_connectors.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/enable_alert.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_name_col.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/monitor_status_column.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/status_badge.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/columns/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/filter_status_button.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_group.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/integration_link.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/monitor_list_drawer.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/__snapshots__/most_recent_error.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/data.json diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/enabled_alerts.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_group.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/integration_link.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/monitor_url.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_drawer/most_recent_run.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_header.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_page_size_select.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_meesage.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/no_items_message.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/overview_page_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/parse_timestamp.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/status_filter.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/troubleshoot_popover.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/monitor_list/use_monitor_histogram.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/query_bar.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/query_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/query_bar.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/query_bar.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/query_bar/use_query_bar.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/__snapshots__/snapshot.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/snapshot_heading.tsx diff --git a/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts new file mode 100644 index 000000000000..af14d8f78289 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot/use_snap_shot.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { useContext } from 'react'; +import { useSelector } from 'react-redux'; +import { useFetcher } from '@kbn/observability-shared-plugin/public'; +import { useGetUrlParams } from '../../../hooks'; +import { esKuerySelector } from '../../../state/selectors'; +import { UptimeRefreshContext } from '../../../contexts'; +import { fetchSnapshotCount } from '../../../state/api'; + +export const useSnapShotCount = () => { + const { dateRangeStart, dateRangeEnd, query } = useGetUrlParams(); + + const { lastRefresh } = useContext(UptimeRefreshContext); + + const esKuery = useSelector(esKuerySelector); + + const { data, loading } = useFetcher( + () => fetchSnapshotCount({ query, dateRangeStart, dateRangeEnd, filters: esKuery }), + // FIXME: Dario thinks there is a better way to do this but + // he's getting tired and maybe the Uptime folks can fix it + + [dateRangeStart, dateRangeEnd, esKuery, lastRefresh, query] + ); + + return { count: data || { total: 0, up: 0, down: 0 }, loading }; +}; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot_heading.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot_heading.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/snapshot_heading.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/snapshot_heading.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/status_panel.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/status_panel.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/status_panel.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/overview/status_panel.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/certificate_form.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/__snapshots__/indices_form.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/add_connector_flyout.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/add_connector_flyout.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/add_connector_flyout.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/add_connector_flyout.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/alert_defaults_form.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/alert_defaults_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/alert_defaults_form.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/alert_defaults_form.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/certificate_form.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/certificate_form.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/certificate_form.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/certificate_form.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/certificate_form.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/certificate_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/certificate_form.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/certificate_form.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/default_email.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/default_email.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/default_email.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/default_email.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/indices_form.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/indices_form.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/indices_form.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/indices_form.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/indices_form.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/indices_form.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/indices_form.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/indices_form.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/settings_actions.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/settings_actions.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/settings_actions.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/settings_actions.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/settings_bottom_bar.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/settings_bottom_bar.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/settings_bottom_bar.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/settings_bottom_bar.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/use_settings_errors.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/use_settings_errors.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/settings/use_settings_errors.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/settings/use_settings_errors.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx similarity index 98% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx index 7eab37d2b9af..af4c1ed3915a 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/stderr_logs.tsx @@ -92,7 +92,6 @@ export const StdErrorLogs = ({ return ''; // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [checkGroup, timestamp]); const search = { diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_duration.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/screenshot_link.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx similarity index 98% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx index 606019c99429..6af149efe453 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_expanded_row/step_screenshots.tsx @@ -42,7 +42,6 @@ export const StepScreenshots = ({ step }: Props) => { } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [step._id, step['@timestamp']]); const lastSuccessfulCheck: Ping | undefined = data; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_field_trend.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/step_image.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/steps_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_check_steps.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_expanded_row.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/check_steps/use_std_error_logs.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/code_block_accordion.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/code_block_accordion.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/code_block_accordion.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/code_block_accordion.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_event.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_event.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_event.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/console_output_event_list.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/empty_journey.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/empty_journey.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/empty_journey.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/empty_journey.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/empty_journey.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/empty_journey.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/empty_journey.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/empty_journey.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/executed_step.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/executed_step.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/executed_step.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/executed_step.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/executed_step.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/executed_step.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/executed_step.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/executed_step.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/status_badge.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/status_badge.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/status_badge.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx similarity index 99% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx index b7d2f6d85fe2..2e5b8aac0d72 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/step_screenshot_display.tsx @@ -137,7 +137,6 @@ export const StepScreenshotDisplay: FC = ({ } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [basePath, checkGroup, imgSrc, stepIndex, isScreenshotRef, lastRefresh]); const refDimensions = useMemo(() => { diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/synthetics/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/components/synthetics/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx similarity index 96% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx index 7abbdf3fde8c..e3fb9f4b3bb3 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx +++ b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_data_view_context.tsx @@ -28,7 +28,6 @@ export const UptimeDataViewContextProvider: FC< } // FIXME: Dario thinks there is a better way to do this but // he's getting tired and maybe the Uptime folks can fix it - // eslint-disable-next-line react-hooks/exhaustive-deps }, [heartbeatIndices, indexStatus?.indexExists]); return ; diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_refresh_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_refresh_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_refresh_context.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_refresh_context.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_settings_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_settings_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_settings_context.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_settings_context.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_startup_plugins_context.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/contexts/uptime_theme_context.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/__snapshots__/use_url_params.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_base_chart_theme.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_base_chart_theme.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_base_chart_theme.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_base_chart_theme.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_breadcrumbs.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_breadcrumbs.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_breadcrumbs.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_breadcrumbs.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_breadcrumbs.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_cert_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_cert_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_cert_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_cert_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_composite_image.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_composite_image.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_composite_image.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_composite_image.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_composite_image.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_composite_image.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_composite_image.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_composite_image.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_filter_update.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_filter_update.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_filter_update.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_filter_update.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_filter_update.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_filter_update.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_filter_update.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_filter_update.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_init_app.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_init_app.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_init_app.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_init_app.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_mapping_check.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_mapping_check.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_mapping_check.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_mapping_check.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_mapping_check.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_mapping_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_mapping_check.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_mapping_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_monitor.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_monitor.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_overview_filter_check.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_overview_filter_check.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_overview_filter_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_overview_filter_check.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_overview_filter_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_search_text.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_search_text.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_search_text.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_search_text.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_selected_filters.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_selected_filters.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_selected_filters.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_selected_filters.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_selected_filters.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_selected_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_selected_filters.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_selected_filters.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_update_kuery_string.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_update_kuery_string.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_update_kuery_string.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_update_kuery_string.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_url_params.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_url_params.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_url_params.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_url_params.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_url_params.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/hooks/use_url_params.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/hooks/use_url_params.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/legacy_screenshot_ref.mock.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/legacy_screenshot_ref.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/legacy_screenshot_ref.mock.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/legacy_screenshot_ref.mock.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/legacy_use_composite_image.mock.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/legacy_use_composite_image.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/legacy_use_composite_image.mock.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/legacy_use_composite_image.mock.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/uptime_plugin_start_mock.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/uptime_store.mock.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/__mocks__/ut_router_history.mock.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/adapters/framework/capabilities_adapter.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/alert_messages.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/alert_messages.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/alert_messages.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/alert_messages.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/common.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/common.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/common.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/duration_anomaly.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/duration_anomaly.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/tls_alert.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_tls_alert.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_tls_alert.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_tls_alert.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/lazy_wrapper/validate_tls_alert.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/monitor_status.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/monitor_status.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/monitor_status.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/monitor_status.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/monitor_status.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/monitor_status.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/monitor_status.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/monitor_status.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/tls.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/tls.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/tls.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/tls.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/tls_legacy.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/tls_legacy.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/alert_types/tls_legacy.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/alert_types/tls_legacy.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/formatting.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/formatting.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/formatting.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/formatting.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_chart_date_label.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/get_label_format.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/charts/is_within_current_date.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/compose_screenshot_images.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/convert_measurements.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/convert_measurements.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/convert_measurements.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/convert_measurements.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/convert_measurements.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/convert_measurements.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/convert_measurements.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/convert_measurements.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/enzyme_helpers.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/helper_with_redux.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/helper_with_redux.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/helper_with_redux.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/helper_with_redux.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/add_base_path.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/build_href.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/build_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/build_href.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/build_href.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_apm_href.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_infra_href.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/get_logging_href.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/observability_integration/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/observability_integration/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/parse_search.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/parse_search.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/parse_search.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/parse_search.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/parse_search.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/parse_search.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/parse_search.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/parse_search.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/rtl_helpers.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/series_has_down_values.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/series_has_down_values.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/series_has_down_values.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/series_has_down_values.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/series_has_down_values.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/series_has_down_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/series_has_down_values.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/series_has_down_values.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/test_helpers.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/test_helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/test_helpers.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/test_helpers.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/__snapshots__/get_supported_url_params.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/get_supported_url_params.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/parse_absolute_date.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/stringify_url_params.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/stringify_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/helper/url_params/stringify_url_params.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/helper/url_params/stringify_url_params.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/lib.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/lib.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/lib/lib.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/lib/lib.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/certificates.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/certificates.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/certificates.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/certificates.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/certificates.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/certificates.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/certificates.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/certificates.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/mapping_error.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/mapping_error.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/mapping_error.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/mapping_error.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/monitor.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/monitor.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/monitor.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/monitor.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/monitor.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/monitor.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/monitor.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/monitor.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/not_found.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/not_found.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/not_found.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/not_found.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/not_found.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/not_found.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/not_found.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/not_found.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/overview.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/overview.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/overview.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/overview.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/settings.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/settings.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/settings.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/settings.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/settings.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/settings.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/settings.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/settings.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/checks_navigation.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/checks_navigation.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/checks_navigation.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/checks_navigation.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/step_detail_page.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/step_detail_page.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/step_detail_page.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/step_detail_page.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.test.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/synthetics/synthetics_checks.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/translations.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/translations.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/pages/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/routes.tsx b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/routes.tsx similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/routes.tsx rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/routes.tsx diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/index_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/index_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/journey.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/journey.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/journey.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ml_anomaly.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ml_anomaly.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ml_anomaly.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_list.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_list.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_list.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/network_events.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/network_events.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ping.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ping.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/selected_filters.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/selected_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/selected_filters.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/selected_filters.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/snapshot.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/snapshot.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/snapshot.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/snapshot.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ui.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ui.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/ui.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/ui.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/utils.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/actions/utils.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/actions/utils.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/alerts/alerts.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/alerts/alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/alerts/alerts.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/alerts/alerts.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/__snapshots__/snapshot.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/alerts.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/alerts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/alerts.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/alerts.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/has_integration_monitors.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/has_integration_monitors.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/has_integration_monitors.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/has_integration_monitors.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/index_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/index_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/journey.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/journey.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/journey.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/ml_anomaly.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/ml_anomaly.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/ml_anomaly.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_list.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_list.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_list.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/network_events.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/network_events.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/ping.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/ping.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/snapshot.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/snapshot.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/snapshot.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/snapshot.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/snapshot.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/snapshot.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/snapshot.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/snapshot.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/utils.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/api/utils.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/api/utils.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/certificates/certificates.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/certificates/certificates.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/certificates/certificates.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/certificates/certificates.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/fetch_effect.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/fetch_effect.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/fetch_effect.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/fetch_effect.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/fetch_effect.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/fetch_effect.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/fetch_effect.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/fetch_effect.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/index_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/index_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/journey.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/journey.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/journey.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/journey.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/journey.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/journey.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/journey.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/ml_anomaly.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/ml_anomaly.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/ml_anomaly.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_list.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_list.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_list.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/network_events.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/network_events.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/ping.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/ping.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/effects/synthetic_journey_blocks.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/kibana_service.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/kibana_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/kibana_service.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/kibana_service.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/index_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/index_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/journey.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/journey.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/journey.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/journey.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ml_anomaly.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ml_anomaly.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ml_anomaly.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ml_anomaly.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_list.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_list.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_list.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_status.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_status.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_status.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_status.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/network_events.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/network_events.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ping.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ping.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ping.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ping.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ping_list.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ping_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ping_list.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ping_list.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/selected_filters.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/selected_filters.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/selected_filters.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/selected_filters.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/selected_filters.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/selected_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/selected_filters.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/selected_filters.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/synthetics.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/synthetics.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/synthetics.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/synthetics.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/synthetics.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/synthetics.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/synthetics.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/synthetics.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/types.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/types.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ui.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ui.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ui.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ui.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ui.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ui.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/ui.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/ui.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/utils.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/reducers/utils.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/reducers/utils.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/selectors/index.test.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/selectors/index.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/selectors/index.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/selectors/index.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/selectors/index.ts b/x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/selectors/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/legacy_uptime/state/selectors/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/legacy_uptime/state/selectors/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/locators/overview.test.ts b/x-pack/solutions/observability/plugins/uptime/public/locators/overview.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/locators/overview.test.ts rename to x-pack/solutions/observability/plugins/uptime/public/locators/overview.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/locators/overview.ts b/x-pack/solutions/observability/plugins/uptime/public/locators/overview.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/locators/overview.ts rename to x-pack/solutions/observability/plugins/uptime/public/locators/overview.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/plugin.ts b/x-pack/solutions/observability/plugins/uptime/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/plugin.ts rename to x-pack/solutions/observability/plugins/uptime/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/utils/api_service/api_service.ts b/x-pack/solutions/observability/plugins/uptime/public/utils/api_service/api_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/utils/api_service/api_service.ts rename to x-pack/solutions/observability/plugins/uptime/public/utils/api_service/api_service.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/utils/api_service/index.ts b/x-pack/solutions/observability/plugins/uptime/public/utils/api_service/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/utils/api_service/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/utils/api_service/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/utils/kibana_service/index.ts b/x-pack/solutions/observability/plugins/uptime/public/utils/kibana_service/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/utils/kibana_service/index.ts rename to x-pack/solutions/observability/plugins/uptime/public/utils/kibana_service/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/public/utils/kibana_service/kibana_service.ts b/x-pack/solutions/observability/plugins/uptime/public/utils/kibana_service/kibana_service.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/public/utils/kibana_service/kibana_service.ts rename to x-pack/solutions/observability/plugins/uptime/public/utils/kibana_service/kibana_service.ts diff --git a/x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js b/x-pack/solutions/observability/plugins/uptime/scripts/base_e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/uptime/scripts/base_e2e.js rename to x-pack/solutions/observability/plugins/uptime/scripts/base_e2e.js diff --git a/x-pack/plugins/observability_solution/uptime/scripts/uptime_e2e.js b/x-pack/solutions/observability/plugins/uptime/scripts/uptime_e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/uptime/scripts/uptime_e2e.js rename to x-pack/solutions/observability/plugins/uptime/scripts/uptime_e2e.js diff --git a/x-pack/plugins/observability_solution/uptime/server/constants/settings.ts b/x-pack/solutions/observability/plugins/uptime/server/constants/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/constants/settings.ts rename to x-pack/solutions/observability/plugins/uptime/server/constants/settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/index.ts b/x-pack/solutions/observability/plugins/uptime/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/framework/adapter_types.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/framework/adapter_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/framework/adapter_types.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/framework/adapter_types.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/framework/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/framework/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/framework/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/framework/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/adapters/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/adapters/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/action_variables.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/action_variables.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/action_variables.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/action_variables.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/common.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/common.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/common.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/common.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/common.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/common.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/common.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/common.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_monitor_status.yaml diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/docs/params_property_synthetics_uptime_tls.yaml diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/duration_anomaly.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/status_check.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/status_check.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/status_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/status_check.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/status_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/test_utils/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/test_utils/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/test_utils/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/test_utils/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls_legacy.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls_legacy.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls_legacy.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls_legacy.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls_legacy.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls_legacy.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/tls_legacy.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/tls_legacy.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/translations.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/translations.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/translations.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/types.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/alerts/types.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/alerts/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/__snapshots__/license.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/__snapshots__/license.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/__snapshots__/license.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/__snapshots__/license.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/license.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/license.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/license.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/license.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/license.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/license.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/domains/license.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/domains/license.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/__snapshots__/get_filter_clause.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/__snapshots__/get_filter_clause.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/__snapshots__/get_filter_clause.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/__snapshots__/get_filter_clause.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/get_filter_clause.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/get_filter_clause.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/get_filter_clause.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/get_filter_clause.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/get_filter_clause.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/get_filter_clause.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/get_filter_clause.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/get_filter_clause.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/make_date_rate_filter.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/make_date_rate_filter.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/make_date_rate_filter.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/make_date_rate_filter.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/object_to_array.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/object_to_array.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/object_to_array.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/object_to_array.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/parse_relative_date.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/parse_relative_date.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/helper/parse_relative_date.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/helper/parse_relative_date.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/lib.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/lib.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/lib.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/lib.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/lib.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/generate_filter_aggs.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/generate_filter_aggs.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/generate_filter_aggs.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/generate_filter_aggs.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_details.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_monitor_duration.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_ping_histogram.test.ts.snap b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_ping_histogram.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_ping_histogram.test.ts.snap rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/__snapshots__/get_ping_histogram.test.ts.snap diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/generate_filter_aggs.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_certs.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_certs.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_certs.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_index_pattern.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_index_pattern.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_index_pattern.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_index_pattern.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_index_status.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_index_status.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_details.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_details.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_details.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_details.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_details.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_details.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_details.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_failed_steps.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_screenshot_blocks.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_steps.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_steps.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_steps.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_steps.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_steps.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_steps.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_journey_steps.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_journey_steps.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_last_successful_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_latest_monitor.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_availability.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_details.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_details.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_details.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_details.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_details.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_details.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_details.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_duration.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_locations.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_states.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_states.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_states.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_states.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_network_events.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_network_events.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_ping_histogram.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_pings.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_pings.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_pings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_snapshot_counts.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_snapshot_counts.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/get_snapshot_counts.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/get_snapshot_counts.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/fetch_chunk.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/fetch_chunk.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/fetch_chunk.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/fetch_chunk.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/find_potential_matches.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/find_potential_matches.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/find_potential_matches.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/find_potential_matches.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/get_query_string_filter.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/monitor_summary_iterator.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/query_context.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/query_context.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/query_context.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/query_context.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/refine_potential_matches.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/refine_potential_matches.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/refine_potential_matches.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/refine_potential_matches.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/test_helpers.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/test_helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/test_helpers.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/test_helpers.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/types.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/search/types.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/search/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/test_helpers.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/test_helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/requests/test_helpers.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/requests/test_helpers.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/migrations.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/migrations.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/migrations.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/migrations.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/migrations.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/migrations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/migrations.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/migrations.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/saved_objects.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/saved_objects.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/saved_objects.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/saved_objects.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/lib/saved_objects/uptime_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/create_route_with_auth.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/create_route_with_auth.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/create_route_with_auth.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/create_route_with_auth.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/dynamic_settings.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/dynamic_settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/dynamic_settings.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/dynamic_settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index_state/get_index_status.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index_state/get_index_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index_state/get_index_status.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index_state/get_index_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index_state/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index_state/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/index_state/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/index_state/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts similarity index 96% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts index f0d24a831672..9e33ea01612a 100644 --- a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts +++ b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_list.ts @@ -23,8 +23,10 @@ export const createMonitorListRoute: UMRestApiRouteFactory = (libs) => ({ pageSize: schema.number(), }), }, - options: { - tags: ['access:uptime-read'], + security: { + authz: { + requiredPrivileges: ['uptime-read'], + }, }, handler: async ({ uptimeEsClient, request, response }): Promise => { const { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter, pageSize, query } = diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_locations.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_locations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_locations.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_locations.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_status.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_status.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitor_status.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitor_status.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitors_details.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitors_details.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitors_details.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitors_details.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitors_durations.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitors_durations.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/monitors/monitors_durations.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/monitors/monitors_durations.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/network_events/get_network_events.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/network_events/get_network_events.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/network_events/get_network_events.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/network_events/get_network_events.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/network_events/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/network_events/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/network_events/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/network_events/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/get_ping_histogram.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/get_ping_histogram.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/get_ping_histogram.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/get_ping_histogram.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/get_pings.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/get_pings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/get_pings.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/get_pings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshot_blocks.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.test.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshots.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journey_screenshots.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journey_screenshots.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journeys.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journeys.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/pings/journeys.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/pings/journeys.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/snapshot/get_snapshot_count.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/snapshot/get_snapshot_count.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/snapshot/get_snapshot_count.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/snapshot/get_snapshot_count.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/snapshot/index.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/snapshot/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/snapshot/index.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/snapshot/index.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/synthetics/last_successful_check.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/synthetics/last_successful_check.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/synthetics/last_successful_check.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/synthetics/last_successful_check.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/types.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/types.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/types.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/routes/uptime_route_wrapper.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts b/x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/legacy_uptime/uptime_server.ts rename to x-pack/solutions/observability/plugins/uptime/server/legacy_uptime/uptime_server.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/plugin.ts b/x-pack/solutions/observability/plugins/uptime/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/plugin.ts rename to x-pack/solutions/observability/plugins/uptime/server/plugin.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/runtime_types/settings.ts b/x-pack/solutions/observability/plugins/uptime/server/runtime_types/settings.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/runtime_types/settings.ts rename to x-pack/solutions/observability/plugins/uptime/server/runtime_types/settings.ts diff --git a/x-pack/plugins/observability_solution/uptime/server/types.ts b/x-pack/solutions/observability/plugins/uptime/server/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/uptime/server/types.ts rename to x-pack/solutions/observability/plugins/uptime/server/types.ts diff --git a/x-pack/solutions/observability/plugins/uptime/tsconfig.json b/x-pack/solutions/observability/plugins/uptime/tsconfig.json new file mode 100644 index 000000000000..5de407dc03b8 --- /dev/null +++ b/x-pack/solutions/observability/plugins/uptime/tsconfig.json @@ -0,0 +1,84 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "scripts/**/*", + "public/**/*", + "public/legacy_uptime/components/monitor/status_details/location_map/embeddables/low_poly_layer.json", + "server/**/*", + "server/legacy_uptime/lib/requests/__fixtures__/monitor_charts_mock.json", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/config-schema", + "@kbn/i18n", + "@kbn/fleet-plugin", + "@kbn/alerting-plugin", + "@kbn/datemath", + "@kbn/stack-connectors-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/kibana-react-plugin", + "@kbn/observability-shared-plugin", + "@kbn/observability-plugin", + "@kbn/i18n-react", + "@kbn/shared-ux-page-kibana-template", + "@kbn/test-jest-helpers", + "@kbn/ml-anomaly-utils", + "@kbn/exploratory-view-plugin", + "@kbn/ml-plugin", + "@kbn/rison", + "@kbn/shared-ux-router", + "@kbn/unified-search-plugin", + "@kbn/core-http-browser", + "@kbn/es-query", + "@kbn/data-views-plugin", + "@kbn/ui-theme", + "@kbn/rule-data-utils", + "@kbn/kibana-utils-plugin", + "@kbn/data-plugin", + "@kbn/ml-error-utils", + "@kbn/core-http-browser-mocks", + "@kbn/securitysolution-io-ts-utils", + "@kbn/share-plugin", + "@kbn/discover-plugin", + "@kbn/home-plugin", + "@kbn/embeddable-plugin", + "@kbn/inspector-plugin", + "@kbn/cases-plugin", + "@kbn/cloud-plugin", + "@kbn/spaces-plugin", + "@kbn/core-doc-links-browser", + "@kbn/usage-collection-plugin", + "@kbn/core-application-browser", + "@kbn/encrypted-saved-objects-plugin", + "@kbn/task-manager-plugin", + "@kbn/features-plugin", + "@kbn/rule-registry-plugin", + "@kbn/security-plugin", + "@kbn/bfetch-plugin", + "@kbn/alerts-as-data-utils", + "@kbn/std", + "@kbn/utility-types", + "@kbn/licensing-plugin", + "@kbn/es-types", + "@kbn/safer-lodash-set", + "@kbn/core-elasticsearch-client-server-mocks", + "@kbn/core-http-server", + "@kbn/actions-plugin", + "@kbn/core-saved-objects-server", + "@kbn/observability-ai-assistant-plugin", + "@kbn/shared-ux-link-redirect-app", + "@kbn/repo-info", + "@kbn/react-kibana-context-render", + "@kbn/react-kibana-context-theme", + "@kbn/react-kibana-mount", + "@kbn/deeplinks-observability", + "@kbn/ebt-tools", + "@kbn/core-rendering-browser", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.js b/x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.js similarity index 100% rename from x-pack/plugins/observability_solution/ux/.buildkite/pipelines/flaky.js rename to x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.js diff --git a/x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.sh b/x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.sh new file mode 100644 index 000000000000..f6a329e3b5f4 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +UUID="$(cat /proc/sys/kernel/random/uuid)" +export UUID + +node x-pack/solutions/observability/plugins/ux/.buildkite/pipelines/flaky.js | buildkite-agent pipeline upload diff --git a/x-pack/plugins/streams_app/.storybook/main.js b/x-pack/solutions/observability/plugins/ux/.storybook/main.js similarity index 100% rename from x-pack/plugins/streams_app/.storybook/main.js rename to x-pack/solutions/observability/plugins/ux/.storybook/main.js diff --git a/x-pack/plugins/observability_solution/ux/CONTRIBUTING.md b/x-pack/solutions/observability/plugins/ux/CONTRIBUTING.md similarity index 100% rename from x-pack/plugins/observability_solution/ux/CONTRIBUTING.md rename to x-pack/solutions/observability/plugins/ux/CONTRIBUTING.md diff --git a/x-pack/plugins/observability_solution/ux/common/agent_name.ts b/x-pack/solutions/observability/plugins/ux/common/agent_name.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/agent_name.ts rename to x-pack/solutions/observability/plugins/ux/common/agent_name.ts diff --git a/x-pack/plugins/observability_solution/ux/common/config.ts b/x-pack/solutions/observability/plugins/ux/common/config.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/config.ts rename to x-pack/solutions/observability/plugins/ux/common/config.ts diff --git a/x-pack/plugins/observability_solution/ux/common/elasticsearch_fieldnames.ts b/x-pack/solutions/observability/plugins/ux/common/elasticsearch_fieldnames.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/elasticsearch_fieldnames.ts rename to x-pack/solutions/observability/plugins/ux/common/elasticsearch_fieldnames.ts diff --git a/x-pack/plugins/observability_solution/ux/common/environment_filter_values.ts b/x-pack/solutions/observability/plugins/ux/common/environment_filter_values.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/environment_filter_values.ts rename to x-pack/solutions/observability/plugins/ux/common/environment_filter_values.ts diff --git a/x-pack/plugins/observability_solution/ux/common/environment_rt.ts b/x-pack/solutions/observability/plugins/ux/common/environment_rt.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/environment_rt.ts rename to x-pack/solutions/observability/plugins/ux/common/environment_rt.ts diff --git a/x-pack/plugins/observability_solution/ux/common/fetch_options.ts b/x-pack/solutions/observability/plugins/ux/common/fetch_options.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/fetch_options.ts rename to x-pack/solutions/observability/plugins/ux/common/fetch_options.ts diff --git a/x-pack/plugins/observability_solution/ux/common/transaction_types.ts b/x-pack/solutions/observability/plugins/ux/common/transaction_types.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/transaction_types.ts rename to x-pack/solutions/observability/plugins/ux/common/transaction_types.ts diff --git a/x-pack/plugins/observability_solution/ux/common/utils/merge_projection.ts b/x-pack/solutions/observability/plugins/ux/common/utils/merge_projection.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/utils/merge_projection.ts rename to x-pack/solutions/observability/plugins/ux/common/utils/merge_projection.ts diff --git a/x-pack/plugins/observability_solution/ux/common/utils/pick_keys.ts b/x-pack/solutions/observability/plugins/ux/common/utils/pick_keys.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/utils/pick_keys.ts rename to x-pack/solutions/observability/plugins/ux/common/utils/pick_keys.ts diff --git a/x-pack/plugins/observability_solution/ux/common/ux_ui_filter.ts b/x-pack/solutions/observability/plugins/ux/common/ux_ui_filter.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/common/ux_ui_filter.ts rename to x-pack/solutions/observability/plugins/ux/common/ux_ui_filter.ts diff --git a/x-pack/solutions/observability/plugins/ux/e2e/README.md b/x-pack/solutions/observability/plugins/ux/e2e/README.md new file mode 100644 index 000000000000..4aa66d4fa313 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/e2e/README.md @@ -0,0 +1,15 @@ +## How to run these tests + +These tests rely on the Kibana functional test runner. There is a Kibana config in this directory, and a dedicated +script for standing up the test server. + +### Start the server + +From `~/x-pack/solutions/observability/plugins/ux/scripts`, run `node e2e.js --server`. Wait for the server to startup. It will provide you +with an example run command when it finishes. + +### Run the tests + +From this directory, `~/x-pack/solutions/observability/plugins/ux/e2e`, you can now run `node ../../../../../../scripts/functional_test_runner --config synthetics_run.ts`. + +In addition to the usual flags like `--grep`, you can also specify `--no-headless` in order to view your tests as you debug/develop. diff --git a/x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_8.0.0/data.json.gz b/x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_8.0.0/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_8.0.0/data.json.gz rename to x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_8.0.0/data.json.gz diff --git a/x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_8.0.0/mappings.json b/x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_8.0.0/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_8.0.0/mappings.json rename to x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_8.0.0/mappings.json diff --git a/x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_test_data/data.json.gz b/x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_test_data/data.json.gz similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_test_data/data.json.gz rename to x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_test_data/data.json.gz diff --git a/x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_test_data/mappings.json b/x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_test_data/mappings.json similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/fixtures/rum_test_data/mappings.json rename to x-pack/solutions/observability/plugins/ux/e2e/fixtures/rum_test_data/mappings.json diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/core_web_vitals.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/core_web_vitals.ts similarity index 96% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/core_web_vitals.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/core_web_vitals.ts index 6aeebbb913b1..a40073644803 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/core_web_vitals.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/core_web_vitals.ts @@ -6,7 +6,7 @@ */ import { journey, step, expect, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/index.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/index.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/index.ts diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/inp.journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/inp.journey.ts similarity index 98% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/inp.journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/inp.journey.ts index 451b5b749a93..215325caeb40 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/inp.journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/inp.journey.ts @@ -7,7 +7,7 @@ import { journey, step, expect, before } from '@elastic/synthetics'; import { Client } from '@elastic/elasticsearch'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { loginToKibana, waitForLoadingToFinish } from './utils'; const addTestTransaction = async (params: any) => { diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/page_views.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/page_views.ts similarity index 97% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/page_views.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/page_views.ts index cdae75f724d4..ec91050fb6d2 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/page_views.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/page_views.ts @@ -6,7 +6,7 @@ */ import { journey, step, expect, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/url_ux_query.journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/url_ux_query.journey.ts similarity index 95% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/url_ux_query.journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/url_ux_query.journey.ts index 24c1847b5cd0..730952254f1d 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/url_ux_query.journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/url_ux_query.journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, expect, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/utils.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/utils.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/utils.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/utils.ts diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_client_metrics.journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_client_metrics.journey.ts similarity index 97% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/ux_client_metrics.journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_client_metrics.journey.ts index 97cad67b91a7..ad8f569dbd47 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_client_metrics.journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_client_metrics.journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, expect, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_js_errors.journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_js_errors.journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/ux_js_errors.journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_js_errors.journey.ts index 9f573bf5e149..4c685c4db4f4 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_js_errors.journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_js_errors.journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, expect, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_long_task_metric_journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/ux_long_task_metric_journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts index eb9bad1c763d..5e55610e8793 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_long_task_metric_journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_long_task_metric_journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, before, expect } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_visitor_breakdown.journey.ts b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts similarity index 96% rename from x-pack/plugins/observability_solution/ux/e2e/journeys/ux_visitor_breakdown.journey.ts rename to x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts index 86e804f94751..92e51d4c16c3 100644 --- a/x-pack/plugins/observability_solution/ux/e2e/journeys/ux_visitor_breakdown.journey.ts +++ b/x-pack/solutions/observability/plugins/ux/e2e/journeys/ux_visitor_breakdown.journey.ts @@ -6,7 +6,7 @@ */ import { journey, step, before } from '@elastic/synthetics'; -import { recordVideo } from '../helpers/record_video'; +import { recordVideo } from '@kbn/observability-synthetics-test-data'; import { UXDashboardDatePicker } from '../page_objects/date_picker'; import { byLensTestId, loginToKibana, waitForLoadingToFinish } from './utils'; diff --git a/x-pack/plugins/observability_solution/ux/e2e/page_objects/dashboard.ts b/x-pack/solutions/observability/plugins/ux/e2e/page_objects/dashboard.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/page_objects/dashboard.ts rename to x-pack/solutions/observability/plugins/ux/e2e/page_objects/dashboard.ts diff --git a/x-pack/plugins/observability_solution/ux/e2e/page_objects/date_picker.ts b/x-pack/solutions/observability/plugins/ux/e2e/page_objects/date_picker.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/page_objects/date_picker.ts rename to x-pack/solutions/observability/plugins/ux/e2e/page_objects/date_picker.ts diff --git a/x-pack/plugins/observability_solution/ux/e2e/page_objects/login.tsx b/x-pack/solutions/observability/plugins/ux/e2e/page_objects/login.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/page_objects/login.tsx rename to x-pack/solutions/observability/plugins/ux/e2e/page_objects/login.tsx diff --git a/x-pack/plugins/observability_solution/ux/e2e/page_objects/utils.tsx b/x-pack/solutions/observability/plugins/ux/e2e/page_objects/utils.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/e2e/page_objects/utils.tsx rename to x-pack/solutions/observability/plugins/ux/e2e/page_objects/utils.tsx diff --git a/x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.ts b/x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.ts new file mode 100644 index 000000000000..84287949caa2 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/e2e/synthetics_run.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 { FtrConfigProviderContext } from '@kbn/test'; +import path from 'path'; +import { SyntheticsRunner, argv } from '@kbn/observability-synthetics-test-data'; + +const { headless, grep, bail: pauseOnError } = argv; + +async function runE2ETests({ readConfigFile }: FtrConfigProviderContext) { + const kibanaConfig = await readConfigFile(require.resolve('@kbn/synthetics-e2e/config')); + + return { + ...kibanaConfig.getAll(), + testRunner: async ({ getService }: any) => { + const syntheticsRunner = new SyntheticsRunner(getService, { + headless, + match: grep, + pauseOnError, + }); + + await syntheticsRunner.setup(); + + const fixturesDir = path.join(__dirname, '../e2e/fixtures/'); + + await syntheticsRunner.loadTestData(fixturesDir, ['rum_8.0.0', 'rum_test_data']); + await syntheticsRunner.loadTestFiles(async () => { + require('./journeys'); + }); + await syntheticsRunner.run(); + }, + }; +} + +// eslint-disable-next-line import/no-default-export +export default runE2ETests; diff --git a/x-pack/solutions/observability/plugins/ux/e2e/tsconfig.json b/x-pack/solutions/observability/plugins/ux/e2e/tsconfig.json new file mode 100644 index 000000000000..0ead299c18fc --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/e2e/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "exclude": ["tmp", "target/**/*"], + "include": ["./**/*"], + "compilerOptions": { + "outDir": "target/types", + "types": ["node"] + }, + "kbn_references": [ + "@kbn/test", + "@kbn/observability-synthetics-test-data", + ] +} diff --git a/x-pack/solutions/observability/plugins/ux/jest.config.js b/x-pack/solutions/observability/plugins/ux/jest.config.js new file mode 100644 index 000000000000..2ea37f49e3d5 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/jest.config.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. + */ + +const path = require('path'); + +module.exports = { + preset: '@kbn/test', + rootDir: path.resolve(__dirname, '../../../../..'), + roots: ['/x-pack/solutions/observability/plugins/ux'], +}; diff --git a/x-pack/solutions/observability/plugins/ux/kibana.jsonc b/x-pack/solutions/observability/plugins/ux/kibana.jsonc new file mode 100644 index 000000000000..6626a9e41461 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/kibana.jsonc @@ -0,0 +1,49 @@ +{ + "type": "plugin", + "id": "@kbn/ux-plugin", + "owner": [ + "@elastic/obs-ux-management-team" + ], + "group": "observability", + "visibility": "private", + "plugin": { + "id": "ux", + "browser": true, + "server": true, + "configPath": [ + "xpack", + "ux" + ], + "requiredPlugins": [ + "features", + "data", + "dataViews", + "exploratoryView", + "licensing", + "triggersActionsUi", + "observabilityShared", + "embeddable", + "inspector", + "apm" + ], + "optionalPlugins": [ + "cloud", + "usageCollection", + "taskManager", + "actions", + "alerts", + "observability", + "security", + "maps", + "lens", + "observabilityAIAssistant", + "spaces" + ], + "requiredBundles": [ + "kibanaReact", + "exploratoryView", + "observability", + "maps" + ] + } +} diff --git a/x-pack/plugins/observability_solution/ux/public/application/application.test.tsx b/x-pack/solutions/observability/plugins/ux/public/application/application.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/application/application.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/application/application.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/application/ux_app.tsx b/x-pack/solutions/observability/plugins/ux/public/application/ux_app.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/application/ux_app.tsx rename to x-pack/solutions/observability/plugins/ux/public/application/ux_app.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/action_menu/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/action_menu/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/action_menu/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/action_menu/inpector_link.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/action_menu/inpector_link.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/action_menu/inpector_link.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/action_menu/inpector_link.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/breakdowns/breakdown_filter.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/breakdowns/breakdown_filter.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/breakdowns/breakdown_filter.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/breakdowns/breakdown_filter.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/chart_wrapper/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/chart_wrapper/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/chart_wrapper/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/chart_wrapper/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/__snapshots__/visitor_breakdown_chart.test.tsx.snap b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/__snapshots__/visitor_breakdown_chart.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/__snapshots__/visitor_breakdown_chart.test.tsx.snap rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/__snapshots__/visitor_breakdown_chart.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/page_load_dist_chart.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/page_load_dist_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/page_load_dist_chart.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/page_load_dist_chart.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/page_views_chart.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/page_views_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/page_views_chart.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/page_views_chart.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/use_exp_view_attrs.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/use_exp_view_attrs.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/use_exp_view_attrs.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/use_exp_view_attrs.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.test.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/charts/visitor_breakdown_chart.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/client_metrics/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/client_metrics/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/client_metrics/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/client_metrics/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/client_metrics/metrics.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/client_metrics/metrics.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/client_metrics/metrics.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/client_metrics/metrics.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/csm_shared_context/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/csm_shared_context/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/csm_shared_context/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/csm_shared_context/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/empty_state_loading.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/empty_state_loading.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/empty_state_loading.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/empty_state_loading.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/environment_filter/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/environment_filter/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/environment_filter/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/environment_filter/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_has_rum_data.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_has_rum_data.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_has_rum_data.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_has_rum_data.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_local_uifilters.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_local_uifilters.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_local_uifilters.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_local_uifilters.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_ux_query.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_ux_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/hooks/use_ux_query.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/hooks/use_ux_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/impactful_metrics/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/impactful_metrics/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/impactful_metrics/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/impactful_metrics/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/impactful_metrics/js_errors.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/impactful_metrics/js_errors.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/impactful_metrics/js_errors.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/impactful_metrics/js_errors.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/queries.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/queries.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/queries.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/queries.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_filters.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/selected_wildcards.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/local_uifilters/use_data_view.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/percentile_annotations.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/percentile_annotations.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/percentile_annotations.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/percentile_annotations.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/reset_percentile_zoom.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/reset_percentile_zoom.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/reset_percentile_zoom.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/reset_percentile_zoom.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/types.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_load_distribution/types.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_load_distribution/types.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_views_trend/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_views_trend/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/page_views_trend/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/page_views_trend/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/page_load_and_views.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/page_load_and_views.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/page_load_and_views.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/page_load_and_views.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/visitor_breakdowns.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/visitor_breakdowns.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/visitor_breakdowns.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/visitor_breakdowns.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/web_application_select.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/web_application_select.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/panels/web_application_select.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/panels/web_application_select.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_dashboard.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_dashboard.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_dashboard.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_datepicker/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_datepicker/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_datepicker/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_datepicker/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_home.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_home.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/rum_home.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/rum_home.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/translations.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/translations.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/translations.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/service_name_filter/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/service_name_filter/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/service_name_filter/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/service_name_filter/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/render_option.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/render_option.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/render_option.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/render_option.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/use_url_search.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/use_url_search.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/url_filter/url_search/use_url_search.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/url_filter/url_search/use_url_search.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/user_percentile/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/user_percentile/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/user_percentile/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/user_percentile/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/utils/test_helper.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/utils/test_helper.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/utils/test_helper.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/utils/test_helper.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/format_to_sec.test.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/format_to_sec.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/format_to_sec.test.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/format_to_sec.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.test.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/key_ux_metrics.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/translations.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/translations.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_metrics/translations.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_metrics/translations.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/ux_overview_fetchers.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__mocks__/regions_layer.mock.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__mocks__/regions_layer.mock.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__mocks__/regions_layer.mock.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__mocks__/regions_layer.mock.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/embedded_map.test.tsx.snap b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/embedded_map.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/embedded_map.test.tsx.snap rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/embedded_map.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/map_tooltip.test.tsx.snap b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/map_tooltip.test.tsx.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/map_tooltip.test.tsx.snap rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__snapshots__/map_tooltip.test.tsx.snap diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__stories__/map_tooltip.stories.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__stories__/map_tooltip.stories.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__stories__/map_tooltip.stories.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/__stories__/map_tooltip.stories.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.test.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/embedded_map.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/index.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/index.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/index.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/index.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.test.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.tsx b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.tsx rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/map_tooltip.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.test.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.test.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_layer_list.ts diff --git a/x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_map_filters.ts b/x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_map_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_map_filters.ts rename to x-pack/solutions/observability/plugins/ux/public/components/app/rum_dashboard/visitor_breakdown_map/use_map_filters.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/plugin_context.ts b/x-pack/solutions/observability/plugins/ux/public/context/plugin_context.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/plugin_context.ts rename to x-pack/solutions/observability/plugins/ux/public/context/plugin_context.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/constants.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/constants.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/constants.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/constants.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/helpers.test.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/helpers.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/helpers.test.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/helpers.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/helpers.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/helpers.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/helpers.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/helpers.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/mock_url_params_context_provider.tsx b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/mock_url_params_context_provider.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/mock_url_params_context_provider.tsx rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/mock_url_params_context_provider.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/resolve_url_params.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/resolve_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/resolve_url_params.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/resolve_url_params.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/types.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/types.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/types.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/types.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/url_params_context.test.tsx b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/url_params_context.test.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/url_params_context.test.tsx rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/url_params_context.test.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/url_params_context.tsx b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/url_params_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/url_params_context.tsx rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/url_params_context.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/use_url_params.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/use_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/use_url_params.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/use_url_params.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/url_params_context/use_ux_url_params.ts b/x-pack/solutions/observability/plugins/ux/public/context/url_params_context/use_ux_url_params.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/url_params_context/use_ux_url_params.ts rename to x-pack/solutions/observability/plugins/ux/public/context/url_params_context/use_ux_url_params.ts diff --git a/x-pack/plugins/observability_solution/ux/public/context/use_ux_plugin_context.tsx b/x-pack/solutions/observability/plugins/ux/public/context/use_ux_plugin_context.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/context/use_ux_plugin_context.tsx rename to x-pack/solutions/observability/plugins/ux/public/context/use_ux_plugin_context.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_breakpoints.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_breakpoints.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_breakpoints.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_breakpoints.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_client_metrics_query.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_client_metrics_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_client_metrics_query.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_client_metrics_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_core_web_vitals_query.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_core_web_vitals_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_core_web_vitals_query.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_core_web_vitals_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_date_range_redirect.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_date_range_redirect.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_date_range_redirect.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_date_range_redirect.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_deep_object_identity.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_deep_object_identity.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_deep_object_identity.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_deep_object_identity.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_dynamic_data_view.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_dynamic_data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_dynamic_data_view.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_dynamic_data_view.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_environments_fetcher.tsx b/x-pack/solutions/observability/plugins/ux/public/hooks/use_environments_fetcher.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_environments_fetcher.tsx rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_environments_fetcher.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_fetcher.tsx b/x-pack/solutions/observability/plugins/ux/public/hooks/use_fetcher.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_fetcher.tsx rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_fetcher.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_inp_query.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_inp_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_inp_query.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_inp_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_js_errors_query.tsx b/x-pack/solutions/observability/plugins/ux/public/hooks/use_js_errors_query.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_js_errors_query.tsx rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_js_errors_query.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_kibana_services.tsx b/x-pack/solutions/observability/plugins/ux/public/hooks/use_kibana_services.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_kibana_services.tsx rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_kibana_services.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_long_task_metrics_query.tsx b/x-pack/solutions/observability/plugins/ux/public/hooks/use_long_task_metrics_query.tsx similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_long_task_metrics_query.tsx rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_long_task_metrics_query.tsx diff --git a/x-pack/plugins/observability_solution/ux/public/hooks/use_static_data_view.ts b/x-pack/solutions/observability/plugins/ux/public/hooks/use_static_data_view.ts similarity index 91% rename from x-pack/plugins/observability_solution/ux/public/hooks/use_static_data_view.ts rename to x-pack/solutions/observability/plugins/ux/public/hooks/use_static_data_view.ts index 51ebe9e4c28b..be4a382b8ad5 100644 --- a/x-pack/plugins/observability_solution/ux/public/hooks/use_static_data_view.ts +++ b/x-pack/solutions/observability/plugins/ux/public/hooks/use_static_data_view.ts @@ -12,7 +12,6 @@ export function useStaticDataView() { const { exploratoryView } = useKibanaServices(); const { data, loading } = useFetcher(async () => { return exploratoryView.getAppDataView('ux'); - // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return { diff --git a/x-pack/plugins/observability_solution/ux/public/index.ts b/x-pack/solutions/observability/plugins/ux/public/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/index.ts rename to x-pack/solutions/observability/plugins/ux/public/index.ts diff --git a/x-pack/plugins/observability_solution/ux/public/plugin.ts b/x-pack/solutions/observability/plugins/ux/public/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/plugin.ts rename to x-pack/solutions/observability/plugins/ux/public/plugin.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/client_metrics_query.test.ts.snap b/x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/client_metrics_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/client_metrics_query.test.ts.snap rename to x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/client_metrics_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/core_web_vitals_query.test.ts.snap b/x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/core_web_vitals_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/core_web_vitals_query.test.ts.snap rename to x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/core_web_vitals_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/js_errors_query.test.ts.snap b/x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/js_errors_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/js_errors_query.test.ts.snap rename to x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/js_errors_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/long_task_metrics_query.test.ts.snap b/x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/long_task_metrics_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/long_task_metrics_query.test.ts.snap rename to x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/long_task_metrics_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/service_name_query.test.ts.snap b/x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/service_name_query.test.ts.snap similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/__snapshots__/service_name_query.test.ts.snap rename to x-pack/solutions/observability/plugins/ux/public/services/data/__snapshots__/service_name_query.test.ts.snap diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/call_date_math.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/call_date_math.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/call_date_math.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/call_date_math.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/client_metrics_query.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/client_metrics_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/client_metrics_query.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/client_metrics_query.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/client_metrics_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/client_metrics_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/client_metrics_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/client_metrics_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/core_web_vitals_query.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/core_web_vitals_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/core_web_vitals_query.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/core_web_vitals_query.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/core_web_vitals_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/core_web_vitals_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/core_web_vitals_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/core_web_vitals_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/environments_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/environments_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/environments_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/environments_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/get_es_filter.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/get_es_filter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/get_es_filter.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/get_es_filter.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/get_es_filter.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/get_es_filter.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/get_es_filter.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/get_es_filter.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/get_exp_view_filter.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/get_exp_view_filter.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/get_exp_view_filter.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/get_exp_view_filter.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/get_exp_view_filter.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/get_exp_view_filter.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/get_exp_view_filter.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/get_exp_view_filter.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/has_rum_data_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/has_rum_data_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/has_rum_data_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/has_rum_data_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/inp_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/inp_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/inp_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/inp_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/js_errors_query.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/js_errors_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/js_errors_query.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/js_errors_query.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/js_errors_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/js_errors_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/js_errors_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/js_errors_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/long_task_metrics_query.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/long_task_metrics_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/long_task_metrics_query.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/long_task_metrics_query.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/long_task_metrics_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/long_task_metrics_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/long_task_metrics_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/long_task_metrics_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/projections.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/projections.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/projections.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/projections.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/range_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/range_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/range_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/range_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/service_name_query.test.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/service_name_query.test.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/service_name_query.test.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/service_name_query.test.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/service_name_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/service_name_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/service_name_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/service_name_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/data/url_search_query.ts b/x-pack/solutions/observability/plugins/ux/public/services/data/url_search_query.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/data/url_search_query.ts rename to x-pack/solutions/observability/plugins/ux/public/services/data/url_search_query.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/rest/call_api.ts b/x-pack/solutions/observability/plugins/ux/public/services/rest/call_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/rest/call_api.ts rename to x-pack/solutions/observability/plugins/ux/public/services/rest/call_api.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/rest/create_call_apm_api.ts b/x-pack/solutions/observability/plugins/ux/public/services/rest/create_call_apm_api.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/rest/create_call_apm_api.ts rename to x-pack/solutions/observability/plugins/ux/public/services/rest/create_call_apm_api.ts diff --git a/x-pack/plugins/observability_solution/ux/public/services/rest/data_view.ts b/x-pack/solutions/observability/plugins/ux/public/services/rest/data_view.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/public/services/rest/data_view.ts rename to x-pack/solutions/observability/plugins/ux/public/services/rest/data_view.ts diff --git a/x-pack/solutions/observability/plugins/ux/readme.md b/x-pack/solutions/observability/plugins/ux/readme.md new file mode 100644 index 000000000000..0f39b686260a --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/readme.md @@ -0,0 +1,14 @@ +# Documentation for UX UI developers + +https://docs.elastic.dev/kibana-dev-docs/welcome + +## Running E2E Tests + +The tests are managed via the `scripts/e2e.js` file. This script accepts numerous options. + +From the Kibana root you can run `node x-pack/solutions/observability/plugins/ux/scripts/e2e.js` to simply stand up the stack, load data, and run the tests. + +If you are developing a new test, it is better to stand up the stack in one shell and load data/run tests in a second session. You can do this by running: + +- `node ./x-pack/solutions/observability/plugins/ux/scripts/e2e.js --server` +- `node ./x-pack/solutions/observability/plugins/ux/scripts/e2e.js --runner`, you can also specify `--grep "{TEST_NAME}"` to run a specific series of tests diff --git a/x-pack/plugins/observability_solution/ux/scripts/e2e.js b/x-pack/solutions/observability/plugins/ux/scripts/e2e.js similarity index 100% rename from x-pack/plugins/observability_solution/ux/scripts/e2e.js rename to x-pack/solutions/observability/plugins/ux/scripts/e2e.js diff --git a/x-pack/plugins/observability_solution/ux/server/index.ts b/x-pack/solutions/observability/plugins/ux/server/index.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/server/index.ts rename to x-pack/solutions/observability/plugins/ux/server/index.ts diff --git a/x-pack/plugins/observability_solution/ux/server/plugin.ts b/x-pack/solutions/observability/plugins/ux/server/plugin.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/server/plugin.ts rename to x-pack/solutions/observability/plugins/ux/server/plugin.ts diff --git a/x-pack/solutions/observability/plugins/ux/tsconfig.json b/x-pack/solutions/observability/plugins/ux/tsconfig.json new file mode 100644 index 000000000000..3358b1a77282 --- /dev/null +++ b/x-pack/solutions/observability/plugins/ux/tsconfig.json @@ -0,0 +1,56 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "../../../../../typings/**/*", + "common/**/*", + "public/**/*", + "server/**/*", + "typings/**/*", + "public/**/*.json" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/embeddable-plugin", + "@kbn/home-plugin", + "@kbn/inspector-plugin", + "@kbn/kibana-react-plugin", + "@kbn/apm-plugin", + "@kbn/features-plugin", + "@kbn/licensing-plugin", + "@kbn/maps-plugin", + "@kbn/observability-plugin", + "@kbn/lens-plugin", + "@kbn/i18n", + "@kbn/io-ts-utils", + "@kbn/data-views-plugin", + "@kbn/core-http-browser", + "@kbn/datemath", + "@kbn/ui-theme", + "@kbn/typed-react-router-config", + "@kbn/utility-types", + "@kbn/server-route-repository", + "@kbn/es-types", + "@kbn/shared-ux-page-kibana-template", + "@kbn/i18n-react", + "@kbn/es-query", + "@kbn/exploratory-view-plugin", + "@kbn/observability-shared-plugin", + "@kbn/shared-ux-router", + "@kbn/observability-ai-assistant-plugin", + "@kbn/config-schema", + "@kbn/shared-ux-link-redirect-app", + "@kbn/apm-data-view", + "@kbn/spaces-plugin", + "@kbn/deeplinks-observability", + "@kbn/react-kibana-context-render", + "@kbn/react-kibana-context-theme", + "@kbn/search-types", + "@kbn/server-route-repository-utils", + "@kbn/core-chrome-browser" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/observability_solution/ux/typings/ui_filters.ts b/x-pack/solutions/observability/plugins/ux/typings/ui_filters.ts similarity index 100% rename from x-pack/plugins/observability_solution/ux/typings/ui_filters.ts rename to x-pack/solutions/observability/plugins/ux/typings/ui_filters.ts diff --git a/packages/kbn-data-stream-adapter/README.md b/x-pack/solutions/security/packages/data-stream-adapter/README.md similarity index 100% rename from packages/kbn-data-stream-adapter/README.md rename to x-pack/solutions/security/packages/data-stream-adapter/README.md diff --git a/x-pack/solutions/security/packages/data-stream-adapter/index.ts b/x-pack/solutions/security/packages/data-stream-adapter/index.ts new file mode 100644 index 000000000000..211fc4f9b5f1 --- /dev/null +++ b/x-pack/solutions/security/packages/data-stream-adapter/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { DataStreamAdapter } from './src/data_stream_adapter'; +export { DataStreamSpacesAdapter } from './src/data_stream_spaces_adapter'; + +export { retryTransientEsErrors, ecsFieldMap } from '@kbn/index-adapter'; +export type { + SetComponentTemplateParams, + SetIndexTemplateParams, + InstallParams, + EcsFieldMap, +} from '@kbn/index-adapter'; + +export * from '@kbn/index-adapter/src/field_maps/types'; diff --git a/x-pack/solutions/security/packages/data-stream-adapter/jest.config.js b/x-pack/solutions/security/packages/data-stream-adapter/jest.config.js new file mode 100644 index 000000000000..a5e7d4348c73 --- /dev/null +++ b/x-pack/solutions/security/packages/data-stream-adapter/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/solutions/security/packages/data-stream-adapter'], +}; diff --git a/packages/kbn-data-stream-adapter/kibana.jsonc b/x-pack/solutions/security/packages/data-stream-adapter/kibana.jsonc similarity index 100% rename from packages/kbn-data-stream-adapter/kibana.jsonc rename to x-pack/solutions/security/packages/data-stream-adapter/kibana.jsonc diff --git a/x-pack/solutions/security/packages/data-stream-adapter/package.json b/x-pack/solutions/security/packages/data-stream-adapter/package.json new file mode 100644 index 000000000000..ff622fd59305 --- /dev/null +++ b/x-pack/solutions/security/packages/data-stream-adapter/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/data-stream-adapter", + "version": "1.0.0", + "description": "Utility library for Elasticsearch Data Stream management", + "license": "Elastic License 2.0", + "private": true +} diff --git a/packages/kbn-data-stream-adapter/src/create_or_update_data_stream.test.ts b/x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.test.ts similarity index 93% rename from packages/kbn-data-stream-adapter/src/create_or_update_data_stream.test.ts rename to x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.test.ts index e2141d4afb74..35112e96ecb0 100644 --- a/packages/kbn-data-stream-adapter/src/create_or_update_data_stream.test.ts +++ b/x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { IndicesDataStream } from '@elastic/elasticsearch/lib/api/types'; diff --git a/packages/kbn-data-stream-adapter/src/create_or_update_data_stream.ts b/x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.ts similarity index 94% rename from packages/kbn-data-stream-adapter/src/create_or_update_data_stream.ts rename to x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.ts index 2b0fba3fb0ac..56e3d3a63548 100644 --- a/packages/kbn-data-stream-adapter/src/create_or_update_data_stream.ts +++ b/x-pack/solutions/security/packages/data-stream-adapter/src/create_or_update_data_stream.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { IndicesDataStream } from '@elastic/elasticsearch/lib/api/types'; diff --git a/x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts b/x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.ts new file mode 100644 index 000000000000..d42fb870ab3c --- /dev/null +++ b/x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_adapter.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 { IndexAdapter, SetIndexTemplateParams, type InstallParams } from '@kbn/index-adapter'; +import { createOrUpdateDataStream } from './create_or_update_data_stream'; + +export class DataStreamAdapter extends IndexAdapter { + public setIndexTemplate(params: SetIndexTemplateParams) { + super.setIndexTemplate({ ...params, isDataStream: true }); + } + + public async install(params: InstallParams) { + this.installed = true; + const { logger, pluginStop$, tasksTimeoutMs } = params; + const esClient = await params.esClient; + + await this.installTemplates(params); + + const installFn = this.getInstallFn({ logger, pluginStop$, tasksTimeoutMs }); + + // create data stream when everything is ready + await installFn( + createOrUpdateDataStream({ + name: this.name, + esClient, + logger, + totalFieldsLimit: this.totalFieldsLimit, + }), + `${this.name} data stream` + ); + } +} diff --git a/packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts b/x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts similarity index 81% rename from packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts rename to x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts index df131920b7bf..5fbb986fc647 100644 --- a/packages/kbn-data-stream-adapter/src/data_stream_spaces_adapter.ts +++ b/x-pack/solutions/security/packages/data-stream-adapter/src/data_stream_spaces_adapter.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { diff --git a/x-pack/solutions/security/packages/data-stream-adapter/tsconfig.json b/x-pack/solutions/security/packages/data-stream-adapter/tsconfig.json new file mode 100644 index 000000000000..0df371ef6021 --- /dev/null +++ b/x-pack/solutions/security/packages/data-stream-adapter/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + ] + }, + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/core", + "@kbn/index-adapter", + ], + "exclude": [ + "target/**/*" + ], +} diff --git a/x-pack/packages/security-solution/data_table/README.md b/x-pack/solutions/security/packages/data_table/README.md similarity index 100% rename from x-pack/packages/security-solution/data_table/README.md rename to x-pack/solutions/security/packages/data_table/README.md diff --git a/x-pack/packages/security-solution/data_table/common/types/data_table/index.ts b/x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/data_table/index.ts rename to x-pack/solutions/security/packages/data_table/common/types/data_table/index.ts diff --git a/x-pack/packages/security-solution/data_table/common/types/detail_panel.ts b/x-pack/solutions/security/packages/data_table/common/types/detail_panel.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/detail_panel.ts rename to x-pack/solutions/security/packages/data_table/common/types/detail_panel.ts diff --git a/x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts b/x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/header_actions/index.ts rename to x-pack/solutions/security/packages/data_table/common/types/header_actions/index.ts diff --git a/x-pack/packages/security-solution/data_table/common/types/index.ts b/x-pack/solutions/security/packages/data_table/common/types/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/index.ts rename to x-pack/solutions/security/packages/data_table/common/types/index.ts diff --git a/x-pack/packages/security-solution/data_table/common/types/risk_scores.ts b/x-pack/solutions/security/packages/data_table/common/types/risk_scores.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/risk_scores.ts rename to x-pack/solutions/security/packages/data_table/common/types/risk_scores.ts diff --git a/x-pack/packages/security-solution/data_table/common/types/session_view/index.ts b/x-pack/solutions/security/packages/data_table/common/types/session_view/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/common/types/session_view/index.ts rename to x-pack/solutions/security/packages/data_table/common/types/session_view/index.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/default_headers.ts b/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/default_headers.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/column_headers/default_headers.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/column_headers/default_headers.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.test.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.test.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.test.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/column_headers/helpers.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/column_headers/helpers.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/column_headers/translations.ts b/x-pack/solutions/security/packages/data_table/components/data_table/column_headers/translations.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/column_headers/translations.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/column_headers/translations.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/constants.ts b/x-pack/solutions/security/packages/data_table/components/data_table/constants.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/constants.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/constants.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/data_table.stories.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/data_table.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/data_table.stories.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/data_table.stories.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/helpers.test.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/helpers.test.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/helpers.test.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/helpers.test.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/helpers.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/helpers.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/index.test.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/index.test.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/index.test.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/index.tsx b/x-pack/solutions/security/packages/data_table/components/data_table/index.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/index.tsx rename to x-pack/solutions/security/packages/data_table/components/data_table/index.tsx diff --git a/x-pack/packages/security-solution/data_table/components/data_table/pagination.ts b/x-pack/solutions/security/packages/data_table/components/data_table/pagination.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/pagination.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/pagination.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/types.ts b/x-pack/solutions/security/packages/data_table/components/data_table/types.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/types.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/types.ts diff --git a/x-pack/packages/security-solution/data_table/components/data_table/utils.ts b/x-pack/solutions/security/packages/data_table/components/data_table/utils.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/data_table/utils.ts rename to x-pack/solutions/security/packages/data_table/components/data_table/utils.ts diff --git a/x-pack/packages/security-solution/data_table/components/toolbar/bulk_actions/types.ts b/x-pack/solutions/security/packages/data_table/components/toolbar/bulk_actions/types.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/toolbar/bulk_actions/types.ts rename to x-pack/solutions/security/packages/data_table/components/toolbar/bulk_actions/types.ts diff --git a/x-pack/packages/security-solution/data_table/components/toolbar/unit/index.ts b/x-pack/solutions/security/packages/data_table/components/toolbar/unit/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/toolbar/unit/index.ts rename to x-pack/solutions/security/packages/data_table/components/toolbar/unit/index.ts diff --git a/x-pack/packages/security-solution/data_table/components/toolbar/unit/styles.tsx b/x-pack/solutions/security/packages/data_table/components/toolbar/unit/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/components/toolbar/unit/styles.tsx rename to x-pack/solutions/security/packages/data_table/components/toolbar/unit/styles.tsx diff --git a/x-pack/packages/security-solution/data_table/components/toolbar/unit/translations.ts b/x-pack/solutions/security/packages/data_table/components/toolbar/unit/translations.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/components/toolbar/unit/translations.ts rename to x-pack/solutions/security/packages/data_table/components/toolbar/unit/translations.ts diff --git a/x-pack/packages/security-solution/data_table/hooks/use_selector.tsx b/x-pack/solutions/security/packages/data_table/hooks/use_selector.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/hooks/use_selector.tsx rename to x-pack/solutions/security/packages/data_table/hooks/use_selector.tsx diff --git a/x-pack/packages/security-solution/data_table/index.ts b/x-pack/solutions/security/packages/data_table/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/index.ts rename to x-pack/solutions/security/packages/data_table/index.ts diff --git a/x-pack/solutions/security/packages/data_table/jest.config.js b/x-pack/solutions/security/packages/data_table/jest.config.js new file mode 100644 index 000000000000..5b21976680c6 --- /dev/null +++ b/x-pack/solutions/security/packages/data_table/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', + roots: ['/x-pack/solutions/security/packages/data_table'], + rootDir: '../../../../..', +}; diff --git a/x-pack/packages/security-solution/data_table/kibana.jsonc b/x-pack/solutions/security/packages/data_table/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/data_table/kibana.jsonc rename to x-pack/solutions/security/packages/data_table/kibana.jsonc diff --git a/x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/library_load_event.ts b/x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/library_load_event.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/library_load_event.ts rename to x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/library_load_event.ts diff --git a/x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/process_execution_malware_prevention_alert.ts b/x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/process_execution_malware_prevention_alert.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/process_execution_malware_prevention_alert.ts rename to x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/process_execution_malware_prevention_alert.ts diff --git a/x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/registry_modification_event.ts b/x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/registry_modification_event.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/demo_data/endpoint/registry_modification_event.ts rename to x-pack/solutions/security/packages/data_table/mock/demo_data/endpoint/registry_modification_event.ts diff --git a/x-pack/packages/security-solution/data_table/mock/demo_data/timeline.ts b/x-pack/solutions/security/packages/data_table/mock/demo_data/timeline.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/demo_data/timeline.ts rename to x-pack/solutions/security/packages/data_table/mock/demo_data/timeline.ts diff --git a/x-pack/packages/security-solution/data_table/mock/global_state.ts b/x-pack/solutions/security/packages/data_table/mock/global_state.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/global_state.ts rename to x-pack/solutions/security/packages/data_table/mock/global_state.ts diff --git a/x-pack/packages/security-solution/data_table/mock/header.ts b/x-pack/solutions/security/packages/data_table/mock/header.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/header.ts rename to x-pack/solutions/security/packages/data_table/mock/header.ts diff --git a/x-pack/packages/security-solution/data_table/mock/mock_local_storage.ts b/x-pack/solutions/security/packages/data_table/mock/mock_local_storage.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/mock_local_storage.ts rename to x-pack/solutions/security/packages/data_table/mock/mock_local_storage.ts diff --git a/x-pack/packages/security-solution/data_table/mock/mock_source.ts b/x-pack/solutions/security/packages/data_table/mock/mock_source.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/mock_source.ts rename to x-pack/solutions/security/packages/data_table/mock/mock_source.ts diff --git a/x-pack/packages/security-solution/data_table/mock/mock_timeline_data.ts b/x-pack/solutions/security/packages/data_table/mock/mock_timeline_data.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/mock_timeline_data.ts rename to x-pack/solutions/security/packages/data_table/mock/mock_timeline_data.ts diff --git a/x-pack/packages/security-solution/data_table/mock/test_providers.tsx b/x-pack/solutions/security/packages/data_table/mock/test_providers.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/mock/test_providers.tsx rename to x-pack/solutions/security/packages/data_table/mock/test_providers.tsx diff --git a/x-pack/packages/security-solution/data_table/package.json b/x-pack/solutions/security/packages/data_table/package.json similarity index 100% rename from x-pack/packages/security-solution/data_table/package.json rename to x-pack/solutions/security/packages/data_table/package.json diff --git a/x-pack/packages/security-solution/data_table/store/data_table/actions.ts b/x-pack/solutions/security/packages/data_table/store/data_table/actions.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/actions.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/actions.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/defaults.ts b/x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/defaults.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/defaults.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/helpers.test.tsx b/x-pack/solutions/security/packages/data_table/store/data_table/helpers.test.tsx similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/helpers.test.tsx rename to x-pack/solutions/security/packages/data_table/store/data_table/helpers.test.tsx diff --git a/x-pack/packages/security-solution/data_table/store/data_table/helpers.ts b/x-pack/solutions/security/packages/data_table/store/data_table/helpers.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/helpers.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/helpers.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/index.ts b/x-pack/solutions/security/packages/data_table/store/data_table/index.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/index.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/index.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/inputs.ts b/x-pack/solutions/security/packages/data_table/store/data_table/inputs.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/inputs.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/inputs.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/model.ts b/x-pack/solutions/security/packages/data_table/store/data_table/model.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/model.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/model.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/reducer.ts b/x-pack/solutions/security/packages/data_table/store/data_table/reducer.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/reducer.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/reducer.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/selectors.ts b/x-pack/solutions/security/packages/data_table/store/data_table/selectors.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/selectors.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/selectors.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/translations.ts b/x-pack/solutions/security/packages/data_table/store/data_table/translations.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/translations.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/translations.ts diff --git a/x-pack/packages/security-solution/data_table/store/data_table/types.ts b/x-pack/solutions/security/packages/data_table/store/data_table/types.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/store/data_table/types.ts rename to x-pack/solutions/security/packages/data_table/store/data_table/types.ts diff --git a/x-pack/solutions/security/packages/data_table/tsconfig.json b/x-pack/solutions/security/packages/data_table/tsconfig.json new file mode 100644 index 000000000000..d44a419c3ba4 --- /dev/null +++ b/x-pack/solutions/security/packages/data_table/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": ["jest", "node", "react"] + }, + "include": ["**/*.ts", "**/*.tsx"], + "exclude": ["target/**/*"], + "kbn_references": [ + "@kbn/cell-actions", + "@kbn/timelines-plugin", + "@kbn/es-query", + "@kbn/triggers-actions-ui-plugin", + "@kbn/securitysolution-ecs", + "@kbn/safer-lodash-set", + "@kbn/i18n", + "@kbn/ui-theme", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/i18n-react", + "@kbn/ui-actions-plugin", + "@kbn/data-views-plugin", + "@kbn/field-formats-plugin", + "@kbn/data-plugin" + ] +} diff --git a/x-pack/packages/security-solution/data_table/utils/use_mount_appended.ts b/x-pack/solutions/security/packages/data_table/utils/use_mount_appended.ts similarity index 100% rename from x-pack/packages/security-solution/data_table/utils/use_mount_appended.ts rename to x-pack/solutions/security/packages/data_table/utils/use_mount_appended.ts diff --git a/x-pack/packages/security-solution/distribution_bar/README.md b/x-pack/solutions/security/packages/distribution_bar/README.md similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/README.md rename to x-pack/solutions/security/packages/distribution_bar/README.md diff --git a/x-pack/packages/security-solution/distribution_bar/index.ts b/x-pack/solutions/security/packages/distribution_bar/index.ts similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/index.ts rename to x-pack/solutions/security/packages/distribution_bar/index.ts diff --git a/x-pack/solutions/security/packages/distribution_bar/jest.config.js b/x-pack/solutions/security/packages/distribution_bar/jest.config.js new file mode 100644 index 000000000000..296ff5369079 --- /dev/null +++ b/x-pack/solutions/security/packages/distribution_bar/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', + roots: ['/x-pack/solutions/security/packages/distribution_bar'], + rootDir: '../../../../..', +}; diff --git a/x-pack/packages/security-solution/distribution_bar/kibana.jsonc b/x-pack/solutions/security/packages/distribution_bar/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/kibana.jsonc rename to x-pack/solutions/security/packages/distribution_bar/kibana.jsonc diff --git a/x-pack/packages/security-solution/distribution_bar/package.json b/x-pack/solutions/security/packages/distribution_bar/package.json similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/package.json rename to x-pack/solutions/security/packages/distribution_bar/package.json diff --git a/x-pack/packages/security-solution/distribution_bar/src/distribution_bar.stories.tsx b/x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/src/distribution_bar.stories.tsx rename to x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.stories.tsx diff --git a/x-pack/packages/security-solution/distribution_bar/src/distribution_bar.test.tsx b/x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.test.tsx similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/src/distribution_bar.test.tsx rename to x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.test.tsx diff --git a/x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx b/x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx similarity index 100% rename from x-pack/packages/security-solution/distribution_bar/src/distribution_bar.tsx rename to x-pack/solutions/security/packages/distribution_bar/src/distribution_bar.tsx diff --git a/x-pack/solutions/security/packages/distribution_bar/tsconfig.json b/x-pack/solutions/security/packages/distribution_bar/tsconfig.json new file mode 100644 index 000000000000..277fe500caa4 --- /dev/null +++ b/x-pack/solutions/security/packages/distribution_bar/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react", + ] + }, + "include": ["**/*.ts", "**/*.tsx"], + "kbn_references": [ + "@kbn/ui-theme", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/README.md b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/README.md similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/README.md rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/README.md diff --git a/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 b/x-pack/solutions/security/packages/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_panel/actions/add_to_new_case/hooks/use_add_to_new_case/index.tsx rename to x-pack/solutions/security/packages/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_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts b/x-pack/solutions/security/packages/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_panel/actions/add_to_new_case/hooks/use_add_to_new_case/translations.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/add_to_new_case/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/chat/translations.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/copy_to_clipboard/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/actions/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/constants.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/indices_check_context/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/contexts/results_rollup_context/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_context/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/ilm_phases_empty_prompt/translations.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/constants.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/constants.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/hooks/use_is_historical_results_tour_active/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/hooks/use_is_historical_results_tour_active/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/hooks/use_is_historical_results_tour_active/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/hooks/use_is_historical_results_tour_active/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/constants.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/contexts/historical_results_context/types.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_empty_prompt/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/error_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/historical_results_tour/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/historical_results_tour/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/constants.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/constants.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/reducers/fetch_historical_results_reducer.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/types.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_historical_results/utils/fetch_historical_results.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_ilm_explain/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/hooks/use_stats/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index.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/check_fields_tabs/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.test.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/check_fields_tabs/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/index.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/check_fields_tabs/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_fields_tabs/types.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/check_success_empty_prompt/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/index.test.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/check_success_empty_prompt/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_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/index_check_flyout/check_success_empty_prompt/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/check_success_empty_prompt/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/compare_fields_table/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.test.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/compare_fields_table/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/compare_fields_table/index.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/constants.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/constants.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/ecs_allowed_values/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.test.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/ecs_allowed_values/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/ecs_allowed_values/index.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/empty_prompt_body/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.test.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/empty_prompt_body/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_body/index.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/empty_prompt_title/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.test.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/empty_prompt_title/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/empty_prompt_title/index.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/historical_results/constants.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/constants.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/historical_results/historical_results_list/historical_result/historical_check_fields/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.test.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/historical_results/historical_results_list/historical_result/historical_check_fields/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/index.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/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.test.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/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/historical_check_fields/utils/get_incompatible_and_same_family_fields_from_historical_result.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/historical_results/historical_results_list/historical_result/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.test.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/historical_results/historical_results_list/historical_result/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/index.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/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.test.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/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/index.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/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/legacy_historical_check_fields/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/historical_results/historical_results_list/historical_result/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/styles.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/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.test.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/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/historical_result/utils/is_non_legacy_historical_result.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/historical_results/historical_results_list/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.test.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/historical_results/historical_results_list/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/index.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/historical_results/historical_results_list/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/styles.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/historical_results/historical_results_list/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/historical_results_list/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/historical_results/hooks/use_historical_results_date_picker/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_date_picker/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_date_picker/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_date_picker/index.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/historical_results/hooks/use_historical_results_outcome_filter/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_outcome_filter/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_outcome_filter/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_outcome_filter/index.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/historical_results/hooks/use_historical_results_pagination/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/index.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/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.test.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/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/hooks/use_historical_results_pagination/reducers/historical_results_pagination_reducer.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/historical_results/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.test.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/historical_results/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/index.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/historical_results/reducers/fetch_historical_results_query_reducer.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.test.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/historical_results/reducers/fetch_historical_results_query_reducer.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/reducers/fetch_historical_results_query_reducer.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/historical_results/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/styles.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/historical_results/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/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/historical_results/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/historical_results/types.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/hooks/use_current_window_width/index.test.tsx b/x-pack/solutions/security/packages/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 similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/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 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/hooks/use_current_window_width/index.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/incompatible_callout/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.test.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/incompatible_callout/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_callout/index.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/incompatible_tab/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/index.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/incompatible_tab/utils/get_incompatible_table_columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.test.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/incompatible_tab/utils/get_incompatible_table_columns.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/incompatible_tab/utils/get_incompatible_table_columns.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.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.test.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.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index.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_invalid_values/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.test.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_invalid_values/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_invalid_values/index.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_stats_panel/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.test.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_stats_panel/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/index_stats_panel/index.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/latest_results/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.test.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/latest_results/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/index.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/latest_results/latest_check_fields/all_tab/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/index.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/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.test.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/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/all_tab/utils/get_all_table_columns.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/latest_results/latest_check_fields/custom_tab/custom_callout/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.test.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/latest_results/latest_check_fields/custom_tab/custom_callout/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/custom_callout/index.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/latest_results/latest_check_fields/custom_tab/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/index.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/latest_results/latest_check_fields/custom_tab/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_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/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.test.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/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/get_custom_table_columns.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/latest_results/latest_check_fields/custom_tab/utils/markdown.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.test.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/latest_results/latest_check_fields/custom_tab/utils/markdown.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/custom_tab/utils/markdown.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/latest_results/latest_check_fields/ecs_compliant_tab/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/index.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/latest_results/latest_check_fields/ecs_compliant_tab/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_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/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.test.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/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/ecs_compliant_tab/utils/get_ecs_compliant_table_columns.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/latest_results/latest_check_fields/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.test.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/latest_results/latest_check_fields/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/index.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/latest_results/latest_check_fields/sticky_actions/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/sticky_actions/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/sticky_actions/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/sticky_actions/index.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/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.test.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/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/get_ecs_compliant_badge_color.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/latest_results/latest_check_fields/utils/is_timestamp_field_missing.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.test.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/latest_results/latest_check_fields/utils/is_timestamp_field_missing.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/latest_results/latest_check_fields/utils/is_timestamp_field_missing.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/same_family/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.test.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/same_family/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family/index.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/same_family_callout/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.test.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/same_family_callout/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_callout/index.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/same_family_tab/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/index.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/same_family_tab/utils/get_same_family_table_columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.test.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/same_family_tab/utils/get_same_family_table_columns.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/get_same_family_table_columns.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/same_family_tab/utils/markdown.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.test.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/same_family_tab/utils/markdown.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/same_family_tab/utils/markdown.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/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/styles.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/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/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/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/types.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/utils/get_formatted_check_time.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.test.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/utils/get_formatted_check_time.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_check_flyout/utils/get_formatted_check_time.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/index_result_badge/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx b/x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/loading_empty_prompt/index.tsx rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/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/pattern_label/ilm_phase_counts/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.test.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/pattern_label/ilm_phase_counts/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/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/pattern_label/ilm_phase_counts/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/translations.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/ilm_phase_counts/translations.ts 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/solutions/security/packages/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 similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/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 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/solutions/security/packages/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 similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/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 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/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/pattern_label/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/translations.ts 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/solutions/security/packages/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 similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/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 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/get_pattern_result_tooltip.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/pattern_label/utils/show_result.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/pattern_summary/translations.ts diff --git a/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 b/x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.test.tsx rename to x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx b/x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/index.tsx rename to x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts b/x-pack/solutions/security/packages/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_panel/data_quality_details/indices_details/pattern/remote_clusters_callout/translations.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/styles.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_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/summary_table/utils/columns.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/columns.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/summary_table/utils/get_show_pagination.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_check_text_color.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_index_result_tooltip.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/get_page_index.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/ilm_explain.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_index_names.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/should_create_pattern_rollup.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/indices_details/pattern/utils/stats.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/chart_legend_item/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/constants.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/no_data/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/translations.ts b/x-pack/solutions/security/packages/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_panel/data_quality_details/storage_details/storage_treemap/translations.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.test.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.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_fill_color.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_layers_multi_dimensional.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.test.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_layers_multi_dimensional.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_layers_multi_dimensional.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_legend_items.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.test.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_legend_items.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_legend_items.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_path_to_flattened_bucket_map.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.test.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_path_to_flattened_bucket_map.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/get_path_to_flattened_bucket_map.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/stats.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.test.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/stats.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/storage_treemap/utils/stats.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/translations.ts b/x-pack/solutions/security/packages/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_panel/data_quality_details/storage_details/translations.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/types.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_details/storage_details/utils/get_flattened_buckets.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/ilm_phase_filter/styles.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_all/utils/get_all_indices_to_check.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/helpers.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/errors_viewer/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/errors_popover/translations.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/check_status/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/translations.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/get_error_summaries.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/data_quality_summary/summary_actions/utils/markdown.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_abort_controller_ref/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/reducer.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_indices_check/types.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_is_mounted_ref/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/constants.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/hooks/use_stored_pattern_results/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.test.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/index.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/types.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.test.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.ts similarity index 100% rename from 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 rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/get_pattern_rollups_with_latest_check_result.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/metadata.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/stats.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/hooks/use_results_rollup/utils/storage.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/allowed_values/mock_allowed_values.ts b/x-pack/solutions/security/packages/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_panel/mock/allowed_values/mock_allowed_values.ts rename to x-pack/solutions/security/packages/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_panel/mock/data_quality_check_result/mock_index.tsx b/x-pack/solutions/security/packages/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_panel/mock/data_quality_check_result/mock_index.tsx rename to x-pack/solutions/security/packages/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_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts b/x-pack/solutions/security/packages/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_panel/mock/enriched_field_metadata/mock_enriched_field_metadata.ts rename to x-pack/solutions/security/packages/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_panel/mock/historical_results/mock_historical_results_response.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/historical_results/mock_historical_results_response.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/historical_results/mock_historical_results_response.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/historical_results/mock_historical_results_response.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/ilm_explain/mock_ilm_explain.ts b/x-pack/solutions/security/packages/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_panel/mock/ilm_explain/mock_ilm_explain.ts rename to x-pack/solutions/security/packages/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_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts b/x-pack/solutions/security/packages/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_panel/mock/indices_get_mapping_index_mapping_record/mock_indices_get_mapping_index_mapping_record.ts rename to x-pack/solutions/security/packages/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_panel/mock/mappings_properties/mock_mappings_properties.ts b/x-pack/solutions/security/packages/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_panel/mock/mappings_properties/mock_mappings_properties.ts rename to x-pack/solutions/security/packages/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_panel/mock/mappings_response/mock_mappings_response.ts b/x-pack/solutions/security/packages/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_panel/mock/mappings_response/mock_mappings_response.ts rename to x-pack/solutions/security/packages/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_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx b/x-pack/solutions/security/packages/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_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata.tsx rename to x-pack/solutions/security/packages/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_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts b/x-pack/solutions/security/packages/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_panel/mock/partitioned_field_metadata/mock_partitioned_field_metadata_with_same_family.ts rename to x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts b/x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_alerts_pattern_rollup.ts rename to x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts b/x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_auditbeat_pattern_rollup.ts rename to x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts b/x-pack/solutions/security/packages/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_panel/mock/pattern_rollup/mock_packetbeat_pattern_rollup.ts rename to x-pack/solutions/security/packages/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_panel/mock/stats/mock_stats.tsx b/x-pack/solutions/security/packages/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_panel/mock/stats/mock_stats.tsx rename to x-pack/solutions/security/packages/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_panel/mock/stats/mock_stats_auditbeat_index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_auditbeat_index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/stats/mock_stats_packetbeat_index.ts b/x-pack/solutions/security/packages/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_panel/mock/stats/mock_stats_packetbeat_index.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/test_providers.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/format.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/format.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/format.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/format.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_data_quality_context_props.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_indices_check_context_props.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/test_providers/utils/get_merged_results_rollup_context_props.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/unallowed_values/mock_unallowed_values.ts b/x-pack/solutions/security/packages/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_panel/mock/unallowed_values/mock_unallowed_values.ts rename to x-pack/solutions/security/packages/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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/mock/use_results_rollup/mock_use_results_rollup.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stat_label/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stats_rollup/index.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/generate_historical_results_stub/index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/generate_historical_results_stub/index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/generate_historical_results_stub/index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/generate_historical_results_stub/index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state_stub/index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state_stub/index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state_stub/index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_check_state_stub/index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_historical_result_stub/index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_historical_result_stub/index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_historical_result_stub/index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_historical_result_stub/index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_pattern_rollup_stub/index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_pattern_rollup_stub/index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_pattern_rollup_stub/index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/stub/get_pattern_rollup_stub/index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/styles.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/translations.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/types.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/check_index.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_mappings.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/fetch_unallowed_values.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_ilm_phase_description.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_incompatible_stat_badge_color.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.test.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_summary_table_items.ts 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_value_request_items.tsx 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/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/get_unallowed_values_request_items.test.tsx diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/markdown.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/metadata.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.test.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/data_quality_panel/utils/stats.ts diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/index.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/index.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/index.ts diff --git a/x-pack/solutions/security/packages/ecs_data_quality_dashboard/jest.config.js b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/jest.config.js new file mode 100644 index 000000000000..773d813a166b --- /dev/null +++ b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/jest.config.js @@ -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. + */ + +module.exports = { + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/security/packages/ecs_data_quality_dashboard_impl', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/*.{ts,tsx}', + '!/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/{__test__,__snapshots__,__examples__,*mock*,stub,tests,test_helpers,integration_tests,types}/**/*', + '!/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/*mock*.{ts,tsx}', + '!/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/*.test.{ts,tsx}', + '!/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/*.d.ts', + '!/x-pack/solutions/security/packages/ecs_data_quality_dashboard/impl/**/*.config.ts', + ], + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/security/packages/ecs_data_quality_dashboard'], + setupFilesAfterEnv: [ + '/x-pack/solutions/security/packages/ecs_data_quality_dashboard/setup_tests.ts', + ], +}; diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/kibana.jsonc b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/kibana.jsonc rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/kibana.jsonc diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/package.json b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/package.json similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/package.json rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/package.json diff --git a/x-pack/packages/security-solution/ecs_data_quality_dashboard/setup_tests.ts b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/setup_tests.ts similarity index 100% rename from x-pack/packages/security-solution/ecs_data_quality_dashboard/setup_tests.ts rename to x-pack/solutions/security/packages/ecs_data_quality_dashboard/setup_tests.ts diff --git a/x-pack/solutions/security/packages/ecs_data_quality_dashboard/tsconfig.json b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/tsconfig.json new file mode 100644 index 000000000000..2d76e9b8b0b4 --- /dev/null +++ b/x-pack/solutions/security/packages/ecs_data_quality_dashboard/tsconfig.json @@ -0,0 +1,30 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx", + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/i18n-react", + "@kbn/ui-theme", + "@kbn/core-http-browser", + "@kbn/core-http-browser-mocks", + "@kbn/elastic-assistant", + "@kbn/triggers-actions-ui-plugin", + "@kbn/core", + "@kbn/core-notifications-browser", + "@kbn/core-notifications-browser-mocks", + ] +} diff --git a/x-pack/plugins/threat_intelligence/.storybook/main.js b/x-pack/solutions/security/packages/expandable-flyout/.storybook/main.js similarity index 100% rename from x-pack/plugins/threat_intelligence/.storybook/main.js rename to x-pack/solutions/security/packages/expandable-flyout/.storybook/main.js diff --git a/x-pack/solutions/security/packages/expandable-flyout/README.md b/x-pack/solutions/security/packages/expandable-flyout/README.md new file mode 100644 index 000000000000..003df10e222e --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/README.md @@ -0,0 +1,112 @@ +# @kbn/expandable-flyout + +## Purpose + +This package offers an expandable flyout UI component and a way to manage the data displayed in it. The component leverages the [EuiFlyout](https://github.com/elastic/eui/tree/main/src/components/flyout) from the EUI library. + +The flyout is composed of 3 sections: +- a right section (primary section) that opens first +- a left wider section to show more details +- a preview section, that overlays the right section. This preview section can display multiple panels one after the other and displays a `Back` button + +> Run `yarn storybook expandable_flyout` to take a quick look at the expandable flyout in action + +## Design decisions + +The expandable-flyout is making some strict UI design decisions: +- when in collapsed mode (i.e. when only the right/preview section is open), the flyout's width linearly grows from its minimum value of 380px to its maximum value of 750px +- when in expanded mode (i.e. when the left section is opened), the flyout's width changes depending on the browser's width: + - if the window is smaller than 1600px, the flyout takes the entire browser window (minus 48px of padding on the left) + - for windows bigger than 1600px, the flyout's width is 80% of the entire browser window (with a max width of 1500px for the left section, and 750px for the right section) + +> While the expandable-flyout will work on very small screens, having both the right and left sections visible at the same time will not be a good experience to the user. We recommend only showing the right panel, and therefore handling this situation when you build your panels by considering hiding the actions that could open the left panel (like the expand details button in the [FlyoutNavigation](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout/shared/components/flyout_navigation.tsx)). + +## State persistence + +The expandable flyout offers 2 ways of managing its state: + +### Memory storage + +The default behavior saves the state of the flyout in memory. The state is internal to the package and based on an isolated redux context. Using this mode means the state will not be persisted when sharing url or reloading browser pages. + +### Url storage + +The second way (done by setting the `urlKey` prop to a string value) saves the state of the flyout in the url. This allows the flyout to be automatically reopened when users refresh the browser page, or when users share an url. The `urlKey` will be used as the url parameter. + +**_Note: the word `memory` cannot be used as an `urlKey` as it is reserved for the memory storage behavior. You can use any other string value, try to use something that should be unique._** + +> We highly recommend NOT nesting flyouts in your code, as it would cause conflicts for the url keys. We recommend instead to build multiple panels, with each their own context to manage their data (for example, take a look at the Security Solution [setup](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution/public/flyout)). +> +> A good solution is for example to have one instance of a flyout at a page level, and then have multiple panels that can be opened in that flyout. + + +## Package API + +The ExpandableFlyout [React component](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/expandable-flyout/src/index.tsx) renders the UI, leveraging an [EuiFlyout](https://eui.elastic.co/#/layout/flyout). + +To retrieve the flyout's layout (left, right and preview panels), you can utilize [useExpandableFlyoutState](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_state.ts). + +To control (or mutate) flyout's layout, you can utilize [useExpandableFlyoutApi](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_api.ts). + +**Expandable Flyout API** exposes the following methods: +- **openFlyout**: open the flyout with a set of panels +- **openRightPanel**: open a right panel +- **openLeftPanel**: open a left panel +- **openPreviewPanel**: open a preview panel +- **closeRightPanel**: close the right panel +- **closeLeftPanel**: close the left panel +- **closePreviewPanel**: close the preview panels +- **previousPreviewPanel**: navigate to the previous preview panel +- **closeFlyout**: close the flyout + +> The expandable flyout propagates the `onClose` callback from the EuiFlyout component. As we recommend having a single instance of the flyout in your application, it's up to the application's code to dispatch the event (through Redux, window events, observable, prop drilling...). + +When calling `openFlyout`, the right panel state is automatically appended in the `history` slice in the redux context. To access the flyout's history, you can use the [useExpandableFlyoutHistory](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_history.ts) hook. + +## Usage + +To use the expandable flyout in your plugin, first you need wrap your code with the [context provider](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/packages/expandable-flyout/src/context.tsx) at a high enough level as follows: +```typescript jsx +// state stored in the url + + ... + + + +// state stored in memory + + ... + +``` + +Then use the [React UI component](https://github.com/elastic/kibana/tree/main/x-pack/solutions/security/packages/expandable-flyout/src/index.tsx) where you need: + +```typescript jsx + +``` +_where `myPanels` is a list of all the panels that can be rendered in the flyout_ + +## Optional properties + +The expandable flyout now offers a way for users to change some of the flyout's UI properties. These are done via a gear icon in the top right corner of the flyout, to the left of the close icon. + +The gear icon can be hidden by setting the `hideSettings` property to `true` in the flyout's custom props. +The `typeDisabled` property allows to disable the push/overlay toggle. +```typescript +flyoutCustomProps?: { + hideSettings?: boolean; + typeDisabled?: boolean, +}; +``` + +At the moment, clicking on the gear icon opens a popover that allows you to toggle the flyout between `overlay` and `push` modes (see [EUI](https://eui.elastic.co/#/layout/flyout#push-versus-overlay)). The default value is `overlay`. The package remembers the selected value in local storage, only for expandable flyout that have a urlKey. The state of memory flyouts is not persisted. + +## Terminology + +### Section + +One of the 3 areas of the flyout (**left**, **right** or **preview**). + +### Panel + +A set of properties defining what's displayed in one of the flyout section (see interface [here](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/packages/expandable-flyout/src/types.ts)). diff --git a/x-pack/solutions/security/packages/expandable-flyout/__mocks__/index.tsx b/x-pack/solutions/security/packages/expandable-flyout/__mocks__/index.tsx new file mode 100644 index 000000000000..fa058e26c288 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/__mocks__/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 type { IStorage } from '@kbn/kibana-utils-plugin/public'; + +export const ExpandableFlyout = jest.fn(); + +export const localStorageMock = (): IStorage => { + let store: Record = {}; + + return { + getItem: (key: string) => { + return store[key] || null; + }, + setItem: (key: string, value: unknown) => { + store[key] = value; + }, + clear() { + store = {}; + }, + removeItem(key: string) { + delete store[key]; + }, + }; +}; diff --git a/x-pack/solutions/security/packages/expandable-flyout/index.ts b/x-pack/solutions/security/packages/expandable-flyout/index.ts new file mode 100644 index 000000000000..4b5cd448428c --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/index.ts @@ -0,0 +1,19 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { ExpandableFlyout } from './src'; + +export { useExpandableFlyoutApi } from './src/hooks/use_expandable_flyout_api'; +export { useExpandableFlyoutState } from './src/hooks/use_expandable_flyout_state'; +export { useExpandableFlyoutHistory } from './src/hooks/use_expandable_flyout_history'; + +export { type FlyoutPanels as ExpandableFlyoutState } from './src/store/state'; + +export { ExpandableFlyoutProvider } from './src/provider'; + +export type { ExpandableFlyoutProps } from './src'; +export type { FlyoutPanelProps, PanelPath, ExpandableFlyoutApi } from './src/types'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/jest.config.js b/x-pack/solutions/security/packages/expandable-flyout/jest.config.js new file mode 100644 index 000000000000..0caae916a926 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/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/solutions/security/packages/expandable-flyout'], +}; diff --git a/packages/kbn-expandable-flyout/kibana.jsonc b/x-pack/solutions/security/packages/expandable-flyout/kibana.jsonc similarity index 100% rename from packages/kbn-expandable-flyout/kibana.jsonc rename to x-pack/solutions/security/packages/expandable-flyout/kibana.jsonc diff --git a/x-pack/solutions/security/packages/expandable-flyout/package.json b/x-pack/solutions/security/packages/expandable-flyout/package.json new file mode 100644 index 000000000000..c5da13192d16 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/expandable-flyout", + "private": true, + "version": "1.0.0", + "license": "Elastic License 2.0", + "sideEffects": false +} \ No newline at end of file diff --git a/packages/kbn-expandable-flyout/src/components/container.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/container.test.tsx similarity index 91% rename from packages/kbn-expandable-flyout/src/components/container.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/container.test.tsx index fa27d81fa443..8cf8466901ba 100644 --- a/packages/kbn-expandable-flyout/src/components/container.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/container.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; @@ -58,6 +56,7 @@ describe('Container', () => { }, left: undefined, preview: undefined, + history: [{ id: 'key' }], }, }, }, @@ -85,6 +84,7 @@ describe('Container', () => { id: 'key', }, preview: undefined, + history: [], }, }, }, @@ -112,6 +112,7 @@ describe('Container', () => { id: 'key', }, ], + history: [], }, }, }, @@ -137,6 +138,7 @@ describe('Container', () => { }, left: undefined, preview: undefined, + history: [], }, }, }, @@ -163,6 +165,7 @@ describe('Container', () => { }, left: undefined, preview: undefined, + history: [], }, }, }, diff --git a/packages/kbn-expandable-flyout/src/components/container.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/container.tsx similarity index 95% rename from packages/kbn-expandable-flyout/src/components/container.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/container.tsx index 9d858d08be23..9679a43bb45f 100644 --- a/packages/kbn-expandable-flyout/src/components/container.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/container.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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, { memo, useCallback, useMemo } from 'react'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/components/left_section.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/left_section.tsx new file mode 100644 index 000000000000..243e01d13662 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/left_section.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 { EuiFlexItem } from '@elastic/eui'; +import React, { memo } from 'react'; +import { LEFT_SECTION_TEST_ID } from './test_ids'; + +interface LeftSectionProps { + /** + * Component to be rendered + */ + component: React.ReactElement; +} + +/** + * Left section of the expanded flyout rendering a panel + */ +export const LeftSection: React.FC = memo(({ component }: LeftSectionProps) => ( + + {component} + +)); + +LeftSection.displayName = 'LeftSection'; diff --git a/packages/kbn-expandable-flyout/src/components/preview_section.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.test.tsx similarity index 83% rename from packages/kbn-expandable-flyout/src/components/preview_section.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.test.tsx index 6476ac91c003..a250a746439f 100644 --- a/packages/kbn-expandable-flyout/src/components/preview_section.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; @@ -30,6 +28,7 @@ describe('PreviewSection', () => { id: 'key', }, ], + history: [], }, }, }, diff --git a/packages/kbn-expandable-flyout/src/components/preview_section.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.tsx similarity index 93% rename from packages/kbn-expandable-flyout/src/components/preview_section.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.tsx index d759e5500534..690917e55b5b 100644 --- a/packages/kbn-expandable-flyout/src/components/preview_section.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/preview_section.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { diff --git a/packages/kbn-expandable-flyout/src/components/resizable_container.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.test.tsx similarity index 78% rename from packages/kbn-expandable-flyout/src/components/resizable_container.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.test.tsx index b15c2b53c78c..07b9deffa914 100644 --- a/packages/kbn-expandable-flyout/src/components/resizable_container.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-expandable-flyout/src/components/resizable_container.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.tsx similarity index 90% rename from packages/kbn-expandable-flyout/src/components/resizable_container.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.tsx index d5e8f2c1b080..4eba95175fec 100644 --- a/packages/kbn-expandable-flyout/src/components/resizable_container.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/resizable_container.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { EuiResizableContainer } from '@elastic/eui'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/components/right_section.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/right_section.tsx new file mode 100644 index 000000000000..1cde5e5e8605 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/right_section.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 { EuiFlexItem } from '@elastic/eui'; +import React, { memo } from 'react'; +import { RIGHT_SECTION_TEST_ID } from './test_ids'; + +interface RightSectionProps { + /** + * Component to be rendered + */ + component: React.ReactElement; +} + +/** + * Right section of the expanded flyout rendering a panel + */ +export const RightSection: React.FC = memo( + ({ component }: RightSectionProps) => ( + + {component} + + ) +); + +RightSection.displayName = 'RightSection'; diff --git a/packages/kbn-expandable-flyout/src/components/settings_menu.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.test.tsx similarity index 95% rename from packages/kbn-expandable-flyout/src/components/settings_menu.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.test.tsx index f9a6991f55b5..c9452172d86c 100644 --- a/packages/kbn-expandable-flyout/src/components/settings_menu.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-expandable-flyout/src/components/settings_menu.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.tsx similarity index 78% rename from packages/kbn-expandable-flyout/src/components/settings_menu.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.tsx index e632f8bb0172..99e49d73f019 100644 --- a/packages/kbn-expandable-flyout/src/components/settings_menu.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/settings_menu.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { @@ -37,39 +35,66 @@ import { } from './test_ids'; import { selectPushVsOverlay, useDispatch, useSelector } from '../store/redux'; -const SETTINGS_MENU_ICON_BUTTON = i18n.translate('expandableFlyout.settingsMenu.popoverButton', { - defaultMessage: 'Open flyout settings menu', -}); +const SETTINGS_MENU_ICON_BUTTON = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.popoverButton', + { + defaultMessage: 'Open flyout settings menu', + } +); const SETTINGS_MENU_ICON_BUTTON_TOOLTIP = i18n.translate( - 'expandableFlyout.settingsMenu.popoverButton', + 'securitySolutionPackages.expandableFlyout.settingsMenu.popoverButton', + { + defaultMessage: 'Flyout settings', + } +); +const SETTINGS_MENU_TITLE = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.popoverTitle', { defaultMessage: 'Flyout settings', } ); -const SETTINGS_MENU_TITLE = i18n.translate('expandableFlyout.settingsMenu.popoverTitle', { - defaultMessage: 'Flyout settings', -}); -const FLYOUT_TYPE_TITLE = i18n.translate('expandableFlyout.settingsMenu.flyoutTypeTitle', { - defaultMessage: 'Flyout type', -}); -const FLYOUT_TYPE_OVERLAY_MODE = i18n.translate('expandableFlyout.settingsMenu.overlayMode', { - defaultMessage: 'Overlay', -}); -const FLYOUT_TYPE_PUSH_MODE = i18n.translate('expandableFlyout.settingsMenu.pushMode', { - defaultMessage: 'Push', -}); -const FLYOUT_TYPE_OVERLAY_TOOLTIP = i18n.translate('expandableFlyout.settingsMenu.overlayTooltip', { - defaultMessage: 'Displays the flyout over the page', -}); -const FLYOUT_TYPE_PUSH_TOOLTIP = i18n.translate('expandableFlyout.settingsMenu.pushTooltip', { - defaultMessage: 'Displays the flyout next to the page', -}); -const FLYOUT_RESIZE_TITLE = i18n.translate('expandableFlyout.renderMenu.flyoutResizeTitle', { - defaultMessage: 'Flyout size', -}); -const FLYOUT_RESIZE_BUTTON = i18n.translate('expandableFlyout.renderMenu.flyoutResizeButton', { - defaultMessage: 'Reset size', -}); +const FLYOUT_TYPE_TITLE = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.flyoutTypeTitle', + { + defaultMessage: 'Flyout type', + } +); +const FLYOUT_TYPE_OVERLAY_MODE = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.overlayMode', + { + defaultMessage: 'Overlay', + } +); +const FLYOUT_TYPE_PUSH_MODE = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.pushMode', + { + defaultMessage: 'Push', + } +); +const FLYOUT_TYPE_OVERLAY_TOOLTIP = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.overlayTooltip', + { + defaultMessage: 'Displays the flyout over the page', + } +); +const FLYOUT_TYPE_PUSH_TOOLTIP = i18n.translate( + 'securitySolutionPackages.expandableFlyout.settingsMenu.pushTooltip', + { + defaultMessage: 'Displays the flyout next to the page', + } +); +const FLYOUT_RESIZE_TITLE = i18n.translate( + 'securitySolutionPackages.expandableFlyout.renderMenu.flyoutResizeTitle', + { + defaultMessage: 'Flyout size', + } +); +const FLYOUT_RESIZE_BUTTON = i18n.translate( + 'securitySolutionPackages.expandableFlyout.renderMenu.flyoutResizeButton', + { + defaultMessage: 'Reset size', + } +); export interface FlyoutCustomProps { /** diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/components/test_ids.ts b/x-pack/solutions/security/packages/expandable-flyout/src/components/test_ids.ts new file mode 100644 index 000000000000..b6b2888423b8 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/test_ids.ts @@ -0,0 +1,48 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export const FLYOUT_TEST_ID = 'resizableFlyout'; + +export const RIGHT_SECTION_TEST_ID = 'rightSection'; + +export const LEFT_SECTION_TEST_ID = 'leftSection'; + +export const PREVIEW_SECTION_TEST_ID = 'previewSection'; + +export const PREVIEW_SECTION_CLOSE_BUTTON_TEST_ID = 'previewSectionCloseButton'; + +export const PREVIEW_SECTION_BACK_BUTTON_TEST_ID = 'previewSectionBackButton'; + +export const PREVIEW_SECTION_HEADER_TEST_ID = 'previewSectionHeader'; + +export const SETTINGS_MENU_BUTTON_TEST_ID = 'settingsMenuButton'; + +export const SETTINGS_MENU_FLYOUT_TYPE_TITLE_TEST_ID = 'settingsMenuFlyoutTypeTitle'; + +export const SETTINGS_MENU_FLYOUT_TYPE_INFORMATION_ICON_TEST_ID = + 'settingsMenuFlyoutTypeInformationIcon'; + +export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_TEST_ID = 'settingsMenuFlyoutTypeButtonGroup'; + +export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_OVERLAY_TEST_ID = + 'settingsMenuFlyoutTypeButtonGroupOverlayOption'; + +export const SETTINGS_MENU_FLYOUT_TYPE_BUTTON_GROUP_PUSH_TEST_ID = + 'settingsMenuFlyoutTypeButtonGroupPushOption'; + +export const SETTINGS_MENU_FLYOUT_RESIZE_TITLE_TEST_ID = 'settingsMenuFlyoutSizeTitle'; + +export const SETTINGS_MENU_FLYOUT_RESIZE_INFORMATION_ICON_TEST_ID = + 'settingsMenuFlyoutSizeInformationIcon'; + +export const SETTINGS_MENU_FLYOUT_RESIZE_BUTTON_TEST_ID = 'settingsMenuFlyoutSizeButton'; + +export const RESIZABLE_LEFT_SECTION_TEST_ID = 'resizableLeftSection'; + +export const RESIZABLE_RIGHT_SECTION_TEST_ID = 'resizableRightSection'; + +export const RESIZABLE_BUTTON_TEST_ID = 'resizableButton'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/components/translations.ts b/x-pack/solutions/security/packages/expandable-flyout/src/components/translations.ts new file mode 100644 index 000000000000..da499ef0904c --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/components/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 BACK_BUTTON = i18n.translate( + 'securitySolutionPackages.expandableFlyout.previewSection.backButton', + { + defaultMessage: 'Back', + } +); + +export const CLOSE_BUTTON = i18n.translate( + 'securitySolutionPackages.expandableFlyout.previewSection.closeButton', + { + defaultMessage: 'Close', + } +); diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/constants.ts b/x-pack/solutions/security/packages/expandable-flyout/src/constants.ts new file mode 100644 index 000000000000..8d50802ed2fc --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/constants.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. + */ + +/** + * This is a reserved word that we use as an id when no urlKey is provided and we are in memory storage mode + */ +export const REDUX_ID_FOR_MEMORY_STORAGE = 'memory'; + +export const EXPANDABLE_FLYOUT_LOCAL_STORAGE = 'expandableFlyout.ui'; +export const PUSH_VS_OVERLAY_LOCAL_STORAGE = 'pushVsOverlay'; +export const USER_COLLAPSED_WIDTH_LOCAL_STORAGE = 'collapsedWidth'; +export const USER_EXPANDED_WIDTH_LOCAL_STORAGE = 'expandedWidth'; +export const USER_SECTION_WIDTHS_LOCAL_STORAGE = 'sectionWidths'; diff --git a/packages/kbn-expandable-flyout/src/context.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/context.tsx similarity index 79% rename from packages/kbn-expandable-flyout/src/context.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/context.tsx index 65074a512ad8..cedd89991783 100644 --- a/packages/kbn-expandable-flyout/src/context.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/context.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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, { createContext, memo, useContext, useMemo } from 'react'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_api.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_api.ts similarity index 88% rename from packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_api.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_api.ts index e1fe482f448f..a00a1ec696ff 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_expandable_flyout_api.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_api.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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, useMemo } from 'react'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_history.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_history.ts new file mode 100644 index 000000000000..b82f1b7569b1 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_history.ts @@ -0,0 +1,20 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { REDUX_ID_FOR_MEMORY_STORAGE } from '../constants'; +import { useExpandableFlyoutContext } from '../context'; +import { selectHistoryById, useSelector } from '../store/redux'; + +/** + * This hook allows you to access the flyout state, read open right, left and preview panels. + */ +export const useExpandableFlyoutHistory = () => { + const { urlKey } = useExpandableFlyoutContext(); + // if no urlKey is provided, we are in memory storage mode and use the reserved word 'memory' + const id = urlKey || REDUX_ID_FOR_MEMORY_STORAGE; + return useSelector(selectHistoryById(id)); +}; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_state.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_state.ts new file mode 100644 index 000000000000..bf1c17039d5f --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_expandable_flyout_state.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 { useMemo } from 'react'; +import { REDUX_ID_FOR_MEMORY_STORAGE } from '../constants'; +import { useExpandableFlyoutContext } from '../context'; +import { selectPanelsById, useSelector } from '../store/redux'; + +/** + * This hook allows you to access the flyout state, read open right, left and preview panels. + */ +export const useExpandableFlyoutState = () => { + const { urlKey } = useExpandableFlyoutContext(); + // if no urlKey is provided, we are in memory storage mode and use the reserved word 'memory' + const id = useMemo(() => urlKey || REDUX_ID_FOR_MEMORY_STORAGE, [urlKey]); + + return useSelector(selectPanelsById(id)); +}; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts similarity index 89% rename from packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts index cc3623f9238c..de56bb563e78 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.ts similarity index 84% rename from packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.ts index 9c88fe29e75d..56e027f21dbc 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_initialize_from_local_storage.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_initialize_from_local_storage.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { diff --git a/packages/kbn-expandable-flyout/src/hooks/use_sections.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.test.tsx similarity index 90% rename from packages/kbn-expandable-flyout/src/hooks/use_sections.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.test.tsx index 8dc4aacaefbc..f5c7e7f0fb4a 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_sections.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_sections.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.ts similarity index 86% rename from packages/kbn-expandable-flyout/src/hooks/use_sections.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.ts index 5267030790e3..882f2a691550 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_sections.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_sections.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { useMemo } from 'react'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_window_width.test.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.test.ts similarity index 91% rename from packages/kbn-expandable-flyout/src/hooks/use_window_width.test.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.test.ts index 696191e7fbdf..906d9cc961a6 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_window_width.test.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-expandable-flyout/src/hooks/use_window_width.ts b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.ts similarity index 87% rename from packages/kbn-expandable-flyout/src/hooks/use_window_width.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.ts index 3df9eef08a4f..02bc19622096 100644 --- a/packages/kbn-expandable-flyout/src/hooks/use_window_width.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/hooks/use_window_width.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { useLayoutEffect, useState } from 'react'; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/index.stories.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/index.stories.tsx new file mode 100644 index 000000000000..4667cf64e299 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/index.stories.tsx @@ -0,0 +1,369 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { Story } from '@storybook/react'; +import { + EuiButton, + EuiFlexGroup, + EuiFlexItem, + EuiFlyoutBody, + EuiFlyoutFooter, + EuiFlyoutHeader, + EuiPanel, + EuiTitle, +} from '@elastic/eui'; +import { ExpandableFlyout } from '.'; +import { TestProvider } from './test/provider'; +import { initialUiState, State } from './store/state'; + +export default { + component: ExpandableFlyout, + title: 'ExpandableFlyout', +}; + +const registeredPanels = [ + { + key: 'right', + component: () => ( + <> + + +

{'Right panel header'}

+
+
+ +

{'Example of a right component body'}

+
+ + + + {'Footer button'} + + + + + ), + }, + { + key: 'left', + component: () => ( + + + + +

{'Left panel header'}

+
+
+

{'Example of a left component content'}

+ +
+
+ ), + }, + { + key: 'preview1', + component: () => ( + + + + +

{'Preview panel header'}

+
+
+

{'Example of a preview component content'}

+ +
+
+ ), + }, + { + key: 'preview2', + component: () => ( + + + + +

{'Second preview panel header'}

+
+
+

{'Example of another preview component content'}

+ +
+
+ ), + }, +]; + +export const Right: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: undefined, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const Left: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const Preview: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: [ + { + id: 'preview1', + }, + ], + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const MultiplePreviews: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: [ + { + id: 'preview1', + }, + { + id: 'preview2', + }, + ], + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const CollapsedPushMode: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: undefined, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: { + ...initialUiState, + pushVsOverlay: 'push', + }, + }; + + return ( + + + + ); +}; + +export const ExpandedPushMode: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: { + ...initialUiState, + pushVsOverlay: 'push', + }, + }; + + return ( + + + + ); +}; + +export const DisableTypeSelection: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const ResetWidths: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; + +export const DisableResizeWidthSelection: Story = () => { + const state: State = { + panels: { + byId: { + memory: { + right: { + id: 'right', + }, + left: { + id: 'left', + }, + preview: undefined, + history: [{ id: 'right' }], + }, + }, + }, + ui: initialUiState, + }; + + return ( + + + + ); +}; diff --git a/packages/kbn-expandable-flyout/src/index.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/index.test.tsx similarity index 80% rename from packages/kbn-expandable-flyout/src/index.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/index.test.tsx index 8ee4ff32a982..4ac5d7946237 100644 --- a/packages/kbn-expandable-flyout/src/index.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/index.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; @@ -51,6 +49,7 @@ describe('ExpandableFlyout', () => { }, left: undefined, preview: undefined, + history: [{ id: 'key' }], }, }, }, diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/index.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/index.tsx new file mode 100644 index 000000000000..06aef1030589 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/index.tsx @@ -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 React, { useMemo } from 'react'; +import type { Interpolation, Theme } from '@emotion/react'; +import { EuiFlyoutProps } from '@elastic/eui'; +import { EuiFlyoutResizableProps } from '@elastic/eui/src/components/flyout/flyout_resizable'; +import { Container } from './components/container'; +import { useWindowWidth } from './hooks/use_window_width'; +import { useInitializeFromLocalStorage } from './hooks/use_initialize_from_local_storage'; +import { FlyoutCustomProps } from './components/settings_menu'; +import type { Panel } from './types'; + +export interface ExpandableFlyoutProps extends Omit { + /** + * List of all registered panels available for render + */ + registeredPanels: Panel[]; + /** + * Allows for custom styles to be passed to the EuiFlyout component + */ + customStyles?: Interpolation; + /** + * Callback function to let application's code the flyout is closed + */ + onClose?: EuiFlyoutProps['onClose']; + /** + * Set of properties that drive a settings menu + */ + flyoutCustomProps?: FlyoutCustomProps; + /** + * Optional data test subject string to be used on the EuiFlyoutResizable component + */ + 'data-test-subj'?: string; +} + +/** + * Expandable flyout UI React component. + * Displays 3 sections (right, left, preview) depending on the panels in the context. + * + * The behavior expects that the left and preview sections should only be displayed is a right section + * is already rendered. + */ +export const ExpandableFlyout: React.FC = ({ ...props }) => { + const windowWidth = useWindowWidth(); + + useInitializeFromLocalStorage(); + + const container = useMemo(() => , [props]); + + if (windowWidth === 0) { + return null; + } + + return <>{container}; +}; + +ExpandableFlyout.displayName = 'ExpandableFlyout'; diff --git a/packages/kbn-expandable-flyout/src/provider.test.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/provider.test.tsx similarity index 88% rename from packages/kbn-expandable-flyout/src/provider.test.tsx rename to x-pack/solutions/security/packages/expandable-flyout/src/provider.test.tsx index 7d7e6f8ab10c..9005a95003d9 100644 --- a/packages/kbn-expandable-flyout/src/provider.test.tsx +++ b/x-pack/solutions/security/packages/expandable-flyout/src/provider.test.tsx @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; @@ -34,6 +32,7 @@ describe('UrlSynchronizer', () => { right: { id: 'key1' }, left: { id: 'key11' }, preview: undefined, + history: [{ id: 'key1' }], }, }, needsSync: true, @@ -93,6 +92,7 @@ describe('UrlSynchronizer', () => { right: { id: 'key1' }, left: { id: 'key2' }, preview: undefined, + history: [{ id: 'key1' }], }, }, needsSync: true, diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/provider.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/provider.tsx new file mode 100644 index 000000000000..e84d1128c99d --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/provider.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 { createKbnUrlStateStorage } from '@kbn/kibana-utils-plugin/public'; +import React, { FC, PropsWithChildren, useEffect, useMemo } from 'react'; +import { Provider as ReduxProvider } from 'react-redux'; +import { useHistory } from 'react-router-dom'; +import { ExpandableFlyoutContextProvider, useExpandableFlyoutContext } from './context'; +import { FlyoutPanels } from './store/state'; +import { useExpandableFlyoutState } from './hooks/use_expandable_flyout_state'; +import { Context, selectNeedsSync, store, useDispatch, useSelector } from './store/redux'; +import { urlChangedAction } from './store/actions'; + +/** + * Dispatches actions when url state changes and initializes the state when the app is loaded with flyout url parameters + */ +export const UrlSynchronizer = () => { + const { urlKey } = useExpandableFlyoutContext(); + const panels = useExpandableFlyoutState(); + const needsSync = useSelector(selectNeedsSync()); + const dispatch = useDispatch(); + + const history = useHistory(); + + const urlStorage = useMemo( + () => + createKbnUrlStateStorage({ + history, + useHash: false, + useHashQuery: false, + }), + [history] + ); + + useEffect(() => { + if (!urlKey) { + return; + } + + const currentValue = urlStorage.get(urlKey); + + // Dispatch current value to redux store as it does not happen automatically + if (currentValue) { + dispatch( + urlChangedAction({ + ...currentValue, + preview: currentValue?.preview?.at(-1), + id: urlKey, + }) + ); + } + + const subscription = urlStorage.change$(urlKey).subscribe((value) => { + dispatch(urlChangedAction({ ...value, preview: value?.preview?.at(-1), id: urlKey })); + }); + + return () => subscription.unsubscribe(); + }, [dispatch, urlKey, urlStorage]); + + useEffect(() => { + if (!needsSync || !panels || !urlKey) { + return; + } + + const { left, right, preview } = panels; + urlStorage.set(urlKey, { left, right, preview: [preview?.at(-1)] }); + }, [needsSync, panels, urlKey, urlStorage]); + + return null; +}; + +interface ExpandableFlyoutProviderProps { + /** + * Unique key to be used as url parameter to store the state of the flyout. + * Providing this will save the state of the flyout in the url. + * The word `memory` is reserved, do NOT use it! + */ + urlKey?: string; +} + +/** + * Wrap your plugin with this context for the ExpandableFlyout React component. + */ +export const ExpandableFlyoutProvider: FC> = ({ + children, + urlKey, +}) => { + return ( + + + {urlKey ? : null} + {children} + + + ); +}; diff --git a/packages/kbn-expandable-flyout/src/store/actions.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/actions.ts similarity index 93% rename from packages/kbn-expandable-flyout/src/store/actions.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/actions.ts index 49e28befa345..890f0bd01c92 100644 --- a/packages/kbn-expandable-flyout/src/store/actions.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/actions.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { createAction } from '@reduxjs/toolkit'; diff --git a/packages/kbn-expandable-flyout/src/store/middlewares.test.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.test.ts similarity index 95% rename from packages/kbn-expandable-flyout/src/store/middlewares.test.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.test.ts index 680a5619b0b6..efedee53b2d1 100644 --- a/packages/kbn-expandable-flyout/src/store/middlewares.test.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { localStorageMock } from '../../__mocks__'; diff --git a/packages/kbn-expandable-flyout/src/store/middlewares.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.ts similarity index 91% rename from packages/kbn-expandable-flyout/src/store/middlewares.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.ts index 4fb5354535ca..e9ec4cf3bd16 100644 --- a/packages/kbn-expandable-flyout/src/store/middlewares.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/middlewares.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { Action, Dispatch } from '@reduxjs/toolkit'; diff --git a/packages/kbn-expandable-flyout/src/store/reducers.test.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.test.ts similarity index 92% rename from packages/kbn-expandable-flyout/src/store/reducers.test.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.test.ts index 1a887333daca..f273b117fc89 100644 --- a/packages/kbn-expandable-flyout/src/store/reducers.test.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 '../types'; @@ -74,19 +72,21 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, }); }); - it('should override all panels in the state', () => { + it('should override all panels in the state and update history', () => { const state: PanelsState = { byId: { [id1]: { left: leftPanel1, right: rightPanel1, preview: [previewPanel1, { id: 'preview' }], + history: [rightPanel1], }, }, }; @@ -104,6 +104,7 @@ describe('panelsReducer', () => { left: leftPanel2, right: rightPanel2, preview: [previewPanel2], + history: [rightPanel1, rightPanel2], }, }, needsSync: true, @@ -117,6 +118,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -132,6 +134,7 @@ describe('panelsReducer', () => { left: undefined, right: rightPanel2, preview: undefined, + history: [rightPanel1, rightPanel2], }, }, needsSync: true, @@ -145,6 +148,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -160,11 +164,13 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, [id2]: { left: undefined, right: rightPanel2, preview: undefined, + history: [rightPanel2], }, }, needsSync: true, @@ -173,7 +179,7 @@ describe('panelsReducer', () => { }); describe('should handle openRightPanel action', () => { - it('should add right panel to empty state', () => { + it('should add right panel to empty state but does not update history', () => { const state: PanelsState = initialPanelsState; const action = openRightPanelAction({ right: rightPanel1, id: id1 }); const newState: PanelsState = panelsReducer(state, action); @@ -184,19 +190,21 @@ describe('panelsReducer', () => { left: undefined, right: rightPanel1, preview: undefined, + history: [], }, }, needsSync: true, }); }); - it('should replace right panel', () => { + it('should replace right panel but does not update history', () => { const state: PanelsState = { byId: { [id1]: { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -209,6 +217,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel2, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -222,6 +231,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -234,11 +244,13 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, [id2]: { left: undefined, right: rightPanel2, preview: undefined, + history: [], }, }, needsSync: true, @@ -258,6 +270,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: undefined, preview: undefined, + history: [], }, }, needsSync: true, @@ -271,6 +284,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, }, }; @@ -283,6 +297,7 @@ describe('panelsReducer', () => { left: leftPanel2, right: rightPanel1, preview: [previewPanel1], + history: [], }, }, needsSync: true, @@ -296,6 +311,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, }, }; @@ -308,11 +324,13 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, [id2]: { left: leftPanel2, right: undefined, preview: undefined, + history: [], }, }, needsSync: true, @@ -332,6 +350,7 @@ describe('panelsReducer', () => { left: undefined, right: undefined, preview: [previewPanel1], + history: [], }, }, needsSync: true, @@ -345,6 +364,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, }, }; @@ -357,6 +377,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1, previewPanel2], + history: [], }, }, needsSync: true, @@ -370,6 +391,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, }, }; @@ -382,11 +404,13 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [], }, [id2]: { left: undefined, right: undefined, preview: [previewPanel2], + history: [], }, }, needsSync: true, @@ -413,6 +437,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: undefined, preview: [previewPanel1], + history: [], }, }, }; @@ -432,6 +457,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -445,6 +471,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: undefined, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -458,6 +485,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -471,6 +499,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -497,6 +526,7 @@ describe('panelsReducer', () => { left: undefined, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -516,6 +546,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -528,6 +559,7 @@ describe('panelsReducer', () => { left: undefined, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -541,6 +573,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -553,6 +586,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -579,6 +613,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: undefined, + history: [rightPanel1], }, }, }; @@ -598,6 +633,7 @@ describe('panelsReducer', () => { left: rightPanel1, right: leftPanel1, preview: [previewPanel1, previewPanel2], + history: [rightPanel1], }, }, }; @@ -610,6 +646,7 @@ describe('panelsReducer', () => { left: rightPanel1, right: leftPanel1, preview: undefined, + history: [rightPanel1], }, }, needsSync: true, @@ -623,6 +660,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -635,6 +673,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, @@ -661,6 +700,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: undefined, + history: [rightPanel1], }, }, }; @@ -677,9 +717,10 @@ describe('panelsReducer', () => { const state: PanelsState = { byId: { [id1]: { - left: rightPanel1, - right: leftPanel1, + left: leftPanel1, + right: rightPanel1, preview: [previewPanel1, previewPanel2], + history: [rightPanel1], }, }, }; @@ -689,9 +730,10 @@ describe('panelsReducer', () => { expect(newState).toEqual({ byId: { [id1]: { - left: rightPanel1, - right: leftPanel1, + left: leftPanel1, + right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: false, @@ -705,6 +747,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -717,6 +760,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: false, @@ -743,6 +787,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -755,6 +800,7 @@ describe('panelsReducer', () => { left: undefined, right: undefined, preview: undefined, + history: [rightPanel1], }, }, needsSync: true, @@ -768,6 +814,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, }; @@ -780,6 +827,7 @@ describe('panelsReducer', () => { left: leftPanel1, right: rightPanel1, preview: [previewPanel1], + history: [rightPanel1], }, }, needsSync: true, diff --git a/packages/kbn-expandable-flyout/src/store/reducers.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.ts similarity index 92% rename from packages/kbn-expandable-flyout/src/store/reducers.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.ts index b14aa0b1b703..1d998aa47f5a 100644 --- a/packages/kbn-expandable-flyout/src/store/reducers.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/reducers.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { createReducer } from '@reduxjs/toolkit'; @@ -35,11 +33,15 @@ export const panelsReducer = createReducer(initialPanelsState, (builder) => { state.byId[id].right = right; state.byId[id].left = left; state.byId[id].preview = preview ? [preview] : undefined; + if (right) { + state.byId[id].history?.push(right); + } } else { state.byId[id] = { left, right, preview: preview ? [preview] : undefined, + history: right ? [right] : [], }; } @@ -54,6 +56,7 @@ export const panelsReducer = createReducer(initialPanelsState, (builder) => { left, right: undefined, preview: undefined, + history: [], }; } @@ -68,6 +71,7 @@ export const panelsReducer = createReducer(initialPanelsState, (builder) => { right, left: undefined, preview: undefined, + history: [], }; } @@ -90,6 +94,7 @@ export const panelsReducer = createReducer(initialPanelsState, (builder) => { right: undefined, left: undefined, preview: preview ? [preview] : undefined, + history: [], }; } @@ -149,6 +154,7 @@ export const panelsReducer = createReducer(initialPanelsState, (builder) => { right, left, preview: preview ? [preview] : undefined, + history: right ? [right] : [], // update history only when loading flyout on refresh }; } diff --git a/packages/kbn-expandable-flyout/src/store/redux.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/redux.ts similarity index 84% rename from packages/kbn-expandable-flyout/src/store/redux.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/redux.ts index d68b4a029576..5651ea29cd16 100644 --- a/packages/kbn-expandable-flyout/src/store/redux.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/redux.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 } from 'react'; @@ -48,6 +46,8 @@ const panelsSelector = createSelector(stateSelector, (state) => state.panels); export const selectPanelsById = (id: string) => createSelector(panelsSelector, (state) => state.byId[id] || {}); export const selectNeedsSync = () => createSelector(panelsSelector, (state) => state.needsSync); +export const selectHistoryById = (id: string) => + createSelector(stateSelector, (state) => state.panels.byId[id].history || []); const uiSelector = createSelector(stateSelector, (state) => state.ui); export const selectPushVsOverlay = createSelector(uiSelector, (state) => state.pushVsOverlay); diff --git a/packages/kbn-expandable-flyout/src/store/state.ts b/x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts similarity index 88% rename from packages/kbn-expandable-flyout/src/store/state.ts rename to x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts index e158f61aaccd..c5b7471a4b66 100644 --- a/packages/kbn-expandable-flyout/src/store/state.ts +++ b/x-pack/solutions/security/packages/expandable-flyout/src/store/state.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 '../..'; @@ -22,6 +20,10 @@ export interface FlyoutPanels { * Panels to render in the preview section */ preview: FlyoutPanelProps[] | undefined; + /* + * History of the right panels that were opened + */ + history: FlyoutPanelProps[]; } export interface PanelsState { diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/test/provider.tsx b/x-pack/solutions/security/packages/expandable-flyout/src/test/provider.tsx new file mode 100644 index 000000000000..f031f9ca8656 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/test/provider.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 { Provider as ReduxProvider } from 'react-redux'; +import { configureStore } from '@reduxjs/toolkit'; +import React, { FC, PropsWithChildren } from 'react'; +import { I18nProvider } from '@kbn/i18n-react'; +import { + savePushVsOverlayToLocalStorageMiddleware, + saveUserSectionWidthsToLocalStorageMiddleware, + saveUserFlyoutWidthsToLocalStorageMiddleware, +} from '../store/middlewares'; +import { ExpandableFlyoutContextProvider } from '../context'; +import { panelsReducer, uiReducer } from '../store/reducers'; +import { Context } from '../store/redux'; +import { initialState, State } from '../store/state'; + +interface TestProviderProps { + state?: State; + urlKey?: string; +} + +export const TestProvider: FC> = ({ + children, + state = initialState, + urlKey, +}) => { + const store = configureStore({ + reducer: { + panels: panelsReducer, + ui: uiReducer, + }, + devTools: false, + preloadedState: state, + middleware: [ + savePushVsOverlayToLocalStorageMiddleware, + saveUserSectionWidthsToLocalStorageMiddleware, + saveUserFlyoutWidthsToLocalStorageMiddleware, + ], + }); + + return ( + + + + {children} + + + + ); +}; diff --git a/x-pack/solutions/security/packages/expandable-flyout/src/types.ts b/x-pack/solutions/security/packages/expandable-flyout/src/types.ts new file mode 100644 index 000000000000..6266572c4210 --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/src/types.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 React from 'react'; + +export interface ExpandableFlyoutApi { + /** + * Open the flyout with left, right and/or preview panels + */ + openFlyout: (panels: { + left?: FlyoutPanelProps; + right?: FlyoutPanelProps; + preview?: FlyoutPanelProps; + }) => void; + /** + * Replaces the current right panel with a new one + */ + openRightPanel: (panel: FlyoutPanelProps) => void; + /** + * Replaces the current left panel with a new one + */ + openLeftPanel: (panel: FlyoutPanelProps) => void; + /** + * Add a new preview panel to the list of current preview panels + */ + openPreviewPanel: (panel: FlyoutPanelProps) => void; + /** + * Closes right panel + */ + closeRightPanel: () => void; + /** + * Closes left panel + */ + closeLeftPanel: () => void; + /** + * Closes all preview panels + */ + closePreviewPanel: () => void; + /** + * Go back to previous preview panel + */ + previousPreviewPanel: () => void; + /** + * Close all panels and closes flyout + */ + closeFlyout: () => void; +} + +export interface PanelPath { + /** + * Top level tab that to be displayed + */ + tab: string; + /** + * Optional secondary level to be displayed under top level tab + */ + subTab?: string; +} + +export interface FlyoutPanelProps { + /** + * Unique key to identify the panel + */ + id: string; + /** + * Any parameters necessary for the initial requests within the flyout + */ + params?: Record; + /** + * Tracks the path for what to show in a panel, such as activated tab and subtab + */ + path?: PanelPath; + /** + * Tracks visual state such as whether the panel is collapsed + */ + state?: Record; +} + +export interface Panel { + /** + * Unique key used to identify the panel + */ + key?: string; + /** + * Component to be rendered + */ + component: (props: FlyoutPanelProps) => React.ReactElement; +} diff --git a/x-pack/solutions/security/packages/expandable-flyout/tsconfig.json b/x-pack/solutions/security/packages/expandable-flyout/tsconfig.json new file mode 100644 index 000000000000..7759b8cc851b --- /dev/null +++ b/x-pack/solutions/security/packages/expandable-flyout/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "exclude": [ + "target/**/*" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/kibana-utils-plugin", + "@kbn/i18n-react" + ] +} diff --git a/x-pack/packages/security-solution/features/README.mdx b/x-pack/solutions/security/packages/features/README.mdx similarity index 100% rename from x-pack/packages/security-solution/features/README.mdx rename to x-pack/solutions/security/packages/features/README.mdx diff --git a/x-pack/packages/security-solution/features/config.ts b/x-pack/solutions/security/packages/features/config.ts similarity index 100% rename from x-pack/packages/security-solution/features/config.ts rename to x-pack/solutions/security/packages/features/config.ts diff --git a/x-pack/packages/security-solution/features/index.ts b/x-pack/solutions/security/packages/features/index.ts similarity index 100% rename from x-pack/packages/security-solution/features/index.ts rename to x-pack/solutions/security/packages/features/index.ts diff --git a/x-pack/solutions/security/packages/features/jest.config.js b/x-pack/solutions/security/packages/features/jest.config.js new file mode 100644 index 000000000000..8179ac021e81 --- /dev/null +++ b/x-pack/solutions/security/packages/features/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/solutions/security/packages/features'], +}; diff --git a/x-pack/packages/security-solution/features/keys.ts b/x-pack/solutions/security/packages/features/keys.ts similarity index 100% rename from x-pack/packages/security-solution/features/keys.ts rename to x-pack/solutions/security/packages/features/keys.ts diff --git a/x-pack/packages/security-solution/features/kibana.jsonc b/x-pack/solutions/security/packages/features/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/features/kibana.jsonc rename to x-pack/solutions/security/packages/features/kibana.jsonc diff --git a/x-pack/packages/security-solution/features/package.json b/x-pack/solutions/security/packages/features/package.json similarity index 100% rename from x-pack/packages/security-solution/features/package.json rename to x-pack/solutions/security/packages/features/package.json diff --git a/x-pack/packages/security-solution/features/privileges.ts b/x-pack/solutions/security/packages/features/privileges.ts similarity index 100% rename from x-pack/packages/security-solution/features/privileges.ts rename to x-pack/solutions/security/packages/features/privileges.ts diff --git a/x-pack/packages/security-solution/features/product_features.ts b/x-pack/solutions/security/packages/features/product_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/product_features.ts rename to x-pack/solutions/security/packages/features/product_features.ts diff --git a/x-pack/packages/security-solution/features/src/assistant/index.ts b/x-pack/solutions/security/packages/features/src/assistant/index.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/assistant/index.ts rename to x-pack/solutions/security/packages/features/src/assistant/index.ts diff --git a/x-pack/packages/security-solution/features/src/assistant/kibana_features.ts b/x-pack/solutions/security/packages/features/src/assistant/kibana_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/assistant/kibana_features.ts rename to x-pack/solutions/security/packages/features/src/assistant/kibana_features.ts diff --git a/x-pack/packages/security-solution/features/src/assistant/kibana_sub_features.ts b/x-pack/solutions/security/packages/features/src/assistant/kibana_sub_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/assistant/kibana_sub_features.ts rename to x-pack/solutions/security/packages/features/src/assistant/kibana_sub_features.ts diff --git a/x-pack/packages/security-solution/features/src/assistant/product_feature_config.ts b/x-pack/solutions/security/packages/features/src/assistant/product_feature_config.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/assistant/product_feature_config.ts rename to x-pack/solutions/security/packages/features/src/assistant/product_feature_config.ts diff --git a/x-pack/packages/security-solution/features/src/attack_discovery/index.ts b/x-pack/solutions/security/packages/features/src/attack_discovery/index.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/attack_discovery/index.ts rename to x-pack/solutions/security/packages/features/src/attack_discovery/index.ts diff --git a/x-pack/packages/security-solution/features/src/attack_discovery/kibana_features.ts b/x-pack/solutions/security/packages/features/src/attack_discovery/kibana_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/attack_discovery/kibana_features.ts rename to x-pack/solutions/security/packages/features/src/attack_discovery/kibana_features.ts diff --git a/x-pack/packages/security-solution/features/src/attack_discovery/product_feature_config.ts b/x-pack/solutions/security/packages/features/src/attack_discovery/product_feature_config.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/attack_discovery/product_feature_config.ts rename to x-pack/solutions/security/packages/features/src/attack_discovery/product_feature_config.ts diff --git a/x-pack/packages/security-solution/features/src/cases/index.ts b/x-pack/solutions/security/packages/features/src/cases/index.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/index.ts rename to x-pack/solutions/security/packages/features/src/cases/index.ts diff --git a/x-pack/packages/security-solution/features/src/cases/product_feature_config.ts b/x-pack/solutions/security/packages/features/src/cases/product_feature_config.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/product_feature_config.ts rename to x-pack/solutions/security/packages/features/src/cases/product_feature_config.ts diff --git a/x-pack/packages/security-solution/features/src/cases/types.ts b/x-pack/solutions/security/packages/features/src/cases/types.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/types.ts rename to x-pack/solutions/security/packages/features/src/cases/types.ts diff --git a/x-pack/packages/security-solution/features/src/cases/v1_features/kibana_features.ts b/x-pack/solutions/security/packages/features/src/cases/v1_features/kibana_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/v1_features/kibana_features.ts rename to x-pack/solutions/security/packages/features/src/cases/v1_features/kibana_features.ts diff --git a/x-pack/packages/security-solution/features/src/cases/v1_features/kibana_sub_features.ts b/x-pack/solutions/security/packages/features/src/cases/v1_features/kibana_sub_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/v1_features/kibana_sub_features.ts rename to x-pack/solutions/security/packages/features/src/cases/v1_features/kibana_sub_features.ts diff --git a/x-pack/packages/security-solution/features/src/cases/v1_features/types.ts b/x-pack/solutions/security/packages/features/src/cases/v1_features/types.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/v1_features/types.ts rename to x-pack/solutions/security/packages/features/src/cases/v1_features/types.ts diff --git a/x-pack/packages/security-solution/features/src/cases/v2_features/kibana_features.ts b/x-pack/solutions/security/packages/features/src/cases/v2_features/kibana_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/v2_features/kibana_features.ts rename to x-pack/solutions/security/packages/features/src/cases/v2_features/kibana_features.ts diff --git a/x-pack/packages/security-solution/features/src/cases/v2_features/kibana_sub_features.ts b/x-pack/solutions/security/packages/features/src/cases/v2_features/kibana_sub_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/cases/v2_features/kibana_sub_features.ts rename to x-pack/solutions/security/packages/features/src/cases/v2_features/kibana_sub_features.ts diff --git a/x-pack/packages/security-solution/features/src/constants.ts b/x-pack/solutions/security/packages/features/src/constants.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/constants.ts rename to x-pack/solutions/security/packages/features/src/constants.ts diff --git a/x-pack/packages/security-solution/features/src/helpers.ts b/x-pack/solutions/security/packages/features/src/helpers.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/helpers.ts rename to x-pack/solutions/security/packages/features/src/helpers.ts diff --git a/x-pack/packages/security-solution/features/src/product_features_keys.ts b/x-pack/solutions/security/packages/features/src/product_features_keys.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/product_features_keys.ts rename to x-pack/solutions/security/packages/features/src/product_features_keys.ts diff --git a/x-pack/packages/security-solution/features/src/product_features_privileges.ts b/x-pack/solutions/security/packages/features/src/product_features_privileges.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/product_features_privileges.ts rename to x-pack/solutions/security/packages/features/src/product_features_privileges.ts diff --git a/x-pack/packages/security-solution/features/src/security/index.ts b/x-pack/solutions/security/packages/features/src/security/index.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/security/index.ts rename to x-pack/solutions/security/packages/features/src/security/index.ts diff --git a/x-pack/packages/security-solution/features/src/security/kibana_features.ts b/x-pack/solutions/security/packages/features/src/security/kibana_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/security/kibana_features.ts rename to x-pack/solutions/security/packages/features/src/security/kibana_features.ts diff --git a/x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts b/x-pack/solutions/security/packages/features/src/security/kibana_sub_features.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/security/kibana_sub_features.ts rename to x-pack/solutions/security/packages/features/src/security/kibana_sub_features.ts diff --git a/x-pack/packages/security-solution/features/src/security/product_feature_config.ts b/x-pack/solutions/security/packages/features/src/security/product_feature_config.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/security/product_feature_config.ts rename to x-pack/solutions/security/packages/features/src/security/product_feature_config.ts diff --git a/x-pack/packages/security-solution/features/src/security/types.ts b/x-pack/solutions/security/packages/features/src/security/types.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/security/types.ts rename to x-pack/solutions/security/packages/features/src/security/types.ts diff --git a/x-pack/packages/security-solution/features/src/types.ts b/x-pack/solutions/security/packages/features/src/types.ts similarity index 100% rename from x-pack/packages/security-solution/features/src/types.ts rename to x-pack/solutions/security/packages/features/src/types.ts diff --git a/x-pack/solutions/security/packages/features/tsconfig.json b/x-pack/solutions/security/packages/features/tsconfig.json new file mode 100644 index 000000000000..bc415fbae622 --- /dev/null +++ b/x-pack/solutions/security/packages/features/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + ] + }, + "include": ["**/*.ts", "**/*.tsx"], + "kbn_references": [ + "@kbn/features-plugin", + "@kbn/utility-types", + "@kbn/i18n", + "@kbn/core-application-common", + "@kbn/cases-plugin", + "@kbn/securitysolution-rules", + "@kbn/securitysolution-list-constants", + ], + "exclude": ["target/**/*"] +} diff --git a/packages/kbn-index-adapter/README.md b/x-pack/solutions/security/packages/index-adapter/README.md similarity index 100% rename from packages/kbn-index-adapter/README.md rename to x-pack/solutions/security/packages/index-adapter/README.md diff --git a/x-pack/solutions/security/packages/index-adapter/index.ts b/x-pack/solutions/security/packages/index-adapter/index.ts new file mode 100644 index 000000000000..8f5bf5446863 --- /dev/null +++ b/x-pack/solutions/security/packages/index-adapter/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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export { IndexAdapter } from './src/index_adapter'; +export { IndexPatternAdapter, type InstallIndex } from './src/index_pattern_adapter'; +export { retryTransientEsErrors } from './src/retry_transient_es_errors'; +export { ecsFieldMap, type EcsFieldMap } from './src/field_maps/ecs_field_map'; +export { createOrUpdateIndexTemplate } from './src/create_or_update_index_template'; +export { createOrUpdateComponentTemplate } from './src/create_or_update_component_template'; + +export type { + SetComponentTemplateParams, + SetIndexTemplateParams, + IndexAdapterParams, + InstallParams, +} from './src/index_adapter'; +export * from './src/field_maps/types'; diff --git a/x-pack/solutions/security/packages/index-adapter/jest.config.js b/x-pack/solutions/security/packages/index-adapter/jest.config.js new file mode 100644 index 000000000000..5162be5bba83 --- /dev/null +++ b/x-pack/solutions/security/packages/index-adapter/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/solutions/security/packages/index-adapter'], +}; diff --git a/packages/kbn-index-adapter/kibana.jsonc b/x-pack/solutions/security/packages/index-adapter/kibana.jsonc similarity index 100% rename from packages/kbn-index-adapter/kibana.jsonc rename to x-pack/solutions/security/packages/index-adapter/kibana.jsonc diff --git a/x-pack/solutions/security/packages/index-adapter/package.json b/x-pack/solutions/security/packages/index-adapter/package.json new file mode 100644 index 000000000000..557f2133488c --- /dev/null +++ b/x-pack/solutions/security/packages/index-adapter/package.json @@ -0,0 +1,7 @@ +{ + "name": "@kbn/index-adapter", + "version": "1.0.0", + "description": "Utility library for Elasticsearch index management", + "license": "Elastic License 2.0", + "private": true +} \ No newline at end of file diff --git a/packages/kbn-index-adapter/src/create_or_update_component_template.test.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.test.ts similarity index 96% rename from packages/kbn-index-adapter/src/create_or_update_component_template.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.test.ts index 2bedbec8691b..c99952689b7b 100644 --- a/packages/kbn-index-adapter/src/create_or_update_component_template.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/packages/kbn-index-adapter/src/create_or_update_component_template.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.ts similarity index 91% rename from packages/kbn-index-adapter/src/create_or_update_component_template.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.ts index 73abf92c9e4a..6a7f87539de9 100644 --- a/packages/kbn-index-adapter/src/create_or_update_component_template.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_component_template.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { diff --git a/packages/kbn-index-adapter/src/create_or_update_index.test.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.test.ts similarity index 92% rename from packages/kbn-index-adapter/src/create_or_update_index.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.test.ts index 6c32b183e1fd..22d126782f68 100644 --- a/packages/kbn-index-adapter/src/create_or_update_index.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/packages/kbn-index-adapter/src/create_or_update_index.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.ts similarity index 94% rename from packages/kbn-index-adapter/src/create_or_update_index.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.ts index ff825c61305b..ce9528d8277f 100644 --- a/packages/kbn-index-adapter/src/create_or_update_index.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { IndexName } from '@elastic/elasticsearch/lib/api/types'; diff --git a/packages/kbn-index-adapter/src/create_or_update_index_template.test.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.test.ts similarity index 94% rename from packages/kbn-index-adapter/src/create_or_update_index_template.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.test.ts index 5f53c329e8cd..eb85b0931f9e 100644 --- a/packages/kbn-index-adapter/src/create_or_update_index_template.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { elasticsearchServiceMock, loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/packages/kbn-index-adapter/src/create_or_update_index_template.ts b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.ts similarity index 83% rename from packages/kbn-index-adapter/src/create_or_update_index_template.ts rename to x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.ts index 586b76ff44f2..d7e4b25771b8 100644 --- a/packages/kbn-index-adapter/src/create_or_update_index_template.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/create_or_update_index_template.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { diff --git a/packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts b/x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts similarity index 88% rename from packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts rename to x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts index a15c8480e6fc..424c2af01d4c 100644 --- a/packages/kbn-index-adapter/src/field_maps/ecs_field_map.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/field_maps/ecs_field_map.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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'; diff --git a/packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.test.ts b/x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.test.ts similarity index 90% rename from packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.test.ts index 5a4bffd3c46a..7d8a17a84fe4 100644 --- a/packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { mappingFromFieldMap } from './mapping_from_field_map'; diff --git a/packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.ts b/x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.ts similarity index 78% rename from packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.ts rename to x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.ts index 0d416ae8356e..c40dcbef695c 100644 --- a/packages/kbn-index-adapter/src/field_maps/mapping_from_field_map.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/field_maps/mapping_from_field_map.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/typesWithBodyKey'; diff --git a/x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts b/x-pack/solutions/security/packages/index-adapter/src/field_maps/types.ts new file mode 100644 index 000000000000..9c96fa2d796f --- /dev/null +++ b/x-pack/solutions/security/packages/index-adapter/src/field_maps/types.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +export interface AllowedValue { + description?: string; + name?: string; +} + +export interface MultiField { + flat_name: string; + name: string; + type: string; +} + +export interface EcsMetadata { + allowed_values?: AllowedValue[]; + dashed_name: string; + description: string; + doc_values?: boolean; + example?: string | number | boolean; + flat_name: string; + ignore_above?: number; + index?: boolean; + level: string; + multi_fields?: MultiField[]; + name: string; + normalize: string[]; + required?: boolean; + scaling_factor?: number; + short: string; + type: string; + properties?: Record; +} + +export type FieldMap = Record< + T, + { + type: string; + required: boolean; + array?: boolean; + doc_values?: boolean; + enabled?: boolean; + fields?: Record; + format?: string; + ignore_above?: number; + multi_fields?: MultiField[]; + index?: boolean; + path?: string; + scaling_factor?: number; + dynamic?: boolean | 'strict'; + properties?: Record; + inference_id?: string; + copy_to?: string; + } +>; + +// This utility type flattens all the keys of a schema object and its nested objects as a union type. +// Its purpose is to ensure that the FieldMap keys are always in sync with the schema object. +// It assumes all optional fields of the schema are required in the field map, they can always be omitted from the resulting type. +export type SchemaFieldMapKeys< + T extends Record, + Key = keyof T +> = Key extends string + ? NonNullable extends Record + ? `${Key}` | `${Key}.${SchemaFieldMapKeys>}` + : `${Key}` + : never; diff --git a/packages/kbn-index-adapter/src/index_adapter.ts b/x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts similarity index 92% rename from packages/kbn-index-adapter/src/index_adapter.ts rename to x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts index eef2ce529d78..f8395db9fa9b 100644 --- a/packages/kbn-index-adapter/src/index_adapter.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/index_adapter.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { diff --git a/packages/kbn-index-adapter/src/index_pattern_adapter.ts b/x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts similarity index 90% rename from packages/kbn-index-adapter/src/index_pattern_adapter.ts rename to x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts index 38a96a3c65b8..ae5e692cd55b 100644 --- a/packages/kbn-index-adapter/src/index_pattern_adapter.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/index_pattern_adapter.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { createIndex, updateIndices } from './create_or_update_index'; diff --git a/packages/kbn-index-adapter/src/install_with_timeout.test.ts b/x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.test.ts similarity index 80% rename from packages/kbn-index-adapter/src/install_with_timeout.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.test.ts index 6743604ba24f..43cdb8ce734a 100644 --- a/packages/kbn-index-adapter/src/install_with_timeout.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { loggerMock } from '@kbn/logging-mocks'; diff --git a/packages/kbn-index-adapter/src/install_with_timeout.ts b/x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.ts similarity index 81% rename from packages/kbn-index-adapter/src/install_with_timeout.ts rename to x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.ts index 79b78b7bb656..bb88b29cfe95 100644 --- a/packages/kbn-index-adapter/src/install_with_timeout.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/install_with_timeout.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { firstValueFrom, type Observable } from 'rxjs'; diff --git a/packages/kbn-index-adapter/src/resource_installer_utils.test.ts b/x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.test.ts similarity index 92% rename from packages/kbn-index-adapter/src/resource_installer_utils.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.test.ts index 31d4a3abcbb0..2067d17e5cb3 100644 --- a/packages/kbn-index-adapter/src/resource_installer_utils.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { getIndexTemplate, getComponentTemplate } from './resource_installer_utils'; diff --git a/packages/kbn-index-adapter/src/resource_installer_utils.ts b/x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.ts similarity index 87% rename from packages/kbn-index-adapter/src/resource_installer_utils.ts rename to x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.ts index eb6e2490000b..dbe958dc019d 100644 --- a/packages/kbn-index-adapter/src/resource_installer_utils.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/resource_installer_utils.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license 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 { diff --git a/packages/kbn-index-adapter/src/retry_transient_es_errors.test.ts b/x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.test.ts similarity index 87% rename from packages/kbn-index-adapter/src/retry_transient_es_errors.test.ts rename to x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.test.ts index 1b4582587f97..9120bdab5186 100644 --- a/packages/kbn-index-adapter/src/retry_transient_es_errors.test.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.test.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import { loggingSystemMock } from '@kbn/core/server/mocks'; diff --git a/packages/kbn-index-adapter/src/retry_transient_es_errors.ts b/x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts similarity index 79% rename from packages/kbn-index-adapter/src/retry_transient_es_errors.ts rename to x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts index 2b6ddea50982..6dd568de3b98 100644 --- a/packages/kbn-index-adapter/src/retry_transient_es_errors.ts +++ b/x-pack/solutions/security/packages/index-adapter/src/retry_transient_es_errors.ts @@ -1,10 +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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. */ import type { Logger } from '@kbn/core/server'; diff --git a/x-pack/solutions/security/packages/index-adapter/tsconfig.json b/x-pack/solutions/security/packages/index-adapter/tsconfig.json new file mode 100644 index 000000000000..fb98020940ad --- /dev/null +++ b/x-pack/solutions/security/packages/index-adapter/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + ] + }, + "include": ["**/*.ts"], + "kbn_references": [ + "@kbn/core", + "@kbn/std", + "@kbn/safer-lodash-set", + "@kbn/logging-mocks", + ], + "exclude": [ + "target/**/*" + ], +} diff --git a/x-pack/packages/security-solution/navigation/README.mdx b/x-pack/solutions/security/packages/navigation/README.mdx similarity index 100% rename from x-pack/packages/security-solution/navigation/README.mdx rename to x-pack/solutions/security/packages/navigation/README.mdx diff --git a/x-pack/packages/security-solution/navigation/index.ts b/x-pack/solutions/security/packages/navigation/index.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/index.ts rename to x-pack/solutions/security/packages/navigation/index.ts diff --git a/x-pack/solutions/security/packages/navigation/jest.config.js b/x-pack/solutions/security/packages/navigation/jest.config.js new file mode 100644 index 000000000000..e452a9a064f1 --- /dev/null +++ b/x-pack/solutions/security/packages/navigation/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/solutions/security/packages/navigation'], +}; diff --git a/x-pack/packages/security-solution/navigation/kibana.jsonc b/x-pack/solutions/security/packages/navigation/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/navigation/kibana.jsonc rename to x-pack/solutions/security/packages/navigation/kibana.jsonc diff --git a/x-pack/packages/security-solution/navigation/landing_links.ts b/x-pack/solutions/security/packages/navigation/landing_links.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/landing_links.ts rename to x-pack/solutions/security/packages/navigation/landing_links.ts diff --git a/x-pack/packages/security-solution/navigation/links.ts b/x-pack/solutions/security/packages/navigation/links.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/links.ts rename to x-pack/solutions/security/packages/navigation/links.ts diff --git a/x-pack/packages/security-solution/navigation/mocks/context.ts b/x-pack/solutions/security/packages/navigation/mocks/context.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/mocks/context.ts rename to x-pack/solutions/security/packages/navigation/mocks/context.ts diff --git a/x-pack/packages/security-solution/navigation/mocks/navigation.ts b/x-pack/solutions/security/packages/navigation/mocks/navigation.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/mocks/navigation.ts rename to x-pack/solutions/security/packages/navigation/mocks/navigation.ts diff --git a/x-pack/packages/security-solution/navigation/package.json b/x-pack/solutions/security/packages/navigation/package.json similarity index 100% rename from x-pack/packages/security-solution/navigation/package.json rename to x-pack/solutions/security/packages/navigation/package.json diff --git a/x-pack/packages/security-solution/navigation/src/__mocks__/context.tsx b/x-pack/solutions/security/packages/navigation/src/__mocks__/context.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/__mocks__/context.tsx rename to x-pack/solutions/security/packages/navigation/src/__mocks__/context.tsx diff --git a/x-pack/packages/security-solution/navigation/src/__mocks__/navigation.ts b/x-pack/solutions/security/packages/navigation/src/__mocks__/navigation.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/__mocks__/navigation.ts rename to x-pack/solutions/security/packages/navigation/src/__mocks__/navigation.ts diff --git a/x-pack/packages/security-solution/navigation/src/constants.ts b/x-pack/solutions/security/packages/navigation/src/constants.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/constants.ts rename to x-pack/solutions/security/packages/navigation/src/constants.ts diff --git a/x-pack/packages/security-solution/navigation/src/context.tsx b/x-pack/solutions/security/packages/navigation/src/context.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/context.tsx rename to x-pack/solutions/security/packages/navigation/src/context.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/beta_badge.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/beta_badge.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/beta_badge.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/beta_badge.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/index.ts b/x-pack/solutions/security/packages/navigation/src/landing_links/index.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/index.ts rename to x-pack/solutions/security/packages/navigation/src/landing_links/index.ts diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_goups.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_goups.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_goups.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_goups.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_groups.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_groups.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_groups.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_groups.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_groups.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_groups.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_categories_groups.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_categories_groups.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_icons_groups.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_icons_groups.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_image_card.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_image_card.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.stories.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.stories.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.stories.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.stories.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.test.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.test.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/landing_links_images_cards.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/landing_links_images_cards.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/lazy.tsx b/x-pack/solutions/security/packages/navigation/src/landing_links/lazy.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/lazy.tsx rename to x-pack/solutions/security/packages/navigation/src/landing_links/lazy.tsx diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/translations.ts b/x-pack/solutions/security/packages/navigation/src/landing_links/translations.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/translations.ts rename to x-pack/solutions/security/packages/navigation/src/landing_links/translations.ts diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/utils.test.ts b/x-pack/solutions/security/packages/navigation/src/landing_links/utils.test.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/utils.test.ts rename to x-pack/solutions/security/packages/navigation/src/landing_links/utils.test.ts diff --git a/x-pack/packages/security-solution/navigation/src/landing_links/utils.ts b/x-pack/solutions/security/packages/navigation/src/landing_links/utils.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/landing_links/utils.ts rename to x-pack/solutions/security/packages/navigation/src/landing_links/utils.ts diff --git a/x-pack/packages/security-solution/navigation/src/links.test.tsx b/x-pack/solutions/security/packages/navigation/src/links.test.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/links.test.tsx rename to x-pack/solutions/security/packages/navigation/src/links.test.tsx diff --git a/x-pack/packages/security-solution/navigation/src/links.tsx b/x-pack/solutions/security/packages/navigation/src/links.tsx similarity index 100% rename from x-pack/packages/security-solution/navigation/src/links.tsx rename to x-pack/solutions/security/packages/navigation/src/links.tsx diff --git a/x-pack/packages/security-solution/navigation/src/navigation.test.ts b/x-pack/solutions/security/packages/navigation/src/navigation.test.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/navigation.test.ts rename to x-pack/solutions/security/packages/navigation/src/navigation.test.ts diff --git a/x-pack/packages/security-solution/navigation/src/navigation.ts b/x-pack/solutions/security/packages/navigation/src/navigation.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/navigation.ts rename to x-pack/solutions/security/packages/navigation/src/navigation.ts diff --git a/x-pack/packages/security-solution/navigation/src/types.ts b/x-pack/solutions/security/packages/navigation/src/types.ts similarity index 100% rename from x-pack/packages/security-solution/navigation/src/types.ts rename to x-pack/solutions/security/packages/navigation/src/types.ts diff --git a/x-pack/solutions/security/packages/navigation/tsconfig.json b/x-pack/solutions/security/packages/navigation/tsconfig.json new file mode 100644 index 000000000000..41296e15768c --- /dev/null +++ b/x-pack/solutions/security/packages/navigation/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react" + ] + }, + "include": ["**/*.ts", "**/*.tsx"], + "kbn_references": [ + "@kbn/i18n", + "@kbn/core", + "@kbn/deeplinks-security" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/packages/security-solution/side_nav/README.mdx b/x-pack/solutions/security/packages/side_nav/README.mdx similarity index 100% rename from x-pack/packages/security-solution/side_nav/README.mdx rename to x-pack/solutions/security/packages/side_nav/README.mdx diff --git a/x-pack/packages/security-solution/side_nav/index.ts b/x-pack/solutions/security/packages/side_nav/index.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/index.ts rename to x-pack/solutions/security/packages/side_nav/index.ts diff --git a/x-pack/solutions/security/packages/side_nav/jest.config.js b/x-pack/solutions/security/packages/side_nav/jest.config.js new file mode 100644 index 000000000000..11d774a65045 --- /dev/null +++ b/x-pack/solutions/security/packages/side_nav/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/solutions/security/packages/side_nav'], +}; diff --git a/x-pack/packages/security-solution/side_nav/kibana.jsonc b/x-pack/solutions/security/packages/side_nav/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/side_nav/kibana.jsonc rename to x-pack/solutions/security/packages/side_nav/kibana.jsonc diff --git a/x-pack/packages/security-solution/side_nav/package.json b/x-pack/solutions/security/packages/side_nav/package.json similarity index 100% rename from x-pack/packages/security-solution/side_nav/package.json rename to x-pack/solutions/security/packages/side_nav/package.json diff --git a/x-pack/packages/security-solution/side_nav/panel.ts b/x-pack/solutions/security/packages/side_nav/panel.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/panel.ts rename to x-pack/solutions/security/packages/side_nav/panel.ts diff --git a/x-pack/packages/security-solution/side_nav/src/beta_badge.tsx b/x-pack/solutions/security/packages/side_nav/src/beta_badge.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/beta_badge.tsx rename to x-pack/solutions/security/packages/side_nav/src/beta_badge.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/index.tsx b/x-pack/solutions/security/packages/side_nav/src/index.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/index.tsx rename to x-pack/solutions/security/packages/side_nav/src/index.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav.stories.tsx b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav.stories.tsx similarity index 99% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav.stories.tsx rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav.stories.tsx index 4ac035f717c8..d67e36949ae9 100644 --- a/x-pack/packages/security-solution/side_nav/src/solution_side_nav.stories.tsx +++ b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav.stories.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { SolutionNav } from '@kbn/shared-ux-page-solution-nav'; import { LinkCategoryType } from '@kbn/security-solution-navigation'; -import readme from '../../README.mdx'; +import readme from '../README.mdx'; import { SolutionSideNav as SolutionSideNavComponent, type SolutionSideNavProps, diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav.styles.ts b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav.styles.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav.styles.ts rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav.styles.ts diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav.test.tsx b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav.test.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav.test.tsx rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav.test.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav.tsx rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.styles.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.styles.ts rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.styles.ts diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.test.tsx b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.test.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.test.tsx rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.test.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx b/x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/solution_side_nav_panel.tsx rename to x-pack/solutions/security/packages/side_nav/src/solution_side_nav_panel.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/telemetry/const.ts b/x-pack/solutions/security/packages/side_nav/src/telemetry/const.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/telemetry/const.ts rename to x-pack/solutions/security/packages/side_nav/src/telemetry/const.ts diff --git a/x-pack/packages/security-solution/side_nav/src/telemetry/telemetry_context.tsx b/x-pack/solutions/security/packages/side_nav/src/telemetry/telemetry_context.tsx similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/telemetry/telemetry_context.tsx rename to x-pack/solutions/security/packages/side_nav/src/telemetry/telemetry_context.tsx diff --git a/x-pack/packages/security-solution/side_nav/src/types.ts b/x-pack/solutions/security/packages/side_nav/src/types.ts similarity index 100% rename from x-pack/packages/security-solution/side_nav/src/types.ts rename to x-pack/solutions/security/packages/side_nav/src/types.ts diff --git a/x-pack/solutions/security/packages/side_nav/tsconfig.json b/x-pack/solutions/security/packages/side_nav/tsconfig.json new file mode 100644 index 000000000000..12c35d948e0d --- /dev/null +++ b/x-pack/solutions/security/packages/side_nav/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react", + "@kbn/ambient-ui-types" + ] + }, + "include": ["**/*.ts", "**/*.tsx"], + "kbn_references": [ + "@kbn/i18n", + "@kbn/analytics", + "@kbn/shared-ux-page-solution-nav", + "@kbn/security-solution-navigation", + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/packages/security-solution/storybook/config/README.mdx b/x-pack/solutions/security/packages/storybook/config/README.mdx similarity index 100% rename from x-pack/packages/security-solution/storybook/config/README.mdx rename to x-pack/solutions/security/packages/storybook/config/README.mdx diff --git a/x-pack/packages/security-solution/storybook/config/constants.ts b/x-pack/solutions/security/packages/storybook/config/constants.ts similarity index 100% rename from x-pack/packages/security-solution/storybook/config/constants.ts rename to x-pack/solutions/security/packages/storybook/config/constants.ts diff --git a/x-pack/packages/security-solution/storybook/config/index.ts b/x-pack/solutions/security/packages/storybook/config/index.ts similarity index 100% rename from x-pack/packages/security-solution/storybook/config/index.ts rename to x-pack/solutions/security/packages/storybook/config/index.ts diff --git a/x-pack/solutions/security/packages/storybook/config/kibana.jsonc b/x-pack/solutions/security/packages/storybook/config/kibana.jsonc new file mode 100644 index 000000000000..141b69563ed3 --- /dev/null +++ b/x-pack/solutions/security/packages/storybook/config/kibana.jsonc @@ -0,0 +1,7 @@ +{ + "type": "shared-common", + "id": "@kbn/security-solution-storybook-config", + "owner": "@elastic/security-threat-hunting-explore", + "group": "security", + "visibility": "private" +} diff --git a/x-pack/solutions/security/packages/storybook/config/main.ts b/x-pack/solutions/security/packages/storybook/config/main.ts new file mode 100644 index 000000000000..8fd00f77083a --- /dev/null +++ b/x-pack/solutions/security/packages/storybook/config/main.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. + */ + +import { defaultConfig } from '@kbn/storybook'; + +module.exports = { + ...defaultConfig, + stories: ['../../../**/*.stories.+(tsx|mdx)'], + reactOptions: { + strictMode: true, + }, +}; diff --git a/x-pack/packages/security-solution/storybook/config/manager.ts b/x-pack/solutions/security/packages/storybook/config/manager.ts similarity index 100% rename from x-pack/packages/security-solution/storybook/config/manager.ts rename to x-pack/solutions/security/packages/storybook/config/manager.ts diff --git a/x-pack/packages/security-solution/storybook/config/package.json b/x-pack/solutions/security/packages/storybook/config/package.json similarity index 100% rename from x-pack/packages/security-solution/storybook/config/package.json rename to x-pack/solutions/security/packages/storybook/config/package.json diff --git a/x-pack/packages/security-solution/storybook/config/preview.ts b/x-pack/solutions/security/packages/storybook/config/preview.ts similarity index 100% rename from x-pack/packages/security-solution/storybook/config/preview.ts rename to x-pack/solutions/security/packages/storybook/config/preview.ts diff --git a/x-pack/solutions/security/packages/storybook/config/tsconfig.json b/x-pack/solutions/security/packages/storybook/config/tsconfig.json new file mode 100644 index 000000000000..8ef38ac430bc --- /dev/null +++ b/x-pack/solutions/security/packages/storybook/config/tsconfig.json @@ -0,0 +1,20 @@ +{ + "extends": "../../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "@kbn/ambient-storybook-types", + ] + }, + "include": [ + "**/*.ts" + ], + "kbn_references": [ + "@kbn/storybook", + ], + "exclude": [ + "target/**/*", + ] +} diff --git a/x-pack/packages/security-solution/upselling/README.mdx b/x-pack/solutions/security/packages/upselling/README.mdx similarity index 100% rename from x-pack/packages/security-solution/upselling/README.mdx rename to x-pack/solutions/security/packages/upselling/README.mdx diff --git a/x-pack/packages/security-solution/upselling/helpers/index.tsx b/x-pack/solutions/security/packages/upselling/helpers/index.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/helpers/index.tsx rename to x-pack/solutions/security/packages/upselling/helpers/index.tsx diff --git a/x-pack/packages/security-solution/upselling/images/entity_paywall.png b/x-pack/solutions/security/packages/upselling/images/entity_paywall.png similarity index 100% rename from x-pack/packages/security-solution/upselling/images/entity_paywall.png rename to x-pack/solutions/security/packages/upselling/images/entity_paywall.png diff --git a/x-pack/solutions/security/packages/upselling/jest.config.js b/x-pack/solutions/security/packages/upselling/jest.config.js new file mode 100644 index 000000000000..d64e79c15976 --- /dev/null +++ b/x-pack/solutions/security/packages/upselling/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/solutions/security/packages/upselling'], +}; diff --git a/x-pack/packages/security-solution/upselling/kibana.jsonc b/x-pack/solutions/security/packages/upselling/kibana.jsonc similarity index 100% rename from x-pack/packages/security-solution/upselling/kibana.jsonc rename to x-pack/solutions/security/packages/upselling/kibana.jsonc diff --git a/x-pack/packages/security-solution/upselling/messages/index.tsx b/x-pack/solutions/security/packages/upselling/messages/index.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/messages/index.tsx rename to x-pack/solutions/security/packages/upselling/messages/index.tsx diff --git a/x-pack/packages/security-solution/upselling/package.json b/x-pack/solutions/security/packages/upselling/package.json similarity index 100% rename from x-pack/packages/security-solution/upselling/package.json rename to x-pack/solutions/security/packages/upselling/package.json diff --git a/x-pack/packages/security-solution/upselling/pages/attack_discovery/index.test.tsx b/x-pack/solutions/security/packages/upselling/pages/attack_discovery/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/attack_discovery/index.test.tsx rename to x-pack/solutions/security/packages/upselling/pages/attack_discovery/index.test.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/attack_discovery/index.tsx b/x-pack/solutions/security/packages/upselling/pages/attack_discovery/index.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/attack_discovery/index.tsx rename to x-pack/solutions/security/packages/upselling/pages/attack_discovery/index.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/index.test.tsx b/x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/index.test.tsx rename to x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/index.test.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/index.tsx b/x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/index.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/index.tsx rename to x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/index.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/translations.ts b/x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/translations.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/attack_discovery/page_title/translations.ts rename to x-pack/solutions/security/packages/upselling/pages/attack_discovery/page_title/translations.ts diff --git a/x-pack/packages/security-solution/upselling/pages/entity_analytics.test.tsx b/x-pack/solutions/security/packages/upselling/pages/entity_analytics.test.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/entity_analytics.test.tsx rename to x-pack/solutions/security/packages/upselling/pages/entity_analytics.test.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/entity_analytics.tsx b/x-pack/solutions/security/packages/upselling/pages/entity_analytics.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/entity_analytics.tsx rename to x-pack/solutions/security/packages/upselling/pages/entity_analytics.tsx diff --git a/x-pack/packages/security-solution/upselling/pages/translations.ts b/x-pack/solutions/security/packages/upselling/pages/translations.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/pages/translations.ts rename to x-pack/solutions/security/packages/upselling/pages/translations.ts diff --git a/x-pack/packages/security-solution/upselling/sections/attack_discovery/assistant_avatar/assistant_avatar.tsx b/x-pack/solutions/security/packages/upselling/sections/attack_discovery/assistant_avatar/assistant_avatar.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/sections/attack_discovery/assistant_avatar/assistant_avatar.tsx rename to x-pack/solutions/security/packages/upselling/sections/attack_discovery/assistant_avatar/assistant_avatar.tsx diff --git a/x-pack/packages/security-solution/upselling/sections/attack_discovery/index.test.tsx b/x-pack/solutions/security/packages/upselling/sections/attack_discovery/index.test.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/sections/attack_discovery/index.test.tsx rename to x-pack/solutions/security/packages/upselling/sections/attack_discovery/index.test.tsx diff --git a/x-pack/packages/security-solution/upselling/sections/attack_discovery/index.tsx b/x-pack/solutions/security/packages/upselling/sections/attack_discovery/index.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/sections/attack_discovery/index.tsx rename to x-pack/solutions/security/packages/upselling/sections/attack_discovery/index.tsx diff --git a/x-pack/packages/security-solution/upselling/sections/attack_discovery/translations.ts b/x-pack/solutions/security/packages/upselling/sections/attack_discovery/translations.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/sections/attack_discovery/translations.ts rename to x-pack/solutions/security/packages/upselling/sections/attack_discovery/translations.ts diff --git a/x-pack/packages/security-solution/upselling/sections/entity_analytics.tsx b/x-pack/solutions/security/packages/upselling/sections/entity_analytics.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/sections/entity_analytics.tsx rename to x-pack/solutions/security/packages/upselling/sections/entity_analytics.tsx diff --git a/x-pack/packages/security-solution/upselling/service/index.ts b/x-pack/solutions/security/packages/upselling/service/index.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/service/index.ts rename to x-pack/solutions/security/packages/upselling/service/index.ts diff --git a/x-pack/packages/security-solution/upselling/service/types.ts b/x-pack/solutions/security/packages/upselling/service/types.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/service/types.ts rename to x-pack/solutions/security/packages/upselling/service/types.ts diff --git a/x-pack/packages/security-solution/upselling/service/upselling_service.test.tsx b/x-pack/solutions/security/packages/upselling/service/upselling_service.test.tsx similarity index 100% rename from x-pack/packages/security-solution/upselling/service/upselling_service.test.tsx rename to x-pack/solutions/security/packages/upselling/service/upselling_service.test.tsx diff --git a/x-pack/packages/security-solution/upselling/service/upselling_service.ts b/x-pack/solutions/security/packages/upselling/service/upselling_service.ts similarity index 100% rename from x-pack/packages/security-solution/upselling/service/upselling_service.ts rename to x-pack/solutions/security/packages/upselling/service/upselling_service.ts diff --git a/x-pack/solutions/security/packages/upselling/tsconfig.json b/x-pack/solutions/security/packages/upselling/tsconfig.json new file mode 100644 index 000000000000..653738495ed8 --- /dev/null +++ b/x-pack/solutions/security/packages/upselling/tsconfig.json @@ -0,0 +1,27 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types", + "types": [ + "jest", + "node", + "react", + "@emotion/react/types/css-prop", + "@testing-library/jest-dom", + "@testing-library/react", + "@kbn/ambient-ui-types" + ] + }, + "include": [ + "**/*.ts", + "**/*.tsx" + ], + "kbn_references": [ + "@kbn/i18n", + "@kbn/security-solution-navigation", + "@kbn/shared-ux-page-kibana-template", + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/x-pack/solutions/security/plugins/threat_intelligence/.storybook/main.js b/x-pack/solutions/security/plugins/threat_intelligence/.storybook/main.js new file mode 100644 index 000000000000..86b48c32f103 --- /dev/null +++ b/x-pack/solutions/security/plugins/threat_intelligence/.storybook/main.js @@ -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. + */ + +module.exports = require('@kbn/storybook').defaultConfig; diff --git a/x-pack/plugins/threat_intelligence/CONTRIBUTING.md b/x-pack/solutions/security/plugins/threat_intelligence/CONTRIBUTING.md similarity index 98% rename from x-pack/plugins/threat_intelligence/CONTRIBUTING.md rename to x-pack/solutions/security/plugins/threat_intelligence/CONTRIBUTING.md index e7408742371e..ae7357bef4d0 100644 --- a/x-pack/plugins/threat_intelligence/CONTRIBUTING.md +++ b/x-pack/solutions/security/plugins/threat_intelligence/CONTRIBUTING.md @@ -127,7 +127,7 @@ If changes are made to how developers build, test, interact with, or release cod **Unit tests:** -`npm run test:jest --config ./x-pack/plugins/threat_intelligence` +`npm run test:jest --config ./x-pack/solutions/security/plugins/threat_intelligence` **E2E tests:** diff --git a/x-pack/solutions/security/plugins/threat_intelligence/README.md b/x-pack/solutions/security/plugins/threat_intelligence/README.md new file mode 100755 index 000000000000..033b065dcdd2 --- /dev/null +++ b/x-pack/solutions/security/plugins/threat_intelligence/README.md @@ -0,0 +1,91 @@ +# Threat Intelligence + +Elastic Threat Intelligence makes it easy to analyze and investigate potential security threats by aggregating data from multiple sources in one place. You’ll be able to view data from all activated threat intelligence feeds and take action. + +### Where to find the UI for this plugin? + +The Threat Intelligence UI is displayed in Kibana Security, under the Explore section. + +## Development setup + +### Kibana development in general + +Best source - [internal Kibana docs](https://docs.elastic.dev/kibana-dev-docs/getting-started/welcome). If you have any issues with setting up your Kibana dev environment [#kibana](https://elastic.slack.com/archives/C0D8P2XK5) Slack channel is a good way to get help. + +### Essential `kibana.yml` settings + +You can make a copy of `kibana.yml` file into `kibana.dev.yml` and make adjustments to the settings. External documentation on the flags available is [here](https://www.elastic.co/guide/en/kibana/current/settings.html) + +It is recommended to set `server.basePath: "/kbn"` to make you local instance persist the base Kibana path. If you don't do it, the base path will be a random string every time you start Kibana. Any other value than `/kbn` will also work. + +### Getting Threat Intelligence feeds data into Kibana + +There are many ways to get data for you local development. We first focus on getting Threat Intelligence data specifically. + +### Setting up filebeat threatintel integrations locally + +1. install [mage](https://github.com/magefile/mage). It is a Go build tool used to build `beats`. Installation from the sources requires Go lang set up. A simpler option might be to install it from a package manager available in your system (eg. `brew` on MacOs) or use their [binary distribution](https://github.com/magefile/mage/releases) +1. start Elasticsearch and Kibana +1. clone [beats](https://github.com/elastic/beats) repository +1. inside beats repository, update `x-pack/filebeat/filebeat.yml` with your local Elasticsearch and Kibana connection configs + + ``` + output.elasticsearch: + hosts: ["localhost:9200"] + username: "elastic" + password: "changeme" + + setup.kibana: + host: "localhost:5601" // make sure to run Kibana with --no-base-path option or specify server.basePath in Kibana config and use it here as a path, eg. localhost:5601/kbn + ``` + +1. go into `x-pack/filebeat` (that's where security related modules live) +1. build filebeat `mage build` +1. enable `threatintel` module by running `./filebeat modules enable threatintel` +1. enable specific Threat Intelligence integrations by updating `modules.d/threatintel.yml`. Update `enable` to `true` in every integration you want to enable and configs specific for these integrations. The bare minimum is to enable Abuse.CH feeds `abuseurl`, `abusemalware` and `malwarebazaar`. +1. run `./filebeat setup -E setup.dashboards.directory=build/kibana` to set up predefined dashboards +1. run `./filebeat -e` to start filebeat +1. to validate that the set up works, wait for some Threat Intel data to be ingested and then go in Analytics > Discover in your local Kibana to search `event.category : threat and event.type : indicator`. You should see some documents returned by this search. Abuse.CH feeds are up to date so you should see the results from the last 7 days. + +### More ways to get data + +There are many more tools available for getting the data for testing or local development, depending on the data type and usecase. + +- Kibana development docs > [Add data](https://docs.elastic.dev/kibana-dev-docs/getting-started/sample-data) +- [Dev/Design/Testing Environments and Frameworks](https://docs.google.com/document/d/1DGCcLMnVKQ_STlkbS4E0m4kbPivNtR8iMlg_IoCuCEw/edit#) gathered by Security Engineering Productivity team + +### Generate fixtures for local testing + +You can generate large volumes of threat indicators on demand with the following script: + +``` +node scripts/generate_indicators.js +``` + +see the file in order to adjust the amount of indicators generated. The default is one million. + +## E2E + +### Running locally + +Cypress tests are integrated with the Security Solution ones. Please refer to https://github.com/elastic/kibana/blob/main/x-pack/test/security_solution_cypress/cypress/README.md for more information + +## FAQ + +### How is the Threat Intelligence code loaded in Kibana? + +The Threat Intelligence plugin is loaded lazily within the [security_solution](https://github.com/elastic/kibana/tree/main/x-pack/plugins/security_solution) plugin, +from `x-pack/plugins/security_solution/public/threat_intelligence` owned by the Threat Hunting Investigations Team. + +## QA and demo for implemented features + +One way to QA and demo the feature merged into `main` branch is to run the latest `main` locally. +Another option is to deploy a Staging instance. For Staging environment snapshots are being build every night with the latest state of the `main` branch. More documentation can be found [here](https://cloud.elastic.dev/environments/Staging/#automatic-termination-of-staging-deployments) + +## Contributing + +See [CONTRIBUTING.md](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/threat_intelligence/CONTRIBUTING.md) for information on contributing. + +## Issues + +Please report any issues in [this GitHub project](https://github.com/orgs/elastic/projects/758/). \ No newline at end of file diff --git a/x-pack/plugins/threat_intelligence/common/constants.ts b/x-pack/solutions/security/plugins/threat_intelligence/common/constants.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/common/constants.ts rename to x-pack/solutions/security/plugins/threat_intelligence/common/constants.ts diff --git a/x-pack/plugins/threat_intelligence/common/types/indicator.ts b/x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/common/types/indicator.ts rename to x-pack/solutions/security/plugins/threat_intelligence/common/types/indicator.ts diff --git a/x-pack/solutions/security/plugins/threat_intelligence/jest.config.js b/x-pack/solutions/security/plugins/threat_intelligence/jest.config.js new file mode 100644 index 000000000000..9524dca68399 --- /dev/null +++ b/x-pack/solutions/security/plugins/threat_intelligence/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/solutions/security/plugins/threat_intelligence'], +}; diff --git a/x-pack/plugins/threat_intelligence/kibana.jsonc b/x-pack/solutions/security/plugins/threat_intelligence/kibana.jsonc similarity index 100% rename from x-pack/plugins/threat_intelligence/kibana.jsonc rename to x-pack/solutions/security/plugins/threat_intelligence/kibana.jsonc diff --git a/x-pack/plugins/threat_intelligence/package.json b/x-pack/solutions/security/plugins/threat_intelligence/package.json similarity index 100% rename from x-pack/plugins/threat_intelligence/package.json rename to x-pack/solutions/security/plugins/threat_intelligence/package.json diff --git a/x-pack/plugins/threat_intelligence/public/components/date_formatter.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/date_formatter.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/date_formatter.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/date_formatter.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/date_formatter.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/date_formatter.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/date_formatter.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/empty_state.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/empty_state.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/empty_state.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/empty_state.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/empty_state.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/empty_state.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/empty_state.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/empty_state.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/layout.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/layout.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/layout.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/layout.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/layout.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/layout.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/layout.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/no_results.svg b/x-pack/solutions/security/plugins/threat_intelligence/public/components/no_results.svg similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/no_results.svg rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/no_results.svg diff --git a/x-pack/plugins/threat_intelligence/public/components/paywall.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/paywall.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/paywall.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/paywall.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/paywall.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/paywall.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/paywall.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/paywall.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/components/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/components/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/components/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/components/update_status.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/update_status.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/update_status.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/update_status.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/components/update_status.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/components/update_status.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/components/update_status.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/components/update_status.tsx diff --git a/x-pack/plugins/threat_intelligence/public/constants/common.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/constants/common.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/constants/common.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/constants/common.ts diff --git a/x-pack/plugins/threat_intelligence/public/constants/navigation.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/constants/navigation.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/constants/navigation.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/constants/navigation.ts diff --git a/x-pack/plugins/threat_intelligence/public/constants/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/constants/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/constants/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/constants/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/enterprise_guard.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/enterprise_guard.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/enterprise_guard.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/enterprise_guard.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/enterprise_guard.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/enterprise_guard.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/enterprise_guard.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/field_types_provider.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/field_types_provider.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/field_types_provider.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/field_types_provider.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/filters_global.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/filters_global.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/filters_global.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/filters_global.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/indicators_page_wrapper.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/inspector.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/inspector.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/inspector.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/inspector.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/integrations_guard.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/integrations_guard.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/integrations_guard.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/integrations_guard.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/integrations_guard.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/integrations_guard.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/integrations_guard.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_context.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/security_solution_context.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_context.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_page_wrapper.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_page_wrapper.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/security_solution_page_wrapper.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_page_wrapper.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/security_solution_plugin_template_wrapper.tsx diff --git a/x-pack/plugins/threat_intelligence/public/containers/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/containers/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/containers/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/containers/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_documentation_link.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_documentation_link.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_documentation_link.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_documentation_link.tsx diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_field_types.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_field_types.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_field_types.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_field_types.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_inspector.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_inspector.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_inspector.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_inspector.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_integrations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_integrations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_integrations_page_link.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations_page_link.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_integrations_page_link.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_integrations_page_link.tsx diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_kibana.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_kibana.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_kibana.ts diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_kibana_ui_settings.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_kibana_ui_settings.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_kibana_ui_settings.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_kibana_ui_settings.tsx diff --git a/x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_security_context.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/hooks/use_security_context.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/hooks/use_security_context.ts diff --git a/x-pack/plugins/threat_intelligence/public/index.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/index.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/index.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/index.ts diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_field_type_map.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_field_type_map.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_field_type_map.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_field_type_map.ts diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_indicators_filters_context.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_indicators_filters_context.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_indicators_filters_context.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_indicators_filters_context.tsx diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_timelines_service.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_timelines_service.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_timelines_service.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_timelines_service.tsx diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_triggers_actions_ui_service.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_triggers_actions_ui_service.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_triggers_actions_ui_service.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_triggers_actions_ui_service.tsx diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_ui_settings_service.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_ui_settings_service.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_kibana_ui_settings_service.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_kibana_ui_settings_service.ts diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_security_context.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_security_context.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_security_context.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_security_context.tsx diff --git a/x-pack/plugins/threat_intelligence/public/mocks/mock_use_kibana_for_filters.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_use_kibana_for_filters.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/mock_use_kibana_for_filters.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/mock_use_kibana_for_filters.ts diff --git a/x-pack/plugins/threat_intelligence/public/mocks/story_providers.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/story_providers.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/story_providers.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/story_providers.tsx diff --git a/x-pack/plugins/threat_intelligence/public/mocks/test_providers.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/mocks/test_providers.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/mocks/test_providers.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/mocks/test_providers.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/components/add_to_block_list.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/flyout.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/containers/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/containers/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/containers/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_policies.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_set_url_params.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_set_url_params.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/hooks/use_set_url_params.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/hooks/use_set_url_params.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/block_list/utils/can_add_to_block_list.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_existing_case.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/add_to_new_case.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/attachment_children.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/attachment_children.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/attachment_children.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/attachment_children.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/comment_children.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/comment_children.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/styles.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/styles.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/styles.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/styles.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/components/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/components/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/components/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_case_permission.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/hooks/use_indicator_by_id.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/services/fetch_indicator_by_id.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/utils/attachments.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/utils/attachments.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/utils/attachments.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/utils/attachments.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/cases/utils/attachments.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/utils/attachments.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/cases/utils/attachments.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/cases/utils/attachments.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/empty_page/empty_page.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/empty_page.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/empty_page/integrations_light.svg b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/integrations_light.svg similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/empty_page/integrations_light.svg rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/integrations_light.svg diff --git a/x-pack/plugins/threat_intelligence/public/modules/empty_page/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/empty_page/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/empty_page/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/barchart.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/field_selector.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/legend_action.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/styles.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/styles.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/styles.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/styles.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/barchart/wrapper.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/copy_to_clipboard.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_label.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_label.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_label.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_label.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/field_value.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/tlp_badge.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/common/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/common/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/block.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/empty_prompt.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/fields_table.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/flyout.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/highlighted_values_table.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/highlighted_values_table.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/highlighted_values_table.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/highlighted_values_table.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/indicator_value_actions.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/json_tab.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/overview_tab.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/table_tab.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/take_action.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/flyout/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/flyout/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/actions_row_cell.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/actions_row_cell.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/actions_row_cell.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/actions_row_cell.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_actions.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_actions.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_actions.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_actions.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_popover_renderer.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_popover_renderer.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_popover_renderer.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_popover_renderer.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_renderer.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_renderer.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/cell_renderer.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/cell_renderer.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/field_browser.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/more_actions.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/open_flyout_button.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/styles.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/styles.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/styles.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/styles.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/table.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/components/table/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/components/table/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/containers/block_list_provider.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/containers/block_list_provider.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/containers/block_list_provider.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/containers/block_list_provider.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/containers/filters.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/containers/filters.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/containers/filters.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/containers/filters.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/test_ids.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/test_ids.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/test_ids.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/test_ids.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_aggregated_indicators.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_block_list_context.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_block_list_context.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_block_list_context.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_block_list_context.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_column_settings.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_filters_context.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_filters_context.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_filters_context.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_filters_context.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_flyout_context.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_flyout_context.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_flyout_context.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_flyout_context.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_indicators.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_sourcerer_data_view.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_table_context.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_table_context.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_table_context.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_table_context.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_toolbar_options.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/hooks/use_total_count.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/pages/indicators.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/pages/indicators.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/pages/indicators.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_aggregated_indicators.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/services/fetch_indicators.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/field_value.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/field_value.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_field_schema.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/get_field_schema.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_field_schema.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/get_field_schema.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/get_indicator_query_params.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/indicators/utils/unwrap_value.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_in.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/filter_out.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/query_bar.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/query_bar.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/query_bar.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/query_bar.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/components/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/components/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/components/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filter_in_out.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filters.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filters.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filters.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/hooks/use_filters.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/utils/filter.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/utils/filter.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/utils/filter.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/utils/filter.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/query_bar/utils/filter.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/utils/filter.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/query_bar/utils/filter.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/query_bar/utils/filter.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/add_to_timeline.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.stories.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.stories.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.stories.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.stories.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/investigate_in_timeline.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/styles.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/styles.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/styles.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/styles.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/components/translations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/translations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/components/translations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/components/translations.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_add_to_timeline.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.test.tsx diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/hooks/use_investigate_in_timeline.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/modules/timeline/utils/data_provider.ts diff --git a/x-pack/plugins/threat_intelligence/public/plugin.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/plugin.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/plugin.tsx diff --git a/x-pack/plugins/threat_intelligence/public/types.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/types.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/types.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/types.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/dates.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/dates.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/dates.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/dates.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/dates.tsx b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/dates.tsx similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/dates.tsx rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/dates.tsx diff --git a/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/filter_integrations.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/filter_integrations.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/filter_integrations.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/filter_integrations.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/filter_integrations.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/filter_integrations.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/filter_integrations.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/search.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/search.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/search.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/search.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/security_solution_links.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/security_solution_links.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.test.ts diff --git a/x-pack/plugins/threat_intelligence/public/utils/security_solution_links.ts b/x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/public/utils/security_solution_links.ts rename to x-pack/solutions/security/plugins/threat_intelligence/public/utils/security_solution_links.ts diff --git a/x-pack/plugins/threat_intelligence/scripts/generate_indicators.js b/x-pack/solutions/security/plugins/threat_intelligence/scripts/generate_indicators.js similarity index 100% rename from x-pack/plugins/threat_intelligence/scripts/generate_indicators.js rename to x-pack/solutions/security/plugins/threat_intelligence/scripts/generate_indicators.js diff --git a/x-pack/plugins/threat_intelligence/server/index.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/index.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/index.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/index.ts diff --git a/x-pack/plugins/threat_intelligence/server/plugin.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/plugin.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/plugin.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/plugin.ts diff --git a/x-pack/plugins/threat_intelligence/server/search_strategy.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/search_strategy.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/search_strategy.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/search_strategy.ts diff --git a/x-pack/plugins/threat_intelligence/server/types.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/types.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/types.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/types.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.test.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/calculate_barchart_time_interval.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/get_indicator_query_params.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/get_runtime_mappings.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/indicator_name.test.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/indicator_name.test.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/indicator_name.test.ts diff --git a/x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts b/x-pack/solutions/security/plugins/threat_intelligence/server/utils/indicator_name.ts similarity index 100% rename from x-pack/plugins/threat_intelligence/server/utils/indicator_name.ts rename to x-pack/solutions/security/plugins/threat_intelligence/server/utils/indicator_name.ts diff --git a/x-pack/solutions/security/plugins/threat_intelligence/tsconfig.json b/x-pack/solutions/security/plugins/threat_intelligence/tsconfig.json new file mode 100644 index 000000000000..ffac934023eb --- /dev/null +++ b/x-pack/solutions/security/plugins/threat_intelligence/tsconfig.json @@ -0,0 +1,39 @@ +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + "scripts/**/*", + "public/**/*.json", + "server/**/*.json", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/cases-plugin", + "@kbn/timelines-plugin", + "@kbn/core", + "@kbn/data-plugin", + "@kbn/unified-search-plugin", + "@kbn/triggers-actions-ui-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/i18n-react", + "@kbn/data-views-plugin", + "@kbn/es-query", + "@kbn/rule-registry-plugin", + "@kbn/inspector-plugin", + "@kbn/shared-ux-page-kibana-template-types", + "@kbn/doc-links", + "@kbn/i18n", + "@kbn/kibana-react-plugin", + "@kbn/utility-types", + "@kbn/ui-theme", + "@kbn/securitysolution-io-ts-list-types", + "@kbn/core-ui-settings-browser", + "@kbn/search-types" + ], + "exclude": ["target/**/*"] +} diff --git a/x-pack/plugins/timelines/README.md b/x-pack/solutions/security/plugins/timelines/README.md similarity index 100% rename from x-pack/plugins/timelines/README.md rename to x-pack/solutions/security/plugins/timelines/README.md diff --git a/x-pack/plugins/timelines/common/api/search_strategy/index.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/index.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/index.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/index_fields.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/index_fields.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/index_fields.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/index_fields.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/filter_query.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/filter_query.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/filter_query.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/filter_query.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/language.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/language.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/language.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/language.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/order.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/order.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/order.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/order.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/pagination.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/pagination.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/pagination.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/pagination.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/runtime_mappings.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/runtime_mappings.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/runtime_mappings.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/runtime_mappings.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/sort.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/sort.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/sort.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/sort.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/timeline_events_queries.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/model/timerange.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/timerange.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/model/timerange.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/model/timerange.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/eql.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/eql.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/eql.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/eql.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/eql.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/eql.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/eql.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/eql.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_all.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_all.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_all.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_all.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_all.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_all.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_all.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_all.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_details.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_details.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_details.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_details.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_details.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_details.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_details.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_details.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/events_last_event_time.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/kpi.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/kpi.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/kpi.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/kpi.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/kpi.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/kpi.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/kpi.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/kpi.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/mocks/base_timeline_request.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/mocks/base_timeline_request.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/mocks/base_timeline_request.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/mocks/base_timeline_request.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/request_basic.test.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_basic.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/request_basic.test.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_basic.test.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/request_basic.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_basic.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/request_basic.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_basic.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/request_paginated.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_paginated.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/request_paginated.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/request_paginated.ts diff --git a/x-pack/plugins/timelines/common/api/search_strategy/timeline/timeline.ts b/x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/timeline.ts similarity index 100% rename from x-pack/plugins/timelines/common/api/search_strategy/timeline/timeline.ts rename to x-pack/solutions/security/plugins/timelines/common/api/search_strategy/timeline/timeline.ts diff --git a/x-pack/plugins/timelines/common/constants.ts b/x-pack/solutions/security/plugins/timelines/common/constants.ts similarity index 100% rename from x-pack/plugins/timelines/common/constants.ts rename to x-pack/solutions/security/plugins/timelines/common/constants.ts diff --git a/x-pack/plugins/timelines/common/experimental_features.ts b/x-pack/solutions/security/plugins/timelines/common/experimental_features.ts similarity index 100% rename from x-pack/plugins/timelines/common/experimental_features.ts rename to x-pack/solutions/security/plugins/timelines/common/experimental_features.ts diff --git a/x-pack/plugins/timelines/common/index.ts b/x-pack/solutions/security/plugins/timelines/common/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/index.ts rename to x-pack/solutions/security/plugins/timelines/common/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/common/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/common/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/common/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/eql/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/eql/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.mock.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.mock.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.mock.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.mock.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.test.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.test.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.test.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/eql/validation/helpers.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/helpers.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/eql/validation/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/eql/validation/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/eql/validation/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/index_fields/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/index_fields/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/events/all/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/all/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/events/details/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/details/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/eql/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/events/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/events/last_event_time/index.ts diff --git a/x-pack/plugins/timelines/common/search_strategy/timeline/index.ts b/x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/search_strategy/timeline/index.ts rename to x-pack/solutions/security/plugins/timelines/common/search_strategy/timeline/index.ts diff --git a/x-pack/plugins/timelines/common/typed_json.ts b/x-pack/solutions/security/plugins/timelines/common/typed_json.ts similarity index 100% rename from x-pack/plugins/timelines/common/typed_json.ts rename to x-pack/solutions/security/plugins/timelines/common/typed_json.ts diff --git a/x-pack/plugins/timelines/common/types/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/index.ts diff --git a/x-pack/plugins/timelines/common/types/timeline/actions/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/actions/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/timeline/actions/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/timeline/actions/index.ts diff --git a/x-pack/plugins/timelines/common/types/timeline/cells/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/timeline/cells/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/timeline/cells/index.ts diff --git a/x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/timeline/data_provider/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/timeline/data_provider/index.ts diff --git a/x-pack/plugins/timelines/common/types/timeline/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/timeline/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/timeline/index.ts diff --git a/x-pack/plugins/timelines/common/types/timeline/rows/index.ts b/x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/types/timeline/rows/index.ts rename to x-pack/solutions/security/plugins/timelines/common/types/timeline/rows/index.ts diff --git a/x-pack/plugins/timelines/common/utility_types.ts b/x-pack/solutions/security/plugins/timelines/common/utility_types.ts similarity index 100% rename from x-pack/plugins/timelines/common/utility_types.ts rename to x-pack/solutions/security/plugins/timelines/common/utility_types.ts diff --git a/x-pack/plugins/timelines/common/utils/accessibility/helpers.test.tsx b/x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.test.tsx similarity index 100% rename from x-pack/plugins/timelines/common/utils/accessibility/helpers.test.tsx rename to x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.test.tsx diff --git a/x-pack/plugins/timelines/common/utils/accessibility/helpers.ts b/x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/accessibility/helpers.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/accessibility/helpers.ts diff --git a/x-pack/plugins/timelines/common/utils/accessibility/index.ts b/x-pack/solutions/security/plugins/timelines/common/utils/accessibility/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/accessibility/index.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/accessibility/index.ts diff --git a/x-pack/plugins/timelines/common/utils/api.ts b/x-pack/solutions/security/plugins/timelines/common/utils/api.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/api.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/api.ts diff --git a/x-pack/plugins/timelines/common/utils/field_formatters.test.ts b/x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.test.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/field_formatters.test.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.test.ts diff --git a/x-pack/plugins/timelines/common/utils/field_formatters.ts b/x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/field_formatters.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/field_formatters.ts diff --git a/x-pack/plugins/timelines/common/utils/index.ts b/x-pack/solutions/security/plugins/timelines/common/utils/index.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/index.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/index.ts diff --git a/x-pack/plugins/timelines/common/utils/to_array.ts b/x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts similarity index 100% rename from x-pack/plugins/timelines/common/utils/to_array.ts rename to x-pack/solutions/security/plugins/timelines/common/utils/to_array.ts diff --git a/x-pack/solutions/security/plugins/timelines/jest.config.js b/x-pack/solutions/security/plugins/timelines/jest.config.js new file mode 100644 index 000000000000..5ce00c1a0a30 --- /dev/null +++ b/x-pack/solutions/security/plugins/timelines/jest.config.js @@ -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. + */ + +module.exports = { + preset: '@kbn/test', + rootDir: '../../../../..', + roots: ['/x-pack/solutions/security/plugins/timelines'], + coverageDirectory: + '/target/kibana-coverage/jest/x-pack/solutions/security/plugins/timelines', + coverageReporters: ['text', 'html'], + collectCoverageFrom: [ + '/x-pack/solutions/security/plugins/timelines/{common,public,server}/**/*.{ts,tsx}', + ], +}; diff --git a/x-pack/plugins/timelines/kibana.jsonc b/x-pack/solutions/security/plugins/timelines/kibana.jsonc similarity index 100% rename from x-pack/plugins/timelines/kibana.jsonc rename to x-pack/solutions/security/plugins/timelines/kibana.jsonc diff --git a/x-pack/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg b/x-pack/solutions/security/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg similarity index 100% rename from x-pack/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg rename to x-pack/solutions/security/plugins/timelines/public/assets/illustration_product_no_results_magnifying_glass.svg diff --git a/x-pack/plugins/timelines/public/components/clipboard/clipboard.tsx b/x-pack/solutions/security/plugins/timelines/public/components/clipboard/clipboard.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/clipboard/clipboard.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/clipboard/clipboard.tsx diff --git a/x-pack/plugins/timelines/public/components/clipboard/translations.ts b/x-pack/solutions/security/plugins/timelines/public/components/clipboard/translations.ts similarity index 100% rename from x-pack/plugins/timelines/public/components/clipboard/translations.ts rename to x-pack/solutions/security/plugins/timelines/public/components/clipboard/translations.ts diff --git a/x-pack/plugins/timelines/public/components/clipboard/with_copy_to_clipboard.tsx b/x-pack/solutions/security/plugins/timelines/public/components/clipboard/with_copy_to_clipboard.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/clipboard/with_copy_to_clipboard.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/clipboard/with_copy_to_clipboard.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.test.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.test.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.test.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.test.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/add_to_timeline.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/column_toggle.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/column_toggle.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/column_toggle.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/column_toggle.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/copy.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/copy.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/copy.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/copy.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/filter_for_value.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/filter_for_value.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/filter_for_value.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/filter_for_value.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/filter_out_value.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/filter_out_value.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/filter_out_value.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/filter_out_value.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/overflow.test.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/overflow.test.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/overflow.test.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/overflow.test.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/overflow.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/overflow.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/overflow.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/overflow.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/translations.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/translations.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/translations.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/translations.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/actions/types.ts b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/types.ts similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/actions/types.ts rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/actions/types.ts diff --git a/x-pack/plugins/timelines/public/components/hover_actions/index.tsx b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/index.tsx diff --git a/x-pack/plugins/timelines/public/components/hover_actions/utils.ts b/x-pack/solutions/security/plugins/timelines/public/components/hover_actions/utils.ts similarity index 100% rename from x-pack/plugins/timelines/public/components/hover_actions/utils.ts rename to x-pack/solutions/security/plugins/timelines/public/components/hover_actions/utils.ts diff --git a/x-pack/plugins/timelines/public/components/index.tsx b/x-pack/solutions/security/plugins/timelines/public/components/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/index.tsx diff --git a/x-pack/plugins/timelines/public/components/last_updated/index.test.tsx b/x-pack/solutions/security/plugins/timelines/public/components/last_updated/index.test.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/last_updated/index.test.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/last_updated/index.test.tsx diff --git a/x-pack/plugins/timelines/public/components/last_updated/index.tsx b/x-pack/solutions/security/plugins/timelines/public/components/last_updated/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/last_updated/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/last_updated/index.tsx diff --git a/x-pack/plugins/timelines/public/components/last_updated/translations.ts b/x-pack/solutions/security/plugins/timelines/public/components/last_updated/translations.ts similarity index 100% rename from x-pack/plugins/timelines/public/components/last_updated/translations.ts rename to x-pack/solutions/security/plugins/timelines/public/components/last_updated/translations.ts diff --git a/x-pack/plugins/timelines/public/components/loading/index.tsx b/x-pack/solutions/security/plugins/timelines/public/components/loading/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/loading/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/loading/index.tsx diff --git a/x-pack/plugins/timelines/public/components/tooltip_with_keyboard_shortcut/index.tsx b/x-pack/solutions/security/plugins/timelines/public/components/tooltip_with_keyboard_shortcut/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/components/tooltip_with_keyboard_shortcut/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/components/tooltip_with_keyboard_shortcut/index.tsx diff --git a/x-pack/plugins/timelines/public/hooks/use_add_to_timeline.ts b/x-pack/solutions/security/plugins/timelines/public/hooks/use_add_to_timeline.ts similarity index 100% rename from x-pack/plugins/timelines/public/hooks/use_add_to_timeline.ts rename to x-pack/solutions/security/plugins/timelines/public/hooks/use_add_to_timeline.ts diff --git a/x-pack/plugins/timelines/public/hooks/use_app_toasts.ts b/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts similarity index 100% rename from x-pack/plugins/timelines/public/hooks/use_app_toasts.ts rename to x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts diff --git a/x-pack/plugins/timelines/public/hooks/use_selector.tsx b/x-pack/solutions/security/plugins/timelines/public/hooks/use_selector.tsx similarity index 100% rename from x-pack/plugins/timelines/public/hooks/use_selector.tsx rename to x-pack/solutions/security/plugins/timelines/public/hooks/use_selector.tsx diff --git a/x-pack/plugins/timelines/public/index.ts b/x-pack/solutions/security/plugins/timelines/public/index.ts similarity index 100% rename from x-pack/plugins/timelines/public/index.ts rename to x-pack/solutions/security/plugins/timelines/public/index.ts diff --git a/x-pack/plugins/timelines/public/methods/index.tsx b/x-pack/solutions/security/plugins/timelines/public/methods/index.tsx similarity index 100% rename from x-pack/plugins/timelines/public/methods/index.tsx rename to x-pack/solutions/security/plugins/timelines/public/methods/index.tsx diff --git a/x-pack/plugins/timelines/public/mock/browser_fields.ts b/x-pack/solutions/security/plugins/timelines/public/mock/browser_fields.ts similarity index 100% rename from x-pack/plugins/timelines/public/mock/browser_fields.ts rename to x-pack/solutions/security/plugins/timelines/public/mock/browser_fields.ts diff --git a/x-pack/plugins/timelines/public/mock/index.ts b/x-pack/solutions/security/plugins/timelines/public/mock/index.ts similarity index 100% rename from x-pack/plugins/timelines/public/mock/index.ts rename to x-pack/solutions/security/plugins/timelines/public/mock/index.ts diff --git a/x-pack/plugins/timelines/public/mock/index_pattern.ts b/x-pack/solutions/security/plugins/timelines/public/mock/index_pattern.ts similarity index 100% rename from x-pack/plugins/timelines/public/mock/index_pattern.ts rename to x-pack/solutions/security/plugins/timelines/public/mock/index_pattern.ts diff --git a/x-pack/plugins/timelines/public/mock/kibana_react.mock.ts b/x-pack/solutions/security/plugins/timelines/public/mock/kibana_react.mock.ts similarity index 100% rename from x-pack/plugins/timelines/public/mock/kibana_react.mock.ts rename to x-pack/solutions/security/plugins/timelines/public/mock/kibana_react.mock.ts diff --git a/x-pack/plugins/timelines/public/mock/mock_and_providers.tsx b/x-pack/solutions/security/plugins/timelines/public/mock/mock_and_providers.tsx similarity index 100% rename from x-pack/plugins/timelines/public/mock/mock_and_providers.tsx rename to x-pack/solutions/security/plugins/timelines/public/mock/mock_and_providers.tsx diff --git a/x-pack/plugins/timelines/public/mock/mock_data_providers.tsx b/x-pack/solutions/security/plugins/timelines/public/mock/mock_data_providers.tsx similarity index 100% rename from x-pack/plugins/timelines/public/mock/mock_data_providers.tsx rename to x-pack/solutions/security/plugins/timelines/public/mock/mock_data_providers.tsx diff --git a/x-pack/plugins/timelines/public/mock/mock_hover_actions.tsx b/x-pack/solutions/security/plugins/timelines/public/mock/mock_hover_actions.tsx similarity index 100% rename from x-pack/plugins/timelines/public/mock/mock_hover_actions.tsx rename to x-pack/solutions/security/plugins/timelines/public/mock/mock_hover_actions.tsx diff --git a/x-pack/plugins/timelines/public/mock/mock_local_storage.ts b/x-pack/solutions/security/plugins/timelines/public/mock/mock_local_storage.ts similarity index 100% rename from x-pack/plugins/timelines/public/mock/mock_local_storage.ts rename to x-pack/solutions/security/plugins/timelines/public/mock/mock_local_storage.ts diff --git a/x-pack/plugins/timelines/public/mock/plugin_mock.tsx b/x-pack/solutions/security/plugins/timelines/public/mock/plugin_mock.tsx similarity index 100% rename from x-pack/plugins/timelines/public/mock/plugin_mock.tsx rename to x-pack/solutions/security/plugins/timelines/public/mock/plugin_mock.tsx diff --git a/x-pack/plugins/timelines/public/mock/test_providers.tsx b/x-pack/solutions/security/plugins/timelines/public/mock/test_providers.tsx similarity index 100% rename from x-pack/plugins/timelines/public/mock/test_providers.tsx rename to x-pack/solutions/security/plugins/timelines/public/mock/test_providers.tsx diff --git a/x-pack/plugins/timelines/public/plugin.ts b/x-pack/solutions/security/plugins/timelines/public/plugin.ts similarity index 100% rename from x-pack/plugins/timelines/public/plugin.ts rename to x-pack/solutions/security/plugins/timelines/public/plugin.ts diff --git a/x-pack/plugins/timelines/public/store/timeline/actions.ts b/x-pack/solutions/security/plugins/timelines/public/store/timeline/actions.ts similarity index 100% rename from x-pack/plugins/timelines/public/store/timeline/actions.ts rename to x-pack/solutions/security/plugins/timelines/public/store/timeline/actions.ts diff --git a/x-pack/plugins/timelines/public/store/timeline/helpers.ts b/x-pack/solutions/security/plugins/timelines/public/store/timeline/helpers.ts similarity index 100% rename from x-pack/plugins/timelines/public/store/timeline/helpers.ts rename to x-pack/solutions/security/plugins/timelines/public/store/timeline/helpers.ts diff --git a/x-pack/plugins/timelines/public/store/timeline/index.ts b/x-pack/solutions/security/plugins/timelines/public/store/timeline/index.ts similarity index 100% rename from x-pack/plugins/timelines/public/store/timeline/index.ts rename to x-pack/solutions/security/plugins/timelines/public/store/timeline/index.ts diff --git a/x-pack/plugins/timelines/public/store/timeline/reducer.ts b/x-pack/solutions/security/plugins/timelines/public/store/timeline/reducer.ts similarity index 100% rename from x-pack/plugins/timelines/public/store/timeline/reducer.ts rename to x-pack/solutions/security/plugins/timelines/public/store/timeline/reducer.ts diff --git a/x-pack/plugins/timelines/public/types.ts b/x-pack/solutions/security/plugins/timelines/public/types.ts similarity index 100% rename from x-pack/plugins/timelines/public/types.ts rename to x-pack/solutions/security/plugins/timelines/public/types.ts diff --git a/x-pack/plugins/timelines/server/config.ts b/x-pack/solutions/security/plugins/timelines/server/config.ts similarity index 100% rename from x-pack/plugins/timelines/server/config.ts rename to x-pack/solutions/security/plugins/timelines/server/config.ts diff --git a/x-pack/solutions/security/plugins/timelines/server/index.ts b/x-pack/solutions/security/plugins/timelines/server/index.ts new file mode 100644 index 000000000000..5a0f514fd804 --- /dev/null +++ b/x-pack/solutions/security/plugins/timelines/server/index.ts @@ -0,0 +1,42 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PluginConfigDescriptor, PluginInitializerContext } from '@kbn/core/server'; +import { schema } from '@kbn/config-schema'; +import { ConfigSchema } from './config'; + +export async function plugin(initializerContext: PluginInitializerContext) { + const { TimelinesPlugin } = await import('./plugin'); + return new TimelinesPlugin(initializerContext); +} + +export type { TimelinesPluginUI, TimelinesPluginStart } from './types'; + +const configSchema = schema.object({ + /** + * For internal use. A list of string values (comma delimited) that will enable experimental + * type of functionality that is not yet released. Valid values for this settings need to + * be defined in: + * `x-pack/solutions/security/plugins/timelines/common/experimental_features.ts` + * under the `allowedExperimentalValues` object + * + * @example + * xpack.timelines.enableExperimental: + * - someCrazyFeature + * - someEvenCrazierFeature + */ + enableExperimental: schema.arrayOf(schema.string(), { + defaultValue: () => [], + }), +}); + +export const config: PluginConfigDescriptor = { + exposeToBrowser: { + enableExperimental: true, + }, + schema: configSchema, +}; diff --git a/x-pack/plugins/timelines/server/plugin.ts b/x-pack/solutions/security/plugins/timelines/server/plugin.ts similarity index 100% rename from x-pack/plugins/timelines/server/plugin.ts rename to x-pack/solutions/security/plugins/timelines/server/plugin.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/index.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/index_fields/index.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/index_fields/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/mock.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/index_fields/mock.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/mock.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/index_fields/parse_options.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/parse_options.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/index_fields/parse_options.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/index_fields/parse_options.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/eql/__mocks__/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/__mocks__/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/eql/__mocks__/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/__mocks__/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/eql/helpers.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/helpers.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/eql/helpers.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/helpers.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/eql/helpers.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/helpers.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/eql/helpers.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/helpers.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/eql/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/eql/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/eql/parse_options.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/parse_options.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/eql/parse_options.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/eql/parse_options.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/helpers.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/all/query.events_all.dsl.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/details/query.events_details.dsl.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/query.kpi.dsl.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/query.kpi.dsl.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/query.kpi.dsl.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/kpi/query.kpi.dsl.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/events/last_event_time/query.events_last_event_time.dsl.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_ecs_objects.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/build_object_recursive.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/constants.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/constants.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/constants.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/constants.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.test.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.test.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.test.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.test.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_nested_parent_path.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_timestamp.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_timestamp.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_timestamp.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/get_timestamp.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/is_agg_cardinality_aggregate.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/is_agg_cardinality_aggregate.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/is_agg_cardinality_aggregate.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/helpers/is_agg_cardinality_aggregate.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/index.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/types.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/factory/types.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/factory/types.ts diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/index.ts b/x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/index.ts similarity index 100% rename from x-pack/plugins/timelines/server/search_strategy/timeline/index.ts rename to x-pack/solutions/security/plugins/timelines/server/search_strategy/timeline/index.ts diff --git a/x-pack/plugins/timelines/server/types.ts b/x-pack/solutions/security/plugins/timelines/server/types.ts similarity index 100% rename from x-pack/plugins/timelines/server/types.ts rename to x-pack/solutions/security/plugins/timelines/server/types.ts diff --git a/x-pack/plugins/timelines/server/utils/beat_schema/fields.json b/x-pack/solutions/security/plugins/timelines/server/utils/beat_schema/fields.json similarity index 100% rename from x-pack/plugins/timelines/server/utils/beat_schema/fields.json rename to x-pack/solutions/security/plugins/timelines/server/utils/beat_schema/fields.json diff --git a/x-pack/plugins/timelines/server/utils/beat_schema/fields.json.d.ts b/x-pack/solutions/security/plugins/timelines/server/utils/beat_schema/fields.json.d.ts similarity index 100% rename from x-pack/plugins/timelines/server/utils/beat_schema/fields.json.d.ts rename to x-pack/solutions/security/plugins/timelines/server/utils/beat_schema/fields.json.d.ts diff --git a/x-pack/plugins/timelines/server/utils/build_query.ts b/x-pack/solutions/security/plugins/timelines/server/utils/build_query.ts similarity index 100% rename from x-pack/plugins/timelines/server/utils/build_query.ts rename to x-pack/solutions/security/plugins/timelines/server/utils/build_query.ts diff --git a/x-pack/plugins/timelines/server/utils/filters.ts b/x-pack/solutions/security/plugins/timelines/server/utils/filters.ts similarity index 100% rename from x-pack/plugins/timelines/server/utils/filters.ts rename to x-pack/solutions/security/plugins/timelines/server/utils/filters.ts diff --git a/x-pack/solutions/security/plugins/timelines/tsconfig.json b/x-pack/solutions/security/plugins/timelines/tsconfig.json new file mode 100644 index 000000000000..fa908c501885 --- /dev/null +++ b/x-pack/solutions/security/plugins/timelines/tsconfig.json @@ -0,0 +1,47 @@ + +{ + "extends": "../../../../../tsconfig.base.json", + "compilerOptions": { + "outDir": "target/types" + }, + "include": [ + "common/**/*", + "public/**/*", + "server/**/*", + // have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636 + "server/**/*.json", + "public/**/*.json", + "../../../../../typings/**/*" + ], + "kbn_references": [ + "@kbn/core", + "@kbn/data-plugin", + "@kbn/cases-plugin", + "@kbn/alerting-plugin", + "@kbn/utility-types", + "@kbn/es-query", + "@kbn/securitysolution-ecs", + "@kbn/securitysolution-t-grid", + "@kbn/rule-data-utils", + "@kbn/rule-registry-plugin", + "@kbn/data-views-plugin", + "@kbn/kibana-react-plugin", + "@kbn/kibana-utils-plugin", + "@kbn/ui-theme", + "@kbn/i18n-react", + "@kbn/i18n", + "@kbn/security-plugin", + "@kbn/safer-lodash-set", + "@kbn/alerts-as-data-utils", + "@kbn/logging", + "@kbn/search-errors", + "@kbn/search-types", + "@kbn/react-kibana-mount", + "@kbn/field-formats-plugin", + "@kbn/config-schema", + "@kbn/zod" + ], + "exclude": [ + "target/**/*" + ] +} diff --git a/x-pack/test/accessibility/apps/group1/spaces.ts b/x-pack/test/accessibility/apps/group1/spaces.ts index 324e3bcbcdcc..87cedf0f7d47 100644 --- a/x-pack/test/accessibility/apps/group1/spaces.ts +++ b/x-pack/test/accessibility/apps/group1/spaces.ts @@ -54,6 +54,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.spaceSelector.clickCreateSpace(); await PageObjects.spaceSelector.clickEnterSpaceName(); await PageObjects.spaceSelector.addSpaceName('space_a'); + await PageObjects.spaceSelector.changeSolutionView('classic'); await a11y.testAppSnapshot(); }); @@ -90,6 +91,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.spaceSelector.clickCreateSpace(); await PageObjects.spaceSelector.clickEnterSpaceName(); await PageObjects.spaceSelector.addSpaceName('space_b'); + await PageObjects.spaceSelector.changeSolutionView('classic'); await PageObjects.spaceSelector.clickSaveSpaceCreation(); await PageObjects.common.navigateToApp('home'); await PageObjects.spaceSelector.openSpacesNav(); diff --git a/x-pack/test/accessibility/apps/group3/enterprise_search.ts b/x-pack/test/accessibility/apps/group3/enterprise_search.ts index 976f16a6c715..9210a5ccb6a6 100644 --- a/x-pack/test/accessibility/apps/group3/enterprise_search.ts +++ b/x-pack/test/accessibility/apps/group3/enterprise_search.ts @@ -28,7 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Overview', () => { before(async () => { - await common.navigateToApp('enterprise_search/overview'); + await common.navigateToApp('elasticsearch/overview'); }); it('loads a landing page with product cards', async function () { @@ -50,7 +50,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Content', () => { before(async () => { - await common.navigateToApp('enterprise_search/content/search_indices'); + await common.navigateToApp('elasticsearch/content/search_indices'); }); it('loads the indices page', async function () { @@ -64,7 +64,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Elasticsearch', () => { before(async () => { - await common.navigateToApp('enterprise_search/elasticsearch'); + await common.navigateToApp('elasticsearch/elasticsearch'); }); it('loads a setup guide', async function () { @@ -106,7 +106,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Playground', () => { before(async () => { - await common.navigateToApp('enterprise_search/applications'); + await common.navigateToApp('elasticsearch/applications'); }); it('loads playground', async function () { @@ -120,7 +120,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { describe('Search Applications', () => { before(async () => { - await common.navigateToApp('enterprise_search/applications/search_applications'); + await common.navigateToApp('elasticsearch/applications/search_applications'); }); it('loads search applications list', async function () { @@ -133,7 +133,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('Behavioral Analytics', () => { before(async () => { - await common.navigateToApp('enterprise_search/analytics'); + await common.navigateToApp('elasticsearch/analytics'); }); it('loads Behavioral Analytics page', async function () { @@ -146,7 +146,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('Vector Search', () => { before(async () => { - await common.navigateToApp('enterprise_search/vector_search'); + await common.navigateToApp('elasticsearch/vector_search'); }); it('loads Vector Search page', async function () { @@ -159,7 +159,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }); describe('AI Search', () => { before(async () => { - await common.navigateToApp('enterprise_search/ai_search'); + await common.navigateToApp('elasticsearch/ai_search'); }); it('loads AI Search page', async function () { diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/config.ts b/x-pack/test/api_integration/apis/cloud_security_posture/config.ts index 5f335f116fef..28ac1f643041 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/config.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/config.ts @@ -5,13 +5,27 @@ * 2.0. */ -import { FtrConfigProviderContext } from '@kbn/test'; +import { FtrConfigProviderContext, getKibanaCliLoggers } from '@kbn/test'; export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const baseIntegrationTestsConfig = await readConfigFile(require.resolve('../../config.ts')); + const baseConfig = await readConfigFile(require.resolve('../../config.ts')); return { - ...baseIntegrationTestsConfig.getAll(), + ...baseConfig.getAll(), testFiles: [require.resolve('.')], + kbnTestServer: { + ...baseConfig.get('kbnTestServer'), + serverArgs: [ + ...baseConfig.get('kbnTestServer.serverArgs'), + `--logging.loggers=${JSON.stringify([ + ...getKibanaCliLoggers(baseConfig.get('kbnTestServer.serverArgs')), + { + name: 'plugins.cloudSecurityPosture', + level: 'all', + appenders: ['default'], + }, + ])}`, + ], + }, }; } diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts b/x-pack/test/api_integration/apis/cloud_security_posture/graph.ts new file mode 100644 index 000000000000..4ff483bff343 --- /dev/null +++ b/x-pack/test/api_integration/apis/cloud_security_posture/graph.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 { + ELASTIC_HTTP_VERSION_HEADER, + X_ELASTIC_INTERNAL_ORIGIN_REQUEST, +} from '@kbn/core-http-common'; +import type { Agent } from 'supertest'; +import type { GraphRequest } from '@kbn/cloud-security-posture-common/types/graph/latest'; +import { FtrProviderContext } from '@kbn/ftr-common-functional-services'; +import { result } from '../../../cloud_security_posture_api/utils'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + + const logger = getService('log'); + const supertest = getService('supertest'); + + const postGraph = (agent: Agent, body: GraphRequest, auth?: { user: string; pass: string }) => { + let req = agent + .post('/internal/cloud_security_posture/graph') + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'xxxx'); + + if (auth) { + req = req.auth(auth.user, auth.pass); + } + + return req.send(body); + }; + + describe('POST /internal/cloud_security_posture/graph', () => { + // TODO: fix once feature flag is enabled for the API + describe.skip('Feature flag', () => { + it('should return 404 when feature flag is not toggled', async () => { + await postGraph(supertest, { + query: { + eventIds: [], + start: 'now-1d/d', + end: 'now/d', + }, + }).expect(result(404, logger)); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/cloud_security_posture/index.ts b/x-pack/test/api_integration/apis/cloud_security_posture/index.ts index fa11aab67b27..46f594be3ed3 100644 --- a/x-pack/test/api_integration/apis/cloud_security_posture/index.ts +++ b/x-pack/test/api_integration/apis/cloud_security_posture/index.ts @@ -20,6 +20,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./benchmark/v2')); loadTestFile(require.resolve('./rules/v1')); loadTestFile(require.resolve('./rules/v2')); + loadTestFile(require.resolve('./graph')); // Place your tests files under this directory and add the following here: // loadTestFile(require.resolve('./your test name')); diff --git a/x-pack/test/api_integration/apis/entity_manager/count.ts b/x-pack/test/api_integration/apis/entity_manager/count.ts new file mode 100644 index 000000000000..a19153633916 --- /dev/null +++ b/x-pack/test/api_integration/apis/entity_manager/count.ts @@ -0,0 +1,421 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 expect from 'expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { + createEntityTypeDefinition, + createEntitySourceDefinition, + countEntities, +} from './helpers/request'; +import { createIndexWithDocuments, createIndexWithEntities } from './helpers/data_generation'; +import { clearEntityDefinitions } from './helpers/clear_entity_definitions'; + +export default function ({ getService }: FtrProviderContext) { + const esClient = getService('es'); + const supertest = getService('supertest'); + + describe('_count API', () => { + let cleanup: Function[] = []; + + before(() => clearEntityDefinitions(esClient)); + + afterEach(async () => { + await Promise.all([clearEntityDefinitions(esClient), ...cleanup.map((fn) => fn())]); + cleanup = []; + }); + + it('returns correct count for single source definition', async () => { + const source = { + id: 'source-1-with-services', + type_id: '20-services', + index_patterns: ['index-1-with-services'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: 'custom_timestamp', + }; + await createEntityTypeDefinition(supertest, { + type: { id: '20-services', display_name: '20-services' }, + }); + await createEntitySourceDefinition(supertest, { source }); + + cleanup.push( + await createIndexWithEntities(esClient, { + index: 'index-1-with-services', + count: 20, + source, + }) + ); + + const result = await countEntities(supertest, {}, 200); + + expect(result).toEqual({ total: 20, types: { '20-services': 20 }, errors: [] }); + }); + + it('aggregates total count across types', async () => { + const sourceType1 = { + id: 'source-1-with-20-chumbles', + type_id: 'chumble', + index_patterns: ['index-1-with-chumbles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: 'custom_timestamp', + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'chumble', display_name: 'chumble' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType1 }); + + const sourceType2 = { + id: 'source-1-with-15-shleems', + type_id: 'shleem', + index_patterns: ['index-1-with-shleems'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'shleem', display_name: 'shleem' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType2 }); + + const sourceType3 = { + id: 'source-1-with-25-shmuckles', + type_id: 'shmuckle', + index_patterns: ['index-1-with-shmuckles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'shmuckle', display_name: 'shmuckle' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType3 }); + + cleanup = await Promise.all([ + createIndexWithEntities(esClient, { + index: 'index-1-with-chumbles', + count: 20, + source: sourceType1, + }), + createIndexWithEntities(esClient, { + index: 'index-1-with-shleems', + count: 15, + source: sourceType2, + }), + createIndexWithEntities(esClient, { + index: 'index-1-with-shmuckles', + count: 25, + source: sourceType3, + }), + ]); + + // counts all existing types + let result = await countEntities(supertest, {}, 200); + + expect(result).toEqual({ + total: 60, + types: { + shleem: 15, + chumble: 20, + shmuckle: 25, + }, + errors: [], + }); + + // only counts requested types + result = await countEntities(supertest, { types: ['shleem', 'shmuckle'] }, 200); + + expect(result).toEqual({ + total: 40, + types: { + shleem: 15, + shmuckle: 25, + }, + errors: [], + }); + }); + + it('aggregates type count across sources', async () => { + await createEntityTypeDefinition(supertest, { type: { id: 'fleeb', display_name: 'fleeb' } }); + await Promise.all([ + createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-5-fleebs', + type_id: 'fleeb', + index_patterns: ['index-1-with-fleebs'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }), + createEntitySourceDefinition(supertest, { + source: { + id: 'source-2-with-5-fleebs', + type_id: 'fleeb', + index_patterns: ['index-2-with-fleebs'], + identity_fields: ['servicename_field'], + metadata_fields: [], + filters: [], + timestamp_field: 'custom_timestamp', + }, + }), + ]); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-fleebs', + properties: { + '@timestamp': { type: 'date' }, + 'service.name': { type: 'keyword' }, + }, + documents: [ + { '@timestamp': moment().toISOString(), 'service.name': 'service-one' }, + { '@timestamp': moment().toISOString(), 'service.name': 'service-two' }, + { '@timestamp': moment().toISOString(), 'service.name': 'service-three' }, + { '@timestamp': moment().toISOString(), 'service.name': 'service-four' }, + { '@timestamp': moment().toISOString(), 'service.name': 'service-five' }, + ], + }), + createIndexWithDocuments(esClient, { + index: 'index-2-with-fleebs', + properties: { + custom_timestamp: { type: 'date' }, + servicename_field: { type: 'keyword' }, + }, + documents: [ + { custom_timestamp: moment().toISOString(), servicename_field: 'service-three' }, + { custom_timestamp: moment().toISOString(), servicename_field: 'service-four' }, + { custom_timestamp: moment().toISOString(), servicename_field: 'service-five' }, + { custom_timestamp: moment().toISOString(), servicename_field: 'service-six' }, + { custom_timestamp: moment().toISOString(), servicename_field: 'service-seven' }, + ], + }), + ]); + + const result = await countEntities(supertest, { types: ['fleeb'] }, 200); + + expect(result).toEqual({ total: 7, types: { fleeb: 7 }, errors: [] }); + }); + + it('respects start and end parameters', async () => { + const now = moment(); + + await createEntityTypeDefinition(supertest, { + type: { id: 'grumbo', display_name: 'grumbo' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-grumbos', + type_id: 'grumbo', + index_patterns: ['index-1-with-grumbos'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }); + + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'index-1-with-grumbos', + properties: { + '@timestamp': { type: 'date' }, + 'service.name': { type: 'keyword' }, + }, + documents: [ + { '@timestamp': moment(now).toISOString(), 'service.name': 'service-one' }, + { + '@timestamp': moment(now).subtract(10, 'minute').toISOString(), + 'service.name': 'service-two', + }, + { + '@timestamp': moment(now).subtract(20, 'minute').toISOString(), + 'service.name': 'service-three', + }, + { + '@timestamp': moment(now).subtract(30, 'minute').toISOString(), + 'service.name': 'service-four', + }, + { + '@timestamp': moment(now).subtract(30, 'minute').toISOString(), + 'service.name': 'service-five', + }, + ], + }) + ); + + const result = await countEntities( + supertest, + { + start: moment(now).subtract(25, 'minute').toISOString(), + end: now.toISOString(), + }, + 200 + ); + + expect(result).toEqual({ total: 3, types: { grumbo: 3 }, errors: [] }); + }); + + it('respects filters parameters', async () => { + const sourceType1 = { + id: 'source-1-with-chumbles', + type_id: 'chumble', + index_patterns: ['index-1-with-chumbles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'chumble', display_name: 'chumble' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType1 }); + + const sourceType2 = { + id: 'source-1-with-shleems', + type_id: 'shleem', + index_patterns: ['index-1-with-shleems'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'shleem', display_name: 'shleem' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType2 }); + + const sourceType3 = { + id: 'source-1-with-shmuckles', + type_id: 'shmuckle', + index_patterns: ['index-1-with-shmuckles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }; + await createEntityTypeDefinition(supertest, { + type: { id: 'shmuckle', display_name: 'shmuckle' }, + }); + await createEntitySourceDefinition(supertest, { source: sourceType3 }); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-chumbles', + properties: { + 'service.name': { type: 'keyword' }, + 'service.environment': { type: 'keyword' }, + }, + documents: [ + { 'service.name': 'service-one', 'service.environment': 'prod' }, + { 'service.name': 'service-one' }, + ], + }), + createIndexWithDocuments(esClient, { + index: 'index-1-with-shleems', + properties: { + 'service.name': { type: 'keyword' }, + 'service.environment': { type: 'keyword' }, + }, + documents: [ + { 'service.name': 'service-two', 'service.environment': 'staging' }, + { 'service.name': 'service-three', 'service.environment': 'prod' }, + { 'service.name': 'service-three', 'service.environment': 'dev' }, + ], + }), + createIndexWithDocuments(esClient, { + index: 'index-1-with-shmuckles', + properties: { + 'service.name': { type: 'keyword' }, + }, + documents: [ + { 'service.name': 'service-two' }, + { 'service.name': 'service-three' }, + { 'service.name': 'service-three' }, + ], + }), + ]); + + const result = await countEntities( + supertest, + { filters: ['service.environment: prod'] }, + 200 + ); + + expect(result).toEqual({ + total: 2, + types: { + chumble: 1, + shleem: 1, + shmuckle: 0, + }, + errors: [], + }); + }); + + it('is resilient to invalid sources', async () => { + await createEntityTypeDefinition(supertest, { + type: { id: 'chumble', display_name: 'chumble' }, + }); + await Promise.all([ + createEntitySourceDefinition(supertest, { + source: { + id: 'source-with-chumbles', + type_id: 'chumble', + index_patterns: ['index-1-with-chumbles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }, + }), + createEntitySourceDefinition(supertest, { + source: { + id: 'invalid-source-with-chumbles', + type_id: 'chumble', + index_patterns: ['index-2-with-chumbles'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }, + }), + ]); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-chumbles', + properties: { + 'service.name': { type: 'keyword' }, + }, + documents: [{ 'service.name': 'service-one' }], + }), + createIndexWithDocuments(esClient, { + index: 'index-2-with-chumbles', + properties: { + 'service.environment': { type: 'keyword' }, + }, + documents: [{ 'service.name': 'service-two' }], + }), + ]); + + const result = await countEntities(supertest, {}, 200); + + expect(result).toEqual({ + total: 1, + types: { + chumble: 1, + }, + errors: [ + 'Mandatory fields [service.name] are not mapped for source [source: invalid-source-with-chumbles, type: chumble] with index patterns [index-2-with-chumbles]', + ], + }); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/entity_manager/helpers/clear_entity_definitions.ts b/x-pack/test/api_integration/apis/entity_manager/helpers/clear_entity_definitions.ts new file mode 100644 index 000000000000..5306e2b6d932 --- /dev/null +++ b/x-pack/test/api_integration/apis/entity_manager/helpers/clear_entity_definitions.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 { ElasticsearchClient } from '@kbn/core-elasticsearch-server'; +import { DEFINITIONS_ALIAS } from '@kbn/entityManager-plugin/server/lib/v2/constants'; + +export async function clearEntityDefinitions(esClient: ElasticsearchClient) { + await esClient.deleteByQuery({ + index: DEFINITIONS_ALIAS, + query: { + match_all: {}, + }, + refresh: true, + }); +} diff --git a/x-pack/test/api_integration/apis/entity_manager/helpers/data_generation.ts b/x-pack/test/api_integration/apis/entity_manager/helpers/data_generation.ts new file mode 100644 index 000000000000..2f784e6a7553 --- /dev/null +++ b/x-pack/test/api_integration/apis/entity_manager/helpers/data_generation.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 moment from 'moment'; +import { v4 as uuidv4 } from 'uuid'; +import { Client } from '@elastic/elasticsearch'; +import { MappingProperty, PropertyName } from '@elastic/elasticsearch/lib/api/types'; +import { EntitySourceDefinition } from '@kbn/entityManager-plugin/server/lib/v2/types'; + +export async function createIndexWithDocuments( + client: Client, + options: { + index: string; + properties: Record; + documents: Array>; + } +) { + await client.indices.create({ + index: options.index, + mappings: { + dynamic: false, + properties: options.properties, + }, + }); + + const bulkActions = options.documents.flatMap((doc) => { + return [{ create: { _index: options.index } }, doc]; + }); + + await client.bulk({ + body: bulkActions, + refresh: 'wait_for', + }); + + return () => client.indices.delete({ index: options.index }); +} + +export async function createIndexWithEntities( + client: Client, + options: { + index: string; + source: EntitySourceDefinition; + count: number; + } +) { + const { source, index, count } = options; + const documents = new Array(count).fill(null).map(() => { + return { + ...(source.timestamp_field ? { [source.timestamp_field]: moment().toISOString() } : {}), + ...source.identity_fields.concat(source.metadata_fields).reduce((fields, field) => { + fields[field] = uuidv4(); + return fields; + }, {} as Record), + }; + }); + + return createIndexWithDocuments(client, { + index, + documents, + properties: { + ...(source.timestamp_field ? { [source.timestamp_field]: { type: 'date' } } : {}), + ...source.identity_fields.concat(source.metadata_fields).reduce((fields, field) => { + fields[field] = { type: 'keyword' }; + return fields; + }, {} as Record), + }, + }); +} diff --git a/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts b/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts index c21f33cc8793..3ef606320cb0 100644 --- a/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts +++ b/x-pack/test/api_integration/apis/entity_manager/helpers/request.ts @@ -8,6 +8,7 @@ import { Agent } from 'supertest'; import { EntityDefinition, EntityDefinitionUpdate } from '@kbn/entities-schema'; import { EntityDefinitionWithState } from '@kbn/entityManager-plugin/server/lib/entities/types'; +import { EntitySourceDefinition } from '@kbn/entityManager-plugin/server/lib/v2/types'; export interface Auth { username: string; @@ -89,3 +90,69 @@ export const upgradeBuiltinDefinitions = async ( .expect(200); return response.body; }; + +export const createEntityTypeDefinition = ( + supertest: Agent, + params: { + type: { + id: string; + display_name: string; + }; + } +) => { + return supertest + .post('/internal/entities/v2/definitions/types') + .set('kbn-xsrf', 'xxx') + .send({ type: params.type }) + .expect(201); +}; + +export const createEntitySourceDefinition = ( + supertest: Agent, + params: { + source: EntitySourceDefinition; + } +) => { + return supertest + .post('/internal/entities/v2/definitions/sources') + .set('kbn-xsrf', 'xxx') + .send({ source: params.source }) + .expect(201); +}; + +export const searchEntities = async ( + supertest: Agent, + params: { + type: string; + start?: string; + end?: string; + metadata_fields?: string[]; + filters?: string[]; + }, + expectedCode?: number +) => { + const response = await supertest + .post('/internal/entities/v2/_search') + .set('kbn-xsrf', 'xxx') + .send(params) + .expect(expectedCode ?? 200); + return response.body; +}; + +export const countEntities = async ( + supertest: Agent, + params: { + types?: string[]; + filters?: string[]; + start?: string; + end?: string; + }, + expectedCode?: number +) => { + const response = await supertest + .post('/internal/entities/v2/_count') + .set('kbn-xsrf', 'xxx') + .send(params) + .expect(expectedCode ?? 200); + return response.body; +}; diff --git a/x-pack/test/api_integration/apis/entity_manager/index.ts b/x-pack/test/api_integration/apis/entity_manager/index.ts index 8f7af35e5c8a..960eedb25df5 100644 --- a/x-pack/test/api_integration/apis/entity_manager/index.ts +++ b/x-pack/test/api_integration/apis/entity_manager/index.ts @@ -13,5 +13,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./builtin_definitions')); loadTestFile(require.resolve('./definitions')); + loadTestFile(require.resolve('./count')); + loadTestFile(require.resolve('./search')); }); } diff --git a/x-pack/test/api_integration/apis/entity_manager/search.ts b/x-pack/test/api_integration/apis/entity_manager/search.ts new file mode 100644 index 000000000000..f164a309f031 --- /dev/null +++ b/x-pack/test/api_integration/apis/entity_manager/search.ts @@ -0,0 +1,817 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 expect from 'expect'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { + createEntitySourceDefinition, + createEntityTypeDefinition, + searchEntities, +} from './helpers/request'; +import { createIndexWithDocuments } from './helpers/data_generation'; +import { clearEntityDefinitions } from './helpers/clear_entity_definitions'; + +export default function ({ getService }: FtrProviderContext) { + const esClient = getService('es'); + const supertest = getService('supertest'); + + // Failing: See https://github.com/elastic/kibana/issues/203982 + describe.skip('_search API', () => { + let cleanup: Function[] = []; + + before(() => clearEntityDefinitions(esClient)); + + afterEach(async () => { + await Promise.all([clearEntityDefinitions(esClient), ...cleanup.map((fn) => fn())]); + cleanup = []; + }); + + it('returns 404 when no matching sources', async () => { + await searchEntities(supertest, { type: 'undefined-type' }, 404); + }); + + it('resolves entities from sources with timestamp', async () => { + const now = moment(); + + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'index-1-with-services', + properties: { + custom_timestamp: { type: 'date' }, + 'service.name': { type: 'keyword' }, + }, + documents: [ + { + custom_timestamp: moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-one', + }, + { + custom_timestamp: moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-two', + }, + { + custom_timestamp: moment(now).subtract(1, 'hour').toISOString(), + 'service.name': 'service-three', + }, + ], + }) + ); + + await createEntityTypeDefinition(supertest, { + type: { id: 'services-with-timestamp', display_name: 'services-with-timestamp' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-services', + type_id: 'services-with-timestamp', + index_patterns: ['index-1-with-services'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: 'custom_timestamp', + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'services-with-timestamp', + start: moment(now).subtract(10, 'minute').toISOString(), + end: now.toISOString(), + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'entity.id': 'service-one', + 'entity.display_name': 'service-one', + 'entity.type': 'services-with-timestamp', + 'service.name': 'service-one', + }, + { + 'entity.last_seen_timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'entity.id': 'service-two', + 'entity.display_name': 'service-two', + 'entity.type': 'services-with-timestamp', + 'service.name': 'service-two', + }, + ]); + }); + + it('resolves entities from sources without timestamp', async () => { + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'index-1-with-home-appliances', + properties: { 'appliance.name': { type: 'keyword' } }, + documents: [ + { 'appliance.name': 'rice cooker' }, + { 'appliance.name': 'kettle' }, + { 'appliance.name': 'dishwasher' }, + ], + }) + ); + + await createEntityTypeDefinition(supertest, { + type: { id: 'home-appliances', display_name: 'home-appliances' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'appliances-no-timestamp', + type_id: 'home-appliances', + index_patterns: ['index-1-with-home-appliances'], + identity_fields: ['appliance.name'], + metadata_fields: [], + filters: [], + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'home-appliances', + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.id': 'dishwasher', + 'entity.display_name': 'dishwasher', + 'entity.type': 'home-appliances', + 'appliance.name': 'dishwasher', + }, + { + 'entity.id': 'kettle', + 'entity.display_name': 'kettle', + 'entity.type': 'home-appliances', + 'appliance.name': 'kettle', + }, + { + 'entity.id': 'rice cooker', + 'entity.display_name': 'rice cooker', + 'entity.type': 'home-appliances', + 'appliance.name': 'rice cooker', + }, + ]); + }); + + it('merges entities from different sources', async () => { + const now = moment(); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-hosts', + properties: { + '@timestamp': { type: 'date' }, + 'host.name': { type: 'keyword' }, + 'agent.name': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'host.name': 'host-uno', + 'agent.name': 'agent-a', + }, + { + '@timestamp': moment(now).subtract(3, 'minute').toISOString(), + 'host.name': 'host-uno', + 'agent.name': 'agent-b', + }, + { + '@timestamp': moment(now).subtract(3, 'minute').toISOString(), + 'host.name': 'host-dos', + 'agent.name': 'agent-3', + }, + { + '@timestamp': moment(now).subtract(4, 'minute').toISOString(), + 'host.name': 'host-tres', + }, + ], + }), + + createIndexWithDocuments(esClient, { + index: 'index-2-with-hosts', + properties: { + timestamp: { type: 'date' }, + hostname_field: { type: 'keyword' }, + 'agent.name': { type: 'keyword' }, + }, + documents: [ + { + timestamp: moment(now).subtract(2, 'minute').toISOString(), + hostname_field: 'host-uno', + 'agent.name': 'agent-1', + }, + { + timestamp: moment(now).subtract(2, 'minute').toISOString(), + hostname_field: 'host-dos', + 'agent.name': 'agent-k', + }, + { + timestamp: moment(now).subtract(5, 'minute').toISOString(), + hostname_field: 'host-four', + }, + ], + }), + ]); + + await createEntityTypeDefinition(supertest, { + type: { id: 'hosts-with-agents', display_name: 'hosts-with-agents' }, + }); + await Promise.all([ + createEntitySourceDefinition(supertest, { + source: { + id: 'hosts-with-agents-1', + type_id: 'hosts-with-agents', + index_patterns: ['index-1-with-hosts'], + identity_fields: ['host.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }), + createEntitySourceDefinition(supertest, { + source: { + id: 'hosts-with-agents-2', + type_id: 'hosts-with-agents', + index_patterns: ['index-2-with-hosts'], + identity_fields: ['hostname_field'], + metadata_fields: [], + filters: [], + timestamp_field: 'timestamp', + }, + }), + ]); + + const { entities, errors } = await searchEntities(supertest, { + type: 'hosts-with-agents', + start: moment(now).subtract(10, 'minute').toISOString(), + end: moment(now).toISOString(), + metadata_fields: ['agent.name'], + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.id': 'host-uno', + 'entity.display_name': 'host-uno', + 'entity.type': 'hosts-with-agents', + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'host.name': 'host-uno', + hostname_field: 'host-uno', + 'agent.name': expect.arrayContaining(['agent-a', 'agent-b', 'agent-1']), + }, + { + 'entity.id': 'host-dos', + 'entity.display_name': 'host-dos', + 'entity.type': 'hosts-with-agents', + 'entity.last_seen_timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'host.name': 'host-dos', + hostname_field: 'host-dos', + 'agent.name': expect.arrayContaining(['agent-3', 'agent-k']), + }, + { + 'entity.id': 'host-tres', + 'entity.display_name': 'host-tres', + 'entity.type': 'hosts-with-agents', + 'entity.last_seen_timestamp': moment(now).subtract(4, 'minute').toISOString(), + 'host.name': 'host-tres', + 'agent.name': null, + }, + { + 'entity.id': 'host-four', + 'entity.display_name': 'host-four', + 'entity.type': 'hosts-with-agents', + 'entity.last_seen_timestamp': moment(now).subtract(5, 'minute').toISOString(), + hostname_field: 'host-four', + 'agent.name': null, + }, + ]); + }); + + it('includes source and additional metadata fields', async () => { + const now = moment(); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-services', + properties: { + '@timestamp': { type: 'date' }, + 'service.name': { type: 'keyword' }, + 'agent.name': { type: 'keyword' }, + 'host.name': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-one', + 'agent.name': 'agent-one', + 'host.name': 'host-one', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-one', + 'agent.name': 'agent-one', + 'host.name': 'host-one', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-one', + 'host.name': 'host-two', + }, + { + '@timestamp': moment(now).subtract(3, 'minute').toISOString(), + 'service.name': 'service-two', + 'host.name': 'host-three', + }, + ], + }), + + createIndexWithDocuments(esClient, { + index: 'index-2-with-services', + properties: { + '@timestamp': { type: 'date' }, + 'service.name': { type: 'keyword' }, + 'agent.name': { type: 'keyword' }, + 'host.name': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-one', + 'agent.name': 'agent-one', + 'host.name': 'host-one', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-one', + 'agent.name': 'agent-ten', + 'host.name': 'host-ten', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-two', + 'agent.name': 'agent-nine', + 'host.name': 'host-nine', + }, + ], + }), + ]); + + await createEntityTypeDefinition(supertest, { + type: { id: 'services-with-hosts', display_name: 'services-with-hosts' }, + }); + await Promise.all([ + createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-services', + type_id: 'services-with-hosts', + index_patterns: ['index-1-with-services'], + identity_fields: ['service.name'], + metadata_fields: ['host.name'], + filters: [], + timestamp_field: '@timestamp', + }, + }), + createEntitySourceDefinition(supertest, { + source: { + id: 'source-2-with-services', + type_id: 'services-with-hosts', + index_patterns: ['index-2-with-services'], + identity_fields: ['service.name'], + metadata_fields: ['host.name'], + filters: [], + timestamp_field: '@timestamp', + }, + }), + ]); + + const { entities, errors } = await searchEntities(supertest, { + type: 'services-with-hosts', + metadata_fields: ['agent.name', 'non.existing.metadata.field'], + start: moment(now).subtract(5, 'minute').toISOString(), + end: moment(now).toISOString(), + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'entity.id': 'service-one', + 'entity.display_name': 'service-one', + 'entity.type': 'services-with-hosts', + 'service.name': 'service-one', + 'agent.name': expect.arrayContaining(['agent-one', 'agent-ten']), + 'host.name': expect.arrayContaining(['host-one', 'host-two', 'host-ten']), + }, + { + 'entity.last_seen_timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'entity.id': 'service-two', + 'entity.display_name': 'service-two', + 'entity.type': 'services-with-hosts', + 'service.name': 'service-two', + 'agent.name': 'agent-nine', + 'host.name': expect.arrayContaining(['host-three', 'host-nine']), + }, + ]); + }); + + it('respects filters', async () => { + const now = moment(); + + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'index-1-with-services', + properties: { + '@timestamp': { type: 'date' }, + 'service.name': { type: 'keyword' }, + 'service.environment': { type: 'keyword' }, + 'service.url': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-one', + 'service.environment': 'prod', + 'service.url': 'http://prod.service-one.com', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-one', + 'service.environment': 'staging', + 'service.url': 'http://staging.service-one.com', + }, + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'service.name': 'service-two', + 'service.environment': 'prod', + 'service.url': 'http://prod.service-two.com', + }, + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-two', + 'service.environment': 'staging', + 'service.url': 'http://staging.service-two.com', + }, + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'service.name': 'service-three', + 'service.environment': 'prod', + 'service.url': 'http://prod.service-three.com', + }, + ], + }) + ); + + await createEntityTypeDefinition(supertest, { + type: { id: 'service-one-type', display_name: 'service-one-type' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-services', + type_id: 'service-one-type', + index_patterns: ['index-1-with-services'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: ['service.name: service-one'], + timestamp_field: '@timestamp', + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'service-one-type', + start: moment(now).subtract(5, 'minute').toISOString(), + end: moment(now).toISOString(), + filters: ['service.environment: prod'], + metadata_fields: ['service.environment', 'service.url'], + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'entity.id': 'service-one', + 'entity.display_name': 'service-one', + 'entity.type': 'service-one-type', + 'service.name': 'service-one', + 'service.environment': 'prod', + 'service.url': 'http://prod.service-one.com', + }, + ]); + }); + + it('resolves entities with multiple identity fields', async () => { + const now = moment(); + + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'index-1-with-cars', + properties: { + '@timestamp': { type: 'date' }, + 'car.brand': { type: 'keyword' }, + 'car.model': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'car.brand': 'Fiat', + 'car.model': 'Multipla', + }, + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'car.brand': 'Citroen', + 'car.model': 'ZX break', + }, + ], + }) + ); + + await createEntityTypeDefinition(supertest, { + type: { id: 'most-refined-cars', display_name: 'most-refined-cars' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-cars', + type_id: 'most-refined-cars', + index_patterns: ['index-1-with-cars'], + identity_fields: ['car.brand', 'car.model'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + display_name: 'car.model', + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'most-refined-cars', + start: moment(now).subtract(5, 'minute').toISOString(), + end: moment(now).toISOString(), + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'entity.id': 'Citroen:ZX break', + 'entity.display_name': 'ZX break', + 'entity.type': 'most-refined-cars', + 'car.brand': 'Citroen', + 'car.model': 'ZX break', + }, + { + 'entity.last_seen_timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'entity.id': 'Fiat:Multipla', + 'entity.display_name': 'Multipla', + 'entity.type': 'most-refined-cars', + 'car.brand': 'Fiat', + 'car.model': 'Multipla', + }, + ]); + }); + + it('resolves entities with multiple identity fields across sources', async () => { + const now = moment(); + + cleanup = await Promise.all([ + createIndexWithDocuments(esClient, { + index: 'index-1-with-cars', + properties: { + '@timestamp': { type: 'date' }, + 'car.brand': { type: 'keyword' }, + 'car.model': { type: 'keyword' }, + 'car.color': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'car.brand': 'Fiat', + 'car.model': 'Multipla', + 'car.color': 'cyan', + }, + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'car.brand': 'Citroen', + 'car.model': 'ZX break', + 'car.color': 'white', + }, + ], + }), + + createIndexWithDocuments(esClient, { + index: 'index-2-with-cars', + properties: { + '@timestamp': { type: 'date' }, + car_brand: { type: 'keyword' }, + car_model: { type: 'keyword' }, + 'car.color': { type: 'keyword' }, + }, + documents: [ + { + '@timestamp': moment(now).subtract(2, 'minute').toISOString(), + car_brand: 'Fiat', + car_model: 'Multipla', + 'car.color': 'purple', + }, + { + '@timestamp': moment(now).subtract(1, 'minute').toISOString(), + car_brand: 'Citroen', + car_model: 'ZX break', + 'car.color': 'orange', + }, + ], + }), + ]); + + await createEntityTypeDefinition(supertest, { + type: { id: 'most-refined-cars', display_name: 'most-refined-cars' }, + }); + await Promise.all([ + createEntitySourceDefinition(supertest, { + source: { + id: 'source-1-with-cars', + type_id: 'most-refined-cars', + index_patterns: ['index-1-with-cars'], + identity_fields: ['car.brand', 'car.model'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }), + createEntitySourceDefinition(supertest, { + source: { + id: 'source-2-with-cars', + type_id: 'most-refined-cars', + index_patterns: ['index-2-with-cars'], + identity_fields: ['car_brand', 'car_model'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }), + ]); + + const { entities, errors } = await searchEntities(supertest, { + type: 'most-refined-cars', + start: moment(now).subtract(5, 'minute').toISOString(), + end: moment(now).toISOString(), + metadata_fields: ['car.color'], + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.last_seen_timestamp': moment(now).subtract(1, 'minute').toISOString(), + 'entity.id': 'Citroen:ZX break', + 'entity.display_name': 'Citroen:ZX break', + 'entity.type': 'most-refined-cars', + 'car.brand': 'Citroen', + 'car.model': 'ZX break', + car_brand: 'Citroen', + car_model: 'ZX break', + 'car.color': expect.arrayContaining(['white', 'orange']), + }, + { + 'entity.last_seen_timestamp': moment(now).subtract(2, 'minute').toISOString(), + 'entity.id': 'Fiat:Multipla', + 'entity.display_name': 'Fiat:Multipla', + 'entity.type': 'most-refined-cars', + 'car.brand': 'Fiat', + 'car.model': 'Multipla', + car_brand: 'Fiat', + car_model: 'Multipla', + 'car.color': expect.arrayContaining(['cyan', 'purple']), + }, + ]); + }); + + it('casts conflicting mappings to keywords', async () => { + cleanup = await Promise.all([ + await createIndexWithDocuments(esClient, { + index: 'index-service-name-as-keyword', + properties: { 'service.name': { type: 'keyword' } }, + documents: [{ 'service.name': 'service-name-as-keyword' }], + }), + + await createIndexWithDocuments(esClient, { + index: 'index-service-name-as-text', + properties: { 'service.name': { type: 'text' } }, + documents: [{ 'service.name': 'service-name-as-text' }], + }), + + await createIndexWithDocuments(esClient, { + index: 'index-service-name-as-long', + properties: { 'service.name': { type: 'long' } }, + documents: [{ 'service.name': 123 }], + }), + ]); + + await createEntityTypeDefinition(supertest, { + type: { + id: 'type-with-conflicting-mappings', + display_name: 'type-with-conflicting-mappings', + }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'conflicting-mappings', + type_id: 'type-with-conflicting-mappings', + index_patterns: ['index-service-name-as-*'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'type-with-conflicting-mappings', + }); + + expect(errors).toEqual([]); + expect(entities).toEqual([ + { + 'entity.id': '123', + 'entity.display_name': '123', + 'entity.type': 'type-with-conflicting-mappings', + 'service.name': '123', + }, + { + 'entity.id': 'service-name-as-keyword', + 'entity.display_name': 'service-name-as-keyword', + 'entity.type': 'type-with-conflicting-mappings', + 'service.name': 'service-name-as-keyword', + }, + { + 'entity.id': 'service-name-as-text', + 'entity.display_name': 'service-name-as-text', + 'entity.type': 'type-with-conflicting-mappings', + 'service.name': 'service-name-as-text', + }, + ]); + }); + + it('returns error if index does not exist', async () => { + await createEntityTypeDefinition(supertest, { + type: { id: 'type-with-non-existing-index', display_name: 'type-with-non-existing-index' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'non-existing-index', + type_id: 'type-with-non-existing-index', + index_patterns: ['non-existing-index-pattern*', 'non-existing-index'], + identity_fields: ['service.name'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'type-with-non-existing-index', + }); + expect(errors).toEqual([ + 'No index found for source [source: non-existing-index, type: type-with-non-existing-index] with index patterns [non-existing-index-pattern*, non-existing-index]', + ]); + expect(entities).toEqual([]); + }); + + it('returns error if mandatory fields are not mapped', async () => { + cleanup.push( + await createIndexWithDocuments(esClient, { + index: 'unmapped-id-fields', + properties: { 'service.environment': { type: 'keyword' } }, + documents: [ + { + '@timestamp': moment().toISOString(), + 'service.name': 'service-one', + 'service.environment': 'prod', + }, + ], + }) + ); + + await createEntityTypeDefinition(supertest, { + type: { id: 'type-with-unmapped-id-fields', display_name: 'type-with-unmapped-id-fields' }, + }); + await createEntitySourceDefinition(supertest, { + source: { + id: 'unmapped-fields', + type_id: 'type-with-unmapped-id-fields', + index_patterns: ['unmapped-id-fields'], + identity_fields: ['service.name', 'service.environment'], + metadata_fields: [], + filters: [], + timestamp_field: '@timestamp', + }, + }); + + const { entities, errors } = await searchEntities(supertest, { + type: 'type-with-unmapped-id-fields', + }); + expect(errors).toEqual([ + 'Mandatory fields [service.name, @timestamp] are not mapped for source [source: unmapped-fields, type: type-with-unmapped-id-fields] with index patterns [unmapped-id-fields]', + ]); + expect(entities).toEqual([]); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/features/features/features.ts b/x-pack/test/api_integration/apis/features/features/features.ts index 42dcd94234c9..bbdce7ab4291 100644 --- a/x-pack/test/api_integration/apis/features/features/features.ts +++ b/x-pack/test/api_integration/apis/features/features/features.ts @@ -102,6 +102,8 @@ export default function ({ getService }: FtrProviderContext) { 'dev_tools', 'actions', 'enterpriseSearch', + 'enterpriseSearchApplications', + 'enterpriseSearchAnalytics', 'filesManagement', 'filesSharedImage', 'advancedSettings', @@ -154,6 +156,8 @@ export default function ({ getService }: FtrProviderContext) { 'dev_tools', 'actions', 'enterpriseSearch', + 'enterpriseSearchApplications', + 'enterpriseSearchAnalytics', 'filesManagement', 'filesSharedImage', 'advancedSettings', diff --git a/x-pack/test/api_integration/apis/management/index_management/lib/templates.helpers.ts b/x-pack/test/api_integration/apis/management/index_management/lib/templates.helpers.ts index a342df2d6287..ea1e9a2d83bb 100644 --- a/x-pack/test/api_integration/apis/management/index_management/lib/templates.helpers.ts +++ b/x-pack/test/api_integration/apis/management/index_management/lib/templates.helpers.ts @@ -59,7 +59,6 @@ export function templatesHelpers(getService: FtrProviderContext['getService']) { name, indexPatterns, version: 1, - indexMode: 'standard', template: { ...getTemplateMock(isMappingsSourceFieldEnabled) }, _kbnMeta: { isLegacy, diff --git a/x-pack/test/api_integration/apis/ml/trained_models/model_downloads.ts b/x-pack/test/api_integration/apis/ml/trained_models/model_downloads.ts index 4e5fd7031449..654d3ad472e8 100644 --- a/x-pack/test/api_integration/apis/ml/trained_models/model_downloads.ts +++ b/x-pack/test/api_integration/apis/ml/trained_models/model_downloads.ts @@ -45,7 +45,7 @@ export default ({ getService }: FtrProviderContext) => { .set(getCommonRequestHeader('1')); ml.api.assertResponseStatusCode(200, status, body); - expect(body.length).to.eql(5); + expect(body.length).to.eql(6); expect(body).to.eql([ { @@ -129,6 +129,22 @@ export default ({ getService }: FtrProviderContext) => { model_id: '.multilingual-e5-small_linux-x86_64', ...(isIntelBased ? { recommended: true, supported: true } : { supported: false }), }, + { + model_id: '.rerank-v1', + techPreview: true, + recommended: true, + supported: true, + hidden: true, + modelName: 'rerank', + version: 1, + config: { + input: { + field_names: ['input', 'query'], + }, + }, + description: 'Elastic Rerank v1', + type: ['pytorch', 'text_similarity'], + }, ]); }); diff --git a/x-pack/test/api_integration/apis/security/privileges.ts b/x-pack/test/api_integration/apis/security/privileges.ts index 47ac08fd0671..bb00c34bc580 100644 --- a/x-pack/test/api_integration/apis/security/privileges.ts +++ b/x-pack/test/api_integration/apis/security/privileges.ts @@ -181,6 +181,8 @@ export default function ({ getService }: FtrProviderContext) { 'packs_read', ], enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'], filesManagement: ['all', 'read', 'minimal_all', 'minimal_read'], filesSharedImage: ['all', 'read', 'minimal_all', 'minimal_read'], rulesSettings: [ diff --git a/x-pack/test/api_integration/apis/security/privileges_basic.ts b/x-pack/test/api_integration/apis/security/privileges_basic.ts index cc313fe5cfe6..a7b8ee3fd209 100644 --- a/x-pack/test/api_integration/apis/security/privileges_basic.ts +++ b/x-pack/test/api_integration/apis/security/privileges_basic.ts @@ -44,6 +44,8 @@ export default function ({ getService }: FtrProviderContext) { apm: ['all', 'read', 'minimal_all', 'minimal_read'], osquery: ['all', 'read', 'minimal_all', 'minimal_read'], enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'], ml: ['all', 'read', 'minimal_all', 'minimal_read'], siem: ['all', 'read', 'minimal_all', 'minimal_read'], securitySolutionAssistant: ['all', 'read', 'minimal_all', 'minimal_read'], @@ -269,6 +271,8 @@ export default function ({ getService }: FtrProviderContext) { 'packs_read', ], enterpriseSearch: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchApplications: ['all', 'read', 'minimal_all', 'minimal_read'], + enterpriseSearchAnalytics: ['all', 'read', 'minimal_all', 'minimal_read'], rulesSettings: [ 'all', 'read', diff --git a/x-pack/test/api_integration/apis/streams/classic.ts b/x-pack/test/api_integration/apis/streams/classic.ts new file mode 100644 index 000000000000..25a7238a757c --- /dev/null +++ b/x-pack/test/api_integration/apis/streams/classic.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 expect from '@kbn/expect'; +import { JsonObject } from '@kbn/utility-types'; +import { + deleteStream, + enableStreams, + fetchDocument, + getStream, + indexDocument, + listStreams, + putStream, +} from './helpers/requests'; +import { FtrProviderContext } from '../../ftr_provider_context'; +import { waitForDocumentInIndex } from '../../../alerting_api_integration/observability/helpers/alerting_wait_for_helpers'; +import { cleanUpRootStream } from './helpers/cleanup'; + +export default function ({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const esClient = getService('es'); + const retryService = getService('retry'); + const logger = getService('log'); + + describe('Classic streams', () => { + after(async () => { + await cleanUpRootStream(esClient); + }); + + before(async () => { + await enableStreams(supertest); + }); + + it('Shows non-wired data streams', async () => { + const doc = { + message: '2023-01-01T00:00:10.000Z error test', + }; + const response = await indexDocument(esClient, 'logs-test-default', doc); + expect(response.result).to.eql('created'); + const streams = await listStreams(supertest); + const classicStream = streams.definitions.find( + (stream: JsonObject) => stream.id === 'logs-test-default' + ); + expect(classicStream).to.eql({ + id: 'logs-test-default', + managed: false, + children: [], + fields: [], + processing: [], + }); + }); + + it('Allows setting processing on classic streams', async () => { + const response = await putStream(supertest, 'logs-test-default', { + managed: false, + children: [], + fields: [], + processing: [ + { + config: { + type: 'grok', + field: 'message', + patterns: [ + '%{TIMESTAMP_ISO8601:inner_timestamp} %{LOGLEVEL:log.level} %{GREEDYDATA:message2}', + ], + }, + }, + ], + }); + expect(response).to.have.property('acknowledged', true); + const streamBody = await getStream(supertest, 'logs-test-default'); + expect(streamBody).to.eql({ + id: 'logs-test-default', + managed: false, + children: [], + inheritedFields: [], + fields: [], + processing: [ + { + config: { + type: 'grok', + field: 'message', + patterns: [ + '%{TIMESTAMP_ISO8601:inner_timestamp} %{LOGLEVEL:log.level} %{GREEDYDATA:message2}', + ], + }, + }, + ], + }); + }); + + it('Executes processing on classic streams', async () => { + const doc = { + '@timestamp': '2024-01-01T00:00:10.000Z', + message: '2023-01-01T00:00:10.000Z error test', + }; + const response = await indexDocument(esClient, 'logs-test-default', doc); + expect(response.result).to.eql('created'); + await waitForDocumentInIndex({ + esClient, + indexName: 'logs-test-default', + retryService, + logger, + docCountTarget: 2, + }); + const result = await fetchDocument(esClient, 'logs-test-default', response._id); + expect(result._source).to.eql({ + '@timestamp': '2024-01-01T00:00:10.000Z', + message: '2023-01-01T00:00:10.000Z error test', + inner_timestamp: '2023-01-01T00:00:10.000Z', + message2: 'test', + log: { + level: 'error', + }, + }); + }); + + it('Allows removing processing on classic streams', async () => { + const response = await putStream(supertest, 'logs-test-default', { + managed: false, + children: [], + fields: [], + processing: [], + }); + expect(response).to.have.property('acknowledged', true); + }); + + it('Executes processing on classic streams after removing processing', async () => { + const doc = { + // default logs pipeline fills in timestamp with current date if not set + message: '2023-01-01T00:00:10.000Z info mylogger this is the message', + }; + const response = await indexDocument(esClient, 'logs-test-default', doc); + expect(response.result).to.eql('created'); + await waitForDocumentInIndex({ + esClient, + indexName: 'logs-test-default', + retryService, + logger, + docCountTarget: 3, + }); + const result = await fetchDocument(esClient, 'logs-test-default', response._id); + expect(result._source).to.eql({ + // accept any date + '@timestamp': (result._source as { [key: string]: unknown })['@timestamp'], + message: '2023-01-01T00:00:10.000Z info mylogger this is the message', + }); + }); + + it('Allows deleting classic streams', async () => { + await deleteStream(supertest, 'logs-test-default'); + const streams = await listStreams(supertest); + const classicStream = streams.definitions.find( + (stream: JsonObject) => stream.id === 'logs-test-default' + ); + expect(classicStream).to.eql(undefined); + }); + }); +} diff --git a/x-pack/test/api_integration/apis/streams/helpers/requests.ts b/x-pack/test/api_integration/apis/streams/helpers/requests.ts index 7d656e4aacf5..43e7f02b7a75 100644 --- a/x-pack/test/api_integration/apis/streams/helpers/requests.ts +++ b/x-pack/test/api_integration/apis/streams/helpers/requests.ts @@ -42,6 +42,18 @@ export async function putStream(supertest: Agent, name: string, body: JsonObject return response.body; } +export async function getStream(supertest: Agent, name: string) { + const req = supertest.get(`/api/streams/${name}`).set('kbn-xsrf', 'xxx'); + const response = await req.send().expect(200); + return response.body; +} + +export async function listStreams(supertest: Agent) { + const req = supertest.get(`/api/streams`).set('kbn-xsrf', 'xxx'); + const response = await req.send().expect(200); + return response.body; +} + export async function deleteStream(supertest: Agent, id: string) { const req = supertest.delete(`/api/streams/${id}`).set('kbn-xsrf', 'xxx'); const response = await req.send().expect(200); diff --git a/x-pack/test/api_integration/apis/streams/index.ts b/x-pack/test/api_integration/apis/streams/index.ts index 4ef3fce38524..14decb240019 100644 --- a/x-pack/test/api_integration/apis/streams/index.ts +++ b/x-pack/test/api_integration/apis/streams/index.ts @@ -11,6 +11,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { describe('Streams Endpoints', () => { loadTestFile(require.resolve('./full_flow')); loadTestFile(require.resolve('./enrichment')); + loadTestFile(require.resolve('./classic')); loadTestFile(require.resolve('./flush_config')); }); } diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_pct_fired.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_pct_fired.ts index 8ed42269e569..f8f4a8a7df66 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_pct_fired.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_pct_fired.ts @@ -28,6 +28,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { const dataViewApi = getService('dataViewApi'); const logger = getService('log'); const config = getService('config'); + const spacesService = getService('spaces'); const isServerless = config.get('serverless'); const expectedConsumer = isServerless ? 'observability' : 'logs'; let roleAuthc: RoleCredentials; @@ -39,6 +40,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { const DATA_VIEW_TITLE = 'kbn-data-forge-fake_hosts.fake_hosts-*'; const DATA_VIEW_NAME = 'data-view-name'; const DATA_VIEW_ID = 'data-view-id'; + const SPACE_ID = 'test-space'; let dataForgeConfig: PartialConfig; let dataForgeIndices: string[]; let actionId: string; @@ -73,8 +75,15 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { name: DATA_VIEW_NAME, id: DATA_VIEW_ID, title: DATA_VIEW_TITLE, + spaceId: SPACE_ID, roleAuthc, }); + await spacesService.create({ + id: SPACE_ID, + name: 'Test Space', + disabledFeatures: [], + color: '#AABBCC', + }); }); after(async () => { @@ -98,11 +107,13 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { }); await dataViewApi.delete({ id: DATA_VIEW_ID, + spaceId: SPACE_ID, roleAuthc, }); await esDeleteAllIndices([ALERT_ACTION_INDEX, ...dataForgeIndices]); await cleanup({ client: esClient, config: dataForgeConfig, logger }); await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); + await spacesService.delete(SPACE_ID); }); describe('Rule creation', () => { @@ -111,10 +122,12 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { roleAuthc, name: 'Index Connector: Threshold API test', indexName: ALERT_ACTION_INDEX, + spaceId: SPACE_ID, }); const createdRule = await alertingApi.createRule({ roleAuthc, + spaceId: SPACE_ID, tags: ['observability'], consumer: expectedConsumer, name: 'Threshold rule', @@ -174,12 +187,13 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { roleAuthc, ruleId, expectedStatus: 'active', + spaceId: SPACE_ID, }); expect(executionStatus).to.be('active'); }); it('should find the created rule with correct information about the consumer', async () => { - const match = await alertingApi.findInRules(roleAuthc, ruleId); + const match = await alertingApi.findInRules(roleAuthc, ruleId, SPACE_ID); expect(match).not.to.be(undefined); expect(match.consumer).to.be(expectedConsumer); }); @@ -204,7 +218,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { 'observability.rules.custom_threshold' ); expect(resp.hits.hits[0]._source).property('kibana.alert.rule.uuid', ruleId); - expect(resp.hits.hits[0]._source).property('kibana.space_ids').contain('default'); + expect(resp.hits.hits[0]._source).property('kibana.space_ids').contain(SPACE_ID); expect(resp.hits.hits[0]._source) .property('kibana.alert.rule.tags') .contain('observability'); @@ -245,7 +259,9 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort(); expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold'); expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql( - `${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}` + `${protocol}://${hostname}${ + port ? `:${port}` : '' + }/s/${SPACE_ID}/app/observability/alerts/${alertId}` ); expect(resp.hits.hits[0]._source?.reason).eql( `Average system.cpu.user.pct is 250%, above the threshold of 50%. (duration: 5 mins, data view: ${DATA_VIEW_NAME})` @@ -255,6 +271,10 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { const parsedViewInAppUrl = parseSearchParams( new URL(resp.hits.hits[0]._source?.viewInAppUrl || '').search ); + const viewInAppUrlPathName = new URL(resp.hits.hits[0]._source?.viewInAppUrl || '') + .pathname; + + expect(viewInAppUrlPathName).contain(`/s/${SPACE_ID}/app/r`); expect(resp.hits.hits[0]._source?.viewInAppUrl).contain('LOGS_EXPLORER_LOCATOR'); expect(omit(parsedViewInAppUrl.params, 'timeRange.from')).eql({ diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_ticks_fired.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_ticks_fired.ts new file mode 100644 index 000000000000..852363b0d859 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_ticks_fired.ts @@ -0,0 +1,288 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { omit } from 'lodash'; +import expect from '@kbn/expect'; +import { cleanup, generate, Dataset, PartialConfig } from '@kbn/data-forge'; +import { COMPARATORS } from '@kbn/alerting-comparators'; +import { Aggregators } from '@kbn/observability-plugin/common/custom_threshold_rule/types'; +import { FIRED_ACTIONS_ID } from '@kbn/observability-plugin/server/lib/rules/custom_threshold/constants'; +import { OBSERVABILITY_THRESHOLD_RULE_TYPE_ID } from '@kbn/rule-data-utils'; +import { parseSearchParams } from '@kbn/share-plugin/common/url_service'; +import { kbnTestConfig } from '@kbn/test'; +import type { InternalRequestHeader, RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; +import { ISO_DATE_REGEX } from './constants'; +import { ActionDocument, LogsExplorerLocatorParsedParams } from './types'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + const esClient = getService('es'); + const samlAuth = getService('samlAuth'); + const supertestWithoutAuth = getService('supertestWithoutAuth'); + const esDeleteAllIndices = getService('esDeleteAllIndices'); + const alertingApi = getService('alertingApi'); + const dataViewApi = getService('dataViewApi'); + const logger = getService('log'); + const config = getService('config'); + const isServerless = config.get('serverless'); + const expectedConsumer = isServerless ? 'observability' : 'logs'; + const spacesService = getService('spaces'); + let roleAuthc: RoleCredentials; + let internalReqHeader: InternalRequestHeader; + + describe('AVG - TICKS - FIRED', () => { + const CUSTOM_THRESHOLD_RULE_ALERT_INDEX = '.alerts-observability.threshold.alerts-default'; + const ALERT_ACTION_INDEX = 'alert-action-threshold'; + const DATA_VIEW = 'kbn-data-forge-fake_hosts.fake_hosts-*'; + const DATA_VIEW_ID = 'data-view-id'; + const DATA_VIEW_NAME = 'test-data-view-name'; + const SPACE_ID = 'test-space'; + let dataForgeConfig: PartialConfig; + let dataForgeIndices: string[]; + let actionId: string; + let ruleId: string; + let alertId: string; + + before(async () => { + roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); + internalReqHeader = samlAuth.getInternalRequestHeader(); + dataForgeConfig = { + schedule: [ + { + template: 'good', + start: 'now-10m', + end: 'now+5m', + metrics: [ + { + name: 'system.core.system.ticks', + method: 'linear', + start: 10_000_000, + end: 10_000_000, + }, + ], + }, + ], + indexing: { + dataset: 'fake_hosts' as Dataset, + eventsPerCycle: 1, + interval: 10000, + alignEventsToInterval: true, + }, + }; + dataForgeIndices = await generate({ client: esClient, config: dataForgeConfig, logger }); + await alertingApi.waitForDocumentInIndex({ + indexName: dataForgeIndices.join(','), + docCountTarget: 270, + }); + await dataViewApi.create({ + name: DATA_VIEW_NAME, + id: DATA_VIEW_ID, + title: DATA_VIEW, + spaceId: SPACE_ID, + roleAuthc, + }); + await spacesService.create({ + id: SPACE_ID, + name: 'Test Space', + disabledFeatures: [], + color: '#AABBCC', + }); + }); + + after(async () => { + await supertestWithoutAuth + .delete(`/api/alerting/rule/${ruleId}`) + .set(roleAuthc.apiKeyHeader) + .set(internalReqHeader); + await supertestWithoutAuth + .delete(`/api/actions/connector/${actionId}`) + .set(roleAuthc.apiKeyHeader) + .set(internalReqHeader); + await esDeleteAllIndices([ALERT_ACTION_INDEX, ...dataForgeIndices]); + await esClient.deleteByQuery({ + index: CUSTOM_THRESHOLD_RULE_ALERT_INDEX, + query: { term: { 'kibana.alert.rule.uuid': ruleId } }, + }); + await esClient.deleteByQuery({ + index: '.kibana-event-log-*', + query: { term: { 'kibana.alert.rule.consumer': expectedConsumer } }, + }); + await dataViewApi.delete({ + id: DATA_VIEW_ID, + spaceId: SPACE_ID, + roleAuthc, + }); + await cleanup({ client: esClient, config: dataForgeConfig, logger }); + await spacesService.delete(SPACE_ID); + await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); + }); + + describe('Rule creation', () => { + it('creates rule successfully', async () => { + actionId = await alertingApi.createIndexConnector({ + roleAuthc, + name: 'Index Connector: Threshold API test', + indexName: ALERT_ACTION_INDEX, + spaceId: SPACE_ID, + }); + + const createdRule = await alertingApi.createRule({ + roleAuthc, + spaceId: SPACE_ID, + tags: ['observability'], + consumer: expectedConsumer, + name: 'Threshold rule', + ruleTypeId: OBSERVABILITY_THRESHOLD_RULE_TYPE_ID, + params: { + criteria: [ + { + comparator: COMPARATORS.GREATER_THAN, + threshold: [7500000], + timeSize: 5, + timeUnit: 'm', + metrics: [ + { name: 'A', field: 'system.core.system.ticks', aggType: Aggregators.AVERAGE }, + ], + }, + ], + alertOnNoData: true, + alertOnGroupDisappear: true, + searchConfiguration: { + query: { + query: '', + language: 'kuery', + }, + index: DATA_VIEW_ID, + }, + }, + actions: [ + { + group: FIRED_ACTIONS_ID, + id: actionId, + params: { + documents: [ + { + ruleType: '{{rule.type}}', + alertDetailsUrl: '{{context.alertDetailsUrl}}', + reason: '{{context.reason}}', + value: '{{context.value}}', + viewInAppUrl: '{{context.viewInAppUrl}}', + }, + ], + }, + frequency: { + notify_when: 'onActionGroupChange', + throttle: null, + summary: false, + }, + }, + ], + }); + ruleId = createdRule.id; + expect(ruleId).not.to.be(undefined); + }); + + it('should be active', async () => { + const executionStatus = await alertingApi.waitForRuleStatus({ + roleAuthc, + ruleId, + expectedStatus: 'active', + spaceId: SPACE_ID, + }); + expect(executionStatus).to.be('active'); + }); + + it('should set correct information in the alert document', async () => { + const resp = await alertingApi.waitForAlertInIndex({ + indexName: CUSTOM_THRESHOLD_RULE_ALERT_INDEX, + ruleId, + }); + alertId = (resp.hits.hits[0]._source as any)['kibana.alert.uuid']; + + expect(resp.hits.hits[0]._source).property( + 'kibana.alert.rule.category', + 'Custom threshold' + ); + expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', expectedConsumer); + expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule'); + expect(resp.hits.hits[0]._source).property('kibana.alert.rule.producer', 'observability'); + expect(resp.hits.hits[0]._source).property('kibana.alert.rule.revision', 0); + expect(resp.hits.hits[0]._source).property( + 'kibana.alert.rule.rule_type_id', + 'observability.rules.custom_threshold' + ); + expect(resp.hits.hits[0]._source).property('kibana.alert.rule.uuid', ruleId); + expect(resp.hits.hits[0]._source).property('kibana.space_ids').contain(SPACE_ID); + expect(resp.hits.hits[0]._source) + .property('kibana.alert.rule.tags') + .contain('observability'); + expect(resp.hits.hits[0]._source).property( + 'kibana.alert.action_group', + 'custom_threshold.fired' + ); + expect(resp.hits.hits[0]._source).property('tags').contain('observability'); + expect(resp.hits.hits[0]._source).property('kibana.alert.instance.id', '*'); + expect(resp.hits.hits[0]._source).property('kibana.alert.workflow_status', 'open'); + expect(resp.hits.hits[0]._source).property('event.kind', 'signal'); + expect(resp.hits.hits[0]._source).property('event.action', 'open'); + expect(resp.hits.hits[0]._source) + .property('kibana.alert.evaluation.threshold') + .eql([7500000]); + expect(resp.hits.hits[0]._source) + .property('kibana.alert.rule.parameters') + .eql({ + criteria: [ + { + comparator: '>', + threshold: [7500000], + timeSize: 5, + timeUnit: 'm', + metrics: [{ name: 'A', field: 'system.core.system.ticks', aggType: 'avg' }], + }, + ], + alertOnNoData: true, + alertOnGroupDisappear: true, + searchConfiguration: { index: 'data-view-id', query: { query: '', language: 'kuery' } }, + }); + }); + + it('should set correct action parameter: ruleType', async () => { + const resp = await alertingApi.waitForDocumentInIndex({ + indexName: ALERT_ACTION_INDEX, + docCountTarget: 1, + }); + const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort(); + expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold'); + expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql( + `${protocol}://${hostname}${ + port ? `:${port}` : '' + }/s/${SPACE_ID}/app/observability/alerts/${alertId}` + ); + expect(resp.hits.hits[0]._source?.reason).eql( + `Average system.core.system.ticks is 10,000,000, above the threshold of 7,500,000. (duration: 5 mins, data view: ${DATA_VIEW_NAME})` + ); + expect(resp.hits.hits[0]._source?.value).eql('10,000,000'); + + const parsedViewInAppUrl = parseSearchParams( + new URL(resp.hits.hits[0]._source?.viewInAppUrl || '').search + ); + const viewInAppUrlPathName = new URL(resp.hits.hits[0]._source?.viewInAppUrl || '') + .pathname; + + expect(viewInAppUrlPathName).contain(`/s/${SPACE_ID}/app/r`); + expect(resp.hits.hits[0]._source?.viewInAppUrl).contain('LOGS_EXPLORER_LOCATOR'); + expect(omit(parsedViewInAppUrl.params, 'timeRange.from')).eql({ + dataset: DATA_VIEW_ID, + timeRange: { to: 'now' }, + query: { query: '', language: 'kuery' }, + filters: [], + }); + expect(parsedViewInAppUrl.params.timeRange.from).match(ISO_DATE_REGEX); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_us_fired.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_us_fired.ts deleted file mode 100644 index 05b6ded5191d..000000000000 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/avg_us_fired.ts +++ /dev/null @@ -1,232 +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 moment from 'moment'; -import { format } from 'url'; -import expect from '@kbn/expect'; -import { COMPARATORS } from '@kbn/alerting-comparators'; -import { ApmSynthtraceEsClient } from '@kbn/apm-synthtrace'; -import { Aggregators } from '@kbn/observability-plugin/common/custom_threshold_rule/types'; -import { FIRED_ACTIONS_ID } from '@kbn/observability-plugin/server/lib/rules/custom_threshold/constants'; -import { OBSERVABILITY_THRESHOLD_RULE_TYPE_ID } from '@kbn/rule-data-utils'; -import { kbnTestConfig } from '@kbn/test'; -import type { InternalRequestHeader, RoleCredentials } from '@kbn/ftr-common-functional-services'; -import { DeploymentAgnosticFtrProviderContext } from '../../../../ftr_provider_context'; -import { getSyntraceClient, generateData } from './helpers/syntrace'; -import { ActionDocument } from './types'; - -export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { - const start = moment(Date.now()).subtract(10, 'minutes').valueOf(); - const end = moment(Date.now()).add(15, 'minutes').valueOf(); - const esClient = getService('es'); - const samlAuth = getService('samlAuth'); - const supertestWithoutAuth = getService('supertestWithoutAuth'); - const esDeleteAllIndices = getService('esDeleteAllIndices'); - const alertingApi = getService('alertingApi'); - const dataViewApi = getService('dataViewApi'); - const config = getService('config'); - const kibanaServerConfig = config.get('servers.kibana'); - const isServerless = config.get('serverless'); - const expectedConsumer = isServerless ? 'observability' : 'logs'; - const kibanaUrl = format(kibanaServerConfig); - let roleAuthc: RoleCredentials; - let internalReqHeader: InternalRequestHeader; - - describe('AVG - US - FIRED', () => { - const CUSTOM_THRESHOLD_RULE_ALERT_INDEX = '.alerts-observability.threshold.alerts-default'; - const ALERT_ACTION_INDEX = 'alert-action-threshold'; - const DATA_VIEW = 'traces-apm*,metrics-apm*,logs-apm*'; - const DATA_VIEW_ID = 'data-view-id'; - const DATA_VIEW_NAME = 'test-data-view-name'; - - let synthtraceEsClient: ApmSynthtraceEsClient; - let actionId: string; - let ruleId: string; - let alertId: string; - - before(async () => { - roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); - internalReqHeader = samlAuth.getInternalRequestHeader(); - synthtraceEsClient = await getSyntraceClient({ esClient, kibanaUrl }); - await generateData({ synthtraceEsClient, start, end }); - await dataViewApi.create({ - name: DATA_VIEW_NAME, - id: DATA_VIEW_ID, - title: DATA_VIEW, - roleAuthc, - }); - }); - - after(async () => { - await supertestWithoutAuth - .delete(`/api/alerting/rule/${ruleId}`) - .set(roleAuthc.apiKeyHeader) - .set(internalReqHeader); - await supertestWithoutAuth - .delete(`/api/actions/connector/${actionId}`) - .set(roleAuthc.apiKeyHeader) - .set(internalReqHeader); - await esDeleteAllIndices([ALERT_ACTION_INDEX]); - await esClient.deleteByQuery({ - index: CUSTOM_THRESHOLD_RULE_ALERT_INDEX, - query: { term: { 'kibana.alert.rule.uuid': ruleId } }, - }); - await esClient.deleteByQuery({ - index: '.kibana-event-log-*', - query: { term: { 'kibana.alert.rule.consumer': expectedConsumer } }, - }); - await synthtraceEsClient.clean(); - await dataViewApi.delete({ - id: DATA_VIEW_ID, - roleAuthc, - }); - await samlAuth.invalidateM2mApiKeyWithRoleScope(roleAuthc); - }); - - describe('Rule creation', () => { - it('creates rule successfully', async () => { - actionId = await alertingApi.createIndexConnector({ - roleAuthc, - name: 'Index Connector: Threshold API test', - indexName: ALERT_ACTION_INDEX, - }); - - const createdRule = await alertingApi.createRule({ - roleAuthc, - tags: ['observability'], - consumer: expectedConsumer, - name: 'Threshold rule', - ruleTypeId: OBSERVABILITY_THRESHOLD_RULE_TYPE_ID, - params: { - criteria: [ - { - comparator: COMPARATORS.GREATER_THAN, - threshold: [7500000], - timeSize: 5, - timeUnit: 'm', - metrics: [ - { name: 'A', field: 'span.self_time.sum.us', aggType: Aggregators.AVERAGE }, - ], - }, - ], - alertOnNoData: true, - alertOnGroupDisappear: true, - searchConfiguration: { - query: { - query: '', - language: 'kuery', - }, - index: DATA_VIEW_ID, - }, - }, - actions: [ - { - group: FIRED_ACTIONS_ID, - id: actionId, - params: { - documents: [ - { - ruleType: '{{rule.type}}', - alertDetailsUrl: '{{context.alertDetailsUrl}}', - reason: '{{context.reason}}', - value: '{{context.value}}', - }, - ], - }, - frequency: { - notify_when: 'onActionGroupChange', - throttle: null, - summary: false, - }, - }, - ], - }); - ruleId = createdRule.id; - expect(ruleId).not.to.be(undefined); - }); - - it('should be active', async () => { - const executionStatus = await alertingApi.waitForRuleStatus({ - roleAuthc, - ruleId, - expectedStatus: 'active', - }); - expect(executionStatus).to.be('active'); - }); - - it('should set correct information in the alert document', async () => { - const resp = await alertingApi.waitForAlertInIndex({ - indexName: CUSTOM_THRESHOLD_RULE_ALERT_INDEX, - ruleId, - }); - alertId = (resp.hits.hits[0]._source as any)['kibana.alert.uuid']; - - expect(resp.hits.hits[0]._source).property( - 'kibana.alert.rule.category', - 'Custom threshold' - ); - expect(resp.hits.hits[0]._source).property('kibana.alert.rule.consumer', expectedConsumer); - expect(resp.hits.hits[0]._source).property('kibana.alert.rule.name', 'Threshold rule'); - expect(resp.hits.hits[0]._source).property('kibana.alert.rule.producer', 'observability'); - expect(resp.hits.hits[0]._source).property('kibana.alert.rule.revision', 0); - expect(resp.hits.hits[0]._source).property( - 'kibana.alert.rule.rule_type_id', - 'observability.rules.custom_threshold' - ); - expect(resp.hits.hits[0]._source).property('kibana.alert.rule.uuid', ruleId); - expect(resp.hits.hits[0]._source).property('kibana.space_ids').contain('default'); - expect(resp.hits.hits[0]._source) - .property('kibana.alert.rule.tags') - .contain('observability'); - expect(resp.hits.hits[0]._source).property( - 'kibana.alert.action_group', - 'custom_threshold.fired' - ); - expect(resp.hits.hits[0]._source).property('tags').contain('observability'); - expect(resp.hits.hits[0]._source).property('kibana.alert.instance.id', '*'); - expect(resp.hits.hits[0]._source).property('kibana.alert.workflow_status', 'open'); - expect(resp.hits.hits[0]._source).property('event.kind', 'signal'); - expect(resp.hits.hits[0]._source).property('event.action', 'open'); - expect(resp.hits.hits[0]._source) - .property('kibana.alert.evaluation.threshold') - .eql([7500000]); - expect(resp.hits.hits[0]._source) - .property('kibana.alert.rule.parameters') - .eql({ - criteria: [ - { - comparator: '>', - threshold: [7500000], - timeSize: 5, - timeUnit: 'm', - metrics: [{ name: 'A', field: 'span.self_time.sum.us', aggType: 'avg' }], - }, - ], - alertOnNoData: true, - alertOnGroupDisappear: true, - searchConfiguration: { index: 'data-view-id', query: { query: '', language: 'kuery' } }, - }); - }); - - it('should set correct action parameter: ruleType', async () => { - const resp = await alertingApi.waitForDocumentInIndex({ - indexName: ALERT_ACTION_INDEX, - docCountTarget: 1, - }); - const { protocol, hostname, port } = kbnTestConfig.getUrlPartsWithStrippedDefaultPort(); - expect(resp.hits.hits[0]._source?.ruleType).eql('observability.rules.custom_threshold'); - expect(resp.hits.hits[0]._source?.alertDetailsUrl).eql( - `${protocol}://${hostname}${port ? `:${port}` : ''}/app/observability/alerts/${alertId}` - ); - expect(resp.hits.hits[0]._source?.reason).eql( - `Average span.self_time.sum.us is 10,000,000, above the threshold of 7,500,000. (duration: 5 mins, data view: ${DATA_VIEW_NAME})` - ); - expect(resp.hits.hits[0]._source?.value).eql('10,000,000'); - }); - }); - }); -} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/index.ts index 96a3351043ae..45a8f2d8b1b4 100644 --- a/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/alerting/custom_threshold/index.ts @@ -11,7 +11,7 @@ export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) describe('Custom Threshold rule', () => { loadTestFile(require.resolve('./avg_pct_fired')); loadTestFile(require.resolve('./avg_pct_no_data')); - loadTestFile(require.resolve('./avg_us_fired')); + loadTestFile(require.resolve('./avg_ticks_fired')); loadTestFile(require.resolve('./custom_eq_avg_bytes_fired')); loadTestFile(require.resolve('./documents_count_fired')); loadTestFile(require.resolve('./group_by_fired')); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor.ts new file mode 100644 index 000000000000..1e985975db1d --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor.ts @@ -0,0 +1,304 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import { RoleCredentials, SamlAuthProviderType } from '@kbn/ftr-common-functional-services'; +import epct from 'expect'; +import moment from 'moment/moment'; +import { v4 as uuidv4 } from 'uuid'; +import { omit, omitBy } from 'lodash'; +import { + ConfigKey, + MonitorTypeEnum, + HTTPFields, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { DEFAULT_FIELDS } from '@kbn/synthetics-plugin/common/constants/monitor_defaults'; +import { + removeMonitorEmptyValues, + transformPublicKeys, +} from '@kbn/synthetics-plugin/server/routes/monitor_cruds/formatters/saved_object_to_monitor'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export const addMonitorAPIHelper = async ( + supertestAPI: any, + monitor: any, + statusCode = 200, + roleAuthc: RoleCredentials, + samlAuth: SamlAuthProviderType +) => { + const result = await supertestAPI + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(roleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(statusCode); + + if (statusCode === 200) { + const { created_at: createdAt, updated_at: updatedAt, id, config_id: configId } = result.body; + expect(id).not.empty(); + expect(configId).not.empty(); + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + return { + rawBody: result.body, + body: { + ...omit(result.body, ['created_at', 'updated_at', 'id', 'config_id', 'form_monitor_type']), + }, + }; + } + return result.body; +}; + +export const keyToOmitList = [ + 'created_at', + 'updated_at', + 'id', + 'config_id', + 'form_monitor_type', + 'spaceId', + 'private_locations', +]; + +export const omitMonitorKeys = (monitor: any) => { + return omitBy(omit(transformPublicKeys(monitor), keyToOmitList), removeMonitorEmptyValues); +}; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('AddNewMonitorsUI', function () { + const supertestAPI = getService('supertestWithoutAuth'); + const samlAuth = getService('samlAuth'); + const kibanaServer = getService('kibanaServer'); + const monitorTestService = new SyntheticsMonitorTestService(getService); + const privateLocationsService = new PrivateLocationTestService(getService); + + let privateLocation: PrivateLocation; + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + let editorRoleAuthc: RoleCredentials; + + const addMonitorAPI = async (monitor: any, statusCode = 200) => { + return addMonitorAPIHelper(supertestAPI, monitor, statusCode, editorRoleAuthc, samlAuth); + }; + + const deleteMonitor = async ( + monitorId?: string | string[], + statusCode = 200, + spaceId?: string + ) => { + return monitorTestService.deleteMonitor(editorRoleAuthc, monitorId, statusCode, spaceId); + }; + + before(async () => { + _httpMonitorJson = getFixtureJson('http_monitor'); + await kibanaServer.savedObjects.cleanStandardList(); + editorRoleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + }); + + beforeEach(async () => { + privateLocation = await privateLocationsService.addTestPrivateLocation(); + httpMonitorJson = { + ..._httpMonitorJson, + locations: [privateLocation], + }; + }); + + it('returns the newly added monitor', async () => { + const newMonitor = httpMonitorJson; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + expect(apiResponse).eql(omitMonitorKeys(newMonitor)); + }); + + it('returns bad request if payload is invalid for HTTP monitor', async () => { + // Delete a required property to make payload invalid + const newMonitor = { ...httpMonitorJson, 'check.request.headers': null }; + await addMonitorAPI(newMonitor, 400); + }); + + it('returns bad request if monitor type is invalid', async () => { + const newMonitor = { ...httpMonitorJson, type: 'invalid-data-steam' }; + + const apiResponse = await addMonitorAPI(newMonitor, 400); + + expect(apiResponse.message).eql('Invalid value "invalid-data-steam" supplied to "type"'); + }); + + it('can create valid monitors without all defaults', async () => { + // Delete a required property to make payload invalid + const newMonitor = { + name: 'Sample name', + type: 'http', + urls: 'https://elastic.co', + locations: [privateLocation], + }; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + expect(apiResponse).eql( + omitMonitorKeys({ + ...DEFAULT_FIELDS[MonitorTypeEnum.HTTP], + ...newMonitor, + }) + ); + }); + + it('can disable retries', async () => { + const maxAttempts = 1; + const newMonitor = { + max_attempts: maxAttempts, + urls: 'https://elastic.co', + name: `Sample name ${uuidv4()}`, + type: 'http', + locations: [privateLocation], + }; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + epct(apiResponse).toEqual(epct.objectContaining({ retest_on_failure: false })); + }); + + it('can enable retries with max attempts', async () => { + const maxAttempts = 2; + const newMonitor = { + max_attempts: maxAttempts, + urls: 'https://elastic.co', + name: `Sample name ${uuidv4()}`, + type: 'http', + locations: [privateLocation], + }; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + epct(apiResponse).toEqual(epct.objectContaining({ retest_on_failure: true })); + }); + + it('can enable retries', async () => { + const newMonitor = { + retest_on_failure: false, + urls: 'https://elastic.co', + name: `Sample name ${uuidv4()}`, + type: 'http', + locations: [privateLocation], + }; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + epct(apiResponse).toEqual(epct.objectContaining({ retest_on_failure: false })); + }); + + it('cannot create a invalid monitor without a monitor type', async () => { + // Delete a required property to make payload invalid + const newMonitor = { + name: 'Sample name', + url: 'https://elastic.co', + locations: [privateLocation], + }; + await addMonitorAPI(newMonitor, 400); + }); + + it('omits unknown keys', async () => { + // Delete a required property to make payload invalid + const newMonitor = { + name: 'Sample name', + url: 'https://elastic.co', + unknownKey: 'unknownValue', + type: 'http', + locations: [privateLocation], + }; + const apiResponse = await addMonitorAPI(newMonitor, 400); + expect(apiResponse.message).not.to.have.keys( + 'Invalid monitor key(s) for http type: unknownKey","attributes":{"details":"Invalid monitor key(s) for http type: unknownKey' + ); + }); + + it('sets namespace to Kibana space when not set to a custom namespace', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const EXPECTED_NAMESPACE = formatKibanaNamespace(SPACE_ID); + privateLocation = await privateLocationsService.addTestPrivateLocation(SPACE_ID); + const monitor = { + ...httpMonitorJson, + [ConfigKey.NAMESPACE]: 'default', + locations: [privateLocation], + }; + let monitorId = ''; + + try { + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + const apiResponse = await supertestAPI + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + monitorId = apiResponse.body.id; + expect(apiResponse.body[ConfigKey.NAMESPACE]).eql(EXPECTED_NAMESPACE); + } finally { + await deleteMonitor(monitorId, 200, SPACE_ID); + } + }); + + it('preserves the passed namespace when preserve_namespace is passed', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + privateLocation = await privateLocationsService.addTestPrivateLocation(SPACE_ID); + const monitor = { + ...httpMonitorJson, + [ConfigKey.NAMESPACE]: 'default', + locations: [privateLocation], + }; + let monitorId = ''; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + try { + const apiResponse = await supertestAPI + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ preserve_namespace: true }) + .set(editorRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + monitorId = apiResponse.body.id; + expect(apiResponse.body[ConfigKey.NAMESPACE]).eql('default'); + } finally { + await deleteMonitor(monitorId, 200, SPACE_ID); + } + }); + + it('sets namespace to custom namespace when set', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + privateLocation = await privateLocationsService.addTestPrivateLocation(SPACE_ID); + const monitor = { + ...httpMonitorJson, + locations: [privateLocation], + }; + let monitorId = ''; + + try { + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + const apiResponse = await supertestAPI + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + monitorId = apiResponse.body.id; + expect(apiResponse.body[ConfigKey.NAMESPACE]).eql(monitor[ConfigKey.NAMESPACE]); + } finally { + await deleteMonitor(monitorId, 200, SPACE_ID); + } + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_private_location.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_private_location.ts new file mode 100644 index 000000000000..7141eab30d8f --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_private_location.ts @@ -0,0 +1,560 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 semver from 'semver'; +import { v4 as uuidv4 } from 'uuid'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + ConfigKey, + HTTPFields, + PrivateLocation, + ServiceLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { omit } from 'lodash'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import expect from '@kbn/expect'; +import rawExpect from 'expect'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { comparePolicies, getTestSyntheticsPolicy } from './sample_data/test_policy'; +import { + INSTALLED_VERSION, + PrivateLocationTestService, +} from '../../../services/synthetics_private_location'; +import { addMonitorAPIHelper, keyToOmitList, omitMonitorKeys } from './create_monitor'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('PrivateLocationAddMonitor', function () { + const kibanaServer = getService('kibanaServer'); + const supertestAPI = getService('supertestWithoutAuth'); + const supertestWithAuth = getService('supertest'); + const samlAuth = getService('samlAuth'); + + let testFleetPolicyID: string; + let editorUser: RoleCredentials; + let privateLocations: PrivateLocation[] = []; + const testPolicyName = 'Fleet test server policy' + Date.now(); + + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + const monitorTestService = new SyntheticsMonitorTestService(getService); + const testPrivateLocations = new PrivateLocationTestService(getService); + + const addMonitorAPI = async (monitor: any, statusCode = 200) => { + return addMonitorAPIHelper(supertestAPI, monitor, statusCode, editorUser, samlAuth); + }; + + const deleteMonitor = async ( + monitorId?: string | string[], + statusCode = 200, + spaceId?: string + ) => { + return monitorTestService.deleteMonitor(editorUser, monitorId, statusCode, spaceId); + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await testPrivateLocations.installSyntheticsPackage(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + + _httpMonitorJson = getFixtureJson('http_monitor'); + }); + + beforeEach(() => { + httpMonitorJson = { + ..._httpMonitorJson, + locations: privateLocations ? [privateLocations[0]] : [], + }; + }); + + it('adds a test fleet policy', async () => { + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testFleetPolicyID = apiResponse.body.item.id; + }); + + it('add a test private location', async () => { + privateLocations = await testPrivateLocations.setTestLocations([testFleetPolicyID]); + + const apiResponse = await supertestAPI + .get(SYNTHETICS_API_URLS.SERVICE_LOCATIONS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const testResponse: Array = [ + { + id: testFleetPolicyID, + isServiceManaged: false, + isInvalid: false, + label: privateLocations[0].label, + geo: { + lat: 0, + lon: 0, + }, + agentPolicyId: testFleetPolicyID, + }, + ]; + + rawExpect(apiResponse.body.locations).toEqual(rawExpect.arrayContaining(testResponse)); + }); + + it('does not add a monitor if there is an error in creating integration', async () => { + const newMonitor = { ...httpMonitorJson }; + const invalidName = 'invalid name'; + + const location = { + id: 'invalidLocation', + label: privateLocations[0].label, + isServiceManaged: false, + geo: { + lat: 0, + lon: 0, + }, + }; + + newMonitor.name = invalidName; + + const apiResponse = await supertestAPI + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ ...newMonitor, locations: [location] }) + .expect(400); + + expect(apiResponse.body).eql({ + statusCode: 400, + error: 'Bad Request', + message: `Invalid locations specified. Private Location(s) 'invalidLocation' not found. Available private locations are '${privateLocations[0].label}'`, + }); + + const apiGetResponse = await supertestAPI + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + `?query="${invalidName}"`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + // verify that no monitor was added + expect(apiGetResponse.body.monitors?.length).eql(0); + }); + + let newMonitorId: string; + + it('adds a monitor in private location', async () => { + const newMonitor = { + ...httpMonitorJson, + locations: [privateLocations[0]], + }; + + const { body, rawBody } = await addMonitorAPI(newMonitor); + + expect(body).eql(omitMonitorKeys(newMonitor)); + newMonitorId = rawBody.id; + }); + + it('added an integration for previously added monitor', async () => { + const apiResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy?.policy_id).eql(testFleetPolicyID); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: httpMonitorJson.name, + id: newMonitorId, + location: { id: testFleetPolicyID, name: privateLocations[0].label }, + }) + ); + }); + + let testFleetPolicyID2: string; + let newLocations: PrivateLocation[] = []; + + it('edits a monitor with additional private location', async () => { + const resPolicy = await testPrivateLocations.addFleetPolicy(testPolicyName + 1); + testFleetPolicyID2 = resPolicy.body.item.id; + + newLocations = await testPrivateLocations.setTestLocations([ + testFleetPolicyID, + testFleetPolicyID2, + ]); + + httpMonitorJson.locations.push({ + id: testFleetPolicyID2, + agentPolicyId: testFleetPolicyID2, + label: newLocations[1].label, + isServiceManaged: false, + geo: { + lat: 0, + lon: 0, + }, + }); + + const apiResponse = await supertestAPI + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + newMonitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(httpMonitorJson); + + const { created_at: createdAt, updated_at: updatedAt } = apiResponse.body; + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + expect(omit(apiResponse.body, keyToOmitList)).eql( + omitMonitorKeys({ + ...omit(httpMonitorJson, ['urls']), + url: httpMonitorJson.urls, + updated_at: updatedAt, + revision: 2, + }) + ); + }); + + it('added an integration for second location in edit monitor', async () => { + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + let packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: httpMonitorJson.name, + id: newMonitorId, + location: { id: testFleetPolicyID, name: privateLocations[0].label }, + }) + ); + + packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID2 + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID2); + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: httpMonitorJson.name, + id: newMonitorId, + location: { + name: newLocations[1].label, + id: testFleetPolicyID2, + }, + }) + ); + }); + + it('deletes integration for a removed location from monitor', async () => { + httpMonitorJson.locations = httpMonitorJson.locations.filter( + ({ id }) => id !== testFleetPolicyID2 + ); + + await supertestAPI + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + newMonitorId + '?internal=true') + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(httpMonitorJson) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + let packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: httpMonitorJson.name, + id: newMonitorId, + location: { id: testFleetPolicyID, name: privateLocations[0].label }, + }) + ); + + packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID2 + '-default' + ); + + expect(packagePolicy).eql(undefined); + }); + + it('deletes integration for a deleted monitor', async () => { + await deleteMonitor(newMonitorId); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy).eql(undefined); + }); + + // it('handles spaces', async () => { + // const username = 'admin'; + // const password = `${username}-password`; + // const roleName = 'uptime-role'; + // const SPACE_ID = `test-space-${uuidv4()}`; + // const SPACE_NAME = `test-space-name ${uuidv4()}`; + // let monitorId = ''; + // const monitor = { + // ...httpMonitorJson, + // name: `Test monitor ${uuidv4()}`, + // [ConfigKey.NAMESPACE]: 'default', + // locations: [ + // { + // id: testFleetPolicyID, + // agentPolicyId: testFleetPolicyID, + // label: 'Test private location 0', + // isServiceManaged: false, + // geo: { + // lat: 0, + // lon: 0, + // }, + // }, + // ], + // }; + + // try { + // await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + // await security.role.create(roleName, { + // kibana: [ + // { + // feature: { + // uptime: ['all'], + // actions: ['all'], + // }, + // spaces: ['*'], + // }, + // ], + // }); + // await security.user.create(username, { + // password, + // roles: [roleName], + // full_name: 'a kibana user', + // }); + // const apiResponse = await supertestWithoutAuth + // .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + // .auth(username, password) + // .set('kbn-xsrf', 'true') + // .send(monitor) + // .expect(200); + + // const { created_at: createdAt, updated_at: updatedAt } = apiResponse.body; + // expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + // expect(omit(apiResponse.body, keyToOmitList)).eql( + // omitMonitorKeys({ + // ...monitor, + // [ConfigKey.NAMESPACE]: formatKibanaNamespace(SPACE_ID), + // url: apiResponse.body.url, + // }) + // ); + // monitorId = apiResponse.body.id; + + // const policyResponse = await supertestWithAuth.get( + // '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + // ); + + // const packagePolicy = policyResponse.body.items.find( + // (pkgPolicy: PackagePolicy) => + // pkgPolicy.id === monitorId + '-' + testFleetPolicyID + `-${SPACE_ID}` + // ); + + // expect(packagePolicy.policy_id).eql(testFleetPolicyID); + // expect(packagePolicy.name).eql(`${monitor.name}-Test private location 0-${SPACE_ID}`); + // comparePolicies( + // packagePolicy, + // getTestSyntheticsPolicy({ + // name: monitor.name, + // id: monitorId, + // location: { id: testFleetPolicyID }, + // namespace: formatKibanaNamespace(SPACE_ID), + // spaceId: SPACE_ID, + // }) + // ); + // await supertestWithoutAuth + // .delete(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + // .auth(username, password) + // .set('kbn-xsrf', 'true') + // .send({ ids: [monitorId] }) + // .expect(200); + // } finally { + // await security.user.delete(username); + // await security.role.delete(roleName); + // } + // }); + + it('handles is_tls_enabled true', async () => { + let monitorId = ''; + + const monitor = { + ...httpMonitorJson, + locations: [ + { + id: testFleetPolicyID, + label: privateLocations[0].label, + isServiceManaged: false, + }, + ], + [ConfigKey.METADATA]: { + is_tls_enabled: true, + }, + }; + + try { + const apiResponse = await supertestAPI + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + + monitorId = apiResponse.body.id; + + const policyResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = policyResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === monitorId + '-' + testFleetPolicyID + `-default` + ); + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: monitor.name, + id: monitorId, + location: { id: testFleetPolicyID, name: privateLocations[0].label }, + isTLSEnabled: true, + }) + ); + } finally { + await deleteMonitor(monitorId); + } + }); + + it('handles is_tls_enabled false', async () => { + let monitorId = ''; + + const monitor = { + ...httpMonitorJson, + locations: [ + { + id: testFleetPolicyID, + label: privateLocations[0].label, + isServiceManaged: false, + }, + ], + [ConfigKey.METADATA]: { + is_tls_enabled: false, + }, + }; + + try { + const apiResponse = await supertestAPI + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + + monitorId = apiResponse.body.id; + + const policyResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = policyResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === monitorId + '-' + testFleetPolicyID + `-default` + ); + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: monitor.name, + id: monitorId, + location: { id: testFleetPolicyID, name: privateLocations[0].label }, + }) + ); + } finally { + await deleteMonitor(monitorId); + } + }); + + it('handles auto upgrading policies', async () => { + let monitorId = ''; + + const monitor = { + ...httpMonitorJson, + name: `Test monitor ${uuidv4()}`, + [ConfigKey.NAMESPACE]: 'default', + locations: [ + { + id: testFleetPolicyID, + label: privateLocations[0].label, + isServiceManaged: false, + }, + ], + }; + + try { + const apiResponse = await supertestAPI + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + monitorId = apiResponse.body.id; + + const policyResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = policyResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === monitorId + '-' + testFleetPolicyID + `-default` + ); + + expect(packagePolicy.package.version).eql(INSTALLED_VERSION); + + await supertestWithAuth.post('/api/fleet/setup').set('kbn-xsrf', 'true').send().expect(200); + const policyResponseAfterUpgrade = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + const packagePolicyAfterUpgrade = policyResponseAfterUpgrade.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === monitorId + '-' + testFleetPolicyID + `-default` + ); + expect(semver.gte(packagePolicyAfterUpgrade.package.version, INSTALLED_VERSION)).eql(true); + } finally { + await deleteMonitor(monitorId); + } + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project.ts new file mode 100644 index 000000000000..d8f7e7860729 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project.ts @@ -0,0 +1,2194 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import expect from '@kbn/expect'; +import rawExpect from 'expect'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + ConfigKey, + ProjectMonitorsRequest, + PrivateLocation, + ServiceLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { formatKibanaNamespace } from '@kbn/synthetics-plugin/common/formatters'; +import { REQUEST_TOO_LARGE } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/add_monitor_project'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import { + PROFILE_VALUES_ENUM, + PROFILES_MAP, +} from '@kbn/synthetics-plugin/common/constants/monitor_defaults'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { comparePolicies } from './sample_data/test_policy'; +import { + getTestProjectSyntheticsPolicy, + getTestProjectSyntheticsPolicyLightweight, +} from './sample_data/test_project_monitor_policy'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('AddProjectMonitors', function () { + const supertest = getService('supertestWithoutAuth'); + const supertestWithAuth = getService('supertest'); + const kibanaServer = getService('kibanaServer'); + const monitorTestService = new SyntheticsMonitorTestService(getService); + const testPrivateLocations = new PrivateLocationTestService(getService); + const samlAuth = getService('samlAuth'); + + let projectMonitors: ProjectMonitorsRequest; + let httpProjectMonitors: ProjectMonitorsRequest; + let tcpProjectMonitors: ProjectMonitorsRequest; + let icmpProjectMonitors: ProjectMonitorsRequest; + let editorUser: RoleCredentials; + let viewerUser: RoleCredentials; + let privateLocations: PrivateLocation[] = []; + + let testPolicyId1 = ''; + let testPolicyId2 = ''; + const testPolicyName = 'Fleet test server policy' + Date.now(); + + const setUniqueIds = (request: ProjectMonitorsRequest) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuidv4() })), + }; + }; + + const deleteMonitor = async ( + journeyId: string, + projectId: string, + space: string = 'default' + ) => { + try { + const response = await supertest + .get(`/s/${space}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: "${journeyId}" AND ${syntheticsMonitorType}.attributes.project_id: "${projectId}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const { monitors } = response.body; + if (monitors[0]?.config_id) { + await monitorTestService.deleteMonitor(editorUser, monitors[0].config_id, 200, space); + } + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + viewerUser = await samlAuth.createM2mApiKeyWithRoleScope('viewer'); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + await testPrivateLocations.installSyntheticsPackage(); + + const apiResponse1 = await testPrivateLocations.addFleetPolicy(testPolicyName); + const apiResponse2 = await testPrivateLocations.addFleetPolicy(`${testPolicyName}-2`); + testPolicyId1 = apiResponse1.body.item.id; + testPolicyId2 = apiResponse2.body.item.id; + privateLocations = await testPrivateLocations.setTestLocations([ + testPolicyId1, + testPolicyId2, + ]); + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'testGlobalParam', value: 'testGlobalParamValue' }) + .expect(200); + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'testGlobalParam2', value: 'testGlobalParamValue2' }) + .expect(200); + const spaces = (await kibanaServer.spaces.list()) as Array<{ + id: string; + }>; + for (let i = 0; i < spaces.length; i++) { + if (spaces[i].id !== 'default') await kibanaServer.spaces.delete(spaces[i].id); + } + }); + + beforeEach(async () => { + await kibanaServer.savedObjects.clean({ + types: ['synthetics-monitor', 'ingest-package-policies'], + }); + const formatLocations = (monitors: ProjectMonitorsRequest['monitors']) => { + return monitors.map((monitor) => { + return { + ...monitor, + /* cannot configure public locations for deployment agnostic tests + * they would fail in MKI and ESS due to missing mock location */ + locations: [], + privateLocations: [privateLocations[0].label], + }; + }); + }; + projectMonitors = setUniqueIds({ + monitors: formatLocations(getFixtureJson('project_browser_monitor').monitors), + }); + httpProjectMonitors = setUniqueIds({ + monitors: formatLocations(getFixtureJson('project_http_monitor').monitors), + }); + tcpProjectMonitors = setUniqueIds({ + monitors: formatLocations(getFixtureJson('project_tcp_monitor').monitors), + }); + icmpProjectMonitors = setUniqueIds({ + monitors: formatLocations(getFixtureJson('project_icmp_monitor').monitors), + }); + }); + + it('project monitors - returns 404 for non-existing spaces', async () => { + const project = `test-project-${uuidv4()}`; + await supertest + .put( + `/s/i_dont_exist${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(404); + }); + + it('project monitors - handles browser monitors', async () => { + const successfulMonitors = [projectMonitors.monitors[0]]; + const project = `test-project-${uuidv4()}`; + + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [], + }); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const createdMonitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const decryptedCreatedMonitor = await monitorTestService.getMonitor( + createdMonitorsResponse.body.monitors[0].config_id, + { + internal: true, + user: editorUser, + } + ); + + expect(decryptedCreatedMonitor.rawBody).to.eql({ + __ui: { + script_source: { + file_name: '', + is_generated_script: false, + }, + }, + config_id: decryptedCreatedMonitor.rawBody.config_id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + enabled: true, + alert: { + status: { + enabled: true, + }, + tls: { + enabled: true, + }, + }, + 'filter_journeys.match': 'check if title is present', + 'filter_journeys.tags': [], + form_monitor_type: 'multistep', + ignore_https_errors: false, + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: testPolicyId1, + agentPolicyId: testPolicyId1, + isServiceManaged: false, + label: privateLocations[0].label, + }, + ], + name: 'check if title is present', + namespace: 'default', + origin: 'project', + original_space: 'default', + playwright_options: '{"headless":true,"chromiumSandbox":false}', + playwright_text_assertion: '', + project_id: project, + params: '', + revision: 1, + schedule: { + number: '10', + unit: 'm', + }, + screenshots: 'on', + 'service.name': '', + synthetics_args: [], + tags: [], + throttling: PROFILES_MAP[PROFILE_VALUES_ENUM.DEFAULT], + 'ssl.certificate': '', + 'ssl.certificate_authorities': '', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': 'full', + 'ssl.key': '', + 'ssl.key_passphrase': '', + 'source.inline.script': '', + 'source.project.content': + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + timeout: null, + type: 'browser', + 'url.port': null, + urls: '', + id: `${journeyId}-${project}-default`, + hash: 'ekrjelkjrelkjre', + max_attempts: 2, + updated_at: decryptedCreatedMonitor.rawBody.updated_at, + created_at: decryptedCreatedMonitor.rawBody.created_at, + labels: {}, + }); + } + }); + + it('project monitors - allows throttling false for browser monitors', async () => { + const successfulMonitors = [projectMonitors.monitors[0]]; + const project = `test-project-${uuidv4()}`; + + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + ...projectMonitors, + monitors: [{ ...projectMonitors.monitors[0], throttling: false }], + }) + .expect(200); + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [], + }); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const createdMonitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const decryptedCreatedMonitor = await monitorTestService.getMonitor( + createdMonitorsResponse.body.monitors[0].config_id, + { user: editorUser } + ); + + expect(decryptedCreatedMonitor.body.throttling).to.eql({ + value: null, + id: 'no-throttling', + label: 'No throttling', + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - handles http monitors', async () => { + const kibanaVersion = await kibanaServer.version.get(); + const successfulMonitors = [httpProjectMonitors.monitors[1]]; + const project = `test-project-${uuidv4()}`; + + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(httpProjectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: httpProjectMonitors.monitors[0].id, + details: `\`http\` project monitors must have exactly one value for field \`urls\` in version \`${kibanaVersion}\`. Your monitor was not created or updated.`, + reason: 'Invalid Heartbeat configuration', + }, + { + id: httpProjectMonitors.monitors[0].id, + details: `The following Heartbeat options are not supported for ${httpProjectMonitors.monitors[0].type} project monitors in ${kibanaVersion}: check.response.body|unsupportedKey.nestedUnsupportedKey. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + ], + }); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const isTLSEnabled = Object.keys(monitor).some((key) => key.includes('ssl')); + const createdMonitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const { rawBody: decryptedCreatedMonitor } = await monitorTestService.getMonitor( + createdMonitorsResponse.body.monitors[0].config_id, + { + internal: true, + user: editorUser, + } + ); + + expect(decryptedCreatedMonitor).to.eql({ + __ui: { + is_tls_enabled: isTLSEnabled, + }, + 'check.request.method': 'POST', + 'check.response.status': ['200'], + config_id: decryptedCreatedMonitor.config_id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + 'check.response.body.negative': [], + 'check.response.body.positive': ['${testLocal1}', 'saved'], + 'check.response.json': [ + { description: 'check status', expression: 'foo.bar == "myValue"' }, + ], + 'check.response.headers': {}, + proxy_url: '${testGlobalParam2}', + 'check.request.body': { + type: 'text', + value: '', + }, + params: JSON.stringify({ + testLocal1: 'testLocalParamsValue', + testGlobalParam2: 'testGlobalParamOverwrite', + }), + 'check.request.headers': { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + enabled: false, + alert: { + status: { + enabled: true, + }, + tls: { + enabled: true, + }, + }, + form_monitor_type: 'http', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: testPolicyId1, + agentPolicyId: testPolicyId1, + isServiceManaged: false, + label: privateLocations[0].label, + }, + ], + max_redirects: '0', + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: project, + username: '', + password: '', + proxy_headers: {}, + 'response.include_body': 'always', + 'response.include_headers': false, + 'response.include_body_max_bytes': '900', + revision: 1, + schedule: { + number: '60', + unit: 'm', + }, + 'service.name': '', + 'ssl.certificate': '', + 'ssl.certificate_authorities': '', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': isTLSEnabled ? 'strict' : 'full', + 'ssl.key': '', + 'ssl.key_passphrase': '', + tags: Array.isArray(monitor.tags) ? monitor.tags : monitor.tags?.split(','), + timeout: '80', + type: 'http', + urls: Array.isArray(monitor.urls) ? monitor.urls?.[0] : monitor.urls, + 'url.port': null, + id: `${journeyId}-${project}-default`, + hash: 'ekrjelkjrelkjre', + mode: 'any', + ipv6: true, + ipv4: true, + max_attempts: 2, + labels: {}, + updated_at: decryptedCreatedMonitor.updated_at, + created_at: decryptedCreatedMonitor.created_at, + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - handles tcp monitors', async () => { + const successfulMonitors = [tcpProjectMonitors.monitors[0], tcpProjectMonitors.monitors[1]]; + const kibanaVersion = await kibanaServer.version.get(); + const project = `test-project-${uuidv4()}`; + + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(tcpProjectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: tcpProjectMonitors.monitors[2].id, + details: `\`tcp\` project monitors must have exactly one value for field \`hosts\` in version \`${kibanaVersion}\`. Your monitor was not created or updated.`, + reason: 'Invalid Heartbeat configuration', + }, + { + id: tcpProjectMonitors.monitors[2].id, + details: `The following Heartbeat options are not supported for ${tcpProjectMonitors.monitors[0].type} project monitors in ${kibanaVersion}: ports|unsupportedKey.nestedUnsupportedKey. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + ], + }); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const isTLSEnabled = Object.keys(monitor).some((key) => key.includes('ssl')); + const createdMonitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const { rawBody: decryptedCreatedMonitor } = await monitorTestService.getMonitor( + createdMonitorsResponse.body.monitors[0].config_id, + { + internal: true, + user: editorUser, + } + ); + + expect(decryptedCreatedMonitor).to.eql({ + __ui: { + is_tls_enabled: isTLSEnabled, + }, + config_id: decryptedCreatedMonitor.config_id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + 'check.receive': '', + 'check.send': '', + enabled: true, + alert: { + status: { + enabled: true, + }, + tls: { + enabled: true, + }, + }, + form_monitor_type: 'tcp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: testPolicyId1, + agentPolicyId: testPolicyId1, + isServiceManaged: false, + label: privateLocations[0].label, + }, + ], + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: project, + revision: 1, + schedule: { + number: '1', + unit: 'm', + }, + proxy_url: '', + proxy_use_local_resolver: false, + 'service.name': '', + 'ssl.certificate': '', + 'ssl.certificate_authorities': '', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': isTLSEnabled ? 'strict' : 'full', + 'ssl.key': '', + 'ssl.key_passphrase': '', + tags: Array.isArray(monitor.tags) ? monitor.tags : monitor.tags?.split(','), + timeout: '16', + type: 'tcp', + hosts: Array.isArray(monitor.hosts) ? monitor.hosts?.[0] : monitor.hosts, + 'url.port': null, + urls: '', + id: `${journeyId}-${project}-default`, + hash: 'ekrjelkjrelkjre', + mode: 'any', + ipv6: true, + ipv4: true, + params: '', + max_attempts: 2, + labels: {}, + updated_at: decryptedCreatedMonitor.updated_at, + created_at: decryptedCreatedMonitor.created_at, + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - handles icmp monitors', async () => { + const successfulMonitors = [icmpProjectMonitors.monitors[0], icmpProjectMonitors.monitors[1]]; + const kibanaVersion = await kibanaServer.version.get(); + const project = `test-project-${uuidv4()}`; + + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(icmpProjectMonitors) + .expect(200); + expect(body).eql({ + updatedMonitors: [], + createdMonitors: successfulMonitors.map((monitor) => monitor.id), + failedMonitors: [ + { + id: icmpProjectMonitors.monitors[2].id, + details: `\`icmp\` project monitors must have exactly one value for field \`hosts\` in version \`${kibanaVersion}\`. Your monitor was not created or updated.`, + reason: 'Invalid Heartbeat configuration', + }, + { + id: icmpProjectMonitors.monitors[2].id, + details: `The following Heartbeat options are not supported for ${icmpProjectMonitors.monitors[0].type} project monitors in ${kibanaVersion}: unsupportedKey.nestedUnsupportedKey. You monitor was not created or updated.`, + reason: 'Unsupported Heartbeat option', + }, + ], + }); + + for (const monitor of successfulMonitors) { + const journeyId = monitor.id; + const createdMonitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ filter: `${syntheticsMonitorType}.attributes.journey_id: ${journeyId}` }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const { rawBody: decryptedCreatedMonitor } = await monitorTestService.getMonitor( + createdMonitorsResponse.body.monitors[0].config_id, + { + internal: true, + user: editorUser, + } + ); + + expect(decryptedCreatedMonitor).to.eql({ + config_id: decryptedCreatedMonitor.config_id, + custom_heartbeat_id: `${journeyId}-${project}-default`, + enabled: true, + alert: { + status: { + enabled: true, + }, + tls: { + enabled: true, + }, + }, + form_monitor_type: 'icmp', + journey_id: journeyId, + locations: [ + { + geo: { + lat: 0, + lon: 0, + }, + id: testPolicyId1, + agentPolicyId: testPolicyId1, + isServiceManaged: false, + label: privateLocations[0].label, + }, + ], + name: monitor.name, + namespace: 'default', + origin: 'project', + original_space: 'default', + project_id: project, + revision: 1, + schedule: { + number: '1', + unit: 'm', + }, + 'service.name': '', + tags: Array.isArray(monitor.tags) ? monitor.tags : monitor.tags?.split(','), + timeout: '16', + type: 'icmp', + hosts: Array.isArray(monitor.hosts) ? monitor.hosts?.[0] : monitor.hosts, + wait: + monitor.wait?.slice(-1) === 's' + ? monitor.wait?.slice(0, -1) + : `${parseInt(monitor.wait?.slice(0, -1) || '1', 10) * 60}`, + id: `${journeyId}-${project}-default`, + hash: 'ekrjelkjrelkjre', + mode: 'any', + ipv4: true, + ipv6: true, + params: '', + max_attempts: 2, + updated_at: decryptedCreatedMonitor.updated_at, + created_at: decryptedCreatedMonitor.created_at, + labels: {}, + }); + } + } finally { + await Promise.all([ + successfulMonitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - returns a list of successfully created monitors', async () => { + const project = `test-project-${uuidv4()}`; + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + failedMonitors: [], + createdMonitors: projectMonitors.monitors.map((monitor) => monitor.id), + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - returns a list of successfully updated monitors', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + + expect(body).eql({ + createdMonitors: [], + failedMonitors: [], + updatedMonitors: projectMonitors.monitors.map((monitor) => monitor.id), + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - validates monitor type', async () => { + const project = `test-project-${uuidv4()}`; + + try { + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: [{ ...projectMonitors.monitors[0], schedule: '3m', tags: '' }] }) + .expect(200); + + expect(body).eql({ + updatedMonitors: [], + failedMonitors: [ + { + details: 'Invalid value "3m" supplied to "schedule"', + id: projectMonitors.monitors[0].id, + payload: { + content: + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + filter: { + match: 'check if title is present', + }, + id: projectMonitors.monitors[0].id, + locations: [], + privateLocations: [privateLocations[0].label], + name: 'check if title is present', + params: {}, + playwrightOptions: { + chromiumSandbox: false, + headless: true, + }, + schedule: '3m', + tags: '', + throttling: { + download: 5, + latency: 20, + upload: 3, + }, + type: 'browser', + hash: 'ekrjelkjrelkjre', + max_attempts: 2, + }, + reason: "Couldn't save or update monitor because of an invalid configuration.", + }, + ], + createdMonitors: [], + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - saves space as data stream namespace', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + try { + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0][ConfigKey.NAMESPACE]).eql(formatKibanaNamespace(SPACE_ID)); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + } + }); + + it('project monitors - browser - handles custom namespace', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const customNamespace = 'custom.namespace'; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + try { + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + namespace: customNamespace, + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0][ConfigKey.NAMESPACE]).eql(customNamespace); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + } + }); + + it('project monitors - lightweight - handles custom namespace', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const customNamespace = 'custom.namespace'; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + try { + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + namespace: customNamespace, + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + + // expect monitor not to have been deleted + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${httpProjectMonitors.monitors[1].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0][ConfigKey.NAMESPACE]).eql(customNamespace); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project, SPACE_ID); + } + }); + + it('project monitors - browser - handles custom namespace errors', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const customNamespace = 'custom-namespace'; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + const { body } = await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + namespace: customNamespace, + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + // expect monitor not to have been deleted + expect(body).to.eql({ + createdMonitors: [], + failedMonitors: [ + { + details: 'Namespace contains invalid characters', + id: projectMonitors.monitors[0].id, + reason: 'Invalid namespace', + }, + ], + updatedMonitors: [], + }); + }); + + it('project monitors - lightweight - handles custom namespace errors', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const customNamespace = 'custom-namespace'; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + const { body } = await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + namespace: customNamespace, + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + // expect monitor not to have been deleted + expect(body).to.eql({ + createdMonitors: [], + failedMonitors: [ + { + details: 'Namespace contains invalid characters', + id: httpProjectMonitors.monitors[1].id, + reason: 'Invalid namespace', + }, + ], + updatedMonitors: [], + }); + }); + + it('project monitors - handles editing with spaces', async () => { + const project = `test-project-${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + try { + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: projectMonitors.monitors.map((monitor) => ({ + ...monitor, + privateLocations: [spaceScopedPrivateLocation.label], + })), + }) + .expect(200); + // expect monitor not to have been deleted + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set('kbn-xsrf', 'true') + .expect(200); + + const decryptedCreatedMonitor = await monitorTestService.getMonitor( + getResponse.body.monitors[0].config_id, + { internal: true, space: SPACE_ID, user: editorUser } + ); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(decryptedCreatedMonitor.body[ConfigKey.SOURCE_PROJECT_CONTENT]).eql( + projectMonitors.monitors[0].content + ); + + const updatedSource = 'updatedSource'; + // update monitor + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + content: updatedSource, + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + const getResponseUpdated = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .expect(200); + const { monitors: monitorsUpdated } = getResponseUpdated.body; + expect(monitorsUpdated.length).eql(1); + + const decryptedUpdatedMonitor = await monitorTestService.getMonitor( + monitorsUpdated[0].config_id, + { internal: true, space: SPACE_ID, user: editorUser } + ); + expect(decryptedUpdatedMonitor.body[ConfigKey.SOURCE_PROJECT_CONTENT]).eql(updatedSource); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + } + }); + + it('project monitors - formats custom id appropriately', async () => { + const project = `test project ${uuidv4()}`; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + try { + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: [spaceScopedPrivateLocation.label], + }, + ], + }) + .expect(200); + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]).eql( + `${projectMonitors.monitors[0].id}-${project}-${SPACE_ID}` + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project, SPACE_ID); + } + }); + + it('project monitors - is able to decrypt monitor when updated after hydration', async () => { + const project = `test-project-${uuidv4()}`; + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + + const response = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const { monitors } = response.body; + + // update project monitor via push api + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + + expect(body).eql({ + updatedMonitors: [projectMonitors.monitors[0].id], + createdMonitors: [], + failedMonitors: [], + }); + + // ensure that monitor can still be decrypted + await monitorTestService.getMonitor(monitors[0]?.config_id, { user: editorUser }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => deleteMonitor(monitor.id, project)), + ]); + } + }); + + it('project monitors - is able to enable and disable monitors', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + ...projectMonitors, + monitors: [ + { + ...projectMonitors.monitors[0], + enabled: false, + }, + ], + }) + .expect(200); + const response = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { monitors } = response.body; + expect(monitors[0].enabled).eql(false); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - cannot update project monitors with read only privileges', async () => { + const project = `test-project-${uuidv4()}`; + + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: [privateLocations[0].label], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(viewerUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: testMonitors }) + .expect(403); + }); + + it('creates integration policies for project monitors with private locations', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + ...projectMonitors, + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: [privateLocations[0].label] }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + expect(packagePolicy.name).eql( + `${projectMonitors.monitors[0].id}-${project}-default-${privateLocations[0].label}` + ); + expect(packagePolicy.policy_id).eql(testPolicyId1); + + const configId = monitorsResponse.body.monitors[0].config_id; + const id = monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: `check if title is present-${privateLocations[0].label}`, + id, + configId, + projectId: project, + locationId: testPolicyId1, + locationName: privateLocations[0].label, + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const packagesResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + expect(packagesResponse.body.items.length).eql(0); + } + }); + + it('creates integration policies for project monitors with private locations - lightweight', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + ...httpProjectMonitors, + monitors: [ + { + ...httpProjectMonitors.monitors[1], + 'check.request.body': '${testGlobalParam}', + privateLocations: [privateLocations[0].label], + }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${httpProjectMonitors.monitors[1].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + expect(packagePolicy.name).eql( + `${httpProjectMonitors.monitors[1].id}-${project}-default-${privateLocations[0].label}` + ); + expect(packagePolicy.policy_id).eql(testPolicyId1); + + const configId = monitorsResponse.body.monitors[0].config_id; + const id = monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicyLightweight({ + inputs: {}, + name: 'My Monitor 3', + id, + configId, + projectId: project, + locationName: privateLocations[0].label, + locationId: testPolicyId1, + }) + ); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project); + + const packagesResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + expect(packagesResponse.body.items.length).eql(0); + } + }); + + it('deletes integration policies for project monitors when private location is removed from the monitor - lightweight', async () => { + const project = `test-project-${uuidv4()}`; + + const monitorRequest = { + monitors: [ + { + ...httpProjectMonitors.monitors[1], + privateLocations: [privateLocations[0].label, privateLocations[1].label], + }, + ], + }; + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitorRequest) + .expect(200); + + const monitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitorRequest.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId1); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { ...monitorRequest.monitors[0], privateLocations: [privateLocations[1].label] }, + ], + }) + .expect(200); + + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy2 = apiResponsePolicy2.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + } + }); + + it('deletes integration policies for project monitors when private location is removed from the monitor', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: [privateLocations[0].label, privateLocations[1].label], + }, + ], + }) + .expect(200); + + const monitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + + expect(packagePolicy.policy_id).eql(testPolicyId1); + + const configId = monitorsResponse.body.monitors[0].config_id; + const id = monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]; + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: `check if title is present-${privateLocations[0].label}`, + id, + configId, + projectId: project, + locationId: testPolicyId1, + locationName: privateLocations[0].label, + }) + ); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: [privateLocations[1].label] }, + ], + }) + .expect(200); + + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy2 = apiResponsePolicy2.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + `${monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]}-${testPolicyId1}` + ); + + expect(packagePolicy2).eql(undefined); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + expect(apiResponsePolicy2.body.items.length).eql(0); + } + }); + + it('handles updating package policies when project monitors are updated', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + privateLocations: [privateLocations[0].label], + }, + ], + }); + + const monitorsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${projectMonitors.monitors[0].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const configId = monitorsResponse.body.monitors[0].id; + const id = monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId = `${id}-${testPolicyId1}`; + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => pkgPolicy.id === policyId + ); + + expect(packagePolicy.policy_id).eql(testPolicyId1); + + comparePolicies( + packagePolicy, + getTestProjectSyntheticsPolicy({ + inputs: {}, + name: `check if title is present-${privateLocations[0].label}`, + id, + configId, + projectId: project, + locationId: testPolicyId1, + locationName: privateLocations[0].label, + }) + ); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...projectMonitors.monitors[0], + namespace: 'custom_namespace', + privateLocations: [privateLocations[0].label], + enabled: false, + }, + ], + }); + + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const configId2 = monitorsResponse.body.monitors[0].id; + const id2 = monitorsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID]; + const policyId2 = `${id}-${testPolicyId1}`; + + const packagePolicy2 = apiResponsePolicy2.body.items.find( + (pkgPolicy: PackagePolicy) => pkgPolicy.id === policyId2 + ); + + comparePolicies( + packagePolicy2, + getTestProjectSyntheticsPolicy({ + inputs: { enabled: { value: false, type: 'bool' } }, + name: `check if title is present-${privateLocations[0].label}`, + id: id2, + configId: configId2, + projectId: project, + locationId: testPolicyId1, + locationName: privateLocations[0].label, + namespace: 'custom_namespace', + }) + ); + } finally { + await deleteMonitor(projectMonitors.monitors[0].id, project); + + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + expect(apiResponsePolicy2.body.items.length).eql(0); + } + }); + + // this test is skipped because it would fail in MKI due to public locations not being available + it.skip('handles location formatting for both private and public locations', async () => { + const project = `test-project-${uuidv4()}`; + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { ...projectMonitors.monitors[0], privateLocations: [privateLocations[0].label] }, + ], + }); + + const updatedMonitorsResponse = await Promise.all( + projectMonitors.monitors.map((monitor) => { + return supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${monitor.id}`, + internal: true, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + }) + ); + + updatedMonitorsResponse.forEach( + (response: { + body: { monitors: Array<{ locations: Array }> }; + }) => { + expect(response.body.monitors[0].locations).eql([ + { + id: 'dev', + label: 'Dev Service', + geo: { lat: 0, lon: 0 }, + isServiceManaged: true, + }, + { + label: privateLocations[0].label, + isServiceManaged: false, + agentPolicyId: testPolicyId1, + id: testPolicyId1, + geo: { + lat: 0, + lon: 0, + }, + }, + ]); + } + ); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('only allows 250 requests at a time', async () => { + const project = `test-project-${uuidv4()}`; + const monitors = []; + for (let i = 0; i < 251; i++) { + monitors.push({ + ...projectMonitors.monitors[0], + id: `test-id-${i}`, + name: `test-name-${i}`, + }); + } + + try { + const { + body: { message }, + } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors, + }) + .expect(400); + + expect(message).to.eql(REQUEST_TOO_LARGE); + } finally { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ ...projectMonitors, project }); + } + }); + + it('project monitors - cannot update a monitor of one type to another type', async () => { + const project = `test-project-${uuidv4()}`; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + const { body } = await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [{ ...httpProjectMonitors.monitors[1], id: projectMonitors.monitors[0].id }], + }) + .expect(200); + expect(body).eql({ + createdMonitors: [], + updatedMonitors: [], + failedMonitors: [ + { + details: `Monitor ${projectMonitors.monitors[0].id} of type browser cannot be updated to type http. Please delete the monitor first and try again.`, + payload: { + 'check.request': { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + method: 'POST', + }, + 'check.response': { + body: { + positive: ['${testLocal1}', 'saved'], + }, + status: [200], + json: [{ description: 'check status', expression: 'foo.bar == "myValue"' }], + }, + enabled: false, + hash: 'ekrjelkjrelkjre', + id: projectMonitors.monitors[0].id, + locations: [], + privateLocations: [privateLocations[0].label], + name: 'My Monitor 3', + response: { + include_body: 'always', + include_body_max_bytes: 900, + }, + 'response.include_headers': false, + schedule: 60, + timeout: '80s', + type: 'http', + tags: 'tag2,tag2', + urls: ['http://localhost:9200'], + 'ssl.verification_mode': 'strict', + params: { + testGlobalParam2: 'testGlobalParamOverwrite', + testLocal1: 'testLocalParamsValue', + }, + proxy_url: '${testGlobalParam2}', + max_attempts: 2, + }, + reason: 'Cannot update monitor to different type.', + }, + ], + }); + } finally { + await Promise.all([ + projectMonitors.monitors.map((monitor) => { + return deleteMonitor(monitor.id, project); + }), + ]); + } + }); + + it('project monitors - handles alert config without adding arbitrary fields', async () => { + const project = `test-project-${uuidv4()}`; + const testAlert = { + status: { + enabled: false, + doesnotexit: true, + tls: { + enabled: true, + }, + }, + }; + try { + await supertest + .put( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + alert: testAlert, + }, + ], + }) + .expect(200); + const getResponse = await supertest + .get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: ${httpProjectMonitors.monitors[1].id}`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { monitors } = getResponse.body; + expect(monitors.length).eql(1); + expect(monitors[0][ConfigKey.ALERT_CONFIG]).eql({ + status: { + enabled: testAlert.status.enabled, + }, + tls: { + enabled: true, + }, + }); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project); + } + }); + + it('project monitors - handles sending invalid public location', async () => { + const project = `test-project-${uuidv4()}`; + try { + const response = await supertest + .put( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + locations: ['does not exist'], + }, + ], + }) + .expect(200); + rawExpect(response.body).toEqual({ + createdMonitors: [], + failedMonitors: [ + { + details: rawExpect.stringContaining( + "Invalid locations specified. Elastic managed Location(s) 'does not exist' not found." + ), + id: httpProjectMonitors.monitors[1].id, + payload: { + 'check.request': { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + method: 'POST', + }, + 'check.response': { + body: { + positive: ['${testLocal1}', 'saved'], + }, + status: [200], + json: [ + { + description: 'check status', + expression: 'foo.bar == "myValue"', + }, + ], + }, + enabled: false, + hash: 'ekrjelkjrelkjre', + id: httpProjectMonitors.monitors[1].id, + locations: ['does not exist'], + privateLocations: [privateLocations[0].label], + name: 'My Monitor 3', + response: { + include_body: 'always', + include_body_max_bytes: 900, + }, + 'response.include_headers': false, + schedule: 60, + 'ssl.verification_mode': 'strict', + tags: 'tag2,tag2', + timeout: '80s', + type: 'http', + urls: ['http://localhost:9200'], + params: { + testGlobalParam2: 'testGlobalParamOverwrite', + testLocal1: 'testLocalParamsValue', + }, + proxy_url: '${testGlobalParam2}', + max_attempts: 2, + }, + reason: "Couldn't save or update monitor because of an invalid configuration.", + }, + ], + updatedMonitors: [], + }); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project); + } + }); + + it('project monitors - handles sending invalid private locations', async () => { + const project = `test-project-${uuidv4()}`; + try { + const response = await supertest + .put( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + locations: [], + privateLocations: ['does not exist'], + }, + ], + }) + .expect(200); + expect(response.body).eql({ + createdMonitors: [], + failedMonitors: [ + { + details: `Invalid locations specified. Private Location(s) 'does not exist' not found. Available private locations are '${privateLocations[0].label}|${privateLocations[1].label}'`, + id: httpProjectMonitors.monitors[1].id, + payload: { + 'check.request': { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + method: 'POST', + }, + 'check.response': { + body: { + positive: ['${testLocal1}', 'saved'], + }, + status: [200], + json: [ + { + description: 'check status', + expression: 'foo.bar == "myValue"', + }, + ], + }, + enabled: false, + hash: 'ekrjelkjrelkjre', + id: httpProjectMonitors.monitors[1].id, + privateLocations: ['does not exist'], + name: 'My Monitor 3', + response: { + include_body: 'always', + include_body_max_bytes: 900, + }, + 'response.include_headers': false, + schedule: 60, + 'ssl.verification_mode': 'strict', + tags: 'tag2,tag2', + timeout: '80s', + type: 'http', + urls: ['http://localhost:9200'], + locations: [], + params: { + testGlobalParam2: 'testGlobalParamOverwrite', + testLocal1: 'testLocalParamsValue', + }, + proxy_url: '${testGlobalParam2}', + max_attempts: 2, + }, + reason: "Couldn't save or update monitor because of an invalid configuration.", + }, + ], + updatedMonitors: [], + }); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project); + } + }); + + it('project monitors - handles no locations specified', async () => { + const project = `test-project-${uuidv4()}`; + try { + const response = await supertest + .put( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: [ + { + ...httpProjectMonitors.monitors[1], + privateLocations: [], + locations: [], + }, + ], + }) + .expect(200); + expect(response.body).eql({ + createdMonitors: [], + failedMonitors: [ + { + details: 'You must add at least one location or private location to this monitor.', + id: httpProjectMonitors.monitors[1].id, + payload: { + 'check.request': { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + method: 'POST', + }, + 'check.response': { + body: { + positive: ['${testLocal1}', 'saved'], + }, + status: [200], + json: [ + { + description: 'check status', + expression: 'foo.bar == "myValue"', + }, + ], + }, + enabled: false, + hash: 'ekrjelkjrelkjre', + id: httpProjectMonitors.monitors[1].id, + privateLocations: [], + name: 'My Monitor 3', + response: { + include_body: 'always', + include_body_max_bytes: 900, + }, + 'response.include_headers': false, + schedule: 60, + 'ssl.verification_mode': 'strict', + tags: 'tag2,tag2', + timeout: '80s', + type: 'http', + urls: ['http://localhost:9200'], + locations: [], + params: { + testGlobalParam2: 'testGlobalParamOverwrite', + testLocal1: 'testLocalParamsValue', + }, + proxy_url: '${testGlobalParam2}', + max_attempts: 2, + }, + reason: "Couldn't save or update monitor because of an invalid configuration.", + }, + ], + updatedMonitors: [], + }); + } finally { + await deleteMonitor(httpProjectMonitors.monitors[1].id, project); + } + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project_private_location.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project_private_location.ts new file mode 100644 index 000000000000..a8f98dac2bf6 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_project_private_location.ts @@ -0,0 +1,162 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import expect from '@kbn/expect'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { ProjectMonitorsRequest } from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('AddProjectMonitorsPrivateLocations', function () { + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + let projectMonitors: ProjectMonitorsRequest; + let editorUser: RoleCredentials; + + const monitorTestService = new SyntheticsMonitorTestService(getService); + + let testPolicyId; + let testPrivateLocationName: string; + const testPolicyName = `Fleet test server policy ${uuidv4()}`; + const testPrivateLocationsService = new PrivateLocationTestService(getService); + + const setUniqueIds = (request: ProjectMonitorsRequest) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ ...monitor, id: uuidv4() })), + }; + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + await testPrivateLocationsService.installSyntheticsPackage(); + + const apiResponse = await testPrivateLocationsService.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + const testPrivateLocations = await testPrivateLocationsService.setTestLocations([ + testPolicyId, + ]); + testPrivateLocationName = testPrivateLocations[0].label; + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); + + beforeEach(() => { + projectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_browser_monitor').monitors.map( + (monitor: Record) => { + return { + ...monitor, + name: `test-monitor-${uuidv4()}`, + type: 'browser', + locations: [], + privateLocations: [testPrivateLocationName], + }; + } + ), + }); + }); + + it('project monitors - returns a failed monitor when creating integration fails', async () => { + const project = `test-project-${uuidv4()}`; + + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: ['Test private location 7'], + }; + const testMonitors = [ + projectMonitors.monitors[0], + { + ...secondMonitor, + name: '!@#$%^&*()_++[\\-\\]- wow name', + }, + ]; + try { + const { body, status } = await monitorTestService.addProjectMonitors( + project, + testMonitors, + editorUser + ); + expect(status).eql(200); + expect(body.createdMonitors.length).eql(1); + expect(body.failedMonitors[0].reason).eql( + "Couldn't save or update monitor because of an invalid configuration." + ); + } finally { + await Promise.all([ + testMonitors.map((monitor) => { + return monitorTestService.deleteMonitorByJourney( + monitor.id, + project, + 'default', + editorUser + ); + }), + ]); + } + }); + + it('project monitors - returns a failed monitor when editing integration fails', async () => { + const project = `test-project-${uuidv4()}`; + + const secondMonitor = { + ...projectMonitors.monitors[0], + id: 'test-id-2', + privateLocations: [testPrivateLocationName], + }; + const testMonitors = [projectMonitors.monitors[0], secondMonitor]; + const { body, status: status0 } = await monitorTestService.addProjectMonitors( + project, + testMonitors, + editorUser + ); + expect(status0).eql(200); + + expect(body.createdMonitors.length).eql(2); + const { body: editedBody, status: editedStatus } = + await monitorTestService.addProjectMonitors(project, testMonitors, editorUser); + expect(editedStatus).eql(200); + + expect(editedBody.createdMonitors.length).eql(0); + expect(editedBody.updatedMonitors.length).eql(2); + + testMonitors[1].name = '!@#$%^&*()_++[\\-\\]- wow name'; + testMonitors[1].privateLocations = ['Test private location 8']; + + const { body: editedBodyError, status } = await monitorTestService.addProjectMonitors( + project, + testMonitors, + editorUser + ); + expect(status).eql(200); + expect(editedBodyError.createdMonitors.length).eql(0); + expect(editedBodyError.updatedMonitors.length).eql(1); + expect(editedBodyError.failedMonitors.length).eql(1); + expect(editedBodyError.failedMonitors[0].details).eql( + `Invalid locations specified. Private Location(s) 'Test private location 8' not found. Available private locations are '${testPrivateLocationName}'` + ); + expect(editedBodyError.failedMonitors[0].reason).eql( + "Couldn't save or update monitor because of an invalid configuration." + ); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_public_api.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_public_api.ts new file mode 100644 index 000000000000..2c41d5c58f29 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_monitor_public_api.ts @@ -0,0 +1,280 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import rawExpect from 'expect'; +import { v4 as uuidv4 } from 'uuid'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { PrivateLocation } from '@kbn/synthetics-plugin/common/runtime_types'; +import { DEFAULT_FIELDS } from '@kbn/synthetics-plugin/common/constants/monitor_defaults'; +import { LOCATION_REQUIRED_ERROR } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/monitor_validation'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { addMonitorAPIHelper, omitMonitorKeys } from './create_monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('AddNewMonitorsPublicAPI', function () { + const supertestAPI = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + const privateLocationTestService = new PrivateLocationTestService(getService); + + async function addMonitorAPI(monitor: any, statusCode: number = 200) { + return await addMonitorAPIHelper(supertestAPI, monitor, statusCode, editorUser, samlAuth); + } + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + privateLocation = await privateLocationTestService.addTestPrivateLocation(); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); + + it('should return error for empty monitor', async function () { + const { message } = await addMonitorAPI({}, 400); + expect(message).eql('Invalid value "undefined" supplied to "type"'); + }); + + it('return error if no location specified', async () => { + const { message } = await addMonitorAPI({ type: 'http' }, 400); + expect(message).eql(LOCATION_REQUIRED_ERROR); + }); + + it('return error if invalid location specified', async () => { + const { message } = await addMonitorAPI({ type: 'http', locations: ['mars'] }, 400); + rawExpect(message).toContain( + "Invalid locations specified. Elastic managed Location(s) 'mars' not found." + ); + }); + + it('return error if invalid private location specified', async () => { + const { message } = await addMonitorAPI( + { + type: 'http', + locations: ['mars'], + privateLocations: ['moon'], + }, + 400 + ); + expect(message).eql('Invalid monitor key(s) for http type: privateLocations'); + + const result = await addMonitorAPI( + { + type: 'http', + locations: ['mars'], + private_locations: ['moon'], + }, + 400 + ); + rawExpect(result.message).toContain("Private Location(s) 'moon' not found."); + }); + + it('return error for origin project', async () => { + const { message } = await addMonitorAPI( + { + type: 'http', + locations: ['dev'], + url: 'https://www.google.com', + origin: 'project', + }, + 400 + ); + expect(message).eql('Unsupported origin type project, only ui type is supported via API.'); + }); + + describe('HTTP Monitor', () => { + const defaultFields = DEFAULT_FIELDS.http; + it('return error empty http', async () => { + const { message, attributes } = await addMonitorAPI( + { + type: 'http', + locations: [], + private_locations: [privateLocation.id], + }, + 400 + ); + + expect(message).eql('Monitor is not a valid monitor of type http'); + expect(attributes).eql({ + details: + 'Invalid field "url", must be a non-empty string. | Invalid value "undefined" supplied to "name"', + payload: { type: 'http' }, + }); + }); + + it('base http monitor', async () => { + const monitor = { + type: 'http', + private_locations: [privateLocation.id], + url: 'https://www.google.com', + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + name: 'https://www.google.com', + }) + ); + }); + + it('can enable retries', async () => { + const name = `test name ${uuidv4()}`; + const monitor = { + type: 'http', + private_locations: [privateLocation.id], + url: 'https://www.google.com', + name, + retest_on_failure: true, + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + name, + retest_on_failure: true, + }) + ); + }); + + it('can disable retries', async () => { + const name = `test name ${uuidv4()}`; + const monitor = { + type: 'http', + private_locations: [privateLocation.id], + url: 'https://www.google.com', + name, + retest_on_failure: false, + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + name, + max_attempts: 1, + retest_on_failure: undefined, // this key is not part of the SO and should not be defined + }) + ); + }); + }); + + describe('TCP Monitor', () => { + const defaultFields = DEFAULT_FIELDS.tcp; + + it('base tcp monitor', async () => { + const monitor = { + type: 'tcp', + private_locations: [privateLocation.id], + host: 'https://www.google.com/', + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + name: 'https://www.google.com/', + }) + ); + }); + }); + + describe('ICMP Monitor', () => { + const defaultFields = DEFAULT_FIELDS.icmp; + + it('base icmp monitor', async () => { + const monitor = { + type: 'icmp', + private_locations: [privateLocation.id], + host: 'https://8.8.8.8', + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + name: 'https://8.8.8.8', + }) + ); + }); + }); + + describe('Browser Monitor', () => { + const defaultFields = DEFAULT_FIELDS.browser; + + it('empty browser monitor', async () => { + const monitor = { + type: 'browser', + private_locations: [privateLocation.id], + name: 'simple journey', + }; + const result = await addMonitorAPI(monitor, 400); + + expect(result).eql({ + statusCode: 400, + error: 'Bad Request', + message: 'Monitor is not a valid monitor of type browser', + attributes: { + details: 'source.inline.script: Script is required for browser monitor.', + payload: { type: 'browser', name: 'simple journey' }, + }, + }); + }); + + it('base browser monitor', async () => { + const monitor = { + type: 'browser', + private_locations: [privateLocation.id], + name: 'simple journey', + 'source.inline.script': 'step("simple journey", async () => {});', + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + }) + ); + }); + + it('base browser monitor with inline_script', async () => { + const monitor = { + type: 'browser', + private_locations: [privateLocation.id], + name: 'simple journey inline_script', + inline_script: 'step("simple journey", async () => {});', + }; + const { body: result } = await addMonitorAPI(monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation], + }) + ); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_update_params.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_update_params.ts new file mode 100644 index 000000000000..4f4068008cd4 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/create_update_params.ts @@ -0,0 +1,385 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { v4 as uuidv4 } from 'uuid'; +import { pick } from 'lodash'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { syntheticsParamType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +function assertHas(actual: unknown, expected: object) { + expect(pick(actual, Object.keys(expected))).eql(expected); +} + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe.skip('AddEditParams', function () { + const samlAuth = getService('samlAuth'); + const supertest = getService('supertestWithoutAuth'); + let adminRoleAuthc: RoleCredentials; + + const kServer = getService('kibanaServer'); + const testParam = { + key: 'test', + value: 'test', + }; + const testPrivateLocations = new PrivateLocationTestService(getService); + + before(async () => { + await testPrivateLocations.installSyntheticsPackage(); + adminRoleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin'); + await kServer.savedObjects.clean({ types: [syntheticsParamType] }); + }); + + it('adds a test param', async () => { + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + assertHas(getResponse.body[0], testParam); + }); + + it('handles tags and description', async () => { + const tagsAndDescription = { + tags: ['a tag'], + description: 'test description', + }; + const testParam2 = { + ...testParam, + ...tagsAndDescription, + }; + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .send(testParam2) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + assertHas(getResponse.body[0], testParam2); + }); + + it('handles editing a param', async () => { + const expectedUpdatedParam = { + key: 'testUpdated', + value: 'testUpdated', + tags: ['a tag'], + description: 'test description', + }; + + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const param = getResponse.body[0]; + assertHas(param, testParam); + + await supertest + .put(SYNTHETICS_API_URLS.PARAMS + '/' + param.id) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({}) + .expect(400); + + await supertest + .put(SYNTHETICS_API_URLS.PARAMS + '/' + param.id) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const updatedGetResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const actualUpdatedParam = updatedGetResponse.body[0]; + assertHas(actualUpdatedParam, expectedUpdatedParam); + }); + + it('handles partial editing a param', async () => { + const newParam = { + key: 'testUpdated', + value: 'testUpdated', + tags: ['a tag'], + description: 'test description', + }; + + const response = await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(newParam) + .expect(200); + const paramId = response.body.id; + + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS + '/' + paramId) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + assertHas(getResponse.body, newParam); + + await supertest + .put(SYNTHETICS_API_URLS.PARAMS + '/' + paramId) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + key: 'testUpdated', + }) + .expect(200); + + await supertest + .put(SYNTHETICS_API_URLS.PARAMS + '/' + paramId) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + key: 'testUpdatedAgain', + value: 'testUpdatedAgain', + }) + .expect(200); + + const updatedGetResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS + '/' + paramId) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + assertHas(updatedGetResponse.body, { + ...newParam, + key: 'testUpdatedAgain', + value: 'testUpdatedAgain', + }); + }); + + it('handles spaces', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + await kServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(getResponse.body[0].namespaces).eql([SPACE_ID]); + assertHas(getResponse.body[0], testParam); + }); + + it('handles editing a param in spaces', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + await kServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + const expectedUpdatedParam = { + key: 'testUpdated', + value: 'testUpdated', + tags: ['a tag'], + description: 'test description', + }; + + await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const param = getResponse.body[0]; + assertHas(param, testParam); + + await supertest + .put(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}/${param.id}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(expectedUpdatedParam) + .expect(200); + + const updatedGetResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const actualUpdatedParam = updatedGetResponse.body[0]; + assertHas(actualUpdatedParam, expectedUpdatedParam); + }); + + it('does not allow editing a param in created in one space in a different space', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + const SPACE_ID_TWO = `test-space-${uuidv4()}-two`; + const SPACE_NAME_TWO = `test-space-name ${uuidv4()} 2`; + + await kServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + await kServer.spaces.create({ id: SPACE_ID_TWO, name: SPACE_NAME_TWO }); + + const updatedParam = { + key: 'testUpdated', + value: 'testUpdated', + tags: ['a tag'], + description: 'test description', + }; + + await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const param = getResponse.body[0]; + assertHas(param, testParam); + + // space does exist so get request should be 200 + await supertest + .get(`/s/${SPACE_ID_TWO}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + await supertest + .put(`/s/${SPACE_ID_TWO}${SYNTHETICS_API_URLS.PARAMS}/${param.id}}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(updatedParam) + .expect(404); + + const updatedGetResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const actualUpdatedParam = updatedGetResponse.body[0]; + assertHas(actualUpdatedParam, testParam); + }); + + it('handles invalid spaces', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + await kServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + await supertest + .post(`/s/doesnotexist${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(404); + }); + + it('handles editing with invalid spaces', async () => { + const updatedParam = { + key: 'testUpdated', + value: 'testUpdated', + tags: ['a tag'], + description: 'test description', + }; + + await supertest + .post(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(testParam) + .expect(200); + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.PARAMS) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const param = getResponse.body[0]; + assertHas(param, testParam); + + await supertest + .put(`/s/doesnotexist${SYNTHETICS_API_URLS.PARAMS}/${param.id}}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(updatedParam) + .expect(404); + }); + + it('handles share across spaces', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + await kServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ ...testParam, share_across_spaces: true }) + .expect(200); + + const getResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(getResponse.body[0].namespaces).eql(['*']); + assertHas(getResponse.body[0], testParam); + }); + + it('should not return values for non admin user', async () => { + const resp = await supertest + .get(`${SYNTHETICS_API_URLS.PARAMS}`) + .set(adminRoleAuthc.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + const params = resp.body; + expect(params.length).to.eql(6); + params.forEach((param: any) => { + expect(param.value).to.eql(undefined); + expect(param.key).to.not.empty(); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor.ts new file mode 100644 index 000000000000..3e1582ea3ec2 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor.ts @@ -0,0 +1,164 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + EncryptedSyntheticsSavedMonitor, + HTTPFields, + MonitorFields, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('DeleteMonitorRoute', function () { + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + const testPrivateLocations = new PrivateLocationTestService(getService); + const monitorTestService = new SyntheticsMonitorTestService(getService); + + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + let editorUser: RoleCredentials; + let testPolicyId = ''; + let privateLocations: PrivateLocation[]; + + const saveMonitor = async ( + monitor: MonitorFields + ): Promise => { + const res = await supertest + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor); + + expect(res.status).to.eql(200, JSON.stringify(res.body)); + + return res.body; + }; + + const deleteMonitor = async (monitorId?: string | string[], statusCode = 200) => { + return monitorTestService.deleteMonitor(editorUser, monitorId, statusCode, 'default'); + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await testPrivateLocations.installSyntheticsPackage(); + const testPolicyName = 'Fleet test server policy' + Date.now(); + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + privateLocations = await testPrivateLocations.setTestLocations([testPolicyId]); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + + _httpMonitorJson = getFixtureJson('http_monitor'); + }); + + beforeEach(() => { + httpMonitorJson = { + ..._httpMonitorJson, + locations: [privateLocations[0]], + }; + }); + + it('deletes monitor by id', async () => { + const { id: monitorId } = await saveMonitor(httpMonitorJson as MonitorFields); + + const deleteResponse = await deleteMonitor(monitorId); + + expect(deleteResponse.body).eql([{ id: monitorId, deleted: true }]); + + // Hit get endpoint and expect 404 as well + await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(404); + }); + + it('deletes monitor by param id', async () => { + const { id: monitorId } = await saveMonitor(httpMonitorJson as MonitorFields); + + const deleteResponse = await monitorTestService.deleteMonitorByIdParam( + editorUser, + monitorId, + 200, + 'default' + ); + + expect(deleteResponse.body).eql([{ id: monitorId, deleted: true }]); + + // Hit get endpoint and expect 404 as well + await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(404); + }); + + it('throws error if both body and param are missing', async () => { + await supertest + .delete(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .send() + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(400); + }); + + it('deletes multiple monitors by id', async () => { + const { id: monitorId } = await saveMonitor(httpMonitorJson as MonitorFields); + const { id: monitorId2 } = await saveMonitor({ + ...httpMonitorJson, + name: 'another -2', + } as MonitorFields); + + const deleteResponse = await deleteMonitor([monitorId2, monitorId]); + + expect( + deleteResponse.body.sort((a: { id: string }, b: { id: string }) => (a.id > b.id ? 1 : -1)) + ).eql( + [ + { id: monitorId2, deleted: true }, + { id: monitorId, deleted: true }, + ].sort((a, b) => (a.id > b.id ? 1 : -1)) + ); + + // Hit get endpoint and expect 404 as well + await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(404); + }); + + it('returns 404 if monitor id is not found', async () => { + const invalidMonitorId = 'invalid-id'; + const expected404Message = `Monitor id ${invalidMonitorId} not found!`; + + const deleteResponse = await deleteMonitor(invalidMonitorId); + + expect(deleteResponse.status).eql(200); + expect(deleteResponse.body).eql([ + { + id: invalidMonitorId, + deleted: false, + error: expected404Message, + }, + ]); + }); + + it('validates empty monitor id', async () => { + await deleteMonitor(undefined, 400); + await deleteMonitor([], 400); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor_project.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor_project.ts new file mode 100644 index 000000000000..e2eecb91cb15 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/delete_monitor_project.ts @@ -0,0 +1,521 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + ConfigKey, + ProjectMonitorsRequest, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { REQUEST_TOO_LARGE } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/delete_monitor_project'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import expect from '@kbn/expect'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('DeleteProjectMonitors', function () { + const supertest = getService('supertestWithoutAuth'); + const supertestWithAuth = getService('supertest'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + let projectMonitors: ProjectMonitorsRequest; + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + + const testPrivateLocationsService = new PrivateLocationTestService(getService); + + const setUniqueIdsAndLocations = ( + request: ProjectMonitorsRequest, + privateLocations: PrivateLocation[] = [] + ) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ + ...monitor, + id: uuidv4(), + locations: [], + privateLocations: privateLocations.map((location) => location.label), + })), + }; + }; + + before(async () => { + await testPrivateLocationsService.installSyntheticsPackage(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + }); + + beforeEach(async () => { + await kibanaServer.savedObjects.clean({ types: ['synthetics-private-location'] }); + privateLocation = await testPrivateLocationsService.addTestPrivateLocation(); + projectMonitors = setUniqueIdsAndLocations(getFixtureJson('project_browser_monitor'), [ + privateLocation, + ]); + }); + + it('only allows 250 requests at a time', async () => { + const project = 'test-brower-suite'; + const monitors = []; + for (let i = 0; i < 251; i++) { + monitors.push({ + ...projectMonitors.monitors[0], + id: `test-id-${i}`, + name: `test-name-${i}`, + }); + } + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitors.slice(0, 250) }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitors.slice(250, 251) }) + .expect(200); + + const savedObjectsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total } = savedObjectsResponse.body; + expect(total).to.eql(251); + + const response = await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(400); + const { message } = response.body; + expect(message).to.eql(REQUEST_TOO_LARGE); + } finally { + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 251) }) + .expect(200); + } + }); + + it('project monitors - handles browser monitors', async () => { + const monitorToDelete = 'second-monitor-id'; + const monitors = [ + projectMonitors.monitors[0], + { + ...projectMonitors.monitors[0], + id: monitorToDelete, + }, + ]; + const project = 'test-brower-suite'; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors }) + .expect(200); + + const savedObjectsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total } = savedObjectsResponse.body; + expect(total).to.eql(2); + const monitorsToDelete = [monitorToDelete]; + + const response = await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + + expect(response.body.deleted_monitors).to.eql(monitorsToDelete); + + const responseAfterDeletion = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total: totalAfterDeletion } = responseAfterDeletion.body; + expect(totalAfterDeletion).to.eql(1); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + } + }); + + it('does not delete monitors from a different project', async () => { + const monitors = [...projectMonitors.monitors]; + const project = 'test-brower-suite'; + const secondProject = 'second-project'; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + secondProject + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors }) + .expect(200); + + const savedObjectsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const secondProjectSavedObjectResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${secondProject}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total } = savedObjectsResponse.body; + const { total: secondProjectTotal } = secondProjectSavedObjectResponse.body; + expect(total).to.eql(monitors.length); + expect(secondProjectTotal).to.eql(monitors.length); + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + const response = await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + + expect(response.body.deleted_monitors).to.eql(monitorsToDelete); + + const responseAfterDeletion = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const secondResponseAfterDeletion = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${secondProject}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total: totalAfterDeletion } = responseAfterDeletion.body; + const { total: secondProjectTotalAfterDeletion } = secondResponseAfterDeletion.body; + expect(totalAfterDeletion).to.eql(0); + expect(secondProjectTotalAfterDeletion).to.eql(monitors.length); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + secondProject + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + } + }); + + it('does not delete monitors from the same project in a different space project', async () => { + const monitors = [...projectMonitors.monitors]; + const project = 'test-brower-suite'; + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await testPrivateLocationsService.addTestPrivateLocation( + SPACE_ID + ); + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.map((monitor) => ({ + ...monitor, + privateLocations: [privateLocation.label], + })), + }) + .expect(200); + + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.map((monitor) => ({ + ...monitor, + privateLocations: [spaceScopedPrivateLocation.label], + })), + }) + .expect(200); + + const savedObjectsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const secondSpaceProjectSavedObjectResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total } = savedObjectsResponse.body; + const { total: secondSpaceTotal } = secondSpaceProjectSavedObjectResponse.body; + + expect(total).to.eql(monitors.length); + expect(secondSpaceTotal).to.eql(monitors.length); + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + const response = await supertest + .delete( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + + expect(response.body.deleted_monitors).to.eql(monitorsToDelete); + + const responseAfterDeletion = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const secondSpaceResponseAfterDeletion = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total: totalAfterDeletion } = responseAfterDeletion.body; + const { total: secondProjectTotalAfterDeletion } = secondSpaceResponseAfterDeletion.body; + expect(totalAfterDeletion).to.eql(monitors.length); + expect(secondProjectTotalAfterDeletion).to.eql(0); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + } + }); + + it('deletes integration policies when project monitors are deleted', async () => { + const monitors = [ + { ...projectMonitors.monitors[0], privateLocations: [privateLocation.label] }, + ]; + const project = 'test-brower-suite'; + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors }) + .expect(200); + + const savedObjectsResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total } = savedObjectsResponse.body; + expect(total).to.eql(monitors.length); + const apiResponsePolicy = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponsePolicy.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + savedObjectsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID] + + '-' + + privateLocation.id + ); + expect(packagePolicy.policy_id).to.be(privateLocation.id); + + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + const response = await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + + expect(response.body.deleted_monitors).to.eql(monitorsToDelete); + + const responseAfterDeletion = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .query({ + filter: `${syntheticsMonitorType}.attributes.project_id: "${project}"`, + }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const { total: totalAfterDeletion } = responseAfterDeletion.body; + expect(totalAfterDeletion).to.eql(0); + const apiResponsePolicy2 = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy2 = apiResponsePolicy2.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === + savedObjectsResponse.body.monitors[0][ConfigKey.CUSTOM_HEARTBEAT_ID] + + '-' + + privateLocation.id + ); + expect(packagePolicy2).to.be(undefined); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete }) + .expect(200); + } + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor.ts new file mode 100644 index 000000000000..755fdad3aa19 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor.ts @@ -0,0 +1,370 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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 { v4 as uuidv4 } from 'uuid'; +import { omit } from 'lodash'; +import { + ConfigKey, + EncryptedSyntheticsSavedMonitor, + HTTPFields, + MonitorFields, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { omitResponseTimestamps, omitEmptyValues } from './helpers/monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('EditMonitorAPI', function () { + const supertestWithAuth = getService('supertest'); + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + const testPrivateLocations = new PrivateLocationTestService(getService); + const monitorTestService = new SyntheticsMonitorTestService(getService); + + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + let testPolicyId = ''; + let editorUser: RoleCredentials; + let privateLocations: PrivateLocation[]; + + const saveMonitor = async (monitor: MonitorFields, spaceId?: string) => { + const apiURL = spaceId + ? `/s/${spaceId}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}` + : SYNTHETICS_API_URLS.SYNTHETICS_MONITORS; + const res = await supertest + .post(apiURL + '?internal=true') + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + + const { url, created_at: createdAt, updated_at: updatedAt, ...rest } = res.body; + + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + return rest as EncryptedSyntheticsSavedMonitor; + }; + + const editMonitor = async (modifiedMonitor: MonitorFields, monitorId: string) => { + const res = await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId + '?internal=true') + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(modifiedMonitor); + + expect(res.status).eql(200, JSON.stringify(res.body)); + + const { created_at: createdAt, updated_at: updatedAt } = res.body; + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + return omit(res.body, ['created_at', 'updated_at']); + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await supertestWithAuth.post('/api/fleet/setup').set('kbn-xsrf', 'true').send().expect(200); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const testPolicyName = 'Fleet test server policy' + Date.now(); + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + privateLocations = await testPrivateLocations.setTestLocations([testPolicyId]); + _httpMonitorJson = getFixtureJson('http_monitor'); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); + + beforeEach(() => { + httpMonitorJson = { ..._httpMonitorJson, locations: [privateLocations[0]] }; + }); + + it('edits the monitor', async () => { + const newMonitor = httpMonitorJson; + + const savedMonitor = await saveMonitor(newMonitor as MonitorFields); + const monitorId = savedMonitor[ConfigKey.CONFIG_ID]; + + expect(omitResponseTimestamps(savedMonitor)).eql( + omitEmptyValues({ + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + [ConfigKey.CONFIG_ID]: monitorId, + }) + ); + + const updates: Partial = { + [ConfigKey.URLS]: 'https://modified-host.com', + [ConfigKey.NAME]: 'Modified name', + [ConfigKey.LOCATIONS]: [privateLocations[0]], + [ConfigKey.REQUEST_HEADERS_CHECK]: { + sampleHeader2: 'sampleValue2', + }, + [ConfigKey.METADATA]: { + script_source: { + is_generated_script: false, + file_name: 'test-file.name', + }, + }, + }; + + const modifiedMonitor = { + ...savedMonitor, + ...updates, + [ConfigKey.METADATA]: { + ...newMonitor[ConfigKey.METADATA], + ...updates[ConfigKey.METADATA], + }, + } as any; + + const editResponse = await editMonitor(modifiedMonitor, monitorId); + + expect(editResponse).eql( + omitEmptyValues({ + ...modifiedMonitor, + revision: 2, + }) + ); + }); + + it('strips unknown keys from monitor edits', async () => { + const newMonitor = { ...httpMonitorJson, name: 'yet another' }; + + const savedMonitor = await saveMonitor(newMonitor as MonitorFields); + const monitorId = savedMonitor[ConfigKey.CONFIG_ID]; + + const { created_at: createdAt, updated_at: updatedAt } = savedMonitor; + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + expect(omitResponseTimestamps(savedMonitor)).eql( + omitEmptyValues({ + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + [ConfigKey.CONFIG_ID]: monitorId, + }) + ); + + const updates: Partial = { + [ConfigKey.URLS]: 'https://modified-host.com', + [ConfigKey.NAME]: 'Modified name like that', + [ConfigKey.LOCATIONS]: [privateLocations[0]], + [ConfigKey.REQUEST_HEADERS_CHECK]: { + sampleHeader2: 'sampleValue2', + }, + [ConfigKey.METADATA]: { + script_source: { + is_generated_script: false, + file_name: 'test-file.name', + }, + }, + unknownkey: 'unknownvalue', + } as Partial; + + const modifiedMonitor = omit( + { + ...updates, + [ConfigKey.METADATA]: { + ...newMonitor[ConfigKey.METADATA], + ...updates[ConfigKey.METADATA], + }, + }, + ['unknownkey'] + ); + + const editResponse = await editMonitor(modifiedMonitor as MonitorFields, monitorId); + + expect(editResponse).eql( + omitEmptyValues({ + ...savedMonitor, + ...modifiedMonitor, + revision: 2, + }) + ); + expect(editResponse).not.to.have.keys('unknownkey'); + }); + + it('returns 404 if monitor id is not present', async () => { + const invalidMonitorId = 'invalid-id'; + const expected404Message = `Monitor id ${invalidMonitorId} not found!`; + + const editResponse = await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + invalidMonitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(httpMonitorJson) + .expect(404); + + expect(editResponse.body.message).eql(expected404Message); + }); + + it('returns bad request if payload is invalid for HTTP monitor', async () => { + const { id: monitorId, ...savedMonitor } = await saveMonitor( + httpMonitorJson as MonitorFields + ); + + // Delete a required property to make payload invalid + const toUpdate = { ...savedMonitor, 'check.request.headers': null }; + + const apiResponse = await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(toUpdate); + + expect(apiResponse.status).eql(400); + }); + + it('returns bad request if monitor type is invalid', async () => { + const { id: monitorId, ...savedMonitor } = await saveMonitor({ + ...httpMonitorJson, + name: 'test monitor - 11', + } as MonitorFields); + + const toUpdate = { ...savedMonitor, type: 'invalid-data-steam' }; + + const apiResponse = await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(toUpdate); + + expect(apiResponse.status).eql(400); + expect(apiResponse.body.message).eql( + 'Monitor type cannot be changed from http to invalid-data-steam.' + ); + }); + + it('sets config hash to empty string on edits', async () => { + const newMonitor = httpMonitorJson; + const configHash = 'djrhefje'; + + const savedMonitor = await saveMonitor({ + ...(newMonitor as MonitorFields), + [ConfigKey.CONFIG_HASH]: configHash, + name: 'test monitor - 12', + }); + const monitorId = savedMonitor[ConfigKey.CONFIG_ID]; + const { created_at: createdAt, updated_at: updatedAt } = savedMonitor; + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + + expect(savedMonitor).eql( + omitEmptyValues({ + ...newMonitor, + [ConfigKey.CONFIG_ID]: monitorId, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + name: 'test monitor - 12', + hash: configHash, + }) + ); + + const updates: Partial = { + [ConfigKey.URLS]: 'https://modified-host.com', + name: 'test monitor - 12', + } as Partial; + + const modifiedMonitor = { + ...newMonitor, + ...updates, + [ConfigKey.METADATA]: { + ...newMonitor[ConfigKey.METADATA], + ...updates[ConfigKey.METADATA], + }, + }; + + const editResponse = await editMonitor(modifiedMonitor as MonitorFields, monitorId); + + expect(editResponse).eql( + omitEmptyValues({ + ...modifiedMonitor, + [ConfigKey.CONFIG_ID]: monitorId, + [ConfigKey.MONITOR_QUERY_ID]: monitorId, + [ConfigKey.CONFIG_HASH]: '', + revision: 2, + }) + ); + expect(editResponse).not.to.have.keys('unknownkey'); + }); + + it('handles spaces', async () => { + const name = 'Monitor with private location'; + + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + const spaceScopedPrivateLocation = await testPrivateLocations.addTestPrivateLocation( + SPACE_ID + ); + const newMonitor = { + name, + type: 'http', + urls: 'https://elastic.co', + locations: [spaceScopedPrivateLocation], + }; + + const savedMonitor = await saveMonitor(newMonitor as MonitorFields, SPACE_ID); + + const monitorId = savedMonitor[ConfigKey.CONFIG_ID]; + const toUpdate = { + ...savedMonitor, + urls: 'https://google.com', + }; + await supertest + .put(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}/${monitorId}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(toUpdate) + .expect(200); + + const updatedResponse = await monitorTestService.getMonitor(monitorId, { + space: SPACE_ID, + internal: true, + user: editorUser, + }); + + // ensure monitor was updated + expect(updatedResponse.body.urls).eql(toUpdate.urls); + + // update a second time, ensures AAD was not corrupted + const toUpdate2 = { + ...savedMonitor, + urls: 'https://google.com', + }; + + await supertest + .put(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}/${monitorId}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(toUpdate2) + .expect(200); + + const updatedResponse2 = await monitorTestService.getMonitor(monitorId, { + space: SPACE_ID, + internal: true, + user: editorUser, + }); + + // ensure monitor was updated + expect(updatedResponse2.body.urls).eql(toUpdate2.urls); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor_public_api.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor_public_api.ts new file mode 100644 index 000000000000..bb659523a513 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/edit_monitor_public_api.ts @@ -0,0 +1,301 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import rawExpect from 'expect'; +import { v4 as uuidv4 } from 'uuid'; +import { omit } from 'lodash'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { DEFAULT_FIELDS } from '@kbn/synthetics-plugin/common/constants/monitor_defaults'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import moment from 'moment'; +import { PrivateLocation } from '@kbn/synthetics-plugin/common/runtime_types'; +import { LOCATION_REQUIRED_ERROR } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/monitor_validation'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { addMonitorAPIHelper, omitMonitorKeys } from './create_monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('EditMonitorsPublicAPI', function () { + const supertestAPI = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + const testPrivateLocations = new PrivateLocationTestService(getService); + let editorUser: RoleCredentials; + let privateLocation1: PrivateLocation; + let privateLocation2: PrivateLocation; + + async function addMonitorAPI(monitor: any, statusCode: number = 200) { + return await addMonitorAPIHelper(supertestAPI, monitor, statusCode, editorUser, samlAuth); + } + + async function editMonitorAPI(id: string, monitor: any, statusCode: number = 200) { + return await editMonitorAPIHelper(id, monitor, statusCode); + } + + async function editMonitorAPIHelper(monitorId: string, monitor: any, statusCode = 200) { + const result = await supertestAPI + .put(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + `/${monitorId}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor); + + expect(result.status).eql(statusCode, JSON.stringify(result.body)); + + if (statusCode === 200) { + const { + created_at: createdAt, + updated_at: updatedAt, + id, + config_id: configId, + } = result.body; + expect(id).not.empty(); + expect(configId).not.empty(); + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + return { + rawBody: result.body, + body: { + ...omit(result.body, [ + 'created_at', + 'updated_at', + 'id', + 'config_id', + 'form_monitor_type', + ]), + }, + }; + } + return result.body; + } + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + await testPrivateLocations.installSyntheticsPackage(); + privateLocation1 = await testPrivateLocations.addTestPrivateLocation(); + privateLocation2 = await testPrivateLocations.addTestPrivateLocation(); + }); + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); + let monitorId = 'test-id'; + + const defaultFields = DEFAULT_FIELDS.http; + + it('adds test monitor', async () => { + const monitor = { + type: 'http', + private_locations: [privateLocation1.id], + url: 'https://www.google.com', + }; + const { body: result, rawBody } = await addMonitorAPI(monitor); + monitorId = rawBody.id; + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation1], + name: 'https://www.google.com', + }) + ); + }); + + it('should return error for empty monitor', async function () { + const errMessage = 'Monitor must be a non-empty object'; + const testCases = [{}, null, undefined, false, [], '']; + for (const testCase of testCases) { + const { message } = await editMonitorAPI(monitorId, testCase, 400); + expect(message).eql(errMessage); + } + }); + + it('return error if type is being changed', async () => { + const { message } = await editMonitorAPI(monitorId, { type: 'tcp' }, 400); + expect(message).eql('Monitor type cannot be changed from http to tcp.'); + }); + + it('return error if monitor not found', async () => { + const { message } = await editMonitorAPI('invalid-monitor-id', { type: 'tcp' }, 404); + expect(message).eql('Monitor id invalid-monitor-id not found!'); + }); + + it('return error if invalid location specified', async () => { + const { message } = await editMonitorAPI( + monitorId, + { type: 'http', locations: ['mars'] }, + 400 + ); + rawExpect(message).toContain( + "Invalid locations specified. Elastic managed Location(s) 'mars' not found." + ); + }); + + it('return error if invalid private location specified', async () => { + const { message } = await editMonitorAPI( + monitorId, + { + type: 'http', + locations: ['mars'], + privateLocations: ['moon'], + }, + 400 + ); + expect(message).eql('Invalid monitor key(s) for http type: privateLocations'); + + const result = await editMonitorAPI( + monitorId, + { + type: 'http', + locations: ['mars'], + private_locations: ['moon'], + }, + 400 + ); + rawExpect(result.message).toContain("Private Location(s) 'moon' not found."); + }); + + it('throws an error if empty locations', async () => { + const monitor = { + locations: [], + private_locations: [], + }; + const { message } = await editMonitorAPI(monitorId, monitor, 400); + + expect(message).eql(LOCATION_REQUIRED_ERROR); + }); + + it('cannot change origin type', async () => { + const monitor = { + origin: 'project', + }; + const result = await editMonitorAPI(monitorId, monitor, 400); + + expect(result).eql({ + statusCode: 400, + error: 'Bad Request', + message: 'Unsupported origin type project, only ui type is supported via API.', + attributes: { + details: 'Unsupported origin type project, only ui type is supported via API.', + payload: { origin: 'project' }, + }, + }); + }); + + const updates: any = {}; + + it('can change name of monitor', async () => { + updates.name = `updated name ${uuidv4()}`; + const monitor = { + name: updates.name, + }; + const { body: result } = await editMonitorAPI(monitorId, monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + ...updates, + locations: [privateLocation1], + revision: 2, + url: 'https://www.google.com', + }) + ); + }); + + it('prevents duplicate name of monitor', async () => { + const name = `test name ${uuidv4()}`; + const monitor = { + name, + type: 'http', + private_locations: [privateLocation1.id], + url: 'https://www.google.com', + }; + // create one monitor with one name + await addMonitorAPI(monitor); + // create another monitor with a different name + const { body: result, rawBody } = await addMonitorAPI({ + ...monitor, + name: 'test name', + }); + const newMonitorId = rawBody.id; + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...monitor, + locations: [privateLocation1], + name: 'test name', + }) + ); + + const editResult = await editMonitorAPI( + newMonitorId, + { + name, + }, + 400 + ); + + expect(editResult).eql({ + statusCode: 400, + error: 'Bad Request', + message: `Monitor name must be unique, "${name}" already exists.`, + attributes: { + details: `Monitor name must be unique, "${name}" already exists.`, + }, + }); + }); + + it('can add a second private location to existing monitor', async () => { + const monitor = { + private_locations: [privateLocation1.id, privateLocation2.id], + }; + + const { body: result } = await editMonitorAPI(monitorId, monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...updates, + revision: 3, + url: 'https://www.google.com', + locations: [privateLocation1, privateLocation2], + }) + ); + }); + + it('can remove private location from existing monitor', async () => { + const monitor = { + private_locations: [privateLocation2.id], + }; + + const { body: result } = await editMonitorAPI(monitorId, monitor); + + expect(result).eql( + omitMonitorKeys({ + ...defaultFields, + ...updates, + revision: 4, + url: 'https://www.google.com', + locations: [privateLocation2], + }) + ); + }); + + it('can not remove all locations', async () => { + const monitor = { + locations: [], + private_locations: [], + }; + + const { message } = await editMonitorAPI(monitorId, monitor, 400); + + expect(message).eql(LOCATION_REQUIRED_ERROR); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/enable_default_alerting.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/enable_default_alerting.ts new file mode 100644 index 000000000000..231195be88e4 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/enable_default_alerting.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from '@kbn/expect'; +import rawExpect from 'expect'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { omit } from 'lodash'; +import { HTTPFields, PrivateLocation } from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '@kbn/synthetics-plugin/common/constants/settings_defaults'; + +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { addMonitorAPIHelper, omitMonitorKeys } from './create_monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('EnableDefaultAlerting', function () { + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const retry = getService('retry'); + const samlAuth = getService('samlAuth'); + + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + + const privateLocationTestService = new PrivateLocationTestService(getService); + + const addMonitorAPI = async (monitor: any, statusCode = 200) => { + return addMonitorAPIHelper(supertest, monitor, statusCode, editorUser, samlAuth); + }; + + after(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + }); + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + _httpMonitorJson = getFixtureJson('http_monitor'); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + }); + + beforeEach(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + privateLocation = await privateLocationTestService.addTestPrivateLocation(); + httpMonitorJson = { + ..._httpMonitorJson, + locations: [privateLocation], + }; + await supertest + .put(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(DYNAMIC_SETTINGS_DEFAULTS) + .expect(200); + }); + + it('returns the created alerted when called', async () => { + const apiResponse = await supertest + .post(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + const omitFields = [ + 'apiKeyOwner', + 'createdBy', + 'updatedBy', + 'id', + 'updatedAt', + 'createdAt', + 'scheduledTaskId', + 'executionStatus', + 'monitoring', + 'nextRun', + 'lastRun', + 'snoozeSchedule', + 'viewInAppRelativeUrl', + ]; + + const statusRule = apiResponse.body.statusRule; + const tlsRule = apiResponse.body.tlsRule; + + rawExpect(omit(statusRule, omitFields)).toEqual( + omit(defaultAlertRules.statusRule, omitFields) + ); + rawExpect(omit(tlsRule, omitFields)).toEqual(omit(defaultAlertRules.tlsRule, omitFields)); + }); + + it('enables alert when new monitor is added', async () => { + const newMonitor = httpMonitorJson; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + expect(apiResponse).eql(omitMonitorKeys({ ...newMonitor, spaceId: 'default' })); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule.ruleTypeId).eql('xpack.synthetics.alerts.monitorStatus'); + expect(res.body.tlsRule.ruleTypeId).eql('xpack.synthetics.alerts.tls'); + }); + }); + + it('deletes (and recreates) the default rule when settings are updated', async () => { + const newMonitor = httpMonitorJson; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + expect(apiResponse).eql(omitMonitorKeys(newMonitor)); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule.ruleTypeId).eql('xpack.synthetics.alerts.monitorStatus'); + expect(res.body.tlsRule.ruleTypeId).eql('xpack.synthetics.alerts.tls'); + }); + const settings = await supertest + .put(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + defaultStatusRuleEnabled: false, + defaultTLSRuleEnabled: false, + }); + + expect(settings.body.defaultStatusRuleEnabled).eql(false); + expect(settings.body.defaultTLSRuleEnabled).eql(false); + + await supertest + .put(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule).eql(null); + expect(res.body.tlsRule).eql(null); + }); + + const settings2 = await supertest + .put(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + defaultStatusRuleEnabled: true, + defaultTLSRuleEnabled: true, + }) + .expect(200); + + expect(settings2.body.defaultStatusRuleEnabled).eql(true); + expect(settings2.body.defaultTLSRuleEnabled).eql(true); + + await supertest + .put(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule.ruleTypeId).eql('xpack.synthetics.alerts.monitorStatus'); + expect(res.body.tlsRule.ruleTypeId).eql('xpack.synthetics.alerts.tls'); + }); + }); + + it('doesnt throw errors when rule has already been deleted', async () => { + const newMonitor = httpMonitorJson; + + const { body: apiResponse } = await addMonitorAPI(newMonitor); + + expect(apiResponse).eql(omitMonitorKeys(newMonitor)); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule.ruleTypeId).eql('xpack.synthetics.alerts.monitorStatus'); + expect(res.body.tlsRule.ruleTypeId).eql('xpack.synthetics.alerts.tls'); + }); + + const settings = await supertest + .put(SYNTHETICS_API_URLS.DYNAMIC_SETTINGS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + defaultStatusRuleEnabled: false, + defaultTLSRuleEnabled: false, + }) + .expect(200); + + expect(settings.body.defaultStatusRuleEnabled).eql(false); + expect(settings.body.defaultTLSRuleEnabled).eql(false); + + await supertest + .put(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule).eql(null); + expect(res.body.tlsRule).eql(null); + }); + + // call api again with the same settings, make sure its 200 + await supertest + .put(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + await retry.tryForTime(30 * 1000, async () => { + const res = await supertest + .get(SYNTHETICS_API_URLS.ENABLE_DEFAULT_ALERTING) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(res.body.statusRule).eql(null); + expect(res.body.tlsRule).eql(null); + }); + }); + }); +} + +const defaultAlertRules = { + statusRule: { + id: '574e82f0-1672-11ee-8e7d-c985c0ef6c2e', + notifyWhen: null, + consumer: 'uptime', + alertTypeId: 'xpack.synthetics.alerts.monitorStatus', + tags: ['SYNTHETICS_DEFAULT_ALERT'], + name: 'Synthetics status internal rule', + enabled: true, + throttle: null, + apiKeyOwner: 'any', + apiKeyCreatedByUser: true, + createdBy: 'any', + updatedBy: 'any', + muteAll: false, + mutedInstanceIds: [], + revision: 0, + running: false, + schedule: { interval: '1m' }, + actions: [], + params: {}, + snoozeSchedule: [], + updatedAt: '2023-06-29T11:44:44.488Z', + createdAt: '2023-06-29T11:44:44.488Z', + scheduledTaskId: '574e82f0-1672-11ee-8e7d-c985c0ef6c2e', + executionStatus: { + status: 'ok', + lastExecutionDate: '2023-06-29T11:47:55.331Z', + lastDuration: 64, + }, + ruleTypeId: 'xpack.synthetics.alerts.monitorStatus', + viewInAppRelativeUrl: '/app/observability/alerts/rules/574e82f0-1672-11ee-8e7d-c985c0ef6c2e', + }, + tlsRule: { + id: '574eaa00-1672-11ee-8e7d-c985c0ef6c2e', + notifyWhen: null, + consumer: 'uptime', + alertTypeId: 'xpack.synthetics.alerts.tls', + tags: ['SYNTHETICS_DEFAULT_ALERT'], + name: 'Synthetics internal TLS rule', + enabled: true, + throttle: null, + apiKeyOwner: 'elastic_admin', + apiKeyCreatedByUser: true, + createdBy: 'elastic_admin', + updatedBy: 'elastic_admin', + muteAll: false, + mutedInstanceIds: [], + revision: 0, + running: false, + schedule: { interval: '1m' }, + actions: [], + params: {}, + snoozeSchedule: [], + updatedAt: '2023-06-29T11:44:44.489Z', + createdAt: '2023-06-29T11:44:44.489Z', + scheduledTaskId: '574eaa00-1672-11ee-8e7d-c985c0ef6c2e', + executionStatus: { + status: 'ok', + lastExecutionDate: '2023-06-29T11:44:46.214Z', + lastDuration: 193, + }, + ruleTypeId: 'xpack.synthetics.alerts.tls', + viewInAppRelativeUrl: '/app/observability/alerts/rules/574e82f0-1672-11ee-8e7d-c985c0ef6c2e', + }, +}; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/browser_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/browser_monitor.json new file mode 100644 index 000000000000..1cb2d39685bf --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/browser_monitor.json @@ -0,0 +1,60 @@ +{ + "type": "browser", + "enabled": true, + "alert": { + "status": { + "enabled": true + } + }, + "journey_id": "", + "project_id": "", + "schedule": { + "number": "3", + "unit": "m" + }, + "service.name": "", + "config_id": "", + "tags": ["cookie-test", "browser"], + "timeout": "16", + "__ui": { + "script_source": { + "is_generated_script": false, + "file_name": "" + }, + "is_tls_enabled": false + }, + "source.inline.script": "step(\"Visit /users api route\", async () => {\\n const response = await page.goto('https://nextjs-test-synthetics.vercel.app/api/users');\\n expect(response.status()).toEqual(200);\\n});", + "source.project.content": "", + "params": "", + "screenshots": "on", + "synthetics_args": [], + "filter_journeys.match": "", + "filter_journeys.tags": [], + "ignore_https_errors": false, + "throttling": { + "value": { + "download": "5", + "latency": "20", + "upload": "3" + }, + "id": "default", + "label": "Default" + }, + "locations": ["dev"], + "name": "Test HTTP Monitor 03", + "namespace": "testnamespace", + "origin": "ui", + "form_monitor_type": "multistep", + "url.port": null, + "id": "", + "hash": "", + "playwright_options": "", + "playwright_text_assertion": "", + "ssl.certificate": "", + "ssl.certificate_authorities": "", + "ssl.supported_protocols": ["TLSv1.1", "TLSv1.2", "TLSv1.3"], + "ssl.verification_mode": "full", + "revision": 1, + "max_attempts": 2, + "labels": {} +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/http_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/http_monitor.json new file mode 100644 index 000000000000..47d0637a7cd9 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/http_monitor.json @@ -0,0 +1,83 @@ +{ + "type": "http", + "enabled": true, + "alert": { + "status": { + "enabled": true + } + }, + "tags": [ + "tag1", + "tag2" + ], + "schedule": { + "number": "5", + "unit": "m" + }, + "service.name": "", + "config_id": "", + "timeout": "180", + "__ui": { + "is_tls_enabled": false + }, + "max_attempts": 2, + "max_redirects": "3", + "password": "test", + "urls": "https://nextjs-test-synthetics.vercel.app/api/users", + "url.port": null, + "proxy_url": "http://proxy.com", + "proxy_headers": {}, + "check.response.body.negative": [], + "check.response.body.positive": [], + "check.response.json": [], + "response.include_body": "never", + "response.include_body_max_bytes": "1024", + "check.request.headers": { + "sampleHeader": "sampleHeaderValue" + }, + "response.include_headers": true, + "check.response.status": [ + "200", + "201" + ], + "check.request.body": { + "value": "testValue", + "type": "json" + }, + "check.response.headers": {}, + "check.request.method": "", + "username": "test-username", + "ssl.certificate_authorities": "t.string", + "ssl.certificate": "t.string", + "ssl.key": "t.string", + "ssl.key_passphrase": "t.string", + "ssl.verification_mode": "certificate", + "ssl.supported_protocols": [ + "TLSv1.1", + "TLSv1.2" + ], + "name": "test-monitor-name", + "locations": [ + { + "id": "dev", + "label": "Dev Service", + "geo": { + "lat": 0, + "lon": 0 + }, + "isServiceManaged": true + } + ], + "namespace": "testnamespace", + "revision": 1, + "origin": "ui", + "form_monitor_type": "http", + "journey_id": "", + "id": "", + "hash": "", + "mode": "any", + "ipv4": true, + "ipv6": true, + "params": "", + "labels": {} +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/icmp_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/icmp_monitor.json new file mode 100644 index 000000000000..8f97e8de7424 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/icmp_monitor.json @@ -0,0 +1,35 @@ +{ + "type": "icmp", + "locations": ["dev"], + "journey_id": "", + "enabled": true, + "alert": { + "status": { + "enabled": true + } + }, + "schedule": { + "number": "3", + "unit": "m" + }, + "config_id": "", + "service.name": "example-service-name", + "tags": [ + "tagT1", + "tagT2" + ], + "timeout": "16", + "hosts": "192.33.22.111:3333", + "wait": "1", + "name": "Test HTTP Monitor 04", + "namespace": "testnamespace", + "origin": "ui", + "form_monitor_type": "icmp", + "id": "", + "hash": "", + "mode": "any", + "ipv4": true, + "ipv6": true, + "params": "", + "max_attempts": 2 +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/inspect_browser_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/inspect_browser_monitor.json new file mode 100644 index 000000000000..2307e4dcbfaf --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/inspect_browser_monitor.json @@ -0,0 +1,85 @@ +{ + "type": "browser", + "form_monitor_type": "multistep", + "enabled": true, + "alert": { + "status": { + "enabled": true + } + }, + "schedule": { + "number": "10", + "unit": "m" + }, + "service.name": "", + "config_id": "0088b13c-9bb0-4fc6-a0b5-63b9b024eabb", + "tags": [], + "timeout": null, + "name": "check if title is present", + "locations": [ + { + "id": "dev", + "label": "Dev Service", + "geo": { + "lat": 0, + "lon": 0 + }, + "isServiceManaged": true + } + ], + "namespace": "default", + "origin": "project", + "journey_id": "bb82f7de-d832-4b14-8097-38a464d5fe49", + "hash": "ekrjelkjrelkjre", + "id": "bb82f7de-d832-4b14-8097-38a464d5fe49-test-project-cb47c83a-45e7-416a-9301-cb476b5bff01-default", + "params": "", + "project_id": "test-project-cb47c83a-45e7-416a-9301-cb476b5bff01", + "playwright_options": "{\"headless\":true,\"chromiumSandbox\":false}", + "__ui": { + "script_source": { + "is_generated_script": false, + "file_name": "" + } + }, + "url.port": null, + "source.inline.script": "", + "source.project.content": "UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA", + "playwright_text_assertion": "", + "urls": "", + "screenshots": "on", + "synthetics_args": [], + "filter_journeys.match": "check if title is present", + "filter_journeys.tags": [], + "ignore_https_errors": false, + "throttling": { + "value": { + "download": "5", + "upload": "3", + "latency": "20" + }, + "id": "default", + "label": "Default" + }, + "ssl.certificate_authorities": "", + "ssl.certificate": "", + "ssl.key": "", + "ssl.key_passphrase": "", + "ssl.verification_mode": "full", + "ssl.supported_protocols": [ + "TLSv1.1", + "TLSv1.2", + "TLSv1.3" + ], + "original_space": "default", + "custom_heartbeat_id": "bb82f7de-d832-4b14-8097-38a464d5fe49-test-project-cb47c83a-45e7-416a-9301-cb476b5bff01-default", + "revision": 1, + "source.inline": { + "type": "inline", + "script": "", + "fileName": "" + }, + "service": { + "name": "" + }, + "max_attempts": 2 +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_browser_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_browser_monitor.json new file mode 100644 index 000000000000..18cea933e797 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_browser_monitor.json @@ -0,0 +1,30 @@ +{ + "keep_stale": true, + "project": "test-suite", + "monitors": [{ + "throttling": { + "download": 5, + "upload": 3, + "latency": 20 + }, + "schedule": 10, + "locations": [ + "dev" + ], + "params": {}, + "playwrightOptions": { + "headless": true, + "chromiumSandbox": false + }, + "name": "check if title is present", + "id": "check-if-title-is-present", + "tags": [], + "content": "UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA", + "filter": { + "match": "check if title is present" + }, + "hash": "ekrjelkjrelkjre", + "max_attempts": 2, + "type": "browser" + }] +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_http_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_http_monitor.json new file mode 100644 index 000000000000..05e1ebed01ae --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_http_monitor.json @@ -0,0 +1,86 @@ +{ + "project": "test-suite", + "keep_stale": false, + "monitors": [ + { + "locations": ["dev"], + "type": "http", + "enabled": false, + "id": "my-monitor-2", + "name": "My Monitor 2", + "urls": [ + "http://localhost:9200", + "http://anotherurl:9200" + ], + "schedule": 60, + "timeout": "80s", + "check.request": { + "method": "POST", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + } + }, + "response": { + "include_body": "always" + }, + "response.include_headers": false, + "check.response": { + "status": [ + 200 + ], + "body": [ + "Saved", + "saved" + ] + }, + "unsupportedKey": { + "nestedUnsupportedKey": "unsupportedValue" + }, + "hash": "ekrjelkjrelkjre" + }, + { + "locations": ["dev"], + "type": "http", + "enabled": false, + "id": "my-monitor-3", + "name": "My Monitor 3", + "proxy_url": "${testGlobalParam2}", + "urls": [ + "http://localhost:9200" + ], + "schedule": 60, + "timeout": "80s", + "check.request": { + "method": "POST", + "headers": { + "Content-Type": "application/x-www-form-urlencoded" + } + }, + "response": { + "include_body": "always", + "include_body_max_bytes": 900 + }, + "tags": "tag2,tag2", + "response.include_headers": false, + "check.response": { + "status": [ + 200 + ], + "body":{ + "positive": [ + "${testLocal1}", + "saved" + ] + }, + "json": [{"description":"check status","expression":"foo.bar == \"myValue\""}] + }, + "hash": "ekrjelkjrelkjre", + "ssl.verification_mode": "strict", + "params": { + "testLocal1": "testLocalParamsValue", + "testGlobalParam2": "testGlobalParamOverwrite" + }, + "max_attempts": 2 + } + ] +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_icmp_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_icmp_monitor.json new file mode 100644 index 000000000000..63e4215e46cc --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_icmp_monitor.json @@ -0,0 +1,47 @@ + + + +{ + "project": "test-suite", + "keep_stale": true, + "monitors": [ + { + "locations": [ "dev" ], + "type": "icmp", + "id": "Cloudflare-DNS", + "name": "Cloudflare DNS", + "hosts": [ "1.1.1.1" ], + "schedule": 1, + "tags": [ "service:smtp", "org:google" ], + "privateLocations": [ "Test private location 0" ], + "wait": "30s", + "hash": "ekrjelkjrelkjre" + }, + { + "locations": [ "dev" ], + "type": "icmp", + "id": "Cloudflare-DNS-2", + "name": "Cloudflare DNS 2", + "hosts": "1.1.1.1", + "schedule": 1, + "tags": "tag1,tag2", + "privateLocations": [ "Test private location 0" ], + "wait": "1m", + "hash": "ekrjelkjrelkjre" + }, + { + "locations": [ "dev" ], + "type": "icmp", + "id": "Cloudflare-DNS-3", + "name": "Cloudflare DNS 3", + "hosts": "1.1.1.1,2.2.2.2", + "schedule": 1, + "tags": "tag1,tag2", + "privateLocations": [ "Test private location 0" ], + "unsupportedKey": { + "nestedUnsupportedKey": "unnsuportedValue" + }, + "hash": "ekrjelkjrelkjre" + } + ] +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_tcp_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_tcp_monitor.json new file mode 100644 index 000000000000..26382b010ec3 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/project_tcp_monitor.json @@ -0,0 +1,44 @@ +{ + "project": "test-suite", + "keep_stale": true, + "monitors": [ + { + "locations": [ "dev" ], + "type": "tcp", + "id": "gmail-smtp", + "name": "GMail SMTP", + "hosts": [ "smtp.gmail.com:587" ], + "schedule": 1, + "tags": [ "service:smtp", "org:google" ], + "privateLocations": [ ], + "hash": "ekrjelkjrelkjre", + "ssl.verification_mode": "strict" + }, + { + "locations": [ "dev" ], + "type": "tcp", + "id": "always-down", + "name": "Always Down", + "hosts": "localhost:18278", + "schedule": 1, + "tags": "tag1,tag2", + "privateLocations": [ ], + "hash": "ekrjelkjrelkjre" + }, + { + "locations": [ "dev" ], + "type": "tcp", + "id": "always-down", + "name": "Always Down", + "hosts": ["localhost", "anotherhost"], + "ports": ["5698"], + "schedule": 1, + "tags": "tag1,tag2", + "privateLocations": [ ], + "unsupportedKey": { + "nestedUnsupportedKey": "unnsuportedValue" + }, + "hash": "ekrjelkjrelkjre" + } + ] +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/tcp_monitor.json b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/tcp_monitor.json new file mode 100644 index 000000000000..9cc646a36c94 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/fixtures/tcp_monitor.json @@ -0,0 +1,43 @@ +{ + "type": "tcp", + "locations": ["dev"], + "enabled": true, + "config_id": "", + "schedule": { + "number": "3", + "unit": "m" + }, + "service.name": "", + "tags": [], + "timeout": "16", + "__ui": { + "is_tls_enabled": true + }, + "hosts": "example-host:40", + "urls": "example-host:40", + "url.port": null, + "proxy_url": "", + "proxy_use_local_resolver": false, + "check.receive": "", + "check.send": "", + "ssl.certificate_authorities": "", + "ssl.certificate": "", + "ssl.key": "", + "ssl.key_passphrase": "examplepassphrase", + "ssl.verification_mode": "full", + "ssl.supported_protocols": [ + "TLSv1.1", + "TLSv1.3" + ], + "name": "Test HTTP Monitor 04", + "namespace": "testnamespace", + "origin": "ui", + "form_monitor_type": "tcp", + "id": "", + "hash": "", + "mode": "any", + "ipv4": true, + "ipv6": true, + "params": "", + "max_attempts": 2 +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_filters.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_filters.ts new file mode 100644 index 000000000000..cd6f8ff2f727 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_filters.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 { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import expect from '@kbn/expect'; +import { PrivateLocation } from '@kbn/synthetics-plugin/common/runtime_types'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('getMonitorFilters', function () { + const kibanaServer = getService('kibanaServer'); + const supertest = getService('supertestWithoutAuth'); + const samlAuth = getService('samlAuth'); + + const privateLocationTestService = new PrivateLocationTestService(getService); + + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + + after(async () => { + await kibanaServer.savedObjects.clean({ types: [syntheticsMonitorType] }); + }); + + before(async () => { + await kibanaServer.savedObjects.clean({ types: [syntheticsMonitorType] }); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + privateLocation = await privateLocationTestService.addTestPrivateLocation(); + }); + + it('get list of filters', async () => { + const apiResponse = await supertest + .get(SYNTHETICS_API_URLS.FILTERS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(apiResponse.body).eql({ + monitorTypes: [], + tags: [], + locations: [], + projects: [], + schedules: [], + }); + }); + + it('get list of filters with monitorTypes', async () => { + const newMonitor = { + name: 'Sample name', + type: 'http', + urls: 'https://elastic.co', + tags: ['apm', 'synthetics'], + locations: [privateLocation], + }; + + await supertest + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(newMonitor) + .expect(200); + + const apiResponse = await supertest + .get(SYNTHETICS_API_URLS.FILTERS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(apiResponse.body).eql({ + monitorTypes: [{ label: 'http', count: 1 }], + tags: [ + { label: 'apm', count: 1 }, + { label: 'synthetics', count: 1 }, + ], + locations: [{ label: privateLocation.id, count: 1 }], + projects: [], + schedules: [{ label: '3', count: 1 }], + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor.ts new file mode 100644 index 000000000000..d35e1bfc0183 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor.ts @@ -0,0 +1,354 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license 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'; +import moment from 'moment'; +import { v4 as uuidv4 } from 'uuid'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + ConfigKey, + EncryptedSyntheticsSavedMonitor, + MonitorFields, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { secretKeys } from '@kbn/synthetics-plugin/common/constants/monitor_management'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; +import { omitMonitorKeys } from './create_monitor'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { getFixtureJson } from './helpers/get_fixture_json'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('getSyntheticsMonitors', function () { + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const retry = getService('retry'); + const samlAuth = getService('samlAuth'); + const monitorTestService = new SyntheticsMonitorTestService(getService); + const privateLocationTestService = new PrivateLocationTestService(getService); + + let _monitors: MonitorFields[]; + let monitors: MonitorFields[]; + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + + const saveMonitor = async (monitor: MonitorFields, spaceId?: string) => { + let url = SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '?internal=true'; + if (spaceId) { + url = '/s/' + spaceId + url; + } + const res = await supertest + .post(url) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor); + + expect(res.status).eql(200, JSON.stringify(res.body)); + + return res.body as EncryptedSyntheticsSavedMonitor; + }; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + privateLocation = await privateLocationTestService.addTestPrivateLocation(); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + _monitors = [ + getFixtureJson('icmp_monitor'), + getFixtureJson('tcp_monitor'), + getFixtureJson('http_monitor'), + getFixtureJson('browser_monitor'), + ].map((mon) => ({ + ...mon, + locations: [privateLocation], + })); + }); + + beforeEach(() => { + monitors = _monitors; + }); + + // FLAKY: https://github.com/elastic/kibana/issues/204069 + describe.skip('get many monitors', () => { + it('without params', async () => { + const uuid = uuidv4(); + const [mon1, mon2] = await Promise.all( + monitors.map((mon, i) => saveMonitor({ ...mon, name: `${mon.name}-${uuid}-${i}` })) + ); + + const apiResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '?perPage=1000&internal=true') // 1000 to sort of load all saved monitors + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const found: MonitorFields[] = apiResponse.body.monitors.filter(({ id }: MonitorFields) => + [mon1.id, mon2.id].includes(id) + ); + found.sort(({ id: a }) => (a === mon2.id ? 1 : a === mon1.id ? -1 : 0)); + const foundMonitors = found.map( + (fields) => fields as unknown as EncryptedSyntheticsSavedMonitor + ); + + const expected = [mon1, mon2]; + + /** + * These dates are dynamically generated by the server, so we can't + * compare them directly. Instead, we'll just check that they're valid. + */ + foundMonitors.forEach(({ updated_at: updatedAt, created_at: createdAt }) => { + expect(moment(createdAt).isValid()).to.be(true); + expect(moment(updatedAt).isValid()).to.be(true); + }); + + expect(foundMonitors.map((fm) => omit(fm, 'updated_at', 'created_at', 'spaceId'))).eql( + expected.map((expectedMon) => + omit(expectedMon, ['updated_at', 'created_at', ...secretKeys]) + ) + ); + }); + + it('with page params', async () => { + const allMonitors = [...monitors, ...monitors]; + for (const mon of allMonitors) { + await saveMonitor({ ...mon, name: mon.name + Date.now() }); + } + + await retry.try(async () => { + const firstPageResp = await supertest + .get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=2`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const secondPageResp = await supertest + .get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=2&perPage=3`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(firstPageResp.body.total).greaterThan(6); + expect(firstPageResp.body.monitors.length).eql(2); + expect(secondPageResp.body.monitors.length).eql(3); + + expect(firstPageResp.body.monitors[0].id).not.eql(secondPageResp.body.monitors[0].id); + }); + }); + + it('with single monitorQueryId filter', async () => { + const uuid = uuidv4(); + const [_, { id: id2 }] = await Promise.all( + monitors + .map((mon, i) => ({ ...mon, name: `mon.name-${uuid}-${i}` })) + .map((mon) => saveMonitor(mon)) + ); + + const resp = await supertest + .get( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=10&monitorQueryIds=${id2}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const resultMonitorIds = resp.body.monitors.map(({ id }: Partial) => id); + expect(resultMonitorIds.length).eql(1); + expect(resultMonitorIds).eql([id2]); + }); + + it('with multiple monitorQueryId filter', async () => { + const uuid = uuidv4(); + const [_, { id: id2 }, { id: id3 }] = await Promise.all( + monitors + .map((mon, i) => ({ ...mon, name: `${mon.name}-${uuid}-${i}` })) + .map((monT) => saveMonitor(monT)) + ); + + const resp = await supertest + .get( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=10&sortField=name.keyword&sortOrder=asc&monitorQueryIds=${id2}&monitorQueryIds=${id3}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const resultMonitorIds = resp.body.monitors.map(({ id }: Partial) => id); + + expect(resultMonitorIds.length).eql(2); + expect(resultMonitorIds).eql([id2, id3]); + }); + + it('monitorQueryId respects custom_heartbeat_id while filtering', async () => { + const customHeartbeatId0 = 'custom-heartbeat-id-test-01'; + const customHeartbeatId1 = 'custom-heartbeat-id-test-02'; + await Promise.all( + [ + { + ...monitors[0], + [ConfigKey.CUSTOM_HEARTBEAT_ID]: customHeartbeatId0, + [ConfigKey.NAME]: `NAME-${customHeartbeatId0}`, + }, + { + ...monitors[1], + [ConfigKey.CUSTOM_HEARTBEAT_ID]: customHeartbeatId1, + [ConfigKey.NAME]: `NAME-${customHeartbeatId1}`, + }, + ].map((monT) => saveMonitor(monT)) + ); + + const resp = await supertest + .get( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=10&sortField=name.keyword&sortOrder=asc&monitorQueryIds=${customHeartbeatId0}&monitorQueryIds=${customHeartbeatId1}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const resultMonitorIds = resp.body.monitors + .map(({ id }: Partial) => id) + .filter((id: string, index: number, arr: string[]) => arr.indexOf(id) === index); // Filter only unique + expect(resultMonitorIds.length).eql(2); + expect(resultMonitorIds).eql([customHeartbeatId0, customHeartbeatId1]); + }); + + it('gets monitors from all spaces', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + const spaceScopedPrivateLocation = await privateLocationTestService.addTestPrivateLocation( + SPACE_ID + ); + + const allMonitors = [...monitors, ...monitors]; + for (const mon of allMonitors) { + await saveMonitor( + { ...mon, name: mon.name + Date.now(), locations: [spaceScopedPrivateLocation] }, + SPACE_ID + ); + } + + const firstPageResp = await supertest + .get(`${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=1000`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + const defaultSpaceMons = firstPageResp.body.monitors.filter( + ({ spaceId }: { spaceId: string }) => spaceId === 'default' + ); + const testSpaceMons = firstPageResp.body.monitors.filter( + ({ spaceId }: { spaceId: string }) => spaceId === SPACE_ID + ); + + expect(defaultSpaceMons.length).to.eql(22); + expect(testSpaceMons.length).to.eql(0); + + const res = await supertest + .get( + `${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}?page=1&perPage=1000&showFromAllSpaces=true` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const defaultSpaceMons1 = res.body.monitors.filter( + ({ spaceId }: { spaceId: string }) => spaceId === 'default' + ); + const testSpaceMons1 = res.body.monitors.filter( + ({ spaceId }: { spaceId: string }) => spaceId === SPACE_ID + ); + + expect(defaultSpaceMons1.length).to.eql(22); + expect(testSpaceMons1.length).to.eql(8); + }); + }); + + describe('get one monitor', () => { + it('should get by id', async () => { + const uuid = uuidv4(); + const [{ id: id1 }] = await Promise.all( + monitors + .map((mon, i) => ({ ...mon, name: `${mon.name}-${uuid}-${i}` })) + .map((monT) => saveMonitor(monT)) + ); + + const apiResponse = await monitorTestService.getMonitor(id1, { user: editorUser }); + + expect(apiResponse.body).eql( + omitMonitorKeys({ + ...monitors[0], + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + revision: 1, + locations: [privateLocation], + name: `${monitors[0].name}-${uuid}-0`, + }) + ); + }); + + it('should get by id with ui query param', async () => { + const uuid = uuidv4(); + const [{ id: id1 }] = await Promise.all( + monitors + .map((mon, i) => ({ ...mon, name: `${mon.name}-${uuid}-${i}` })) + .map((monT) => saveMonitor(monT)) + ); + + const apiResponse = await monitorTestService.getMonitor(id1, { + internal: true, + user: editorUser, + }); + + expect(apiResponse.body).eql( + omit( + { + ...monitors[0], + form_monitor_type: 'icmp', + revision: 1, + locations: [privateLocation], + name: `${monitors[0].name}-${uuid}-0`, + hosts: '192.33.22.111:3333', + hash: '', + journey_id: '', + max_attempts: 2, + labels: {}, + }, + ['config_id', 'id', 'form_monitor_type'] + ) + ); + }); + + it('returns 404 if monitor id is not found', async () => { + const invalidMonitorId = 'invalid-id'; + const expected404Message = `Monitor id ${invalidMonitorId} not found!`; + + const getResponse = await supertest + .get(SYNTHETICS_API_URLS.GET_SYNTHETICS_MONITOR.replace('{monitorId}', invalidMonitorId)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(404); + + expect(getResponse.body.message).eql(expected404Message); + }); + + it('validates param length', async () => { + const veryLargeMonId = new Array(1050).fill('1').join(''); + + await supertest + .get(SYNTHETICS_API_URLS.GET_SYNTHETICS_MONITOR.replace('{monitorId}', veryLargeMonId)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(400); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor_project.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor_project.ts new file mode 100644 index 000000000000..0678731a4202 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/get_monitor_project.ts @@ -0,0 +1,741 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import type SuperTest from 'supertest'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + LegacyProjectMonitorsRequest, + ProjectMonitor, + ProjectMonitorMetaData, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('GetProjectMonitors', function () { + const supertest = getService('supertestWithoutAuth'); + const samlAuth = getService('samlAuth'); + + let projectMonitors: LegacyProjectMonitorsRequest; + let httpProjectMonitors: LegacyProjectMonitorsRequest; + let tcpProjectMonitors: LegacyProjectMonitorsRequest; + let icmpProjectMonitors: LegacyProjectMonitorsRequest; + let testPolicyId = ''; + let editorUser: RoleCredentials; + let testPrivateLocations: PrivateLocation[] = []; + + const testPrivateLocationsService = new PrivateLocationTestService(getService); + + const setUniqueIds = ( + request: LegacyProjectMonitorsRequest, + privateLocations: PrivateLocation[] = [] + ) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ + ...monitor, + id: uuidv4(), + locations: [], + privateLocations: privateLocations.map((location) => location.label), + })), + }; + }; + + before(async () => { + await testPrivateLocationsService.installSyntheticsPackage(); + + const testPolicyName = 'Fleet test server policy' + Date.now(); + const apiResponse = await testPrivateLocationsService.addFleetPolicy(testPolicyName); + testPolicyId = apiResponse.body.item.id; + testPrivateLocations = await testPrivateLocationsService.setTestLocations([testPolicyId]); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + }); + + beforeEach(() => { + projectMonitors = setUniqueIds( + getFixtureJson('project_browser_monitor'), + testPrivateLocations + ); + httpProjectMonitors = setUniqueIds( + getFixtureJson('project_http_monitor'), + testPrivateLocations + ); + tcpProjectMonitors = setUniqueIds( + getFixtureJson('project_tcp_monitor'), + testPrivateLocations + ); + icmpProjectMonitors = setUniqueIds( + getFixtureJson('project_icmp_monitor'), + testPrivateLocations + ); + }); + + it('project monitors - fetches all monitors - browser', async () => { + const monitors = []; + const project = 'test-brower-suite'; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...projectMonitors.monitors[0], + id: `test browser id ${i}`, + name: `test name ${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + + const firstPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ per_page: 500 }) + .send() + .expect(200); + + const { monitors: firstPageMonitors, total, after_key: afterKey } = firstPageResponse.body; + expect(firstPageMonitors.length).to.eql(500); + expect(total).to.eql(600); + expect(afterKey).to.eql('test browser id 548'); + + const secondPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + search_after: afterKey, + per_page: 500, + }) + .send() + .expect(200); + const { monitors: secondPageMonitors } = secondPageResponse.body; + expect(secondPageMonitors.length).to.eql(100); + checkFields([...firstPageMonitors, ...secondPageMonitors], monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + + it('project monitors - fetches all monitors - http', async () => { + const monitors = []; + const project = 'test-http-suite'; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...httpProjectMonitors.monitors[1], + id: `test http id ${i}`, + name: `test name ${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + + const firstPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ per_page: 500 }) + .send() + .expect(200); + + const { + monitors: firstPageProjectMonitors, + after_key: afterKey, + total, + } = firstPageResponse.body; + expect(firstPageProjectMonitors.length).to.eql(500); + expect(total).to.eql(600); + expect(afterKey).to.eql('test http id 548'); + + const secondPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + search_after: afterKey, + per_page: 500, + }) + .send() + .expect(200); + const { monitors: secondPageProjectMonitors } = secondPageResponse.body; + expect(secondPageProjectMonitors.length).to.eql(100); + checkFields([...firstPageProjectMonitors, ...secondPageProjectMonitors], monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + + it('project monitors - fetches all monitors - tcp', async () => { + const monitors = []; + const project = 'test-tcp-suite'; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...tcpProjectMonitors.monitors[0], + id: `test tcp id ${i}`, + name: `test name ${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + + const firstPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .query({ per_page: 500 }) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + const { + monitors: firstPageProjectMonitors, + after_key: afterKey, + total, + } = firstPageResponse.body; + expect(firstPageProjectMonitors.length).to.eql(500); + expect(total).to.eql(600); + expect(afterKey).to.eql('test tcp id 548'); + + const secondPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + search_after: afterKey, + per_page: 500, + }) + .send() + .expect(200); + const { monitors: secondPageProjectMonitors } = secondPageResponse.body; + expect(secondPageProjectMonitors.length).to.eql(100); + checkFields([...firstPageProjectMonitors, ...secondPageProjectMonitors], monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + + it('project monitors - fetches all monitors - icmp', async () => { + const monitors = []; + const project = 'test-icmp-suite'; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...icmpProjectMonitors.monitors[0], + id: `test icmp id ${i}`, + name: `test name ${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + const firstPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .query({ per_page: 500 }) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + const { + monitors: firstPageProjectMonitors, + after_key: afterKey, + total, + } = firstPageResponse.body; + expect(firstPageProjectMonitors.length).to.eql(500); + expect(total).to.eql(600); + expect(afterKey).to.eql('test icmp id 548'); + + const secondPageResponse = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + search_after: afterKey, + per_page: 500, + }) + .send() + .expect(200); + const { monitors: secondPageProjectMonitors } = secondPageResponse.body; + expect(secondPageProjectMonitors.length).to.eql(100); + + checkFields([...firstPageProjectMonitors, ...secondPageProjectMonitors], monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + + it('project monitors - handles url ecoded project names', async () => { + const monitors = []; + const projectName = 'Test project'; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...icmpProjectMonitors.monitors[0], + id: `test url id ${i}`, + name: `test name ${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + projectName + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + projectName + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + projectName + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + + const firstPageResponse = await supertest + .get( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace( + '{projectName}', + encodeURI(projectName) + ) + ) + .query({ per_page: 500 }) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send() + .expect(200); + + const { + monitors: firstPageProjectMonitors, + after_key: afterKey, + total, + } = firstPageResponse.body; + expect(firstPageProjectMonitors.length).to.eql(500); + expect(total).to.eql(600); + expect(afterKey).to.eql('test url id 548'); + + const secondPageResponse = await supertest + .get( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace( + '{projectName}', + encodeURI(projectName) + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + search_after: afterKey, + per_page: 500, + }) + .send() + .expect(200); + const { monitors: secondPageProjectMonitors } = secondPageResponse.body; + expect(secondPageProjectMonitors.length).to.eql(100); + + checkFields([...firstPageProjectMonitors, ...secondPageProjectMonitors], monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + encodeURI(projectName) + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + encodeURI(projectName) + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace( + '{projectName}', + encodeURI(projectName) + ) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + + it('project monitors - handles per_page parameter', async () => { + const monitors = []; + const project = 'test-suite'; + const perPage = 250; + for (let i = 0; i < 600; i++) { + monitors.push({ + ...icmpProjectMonitors.monitors[0], + id: `test-id-${i}`, + name: `test-name-${i}`, + }); + } + + try { + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(0, 250), + }) + .expect(200); + + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(250, 500), + }) + .expect(200); + await supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ + monitors: monitors.slice(500, 600), + }) + .expect(200); + + let count = Number.MAX_VALUE; + let afterId; + const fullResponse: ProjectMonitorMetaData[] = []; + let page = 1; + while (count >= 250) { + const response: SuperTest.Response = await supertest + .get(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT.replace('{projectName}', project)) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + per_page: perPage, + search_after: afterId, + }) + .send() + .expect(200); + + const { monitors: monitorsResponse, after_key: afterKey, total } = response.body; + expect(total).to.eql(600); + count = monitorsResponse.length; + fullResponse.push(...monitorsResponse); + if (page < 3) { + expect(count).to.eql(perPage); + } else { + expect(count).to.eql(100); + } + page++; + + afterId = afterKey; + } + // expect(fullResponse.length).to.eql(600); + // checkFields(fullResponse, monitors); + } finally { + const monitorsToDelete = monitors.map((monitor) => monitor.id); + + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(0, 250) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(250, 500) }) + .expect(200); + await supertest + .delete( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_DELETE.replace('{projectName}', project) + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ monitors: monitorsToDelete.slice(500, 600) }) + .expect(200); + } + }); + }); +} + +const checkFields = (monitorMetaData: ProjectMonitorMetaData[], monitors: ProjectMonitor[]) => { + monitors.forEach((monitor) => { + const configIsCorrect = monitorMetaData.some((ndjson: Record) => { + return ndjson.journey_id === monitor.id && ndjson.hash === monitor.hash; + }); + expect(configIsCorrect).to.eql(true); + }); +}; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/get_fixture_json.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/get_fixture_json.ts new file mode 100644 index 000000000000..9cc1640b7a58 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/get_fixture_json.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 fs from 'fs'; +import { join } from 'path'; + +const fixturesDir = join(__dirname, '..', 'fixtures'); + +export function getFixtureJson(fixtureName: string) { + try { + const fixturePath = join(fixturesDir, `${fixtureName}.json`); + const fileContents = fs.readFileSync(fixturePath, 'utf8'); + return JSON.parse(fileContents); + } catch (e) { + return {}; + } +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/monitor.ts new file mode 100644 index 000000000000..8c10fa78d983 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/helpers/monitor.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 { omit } from 'lodash'; + +export function omitResponseTimestamps(monitor: object) { + return omit(monitor, ['created_at', 'updated_at']); +} + +export function omitEmptyValues(monitor: object) { + const { url, ...rest } = omit(monitor, ['created_at', 'updated_at']) as any; + + return { + ...rest, + ...(url ? { url } : {}), + }; +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/index.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/index.ts new file mode 100644 index 000000000000..c15f73cf4e6d --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/index.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) { + describe('SyntheticsAPITests', () => { + loadTestFile(require.resolve('./create_monitor')); + loadTestFile(require.resolve('./create_monitor_private_location')); + loadTestFile(require.resolve('./create_monitor_project')); + loadTestFile(require.resolve('./create_monitor_project_private_location')); + loadTestFile(require.resolve('./create_monitor_public_api')); + loadTestFile(require.resolve('./create_update_params')); + loadTestFile(require.resolve('./delete_monitor_project')); + loadTestFile(require.resolve('./delete_monitor')); + loadTestFile(require.resolve('./edit_monitor')); + loadTestFile(require.resolve('./edit_monitor_public_api')); + loadTestFile(require.resolve('./enable_default_alerting')); + loadTestFile(require.resolve('./get_filters')); + loadTestFile(require.resolve('./get_monitor_project')); + loadTestFile(require.resolve('./get_monitor')); + loadTestFile(require.resolve('./synthetics_enablement')); + loadTestFile(require.resolve('./inspect_monitor')); + loadTestFile(require.resolve('./suggestions.ts')); + loadTestFile(require.resolve('./sync_global_params')); + loadTestFile(require.resolve('./test_now_monitor')); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/inspect_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/inspect_monitor.ts new file mode 100644 index 000000000000..99788e2b0d0f --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/inspect_monitor.ts @@ -0,0 +1,246 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import rawExpect from 'expect'; +import expect from '@kbn/expect'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('inspectSyntheticsMonitor', function () { + const supertest = getService('supertestWithoutAuth'); + + const monitorTestService = new SyntheticsMonitorTestService(getService); + const testPrivateLocations = new PrivateLocationTestService(getService); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + let _monitors: MonitorFields[]; + let editorUser: RoleCredentials; + let adminUser: RoleCredentials; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + await kibanaServer.savedObjects.clean({ types: ['synthetics-param'] }); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + adminUser = await samlAuth.createM2mApiKeyWithRoleScope('admin'); + await testPrivateLocations.installSyntheticsPackage(); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + _monitors = [getFixtureJson('http_monitor'), getFixtureJson('inspect_browser_monitor')]; + }); + + // tests public locations which fails in MKI + it.skip('inspect http monitor', async () => { + const apiResponse = await monitorTestService.inspectMonitor(adminUser, { + ..._monitors[0], + locations: [ + { + id: 'dev', + label: 'Dev Service', + isServiceManaged: true, + }, + ], + }); + + rawExpect(apiResponse).toEqual({ + result: { + publicConfigs: [ + rawExpect.objectContaining({ + monitors: [ + { + type: 'http', + schedule: '@every 5m', + enabled: true, + data_stream: { namespace: 'testnamespace' }, + streams: [ + { + data_stream: { dataset: 'http', type: 'synthetics' }, + type: 'http', + enabled: true, + schedule: '@every 5m', + tags: ['tag1', 'tag2'], + timeout: '180s', + name: 'test-monitor-name', + namespace: 'testnamespace', + origin: 'ui', + urls: 'https://nextjs-test-synthetics.vercel.app/api/users', + max_redirects: '3', + max_attempts: 2, + password: 'test', + proxy_url: 'http://proxy.com', + 'response.include_body': 'never', + 'response.include_headers': true, + 'check.response.status': ['200', '201'], + 'check.request.body': 'testValue', + 'check.request.headers': { sampleHeader: 'sampleHeaderValue' }, + username: 'test-username', + mode: 'any', + 'response.include_body_max_bytes': '1024', + ipv4: true, + ipv6: true, + fields: { + meta: { space_id: 'default' }, + }, + fields_under_root: true, + }, + ], + }, + ], + output: { hosts: [] }, + }), + ], + privateConfig: null, + }, + decodedCode: '', + }); + }); + + // tests public locations which fails in MKI + it.skip('inspect project browser monitor', async () => { + const apiResponse = await monitorTestService.inspectMonitor(editorUser, { + ..._monitors[1], + params: JSON.stringify({ + username: 'elastic', + password: 'changeme', + }), + locations: [ + { + id: 'dev', + label: 'Dev Service', + isServiceManaged: true, + }, + ], + }); + rawExpect(apiResponse).toEqual({ + result: { + publicConfigs: [ + rawExpect.objectContaining({ + monitors: [ + { + type: 'browser', + schedule: '@every 10m', + enabled: true, + data_stream: { namespace: 'default' }, + streams: [ + { + data_stream: { dataset: 'browser', type: 'synthetics' }, + type: 'browser', + enabled: true, + schedule: '@every 10m', + name: 'check if title is present', + namespace: 'default', + origin: 'project', + params: { + username: '"********"', + password: '"********"', + }, + playwright_options: { headless: true, chromiumSandbox: false }, + 'source.project.content': + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + screenshots: 'on', + 'filter_journeys.match': 'check if title is present', + ignore_https_errors: false, + throttling: { download: 5, upload: 3, latency: 20 }, + original_space: 'default', + fields: { + meta: { space_id: 'default' }, + 'monitor.project.name': 'test-project-cb47c83a-45e7-416a-9301-cb476b5bff01', + 'monitor.project.id': 'test-project-cb47c83a-45e7-416a-9301-cb476b5bff01', + }, + fields_under_root: true, + max_attempts: 2, + }, + ], + }, + ], + license_level: rawExpect.any(String), + cloud_id: 'ftr_fake_cloud_id', + output: { hosts: [] }, + }), + ], + privateConfig: null, + }, + decodedCode: + '// asset:/Users/vigneshh/elastic/synthetics/examples/todos/basic.journey.ts\nimport { journey, step, expect } from "@elastic/synthetics";\njourney("check if title is present", ({ page, params }) => {\n step("launch app", async () => {\n await page.goto(params.url);\n });\n step("assert title", async () => {\n const header = await page.$("h1");\n expect(await header.textContent()).toBe("todos");\n });\n});\n', + }); + }); + + it('inspect http monitor in private location', async () => { + const location = await testPrivateLocations.addTestPrivateLocation(); + const apiResponse = await monitorTestService.inspectMonitor(editorUser, { + ..._monitors[0], + locations: [ + { + id: location.id, + label: location.label, + isServiceManaged: false, + }, + ], + }); + + const privateConfig = apiResponse.result.privateConfig!; + + const enabledStream = privateConfig.inputs + .find((input) => input.enabled) + ?.streams.find((stream) => stream.enabled); + + const compiledStream = enabledStream?.compiled_stream; + + delete compiledStream.id; + delete compiledStream.processors[0].add_fields.fields.config_id; + + expect(enabledStream?.compiled_stream).eql({ + __ui: { is_tls_enabled: false }, + type: 'http', + name: 'test-monitor-name', + origin: 'ui', + 'run_from.id': location.id, + 'run_from.geo.name': location.label, + enabled: true, + urls: 'https://nextjs-test-synthetics.vercel.app/api/users', + schedule: '@every 5m', + timeout: '180s', + max_redirects: 3, + max_attempts: 2, + proxy_url: 'http://proxy.com', + tags: ['tag1', 'tag2'], + username: 'test-username', + password: 'test', + 'response.include_headers': true, + 'response.include_body': 'never', + 'response.include_body_max_bytes': 1024, + 'check.request.method': null, + 'check.request.headers': { sampleHeader: 'sampleHeaderValue' }, + 'check.request.body': 'testValue', + 'check.response.status': ['200', '201'], + mode: 'any', + ipv4: true, + ipv6: true, + processors: [ + { + add_fields: { + target: '', + fields: { + meta: { space_id: 'default' }, + 'monitor.fleet_managed': true, + }, + }, + }, + ], + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_policy.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_policy.ts new file mode 100644 index 000000000000..338d666d3551 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_policy.ts @@ -0,0 +1,575 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import expect from 'expect'; +import { omit, sortBy } from 'lodash'; +import { PackagePolicy, PackagePolicyConfigRecord } from '@kbn/fleet-plugin/common'; +import { INSTALLED_VERSION } from '../../../../services/synthetics_private_location'; +import { commonVars } from './test_project_monitor_policy'; + +interface PolicyProps { + name?: string; + id: string; + configId?: string; + projectId?: string; + location: { name?: string; id?: string }; + namespace?: string; + isTLSEnabled?: boolean; + proxyUrl?: string; + params?: Record; + isBrowser?: boolean; + spaceId?: string; +} + +export const getTestSyntheticsPolicy = (props: PolicyProps): PackagePolicy => { + const { namespace } = props; + return { + id: '2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + version: 'WzE2MjYsMV0=', + name: 'test-monitor-name-Test private location 0-default', + namespace: namespace ?? 'testnamespace', + package: { name: 'synthetics', title: 'Elastic Synthetics', version: INSTALLED_VERSION }, + enabled: true, + policy_id: '5347cd10-0368-11ed-8df7-a7424c6f5167', + policy_ids: ['5347cd10-0368-11ed-8df7-a7424c6f5167'], + inputs: [ + getHttpInput(props), + { + type: 'synthetics/tcp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'tcp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'tcp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + proxy_url: { type: 'text' }, + processors: { type: 'yaml' }, + proxy_use_local_resolver: { value: false, type: 'bool' }, + tags: { type: 'yaml' }, + 'check.send': { type: 'text' }, + 'check.receive': { type: 'text' }, + 'ssl.certificate_authorities': { type: 'yaml' }, + 'ssl.certificate': { type: 'yaml' }, + 'ssl.key': { type: 'yaml' }, + 'ssl.key_passphrase': { type: 'text' }, + 'ssl.verification_mode': { type: 'text' }, + 'ssl.supported_protocols': { type: 'yaml' }, + location_name: { value: 'Fleet managed', type: 'text' }, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: 'synthetics/tcp-tcp-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + }, + ], + }, + { + type: 'synthetics/icmp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'icmp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'icmp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + wait: { value: '1s', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + tags: { type: 'yaml' }, + location_name: { value: 'Fleet managed', type: 'text' }, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: 'synthetics/icmp-icmp-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + }, + ], + }, + getBrowserInput(props), + ], + is_managed: true, + revision: 1, + created_at: '2022-08-23T14:09:17.176Z', + created_by: 'system', + updated_at: '2022-08-23T14:09:17.176Z', + updated_by: 'system', + }; +}; + +export const getHttpInput = ({ + projectId, + id, + location, + proxyUrl, + isTLSEnabled, + isBrowser, + spaceId, + namespace, + name = 'check if title is present-Test private location 0', +}: PolicyProps) => { + const enabled = !isBrowser; + const baseVars: PackagePolicyConfigRecord = { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'http', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + urls: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + max_redirects: { type: 'integer' }, + proxy_url: { type: 'text' }, + processors: { type: 'yaml' }, + proxy_headers: { type: 'yaml' }, + tags: { type: 'yaml' }, + username: { type: 'text' }, + password: { type: 'password' }, + 'response.include_headers': { type: 'bool' }, + 'response.include_body': { type: 'text' }, + 'response.include_body_max_bytes': { type: 'text' }, + 'check.request.method': { type: 'text' }, + 'check.request.headers': { type: 'yaml' }, + 'check.request.body': { type: 'yaml' }, + 'check.response.status': { type: 'yaml' }, + 'check.response.headers': { type: 'yaml' }, + 'check.response.body.positive': { type: 'yaml' }, + 'check.response.body.negative': { type: 'yaml' }, + 'check.response.json': { type: 'yaml' }, + 'ssl.certificate_authorities': { type: 'yaml' }, + 'ssl.certificate': { type: 'yaml' }, + 'ssl.key': { type: 'yaml' }, + 'ssl.key_passphrase': { type: 'text' }, + 'ssl.verification_mode': { type: 'text' }, + 'ssl.supported_protocols': { type: 'yaml' }, + location_id: { value: 'fleet_managed', type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }; + + const enabledVars = { + __ui: { + value: `{"is_tls_enabled":${isTLSEnabled || false}}`, + type: 'yaml', + }, + enabled: { value: true, type: 'bool' }, + type: { value: 'http', type: 'text' }, + name: { value: JSON.stringify(name), type: 'text' }, + schedule: { value: '"@every 5m"', type: 'text' }, + urls: { value: '"https://nextjs-test-synthetics.vercel.app/api/users"', type: 'text' }, + 'service.name': { value: null, type: 'text' }, + timeout: { value: '180s', type: 'text' }, + max_redirects: { value: '3', type: 'integer' }, + processors: { + type: 'yaml', + value: JSON.stringify([ + { + add_fields: { + fields: { + 'monitor.fleet_managed': true, + config_id: id, + meta: { space_id: spaceId ?? 'default' }, + 'monitor.project.name': projectId, + 'monitor.project.id': projectId, + }, + target: '', + }, + }, + ]), + }, + proxy_url: { value: proxyUrl ?? '"http://proxy.com"', type: 'text' }, + proxy_headers: { value: null, type: 'yaml' }, + tags: { value: '["tag1","tag2"]', type: 'yaml' }, + username: { value: '"test-username"', type: 'text' }, + password: { value: '"test"', type: 'password' }, + 'response.include_headers': { value: true, type: 'bool' }, + 'response.include_body': { value: 'never', type: 'text' }, + 'response.include_body_max_bytes': { value: '1024', type: 'text' }, + 'check.request.method': { value: '', type: 'text' }, + 'check.request.headers': { + value: '{"sampleHeader":"sampleHeaderValue"}', + type: 'yaml', + }, + 'check.request.body': { value: '"testValue"', type: 'yaml' }, + 'check.response.status': { value: '["200","201"]', type: 'yaml' }, + 'check.response.headers': { value: null, type: 'yaml' }, + 'check.response.body.positive': { value: null, type: 'yaml' }, + 'check.response.body.negative': { value: null, type: 'yaml' }, + 'check.response.json': { value: null, type: 'yaml' }, + 'ssl.certificate_authorities': { + value: isTLSEnabled ? '"t.string"' : null, + type: 'yaml', + }, + 'ssl.certificate': { value: isTLSEnabled ? '"t.string"' : null, type: 'yaml' }, + 'ssl.key': { value: isTLSEnabled ? '"t.string"' : null, type: 'yaml' }, + 'ssl.key_passphrase': { value: isTLSEnabled ? 't.string' : null, type: 'text' }, + 'ssl.verification_mode': { value: isTLSEnabled ? 'certificate' : null, type: 'text' }, + 'ssl.supported_protocols': { + value: isTLSEnabled ? '["TLSv1.1","TLSv1.2"]' : null, + type: 'yaml', + }, + location_id: { + type: 'text', + value: location.id ?? 'aaa3c150-f94d-11ed-9895-d36d5472fafd', + }, + location_name: { + value: JSON.stringify(location.name) ?? '"Test private location 0"', + type: 'text', + }, + ...commonVars, + id: { value: JSON.stringify(id), type: 'text' }, + origin: { value: projectId ? 'project' : 'ui', type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text', value: 'any' }, + }; + + const compiledHttpStream = { + __ui: { + is_tls_enabled: isTLSEnabled || false, + }, + type: 'http', + name, + id, + origin: projectId ? 'project' : 'ui', + enabled: true, + urls: 'https://nextjs-test-synthetics.vercel.app/api/users', + schedule: '@every 5m', + timeout: '180s', + max_redirects: 3, + max_attempts: 2, + proxy_url: proxyUrl ?? 'http://proxy.com', + tags: ['tag1', 'tag2'], + username: 'test-username', + password: 'test', + 'run_from.geo.name': location?.name ?? 'Test private location 0', + 'run_from.id': location?.id ?? 'Test private location 0', + 'response.include_headers': true, + 'response.include_body': 'never', + 'response.include_body_max_bytes': 1024, + 'check.request.method': null, + 'check.request.headers': { sampleHeader: 'sampleHeaderValue' }, + 'check.request.body': 'testValue', + 'check.response.status': ['200', '201'], + ipv4: true, + ipv6: true, + mode: 'any', + ...(isTLSEnabled + ? { + 'ssl.certificate': 't.string', + 'ssl.certificate_authorities': 't.string', + 'ssl.key': 't.string', + 'ssl.key_passphrase': 't.string', + 'ssl.verification_mode': 'certificate', + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2'], + } + : {}), + processors: [ + { + add_fields: { + fields: { + config_id: id, + meta: { + space_id: spaceId ?? 'default', + }, + 'monitor.fleet_managed': true, + ...(projectId + ? { 'monitor.project.id': projectId, 'monitor.project.name': projectId } + : {}), + }, + target: '', + }, + }, + ], + }; + + return { + type: 'synthetics/http', + policy_template: 'synthetics', + enabled, + streams: [ + { + enabled, + data_stream: { + type: 'synthetics', + dataset: 'http', + ...(enabled + ? { + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, + } + : {}), + }, + vars: enabled ? enabledVars : baseVars, + id: 'synthetics/http-http-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + ...(enabled ? { compiled_stream: compiledHttpStream } : {}), + }, + ], + }; +}; + +export const getBrowserInput = ({ id, params, isBrowser, projectId }: PolicyProps) => { + const compiledBrowser = isBrowser + ? { + __ui: { + script_source: { is_generated_script: false, file_name: '' }, + is_tls_enabled: false, + }, + type: 'browser', + name: 'Test HTTP Monitor 03', + id, + origin: 'ui', + 'run_from.id': 'Test private location 0', + 'run_from.geo.name': 'Test private location 0', + enabled: true, + schedule: '@every 3m', + timeout: '16s', + throttling: { download: 5, upload: 3, latency: 20 }, + tags: ['cookie-test', 'browser'], + 'source.inline.script': + 'step("Visit /users api route", async () => {\\n const response = await page.goto(\'https://nextjs-test-synthetics.vercel.app/api/users\');\\n expect(response.status()).toEqual(200);\\n});', + ...(params ? { params } : {}), + screenshots: 'on', + processors: [ + { + add_fields: { + target: '', + fields: { + 'monitor.fleet_managed': true, + config_id: id, + }, + }, + }, + ], + } + : { + __ui: null, + type: 'browser', + name: null, + enabled: true, + schedule: '@every 3m', + 'run_from.id': 'Fleet managed', + 'run_from.geo.name': 'Fleet managed', + timeout: null, + throttling: null, + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }; + + const browserVars = isBrowser + ? { + __ui: { + value: + '{"script_source":{"is_generated_script":false,"file_name":""},"is_tls_enabled":false}', + type: 'yaml', + }, + enabled: { value: true, type: 'bool' }, + type: { value: 'browser', type: 'text' }, + name: { value: 'Test HTTP Monitor 03', type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + 'service.name': { value: '', type: 'text' }, + timeout: { value: '16s', type: 'text' }, + tags: { value: '["cookie-test","browser"]', type: 'yaml' }, + 'source.zip_url.url': { type: 'text' }, + 'source.zip_url.username': { type: 'text' }, + 'source.zip_url.folder': { type: 'text' }, + 'source.zip_url.password': { type: 'password' }, + 'source.inline.script': { + value: + '"step(\\"Visit /users api route\\", async () => {\\\\n const response = await page.goto(\'https://nextjs-test-synthetics.vercel.app/api/users\');\\\\n expect(response.status()).toEqual(200);\\\\n});"', + type: 'yaml', + }, + 'source.project.content': { value: '', type: 'text' }, + params: { value: params ? JSON.stringify(params) : '', type: 'yaml' }, + playwright_options: { value: '', type: 'yaml' }, + screenshots: { value: 'on', type: 'text' }, + synthetics_args: { value: null, type: 'text' }, + ignore_https_errors: { value: false, type: 'bool' }, + 'throttling.config': { + value: JSON.stringify({ download: 5, upload: 3, latency: 20 }), + type: 'text', + }, + 'filter_journeys.tags': { value: null, type: 'yaml' }, + 'filter_journeys.match': { value: null, type: 'text' }, + 'source.zip_url.ssl.certificate_authorities': { type: 'yaml' }, + 'source.zip_url.ssl.certificate': { type: 'yaml' }, + 'source.zip_url.ssl.key': { type: 'yaml' }, + 'source.zip_url.ssl.key_passphrase': { type: 'text' }, + 'source.zip_url.ssl.verification_mode': { type: 'text' }, + 'source.zip_url.ssl.supported_protocols': { type: 'yaml' }, + 'source.zip_url.proxy_url': { type: 'text' }, + location_id: { + type: 'text', + value: 'fleet_managed', + }, + location_name: { value: 'Test private location 0', type: 'text' }, + id: { value: id, type: 'text' }, + origin: { value: 'ui', type: 'text' }, + } + : { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'browser', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + tags: { type: 'yaml' }, + 'source.zip_url.url': { type: 'text' }, + 'source.zip_url.username': { type: 'text' }, + 'source.zip_url.folder': { type: 'text' }, + 'source.zip_url.password': { type: 'password' }, + 'source.inline.script': { type: 'yaml' }, + 'source.project.content': { type: 'text' }, + params: { type: 'yaml' }, + playwright_options: { type: 'yaml' }, + screenshots: { type: 'text' }, + synthetics_args: { type: 'text' }, + ignore_https_errors: { type: 'bool' }, + 'throttling.config': { type: 'text' }, + 'filter_journeys.tags': { type: 'yaml' }, + 'filter_journeys.match': { type: 'text' }, + 'source.zip_url.ssl.certificate_authorities': { type: 'yaml' }, + 'source.zip_url.ssl.certificate': { type: 'yaml' }, + 'source.zip_url.ssl.key': { type: 'yaml' }, + 'source.zip_url.ssl.key_passphrase': { type: 'text' }, + 'source.zip_url.ssl.verification_mode': { type: 'text' }, + 'source.zip_url.ssl.supported_protocols': { type: 'yaml' }, + 'source.zip_url.proxy_url': { type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + location_id: { value: 'Fleet managed', type: 'text' }, + id: { type: 'text' }, + origin: { type: 'text' }, + }; + + return { + type: 'synthetics/browser', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: true, + data_stream: getDataStream('browser'), + vars: browserVars, + id: 'synthetics/browser-browser-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + compiled_stream: compiledBrowser, + }, + { + enabled: true, + data_stream: getDataStream('browser.network'), + id: 'synthetics/browser-browser.network-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + { + enabled: true, + data_stream: getDataStream('browser.screenshot'), + id: 'synthetics/browser-browser.screenshot-2bfd7da0-22ed-11ed-8c6b-09a2d21dfbc3-27337270-22ed-11ed-8c6b-09a2d21dfbc3-default', + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + ], + }; +}; + +export const getDataStream = (dataset: string) => ({ + dataset, + type: 'synthetics', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, +}); + +export const omitIds = (policy: PackagePolicy) => { + policy.inputs = sortBy(policy.inputs, 'type'); + + policy.inputs.forEach((input) => { + input.streams = sortBy(input.streams, 'data_stream.dataset'); + input.streams.forEach((stream) => { + stream.id = ''; + }); + }); + + return omit(policy, ignoreTestFields); +}; + +export const comparePolicies = (aPolicy: PackagePolicy, bPolicy: PackagePolicy) => { + const a = omitIds(aPolicy); + const b = omitIds(bPolicy); + + const aHttpInput = a.inputs?.find((input) => input.type === 'synthetics/http'); + const aTcpInput = b.inputs?.find((input) => input.type === 'synthetics/tcp'); + const aIcmpInput = b.inputs?.find((input) => input.type === 'synthetics/icmp'); + const aBrowserInput = b.inputs?.find((input) => input.type === 'synthetics/browser'); + + const bHttpInput = b.inputs?.find((input) => input.type === 'synthetics/http'); + const bTcpInput = b.inputs?.find((input) => input.type === 'synthetics/tcp'); + const bIcmpInput = b.inputs?.find((input) => input.type === 'synthetics/icmp'); + const bBrowserInput = b.inputs?.find((input) => input.type === 'synthetics/browser'); + + expect(aHttpInput).toEqual(bHttpInput); + expect(aTcpInput).toEqual(bTcpInput); + expect(aIcmpInput).toEqual(bIcmpInput); + expect(aBrowserInput).toEqual(bBrowserInput); + + // delete inputs to compare rest of policy + delete a.inputs; + delete b.inputs; + + // delete package to compare rest of policy + delete a.package; + delete b.package; + + expect(a).toEqual(b); +}; + +export const ignoreTestFields = [ + 'id', + 'name', + 'created_at', + 'created_by', + 'updated_at', + 'updated_by', + 'policy_id', + 'policy_ids', + 'version', + 'revision', +]; diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_project_monitor_policy.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_project_monitor_policy.ts new file mode 100644 index 000000000000..cf9025fb8ce7 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sample_data/test_project_monitor_policy.ts @@ -0,0 +1,803 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import { INSTALLED_VERSION } from '../../../../services/synthetics_private_location'; +import { getDataStream } from './test_policy'; + +export const commonVars = { + max_attempts: { + type: 'integer', + value: 2, + }, +}; + +export const getTestProjectSyntheticsPolicyLightweight = ( + { + name, + inputs = {}, + configId, + id, + locationId, + projectId = 'test-suite', + locationName = 'Fleet Managed', + namespace, + }: { + name?: string; + inputs: Record; + configId: string; + id: string; + projectId?: string; + locationId: string; + locationName?: string; + namespace?: string; + } = { + name: 'My Monitor 3', + inputs: {}, + configId: '', + id: '', + locationId: 'fleet_managed', + locationName: 'Fleet Managed', + } +): PackagePolicy => ({ + id: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + version: 'WzEzMDksMV0=', + name: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-${locationName}`, + namespace: namespace || undefined, + package: { name: 'synthetics', title: 'Elastic Synthetics', version: INSTALLED_VERSION }, + enabled: true, + policy_id: '46034710-0ba6-11ed-ba04-5f123b9faa8b', + policy_ids: ['46034710-0ba6-11ed-ba04-5f123b9faa8b'], + inputs: [ + { + type: 'synthetics/http', + policy_template: 'synthetics', + enabled: true, + streams: [ + { + enabled: true, + data_stream: { + type: 'synthetics', + dataset: 'http', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, + }, + vars: { + __ui: { + type: 'yaml', + value: '{"is_tls_enabled":true}', + }, + 'check.request.body': { + type: 'yaml', + value: '"testGlobalParamValue"', + }, + 'check.request.headers': { + type: 'yaml', + value: '{"Content-Type":"application/x-www-form-urlencoded"}', + }, + 'check.request.method': { + type: 'text', + value: 'POST', + }, + 'check.response.body.negative': { + type: 'yaml', + value: null, + }, + 'check.response.body.positive': { + type: 'yaml', + value: '["testLocalParamsValue","saved"]', + }, + 'check.response.headers': { + type: 'yaml', + value: null, + }, + 'check.response.json': { + type: 'yaml', + value: '[{"description":"check status","expression":"foo.bar == \\"myValue\\""}]', + }, + 'check.response.status': { + type: 'yaml', + value: '["200"]', + }, + enabled: { + type: 'bool', + value: false, + }, + id: { + type: 'text', + value: JSON.stringify(id), + }, + ipv4: { + type: 'bool', + value: true, + }, + ipv6: { + type: 'bool', + value: true, + }, + location_id: { + type: 'text', + value: locationId ?? 'fleet_managed', + }, + location_name: { + type: 'text', + value: `"${locationName}"`, + }, + max_redirects: { + type: 'integer', + value: '0', + }, + ...commonVars, + mode: { + type: 'text', + value: 'any', + }, + name: { + type: 'text', + value: JSON.stringify(name), + }, + origin: { + type: 'text', + value: 'project', + }, + password: { + type: 'password', + value: null, + }, + processors: { + type: 'yaml', + value: JSON.stringify([ + { + add_fields: { + fields: { + 'monitor.fleet_managed': true, + config_id: configId, + 'monitor.project.name': projectId, + 'monitor.project.id': projectId, + meta: { space_id: 'default' }, + }, + target: '', + }, + }, + ]), + }, + proxy_headers: { + type: 'yaml', + value: null, + }, + proxy_url: { + type: 'text', + value: JSON.stringify('testGlobalParamOverwrite'), + }, + 'response.include_body': { + type: 'text', + value: 'always', + }, + 'response.include_body_max_bytes': { + type: 'text', + value: '900', + }, + 'response.include_headers': { + type: 'bool', + value: false, + }, + schedule: { + type: 'text', + value: '"@every 60m"', + }, + 'service.name': { + type: 'text', + value: null, + }, + 'ssl.certificate': { + type: 'yaml', + value: null, + }, + 'ssl.certificate_authorities': { + type: 'yaml', + value: null, + }, + 'ssl.key': { + type: 'yaml', + value: null, + }, + 'ssl.key_passphrase': { + type: 'text', + value: null, + }, + 'ssl.supported_protocols': { + type: 'yaml', + value: '["TLSv1.1","TLSv1.2","TLSv1.3"]', + }, + 'ssl.verification_mode': { + type: 'text', + value: 'strict', + }, + tags: { + type: 'yaml', + value: '["tag2","tag2"]', + }, + timeout: { + type: 'text', + value: '80s', + }, + type: { + type: 'text', + value: 'http', + }, + urls: { + type: 'text', + value: '"http://localhost:9200"', + }, + username: { + type: 'text', + value: null, + }, + }, + compiled_stream: { + __ui: { + is_tls_enabled: true, + }, + type: 'http', + name, + id, + origin: 'project', + enabled: false, + urls: 'http://localhost:9200', + schedule: '@every 60m', + timeout: '80s', + max_redirects: 0, + max_attempts: 2, + tags: ['tag2', 'tag2'], + proxy_url: 'testGlobalParamOverwrite', + 'run_from.geo.name': locationName ?? 'Test private location 0', + 'run_from.id': locationId ?? 'Test private location 0', + 'response.include_headers': false, + 'response.include_body': 'always', + 'response.include_body_max_bytes': 900, + 'ssl.supported_protocols': ['TLSv1.1', 'TLSv1.2', 'TLSv1.3'], + 'ssl.verification_mode': 'strict', + 'check.request.method': 'POST', + 'check.request.headers': { 'Content-Type': 'application/x-www-form-urlencoded' }, + 'check.response.body.positive': ['testLocalParamsValue', 'saved'], + 'check.response.json': [ + { + description: 'check status', + expression: 'foo.bar == "myValue"', + }, + ], + 'check.response.status': ['200'], + 'check.request.body': 'testGlobalParamValue', + ipv4: true, + ipv6: true, + mode: 'any', + processors: [ + { + add_fields: { + fields: { + config_id: configId, + 'monitor.fleet_managed': true, + 'monitor.project.id': projectId, + 'monitor.project.name': projectId, + meta: { space_id: 'default' }, + }, + target: '', + }, + }, + ], + }, + id: `synthetics/http-http-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/tcp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'tcp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'tcp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + proxy_url: { type: 'text' }, + proxy_use_local_resolver: { value: false, type: 'bool' }, + tags: { type: 'yaml' }, + 'check.send': { type: 'text' }, + 'check.receive': { type: 'text' }, + 'ssl.certificate_authorities': { type: 'yaml' }, + 'ssl.certificate': { type: 'yaml' }, + 'ssl.key': { type: 'yaml' }, + 'ssl.key_passphrase': { type: 'text' }, + 'ssl.verification_mode': { type: 'text' }, + 'ssl.supported_protocols': { type: 'yaml' }, + location_id: { value: 'fleet_managed', type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: `synthetics/tcp-tcp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/icmp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'icmp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'icmp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + wait: { value: '1s', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + tags: { type: 'yaml' }, + location_id: { value: 'fleet_managed', type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: `synthetics/icmp-icmp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/browser', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: true, + data_stream: { + type: 'synthetics', + dataset: 'browser', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, + }, + vars: { + __ui: { + type: 'yaml', + }, + enabled: { value: true, type: 'bool' }, + type: { value: 'browser', type: 'text' }, + name: { type: 'text' }, + schedule: { value: JSON.stringify('@every 3m'), type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + tags: { type: 'yaml' }, + 'source.zip_url.url': { type: 'text' }, + 'source.zip_url.username': { type: 'text' }, + 'source.zip_url.folder': { type: 'text' }, + 'source.zip_url.password': { type: 'password' }, + 'source.inline.script': { type: 'yaml' }, + 'source.project.content': { + type: 'text', + }, + params: { + type: 'yaml', + }, + playwright_options: { + type: 'yaml', + }, + screenshots: { type: 'text' }, + synthetics_args: { type: 'text' }, + ignore_https_errors: { type: 'bool' }, + 'throttling.config': { + type: 'text', + }, + 'filter_journeys.tags': { type: 'yaml' }, + 'filter_journeys.match': { type: 'text' }, + 'source.zip_url.ssl.certificate_authorities': { type: 'yaml' }, + 'source.zip_url.ssl.certificate': { type: 'yaml' }, + 'source.zip_url.ssl.key': { type: 'yaml' }, + 'source.zip_url.ssl.key_passphrase': { type: 'text' }, + 'source.zip_url.ssl.verification_mode': { type: 'text' }, + 'source.zip_url.ssl.supported_protocols': { type: 'yaml' }, + 'source.zip_url.proxy_url': { type: 'text' }, + location_id: { value: 'fleet_managed', type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ...inputs, + }, + id: `synthetics/browser-browser-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + __ui: null, + type: 'browser', + name: null, + enabled: true, + schedule: '@every 3m', + timeout: null, + throttling: null, + processors: [ + { + add_fields: { + target: '', + fields: { + 'monitor.fleet_managed': true, + }, + }, + }, + ], + 'run_from.geo.name': 'Fleet managed', + 'run_from.id': 'Fleet managed', + ...Object.keys(inputs).reduce((acc: Record, key) => { + acc[key] = inputs[key].value; + return acc; + }, {}), + }, + }, + { + enabled: true, + data_stream: { + type: 'synthetics', + dataset: 'browser.network', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, + }, + id: `synthetics/browser-browser.network-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + { + enabled: true, + data_stream: { + type: 'synthetics', + dataset: 'browser.screenshot', + elasticsearch: { + privileges: { + indices: ['auto_configure', 'create_doc', 'read'], + }, + }, + }, + id: `synthetics/browser-browser.screenshot-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + ], + }, + ], + is_managed: true, + revision: 1, + created_at: '2022-08-23T13:52:42.531Z', + created_by: 'system', + updated_at: '2022-08-23T13:52:42.531Z', + updated_by: 'system', +}); + +export const getTestProjectSyntheticsPolicy = ( + { + name, + inputs = {}, + configId, + id, + projectId = 'test-suite', + locationId, + locationName = 'Fleet Managed', + namespace, + }: { + name?: string; + inputs: Record; + configId: string; + id: string; + projectId?: string; + locationName?: string; + locationId: string; + namespace?: string; + } = { + name: 'check if title is present-Test private location 0', + inputs: {}, + configId: '', + id: '', + locationId: 'fleet_managed', + locationName: 'Fleet Managed', + } +): PackagePolicy => ({ + id: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + version: 'WzEzMDksMV0=', + name: `4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-Test private location 0`, + namespace: namespace || undefined, + package: { name: 'synthetics', title: 'Elastic Synthetics', version: INSTALLED_VERSION }, + enabled: true, + policy_id: '46034710-0ba6-11ed-ba04-5f123b9faa8b', + policy_ids: ['46034710-0ba6-11ed-ba04-5f123b9faa8b'], + inputs: [ + { + type: 'synthetics/http', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'http', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'http', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + urls: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + max_redirects: { type: 'integer' }, + proxy_url: { type: 'text' }, + processors: { type: 'yaml' }, + proxy_headers: { type: 'yaml' }, + tags: { type: 'yaml' }, + username: { type: 'text' }, + password: { type: 'password' }, + 'response.include_headers': { type: 'bool' }, + 'response.include_body': { type: 'text' }, + 'response.include_body_max_bytes': { type: 'text' }, + 'check.request.method': { type: 'text' }, + 'check.request.headers': { type: 'yaml' }, + 'check.request.body': { type: 'yaml' }, + 'check.response.status': { type: 'yaml' }, + 'check.response.headers': { type: 'yaml' }, + 'check.response.body.positive': { type: 'yaml' }, + 'check.response.body.negative': { type: 'yaml' }, + 'check.response.json': { type: 'yaml' }, + 'ssl.certificate_authorities': { type: 'yaml' }, + 'ssl.certificate': { type: 'yaml' }, + 'ssl.key': { type: 'yaml' }, + 'ssl.key_passphrase': { type: 'text' }, + 'ssl.verification_mode': { type: 'text' }, + 'ssl.supported_protocols': { type: 'yaml' }, + location_id: { value: 'fleet_managed', type: 'text' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: `synthetics/http-http-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/tcp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'tcp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'tcp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + proxy_url: { type: 'text' }, + proxy_use_local_resolver: { value: false, type: 'bool' }, + tags: { type: 'yaml' }, + 'check.send': { type: 'text' }, + 'check.receive': { type: 'text' }, + 'ssl.certificate_authorities': { type: 'yaml' }, + 'ssl.certificate': { type: 'yaml' }, + 'ssl.key': { type: 'yaml' }, + 'ssl.key_passphrase': { type: 'text' }, + 'ssl.verification_mode': { type: 'text' }, + 'ssl.supported_protocols': { type: 'yaml' }, + location_name: { value: 'Fleet managed', type: 'text' }, + ...commonVars, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: `synthetics/tcp-tcp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/icmp', + policy_template: 'synthetics', + enabled: false, + streams: [ + { + enabled: false, + data_stream: { + type: 'synthetics', + dataset: 'icmp', + }, + vars: { + __ui: { type: 'yaml' }, + enabled: { value: true, type: 'bool' }, + type: { value: 'icmp', type: 'text' }, + name: { type: 'text' }, + schedule: { value: '"@every 3m"', type: 'text' }, + wait: { value: '1s', type: 'text' }, + hosts: { type: 'text' }, + 'service.name': { type: 'text' }, + timeout: { type: 'text' }, + tags: { type: 'yaml' }, + location_name: { value: 'Fleet managed', type: 'text' }, + max_attempts: { + type: 'integer', + value: 2, + }, + id: { type: 'text' }, + origin: { type: 'text' }, + ipv4: { type: 'bool', value: true }, + ipv6: { type: 'bool', value: true }, + mode: { type: 'text' }, + }, + id: `synthetics/icmp-icmp-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + }, + ], + }, + { + type: 'synthetics/browser', + policy_template: 'synthetics', + enabled: true, + streams: [ + { + enabled: true, + data_stream: getDataStream('browser'), + vars: { + __ui: { + value: '{"script_source":{"is_generated_script":false,"file_name":""}}', + type: 'yaml', + }, + enabled: { value: true, type: 'bool' }, + type: { value: 'browser', type: 'text' }, + name: { value: '"check if title is present"', type: 'text' }, + schedule: { value: '"@every 10m"', type: 'text' }, + 'service.name': { value: null, type: 'text' }, + timeout: { value: null, type: 'text' }, + tags: { value: null, type: 'yaml' }, + 'source.zip_url.url': { type: 'text' }, + 'source.zip_url.username': { type: 'text' }, + 'source.zip_url.folder': { type: 'text' }, + 'source.zip_url.password': { type: 'password' }, + 'source.inline.script': { value: null, type: 'yaml' }, + 'source.project.content': { + value: + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + type: 'text', + }, + params: { + value: + '{"testGlobalParam2":"testGlobalParamValue2","testGlobalParam":"testGlobalParamValue"}', + type: 'yaml', + }, + playwright_options: { + value: '{"headless":true,"chromiumSandbox":false}', + type: 'yaml', + }, + screenshots: { value: 'on', type: 'text' }, + synthetics_args: { value: null, type: 'text' }, + ignore_https_errors: { value: false, type: 'bool' }, + 'throttling.config': { + value: JSON.stringify({ download: 5, upload: 3, latency: 20 }), + type: 'text', + }, + 'filter_journeys.tags': { value: null, type: 'yaml' }, + 'filter_journeys.match': { value: '"check if title is present"', type: 'text' }, + 'source.zip_url.ssl.certificate_authorities': { type: 'yaml' }, + 'source.zip_url.ssl.certificate': { type: 'yaml' }, + 'source.zip_url.ssl.key': { type: 'yaml' }, + 'source.zip_url.ssl.key_passphrase': { type: 'text' }, + 'source.zip_url.ssl.verification_mode': { type: 'text' }, + 'source.zip_url.ssl.supported_protocols': { type: 'yaml' }, + 'source.zip_url.proxy_url': { type: 'text' }, + location_name: { value: 'Test private location 0', type: 'text' }, + ...commonVars, + location_id: { value: 'fleet_managed', type: 'text' }, + id: { value: id, type: 'text' }, + origin: { value: 'project', type: 'text' }, + ...inputs, + }, + id: `synthetics/browser-browser-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + __ui: { + script_source: { is_generated_script: false, file_name: '' }, + }, + type: 'browser', + name: 'check if title is present', + id, + origin: 'project', + enabled: true, + schedule: '@every 10m', + 'run_from.geo.name': locationName, + 'run_from.id': locationId, + timeout: null, + throttling: { download: 5, upload: 3, latency: 20 }, + 'source.project.content': + 'UEsDBBQACAAIAON5qVQAAAAAAAAAAAAAAAAfAAAAZXhhbXBsZXMvdG9kb3MvYmFzaWMuam91cm5leS50c22Q0WrDMAxF3/sVF7MHB0LMXlc6RvcN+wDPVWNviW0sdUsp/fe5SSiD7UFCWFfHujIGlpnkybwxFTZfoY/E3hsaLEtwhs9RPNWKDU12zAOxkXRIbN4tB9d9pFOJdO6EN2HMqQguWN9asFBuQVMmJ7jiWNII9fIXrbabdUYr58l9IhwhQQZCYORCTFFUC31Btj21NRc7Mq4Nds+4bDD/pNVgT9F52Jyr2Fa+g75LAPttg8yErk+S9ELpTmVotlVwnfNCuh2lepl3+JflUmSBJ3uggt1v9INW/lHNLKze9dJe1J3QJK8pSvWkm6aTtCet5puq+x63+AFQSwcIAPQ3VfcAAACcAQAAUEsBAi0DFAAIAAgA43mpVAD0N1X3AAAAnAEAAB8AAAAAAAAAAAAgAKSBAAAAAGV4YW1wbGVzL3RvZG9zL2Jhc2ljLmpvdXJuZXkudHNQSwUGAAAAAAEAAQBNAAAARAEAAAAA', + playwright_options: { headless: true, chromiumSandbox: false }, + screenshots: 'on', + 'filter_journeys.match': 'check if title is present', + params: { + testGlobalParam: 'testGlobalParamValue', + testGlobalParam2: 'testGlobalParamValue2', + }, + ...Object.keys(inputs).reduce((acc: Record, key) => { + acc[key] = inputs[key].value; + return acc; + }, {}), + }, + }, + { + enabled: true, + data_stream: getDataStream('browser.network'), + id: `synthetics/browser-browser.network-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + { + enabled: true, + data_stream: getDataStream('browser.screenshot'), + id: `synthetics/browser-browser.screenshot-4b6abc6c-118b-4d93-a489-1135500d09f1-${projectId}-default-d70a46e0-22ea-11ed-8c6b-09a2d21dfbc3`, + compiled_stream: { + processors: [{ add_fields: { target: '', fields: { 'monitor.fleet_managed': true } } }], + }, + }, + ], + }, + ], + is_managed: true, + revision: 1, + created_at: '2022-08-23T13:52:42.531Z', + created_by: 'system', + updated_at: '2022-08-23T13:52:42.531Z', + updated_by: 'system', +}); diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/suggestions.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/suggestions.ts new file mode 100644 index 000000000000..d6a42b6cc897 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/suggestions.ts @@ -0,0 +1,276 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import expect from 'expect'; +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + MonitorFields, + EncryptedSyntheticsSavedMonitor, + ProjectMonitorsRequest, + PrivateLocation, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('SyntheticsSuggestions', function () { + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + const privateLocationsTestService = new PrivateLocationTestService(getService); + + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + let projectMonitors: ProjectMonitorsRequest; + let _monitors: MonitorFields[]; + let monitors: MonitorFields[]; + let editorUser: RoleCredentials; + let privateLocation: PrivateLocation; + + const setUniqueIds = (request: ProjectMonitorsRequest) => { + return { + ...request, + monitors: request.monitors.map((monitor) => ({ + ...monitor, + id: uuidv4(), + locations: [], + privateLocations: [privateLocation.label], + })), + }; + }; + + const saveMonitor = async (monitor: MonitorFields) => { + const res = await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(monitor); + + return res.body as EncryptedSyntheticsSavedMonitor; + }; + + before(async () => { + await kibanaServer.savedObjects.clean({ + types: [ + syntheticsMonitorType, + 'ingest-agent-policies', + 'ingest-package-policies', + 'synthetics-private-location', + ], + }); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + privateLocation = await privateLocationsTestService.addTestPrivateLocation(SPACE_ID); + _monitors = [getFixtureJson('http_monitor')].map((monitor) => ({ + ...monitor, + locations: [privateLocation], + })); + projectMonitors = setUniqueIds({ + monitors: getFixtureJson('project_icmp_monitor') + .monitors.slice(0, 2) + .map((monitor: any) => ({ + ...monitor, + privateLocations: [privateLocation.label], + locations: [], + })), + }); + }); + + beforeEach(async () => { + await kibanaServer.savedObjects.clean({ + types: [syntheticsMonitorType, 'ingest-package-policies'], + }); + + monitors = []; + for (let i = 0; i < 20; i++) { + monitors.push({ + ..._monitors[0], + locations: [privateLocation], + name: `${_monitors[0].name} ${i}`, + }); + } + }); + + after(async () => { + await kibanaServer.spaces.delete(SPACE_ID); + }); + + it('returns the suggestions', async () => { + const project = `test-project-${uuidv4()}`; + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + for (let i = 0; i < monitors.length; i++) { + await saveMonitor(monitors[i]); + } + const apiResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SUGGESTIONS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + expect(apiResponse.body).toEqual({ + locations: [ + { + count: 22, + label: privateLocation.label, + value: privateLocation.id, + }, + ], + monitorIds: expect.arrayContaining([ + ...monitors.map((monitor) => ({ + count: 1, + label: monitor.name, + value: expect.any(String), + })), + ...projectMonitors.monitors.slice(0, 2).map((monitor) => ({ + count: 1, + label: monitor.name, + value: expect.any(String), + })), + ]), + monitorTypes: [ + { + count: 20, + label: 'http', + value: 'http', + }, + { + count: 2, + label: 'icmp', + value: 'icmp', + }, + ], + projects: [ + { + count: 2, + label: project, + value: project, + }, + ], + tags: expect.arrayContaining([ + { + count: 21, + label: 'tag1', + value: 'tag1', + }, + { + count: 21, + label: 'tag2', + value: 'tag2', + }, + { + count: 1, + label: 'org:google', + value: 'org:google', + }, + { + count: 1, + label: 'service:smtp', + value: 'service:smtp', + }, + ]), + }); + }); + + it('handles query params for projects', async () => { + for (let i = 0; i < monitors.length; i++) { + await saveMonitor(monitors[i]); + } + const project = `test-project-${uuidv4()}`; + await supertest + .put( + `/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace( + '{projectName}', + project + )}` + ) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(projectMonitors) + .expect(200); + + const apiResponse = await supertest + .get(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SUGGESTIONS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .query({ + projects: [project], + }) + .expect(200); + + expect(apiResponse.body).toEqual({ + locations: [ + { + count: 2, + label: privateLocation.label, + value: privateLocation.id, + }, + ], + monitorIds: expect.arrayContaining( + projectMonitors.monitors.map((monitor) => ({ + count: 1, + label: monitor.name, + value: expect.any(String), + })) + ), + monitorTypes: [ + { + count: 2, + label: 'icmp', + value: 'icmp', + }, + ], + projects: [ + { + count: 2, + label: project, + value: project, + }, + ], + tags: expect.arrayContaining([ + { + count: 1, + label: 'tag1', + value: 'tag1', + }, + { + count: 1, + label: 'tag2', + value: 'tag2', + }, + { + count: 1, + label: 'org:google', + value: 'org:google', + }, + { + count: 1, + label: 'service:smtp', + value: 'service:smtp', + }, + ]), + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sync_global_params.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sync_global_params.ts new file mode 100644 index 000000000000..425eb0c704b5 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/sync_global_params.ts @@ -0,0 +1,354 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { + ConfigKey, + HTTPFields, + LocationStatus, + PrivateLocation, + ServiceLocation, + SyntheticsParams, +} from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { PackagePolicy } from '@kbn/fleet-plugin/common'; +import expect from '@kbn/expect'; +import { syntheticsParamType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { PrivateLocationTestService } from '../../../services/synthetics_private_location'; +import { comparePolicies, getTestSyntheticsPolicy } from './sample_data/test_policy'; +import { addMonitorAPIHelper, omitMonitorKeys } from './create_monitor'; + +export const LOCAL_LOCATION = { + id: 'dev', + label: 'Dev Service', + geo: { + lat: 0, + lon: 0, + }, + isServiceManaged: true, +}; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe.skip('SyncGlobalParams', function () { + this.tags('skipCloud'); + const supertestAPI = getService('supertestWithoutAuth'); + const supertestWithAuth = getService('supertest'); + const kServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + let testFleetPolicyID: string; + let _browserMonitorJson: HTTPFields; + let browserMonitorJson: HTTPFields; + + let _httpMonitorJson: HTTPFields; + let httpMonitorJson: HTTPFields; + + let newMonitorId: string; + let newHttpMonitorId: string; + let privateLocations: PrivateLocation[] = []; + + let editorUser: RoleCredentials; + + const testPrivateLocations = new PrivateLocationTestService(getService); + const params: Record = {}; + + const addMonitorAPI = async (monitor: any, statusCode = 200) => { + return addMonitorAPIHelper(supertestAPI, monitor, statusCode, editorUser, samlAuth); + }; + + before(async () => { + await kServer.savedObjects.cleanStandardList(); + await testPrivateLocations.installSyntheticsPackage(); + + _browserMonitorJson = getFixtureJson('browser_monitor'); + _httpMonitorJson = getFixtureJson('http_monitor'); + await kServer.savedObjects.clean({ types: [syntheticsParamType] }); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + }); + + beforeEach(() => { + browserMonitorJson = _browserMonitorJson; + httpMonitorJson = _httpMonitorJson; + }); + + const testPolicyName = 'Fleet test server policy' + Date.now(); + + it('adds a test fleet policy', async () => { + const apiResponse = await testPrivateLocations.addFleetPolicy(testPolicyName); + testFleetPolicyID = apiResponse.body.item.id; + }); + + it('add a test private location', async () => { + privateLocations = await testPrivateLocations.setTestLocations([testFleetPolicyID]); + + const apiResponse = await supertestAPI.get(SYNTHETICS_API_URLS.SERVICE_LOCATIONS); + + const testLocations: Array = [ + { + id: 'dev', + label: 'Dev Service', + geo: { lat: 0, lon: 0 }, + url: 'mockDevUrl', + isServiceManaged: true, + status: LocationStatus.EXPERIMENTAL, + isInvalid: false, + }, + { + id: 'dev2', + label: 'Dev Service 2', + geo: { lat: 0, lon: 0 }, + url: 'mockDevUrl', + isServiceManaged: true, + status: LocationStatus.EXPERIMENTAL, + isInvalid: false, + }, + { + id: testFleetPolicyID, + isInvalid: false, + isServiceManaged: false, + label: privateLocations[0].label, + geo: { + lat: 0, + lon: 0, + }, + agentPolicyId: testFleetPolicyID, + }, + ]; + + expect(apiResponse.body.locations).eql(testLocations); + }); + + it('adds a monitor in private location', async () => { + const newMonitor = browserMonitorJson; + + const pvtLoc = { + id: testFleetPolicyID, + agentPolicyId: testFleetPolicyID, + label: privateLocations[0].label, + isServiceManaged: false, + geo: { + lat: 0, + lon: 0, + }, + }; + + newMonitor.locations.push(pvtLoc); + + const apiResponse = await addMonitorAPI(newMonitor); + + expect(apiResponse.body).eql( + omitMonitorKeys({ + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + locations: [LOCAL_LOCATION, pvtLoc], + }) + ); + newMonitorId = apiResponse.rawBody.id; + }); + + it('added an integration for previously added monitor', async () => { + const apiResponse = await supertestAPI.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy?.policy_id).eql( + testFleetPolicyID, + JSON.stringify({ testFleetPolicyID, newMonitorId }) + ); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: browserMonitorJson.name, + id: newMonitorId, + isBrowser: true, + location: { id: testFleetPolicyID }, + }) + ); + }); + + it('adds a test param', async () => { + const apiResponse = await supertestAPI + .post(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'test', value: 'http://proxy.com' }); + + expect(apiResponse.status).eql(200); + }); + + it('get list of params', async () => { + const apiResponse = await supertestAPI + .get(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'test', value: 'http://proxy.com' }); + + expect(apiResponse.status).eql(200); + + apiResponse.body.forEach(({ key, value }: SyntheticsParams) => { + params[key] = value; + }); + }); + + it('sync global params', async () => { + const apiResponse = await supertestAPI + .get(SYNTHETICS_API_URLS.SYNC_GLOBAL_PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'test', value: 'test' }); + + expect(apiResponse.status).eql(200); + }); + + it('added params to for previously added integration', async () => { + const apiResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: browserMonitorJson.name, + id: newMonitorId, + params, + isBrowser: true, + location: { id: testFleetPolicyID }, + }) + ); + }); + + it('add a http monitor using param', async () => { + const newMonitor = httpMonitorJson; + const pvtLoc = { + id: testFleetPolicyID, + agentPolicyId: testFleetPolicyID, + label: privateLocations[0].label, + isServiceManaged: false, + geo: { + lat: 0, + lon: 0, + }, + }; + newMonitor.locations.push(pvtLoc); + + newMonitor.proxy_url = '${test}'; + + const apiResponse = await addMonitorAPI(newMonitor); + + expect(apiResponse.body).eql( + omitMonitorKeys({ + ...newMonitor, + [ConfigKey.MONITOR_QUERY_ID]: apiResponse.body.id, + [ConfigKey.CONFIG_ID]: apiResponse.body.id, + locations: [LOCAL_LOCATION, pvtLoc], + }) + ); + newHttpMonitorId = apiResponse.rawBody.id; + }); + + it('parsed params for previously added http monitors', async () => { + const apiResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newHttpMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID); + + const pPolicy = getTestSyntheticsPolicy({ + name: httpMonitorJson.name, + id: newHttpMonitorId, + isTLSEnabled: false, + namespace: 'testnamespace', + location: { id: testFleetPolicyID }, + }); + + comparePolicies(packagePolicy, pPolicy); + }); + + it('delete all params and sync again', async () => { + await supertestAPI + .post(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ key: 'get', value: 'test' }); + const getResponse = await supertestAPI + .get(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(getResponse.body.length).eql(2); + + const paramsResponse = getResponse.body || []; + const ids = paramsResponse.map((param: any) => param.id); + + const deleteResponse = await supertestAPI + .delete(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send({ ids }) + .expect(200); + + expect(deleteResponse.body).to.have.length(2); + + const getResponseAfterDelete = await supertestAPI + .get(SYNTHETICS_API_URLS.PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(getResponseAfterDelete.body.length).eql(0); + + await supertestAPI + .get(SYNTHETICS_API_URLS.SYNC_GLOBAL_PARAMS) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const apiResponse = await supertestWithAuth.get( + '/api/fleet/package_policies?page=1&perPage=2000&kuery=ingest-package-policies.package.name%3A%20synthetics' + ); + + const packagePolicy = apiResponse.body.items.find( + (pkgPolicy: PackagePolicy) => + pkgPolicy.id === newMonitorId + '-' + testFleetPolicyID + '-default' + ); + + expect(packagePolicy.policy_id).eql(testFleetPolicyID); + + comparePolicies( + packagePolicy, + getTestSyntheticsPolicy({ + name: browserMonitorJson.name, + id: newMonitorId, + isBrowser: true, + location: { id: testFleetPolicyID }, + }) + ); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/synthetics_enablement.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/synthetics_enablement.ts new file mode 100644 index 000000000000..cb2197bf5416 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/synthetics_enablement.ts @@ -0,0 +1,352 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { SupertestWithRoleScopeType } from '../../../services'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + const config = getService('config'); + const isServerless = config.get('serverless'); + const correctPrivileges = { + applications: [], + cluster: ['monitor', 'read_pipeline', ...(!isServerless ? ['read_ilm'] : [])], + indices: [ + { + allow_restricted_indices: false, + names: ['synthetics-*'], + privileges: ['view_index_metadata', 'create_doc', 'auto_configure', 'read'], + }, + ], + metadata: {}, + run_as: [], + transient_metadata: { + enabled: true, + }, + }; + + describe('SyntheticsEnablement', function () { + /* temporarily skip MKI. Public locations appear to be disabled in QA causing failures + * in isServiceAllowed check */ + this.tags(['skipMKI']); + + const roleScopedSupertest = getService('roleScopedSupertest'); + const kibanaServer = getService('kibanaServer'); + + let supertestWithEditorScope: SupertestWithRoleScopeType; + let supertestWithAdminScope: SupertestWithRoleScopeType; + + const getApiKeys = async () => { + const { body } = await supertestWithAdminScope + .post('/internal/security/api_key/_query') + .send({ + query: { + bool: { + filter: [ + { + term: { + name: 'synthetics-api-key (required for Synthetics App)', + }, + }, + ], + }, + }, + sort: { field: 'creation', direction: 'desc' }, + from: 0, + size: 25, + filters: {}, + }) + .expect(200); + + const apiKeys = body.apiKeys || []; + return apiKeys.filter( + (apiKey: any) => apiKey.name.includes('synthetics-api-key') && apiKey.invalidated === false + ); + }; + + before(async () => { + supertestWithEditorScope = await roleScopedSupertest.getSupertestWithRoleScope('editor', { + withInternalHeaders: true, + useCookieHeader: true, + }); + supertestWithAdminScope = await roleScopedSupertest.getSupertestWithRoleScope('admin', { + withInternalHeaders: true, + useCookieHeader: true, + }); + }); + + describe('[PUT] /internal/uptime/service/enablement', () => { + before(async () => { + supertestWithEditorScope = await roleScopedSupertest.getSupertestWithRoleScope('editor', { + withInternalHeaders: true, + useCookieHeader: true, + }); + supertestWithAdminScope = await roleScopedSupertest.getSupertestWithRoleScope('admin', { + withInternalHeaders: true, + useCookieHeader: true, + }); + }); + + beforeEach(async () => { + const apiKeys = await getApiKeys(); + if (apiKeys.length) { + await supertestWithAdminScope + .delete(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + } + }); + + after(async () => { + // always invalidate API key for the scoped role in the end + await supertestWithAdminScope.destroy(); + await supertestWithEditorScope.destroy(); + }); + + it(`returns response when user cannot manage api keys`, async () => { + const apiResponse = await supertestWithEditorScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: false, + canEnable: false, + isEnabled: false, + isValidApiKey: false, + isServiceAllowed: true, + }); + }); + + it(`returns response for an admin with privilege`, async () => { + const apiResponse = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + const validApiKeys = await getApiKeys(); + expect(validApiKeys.length).eql(1); + expect(validApiKeys[0].role_descriptors.synthetics_writer).eql(correctPrivileges); + }); + + it(`does not create excess api keys`, async () => { + const apiResponse = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + const validApiKeys = await getApiKeys(); + expect(validApiKeys.length).eql(1); + expect(validApiKeys[0].role_descriptors.synthetics_writer).eql(correctPrivileges); + + // call api a second time + const apiResponse2 = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse2.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + const validApiKeys2 = await getApiKeys(); + expect(validApiKeys2.length).eql(1); + expect(validApiKeys2[0].role_descriptors.synthetics_writer).eql(correctPrivileges); + }); + + it(`auto re-enables api key when invalidated`, async () => { + const apiResponse = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + const validApiKeys = await getApiKeys(); + expect(validApiKeys.length).eql(1); + expect(validApiKeys[0].role_descriptors.synthetics_writer).eql(correctPrivileges); + + // delete api key + await supertestWithAdminScope + .post('/internal/security/api_key/invalidate') + .send({ + apiKeys: validApiKeys.map((apiKey: { id: string; name: string }) => ({ + id: apiKey.id, + name: apiKey.name, + })), + isAdmin: true, + }) + .expect(200); + + const validApiKeysAferDeletion = await getApiKeys(); + expect(validApiKeysAferDeletion.length).eql(0); + + // call api a second time + const apiResponse2 = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse2.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + const validApiKeys2 = await getApiKeys(); + expect(validApiKeys2.length).eql(1); + expect(validApiKeys2[0].role_descriptors.synthetics_writer).eql(correctPrivileges); + }); + + it('returns response for an uptime all user without admin privileges', async () => { + const apiResponse = await supertestWithEditorScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: false, + canEnable: false, + isEnabled: false, + isValidApiKey: false, + isServiceAllowed: true, + }); + }); + }); + + describe('[DELETE] /internal/uptime/service/enablement', () => { + beforeEach(async () => { + const apiKeys = await getApiKeys(); + if (apiKeys.length) { + await supertestWithAdminScope + .delete(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + } + }); + + it('with an admin', async () => { + await supertestWithAdminScope.put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT).expect(200); + const delResponse = await supertestWithAdminScope + .delete(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + expect(delResponse.body).eql({}); + const apiResponse = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + }); + + it('with an uptime user', async () => { + await supertestWithAdminScope.put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT).expect(200); + await supertestWithEditorScope + .delete(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(403); + const apiResponse = await supertestWithEditorScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: false, + canEnable: false, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + }); + + it('is space agnostic', async () => { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name-${uuidv4()}`; + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + // can enable synthetics in default space when enabled in a non default space + const apiResponseGet = await supertestWithAdminScope + .put(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT}`) + .expect(200); + + expect(apiResponseGet.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + await supertestWithAdminScope + .put(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT}`) + .expect(200); + await supertestWithAdminScope.delete(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT).expect(200); + const apiResponse = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + + // can disable synthetics in non default space when enabled in default space + await supertestWithAdminScope.put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT).expect(200); + await supertestWithAdminScope + .delete(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT}`) + .expect(200); + const apiResponse2 = await supertestWithAdminScope + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .expect(200); + + expect(apiResponse2.body).eql({ + areApiKeysEnabled: true, + canManageApiKeys: true, + canEnable: true, + isEnabled: true, + isValidApiKey: true, + isServiceAllowed: true, + }); + }); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/test_now_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/test_now_monitor.ts new file mode 100644 index 000000000000..1efe174a2c66 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/apis/observability/synthetics/test_now_monitor.ts @@ -0,0 +1,98 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { RoleCredentials } from '@kbn/ftr-common-functional-services'; +import { MonitorFields } from '@kbn/synthetics-plugin/common/runtime_types'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import expect from '@kbn/expect'; +import { omit } from 'lodash'; +import { DeploymentAgnosticFtrProviderContext } from '../../../ftr_provider_context'; +import { getFixtureJson } from './helpers/get_fixture_json'; +import { SyntheticsMonitorTestService } from '../../../services/synthetics_monitor'; + +export const LOCAL_LOCATION = { + id: 'dev', + label: 'Dev Service', + geo: { + lat: 0, + lon: 0, + }, + isServiceManaged: true, +}; + +export default function ({ getService }: DeploymentAgnosticFtrProviderContext) { + describe('RunTestManually', function () { + this.tags(['skipMKI', 'skipCloud']); + + const supertest = getService('supertestWithoutAuth'); + const kibanaServer = getService('kibanaServer'); + const samlAuth = getService('samlAuth'); + + const monitorTestService = new SyntheticsMonitorTestService(getService); + + let newMonitor: MonitorFields; + let editorUser: RoleCredentials; + + before(async () => { + await kibanaServer.savedObjects.cleanStandardList(); + editorUser = await samlAuth.createM2mApiKeyWithRoleScope('editor'); + await supertest + .put(SYNTHETICS_API_URLS.SYNTHETICS_ENABLEMENT) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + newMonitor = getFixtureJson('http_monitor'); + }); + + it('runs test manually', async () => { + const resp = await monitorTestService.addMonitor(newMonitor, editorUser); + + const res = await supertest + .post(SYNTHETICS_API_URLS.TRIGGER_MONITOR + `/${resp.id}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const result = res.body; + expect(typeof result.testRunId).to.eql('string'); + expect(typeof result.configId).to.eql('string'); + expect(result.schedule).to.eql({ number: '5', unit: 'm' }); + expect(result.locations).to.eql([LOCAL_LOCATION]); + + expect(omit(result.monitor, ['id', 'config_id'])).to.eql( + omit(newMonitor, ['id', 'config_id']) + ); + }); + + it('works in non default space', async () => { + const { SPACE_ID } = await monitorTestService.addNewSpace(); + + const resp = await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .send(newMonitor) + .expect(200); + + const res = await supertest + .post(`/s/${SPACE_ID}${SYNTHETICS_API_URLS.TRIGGER_MONITOR}/${resp.body.id}`) + .set(editorUser.apiKeyHeader) + .set(samlAuth.getInternalRequestHeader()) + .expect(200); + + const result = res.body; + expect(typeof result.testRunId).to.eql('string'); + expect(typeof result.configId).to.eql('string'); + expect(result.schedule).to.eql({ number: '5', unit: 'm' }); + expect(result.locations).to.eql([LOCAL_LOCATION]); + + expect(omit(result.monitor, ['id', 'config_id'])).to.eql( + omit(newMonitor, ['id', 'config_id']) + ); + }); + }); +} diff --git a/x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.index.ts b/x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.index.ts index abd875f8c17c..7544d7d90f1d 100644 --- a/x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.index.ts @@ -20,5 +20,6 @@ export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) loadTestFile(require.resolve('../../apis/painless_lab')); loadTestFile(require.resolve('../../apis/saved_objects_management')); loadTestFile(require.resolve('../../apis/observability/slo')); + loadTestFile(require.resolve('../../apis/observability/synthetics')); }); } diff --git a/x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.index.ts b/x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.index.ts index 4f21d708d418..4f666fc5b3eb 100644 --- a/x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.index.ts +++ b/x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.index.ts @@ -13,6 +13,7 @@ export default function ({ loadTestFile }: DeploymentAgnosticFtrProviderContext) loadTestFile(require.resolve('../../apis/observability/alerting')); loadTestFile(require.resolve('../../apis/observability/dataset_quality')); loadTestFile(require.resolve('../../apis/observability/slo')); + loadTestFile(require.resolve('../../apis/observability/synthetics')); loadTestFile(require.resolve('../../apis/observability/infra')); }); } diff --git a/x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts b/x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts index e7df37f5aa31..8d3432f2e504 100644 --- a/x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts +++ b/x-pack/test/api_integration/deployment_agnostic/default_configs/serverless.config.base.ts @@ -113,6 +113,11 @@ export function createServerlessTestConfig { const response = await supertestWithoutAuth - .get(`/api/alerting/rule/${ruleId}`) + .get(`${spaceId ? '/s/' + spaceId : ''}/api/alerting/rule/${ruleId}`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()) .timeout(requestTimeout); @@ -1034,13 +1036,15 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide name, indexName, roleAuthc, + spaceId, }: { name: string; indexName: string; roleAuthc: RoleCredentials; + spaceId?: string; }) { const { body } = await supertestWithoutAuth - .post(`/api/actions/connector`) + .post(`${spaceId ? '/s/' + spaceId : ''}/api/actions/connector`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()) .send({ @@ -1063,6 +1067,7 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide schedule, consumer, roleAuthc, + spaceId, }: { ruleTypeId: string; name: string; @@ -1080,9 +1085,10 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide schedule?: { interval: string }; consumer: string; roleAuthc: RoleCredentials; + spaceId?: string; }) { const { body } = await supertestWithoutAuth - .post(`/api/alerting/rule`) + .post(`${spaceId ? '/s/' + spaceId : ''}/api/alerting/rule`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()) .send({ @@ -1118,17 +1124,17 @@ export function AlertingApiProvider({ getService }: DeploymentAgnosticFtrProvide }); }, - async findInRules(roleAuthc: RoleCredentials, ruleId: string) { + async findInRules(roleAuthc: RoleCredentials, ruleId: string, spaceId?: string) { const response = await supertestWithoutAuth - .get('/api/alerting/rules/_find') + .get(`${spaceId ? '/s/' + spaceId : ''}/api/alerting/rules/_find`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()); return response.body.data.find((obj: any) => obj.id === ruleId); }, - async searchRules(roleAuthc: RoleCredentials, filter: string) { + async searchRules(roleAuthc: RoleCredentials, filter: string, spaceId?: string) { return supertestWithoutAuth - .get('/api/alerting/rules/_find') + .get(`${spaceId ? '/s/' + spaceId : ''}/api/alerting/rules/_find`) .query({ filter }) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()); diff --git a/x-pack/test/api_integration/deployment_agnostic/services/data_view_api.ts b/x-pack/test/api_integration/deployment_agnostic/services/data_view_api.ts index 33e829d8c9e3..6b03bdf46b27 100644 --- a/x-pack/test/api_integration/deployment_agnostic/services/data_view_api.ts +++ b/x-pack/test/api_integration/deployment_agnostic/services/data_view_api.ts @@ -18,14 +18,16 @@ export function DataViewApiProvider({ getService }: DeploymentAgnosticFtrProvide id, name, title, + spaceId, }: { roleAuthc: RoleCredentials; id: string; name: string; title: string; + spaceId?: string; }) { const { body } = await supertestWithoutAuth - .post(`/api/content_management/rpc/create`) + .post(`${spaceId ? '/s/' + spaceId : ''}/api/content_management/rpc/create`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()) .set(samlAuth.getCommonRequestHeader()) @@ -48,9 +50,17 @@ export function DataViewApiProvider({ getService }: DeploymentAgnosticFtrProvide return body; }, - async delete({ roleAuthc, id }: { roleAuthc: RoleCredentials; id: string }) { + async delete({ + roleAuthc, + id, + spaceId, + }: { + roleAuthc: RoleCredentials; + id: string; + spaceId?: string; + }) { const { body } = await supertestWithoutAuth - .post(`/api/content_management/rpc/delete`) + .post(`${spaceId ? '/s/' + spaceId : ''}/api/content_management/rpc/delete`) .set(roleAuthc.apiKeyHeader) .set(samlAuth.getInternalRequestHeader()) .set(samlAuth.getCommonRequestHeader()) diff --git a/x-pack/test/api_integration/deployment_agnostic/services/deployment_agnostic_services.ts b/x-pack/test/api_integration/deployment_agnostic/services/deployment_agnostic_services.ts index 9623df1bebbd..08a085e2fcd9 100644 --- a/x-pack/test/api_integration/deployment_agnostic/services/deployment_agnostic_services.ts +++ b/x-pack/test/api_integration/deployment_agnostic/services/deployment_agnostic_services.ts @@ -26,4 +26,5 @@ export const deploymentAgnosticServices = _.pick(apiIntegrationServices, [ 'retry', 'security', 'usageAPI', + 'spaces', ]); diff --git a/x-pack/test/api_integration/deployment_agnostic/services/synthetics_monitor.ts b/x-pack/test/api_integration/deployment_agnostic/services/synthetics_monitor.ts new file mode 100644 index 000000000000..e2bd2881db95 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/services/synthetics_monitor.ts @@ -0,0 +1,240 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { RoleCredentials, SamlAuthProviderType } from '@kbn/ftr-common-functional-services'; +import { SYNTHETICS_API_URLS } from '@kbn/synthetics-plugin/common/constants'; +import { syntheticsMonitorType } from '@kbn/synthetics-plugin/common/types/saved_objects'; +import { EncryptedSyntheticsSavedMonitor } from '@kbn/synthetics-plugin/common/runtime_types'; +import { MonitorInspectResponse } from '@kbn/synthetics-plugin/public/apps/synthetics/state/monitor_management/api'; +import { v4 as uuidv4 } from 'uuid'; +import expect from '@kbn/expect'; +import { ProjectAPIKeyResponse } from '@kbn/synthetics-plugin/server/routes/monitor_cruds/get_api_key'; +import moment from 'moment/moment'; +import { omit } from 'lodash'; +import { KibanaSupertestProvider } from '@kbn/ftr-common-functional-services'; +import { DeploymentAgnosticFtrProviderContext } from '../ftr_provider_context'; + +export class SyntheticsMonitorTestService { + private supertest: ReturnType; + private getService: DeploymentAgnosticFtrProviderContext['getService']; + public apiKey: string | undefined = ''; + public samlAuth: SamlAuthProviderType; + + constructor(getService: DeploymentAgnosticFtrProviderContext['getService']) { + this.supertest = getService('supertestWithoutAuth'); + this.samlAuth = getService('samlAuth'); + this.getService = getService; + } + + generateProjectAPIKey = async (accessToPublicLocations = true, user: RoleCredentials) => { + const res = await this.supertest + .get( + SYNTHETICS_API_URLS.SYNTHETICS_PROJECT_APIKEY + + '?accessToElasticManagedLocations=' + + accessToPublicLocations + ) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .expect(200); + const result = res.body as ProjectAPIKeyResponse; + expect(result).to.have.property('apiKey'); + const apiKey = result.apiKey?.encoded; + expect(apiKey).to.not.be.empty(); + this.apiKey = apiKey; + return apiKey; + }; + + async getMonitor( + monitorId: string, + { + statusCode = 200, + space, + internal, + user, + }: { + statusCode?: number; + space?: string; + internal?: boolean; + user: RoleCredentials; + } + ) { + let url = SYNTHETICS_API_URLS.GET_SYNTHETICS_MONITOR.replace('{monitorId}', monitorId); + if (space) { + url = '/s/' + space + url; + } + if (internal) { + url += `?internal=${internal}`; + } + const apiResponse = await this.supertest + .get(url) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .expect(200); + + expect(apiResponse.status).eql(statusCode, JSON.stringify(apiResponse.body)); + + if (statusCode === 200) { + const { + created_at: createdAt, + updated_at: updatedAt, + id, + config_id: configId, + spaceId, + } = apiResponse.body; + expect(id).not.empty(); + expect(configId).not.empty(); + expect(spaceId).not.empty(); + expect([createdAt, updatedAt].map((d) => moment(d).isValid())).eql([true, true]); + return { + rawBody: omit(apiResponse.body, ['spaceId']), + body: { + ...omit(apiResponse.body, [ + 'created_at', + 'updated_at', + 'id', + 'config_id', + 'form_monitor_type', + 'spaceId', + ]), + }, + }; + } + return apiResponse.body; + } + + async addMonitor(monitor: any, user: RoleCredentials) { + const res = await this.supertest + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITORS) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + + return res.body as EncryptedSyntheticsSavedMonitor; + } + + async inspectMonitor(user: RoleCredentials, monitor: any, hideParams: boolean = true) { + const res = await this.supertest + .post(SYNTHETICS_API_URLS.SYNTHETICS_MONITOR_INSPECT) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .send(monitor) + .expect(200); + + // remove the id and config_id from the response + delete res.body.result?.publicConfigs?.[0].monitors[0].id; + delete res.body.result?.publicConfigs?.[0].monitors[0].streams[0].id; + delete res.body.result?.publicConfigs?.[0].monitors[0].streams[0].config_id; + delete res.body.result?.publicConfigs?.[0].monitors[0].streams[0].fields.config_id; + delete res.body.result?.publicConfigs?.[0].output.api_key; + delete res.body.result?.publicConfigs?.[0].license_issued_to; + delete res.body.result?.publicConfigs?.[0].stack_version; + + return res.body as { result: MonitorInspectResponse; decodedCode: string }; + } + + async addProjectMonitors(project: string, monitors: any, user: RoleCredentials) { + if (this.apiKey) { + return this.supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(this.samlAuth.getInternalRequestHeader()) + .set('authorization', `ApiKey ${this.apiKey}`) + .send({ monitors }); + } else { + return this.supertest + .put( + SYNTHETICS_API_URLS.SYNTHETICS_MONITORS_PROJECT_UPDATE.replace('{projectName}', project) + ) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .send({ monitors }); + } + } + + async deleteMonitorByJourney( + journeyId: string, + projectId: string, + space: string = 'default', + user: RoleCredentials + ) { + try { + const response = await this.supertest + .get(`/s/${space}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .query({ + filter: `${syntheticsMonitorType}.attributes.journey_id: "${journeyId}" AND ${syntheticsMonitorType}.attributes.project_id: "${projectId}"`, + }) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .expect(200); + + const { monitors } = response.body; + if (monitors[0]?.id) { + await this.supertest + .delete(`/s/${space}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}`) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .send({ ids: monitors.map((monitor: { id: string }) => monitor.id) }) + .expect(200); + } + } catch (e) { + // eslint-disable-next-line no-console + console.error(e); + } + } + + async addNewSpace() { + const SPACE_ID = `test-space-${uuidv4()}`; + const SPACE_NAME = `test-space-name ${uuidv4()}`; + + const kibanaServer = this.getService('kibanaServer'); + + await kibanaServer.spaces.create({ id: SPACE_ID, name: SPACE_NAME }); + + return { SPACE_ID }; + } + + async deleteMonitor( + user: RoleCredentials, + monitorId?: string | string[], + statusCode = 200, + spaceId?: string + ) { + const deleteResponse = await this.supertest + .delete( + spaceId + ? `/s/${spaceId}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}` + : SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + ) + .send({ ids: Array.isArray(monitorId) ? monitorId : [monitorId] }) + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .expect(statusCode); + + return deleteResponse; + } + + async deleteMonitorByIdParam( + user: RoleCredentials, + monitorId?: string, + statusCode = 200, + spaceId?: string + ) { + const deleteResponse = await this.supertest + .delete( + spaceId + ? `/s/${spaceId}${SYNTHETICS_API_URLS.SYNTHETICS_MONITORS}/${monitorId}` + : SYNTHETICS_API_URLS.SYNTHETICS_MONITORS + '/' + monitorId + ) + .send() + .set(user.apiKeyHeader) + .set(this.samlAuth.getInternalRequestHeader()) + .expect(statusCode); + + return deleteResponse; + } +} diff --git a/x-pack/test/api_integration/deployment_agnostic/services/synthetics_private_location.ts b/x-pack/test/api_integration/deployment_agnostic/services/synthetics_private_location.ts new file mode 100644 index 000000000000..8b3c95e0b948 --- /dev/null +++ b/x-pack/test/api_integration/deployment_agnostic/services/synthetics_private_location.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ +import { v4 as uuidv4 } from 'uuid'; +import { RetryService } from '@kbn/ftr-common-functional-services'; +import { X_ELASTIC_INTERNAL_ORIGIN_REQUEST } from '@kbn/core-http-common'; +import { privateLocationSavedObjectName } from '@kbn/synthetics-plugin/common/saved_objects/private_locations'; +import { SyntheticsPrivateLocations } from '@kbn/synthetics-plugin/common/runtime_types'; +import { KibanaSupertestProvider } from '@kbn/ftr-common-functional-services'; +import { DeploymentAgnosticFtrProviderContext } from '../ftr_provider_context'; + +export const INSTALLED_VERSION = '1.1.1'; + +export class PrivateLocationTestService { + private supertestWithAuth: ReturnType; + private readonly retry: RetryService; + + constructor(getService: DeploymentAgnosticFtrProviderContext['getService']) { + this.supertestWithAuth = getService('supertest'); + this.retry = getService('retry'); + } + + async installSyntheticsPackage() { + await this.supertestWithAuth + .post('/api/fleet/setup') + .set('kbn-xsrf', 'true') + .send() + .expect(200); + const response = await this.supertestWithAuth + .get(`/api/fleet/epm/packages/synthetics/${INSTALLED_VERSION}`) + .set('kbn-xsrf', 'true') + .expect(200); + if (response.body.item.status !== 'installed') { + await this.supertestWithAuth + .post(`/api/fleet/epm/packages/synthetics/${INSTALLED_VERSION}`) + .set('kbn-xsrf', 'true') + .send({ force: true }) + .expect(200); + } + } + + async addTestPrivateLocation(spaceId?: string) { + const apiResponse = await this.addFleetPolicy(uuidv4()); + const testPolicyId = apiResponse.body.item.id; + return (await this.setTestLocations([testPolicyId], spaceId))[0]; + } + + async addFleetPolicy(name: string) { + return await this.retry.try(async () => { + const response = await this.supertestWithAuth + .post('/api/fleet/agent_policies?sys_monitoring=true') + .set('kbn-xsrf', 'true') + .send({ + name, + description: '', + namespace: 'default', + monitoring_enabled: [], + }); + return response; + }); + } + + async setTestLocations(testFleetPolicyIds: string[], spaceId?: string) { + const locations: SyntheticsPrivateLocations = testFleetPolicyIds.map((id, index) => ({ + label: `Test private location ${id}`, + agentPolicyId: id, + id, + geo: { + lat: 0, + lon: 0, + }, + isServiceManaged: false, + })); + + await this.supertestWithAuth + .post(`/s/${spaceId || 'default'}/api/saved_objects/_bulk_create`) + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .set('kbn-xsrf', 'true') + .send( + locations.map((location) => ({ + type: privateLocationSavedObjectName, + id: location.id, + attributes: location, + initialNamespaces: [spaceId ? spaceId : 'default'], + })) + ) + .expect(200); + + return locations; + } +} diff --git a/x-pack/test/api_integration/services/security_solution_api.gen.ts b/x-pack/test/api_integration/services/security_solution_api.gen.ts index a6d0ac86a810..9ffdc1c43a2a 100644 --- a/x-pack/test/api_integration/services/security_solution_api.gen.ts +++ b/x-pack/test/api_integration/services/security_solution_api.gen.ts @@ -28,6 +28,7 @@ import { BulkPatchRulesRequestBodyInput } from '@kbn/security-solution-plugin/co import { BulkUpdateRulesRequestBodyInput } from '@kbn/security-solution-plugin/common/api/detection_engine/rule_management/bulk_crud/bulk_update_rules/bulk_update_rules_route.gen'; import { BulkUpsertAssetCriticalityRecordsRequestBodyInput } from '@kbn/security-solution-plugin/common/api/entity_analytics/asset_criticality/bulk_upload_asset_criticality.gen'; import { CleanDraftTimelinesRequestBodyInput } from '@kbn/security-solution-plugin/common/api/timeline/clean_draft_timelines/clean_draft_timelines_route.gen'; +import { ConfigureRiskEngineSavedObjectRequestBodyInput } from '@kbn/security-solution-plugin/common/api/entity_analytics/risk_engine/engine_configure_saved_object_route.gen'; import { CopyTimelineRequestBodyInput } from '@kbn/security-solution-plugin/common/api/timeline/copy_timeline/copy_timeline_route.gen'; import { CreateAlertsMigrationRequestBodyInput } from '@kbn/security-solution-plugin/common/api/detection_engine/signals_migration/create_signals_migration/create_signals_migration.gen'; import { CreateAssetCriticalityRecordRequestBodyInput } from '@kbn/security-solution-plugin/common/api/entity_analytics/asset_criticality/create_asset_criticality.gen'; @@ -104,6 +105,7 @@ import { GetRuleMigrationResourcesRequestQueryInput, GetRuleMigrationResourcesRequestParamsInput, } from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; +import { GetRuleMigrationResourcesMissingRequestParamsInput } from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; import { GetRuleMigrationStatsRequestParamsInput } from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; import { GetRuleMigrationTranslationStatsRequestParamsInput } from '@kbn/security-solution-plugin/common/siem_migrations/model/api/rules/rule_migration.gen'; import { GetTimelineRequestQueryInput } from '@kbn/security-solution-plugin/common/api/timeline/get_timeline/get_timeline_route.gen'; @@ -313,6 +315,20 @@ If asset criticality records already exist for the specified entities, those rec .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); }, + /** + * Configuring the Risk Engine Saved Object + */ + configureRiskEngineSavedObject( + props: ConfigureRiskEngineSavedObjectProps, + kibanaSpace: string = 'default' + ) { + return supertest + .patch(routeWithNamespace('/api/risk_score/engine/saved_object/configure', kibanaSpace)) + .set('kbn-xsrf', 'true') + .set(ELASTIC_HTTP_VERSION_HEADER, '2023-10-31') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .send(props.body as object); + }, /** * Copies and returns a timeline or timeline template. @@ -998,6 +1014,27 @@ finalize it. .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .query(props.query); }, + /** + * Identifies missing resources from all the rules of an existing SIEM rules migration + */ + getRuleMigrationResourcesMissing( + props: GetRuleMigrationResourcesMissingProps, + kibanaSpace: string = 'default' + ) { + return supertest + .get( + routeWithNamespace( + replaceParams( + '/internal/siem_migrations/rules/{migration_id}/resources/missing', + props.params + ), + kibanaSpace + ) + ) + .set('kbn-xsrf', 'true') + .set(ELASTIC_HTTP_VERSION_HEADER, '1') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana'); + }, /** * Retrieves the stats of a SIEM rules migration using the migration id provided */ @@ -1612,6 +1649,9 @@ export interface BulkUpsertAssetCriticalityRecordsProps { export interface CleanDraftTimelinesProps { body: CleanDraftTimelinesRequestBodyInput; } +export interface ConfigureRiskEngineSavedObjectProps { + body: ConfigureRiskEngineSavedObjectRequestBodyInput; +} export interface CopyTimelineProps { body: CopyTimelineRequestBodyInput; } @@ -1760,6 +1800,9 @@ export interface GetRuleMigrationResourcesProps { query: GetRuleMigrationResourcesRequestQueryInput; params: GetRuleMigrationResourcesRequestParamsInput; } +export interface GetRuleMigrationResourcesMissingProps { + params: GetRuleMigrationResourcesMissingRequestParamsInput; +} export interface GetRuleMigrationStatsProps { params: GetRuleMigrationStatsRequestParamsInput; } diff --git a/x-pack/test/automatic_import_api_integration/security/config_basic.ts b/x-pack/test/automatic_import_api_integration/apis/config_basic.ts similarity index 80% rename from x-pack/test/automatic_import_api_integration/security/config_basic.ts rename to x-pack/test/automatic_import_api_integration/apis/config_basic.ts index ebda3390790e..85abda4f2a7b 100644 --- a/x-pack/test/automatic_import_api_integration/security/config_basic.ts +++ b/x-pack/test/automatic_import_api_integration/apis/config_basic.ts @@ -7,8 +7,7 @@ import { createTestConfig } from '../common/config'; -// eslint-disable-next-line import/no-default-export -export default createTestConfig('security', { +export default createTestConfig('apis', { license: 'basic', ssl: true, testFiles: [require.resolve('./tests/basic')], diff --git a/x-pack/test/automatic_import_api_integration/apis/config_graphs.ts b/x-pack/test/automatic_import_api_integration/apis/config_graphs.ts new file mode 100644 index 000000000000..c572c62bfb21 --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/config_graphs.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 { createTestConfig } from '../common/config'; + +export default createTestConfig('apis', { + license: 'trial', + ssl: true, + testFiles: [require.resolve('./tests/graphs')], + publicBaseUrl: true, +}); diff --git a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/analyze_logs.ts b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/analyze_logs.ts similarity index 95% rename from x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/analyze_logs.ts rename to x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/analyze_logs.ts index 6fb3abf12774..9f842247161c 100644 --- a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/analyze_logs.ts +++ b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/analyze_logs.ts @@ -9,7 +9,6 @@ import { postAnalyzeLogs } from '../../../../common/lib/api/analyze_logs'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { User } from '../../../../common/lib/authentication/types'; -// eslint-disable-next-line import/no-default-export export default ({ getService }: FtrProviderContext): void => { const supertest = getService('supertest'); diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/categorization.ts b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/categorization.ts new file mode 100644 index 000000000000..0420822a8dfa --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/categorization.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 { postCategorization } from '../../../../common/lib/api/categorization'; +import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; +import { User } from '../../../../common/lib/authentication/types'; + +export default ({ getService }: FtrProviderContext): void => { + const supertest = getService('supertest'); + + describe('Run categorization', () => { + it('should get 404 when trying to run categorization with basic license', async () => { + return await postCategorization({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['sample1', 'sample2'], + samplesFormat: { + name: 'json', + }, + connectorId: 'bedrock-connector', + currentPipeline: { + processors: [], + }, + }, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + }); + }); +}; diff --git a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/ecs.ts b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/ecs.ts similarity index 91% rename from x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/ecs.ts rename to x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/ecs.ts index d24a72f796d4..b6381a6ac7af 100644 --- a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/ecs.ts +++ b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/ecs.ts @@ -9,11 +9,11 @@ import { postEcsMapping } from '../../../../common/lib/api/ecs'; import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; import { User } from '../../../../common/lib/authentication/types'; -// eslint-disable-next-line import/no-default-export export default ({ getService }: FtrProviderContext): void => { const supertest = getService('supertest'); - describe('Run ecs_mapping', () => { + describe('Run ecs_mapping', function () { + this.tags('skipFIPS'); it('should get 404 when trying to run ecs_mapping with basic license', async () => { return await postEcsMapping({ supertest, @@ -26,6 +26,7 @@ export default ({ getService }: FtrProviderContext): void => { }, connectorId: 'bedrock-connector', }, + expectedHttpCode: 404, auth: { user: { username: 'elastic', password: 'elastic' } as User, }, diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/related.ts b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/related.ts new file mode 100644 index 000000000000..45c1b5935cb4 --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/basic/graphs/related.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 { postRelated } from '../../../../common/lib/api/related'; +import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; +import { User } from '../../../../common/lib/authentication/types'; + +export default ({ getService }: FtrProviderContext): void => { + const supertest = getService('supertest'); + + describe('Run related', () => { + it('should get 404 when trying to run related graph with basic license', async () => { + return await postRelated({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['sample1', 'sample2'], + samplesFormat: { + name: 'json', + }, + connectorId: 'bedrock-connector', + currentPipeline: { + processors: [], + }, + }, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + }); + }); +}; diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/basic/index.ts b/x-pack/test/automatic_import_api_integration/apis/tests/basic/index.ts new file mode 100644 index 000000000000..f0e61f713a6a --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/basic/index.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 { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { + createUsersAndRoles, + deleteUsersAndRoles, + activateUserProfiles, +} from '../../../common/lib/authentication'; + +export default ({ loadTestFile, getService }: FtrProviderContext): void => { + describe('Automatic Import enabled: basic', function () { + before(async () => { + await createUsersAndRoles(getService); + // once a user profile is created the only way to remove it is to delete the user and roles, so best to activate + // before all the tests + await activateUserProfiles(getService); + }); + + after(async () => { + await deleteUsersAndRoles(getService); + }); + + // Basic + loadTestFile(require.resolve('./graphs/ecs')); + }); +}; diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/graphs/categorization.ts b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/categorization.ts new file mode 100644 index 000000000000..5fed052da894 --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/categorization.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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { postCategorization } from '../../../common/lib/api/categorization'; +import { User } from '../../../common/lib/authentication/types'; +import { BadRequestError } from '../../../common/lib/error/error'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + describe('Run categorization', () => { + it('should get 400 when trying to run categorization with invalid json', async () => { + const response = await postCategorization({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-bedrock', + currentPipeline: { processors: [] }, + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be("Expected property name or '}' in JSON at position 1"); + } else { + expect().fail('Expected BadRequestError'); + } + }); + it('should get 400 when trying to run categorization without connector action', async () => { + const response = await postCategorization({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-dummy', + currentPipeline: { processors: [] }, + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be('Saved object [action/preconfigured-dummy] not found'); + } else { + expect().fail('Expected BadRequestError'); + } + }); + }); +} diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/graphs/ecs_mapping.ts b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/ecs_mapping.ts new file mode 100644 index 000000000000..33281794109e --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/ecs_mapping.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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { postEcsMapping } from '../../../common/lib/api/ecs'; +import { User } from '../../../common/lib/authentication/types'; +import { BadRequestError } from '../../../common/lib/error/error'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + describe('Run ecs_mapping', () => { + it('should get 400 when trying to run ecs_mapping with invalid json', async () => { + const response = await postEcsMapping({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-bedrock', + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be("Expected property name or '}' in JSON at position 1"); + } else { + expect().fail('Expected BadRequestError'); + } + }); + it('should get 400 when trying to run ecs_mapping without connector action', async () => { + const response = await postEcsMapping({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-dummy', + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be('Saved object [action/preconfigured-dummy] not found'); + } else { + expect().fail('Expected BadRequestError'); + } + }); + }); +} diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/graphs/index.ts b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/index.ts new file mode 100644 index 000000000000..c48b1da1d86e --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/index.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 { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { + createUsersAndRoles, + deleteUsersAndRoles, + activateUserProfiles, +} from '../../../common/lib/authentication'; + +export default ({ loadTestFile, getService }: FtrProviderContext): void => { + describe('Automatic Import enabled: basic', function () { + before(async () => { + await createUsersAndRoles(getService); + // once a user profile is created the only way to remove it is to delete the user and roles, so best to activate + // before all the tests + await activateUserProfiles(getService); + }); + + after(async () => { + await deleteUsersAndRoles(getService); + }); + + // Basic + loadTestFile(require.resolve('./ecs_mapping')); + loadTestFile(require.resolve('./categorization')); + loadTestFile(require.resolve('./related')); + }); +}; diff --git a/x-pack/test/automatic_import_api_integration/apis/tests/graphs/related.ts b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/related.ts new file mode 100644 index 000000000000..9698017a2a3f --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/apis/tests/graphs/related.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 expect from '@kbn/expect'; +import { FtrProviderContext } from '../../../../common/ftr_provider_context'; +import { postRelated } from '../../../common/lib/api/related'; +import { User } from '../../../common/lib/authentication/types'; +import { BadRequestError } from '../../../common/lib/error/error'; + +export default function (providerContext: FtrProviderContext) { + const { getService } = providerContext; + const supertest = getService('supertest'); + describe('Run related', () => { + it('should get 400 when trying to run related with invalid json', async () => { + const response = await postRelated({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-bedrock', + currentPipeline: { processors: [] }, + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be("Expected property name or '}' in JSON at position 1"); + } else { + expect().fail('Expected BadRequestError'); + } + }); + it('should get 400 when trying to run related without connector action', async () => { + const response = await postRelated({ + supertest, + req: { + packageName: 'some-package', + dataStreamName: 'some-data-stream', + rawSamples: ['{test:json}'], + samplesFormat: { + name: 'json', + }, + connectorId: 'preconfigured-dummy', + currentPipeline: { processors: [] }, + }, + expectedHttpCode: 400, + auth: { + user: { username: 'elastic', password: 'elastic' } as User, + }, + }); + if (response instanceof BadRequestError) { + expect(response.message).to.be('Saved object [action/preconfigured-dummy] not found'); + } else { + expect().fail('Expected BadRequestError'); + } + }); + }); +} diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts index f14efc63ee8a..38bc7ddafe32 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/categorization.ts @@ -12,6 +12,7 @@ import { } from '@kbn/integration-assistant-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; +import { BadRequestError } from '../error/error'; export const postCategorization = async ({ supertest, @@ -23,7 +24,7 @@ export const postCategorization = async ({ req: CategorizationRequestBody; expectedHttpCode?: number; auth: { user: User }; -}): Promise => { +}): Promise => { const { body: response } = await supertest .post(`${CATEGORIZATION_GRAPH_PATH}`) .send(req) @@ -32,5 +33,9 @@ export const postCategorization = async ({ .auth(auth.user.username, auth.user.password) .expect(expectedHttpCode); + if (response.statusCode === 400) { + return new BadRequestError(response.message); + } + return response; }; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts index 3169659d7e2f..82888d086165 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/ecs.ts @@ -12,6 +12,7 @@ import { } from '@kbn/integration-assistant-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; +import { BadRequestError } from '../error/error'; export const postEcsMapping = async ({ supertest, @@ -23,7 +24,7 @@ export const postEcsMapping = async ({ req: EcsMappingRequestBody; expectedHttpCode?: number; auth: { user: User }; -}): Promise => { +}): Promise => { const { body: response } = await supertest .post(`${ECS_GRAPH_PATH}`) .send(req) @@ -32,5 +33,9 @@ export const postEcsMapping = async ({ .auth(auth.user.username, auth.user.password) .expect(expectedHttpCode); + if (response.statusCode === 400) { + return new BadRequestError(response.message); + } + return response; }; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts b/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts index 7ebe3d3bf89c..0620d98fcb26 100644 --- a/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts +++ b/x-pack/test/automatic_import_api_integration/common/lib/api/related.ts @@ -12,6 +12,7 @@ import { } from '@kbn/integration-assistant-plugin/common'; import { superUser } from '../authentication/users'; import { User } from '../authentication/types'; +import { BadRequestError } from '../error/error'; export const postRelated = async ({ supertest, @@ -23,7 +24,7 @@ export const postRelated = async ({ req: RelatedRequestBody; expectedHttpCode?: number; auth: { user: User }; -}): Promise => { +}): Promise => { const { body: response } = await supertest .post(`${RELATED_GRAPH_PATH}`) .send(req) @@ -32,5 +33,9 @@ export const postRelated = async ({ .auth(auth.user.username, auth.user.password) .expect(expectedHttpCode); + if (response.statusCode === 400) { + return new BadRequestError(response.message); + } + return response; }; diff --git a/x-pack/test/automatic_import_api_integration/common/lib/error/error.ts b/x-pack/test/automatic_import_api_integration/common/lib/error/error.ts new file mode 100644 index 000000000000..d0a19d0d8dfd --- /dev/null +++ b/x-pack/test/automatic_import_api_integration/common/lib/error/error.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 class BadRequestError { + statusCode: number = 400; + error: string | undefined; + message: string | undefined; + + constructor(message: string) { + this.message = message; + } +} diff --git a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/categorization.ts b/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/categorization.ts deleted file mode 100644 index 4d9a3a085310..000000000000 --- a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/categorization.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { postCategorization } from '../../../../common/lib/api/categorization'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { User } from '../../../../common/lib/authentication/types'; - -// eslint-disable-next-line import/no-default-export -export default ({ getService }: FtrProviderContext): void => { - const supertest = getService('supertest'); - - describe('Run categorization', () => { - it('should get 404 when trying to run categorization with basic license', async () => { - return await postCategorization({ - supertest, - req: { - packageName: 'some-package', - dataStreamName: 'some-data-stream', - rawSamples: ['sample1', 'sample2'], - samplesFormat: { - name: 'json', - }, - connectorId: 'bedrock-connector', - currentPipeline: { - processors: [], - }, - }, - auth: { - user: { username: 'elastic', password: 'elastic' } as User, - }, - }); - }); - }); -}; diff --git a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/related.ts b/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/related.ts deleted file mode 100644 index 6091b64f7c22..000000000000 --- a/x-pack/test/automatic_import_api_integration/security/tests/basic/graphs/related.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { postRelated } from '../../../../common/lib/api/related'; -import { FtrProviderContext } from '../../../../../common/ftr_provider_context'; -import { User } from '../../../../common/lib/authentication/types'; - -// eslint-disable-next-line import/no-default-export -export default ({ getService }: FtrProviderContext): void => { - const supertest = getService('supertest'); - - describe('Run related', () => { - it('should get 404 when trying to run related graph with basic license', async () => { - return await postRelated({ - supertest, - req: { - packageName: 'some-package', - dataStreamName: 'some-data-stream', - rawSamples: ['sample1', 'sample2'], - samplesFormat: { - name: 'json', - }, - connectorId: 'bedrock-connector', - currentPipeline: { - processors: [], - }, - }, - auth: { - user: { username: 'elastic', password: 'elastic' } as User, - }, - }); - }); - }); -}; diff --git a/x-pack/test/automatic_import_api_integration/security/tests/basic/index.ts b/x-pack/test/automatic_import_api_integration/security/tests/basic/index.ts deleted file mode 100644 index 7391c1e3ae9e..000000000000 --- a/x-pack/test/automatic_import_api_integration/security/tests/basic/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrProviderContext } from '../../../common/ftr_provider_context'; -import { - createUsersAndRoles, - deleteUsersAndRoles, - activateUserProfiles, -} from '../../../common/lib/authentication'; - -// eslint-disable-next-line import/no-default-export -export default ({ loadTestFile, getService }: FtrProviderContext): void => { - describe('Automatic Import enabled: basic', function () { - before(async () => { - await createUsersAndRoles(getService); - // once a user profile is created the only way to remove it is to delete the user and roles, so best to activate - // before all the tests - await activateUserProfiles(getService); - }); - - after(async () => { - await deleteUsersAndRoles(getService); - }); - - // Basic - loadTestFile(require.resolve('./graphs/ecs')); - }); -}; diff --git a/x-pack/test/cloud_security_posture_api/routes/graph.ts b/x-pack/test/cloud_security_posture_api/routes/graph.ts index 95625b24fa59..08adf73839ea 100644 --- a/x-pack/test/cloud_security_posture_api/routes/graph.ts +++ b/x-pack/test/cloud_security_posture_api/routes/graph.ts @@ -28,14 +28,14 @@ export default function (providerContext: FtrProviderContext) { const cspSecurity = CspSecurityCommonProvider(providerContext); const postGraph = (agent: Agent, body: GraphRequest, auth?: { user: string; pass: string }) => { - const req = agent + let req = agent .post('/internal/cloud_security_posture/graph') .set(ELASTIC_HTTP_VERSION_HEADER, '1') .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') .set('kbn-xsrf', 'xxxx'); if (auth) { - req.auth(auth.user, auth.pass); + req = req.auth(auth.user, auth.pass); } return req.send(body); diff --git a/x-pack/test/cloud_security_posture_functional/config.ts b/x-pack/test/cloud_security_posture_functional/config.ts index 7e80788ffccf..bea81dd38dc1 100644 --- a/x-pack/test/cloud_security_posture_functional/config.ts +++ b/x-pack/test/cloud_security_posture_functional/config.ts @@ -38,6 +38,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { * 1. release a new package to EPR * 2. merge the updated version number change to kibana */ + `--uiSettings.overrides.securitySolution:enableVisualizationsInFlyout=true`, `--xpack.securitySolution.enableExperimental=${JSON.stringify([ 'graphVisualizationInFlyoutEnabled', ])}`, diff --git a/x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit/data.json b/x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit/data.json index 5e3d4cdfdffd..e5b83d55c15a 100644 --- a/x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit/data.json +++ b/x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit/data.json @@ -90,6 +90,11 @@ "logger": "projects/your-project-id/logs/cloudaudit.googleapis.com%2Factivity" }, "related": { + "entity": [ + "10.0.0.1", + "projects/your-project-id/roles/customRole", + "admin@example.com" + ], "ip": [ "10.0.0.1" ], @@ -215,6 +220,11 @@ "logger": "projects/your-project-id/logs/cloudaudit.googleapis.com%2Factivity" }, "related": { + "entity": [ + "10.0.0.1", + "projects/your-project-id/roles/customRole", + "admin2@example.com" + ], "ip": [ "10.0.0.1" ], @@ -340,6 +350,11 @@ "logger": "projects/your-project-id/logs/cloudaudit.googleapis.com%2Factivity" }, "related": { + "entity": [ + "10.0.0.1", + "projects/your-project-id/roles/customRole", + "admin3@example.com" + ], "ip": [ "10.0.0.1" ], @@ -465,6 +480,11 @@ "logger": "projects/your-project-id/logs/cloudaudit.googleapis.com%2Factivity" }, "related": { + "entity": [ + "10.0.0.1", + "projects/your-project-id/roles/customRole", + "admin3@example.com" + ], "ip": [ "10.0.0.1" ], @@ -599,6 +619,11 @@ "logger": "projects/your-project-id/logs/cloudaudit.googleapis.com%2Factivity" }, "related": { + "entity": [ + "10.0.0.1", + "projects/your-project-id/roles/customRole", + "admin4@example.com" + ], "ip": [ "10.0.0.1" ], diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/alerts_page.ts b/x-pack/test/cloud_security_posture_functional/page_objects/alerts_page.ts index f3a9f7b1448a..6ebd496fca36 100644 --- a/x-pack/test/cloud_security_posture_functional/page_objects/alerts_page.ts +++ b/x-pack/test/cloud_security_posture_functional/page_objects/alerts_page.ts @@ -10,7 +10,7 @@ import { FtrService } from '../../functional/ftr_provider_context'; const ALERT_TABLE_ROW_CSS_SELECTOR = '[data-test-subj="alertsTable"] .euiDataGridRow'; const VISUALIZATIONS_SECTION_HEADER_TEST_ID = 'securitySolutionFlyoutVisualizationsHeader'; -const GRAPH_PREVIEW_TEST_ID = 'securitySolutionFlyoutGraphPreview'; +const GRAPH_PREVIEW_CONTENT_TEST_ID = 'securitySolutionFlyoutGraphPreviewContent'; const GRAPH_PREVIEW_LOADING_TEST_ID = 'securitySolutionFlyoutGraphPreviewLoading'; export class AlertsPageObject extends FtrService { @@ -89,12 +89,12 @@ export class AlertsPageObject extends FtrService { }, assertGraphPreviewVisible: async () => { - return await this.testSubjects.existOrFail(GRAPH_PREVIEW_TEST_ID); + return await this.testSubjects.existOrFail(GRAPH_PREVIEW_CONTENT_TEST_ID); }, assertGraphNodesNumber: async (expected: number) => { await this.flyout.waitGraphIsLoaded(); - const graph = await this.testSubjects.find(GRAPH_PREVIEW_TEST_ID); + const graph = await this.testSubjects.find(GRAPH_PREVIEW_CONTENT_TEST_ID); await graph.scrollIntoView(); const nodes = await graph.findAllByCssSelector('.react-flow__nodes .react-flow__node'); expect(nodes.length).to.be(expected); diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/expanded_flyout.ts b/x-pack/test/cloud_security_posture_functional/page_objects/expanded_flyout.ts new file mode 100644 index 000000000000..5829e9083a8c --- /dev/null +++ b/x-pack/test/cloud_security_posture_functional/page_objects/expanded_flyout.ts @@ -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 expect from '@kbn/expect'; +import type { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; +import type { FilterBarService } from '@kbn/test-suites-src/functional/services/filter_bar'; +import { FtrService } from '../../functional/ftr_provider_context'; + +const GRAPH_PREVIEW_TITLE_LINK_TEST_ID = 'securitySolutionFlyoutGraphPreviewTitleLink'; +const NODE_EXPAND_BUTTON_TEST_ID = 'nodeExpandButton'; +const GRAPH_INVESTIGATION_TEST_ID = 'cloudSecurityGraphGraphInvestigation'; +const GRAPH_NODE_EXPAND_POPOVER_TEST_ID = `${GRAPH_INVESTIGATION_TEST_ID}GraphNodeExpandPopover`; +const GRAPH_NODE_POPOVER_EXPLORE_RELATED_TEST_ID = `${GRAPH_INVESTIGATION_TEST_ID}ExploreRelatedEntities`; +const GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_TEST_ID = `${GRAPH_INVESTIGATION_TEST_ID}ShowActionsByEntity`; +const GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_TEST_ID = `${GRAPH_INVESTIGATION_TEST_ID}ShowActionsOnEntity`; +type Filter = Parameters[0]; + +export class ExpandedFlyout extends FtrService { + private readonly pageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly filterBar = this.ctx.getService('filterBar'); + + async expandGraph(): Promise { + await this.testSubjects.click(GRAPH_PREVIEW_TITLE_LINK_TEST_ID); + } + + async waitGraphIsLoaded(): Promise { + await this.testSubjects.existOrFail(GRAPH_INVESTIGATION_TEST_ID, { timeout: 10000 }); + } + + async assertGraphNodesNumber(expected: number): Promise { + await this.waitGraphIsLoaded(); + const graph = await this.testSubjects.find(GRAPH_INVESTIGATION_TEST_ID); + await graph.scrollIntoView(); + const nodes = await graph.findAllByCssSelector('.react-flow__nodes .react-flow__node'); + expect(nodes.length).to.be(expected); + } + + async selectNode(nodeId: string): Promise { + await this.waitGraphIsLoaded(); + const graph = await this.testSubjects.find(GRAPH_INVESTIGATION_TEST_ID); + await graph.scrollIntoView(); + const nodes = await graph.findAllByCssSelector( + `.react-flow__nodes .react-flow__node[data-id="${nodeId}"]` + ); + expect(nodes.length).to.be(1); + await nodes[0].moveMouseTo(); + return nodes[0]; + } + + async clickOnNodeExpandButton(nodeId: string): Promise { + const node = await this.selectNode(nodeId); + const expandButton = await node.findByTestSubject(NODE_EXPAND_BUTTON_TEST_ID); + await expandButton.click(); + await this.testSubjects.existOrFail(GRAPH_NODE_EXPAND_POPOVER_TEST_ID); + } + + async showActionsByEntity(nodeId: string): Promise { + await this.clickOnNodeExpandButton(nodeId); + await this.testSubjects.click(GRAPH_NODE_POPOVER_SHOW_ACTIONS_BY_TEST_ID); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } + + async showActionsOnEntity(nodeId: string): Promise { + await this.clickOnNodeExpandButton(nodeId); + await this.testSubjects.click(GRAPH_NODE_POPOVER_SHOW_ACTIONS_ON_TEST_ID); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } + + async exploreRelatedEntities(nodeId: string): Promise { + await this.clickOnNodeExpandButton(nodeId); + await this.testSubjects.click(GRAPH_NODE_POPOVER_EXPLORE_RELATED_TEST_ID); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } + + async expectFilterTextEquals(filterIdx: number, expected: string): Promise { + const filters = await this.filterBar.getFiltersLabel(); + expect(filters.length).to.be.greaterThan(filterIdx); + expect(filters[filterIdx]).to.be(expected); + } + + async expectFilterPreviewEquals(filterIdx: number, expected: string): Promise { + await this.clickEditFilter(filterIdx); + + const filterPreview = await this.filterBar.getFilterEditorPreview(); + expect(filterPreview).to.be(expected); + + await this.filterBar.ensureFieldEditorModalIsClosed(); + } + + async clickEditFilter(filterIdx: number): Promise { + await this.filterBar.clickEditFilterById(filterIdx.toString()); + } + + async clearAllFilters(): Promise { + await this.testSubjects.click(`${GRAPH_INVESTIGATION_TEST_ID} > showQueryBarMenu`); + await this.testSubjects.click('filter-sets-removeAllFilters'); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } + + async addFilter(filter: Filter): Promise { + await this.testSubjects.click(`${GRAPH_INVESTIGATION_TEST_ID} > addFilter`); + await this.filterBar.createFilter(filter); + await this.testSubjects.scrollIntoView('saveFilter'); + await this.testSubjects.clickWhenNotDisabled('saveFilter'); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } +} diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/index.ts b/x-pack/test/cloud_security_posture_functional/page_objects/index.ts index b7c20632e82f..fdc904e31aac 100644 --- a/x-pack/test/cloud_security_posture_functional/page_objects/index.ts +++ b/x-pack/test/cloud_security_posture_functional/page_objects/index.ts @@ -14,9 +14,13 @@ import { BenchmarkPagePageProvider } from './benchmark_page'; import { CspSecurityCommonProvider } from './security_common'; import { RulePagePageProvider } from './rule_page'; import { AlertsPageObject } from './alerts_page'; +import { NetworkEventsPageObject } from './network_events_page'; +import { ExpandedFlyout } from './expanded_flyout'; export const cloudSecurityPosturePageObjects = { alerts: AlertsPageObject, + networkEvents: NetworkEventsPageObject, + expandedFlyout: ExpandedFlyout, findings: FindingsPageProvider, cloudPostureDashboard: CspDashboardPageProvider, cisAddIntegration: AddCisIntegrationFormPageProvider, diff --git a/x-pack/test/cloud_security_posture_functional/page_objects/network_events_page.ts b/x-pack/test/cloud_security_posture_functional/page_objects/network_events_page.ts new file mode 100644 index 000000000000..8e03fae7eb7e --- /dev/null +++ b/x-pack/test/cloud_security_posture_functional/page_objects/network_events_page.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; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { FtrService } from '../../functional/ftr_provider_context'; + +const EVENTS_TABLE_ROW_CSS_SELECTOR = '[data-test-subj="events-viewer-panel"] .euiDataGridRow'; +const VISUALIZATIONS_SECTION_HEADER_TEST_ID = 'securitySolutionFlyoutVisualizationsHeader'; +const GRAPH_PREVIEW_CONTENT_TEST_ID = 'securitySolutionFlyoutGraphPreviewContent'; +const GRAPH_PREVIEW_LOADING_TEST_ID = 'securitySolutionFlyoutGraphPreviewLoading'; + +export class NetworkEventsPageObject extends FtrService { + private readonly retry = this.ctx.getService('retry'); + private readonly pageObjects = this.ctx.getPageObjects(['common', 'header']); + private readonly testSubjects = this.ctx.getService('testSubjects'); + private readonly defaultTimeoutMs = this.ctx.getService('config').get('timeouts.waitFor'); + + async navigateToNetworkEventsPage(urlQueryParams: string = ''): Promise { + await this.pageObjects.common.navigateToUrlWithBrowserHistory( + 'securitySolution', + '/network/events', + `${urlQueryParams && `?${urlQueryParams}`}`, + { + ensureCurrentUrl: false, + } + ); + await this.pageObjects.header.waitUntilLoadingHasFinished(); + } + + getAbsoluteTimerangeFilter(from: string, to: string) { + return `timerange=(global:(linkTo:!(),timerange:(from:%27${from}%27,kind:absolute,to:%27${to}%27)))`; + } + + getFlyoutFilter(eventId: string) { + return `flyout=(preview:!(),right:(id:document-details-right,params:(id:%27${eventId}%27,indexName:logs-gcp.audit-default,scopeId:network-page-events)))`; + } + + /** + * Clicks the refresh button on the network events page and waits for it to complete + */ + async clickRefresh(): Promise { + await this.ensureOnNetworkEventsPage(); + await this.testSubjects.click('querySubmitButton'); + + // wait for refresh to complete + await this.retry.waitFor( + 'Network events pages refresh button to be enabled', + async (): Promise => { + const refreshButton = await this.testSubjects.find('querySubmitButton'); + + return (await refreshButton.isDisplayed()) && (await refreshButton.isEnabled()); + } + ); + } + + async ensureOnNetworkEventsPage(): Promise { + await this.testSubjects.existOrFail('network-details-headline'); + } + + async waitForListToHaveEvents(timeoutMs?: number): Promise { + const allEventRows = await this.testSubjects.findService.allByCssSelector( + EVENTS_TABLE_ROW_CSS_SELECTOR + ); + + if (!Boolean(allEventRows.length)) { + await this.retry.waitForWithTimeout( + 'waiting for events to show up on network events page', + timeoutMs ?? this.defaultTimeoutMs, + async (): Promise => { + await this.clickRefresh(); + + const allEventRowsInner = await this.testSubjects.findService.allByCssSelector( + EVENTS_TABLE_ROW_CSS_SELECTOR + ); + + return Boolean(allEventRowsInner.length); + } + ); + } + } + + flyout = { + expandVisualizations: async (): Promise => { + await this.testSubjects.click(VISUALIZATIONS_SECTION_HEADER_TEST_ID); + }, + + assertGraphPreviewVisible: async () => { + return await this.testSubjects.existOrFail(GRAPH_PREVIEW_CONTENT_TEST_ID); + }, + + assertGraphNodesNumber: async (expected: number) => { + await this.flyout.waitGraphIsLoaded(); + const graph = await this.testSubjects.find(GRAPH_PREVIEW_CONTENT_TEST_ID); + await graph.scrollIntoView(); + const nodes = await graph.findAllByCssSelector('.react-flow__nodes .react-flow__node'); + expect(nodes.length).to.be(expected); + }, + + waitGraphIsLoaded: async () => { + await this.testSubjects.missingOrFail(GRAPH_PREVIEW_LOADING_TEST_ID, { timeout: 10000 }); + }, + }; +} diff --git a/x-pack/test/cloud_security_posture_functional/pages/alerts_flyout.ts b/x-pack/test/cloud_security_posture_functional/pages/alerts_flyout.ts index 63eafc4107bc..35f9578929ad 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/alerts_flyout.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/alerts_flyout.ts @@ -14,8 +14,9 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const logger = getService('log'); const supertest = getService('supertest'); const esArchiver = getService('esArchiver'); - const pageObjects = getPageObjects(['common', 'header', 'alerts']); + const pageObjects = getPageObjects(['common', 'header', 'alerts', 'expandedFlyout']); const alertsPage = pageObjects.alerts; + const expandedFlyout = pageObjects.expandedFlyout; describe('Security Alerts Page - Graph visualization', function () { this.tags(['cloud_security_posture_graph_viz']); @@ -54,9 +55,52 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { ); }); - it('should render graph visualization', async () => { + it('expanded flyout - filter by node', async () => { await alertsPage.flyout.assertGraphPreviewVisible(); await alertsPage.flyout.assertGraphNodesNumber(3); + + await expandedFlyout.expandGraph(); + await expandedFlyout.waitGraphIsLoaded(); + await expandedFlyout.assertGraphNodesNumber(3); + + // Show actions by entity + await expandedFlyout.showActionsByEntity('admin@example.com'); + await expandedFlyout.expectFilterTextEquals(0, 'actor.entity.id: admin@example.com'); + await expandedFlyout.expectFilterPreviewEquals(0, 'actor.entity.id: admin@example.com'); + + // Show actions on entity + await expandedFlyout.showActionsOnEntity('admin@example.com'); + await expandedFlyout.expectFilterTextEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com' + ); + await expandedFlyout.expectFilterPreviewEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com' + ); + + // Explore related entities + await expandedFlyout.exploreRelatedEntities('admin@example.com'); + await expandedFlyout.expectFilterTextEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com OR related.entity: admin@example.com' + ); + await expandedFlyout.expectFilterPreviewEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com OR related.entity: admin@example.com' + ); + + // Clear filters + await expandedFlyout.clearAllFilters(); + + // Add custom filter + await expandedFlyout.addFilter({ + field: 'actor.entity.id', + operation: 'is', + value: 'admin2@example.com', + }); + await pageObjects.header.waitUntilLoadingHasFinished(); + await expandedFlyout.assertGraphNodesNumber(5); }); }); } diff --git a/x-pack/test/cloud_security_posture_functional/pages/events_flyout.ts b/x-pack/test/cloud_security_posture_functional/pages/events_flyout.ts new file mode 100644 index 000000000000..0848307ca26d --- /dev/null +++ b/x-pack/test/cloud_security_posture_functional/pages/events_flyout.ts @@ -0,0 +1,98 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { waitForPluginInitialized } from '../../cloud_security_posture_api/utils'; +import type { FtrProviderContext } from '../ftr_provider_context'; + +// eslint-disable-next-line import/no-default-export +export default function ({ getPageObjects, getService }: FtrProviderContext) { + const retry = getService('retry'); + const logger = getService('log'); + const supertest = getService('supertest'); + const esArchiver = getService('esArchiver'); + const pageObjects = getPageObjects(['common', 'header', 'networkEvents', 'expandedFlyout']); + const networkEventsPage = pageObjects.networkEvents; + const expandedFlyout = pageObjects.expandedFlyout; + + describe('Security Network Page - Graph visualization', function () { + this.tags(['cloud_security_posture_graph_viz']); + + before(async () => { + await esArchiver.load( + 'x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit' + ); + + await waitForPluginInitialized({ retry, supertest, logger }); + + // Setting the timerange to fit the data and open the flyout for a specific alert + await networkEventsPage.navigateToNetworkEventsPage( + `${networkEventsPage.getAbsoluteTimerangeFilter( + '2024-09-01T00:00:00.000Z', + '2024-09-02T00:00:00.000Z' + )}&${networkEventsPage.getFlyoutFilter('1')}` + ); + + await networkEventsPage.waitForListToHaveEvents(); + + await networkEventsPage.flyout.expandVisualizations(); + }); + + after(async () => { + await esArchiver.unload( + 'x-pack/test/cloud_security_posture_functional/es_archives/logs_gcp_audit' + ); + }); + + it('expanded flyout - filter by node', async () => { + await networkEventsPage.flyout.assertGraphPreviewVisible(); + await networkEventsPage.flyout.assertGraphNodesNumber(3); + + await expandedFlyout.expandGraph(); + await expandedFlyout.waitGraphIsLoaded(); + await expandedFlyout.assertGraphNodesNumber(3); + + // Show actions by entity + await expandedFlyout.showActionsByEntity('admin@example.com'); + await expandedFlyout.expectFilterTextEquals(0, 'actor.entity.id: admin@example.com'); + await expandedFlyout.expectFilterPreviewEquals(0, 'actor.entity.id: admin@example.com'); + + // Show actions on entity + await expandedFlyout.showActionsOnEntity('admin@example.com'); + await expandedFlyout.expectFilterTextEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com' + ); + await expandedFlyout.expectFilterPreviewEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com' + ); + + // Explore related entities + await expandedFlyout.exploreRelatedEntities('admin@example.com'); + await expandedFlyout.expectFilterTextEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com OR related.entity: admin@example.com' + ); + await expandedFlyout.expectFilterPreviewEquals( + 0, + 'actor.entity.id: admin@example.com OR target.entity.id: admin@example.com OR related.entity: admin@example.com' + ); + + // Clear filters + await expandedFlyout.clearAllFilters(); + + // Add custom filter + await expandedFlyout.addFilter({ + field: 'actor.entity.id', + operation: 'is', + value: 'admin2@example.com', + }); + await pageObjects.header.waitUntilLoadingHasFinished(); + await expandedFlyout.assertGraphNodesNumber(5); + }); + }); +} diff --git a/x-pack/test/cloud_security_posture_functional/pages/index.ts b/x-pack/test/cloud_security_posture_functional/pages/index.ts index 0114b6a8ce4d..67c06d979002 100644 --- a/x-pack/test/cloud_security_posture_functional/pages/index.ts +++ b/x-pack/test/cloud_security_posture_functional/pages/index.ts @@ -37,5 +37,6 @@ export default function ({ getPageObjects, loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./vulnerabilities_grouping')); loadTestFile(require.resolve('./benchmark')); loadTestFile(require.resolve('./alerts_flyout')); + loadTestFile(require.resolve('./events_flyout')); }); } diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/elasticsearch/ml_model/test/default.json b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/elasticsearch/ml_model/test/default.json index ce77f56845a5..2e59da56a81d 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/elasticsearch/ml_model/test/default.json +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.1.0/elasticsearch/ml_model/test/default.json @@ -1,6 +1,6 @@ { "model_id": "default", - "estimated_heap_memory_usage_bytes": 365968, + "model_size_bytes": 365968, "description": "for api test", "compressed_definition": "H4sIAAAAAAAA/9S9W5Mc15Gl+1dkeJgndtq+xL6E3goXApAAAgcFEmSPjdHQZJGCDQVqQLB7aG3672d9nlm4VEYscGSaPna6ZZSYkRUZsbdvvy5f/p+3/vbm6m9vfv7u6pdffn7zy60//vf/vPXDm6v/9evV6+9++1b/+Pn7V69/vPVHffrq6qfvb/3x1p2Xb968unpz67NbP1y9fPvrm6tvX7/869X7C9+++3O+8u5Wf335N+7y51f/9vL1yz9cvHrz06vXV/q9dCh1HcvodUl9XVLq7bNbj37+8Ze3L3/5C9/7j5e/Hb/Wak9z5Qtr7Yu+de/yX3R9+9qfrt7e1uNt/uXf//73z/7z1tuXb368evvtX69evv7Ee35/9cPLX396++2/v/zp1ytumMscbUlltlp77uvuUhx/g5/Qba5/8LgQHz5gLi2NJa1dt1xaWZcP323j4tbybHxtY61zXdM6xrJoRdZUrtfC7/jdq1/e6iZ/+/nN24d3z/f9o8t+97958oKnSLn3seQxWhtLmzVrwx7eeX68lEvvLOuUUORZdeny4ou4lNpsc1mXmceipW/1s1vPLo9/lYo2ufRR6tAXah+f3brz/PJ4w5r6XJeV1+6jlvnZredfpRzXShr1w9vqzx7ce3S8o1aolTLaWFet2dSl21/cO17S0n10V93y6Vf3j782U+m5jqm/aovEjQf5cu8ZHz5/fHqzJY255NrXdXY9yWe37j56cLyUa8va1bqUZe29pKLnf5KPz6+HWLSXy1LWtdQqQbx7/fjna3X5p9NzzNbLklvT/o/ZkJQHX9w9Pf1aJBzL0Ju1wnt9+fDJ8coyR269Dm1cL7PoKZ49Pj1FWlJrc+akv516fv3Ug4vT/XSwx5rron2uM+kBv3h22metRSl5lKzX0hlCBC7unu7XdFT1VlqnOUfVAz6+/GZvDS/vfr536elFqqdrI9W1aMu0Y7XoeT+7dfHsKFWlLlq5sRat/ZIXZFFvVk5CkNsiGc36m7XkzHY+vPPFzlvf+9d7e3e88829+3tP+dWznE67mVdJjoStaLNb1vLfvp/21vjei2e7z/jVvdSOj6InaWVqgSWLa9alRw9PIncuw48enO44c85DoiYBHuvQVj9+eNrqrdP5zbNdifvqKDwl96rnapKrdWlr0Ya+uDhqgjIl9lM7UyXBOjVaj8/vPDk94ZqXOnRTPUYrLONXD+/trdTdF3dOh/Ncei4f3dk9S08fPNrbmPuPnx4v9Zr0KLNoEecinaB9efSVuePnu0J3/1oMdL60fpKRooPVE7rgWpVt7Mztzx/uvtzXD49H46OfyieFdbH7JN+8OD5JnVWStdSk904LW3Pn7q6oPrj8avcZJSOnQzN6zzlNvdUykzSATv3XD25/eTob2vBey5CUYEH1h39++PXeMj/74smujN/98vaeon7+5eWuSD5/tLtxXz96fC15esRR3jkmcie+uL2n0P712VFRL2suWUs2xqhjaAMkyc8udh//9pPTOdywGLefXEvJuSI86fes15YCX/X/uppYxztPH+z+2hf3n+y+9u37z3aF68nlo10j+uWjvW17eu/P+792rT43rt15Z6FuKqBvvtx97duPTo8vU6I3aLnJhmbtnJ7j4UkNblivR8+/2LOGl9/c3VGej7+8c7rfUvTSWul1leZa9Bh/+nz/nZ89vLMnj19cnBS8hKePrnMolSZriEZ7/mJ3Xx7febgrPd988697G/Pg9GZZUiofNun5Fp2eUDEv9lXMw5N7sPVulxdf7WmL219+vi9Yzz7fv+XnT3bV1uW9i72lvH95rSzOFMKdR/f2he7pvt69++WzXdV098sdw3zn5ApuKsl7j3df7fZFKvsb/uf9N3h87R+fHZtH91/sKLRHF5e797t/vSIb1+5+fa11z5XMnevnON+Apw++3nXS7n69ryQfPN5dkfv33rlG56v16OHek1zeebQvXBf7onD5+e3dv7tzkcbuIXhyuXvPRxdf73sRD5/vvd3zp/tm/c79L/aF7/LprtK4eHjn8d7BuvdsXzU8fnixe8+7l493n+X2kzR3b/r0xf4p+dPFvv24/+4Ft9bzYv9h7j7aX7Tbl7vPeXHtTGxt0td7135f+uFm0L2RhJCD1bNCv5YmYf0nAnOTizg9q7yXtfW+xMMmPfW7N9y4clqXjSun1dy4ctqDjSunndu4ctrvrbsdpWTrCU7CtXHpJJNbL7T7cCf531qe06nZut3uG52O6MaV08HeXLnnO1dOOmRzFfZ26FpfbVw6qbmtKxd7j3BSqVuL8Ghv5a6199ZzP9hb05Op2LryYO/KnV35OZmyrYd7ur/ae2t6MrVbi7D7BCejvrUGJ19g64/u7S3PyfHYuHJyVrYW4ejhbN1tdxFO3tTmMX6yJyP39kT75O1tXDn5iFvL8+XelZM7unHl5MRu3e3FnpSe/OWNKycne2t/7uzd7eTQb1y5jgK2tu4YO2xpxmPEsfUIX+79zXVos5b24X/6u3hoU/cco6itlXu0Jz2ngG1Lev60J4un0HDrEe7tverz3d85ha5bv3N/76lPYfLmaXiwex53f+fJ3nk8Bf8bV04pg40rpzxDzvJS5JvVnNfSe36Xm9j4k+uExpYg7Br2U/JkU1fs/dApT7Nx5ZTc2Xq465TQaMvIXTG7PH/9S3ufSto6kZd75/uUttqSxWOqi9iIj+YslQLJ8i5BtvV0x6xaznKFS1OsXFuvJb/PxW1pmMs9jXlK+20arl0d92jvTU95yc277e3qKQW6tasv9q6csq0lzbUpiqpzprb2dX2Xot34m1NeNy+py/d+93/zXTJ4UyntncfrvPOWvX2w90enDPfWC12nxc/V3ymbvqktdnXzdeY+9yWPNSddkEeuc/k+4b/lTh7LBLnVufT3/3xXWdg6X493D8SpjFGqgoH1/T+X99WPrRW/uyd1p0LLlnRf7NnCU0ln63ce7J2v6+LRxqVTyWnr8O+a8Mtdo3J3Vz1fV9FuqAWCzFPxbWsVnu96X8/3HuHprl92qihuver+Y3+1K4+nkufWcu+qpstd7/RUkd1SqE+2HZnfW0x+oTj1L1sQgg8u+kLynZ+uXh6r48tapyL9ssp8pNmknJ69fPV659Ldl399+aMe6A8vXr3+fuc7d376+dfvf9u5+ODq5b//9ofPf/5x5/rzv/z6+vurN3/4b3949OrHv7x9HS+/faeXr37auXT56+vX2w/w+1MH75f4PHEwimxtH21tJVN2tttg0gbvn7PMpfZSS6sjkwH64PXOL+2t0cZNPlrt8+sfbNX5xfO9Pv/OO1HZuve1hN289nuk/POfeLW7Vz+9/O35b3+7Opf0G1/w0v7Fz3+Ib/I4XSpKJkPPUpfRqdc9evn2CpDHd29e/vDWffGLi0t3+bTj779yo8jasJMnZMsHX/oYQbEgv1ff/frm1dvfPviSNMWsWsJZyiJ/6nfmwM5X8VyY89LBsYBa6EvAXj6x0k6gzx4816GnXRPZRJ2UurEA+eP/K21jJXXcylhTXylALXm2G5uRy7rqmCetd13SDC9me1c3vvmhdJxd/v3C+vzVX68e/Pzrhlb++LoX1TwOrcsRyutouecldn8rP1oPTb6Szpaed1lmz7vfzFnbkArIGH139v0v6rfbqPLAgNDoT8b+V+Ux6ZeXXKv8P0rgu19tBxAK2jPKvX1d9n+/LAfpiNqp5yf5EmP/prkcJFL6KI+0lDHM25eDTgx1yNlr1W3r/lfrQcvT9F0dt0X/wzzqYZVoUx5ZJJf6j7nrIVUq2yNRCi3D3bXKFZ46iG2tUgdpf/1LPoyWZp9Nby9hMZtaDz21pWphx8z6ut9/hZIyl00Gc2Tz+/OgtdRGTX2pt7QvprontQ0FfyBUpAj2vzoOWqLSZ0m5EaOvTqKBOs4p7ZKkMboV1C6vdOqTLh9r7BdN8oEKSWnaLYoxVlDKQSs0OgLYqz4zj3rQj5eqt09LH4oD9x+gE4SgjaXost5r/6alHbSZrfS+KqbWfrmVksmoUepoSad7f6W6vqnnY5sUfMoWuAct4eg3LVVqeTXndNFBITyTCzZS6u6c6PTrnZZF/6QqnPe/uh5W6smxA3qSaja1HLosNeBOnWy91v77r4chI6XjxH4qAvTKrylg1cEDb7g2I/5I1bqMCkZLZ9qJH6hY8HxSlqPNvn9O50GxFoGyvtdBAhndKwGR2qO2nnI3qkcPKv2UZ9XZbxLCdX/1J6AnSZW8lizNNvalbyFIl4PTgWf2ar6ZZHnWLoGSmyRtttT9JV11onIj4JTL0pK5KcdU9rFo8alhFnPTflhaX3RlTP2XDre7qY6nFMqQS6edHfvnRKoX30+CIsunk9X3v7rKmlO1l0ZLgTEwdl9adC766rIC4nl30/PSK2qyS5WA0h3cybxVP2iDSpdNlZelS26lMNEB7plSveb1dUwHkCAZiqaHc2qiyfJnNn6V5pluU6X6FElI95e86M3MTRM2WgG2Qg7gTMs0xxTVK9PTlx7V97a7puthSodLrKnRD2d4pc72d0ZWCb9hAhvsSJyTtwo2Lp3A8uYIpwPasOnf5erIjpqbopZAoUp/yzWRF+ckQxosKTJJgHKL20U5JUP6Ez9Hxmk4t0BvNQO4Ccw3ZbcA6bDIGkrQtYsTHeG8kkBg62CsiwTK+RpFni5fU+izyjrv71U/dP14rmHFe5tG3ywSjilfp6FDdZydwGXt0NS5GDpIqRnkUpdqSARoEhh5JYuxS+1AGUD6Rv7zKv08jBjLzMjbkVgBxFvdSjX6ShR3JaI4IygSv6qtl5ptiiqNClsPZHqBzqHwR93f+ykvd53AXPVfSzYugZRNOI/yhhS+VRO6lMNUlLk2Cb10vrbVetnxtULuSHG6sd7zkAfuuHTtwjI752XReZef0YuskgyEkyd9LAsrV1cyWN3r1wOARGkS6cXoDnFSQtC/ajmbTKNzCvBzADc3OSbY0WJVqEQZxLl0CifAWSUMomQlt06GxJ3nrF+OApKExciJ3AdKADI0knu0z/5OKciU77j2MmVq5L3uv70OnpSZDKi+z0uZ3U/I6SLB0znNxQWu9WDUskSDWIm6pMKQbhw7KeWxEFBL1WuBmrlpxL9tNO23FF1zFkROwCRTJb1Y2bP939fHYKbk0eaO52L11zrkgKFDZJ4Ug5pvyv1dCVWTLlQrbDq7uCnyUxUqTGOUdNM04nby/uWCurdfSg2PThGFvj6dvGXw/oClI6+RXFStz6W7WfwVu2wcxiInTHsq905PIsVsYpB60L3mXIiDSqf065SoDkWVAk3yOFYjxxJjHTe9mlywpXBGnAGd+hb9Ux2goHl/hYvywxTRSj/V2az9UuRZcR5S1EOMU6Df560Su5VlFPdN3cTUrYqUtKq4bfurr3BBx28S1cp+VecUHQgV5TzIVVTAXsxCSd21BUzrZBMIL82a8vjSS5lutFysrZ20vyhgK/Kv5ds6IyLXQWIie6MnKEZQlve66XwZKxueQeZKyet4VLOP5bAuc61N6rhrH13SRbetc50NKRoyyjaUXvQ9+g30FxL6/ReRHPUqQdYzaD2HUU4oEjIIjeZPRR7F6bHOCZK8U/nRibdZD1LIkvdV9kgX99dqOaxHeHWj262Yb0qPyglZptSjLkigPpF1kQgvOkmyctMlKA54NvLamlSfPnV3lc6R35DDcaN51+o8WhMV90vmZCSMez8OERwuchwWHX2jyeW3gJ8g6UALkQu8SOLJKva00qnr0iMJB4f0mDbJxSsSKRlROQxFYTQH2gXoS5b6TNJ3k1jIrOh1iLiBt9Z2r/T8dVylbFOcB44a1lgHI2UbIkptLtpAqhtyL/bXUDGX7I/8M72rYhqTt1LMIVMpG7uQN1zNwnAqOgmehuulYMqLmhYZXIgMzGjOvBbgIyRO8bt1xeViFblLJcinl/RK15hnlbIZhaLFSjrEpk2x6jKEEzssabM5NoIEGQOMq8J/8/tyBZYZLd7y0LUQzmrIBVO8qWhWLlNyL6WgW6suG6yv63BkXzWQFS4Kzyuvb1OM2p+GtkOLOkt4qB00mDwWWdiyL3zzwNGR/tBp00O4ihUZNpxleSItWAqMb6VTRs5sUms18ZGCPllVHqAQoWWjP2RaZYHHoF4j+2odBplMHTzgUsHS4K2nIn6S1omzsv+kqC+ET0GXotSyThN0HRQXFm3Q7IojZZadayvPKhd6ibSndPS5QF5+igJPvRNb6nzQQlWF9yoUxa0TKPdT/roMiAyetLgLuhVUKOinaqk9239QXHB5LLJypUmVVj2tFSoJfOtrKUnbmkzGpxwk0Yo5O33Wq0tGTvmWjUhSkrWSPjeLWnSSso6nHoH2bSdUM8yRjGyPkqXbVf0q2lERRiGb4eRPFiihfOUuy4I7+9W17JQBFYVSNnVhmI69dKQ0f280o7t4QftEeamuVG1NfmaRQ1LJ7pOOX9O+RtGOTvKXNPx0clnOH2m4lwoVM2UrE4Ovh4Y3RKqV4oKxkcTVmVoJ+dPVVut09jBkWVK3uFdHS8hdlo+F7MnTMl/Nh4Qwk5yjadxVgZZDJX2qTZ8QnZiUS14PbDuvVJtiJSf6sB3o6CmwlZY2fnsFf4BdnGRktVz7S6qjTxInE3zqrDjXTVISRkxvVOQmmCKIfBkd0REhOJQK5qbpQMSg0EvKZKXp2DrjNCTT2K7gP5mwbhwiXqFgWICu7X/z2m88bxpcD+GIZXqvnTMPiBeZJNbVKXZCUWUSOGcDpoPVuCJRAKj6mMhnZCeU/UDX3aKdk5FRAGR25QAwaaRRKS3IYd9f6nSgoICqx/bhT5usAMwNo0Uta3XB1ARhL2WkEzwBkZid1u9TZJaSU6CkGMWuFD49dWZ8YRsiNwWT2mWtpo5vLc1FSDqOi04OvadU/txKLYDNBjEXrqtNLct2A51BhXaXr9X2y2OVi7WsiGV3Wl7fhcokHD2FPeZZZeZ5p0WLoFiZirNRycReU6pmyNmrJmyoB5ejhTdFZ1saMJM1tYEKsB6ZCUUpq6l5SAks8r7knuMIZV9FanhzS2QBFU/Y1JpcNfgyFMvJXXVuVac2RrpQak0C6jb8QF2gFBkVMlvNQAHKBNwFvGod4dW63LY+7Y2UYaekYhYA4G6juJ5ZU+OqDwUKOux6yMhEunobWbhGSWzpRNhe3HtoX20/roWrY4G+U5Sofyfid57ayNTFdAU0UHLul0yw4qiFwszKIXUZKdmJXiDrwFlJTttJy3IypJaBDVht1yfhcQX9OM1hbwf40sirtmGzLMejLrMmDzmAKNb5B1Ur9VkU1hB829ij80oUFeSCWq8KpQSpTNFhzvvbJJcmA6mak0yUqz8kIFDk4Va21EXSUl6SYhSX/OnuFO0MZEejYyqR0HByr/OuILbJHpK2sxrZVYYGx3tSswJba2FUiQgr4hwJXHNFHLnaBJtrJylkMgervB2oaBZgYatxtipLiPXV1gypJePs9cOkrip5UDhK6srWxRQ3SLkTQ8oHcOCkGkgfxULU+LqL88aB4KqADNTXxrRrOrWHCbxdmIT9lRr0kMmBJYOw4q5Zu5pQNWANM3GUfYBlUkFYQokkk3seBxjZmgzYUPhUnWPMAkh+ZRJJs7mStdyK4LDrYNq7yzHyoIuizJWyqFxdY2dlkPIaye8wtT7FJwHBBdO3mxSJy7AmyI/IPEPBlh3es0mqUZ45HrYZbQOCe9AVQdla9t54KyPUjfY9kzvVA1vHPniQqvwSqZNPZOmb4ifK4ArduymThFRHNYV0vj536k5PR9paj7BkW8OVlwX+QyKYkBiXO9GpU7QCZIc4zimfjInTCdBeWWyePldARqZLurSaoALdl2Bj08pLA1Xr43QQqZy8YKO0ZrbJyEmpzFhUW79bUzQcVXjTXAGbxKWWlFoAeZPFWBDwKvDByBhXPAeTY230qVE1ICWFvXVrCp4qU5GVsCyuvKCfLhX7HejgxXU6jEOX8A0g/CPDw2S2n9JGBxg8C+raucPygnHJ5Yri7LpFLbmTOFOwuqCnzVsBnE6EKtIoABnMolYdTgU+EOrCrmZuuoZ2DCAnND7GG9eqJlI9We/WRnKHD1RhDpR/DQPkrPQAggUtoVbUYtrk3svJJvVA3t6Y3iLVByq6pFWax+xTc/4LRZIEEJVajsd2UHvCd5DGpV3LG3D56A0OLSnSYrLfNYCZUkuyovhtHgYv3y/BbdVHNb4yYkmGXCuoIzdckX2lX0EqoQWYbhgVAq4GaQQHDpTJPiesk2NyQylHXw3WWQdX26ucBx1Rt0/U7Gm/IazJLgMKhBFwMxXZTABq7bdiFIm6vHVKEM59AWi50i4yg7LPLUDiawp6A43gHrUfdHjllC3ynHXefb+AdGLCNFXJltOLZZLmqkASqMo7Q6t7ao1axzdKRvZ3yXGpnsn7oIIFxNNlm5cDzpwCnpU8ezb1owqSe4LpJbuTHZJeZ1J3TKSLZlDVuhUkd6//QHYMcNc5Cw0wXgevOW0Xz7E3pUP1Ry+F+33dVf6vDKYkQ2JhOk4K2LBOq13HuzFlTlCD8uhDCeY4cM7/zgonKmD2xio4JSxHkdB4kWdBZsbddOCkSTASxthZK4rgcuoWKcTxibymjJncCT0pvWm+L1C2WvpLBghPyKkPwLLUBFuwtTk/lcYdEt8LC/YuK79REJUBpJNUXiLFq2bc5AEqUwKtTSLd7gAGSX5yxpduZG6mzd3I8lEOptWLpLHJHErJySLo2ppIc1n1ncDfSk4pHcoFNr/fyCBgPyT4rswln7om+PEgK8gW/07mauAjDqp3iw0T5HWthD9ROTNWVmqWO0rqgUFkG9AC2siQdJJgBQlu9pQCgYyxrLak2vUaFrJ8K/58oc5n0Js6z2lGka2RuTMrWqiA6vUVpCaXkArEhhzKSVtoWlwqVoF3B8omZxUpNYmHgUenY0D2geSReSN6AsktR6fl4oo0g7whncBZCiU5lGfFFlX6zesaEEZXtpezMov2qOFQr65IgECDyKRyxvlzeYcBExFl6BK90y7voKBT7zTpNfsEtEefQUIMsr5Np6FTRIkIHY25q7OQMtCZFIFkKlUiJue2AhjSaZJ7SQ+IcxzJ90ikWgLIaDJ0M9ofejQLwA2w//PXK7OFG6Udp0e/2gR1b51k7YZcAilx4HPmq/Uge9kou0uUpfDcO0TeuWE8qnOTEOGF7uNeKCm7YoqUNys49elEedne++gqlS+yKooykDdtYCUTGRU+SA7sOpGElfstQZdcfsLFiBkAKNni2mIoM5LKX6OnG//JrVQhyUWZFQy6jYiluCbuMfNjhqvI6QGkanD6UWM9mQeYpEQq5SEtqT51zT4G0ixfCb0mq06txTorZAAHdlDnJVtNKO1acRDhxZJ6tzmgTplDR5sgyuJEE+iZwNLOAS7Dut90JQNOoOHVJpWlU8ZAv622hR/skFyJSmcynBPVeL/RHQrPAAK/vO8r23TAZpMebDJqFQop226PUMimUUdZHBiS5iI2SkoBRLPL/8u46LQvsld0DFGwt+EPfengSDIlPHs4VzK1idAw4QRbd0WqKTgMMgK9f9cixy7LWyBXHkVwi6iXoICqaIAsm4ULUELCsW/kit2JL4cA2C3AQNbpmvuA7pKiDkioxMVF8JNWbr0RCL7pMXEwM0T7DDTnJls52dXWFQAQ/piSllwb3QuQDDtQDcwORBguQwBbmjspBSxyKgvNlwGqMb9O9o3eXxCGi0tIyf+XPOP9S/qm66JeMCEI6oAWxvjU8wCsOzFaB64Xi+4l3u3oZaoODgmxHBAksCSrxHn4jihOfCZKnbna5HujUXqFQAW/0t+U3DuhZ1nKB4iiDdWDXwPuqbJXPZtsggRPmmwQU9Df5zKqOs207MlvUfwnFWEFSl+j9RoOj+p7NXFvKqwoNThU3Lkb+giIkhx2kPBWnwIzLPQ/6r2MMukH0J2h0bv8LaMiSF2tiXVlegho2/1nTaHPg5AH13p1mLwlnnV0VG+Vvdp3ClcFKxVIW5KfKam2kED9z0mnI+0Iw+kocJZ07s0U8ykcgQm5l1XqMTM+wm5WxfTDspEJgIsDjpNmDdwm/XaSFQeUk58tnyxyreusJlUv2w+kKybxjMWmeYFUkTPUItAkZEIQRWCAoaXTJFQ4x06rHFPRaw3fy5+q33kAaNcl9iUpK1fO2D3qVIgz7ZsQfpg0zUrHBoSgqMHmsLvzIKt8pMSpQXnnRIouXN0O7lKFG9YnLoluckISfcGkiVYYDbRREn6SpCbJHJUDCd5AAukH8DDXlSptHJQPyEa2w6cCEnf0SveAgcRIqUpVFWpVsL6aBITUDzGO7rtS/HbCL9NLFwiZsiIDYBJaRNX0OQMolamapmkE7iwpKZ190AQtmaXC/K0AcgYt7a4YVA9w3BSMOaxgtmGpw1OtgL7TE9pdpkhuF22usnyc6U/08dFuR8K5RXOP8yjAnciPUgwpa2UbXBRDKGokgJZ1ew+8ODe/BeAYVl/+AixWluoHZB/4CMVeLpZaAQk3sDwjk9F1/WrQ63SKIMDmfJNto6CaM7iL7JJPwTMEaSDRmRxUF3Vx4GBcxFfLFkelvQcLN4DSmAwllDSd/vZJ3jUZ/xQkPj0w2hDE3jn80ruK3+htp7nEEexBZSMV2eQmVUrE7q6wDKEmlxEUA5/gIwJaSOJCO+/YuMC46TFp4aUWZ9SJ9r4Dy2iDOHY1ilfRwWwMg8X0yqrsSwmV3UHxrEDi6VoWdM8K4qITQCk0dw4ifXfQ0uh5ae8wb7Qy5jEFMmV1PdElxxg3XGl6/KszUOshcg309S1S/K4DaDkQFy1Ee7XjSrm7ykAcP0/dAQkaZFwrXZL09zv4tRaKdjKp0pEnkaTlgahADYa0Y50ObLXS/jX0caZkno0lkc6VI5/AQ67M3rRIbbqHe4xuxElzXfhgOqNZaIl6kzv4VOMKjUBJytz2VCUo2KjLSvsl45ut8s2k9oY8FJB2Buo2DnRI0vu7hmB7uGyn45Wqdl2awQpIm4AFhcKmT39G9VV4vQBkNjA0RutqpeQ9AiqvXQvlQCzBIZW0o4XeNqd32iEoCLXyOky0KtqAl5aqSmNTKxZupGOaJtG5zv70CdMkdRa1jBJOrLPOKfxIGkUDWeAcCU4fjK4A20HH2qxQI8lZSzCWrpYyUocuQ9lCG6CrYWpX50pyv9ArtzjnPACsco0ztcEGm5n7KuRZHL4FDgzHL5cruAoGD0tbOVzchO9Hjwm5pyu0kxWSNiXTzOBLU/DqByYkJugL9G0HNTxSC8LBM+OmJtwnJdzpEaGxkBjWOQiYxhJabUmW8kjLdKyp8JzJ5S5xTzh8k2lr05Rq2iHpaOYVUm0a6i14ABlRBB/Tjz39LhihQoc+FEQmK9ZBKTVCDZr6prH5hRxrGsH+qSjKmQg5241m2hHUAMtiLPTA56hAztIq/9AVI+gQBDrA2FVubhafXookvQ/QeF1MWEKpRB4fDR3InkmHDzAeNZInEkKHXdWpwy9TELEe6Z/dg7ZIsK4j2mlclxnaFBWp4Il42yleNEShJIwLWR3N4H68EhZhobQ7kvccQPTjM0CdNVw7PPTxDB+SuyjbSc3eSCW4PQpPNTr79l+20rfVCP6pUygWdUEQbCG0DkPwViz4JcDEpL2DU8c694rlqXtpt6sB6VDmZXq1zIZ8geQBHTU4YSeM1Itrsp2HAakepdYWxNA2o5igHZTwQtLjbKFeaekpAPcAIVzVjzo9nQfwlg8TVeqYFVgK5QpK23TXdXFEY64ApOQHVftVqBDoWdO3Kb4ZjCfswRR65QgfHU2X0qmAFJZwshQ62twn4T9ZNWh8anIGViG9tGG0Yi2L6drXN8n6rytWzjWtwSwiweuk3SCQtqSwTGKgFb7T/NGNQI9DjLueIBJAczmMtIJfGOO7/lNWxy2RaeZlwHtndoiT/RREuwzHLkw/8DtKuhmWSMqzDvsSLNMzaklQ85r2HCq5dMHT+k0YbtHcC4kcGqnpDjPw2n6AZFmBSNz6E4zAMrANJ4RozBFz0bHZcCth4Fgk/FZMK1QVGegftHmfaA+C2rBBmdMswUKiSgMWRQIAaY/Fg2gtySnMoIU3yQqJH1mFCmncsjgWHIVsrYKOqmT9nTGJsQmQBI/AKRVjOkHep+gMWePXLVeULIPUs7ZKcio1bAP23Ci7w+HlZ1bIqY9OskTfrOMAmuBGKoAheBtcabzBLCK/Mg+oI1zZES563koXITKzKdIVUWJqQ2WYkwsswr0YENJRpvSF+UElixCUoRnOFVuhSJFDtIAgsIU0Np6ucsrj7pDgNMnq0RMYA0ZcsiAvvBMpGB1qS9sNOq/DWAm5h/t5OddHrswEabujdWEOACMldEQp+nsAA2UxqSfdGvSlR5EuK5kHOR1YNNubRZs04KYePNbO7JPvlF9fKL14OYHpGjFpkDuaoHoeYhbOAjHyUs02LYeFPmkyOjp7xfiQVMbkvEZLBa6kC6n1XdL9GMfo13eB3QCPG7SWsOc5Bhgpx4ZmZmRDsy5PpStTXl9GRuikc486SVRINS0DwIuBcByOviF08KCjba8hdHdUEBUMORirVMQoZJ8gFGvGkLCi0D3joMmbtA4vaAu+NhOtSo78qpRj80QPZtdsSXWm5IROA5oX3n9ziz+807SbqKNScHayl+U8DIINhbbFRE8LjYYKfRU60UHqAuCF1gXg0E0PTL+Mi5XlFowFglE5fe85IjZgITxqilZPyWqzEEy6bDO0NAto1W4n5UyYmle9O5gHi8s9EvLDWyPXyFY8QjOT8loTXqf5deBwMrcg0WghNpYE9AxTcsh/uMpUgnpJIeaKHi1QBZubFgjUMsW2RefJjnSJfDfFM+gMLZWczgeNT1EWdIyxFDqhG5S9aQw5sGwSKUH8QDu2DqF1ISVPdIbB5VgcIETGWe4w5FA0CFqUFRyfBbo1kt8uPb1Q5pWbS0KA9h4XE9HfGnDqo2/mXkknA/QAv93dkKDBuLaSYjsjWeYWn6QJJEvQPrteGBLZGFz6bBkFYeLMyUgROmtyhhLfqdJJ5gnIBolXT0ALNwmAJWqNTp70+YoinQzTmXbu0BGHmpu8csi5XINLUfgGNdqAtYDtMm8PB1Lw0sGg4+nhoEUPzmmyyc4xAQMAFHCAsRwesApmg5yRvANCMyN95L+0AMzyWlyCiRaT2mJaB+RnDjRGwlXSUWI4sqOW6FB2gSGHSE1y7YIsOoYYmTA5zyYZMg9aeUiwZjQhmr4+WOQg2oZplpSUu6cWnRaGSvtyNzTNcNNDmCbHnWKH8aBwNOVgk5dfANc5sDRdleBrGjjoxcgoPY1U+dqERijbm3LuF/gcWvQnmxBzJXSSmWUALlBM8/MVsBTsOMwR774zZA0KRbLOzDu0hoSiDKAN8N8GBpQOlKwpngbxt0Fh0agJAAyqp5aTbY2IgcnrgPucwR0+uVegblVcROnerD6j2YIOGLw+44zMk2orCYmoS/T3dd6t/Hdj1sE66djSqbJdEpK9RP0IuJKddkbXqSxDpyUc7maXhYT9DpLRxn87npbgz6TGu0LdW8yarvDOL8CFCh3x/pQMMIhjQrcI0bIXPgDQjNSBMsFqM8LB1qJLodvhVGSi5ELmYCTQI1uPhyqHhFnvpQexBJDkAhisxLg9+foO2giqlwzrEigLJ9SlMoBHoSu8Ts2BcTBRNPAr4CQV5Jx4UNgMP1povUnGiWXWqPTkglOcbZs2zn6DaIA5glTcXEBeYe2GwhTAvOnX65GJghQNb3tauHzk1+DdrNARu2FdkO/Q/aEgnwZ0F+wg/4OxpAtjbB2jFxCfHBEZE1SyL+LhlxYqnY0ss6f9p5Of/wxKs6fzt0FvH03dlVF3sP80R59QQles0F61cL2NM6MFYNgiiAAgs9aRjrOU6HWDwHFf/0VUrp0CNsAUJMsowOQSpuIEvNaeFBkTKGnpQVkpWjjrp1VSjEnJcEQOxZkKuo6o99Ph4OArZI8UmdQMCFZK0LIXktuEAFWCrQ20SZljhxYuZWmWKWwNphXYj8CluX7LGGEyFGyCClKA5uxfgncUj77TguSSCDEYBk1BvwJU0+auzPyD7SWmn3iiBji6Bnj9khylBSOr6JamPF1pBjEIihyc7FMBNHUoj5hdud8iHyT6MIysMmyHIRmA6+GbdKZCagqaa4Je4G7Wo4T9Avz5ZLSdH+2WoqeI0LM7AwwDQo7YhAlb5udTtHWABlwGlE3mqDLwk8l/OGCAOJz6gZ8Jm4oPQLeGyV6SZZMvG5SkqyPFJnVNNxu03PBFWPMPQAANvBB0mZhbFhU3YcIz2qsLZcEDjqiBp2O/glso8jIMe4WU3fp0TKIOYD1m8hP9hPCzBJ8jBtgZStDy9Org1WbYwZ3yAebRmZueKW5atoQWU2HlhDFgw2SEcan7sS29kh31fapYuhotnc0hfOn95czpOMlXdoyWGMoVxioojeWFuZQw3ZYTJGRMrzL0G+AqPphfZjMeZEUyxHNLdXxEgfXJ0FHJsKVibjoBhFHX64manb9nwASw1HQK+QGMRIcdnm65Fa5ukCNxryNNmOAHTpFGGHDxUxWxlZiYLzGYiU5l1bmy0p+D0AvZGybhgCkh5KK0CD+kM2UMrqdNqdHQnY3XD+lOIcklvdPw/9zaI2/yDyewNY9UoLR0pKJqw1UtRkxRgk0mD0apusQ1nib/Lu1MmcEdZSh7c0AKplPPcM4nZn7CU7c64whob4HZjc9HdpyDjTZ6eTBH1l5HD08vFTM48E47yEn7+4TvwQ7iZ7Yxh68d+bqZ7WiTGA5Bgzmm3sVM9cQ4Mhu6F2YvZlBB01UfFDlNTEIHbwHTv9vEmKKIc4Wtc5UvUrsSXWaKx9ctf4qcJikvea3ytk0ekBkH0b1EeAErlZMi8H00WyxM03Akk3onSRyNU4xDtiFW0LgHNx5gYtfGQNMe02mAnCfrCjM1l/gCpKh7ec4aoHAtU0KCXZlEDjiA+6wlGi4BLs29MgEaCgzFoo53BTBtZywMc4n0EE4lMt5BqynLCdTDpiyCVzgagtPqktr6vBPTEN8WO16aQWuMsQRlhFRbhRyCDNkjPpbzbsO+F3KVfNH1TYaY4IdhEBWKOTQrtKGpMOMClJ2xHSByKowNLSp/droGcLDgHyG596lBIPIsgHtkonsTsrcDvIwVGlySoM54EQgwmhRikWi2c73QTBkokbCmPcjnF3OMFpGVywzUsa+VGIfHCDWa0h2CiJoa0EUqb8z/9BxBg/Hu2tzOQAPrkigGDHmF5tVZ5TVm2eBj0Ua1WibJkfQZQxipP1mCW9jaMnRGpDedg93g4WAoBuT81icIJmbwCeQWUWq+8M0sWdI0UqrDhbcgWaDnp0kixrruf5VWS6Yog+aADdDFgnLHSAtRggFOY3UqJDBUjGBUcpAbnJdSqdLB8WMbt6GKpttD95wOxATcqilYprt6mQ72r59HUTBprzHPdhhMJGgCgBEwVE0HesDTGiVO86AGYzvTGj4mlofD6oSPuEpaPSjAmbfnqYgXgLYxyc9TARCygzdTdENvmgvuqQL0Sc5Ut3ZT4SaVXFleQMm2N6dA8EGDQmOcr1SKazaMzacMBxu2Cxml0yvNDmBeaAdw4QhNMbS70djga1CYfirVJAuH8fqWQ+GUylQ0imaurNdncJVzFdfdwrZ13DrJIlnp1ZsJJjssR5ok+dnF5FYUOihmYZowyaLpyWoha+k5RqMVB/eavFYiWdFpy7NECGvQwkn7T3tLPafM+YTEF3/GoGHlTaQUgIc6ZPfdtDEUL0Oo8Gh60OG4r5IsLHRiKNKzbb4BiKV7mUIpUxucnBIEA42B3sIRMS4HZglEmyGBlmcqRjcOaGAb0HXnIAOQIL6cFXNqpI88HXAXGKQZI+ooI4hWg1Z5WVyEq3eSG89cQsYNusa08HsGLx7NZo4CdZCsZBr8Woqsr0kqL4c6SNZU2q2mq7+sB9Bw8JBWWLD8lE/YAuhtL0BUbPZ3IYDIoCepwbkzkkrIfZ40ZjokS0wAZp5G/URj0XoAcBK0AUGL6LriQCLi88nogJVwZ4TgoEpGg1TWNQVyV2CTzJBvjviNc0c9ZaWayGiDTzhHWqeC00320UUnK6TtPQi7mkNa9gMTFhktiBPZjcddDkPvzvgHALYOachscDDjjXmILTXXVyTZq1CEw5YKQMmyh+YYlQ2WZl2bR3xBs05rIqBM50boEzyDSq5KMbIfsllKNOHIODb386us80L7wWDEmStSLLLOsI5LWIBTeVQirdK/Z+B6Jgk31hiOVIvr6INNO7gEIUAZjnc7DBlT9zqlh+rn4wQRKlBPMoAGY4wdZ/AJqzoplnq4XcF7qjHF3pKEQU/TgyujOYdngbiVxpsYjrNYGQWSxAzATAbpE9O4jpxv0djuks8LeNgWjkQCZ+3yUcyGlA3FOaQZwhk8vGyKjXKlVjdGinPHt0rMVXeuARMrgm8cJgpZPI8fTNAlNMA5WixzmpnZ2uE9A3ewunnVeikiZyZAgOJzbEq00tKlF7hUP1SehHopUPSsMQXZYjKJiYjcmEDuqhkL+ecJgz9tn9PmGLNisobWUwwHNNBpU6DDM+a5r0GGYN24oGaVxZs4CNY+0zEeVJLyuY3eH4x1h6cFetzlPZniJsCegQvgsig+JYuMJMUKix2NLXYUX0adwSYmTwLOXZeP1ZmH7xKObLIyTv6Zd7UEhrQkN5tNYRnUCkzUXD6ZFItZQ8FSiGKz7AqDXFAhJpYCNns6Di1Gy3RYnhcn/7CpD45oUPNmx22iWLvQrtJJXTRMlUv0rNIpMMkyNDW7/GWS4a0QykMElF2mB36HshA+ZJombAEEJmpKRFqu1U7Skj3BSAWEAefc2bOUGOMHNHVOy5U0ItFNVAQy3KG3SR4yQgIondyU1eQv5J+CDIFqt4aPYl5fVg+uXyYUQtXnXNkKpdhgqKnWrBtNTVJWMTwDH+ksdfB5mLH19toC4sjqt6pBGU4vv55gmkRTgVWKhp3YsMUxXCSchMK0eqY4FhfGkZXnMUl1owls25C8CEbOpUFDffdhhyw1xZgJ4tE1n0c9G+LJSv+/7IVbgYr8AaaNSXKOiiUxTSsoAikXLyYztLIDjNBOaEuHegHzA5GBPkuYFudVwD3EdHvS/aur0S/6fMGcBElwMT/fwR00GKMK4+CN64lNizl6jUp1dxGaVAUUaEyzXmGXsUO/CSC1AJO2NccrBuKKcddRofeJ1hR5Y5k9xXwtuyminWAiy1cIiIzLCtKv2JsCv5VBzNn1SVccReBmMfRtGBQh/ZrQr0UihxjZrJPislmhsFeY7mqh7QDJOMmzHNljF0nKOarB2gPld/Nj3Qbt18yml8VspvoO+x6xYYzomI6BCh6elWpogm98OlY3iIwZu8Fgt+z6amHKiobqDltXs/ScxDIExywC6Ub39gvMzJEfKPQCm30KoOEkJQv0xEEPgkoADiaaYB2EtMhLoduf1u+yNDfEXqp/YcQwMwSYzuVqvMeaYeEsy7Mz8WE+BPEcg6KjFdXSfwEfWqjyyVFzlVNG3Xa6SqOv3bIb0QiZGQobKQ/HmNSOE38UdaZoAvXl6CWG7fSo2rnh6wpnJsR/kRFvpsBP4FfWSCQBUrKOX+RPyE0VJlkm1znWAJvK3DD4fUxHrhQYcoZqY5+A031igC/paOLO5MavS51r/zMksjRcuMivHmLGtNR/5FwsLp4G/awFkDpPBlsC5AundwAGSYtNjjAmMnpyPOUGAj1GJ0hopbryXlBuAO+N0SF9cc1TiiXo/CachsfDduuidIO6nSkeVplmWoQ7iFSiH4sIZhobEFryTQ7ljSWHFwPlw0gEy0CGgtIegcqTQnDbRB8K3GM1TIQlsMY1CHIaequNjgQP3muiaj4AmlrCHQC2M+q1a/1ENxwOLJDQBcp1OzimrDFkKwhnHHIbbhR9KNdU0aQzj5RiZBxB5eHvWK3P4KxMPWDC0+DbkWhRl35U5Kk9sPTlCoqAG6bw5R0eOtgUoxOgxvB6X7aiBDyoLjJv1hwoeoWhCWTI++LwwIqNB914MneAjf00dliM2E9AGDKS5pjC0jhh0eXe1Y9qmmh++scYdoHfZ3MOvcToykHE73OocMINuBLwO7w670DXO2XTYLEz+6pId2mMMYuhKKYUniLpURb6y1O1Det4vYSRMn7BVOHCY/wjHT6gvB4duQBgZWq0lG+16IJ6CF9bbiLVSwt0X0B35Zj3NktxxLsdBOIKjVGGXcBCi+BZGjW6Ahk16r5KLaIA2WMglKkHyplBTwbL4VLsnh5nV8a/NGan242S2FHtGdHk7cwUzROVAE1GoFVnUwhPwvDJ7aB1xLL5Su8o2iTeRbW4sYBrNLkU8DKxAjY4lC8ru1YDPOLXf1JdzzHqww+FqMG3xLCbxXFex0yYddAxXTgDdhQtrFQ0buUgDHGLj37StrKwjLuxWTQEmfUvESbtf1WCkoBMLFhKHVXPqkHnUnQiMWnFLT5dsPJ85CBUF3OsNOOtcruYS4GvtvtNSMwZr0Wn4qBtym4o4wZ7pFqLi3hDR0E/ENwfNt0PWlXBwRLDW5sFwBY6kODtpNBsUPHAECKEkkEBU+uzYjk4KhoTni3l0yHH0KAS/LzsqTf9Cxx7PUhljUAje7TLRfMCNL0WCYF4xjAikBMuLbcc4OPU5wzwcGlJWVMqLRkswOp7cSreZAaoS03iE6luSBkb4xFLdeyBDdLYwNTSNFQtCQR4uiODeRpu98m2KIKiWX+FZdLUuGEuDb4IuEAZYmEdZApsGV58+ECthgR0jctPhdsUxQqp9gg5GNllydYOlEzk9SVyQvDrOm+uAz6ErAR6JM8DQL6BQXmdFI0riYXLHXXmVO3U2EoXILqHLkxX5IwZTFr5eoS/7t8SOhfKMDGFrxkZoa8QfjmaWpkbYxELUjWyoAw27HKRnWsiaQNJuh7bcSzuXGs+AgsAz6I5yzTrUVtfYFns7iw1wPTRVxqIfscpgA9LnCMfTqfKmmZ+Hrg/zDvNf7XCwUxBXJpXIuhw5xDY0e0BV8PaXNOHIh7GgBAYgSqzjZXSo1CrJmao2o4bEl3cjZ1VEL243OmBU6Rob83BbO3bGSrgFpQJuXbT1Q0cgJS9QkTQp65dUaY0MTTmSM3tENrwv5Qg72utRS+6Dc9o110BqkLCYKr8NQjfmTlMUsjlr+jHwoNjMHDtDq6GiYADmRkOdcz36M8tXgFIbz6gu7elW/wNxmlOrJpngMmJt8KNyqXs8xpkNxt3UilCi7Lm0xwO9oYgDN7hBojaWQWA+IDjBj6+gaZCzkD/jv6VLKDRN/JzIIpFgQNjN4YOup/ZE8AHUkcOJtEg7wqqjYlPYFcbGRvQMygWcpN61gNeANAweGEc87PMQgOhAl0pG+NKSqQpE3WFwBub8AawK7RxbbLVrqoA+2vGZ6chjiY3y/IFoSgEiFBK+/wSGMJ1Bc0y5Dt4uhOaVOW16t+dApOTk5G9prCZlkQneMAjmCMvV8j6OA1KLvjyyEVB72j8thZuIwRvMSLNOU49YuXO9I/uOanoDqYXA3Cma7BZga4vC8Ufohs7mW5do1WzM5zQD3FlKHKAyejZK7YNE+5fYPaQ2TfLPCxFQxYCpo2FkqYbZ7WvkRhMVKDgqvRKOnQvfKtrC3qrMuwgSgj+cX5hrFgYJuT2MDO+iKxfTJCxHCCAvJgFFhyRDhHHyM4YVzkjTWAGI0FdvknOuiUajU70sgaIxBJ2MTSWyi0EG59om08HHV/8RKbBSTvb3m25KwAXmVznHHUQAQxPa8FB5YrXIKYLDKWhF7udtmPJuvHJoCdjYJrZmRVwvraa+sIkhnSPVnJe5ReCwnJA+vANgmixwb9vXhcROnIjQNmdjBZi+B9thlpBUDXG/rVwtyazwhQ3o2LsXuM+QHMaQxUt/ijaEqJi5+ZehPxC7Yr5rbbzPwfcNzCyjqR9wAwCqW401DtovGJM0m+VnvFabfGxBZgLWrbFTTQrkHZmwCzQ8tFv4pJLazAcoqnLJ+o6sNfAHwWQ31XTo8UAPt95hPHbKE9htb636m9cKxhqmm7lBdQzs0mdgiHtu0CKgSZ05eyMN0EOkNF7ydHOL9gTmDPB07jhOQyzYzyaXqcAunRYhsHhoA9r6rgZoYsRCvBwQl3ZHJKC7DsVQpmNshI7ePoShcEYVJIrrkzJTJyF3tOldOaeOcZ/HR/GjQW5bnMtsOUwoDZDgeBJGT4YuR3gVwhvY1iWRRGx9DI/DNnJ74fHnhvsfoiRFPQ3yVNyrJkI/kDdMGSmu3WiFQoWOQU4+PvdKZwOiJAZZa1Q1bFkUIm8ju48KOebEWVSt52WOYD5zAm0qUp4b1GhC2wVLq3a4SJsdJcyZ8nx49OuWiO61TL5GV3UiGl9B26YDOCmkylm6BcBJqMkvXuIq8BowuAycSE7RS9a0SAXJJSwqMQYBUz2O9kJ55CmsU3E4EwccE7YSka3xahlW/csLQZXR0Gf/KI1oUG5AdUM+RDH6MF0wMIkLgj2mlPmCXY1mW65lTov2QWmkFYdydVGjH21hQJQ8VXnTw+brC6Xp4wDoWAjQLRWSdDoQQ6oOLWbDsyt1PNBgRU96DYFA/EJaMeFC36ExwqpGezPcvAt5iMTmbH6GWIJa/MkxzI30Nlb94Xh9iUYeGmvqwZLAJ/EGpRh0vy035u1545rYEfpxLWuI6Rm9FXDfeEI6uWaSJfJK0oSu24z6uVAJYXCD0NZutE7oDeZyqJjh312XS46+aw7QIZoL/TsYrjWOM+KfYbDztegS4QhPPqCLAcndSREb4nRrFadLbAF9sSUN8azOBVNlxWDw+GPcg0pDFIImnQQ9vI57E61Upi4yekbniO+hL/ZYEiCDc+uP82nI0Hb1SyMI9OPwwBfYB/kO9z6gyFL8BgxzdOdqQW2asanEK7bYbsUQErMraag5IjoroWq5HXFSrr+0ihorsHdxRCf5HLQ0qiVgbh6OQZd2WQxA4Ehl6s1xgg59PZohMoyEEBpPeghbrXCFD8WR20sRxruU4WkFFeKQ/lThGFq/KRd2g45Zwzj5KSmYacpzGNaCDa4LqViHH5Sp5SqAM8mi02R9KdoAoL5YSaH8ZeeXJiFVPHRpnM78BD6wnYCCWeAso0zdaho3WQ2j3E68ZAyM6M6AzUs69XCfDMCI+oZi0NmLeA95MPkGKBbbQe8XgQDQeWfqWDmmwxiKgsFb/o8LGHhjLGiTA+W4XcpE/D6KaJ2HSsTamJNcM6lyZi8kGx3SSO7uRaYoSGKdToq5gMEVXVz/n6M42bgRzuiYt3OE2EH5b+c6WGSboDRccrA7DMt1X0z8klMkFlJNTtvVxsOlaoirm7jtwq+PjHbPjEs0J66QXIQUhwo1W0NZg1gs84w/qmxzuSARpBJg8dmFJpHL1FBz1Q96XE0ekynKcGMNuCTtzifTg+q4lykzhSytZ0dXnjYvCHUd/eE7hZCOEqOJrUkWarcLEjmpHbdbtIl0gK0TV+NJbIodJ5RqJLHZ8KMgC/gZgTZFp1qLmEVo60ZydJpRDSnU8c8GvlneDuW8COvjS65tQV3nB1YRn4ww/VEtcQiQqADlPsCdaIjsa80VDUJfKYMlB2TbEyClvqKCmo0lto82AojfwE9o/jA5RWZBxIUlym7xaf9JwiM8bSjqdm8FMTdswUlUvIsodBXTwh/FTzZ1l+K/Z30FkWwKGuadxqZlOqk8dv6GQ2aq8JERyh3F4PXH2BSOjWJhXqqAzeSeyb1itsizexGCCyHxvy3GZhBa+1iKgyQ7RkWyvKIQMdHI2vEJHBJuAVYmYKnoBDWGzeYAV3KnA9aeiC8clqiw03DyFt0hKndFJgHgMrCPKAgyoVP1D8TeDTkZHWzEuXmBrgKuKwd+dyYApeYAM8QAeicrXkitbJEpINKtVmzFQZ9GizoAbRhNo1senutVLMneoG+KjixtFraVjsl9Tj2ls4jbK/b0hg7yyRbWlac8wwHZqXleSbLsEdESiMlUgobral/FkYZjxgzQ1Ru83uwbqxzrBFCe3LZman7MBiFPknn6LZEwlTRVQASrTqNtHaQoSnIstNj6A3sMWmkdjc6Cr8sMYeOaa7JlV/Y0AGHyIyZ29bRZZxnpfxzBO+4bWIKXYwqYbSka5WQiSAenxAouQoA4sQ0oJnBDLpGAeZ2wKvGhCemktiW25hDkWgsAAe+/5iKHEAYrsGTbDuz54E+W6bbddhFXeULdCOkeivDGmn9dApqCVaEaH6pzpHI+njJQb8rAwE/utNlDWwf85l1Qly/P3O7IgcDkUbxczNo/KFFFCDm9MjeBLFpoom62eIX02gYhJAH/EHrJwj+0qAEBO5ndeXRTm82jEwrNje7ua+02/8uZaLnnDjujchAq2XLCmswBa9477ZLjHkBU4FQo6zkMlY08BOxaY8WSqVG5wdQHypEemnBhzloBRMQaBWDFYncoXHO5D1Ef4iUWUxEcHpvwL+8xHslN+KhHTKUpiu3pL7gzj7+KA2/MiRIqtPlILCB/cjtKtaR0uGfNEdjxMlEfWL+ph5VnvEqIbSNZ/PITx4cUsOWKjKsx9H1RFuXZYDVMw4MdDu66GahaHdntlvUVcyTBrdih+ylca7cjtKgGtxBK+M4qjN6TKLTxzO4jpJTUvA0M0MbvhtmLVi6gQIL3pj03IakuByglAOwr0mixbU/SPf+XghHZiQFCUMdQTwZl4ZPwVgqi5tAF9nY7KBIC16MyDF1d/7oOyZzAFgfKl4bGB83npYi2LbcQS2wMTI1jhmX9q46exJrmG21VeSjjAQyU3Iu80jA7/BxEsGqiJdBDvAuOXdiQQSkUyBBpa/JwasjgKbnnMytLapqnwr8STHgz1n0DGGvNpUph522DXes5oKTBm4ZXib3Tl1GagaFGsUNZ/sVcigkVrA1AbMajwYzTTO3vA+4xkwQD36LtteGRVXgY2uAJHlgGdT3oUcyqx/wocq4OEabOqoxec9AH+BHiHEZRvqD4SwBOqKw7DZfclrgTQ2mcBNvdjiJZHiYrDSY1WxzGPhzRIeUqh0qDFIqyFpBeoMMtpFpTD4Af9mLo1GIhSroJzYUwKQ5pz1HM2OHIAH2BedN638XxlQDsLcqlWoaJLQQmw9HIsFswcpUN0AAEn87KLoGbSf+bF5c4/nASs8FMMmAksqP2ZnkJBI9p83Ny2RiaYaYhzCGPtX9t2r6KgaV2R+RHXO/zzcbozLo0Hd99wfaE2X3GGgxixt/QWlHLzQCgdu72VNoS6NBljH1jvRAt2wkMRYogIsbxhTd2eCT6OfSIbBo72BipP1nLvabsJpnpvWSwJif4DohV46eSAH1d7IHchxIAUVwFx1E0VvGLGamuX2nryGhmhvMVS7FDPfzJB3J+D3jSKxApAfURWFMLEM+2pNMIM7RutqJylLeMUsbilEXvxNtgfCX2u8Mi7Pncy2kuKOkpDhin7OyQ8GLKh3QB3XH7ibjCC5sofrPU1g3CvprvVcBJO7omGYQUco3xJHygPwS08Q79beJ1+Fne/WA8eGagFW3j0oheXZ5kxA279+VzC0VjnXCb5g83o6BvpTegxLLcqZG1wrNzvDJ2xB6gWGB0Tg5ZjnZ5FWKGaUx9Mi13CIpiZm1ma4DO3Hn0Jh3Sg6DPGOzhMEdnBfnsy528mYPLybnUcORdb3+HGg6/1AlmXFOzjjSL0XjEEkMTxcYaGDOdMPjN+qkdB2YQUYKSJGZDrF71GAr0F4AgGXSa3b5fGYCky+Qlk/B0OmgvbQOYmLQSg44UhieUDtwmODns8heObcNilZAyw65AlZaWoFhk5XjZplMM1QdTI9s1JVs5aHQXT7g6ljcnGHpZJzFTGU6IiybqySrVWjmm573DJj2LCPR9eDD4ET1lqmdlEcdqQgIK+kECoTRfGZpLbSR5F5iaJEve8ljk0kiVacldfAa2rlibi+w0ezSqnQTBJtcjsc10SKTo3sAu1fwK67m6pw5wndosKWqIvnj/IkY50HkJZXh8q2dSeFQPFK3dfgPnWzGdAc1ymK9GZJTeS7RE5AoYZmEG5WAGI9ExJ9dDpnSWXAgKzaoLosAsCDGz/bZcBRdbpCKDGG8oj0tgpvTC/4khlSQGXKwS9xTkhKwSyc0ttlQegY7hTuYkSzBZD1Ec3xlPgyt6tamU7OblCMDyG+eFLArtasmWWequlsoBn1BtFZTpHGtm0gvu047JNtu85eg64PBaaFv2GQm1sNKMQq2FxjPHGADSAVcK4qMKAqbb4bNeVeKdfQMmRQPTGN0bDl0LqGx3KgxcAFkPOyQXoInWhLGaHDWuygKFsRWow9bX7AdBHJ7igIOCd8yXM+wrH9MXobhrqVPjJ0ZKdQIj7BYauvAHEN70cjkOS7KmKpL9pSp70Wusm05xLYy1Jel7Z7MIuin5U+VCsOkzeLCo0B7F+NgXcMe+nsyJKiBXTGqr0FQoJNPakSRrzvRoaPhJErkRpxDHzINYIE+F09zRdn+w1y/85Lx/KB25mMbJMQs90y3ay4M8nNQMZgYmXtfg5jJZNsC2ySpptJI0t+PUGRwoDSE/iJ1N9mXfFMOVvsU/RkOH13JzUTHr/T/NPkm/ORotejH4RrGcYSPs8i/TKQRZH+dl1UDVaUgca12WnG0TU+meDEY08JrpFMYHVkYe8UkLZtDi4kmSwyeSe6cyB+kdCuPFT6LZoBAAFRzJDtYfuPhxoikmKeB+nO9nfnY5UY1iGSXa1usMVRlYX5ipIZtqwszt+nJgrbY0ZsWOYAxfoTRR+8U71ZTOkpM7xTYw2r79WGCYyZcZdqskabEjE8o6+R0dVBQ7uAxhVQuDGkxmjOcKw4KoaMjYWJzWD0A/IzcYp54pGjc4kOXW+Sf4XVYZoUC+X6AtZh1utgZ6WtfsGUJ7kDnn0ArXfuMFA5hk8uIwxgGEW1Ak90opQPzedhTeliKM1BMT1QsoPgGWJNviWdKiJ6Srq2l28kXhcOUO+vPNCH3TthF/PJGwtHgO+hJybic0rpBhmoC6z7gDqrkbnXuTGqq1ANAOXKDkJFVTwTLzBOy4XAbuyFFEOyRXJd+AjfhWo3GYULUOY60LsM1Y5ZDcJBquYhvbX9v1abqnivM+zQHOacruNdpBV3IDrngAEIPKEAGgykdESKk2sxsHjFwz/lnk0bkhVhdDldzNAvUrWLEIzTU3XHvr4wuZcggjREjuabVcmBeqxQK82P1cr5yQWELgskGz5wF9TGOkWmUMF25ySsVm9sijSgdsLpJizTrjx4IYcZkOJkuR3SVxASHzqE2It/aSQ52glkLLYN/XFYU1ok1gDbm+AfskTIsE24dIcc8Yhwm00GqG2aEd47CbzrToMxM2bzR3Q1BBbkB2KmclYKxuQBmJ8FkpF+eBJKCcya11k1fiLzDUJBaqArXnDvSx4aopp1dcOds+xDZeFrBe9C/e4LHShooKJvlSFtOiRTDybSigE9dsaNHkw8guMZApU8QVg96AvWvw/VZxYT5wN5L8nN3O0UGp8pKwTwCV4fzPJYUpBsKIvRF2ij33woW4k7Njs6T1Y14J4k/l1VqdQ1mOOekwFuTA3YNo7+Dl4wCrTpFubzaUTYx/QA2LwYjZgfChPqKmn3jBOic+B6iSls3w6GYKuDeiYGQhBLaWPx0S6y84HRn+It8Yogu17RS5qWMtLim+RwNsUw+qCnOgTU+sEwOxqsv2ZawgLdJocuiQxdSTF1IkiIVpcOiPSjT5rVhWZp6UNCalBxtaSJHfwAEVI5mEmZ3qsDMfFLo47AQHe7MGWQ2EAsbd67QpUFOhpifNg3LFxKoQkadYq9sj3cD+hwOih7aJDDTkd1gDaio46FtB2bB1gUMqMTfHNLJiAzwWlH7cEx29Mfo3TPTtXGSXKIVdAlOwmhkBquJDUE3TGZIBfa8duvO0aGTOt3gEMvYqbQ5Jg5RY55+kCVc/QyV0D4RnTiHgrQoiTHwQiuazU55njmw2mDGbEco3eiJ6geSP+zYI0VdMbpVWp0Ssh+3ikNHp2e0lDgnEaAYLbaEx54PlM6PQqIzSKbdjHcGeVKzGFDgM5vWeSl0D/4eWvWA9+B0gFyBSnI3Psf1lCmjxbuR7nYvhawwoIaBx8NOvgkG/iWGyPUKzYAVlQ4FETKwmEhe5ryPGC4OgIPsmPt1+OTpkAKx5RIZJAYlJ1I/AHbdlJgCvx2T4wNqMewryUcNwsMGY/hiJz7q45JigGdlFr0D67cDxPfaK+jZ8jSQkBJIpFroVFnlWFkyCoiNE31s8r3eV2U22YqYqHFM4tIhaSfe0UBcgoRbqs2S0UpFQXk4g6NzcULF5zG4O1hgLL5KEjCRP9gTqFDY1HCSO7lARE9MZbslaGsoTD2c2gZbfu6QIRDLUewwVSGGcgeteo48nvG9qMswmBD+M3mffiI81RDmPAd/sTOTcT7gF+j6aDHahx6AEfofey6LYVX6OoOxnF7a5swf0dxQlCQZgzfZdWkFBj8FR5seo9u3KoQIs0WOinkRdqfgt6SeDmGZTbbjTeB7JAAFBojIzD/djjbNARrXDpQie99iSEl1yYQlIDGwRU267oxKUSxPp468zklu0nG21EMckEGnELhq80Y0NKHMqeyvTvcdYkgFXDT0Hn6KhWSi0Vec+mxhNiiShXkScEtbEmFZCWkuUL2jutzgxJOHNyIFjbB7o0mZQfFW0WO6PsYJs3U5phErs9mMgizU14+tP2ARnIGodL2tzBSQ5FmKvq4wF1LqHi6ty3Zm8kHEvBIlp0r0oHR04JzSpOjjDdL2VdYuM53GIqphAMGVyagdw/a7yOOjDCIXCaYuU2KhNbKsZDlrpKashGb45xmiUuH93X97Rk7BYxhU21CxOENGBIEiWRl2N30YVQHWJdyOdVo/ssREi1Xx/tA/3SwbBfGwGjHEjNHhRvLpfClhbGKAp/F5mORVo4lrgdauuoMP08ERq8pQ0NXRDwf6XU4EPE2LfH4bxxHFQDkY9KBO64d7KqvHBnCs3KEaBxlH8NzxT6d6FojtB7PhanB9W1eKVmdaaaG1K27qFK9VYNZCr61OBCEOIdO1BMCmuW57Gtqkd1FAOBTJpNHofcm0EhGlrLahbuLJ06bBkOdPjBxEo9JMETPM3a/DhAIKhi8Wk0Tq4CsztCAFZlqHrWIgtRwe5r3KP3TzYyV9irOLotMj8M0G8oBA5UJWaDddZogp6wz9yzB66u08pR4MUKUDLHb4lnQ4lm6oXTKZ0Zhy1N8SnZSK4u0QuwoMC9ZRfhoX0QWx0N41EuIKAbJlPiTWG/SSVttKJCcOl4TUKSREbkIPzONgIKhHIX/WiwQtTEhAF+9qKmILc3cgyKbA2zwfC2luvVZjQN7qJnge6KGApnCl69SDmzqYegbkwDnrog3GM0UrW46JVtmyN8c0Tqk82KOH63kFXIEqoRjJ1FEfxEqaqPN3EPYWhsM8SuIHfD7XcxzDd5gYThyXulORFFrWoI6JubzOkQPTxTTaBTYcO7kYfnqmrC5ghswpYRY2ri7BQ3FQReANDKNkoAhZYYsrGgxzQTuNWdyEFGiJq6S5hhs33CEhKpNySA1vxlI7HXmJG8E2FEeOi0dmf6XhV/ZWb4WqsL4Erm4mNZq6o34beMcw/NDOlF1juNzTsi4TZDKRnqPHB2a+RkJ2guG2iVZYJGMScYSQNtFChWEGJJpRrpbvNnH49e8yVNbl0NFfZ1DRjGCZt9ErzTSVKY/gmS0ZTJ/HPkYpKUefkKPCvQ753Pqay9wzOjQxCSVQFrgz1pLRjaCDmo+Uhs4+gS6hhRRkowMNtENwMkd5TwfVHqkBhSx2mczVNNtfD3pxRpushIfZwsrSQXoRPZHJnDqCJ2zECvY6R43FyJRcs+M4ZKmAWRyzWj8GfMxkxJcyCcF5SPRbEr2DFTM1e7Kx1PUYSAkTj5/HO0kvUI2Fb9OsKHiiGM+mp1i6UZIK9GdMi5FzpCAt+25H8PYzBgLQZ+IkmoSVdFnv1AN9JZzB6gHTD4yHBSwxbDDiGB7EOdtt9iAaHoFGs2Q4LLs2aWGKmvPOxgEORWqB0lS1m4UKou+YrbMEiaoDANJLuKTjCLECMcG+pDDlF7aq6MrOroszJucSF8LvlqtrPGOrAJfRJ1Dp0rQAyMkY4gR5SafU75JCCYIPRnskJrSYBaAAK6U36aSwNXsAtXJOoy+646Q4c1YZgQGBDhlBh8IiwYhAd6ZRuJsCvYYRhBRb4CWdQgUEpD0qPZKX5vRxnjHNrcXsWhfCDViA6OeEydbZSDke0riFuZiwHBnvVK8PCoKvrtDDutdnVgu08TQ80/jgkl01en0pstAV7RtkCnhyOWiTcUxOpIM9QSaa0qXn7NJqDrQOAyxdM9aMaI9pn2Q63ayjogg2XH146Lhgp0gS4naG8h57b60r+yEOw6NQ5BkyExEUZHYxrNRPy0QcgCWBtpvfX6ObkliS4MzyVnV8A74FK5TN31AEyTMG9jAZ1+UaGIjZmJquI2hiIzQPLy6Xh/mU0yH/KTDKnJJw4LX81PAVFA5EsfCHOWeWFNrA6ZpB2OlTqCmAx2Ags6VOibnRdKYV8I2u8yGIu2jix6NZpIMstinkKSaJVltgZTBrZapeX2PMhlPTnQoMUQrkEK6bKTj0Z6/Atkii2mxPNJYybBLH11SYgrCQ/mAEahSTGQGtmtFnUAgolvPNPFAu40pGftQpP3pJepBvBsuZLxuRkUeu5QXYGXTgupD+QRuwR9ZlvQzFICAz0/bn0YZ8AoqvBEnWTaOHsUjxrjReeqIpWOsy4M6IkB1ir4GBZgrVCmrEUgfRy0AjC0fa4WUVTbX4uBfSM24mNL18DNtDYVQ7FQ/fl1rxpL7dXAWDuANsRYNGgWYqe1cZKobSUmIcjsC/wwgl7580ax82N6Tf11bK8sPh300zHSlpphKz/oHysAcFvCLkRS48y7hIfFSCZsQDpgB16pYK+mBY8koSQC9UdB1yfLOgQXx9pI7JdGp4Iw3FVznOubHJ6xSYAixKocbrhJRGP/oTV9ioHLCrrwp14cbgDLr0LY1UMrxBs5Zw0W3+FEyfzMkEheg5ZTvA00S/diVS8ievM4eSW06HP+4wwkASzgFNrlyv3S8TCFaKnhbrzYEWXOhhS9rS4lKIneEtk0HXU9+3s8VA/sjd1TPQ+2VNhIwoawTTia2wLo1B0PRlL5CGOgeRxnFqzPTJ8PvOQ+IpCaKpRrgiH76MfpxZ0AO4hGUQkYMGBjEPFKrJNjZme4FrStF/4ECdwNQHQTTOcX3PLraBVcuH4NCX7SXd7QdsKiwliRj0/D7bRFsmCUmKd+aUpIgNF+BsddTqUAjExjBWKpbBpjoaNpQ+ujnTIcUAa+t0EUY1/E3SaBaBygGJAQ4L4zvcW8FNHIleOEuHQcCUQwoJpY2yTDdtYURTPEMaQbdZ9NVyiMnQQPvqtEPQcFBG4MogpJFGcfqEObTkRuFDc/0UCiNXaILRUNJBJuKLESstpl/K3XSt5owOaTBmMUKUkTQuOJEXFW1UKWDqVvjWGkWTTIbMNT7AMgXuvOL4U5mwcdTk/WV8GQXsLCQsE1SgU/AbDj8jmUQ/w93IS7r2SHkSFJdpKoDDwc3sGWjzynx36nyLMxJkPBSe0HY3V8mKH08efLHA1SIz7iL+2ei6igYAWzeNSQpAABTw0AJgBbXTScZEGLpTPUyW4uqEvWJUF/GvEJs2EL1oVYfoLuFyrrCmMHE+m5eiFj2jiYv6FWtmfn/oC0uZivkJ5N1EU20QqWF68pnxZxtZC82+jEDUQ3jafb0OcWQb3TLU43ZF60GG1hzv/BMBt/5NSjXA/9bvKYHuygon8+omBMAWHBC0GN1kw/gqN+HIvEQ4293MeVrYoW6bEaEVj6nkoMhOVuLJbLo05MziyxUInWg9sr48AyxSTDeTY+NUVTmQuW/hTC42kpWDTsJJT8lGNQOF6AdaSGNMKGN0LFM72SudJ12k7dC1XTL0gjoHeBGCNPtOeciUJ7AA3eAGZE+lxwal8xX+COefSuhGpe91IaSwzf7wpJNHOsI1repToDWj60Hqx+FEC5QocObJBJB2cDwTdhwIXIolDckneFeXtKGeh7MLVZqjqgtyasJwqiAQu9nKZpWKIRxkMoGb5gfWuIMPA2ss4+CUiJwy+gwgoCIlZculIBnoykhBAeRqwNxuoQyXp97KDUNCM7CNk7Y8gPQ2HI/y28pE+cWRRlTAzssoZKwz8EPPABgjqFYYk9wAskL3aqYfk5miduBvJXQnCT2lH7IDSa1BYw3iCx5r7xUOwAwJXEHTBrikMRBiCH9pH5tGgxa4qugca/DaFDvXi7sC/VgUapOPsUlbWrejf7Uz7sO1xcSMCQYRQSduLWjUVGWWkX2LkE3h7IGh7+C4LYm0/PxC7A5fiLNK5XBEO8o3YJesUwpHaK4QJXbPRJHkP9LeD/SERI+VKPpFqWoFL7untFzGGlMKMxxMbqPKIXKADc88rJM50onMHqSIMKB5vv2AUCZmIxASulBj0uEcPIuLM3VNH9O5yBpJXXgp7QzFlAWBmNny31DUWye4G4r1LhtAVmUNiJ50pW0wJvuKN7bAumtbbACFNqYNK2o0PnaKNWpV7hD3dFzPMBYw66AEgTe0Ke6ISo3LecbBJ8tgRf94mHMMU6ymUj1+NxdmP1B8h/FwkGFxSLoaHX70DGUpXufkEw+SLQ9KRtAqxneaJLgo1+GRUKu2R6/CAENlT6Gb8zTo2+1BI70wvcS2LRfIdxg4DfXrdBOHFwprC3SuFKsWSxkCrRGDBTvNYK4f8OiTMfNXgWN1w2HZAeJ8bDkZXoM4pgaL105pmTSPTS9DzgeHPzBVl7SNYq3szgTSsDIg3EUklZqWIo01Gs2cR5wQVD0mE64sAxWp6EJ/F3MeqtvVLCtBlRYKe4YTmJCo6q2oftWFmSzdDTuhhSfpf4Nmo23cVUEarBkL/fC0mrs2r8wY5wZME8p9Rgg5z5eSYuZ5qUJ7AUhpQIETCCyTkmk0eg0ZXdKXEkKbZJSPKj85AS2RHFjCKn2Cjex0JzlCZzTAh3bKufNL+LtLjNBpdrRkJ1cPXVrB83BuL7Nj6ANdesybt9WdFGQZhJmQSjqtXoAfAVZZmIzty3VMbsA3hubGnSk6AkY46D07pFA4Xkzgg3e2dDs6TDKdIcyYjNuGis1tKdjoSuPmEYLrlGoejLiC9pE5Qp8YdoHekZjm1h355ohReA32tc4Ye5c6QusnprHJY/AdiUzPqKSZSkouHwtpRaLBX8EUORxbNJHvIS8aQgRF5k5NMFkUWqEYNOZgamWRnEDURV/ecKAKkLc48gqMKP86htpOfEjhPdERlFxVWR7qEsTEGT6U7mp7gdQYFe5o0tYWnB/jBxMDwlNxfkrkDojQYWtjCK11VKLbAajkBK1qD0qQGcqdAf9RTeDBZPYRTPbEJ85MwoLUobWg4635dpcMPACyZyZD2GTYmB/SRTmRqpB2AJWo8L+tTlDrYcDLylkNWJu1JzF0euKBzuEYDoKklyJIGwxPcUJFy0Xw6ulIE1T5gVi0xYFqhNDULABjSSa8Pkyg1QZYJusjVWQLfq3F4h8oKMPAQYd5N5NdA6RaYjI7XAB+HByVEI7TCmWhOf0NLl94dRZmjVXHQgQPAfhk+khjGKtdU+oVpFs6U+dddqpFFhp+d5iTbMMTFbtGFgvqb2ujJxiRGrOCPUqNdLF2HiL4YcPOFCDZKK4xJcEVwcHwM2SowPrczYNOZszh+Baa0iy3Bgk/ZixFwW46xh5FvUTFTKwilWi0JCnjFgsl/ZcdSigRS8DNLYNLLdDx1XD2gjKIASbdZcbKYTBHfVDeBS/gB27QP0FjHozbNrtOR5JUCWHSGLbJXMaE9AnOSfFDhnKNCdEKJpvVO/qcqaKAj7Sv1phV5iviyQXsPltjOoKqbFmDBcfQFNJwojieFkZ8aUv2PlMq7NFAk7lUJzW4SfcazCbd9ZhrQ2vKwXUeEzv9dEP5sfIPgwXBzoDVksIRRBsHVVvjyCa4ophTDHt/h6fSkzO36LNtjJd0o+Aq5BIro4ag9pmW/fDYlcVi4SQb3RPdIfoemDcQuOaU4hwBUSLmTSbbth6kH37XOO8cfZbripIiP2MC7gKXMZNScRC1t0aX90OOxH2hi2y4htAoVrVonF3L8gl4Jj6fghN6nhY3AIQsVgdtvKKmhytWt9inqOjCWOSln4E8ieoW1WpL+qw7ydVew/N0FUjQL0xq5PjxsNaSgkyXloAg0Y7LlYpkHEXtOPOtu/5NyExxoxiKtEw7lAjwVwseAn3oMe8LpFZyJuhOGdkOQE4V/GyD56K58RFYcshWA54PCstlUOi/18d94vf40YqQRiQQLXMtn+pKBCdFYX9amj5yqAzBpBEZH9mJdD5wSoLPh7215A4rrGMxI2eRYreJAblxK8lD+BltWkge90JMwuFP2XU8gDiHwTtmksS8VPPVoJ3UYcnhHzk2T2pL3JFyrcE0JAgblhnYI4Jol+4F06BdgiMsxYHZF+lC375UGQD9NTn40UBSaAYvoNWSr0BXZlLQ5QxzjWPIJNupaEM/TII8GwctRQqbNqu1BMGBH7NDaYD0IdT43o/uWJ1ZKjNjrdelswz+oNDD4KB/MReAOWdrwZVPJofPsFrwHB0Gku6AKpQQKtRCJEWkWmzb/tqCP74cg3inUYAGVoVkuLQuJ1QCejTZ0tUdUskz2iGAZ2Cznc9DWAQ1GCOgu2tepGyLnw/znZS1nXGBzmnBzOtqkY24gIRwxjl10yBgn2EGHTR+NO7vZs7//ve/f/aft354c/W/fr16/d1v3+ofP3//6vWPt/6oT19d/fT9rT/eevLm1Y+vXl+8evO3n9+8fXj31me3frh6+fbXN1ffvn7516vzL3z77nZ89d2t//ryb9z19v1TKxP99MCxR/TBrr18duurZzkdH7TDAUcvGaBpAtbPbt355t790x9WuBUkp0TcOi2f3br3r/fiEp2lrdCMCHto7vqrR8+PdywMJJWwwmsHCfVntx7e+WLvQZ49PuWbACIDM6RjsSt00NpePDv9WXSRgKxbmMKedMfLr57s3fHx3RfH58jSmyTK5iqB11PyjM+/PF4b0GpRwhygYLTXesjnj/ce5MEXd49/JgcEuBhdIqBX9Rx/+nLvOe7ee7S3iE8fXhzvx7BuIvQS50YP+Oji692Hv3h45/Heetx79nBXRJ9//ej09Gcg7Ltf3t6747Mvnpy2cwR3R2DpAXi2z279+eHpKemFgoeC3gU8FK3wxRd7P3b7ye4Cf/7s4nQpQ1xMqEc2Tn905+mz4/3o+qLeqEcgZmFBnn51f++37jy/1mvnj/j1o8enV6ORXnEF5EmTmJ5nvK58n9/z6cOTpTp/ysdf3tn7q0fPdxfk8pujWGXmPcHj0gtMnPH8Tx/sSNwX90+Sz/z6NZCJofNZ4Puntdpa/IvrOtWG6D++93h3kZ9/dd0QefYod55f7q3j5bUYkH6GXLtDJabgQYJ1uasnHj+8zoCc79rlN8925fHLh6c1OT800i97j//Fs+d7B/TywcXept178Wz3hH5171pCztXBo4ePdy89ON2SKAMAhrTrgA8cJfLF3mL96Yvbe4Jwcfv/2RWEuy/u7L3153ee7CzVVw/v7W3n5Z1Hu1t28Xx3qW4/OZ7d8/e6+/zFrjBe3N39sccXd/cW8YuLaxGG8pJBbDJadBrr1+5fPtlb4DuP7u0+/uW9i92HvHN3Vy1982LXsN7+Yv+Otz8/afdcm4JFuhGg4ZYHJ7N1fZzOD+H9kxlP8A8VhlCB21mn3u3zFxe7EvL03p9PK5llFzrZjHVIVvUcJzt+fuXOtR08NyQXj49a4qOfgZFEe3b5dPcp7lxcx89n0vj40cO99/rmm3/dNT8PH+391e0Hj3d1y9O7X++u/f17aVdfffPlo70Vuf3o2c4yPr63a6ofX2vUDf195+lJBtpsM3I0EEjVVrHwz3Zdr7tf7on+o/sv9m746OJyV04fXBu0cwv/8NqFOnN5br/YF24ZhLKzVA8uv9r1eO5+fXtHdJ48+3z36R9ffrN73h9ea5ctXfDozu61+4+f7u7a0weP9s31o692JfLrh9/s3vPiywd7Avn8y0e7r/7k8tGe8nzwTiRvruXtL+7t/dGd+9eee+lkWBUeLfBP6TFeXLzY+6tnT+7sK9VrX29jQZ5/ebl77fL5oz0h//rB7Wvn/Uwb/+nzP+/92dOLa9dyI3S6vPv53t89e3hnV87vXyvCjTd4fOfh/ps/ufZuNmTh7qMHuz/4zZMXe2rhX5892Nu723d3F/Py89u7P3Z58dXutT9d7Do4t59c7qiMpy8e756cy8/345b7T/cdkruXj3evPX34fPeeD+88332Wx7cv917u/rPb+wb4wa4QPb6OHDeW68vPd1/g8Z/v7e7As8/v7l57/vRif1Ee7BvGi+tTt6Gcnzy7u/PmxxTJ25dvfrx6++1fr16+/p1Jku+vfnj5609vv/33lz/9esW9M8M0mZfBsCyJ+CfzKMff5Cd1u+sHOGZRTo+bo1WxoAYbfbv13UtuXDktzcaV04JuXDltw8aV0+ZtXDlt+dbfPNz7nZNwbVw5ieTW3Y5yvHHlJP1bv/Nw78rppG09wdO9vzmd6q3febF3t5P+2LhyUjpbv3NUVZtPsLc6J624ceWkSjeunPTv1uo82vuba2W/tUFHG7G1pEfLsiVwR3u09ap390Tk2vZtrenRYm5cubazW7+0e4RONn3jyskT2HqjJ3tvdHI6tu52f08UTu7NxpWTS7Rx5eRHbb7P3pWTy7a1cEdHb+vZHu2J6cmp3JKEx3uScHJgt473xa5Sutx7tpOLvSXaX+8doZMzv6nIjhHA1iK82BP6U7Cx9UPf7F05xTVbV+7vCc8pgtp61WPYtSVwuzru8a5WerwrcKdQckvD7ArcddS6JT139wzXKUTeuvJw74dOwfjWCz3a27rrsH9T5PYE+JRi2Lrdn/Z26JTL2FqEe3ua7JQ12VzTPaV0ys9sPcHne4twygVtLemLvd85ZZ22jve9vbudMlybZmPP3l4n0zYFeNdV2jWRp2zfpvk+vtB8l0jcerc7ezc+pSy3dvHO3rudcqNbL3DMqG7ZvS/2lNopd7ulUR7sndpTlnjrfU655Y1Lp5T01vI82Nv6U/J7S6k93nUzTnn2rR/6Zu8RrnP6W7+0ezQud1XhqeawZWG/2hfMe7vK61QW2bp0f++VTiWYTeW+Z8sv9w3P8121/+WeOF6XojaPzbGCteVPnApfm8u669g93fW3TrW5rSP2bE/uTkXATc2/tw6ncuOWBH2xe5S/3DuWp3Lo1jl6tqeQr0uvm37D3sM93Y3B7u7a88tde/Vg16c5Fa43d3Xvbqci+dYTfLW3pKdy/LbK2DtFD3fN7AkvsLUPJ4wBlOUf/uc9MmFLP54QDZsneUcz/H5Mxourl2//cvVmD5FxuuzxGM//8uvr76/e/OG//eHRqx//8vZ1/JCeioHe4zgreF0KebY7P/386/e/7Vx8cPXy33/7w+c/7/3xg5evftq5dPnr69d7t7378q8v9SY//uHFq9ff7z7X1cs3O9eevXz1evPS/0lW5/0yn+d0GvC6OSozYVKv9RNbYVI67x61TODUlTnFmdTWh294fu18hc6/836Fz6+925iNSx/t6dZjvROI84t7cnXzm8eN+Pn11bd/+fnt79oEvndas9PC3Fjk46fvn+/scnx8tnQ3vvbx1euFuvGl+PCjlbr5hXdXroXxxhfiw3dbdOPi8dOdxbzx3a3vfHpxP/+JL9+9+unlb89/+9vVx8v76OXbqz9cvHrz3ZuXP7z9Q3zp/E++3foWHvnl7l+8v6bv/bz/tetLn36Nu1e/vLUS8sEXzuXj44s70vHhl3Zk48OvbEjGR5fP5eLDyzek4sNLXiY+/OY/JhF3Xr558+rmMt67/Bft8Pur354+UKRx9fa2fu+XD669+0h+yM8//vL25S9/QT7+4+VvH37r7JIe7X9IKb7Rq199/+1ff/7+6id++ur1L1d//befruIZP9Ctutd/v3Xx7z8+f/Xd/7x6+/TNq++Q3o1nYEm2wYkfX/lIN7vd3tjmva3d2NNP7ZC+8UoL8/q7q8evfrriBT44F4/jFg5wua0KvWrb1Gn7euzTekeW8uVvT354cXX1P0OOfn3z7c8/fKvPbmmHv/vp5S+/vPrh1Xcv3776+fW3P738t6ufYjOTvps3vvEfV9yYr6QD/MFrdJJ1Wgjr8lk+pP/xzpa+RYf98cYNbt2QKu4k2//malOm/i/9/tXVt7+8ffPrd/xW/P5rPcq3Wv+r/y27+Nmt17/+9d+0mr+8/Ovf2PU/lpJlRbV9P1x7G/+SDyvjbNOAxBRe9PH3/3F0Y3Ze5XfI2v4uuxOwI5H/Jz91dqhuCP3eidqU1Q+lbed0bp8WL5r/H278L3/76dXbb08bGt87fvJj2Armtw0a00di7Av+1tu/vLn65S8//xQ+YHvvqv509cPbW3/UA1zx2XevfuHFTk/709tbiNgPb7/97i+v+Mv82a03vPL1vxek68PnzRvPq+Dl7HnzjeeFMxB8VXD2QhL0T3rgeuOBl5sPXM4fOFOX/vBg0RjMzCoo12eHwOLmXerGXdZUz167nG3TStspJBb0Ko3xT3rtduO1+80HXjYeeDkXq3rjeWlAGTlpFQA2TZAEHzxvLf+4YI0bT5znzUduG488Rjp75uVsjVMHm8NIu1Ra/yct8c0HPnvevvG8xH8fS1ZrkwaMUnRe25zrzbuMLfkEhXjjrdv5gcorPPkzZv+09k967fXmPqWbTzy3ROtcA/SPHzjR1zwgnolunJw/VlnQ3BwYrAvpBRz5/+Djl5vPX8+ef908Gv3sBcbZii9Mks+yA5jfdf6zdO5NpZvPte6Gmcj1fM3rzTVnbqdU28gnarqPHrkt//Azl5uno5wdj7xhKkBonz30vLHO+UDT1hqTFOmD/6fZtpu2Ip8Zi7xlLco4e+T1TG1KZrN0z5yZWVAfi8Y/rjXLmT0+F40t01TyuTjnGy7EelhW5n/SwA9/wj/LNOWbtimfGae8ZZ3ameqsDP+ilYXpM+PcKOcti5F59Rte84REAr7JRhtuO9PBeUuVp3PLk296NRBVrDHKqEHnk26uYUorlPvwstFUzXv/Y3Jwc03L+ZpuGZL3D/z+HW64KCXmdurZC4jwWj4+bSX/43JwUxOXM02cN0wJZ+djMSgZsDCDE2QdQPSd3WZLo29sX7mpHZlC1SFAXOXSz7X+s45Avalp6rlbuqXR8w3JhX8SdhFGpbUi7/ls18uGkm3nK0hH84SBpEAPfH6XDbW3oajPxX+J7m85aQkk5ZnwzzKZwX5kL1zrP6wFby5nOV/ODS3IEn+8DrBeQi6xjs5MyzOFUjb00nIjCFfQB+dF7ymmXNczaSwbWgmA6cePkgKcGqO1oFc7v8uGSur95l0YjzmBiOvcMrfi7C5bSgEk7I3oRzfJsDj0BDnT2V22jmk6k1WoT2EHn9r0Rqv9uZxtHtRPuo5S4JKhVZK0NgaRpuVjN0YizXCnJUnX0hz9j57am8a2nq1n3Ti1y5mYQUnE/JQMk4gcsHx2m41T29dzaQX5DxPIypufyXzdOLU344/MpOeKH8U8o9bONUjdODlrPhO0mdfcoYZY4Q47j483Ts7N7FViZkWCezjRtzMlbp9KX51ld3fqPP+knK9Lq36YKNpO636Uv/r/US6JaXdrCmqcBOvEDTO4NsZbLkwLnzkK1/9lmaW8tnMrfjMTBk8gTEShAhlr/vHTV9j5IKupbeJI/hfmmcqWDb259p3BXFOBg86Vnr7+VyWItsKGuREFnzlNdHTCoUX9tunJl/+yxMOGjmnLp2PgtGa4puGHW4dE6uYSM60dEYI8Yugr9Lr838kYbXgG/29tZ7eaQAwF4fs+Sy/yc7LZPI1IkUUoWIq+f+ezheKegCG0BW+qLGrck5lPdybF6sYkKboSKjCjTPPxAHgqbk8v2RJLtTbqmbxM6SiD7PTFSqB4WLh4l9w2d5AeCnLqM0gPpKIj0S4mHT/EY6Jnq+bgBjVVJSA5jDLR3brqWUeJZi0sSX55dlUn8YwM5/PBm6k41FQl2bpRdv5ovtA1kDJsGVvmrH0cgK9dWpM6WK+4zYPSHj3S6Har+2kgwdAoxb4niZKEMzuAZ+lN9RbYkckoR8AnpIZ7MPDuRZBt/X/OpcdvqmMY/IAJclEprJByiNW74N54TM+xJuXBmhQknpGd8GdfUYxwoM5AtOhGWaTetZCdSr69tvEhfhPNv4cNWS4Ja02KIKxDEMXr+0UnJQl1VPNC3kewhpkfB+5UMgpeaMpqqa3fEG+3U5H2yGWeC61eIU+fTANspjOWU/Xb7Z7ekju1kDNIll6Nj2qMKcB1+FYDV1inWas2wEW7gKVjsqzS31ZpbCDBegSwJMve/LZIEGkL7LjBOlig59aczyryRdgsgsTzam6v7HEOGUxv13S+pHtzQJYDGAIdtePoCRArNNuTrxuz4ddkU47b9nnajtfT4XK7ftyueLf3yyYDdH476B6tN8vHv39djxzO689NR9HfyxcUO/PXt88BAA==", "tags": [ diff --git a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/elasticsearch/ml_model/test/default.json b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/elasticsearch/ml_model/test/default.json index ce77f56845a5..2e59da56a81d 100644 --- a/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/elasticsearch/ml_model/test/default.json +++ b/x-pack/test/fleet_api_integration/apis/fixtures/test_packages/all_assets/0.2.0/elasticsearch/ml_model/test/default.json @@ -1,6 +1,6 @@ { "model_id": "default", - "estimated_heap_memory_usage_bytes": 365968, + "model_size_bytes": 365968, "description": "for api test", "compressed_definition": "H4sIAAAAAAAA/9S9W5Mc15Gl+1dkeJgndtq+xL6E3goXApAAAgcFEmSPjdHQZJGCDQVqQLB7aG3672d9nlm4VEYscGSaPna6ZZSYkRUZsbdvvy5f/p+3/vbm6m9vfv7u6pdffn7zy60//vf/vPXDm6v/9evV6+9++1b/+Pn7V69/vPVHffrq6qfvb/3x1p2Xb968unpz67NbP1y9fPvrm6tvX7/869X7C9+++3O+8u5Wf335N+7y51f/9vL1yz9cvHrz06vXV/q9dCh1HcvodUl9XVLq7bNbj37+8Ze3L3/5C9/7j5e/Hb/Wak9z5Qtr7Yu+de/yX3R9+9qfrt7e1uNt/uXf//73z/7z1tuXb368evvtX69evv7Ee35/9cPLX396++2/v/zp1ytumMscbUlltlp77uvuUhx/g5/Qba5/8LgQHz5gLi2NJa1dt1xaWZcP323j4tbybHxtY61zXdM6xrJoRdZUrtfC7/jdq1/e6iZ/+/nN24d3z/f9o8t+97958oKnSLn3seQxWhtLmzVrwx7eeX68lEvvLOuUUORZdeny4ou4lNpsc1mXmceipW/1s1vPLo9/lYo2ufRR6tAXah+f3brz/PJ4w5r6XJeV1+6jlvnZredfpRzXShr1w9vqzx7ce3S8o1aolTLaWFet2dSl21/cO17S0n10V93y6Vf3j782U+m5jqm/aovEjQf5cu8ZHz5/fHqzJY255NrXdXY9yWe37j56cLyUa8va1bqUZe29pKLnf5KPz6+HWLSXy1LWtdQqQbx7/fjna3X5p9NzzNbLklvT/o/ZkJQHX9w9Pf1aJBzL0Ju1wnt9+fDJ8coyR269Dm1cL7PoKZ49Pj1FWlJrc+akv516fv3Ug4vT/XSwx5rron2uM+kBv3h22metRSl5lKzX0hlCBC7unu7XdFT1VlqnOUfVAz6+/GZvDS/vfr536elFqqdrI9W1aMu0Y7XoeT+7dfHsKFWlLlq5sRat/ZIXZFFvVk5CkNsiGc36m7XkzHY+vPPFzlvf+9d7e3e88829+3tP+dWznE67mVdJjoStaLNb1vLfvp/21vjei2e7z/jVvdSOj6InaWVqgSWLa9alRw9PIncuw48enO44c85DoiYBHuvQVj9+eNrqrdP5zbNdifvqKDwl96rnapKrdWlr0Ya+uDhqgjIl9lM7UyXBOjVaj8/vPDk94ZqXOnRTPUYrLONXD+/trdTdF3dOh/Ncei4f3dk9S08fPNrbmPuPnx4v9Zr0KLNoEecinaB9efSVuePnu0J3/1oMdL60fpKRooPVE7rgWpVt7Mztzx/uvtzXD49H46OfyieFdbH7JN+8OD5JnVWStdSk904LW3Pn7q6oPrj8avcZJSOnQzN6zzlNvdUykzSATv3XD25/eTob2vBey5CUYEH1h39++PXeMj/74smujN/98vaeon7+5eWuSD5/tLtxXz96fC15esRR3jkmcie+uL2n0P712VFRL2suWUs2xqhjaAMkyc8udh//9pPTOdywGLefXEvJuSI86fes15YCX/X/uppYxztPH+z+2hf3n+y+9u37z3aF68nlo10j+uWjvW17eu/P+792rT43rt15Z6FuKqBvvtx97duPTo8vU6I3aLnJhmbtnJ7j4UkNblivR8+/2LOGl9/c3VGej7+8c7rfUvTSWul1leZa9Bh/+nz/nZ89vLMnj19cnBS8hKePrnMolSZriEZ7/mJ3Xx7febgrPd988697G/Pg9GZZUiofNun5Fp2eUDEv9lXMw5N7sPVulxdf7WmL219+vi9Yzz7fv+XnT3bV1uW9i72lvH95rSzOFMKdR/f2he7pvt69++WzXdV098sdw3zn5ApuKsl7j3df7fZFKvsb/uf9N3h87R+fHZtH91/sKLRHF5e797t/vSIb1+5+fa11z5XMnevnON+Apw++3nXS7n69ryQfPN5dkfv33rlG56v16OHek1zeebQvXBf7onD5+e3dv7tzkcbuIXhyuXvPRxdf73sRD5/vvd3zp/tm/c79L/aF7/LprtK4eHjn8d7BuvdsXzU8fnixe8+7l493n+X2kzR3b/r0xf4p+dPFvv24/+4Ft9bzYv9h7j7aX7Tbl7vPeXHtTGxt0td7135f+uFm0L2RhJCD1bNCv5YmYf0nAnOTizg9q7yXtfW+xMMmPfW7N9y4clqXjSun1dy4ctqDjSunndu4ctrvrbsdpWTrCU7CtXHpJJNbL7T7cCf531qe06nZut3uG52O6MaV08HeXLnnO1dOOmRzFfZ26FpfbVw6qbmtKxd7j3BSqVuL8Ghv5a6199ZzP9hb05Op2LryYO/KnV35OZmyrYd7ur/ae2t6MrVbi7D7BCejvrUGJ19g64/u7S3PyfHYuHJyVrYW4ejhbN1tdxFO3tTmMX6yJyP39kT75O1tXDn5iFvL8+XelZM7unHl5MRu3e3FnpSe/OWNKycne2t/7uzd7eTQb1y5jgK2tu4YO2xpxmPEsfUIX+79zXVos5b24X/6u3hoU/cco6itlXu0Jz2ngG1Lev60J4un0HDrEe7tverz3d85ha5bv3N/76lPYfLmaXiwex53f+fJ3nk8Bf8bV04pg40rpzxDzvJS5JvVnNfSe36Xm9j4k+uExpYg7Br2U/JkU1fs/dApT7Nx5ZTc2Xq465TQaMvIXTG7PH/9S3ufSto6kZd75/uUttqSxWOqi9iIj+YslQLJ8i5BtvV0x6xaznKFS1OsXFuvJb/PxW1pmMs9jXlK+20arl0d92jvTU95yc277e3qKQW6tasv9q6csq0lzbUpiqpzprb2dX2Xot34m1NeNy+py/d+93/zXTJ4UyntncfrvPOWvX2w90enDPfWC12nxc/V3ymbvqktdnXzdeY+9yWPNSddkEeuc/k+4b/lTh7LBLnVufT3/3xXWdg6X493D8SpjFGqgoH1/T+X99WPrRW/uyd1p0LLlnRf7NnCU0ln63ce7J2v6+LRxqVTyWnr8O+a8Mtdo3J3Vz1fV9FuqAWCzFPxbWsVnu96X8/3HuHprl92qihuver+Y3+1K4+nkufWcu+qpstd7/RUkd1SqE+2HZnfW0x+oTj1L1sQgg8u+kLynZ+uXh6r48tapyL9ssp8pNmknJ69fPV659Ldl399+aMe6A8vXr3+fuc7d376+dfvf9u5+ODq5b//9ofPf/5x5/rzv/z6+vurN3/4b3949OrHv7x9HS+/faeXr37auXT56+vX2w/w+1MH75f4PHEwimxtH21tJVN2tttg0gbvn7PMpfZSS6sjkwH64PXOL+2t0cZNPlrt8+sfbNX5xfO9Pv/OO1HZuve1hN289nuk/POfeLW7Vz+9/O35b3+7Opf0G1/w0v7Fz3+Ib/I4XSpKJkPPUpfRqdc9evn2CpDHd29e/vDWffGLi0t3+bTj779yo8jasJMnZMsHX/oYQbEgv1ff/frm1dvfPviSNMWsWsJZyiJ/6nfmwM5X8VyY89LBsYBa6EvAXj6x0k6gzx4816GnXRPZRJ2UurEA+eP/K21jJXXcylhTXylALXm2G5uRy7rqmCetd13SDC9me1c3vvmhdJxd/v3C+vzVX68e/Pzrhlb++LoX1TwOrcsRyutouecldn8rP1oPTb6Szpaed1lmz7vfzFnbkArIGH139v0v6rfbqPLAgNDoT8b+V+Ux6ZeXXKv8P0rgu19tBxAK2jPKvX1d9n+/LAfpiNqp5yf5EmP/prkcJFL6KI+0lDHM25eDTgx1yNlr1W3r/lfrQcvT9F0dt0X/wzzqYZVoUx5ZJJf6j7nrIVUq2yNRCi3D3bXKFZ46iG2tUgdpf/1LPoyWZp9Nby9hMZtaDz21pWphx8z6ut9/hZIyl00Gc2Tz+/OgtdRGTX2pt7QvprontQ0FfyBUpAj2vzoOWqLSZ0m5EaOvTqKBOs4p7ZKkMboV1C6vdOqTLh9r7BdN8oEKSWnaLYoxVlDKQSs0OgLYqz4zj3rQj5eqt09LH4oD9x+gE4SgjaXost5r/6alHbSZrfS+KqbWfrmVksmoUepoSad7f6W6vqnnY5sUfMoWuAct4eg3LVVqeTXndNFBITyTCzZS6u6c6PTrnZZF/6QqnPe/uh5W6smxA3qSaja1HLosNeBOnWy91v77r4chI6XjxH4qAvTKrylg1cEDb7g2I/5I1bqMCkZLZ9qJH6hY8HxSlqPNvn9O50GxFoGyvtdBAhndKwGR2qO2nnI3qkcPKv2UZ9XZbxLCdX/1J6AnSZW8lizNNvalbyFIl4PTgWf2ar6ZZHnWLoGSmyRtttT9JV11onIj4JTL0pK5KcdU9rFo8alhFnPTflhaX3RlTP2XDre7qY6nFMqQS6edHfvnRKoX30+CIsunk9X3v7rKmlO1l0ZLgTEwdl9adC766rIC4nl30/PSK2qyS5WA0h3cybxVP2iDSpdNlZelS26lMNEB7plSveb1dUwHkCAZiqaHc2qiyfJnNn6V5pluU6X6FElI95e86M3MTRM2WgG2Qg7gTMs0xxTVK9PTlx7V97a7puthSodLrKnRD2d4pc72d0ZWCb9hAhvsSJyTtwo2Lp3A8uYIpwPasOnf5erIjpqbopZAoUp/yzWRF+ckQxosKTJJgHKL20U5JUP6Ez9Hxmk4t0BvNQO4Ccw3ZbcA6bDIGkrQtYsTHeG8kkBg62CsiwTK+RpFni5fU+izyjrv71U/dP14rmHFe5tG3ywSjilfp6FDdZydwGXt0NS5GDpIqRnkUpdqSARoEhh5JYuxS+1AGUD6Rv7zKv08jBjLzMjbkVgBxFvdSjX6ShR3JaI4IygSv6qtl5ptiiqNClsPZHqBzqHwR93f+ykvd53AXPVfSzYugZRNOI/yhhS+VRO6lMNUlLk2Cb10vrbVetnxtULuSHG6sd7zkAfuuHTtwjI752XReZef0YuskgyEkyd9LAsrV1cyWN3r1wOARGkS6cXoDnFSQtC/ajmbTKNzCvBzADc3OSbY0WJVqEQZxLl0CifAWSUMomQlt06GxJ3nrF+OApKExciJ3AdKADI0knu0z/5OKciU77j2MmVq5L3uv70OnpSZDKi+z0uZ3U/I6SLB0znNxQWu9WDUskSDWIm6pMKQbhw7KeWxEFBL1WuBmrlpxL9tNO23FF1zFkROwCRTJb1Y2bP939fHYKbk0eaO52L11zrkgKFDZJ4Ug5pvyv1dCVWTLlQrbDq7uCnyUxUqTGOUdNM04nby/uWCurdfSg2PThGFvj6dvGXw/oClI6+RXFStz6W7WfwVu2wcxiInTHsq905PIsVsYpB60L3mXIiDSqf065SoDkWVAk3yOFYjxxJjHTe9mlywpXBGnAGd+hb9Ux2goHl/hYvywxTRSj/V2az9UuRZcR5S1EOMU6Df560Su5VlFPdN3cTUrYqUtKq4bfurr3BBx28S1cp+VecUHQgV5TzIVVTAXsxCSd21BUzrZBMIL82a8vjSS5lutFysrZ20vyhgK/Kv5ds6IyLXQWIie6MnKEZQlve66XwZKxueQeZKyet4VLOP5bAuc61N6rhrH13SRbetc50NKRoyyjaUXvQ9+g30FxL6/ReRHPUqQdYzaD2HUU4oEjIIjeZPRR7F6bHOCZK8U/nRibdZD1LIkvdV9kgX99dqOaxHeHWj262Yb0qPyglZptSjLkigPpF1kQgvOkmyctMlKA54NvLamlSfPnV3lc6R35DDcaN51+o8WhMV90vmZCSMez8OERwuchwWHX2jyeW3gJ8g6UALkQu8SOLJKva00qnr0iMJB4f0mDbJxSsSKRlROQxFYTQH2gXoS5b6TNJ3k1jIrOh1iLiBt9Z2r/T8dVylbFOcB44a1lgHI2UbIkptLtpAqhtyL/bXUDGX7I/8M72rYhqTt1LMIVMpG7uQN1zNwnAqOgmehuulYMqLmhYZXIgMzGjOvBbgIyRO8bt1xeViFblLJcinl/RK15hnlbIZhaLFSjrEpk2x6jKEEzssabM5NoIEGQOMq8J/8/tyBZYZLd7y0LUQzmrIBVO8qWhWLlNyL6WgW6suG6yv63BkXzWQFS4Kzyuvb1OM2p+GtkOLOkt4qB00mDwWWdiyL3zzwNGR/tBp00O4ihUZNpxleSItWAqMb6VTRs5sUms18ZGCPllVHqAQoWWjP2RaZYHHoF4j+2odBplMHTzgUsHS4K2nIn6S1omzsv+kqC+ET0GXotSyThN0HRQXFm3Q7IojZZadayvPKhd6ibSndPS5QF5+igJPvRNb6nzQQlWF9yoUxa0TKPdT/roMiAyetLgLuhVUKOinaqk9239QXHB5LLJypUmVVj2tFSoJfOtrKUnbmkzGpxwk0Yo5O33Wq0tGTvmWjUhSkrWSPjeLWnSSso6nHoH2bSdUM8yRjGyPkqXbVf0q2lERRiGb4eRPFiihfOUuy4I7+9W17JQBFYVSNnVhmI69dKQ0f280o7t4QftEeamuVG1NfmaRQ1LJ7pOOX9O+RtGOTvKXNPx0clnOH2m4lwoVM2UrE4Ovh4Y3RKqV4oKxkcTVmVoJ+dPVVut09jBkWVK3uFdHS8hdlo+F7MnTMl/Nh4Qwk5yjadxVgZZDJX2qTZ8QnZiUS14PbDuvVJtiJSf6sB3o6CmwlZY2fnsFf4BdnGRktVz7S6qjTxInE3zqrDjXTVISRkxvVOQmmCKIfBkd0REhOJQK5qbpQMSg0EvKZKXp2DrjNCTT2K7gP5mwbhwiXqFgWICu7X/z2m88bxpcD+GIZXqvnTMPiBeZJNbVKXZCUWUSOGcDpoPVuCJRAKj6mMhnZCeU/UDX3aKdk5FRAGR25QAwaaRRKS3IYd9f6nSgoICqx/bhT5usAMwNo0Uta3XB1ARhL2WkEzwBkZid1u9TZJaSU6CkGMWuFD49dWZ8YRsiNwWT2mWtpo5vLc1FSDqOi04OvadU/txKLYDNBjEXrqtNLct2A51BhXaXr9X2y2OVi7WsiGV3Wl7fhcokHD2FPeZZZeZ5p0WLoFiZirNRycReU6pmyNmrJmyoB5ejhTdFZ1saMJM1tYEKsB6ZCUUpq6l5SAks8r7knuMIZV9FanhzS2QBFU/Y1JpcNfgyFMvJXXVuVac2RrpQak0C6jb8QF2gFBkVMlvNQAHKBNwFvGod4dW63LY+7Y2UYaekYhYA4G6juJ5ZU+OqDwUKOux6yMhEunobWbhGSWzpRNhe3HtoX20/roWrY4G+U5Sofyfid57ayNTFdAU0UHLul0yw4qiFwszKIXUZKdmJXiDrwFlJTttJy3IypJaBDVht1yfhcQX9OM1hbwf40sirtmGzLMejLrMmDzmAKNb5B1Ur9VkU1hB829ij80oUFeSCWq8KpQSpTNFhzvvbJJcmA6mak0yUqz8kIFDk4Va21EXSUl6SYhSX/OnuFO0MZEejYyqR0HByr/OuILbJHpK2sxrZVYYGx3tSswJba2FUiQgr4hwJXHNFHLnaBJtrJylkMgervB2oaBZgYatxtipLiPXV1gypJePs9cOkrip5UDhK6srWxRQ3SLkTQ8oHcOCkGkgfxULU+LqL88aB4KqADNTXxrRrOrWHCbxdmIT9lRr0kMmBJYOw4q5Zu5pQNWANM3GUfYBlUkFYQokkk3seBxjZmgzYUPhUnWPMAkh+ZRJJs7mStdyK4LDrYNq7yzHyoIuizJWyqFxdY2dlkPIaye8wtT7FJwHBBdO3mxSJy7AmyI/IPEPBlh3es0mqUZ45HrYZbQOCe9AVQdla9t54KyPUjfY9kzvVA1vHPniQqvwSqZNPZOmb4ifK4ArduymThFRHNYV0vj536k5PR9paj7BkW8OVlwX+QyKYkBiXO9GpU7QCZIc4zimfjInTCdBeWWyePldARqZLurSaoALdl2Bj08pLA1Xr43QQqZy8YKO0ZrbJyEmpzFhUW79bUzQcVXjTXAGbxKWWlFoAeZPFWBDwKvDByBhXPAeTY230qVE1ICWFvXVrCp4qU5GVsCyuvKCfLhX7HejgxXU6jEOX8A0g/CPDw2S2n9JGBxg8C+raucPygnHJ5Yri7LpFLbmTOFOwuqCnzVsBnE6EKtIoABnMolYdTgU+EOrCrmZuuoZ2DCAnND7GG9eqJlI9We/WRnKHD1RhDpR/DQPkrPQAggUtoVbUYtrk3svJJvVA3t6Y3iLVByq6pFWax+xTc/4LRZIEEJVajsd2UHvCd5DGpV3LG3D56A0OLSnSYrLfNYCZUkuyovhtHgYv3y/BbdVHNb4yYkmGXCuoIzdckX2lX0EqoQWYbhgVAq4GaQQHDpTJPiesk2NyQylHXw3WWQdX26ucBx1Rt0/U7Gm/IazJLgMKhBFwMxXZTABq7bdiFIm6vHVKEM59AWi50i4yg7LPLUDiawp6A43gHrUfdHjllC3ynHXefb+AdGLCNFXJltOLZZLmqkASqMo7Q6t7ao1axzdKRvZ3yXGpnsn7oIIFxNNlm5cDzpwCnpU8ezb1owqSe4LpJbuTHZJeZ1J3TKSLZlDVuhUkd6//QHYMcNc5Cw0wXgevOW0Xz7E3pUP1Ry+F+33dVf6vDKYkQ2JhOk4K2LBOq13HuzFlTlCD8uhDCeY4cM7/zgonKmD2xio4JSxHkdB4kWdBZsbddOCkSTASxthZK4rgcuoWKcTxibymjJncCT0pvWm+L1C2WvpLBghPyKkPwLLUBFuwtTk/lcYdEt8LC/YuK79REJUBpJNUXiLFq2bc5AEqUwKtTSLd7gAGSX5yxpduZG6mzd3I8lEOptWLpLHJHErJySLo2ppIc1n1ncDfSk4pHcoFNr/fyCBgPyT4rswln7om+PEgK8gW/07mauAjDqp3iw0T5HWthD9ROTNWVmqWO0rqgUFkG9AC2siQdJJgBQlu9pQCgYyxrLak2vUaFrJ8K/58oc5n0Js6z2lGka2RuTMrWqiA6vUVpCaXkArEhhzKSVtoWlwqVoF3B8omZxUpNYmHgUenY0D2geSReSN6AsktR6fl4oo0g7whncBZCiU5lGfFFlX6zesaEEZXtpezMov2qOFQr65IgECDyKRyxvlzeYcBExFl6BK90y7voKBT7zTpNfsEtEefQUIMsr5Np6FTRIkIHY25q7OQMtCZFIFkKlUiJue2AhjSaZJ7SQ+IcxzJ90ikWgLIaDJ0M9ofejQLwA2w//PXK7OFG6Udp0e/2gR1b51k7YZcAilx4HPmq/Uge9kou0uUpfDcO0TeuWE8qnOTEOGF7uNeKCm7YoqUNys49elEedne++gqlS+yKooykDdtYCUTGRU+SA7sOpGElfstQZdcfsLFiBkAKNni2mIoM5LKX6OnG//JrVQhyUWZFQy6jYiluCbuMfNjhqvI6QGkanD6UWM9mQeYpEQq5SEtqT51zT4G0ixfCb0mq06txTorZAAHdlDnJVtNKO1acRDhxZJ6tzmgTplDR5sgyuJEE+iZwNLOAS7Dut90JQNOoOHVJpWlU8ZAv622hR/skFyJSmcynBPVeL/RHQrPAAK/vO8r23TAZpMebDJqFQop226PUMimUUdZHBiS5iI2SkoBRLPL/8u46LQvsld0DFGwt+EPfengSDIlPHs4VzK1idAw4QRbd0WqKTgMMgK9f9cixy7LWyBXHkVwi6iXoICqaIAsm4ULUELCsW/kit2JL4cA2C3AQNbpmvuA7pKiDkioxMVF8JNWbr0RCL7pMXEwM0T7DDTnJls52dXWFQAQ/piSllwb3QuQDDtQDcwORBguQwBbmjspBSxyKgvNlwGqMb9O9o3eXxCGi0tIyf+XPOP9S/qm66JeMCEI6oAWxvjU8wCsOzFaB64Xi+4l3u3oZaoODgmxHBAksCSrxHn4jihOfCZKnbna5HujUXqFQAW/0t+U3DuhZ1nKB4iiDdWDXwPuqbJXPZtsggRPmmwQU9Df5zKqOs207MlvUfwnFWEFSl+j9RoOj+p7NXFvKqwoNThU3Lkb+giIkhx2kPBWnwIzLPQ/6r2MMukH0J2h0bv8LaMiSF2tiXVlegho2/1nTaHPg5AH13p1mLwlnnV0VG+Vvdp3ClcFKxVIW5KfKam2kED9z0mnI+0Iw+kocJZ07s0U8ykcgQm5l1XqMTM+wm5WxfTDspEJgIsDjpNmDdwm/XaSFQeUk58tnyxyreusJlUv2w+kKybxjMWmeYFUkTPUItAkZEIQRWCAoaXTJFQ4x06rHFPRaw3fy5+q33kAaNcl9iUpK1fO2D3qVIgz7ZsQfpg0zUrHBoSgqMHmsLvzIKt8pMSpQXnnRIouXN0O7lKFG9YnLoluckISfcGkiVYYDbRREn6SpCbJHJUDCd5AAukH8DDXlSptHJQPyEa2w6cCEnf0SveAgcRIqUpVFWpVsL6aBITUDzGO7rtS/HbCL9NLFwiZsiIDYBJaRNX0OQMolamapmkE7iwpKZ190AQtmaXC/K0AcgYt7a4YVA9w3BSMOaxgtmGpw1OtgL7TE9pdpkhuF22usnyc6U/08dFuR8K5RXOP8yjAnciPUgwpa2UbXBRDKGokgJZ1ew+8ODe/BeAYVl/+AixWluoHZB/4CMVeLpZaAQk3sDwjk9F1/WrQ63SKIMDmfJNto6CaM7iL7JJPwTMEaSDRmRxUF3Vx4GBcxFfLFkelvQcLN4DSmAwllDSd/vZJ3jUZ/xQkPj0w2hDE3jn80ruK3+htp7nEEexBZSMV2eQmVUrE7q6wDKEmlxEUA5/gIwJaSOJCO+/YuMC46TFp4aUWZ9SJ9r4Dy2iDOHY1ilfRwWwMg8X0yqrsSwmV3UHxrEDi6VoWdM8K4qITQCk0dw4ifXfQ0uh5ae8wb7Qy5jEFMmV1PdElxxg3XGl6/KszUOshcg309S1S/K4DaDkQFy1Ee7XjSrm7ykAcP0/dAQkaZFwrXZL09zv4tRaKdjKp0pEnkaTlgahADYa0Y50ObLXS/jX0caZkno0lkc6VI5/AQ67M3rRIbbqHe4xuxElzXfhgOqNZaIl6kzv4VOMKjUBJytz2VCUo2KjLSvsl45ut8s2k9oY8FJB2Buo2DnRI0vu7hmB7uGyn45Wqdl2awQpIm4AFhcKmT39G9VV4vQBkNjA0RutqpeQ9AiqvXQvlQCzBIZW0o4XeNqd32iEoCLXyOky0KtqAl5aqSmNTKxZupGOaJtG5zv70CdMkdRa1jBJOrLPOKfxIGkUDWeAcCU4fjK4A20HH2qxQI8lZSzCWrpYyUocuQ9lCG6CrYWpX50pyv9ArtzjnPACsco0ztcEGm5n7KuRZHL4FDgzHL5cruAoGD0tbOVzchO9Hjwm5pyu0kxWSNiXTzOBLU/DqByYkJugL9G0HNTxSC8LBM+OmJtwnJdzpEaGxkBjWOQiYxhJabUmW8kjLdKyp8JzJ5S5xTzh8k2lr05Rq2iHpaOYVUm0a6i14ABlRBB/Tjz39LhihQoc+FEQmK9ZBKTVCDZr6prH5hRxrGsH+qSjKmQg5241m2hHUAMtiLPTA56hAztIq/9AVI+gQBDrA2FVubhafXookvQ/QeF1MWEKpRB4fDR3InkmHDzAeNZInEkKHXdWpwy9TELEe6Z/dg7ZIsK4j2mlclxnaFBWp4Il42yleNEShJIwLWR3N4H68EhZhobQ7kvccQPTjM0CdNVw7PPTxDB+SuyjbSc3eSCW4PQpPNTr79l+20rfVCP6pUygWdUEQbCG0DkPwViz4JcDEpL2DU8c694rlqXtpt6sB6VDmZXq1zIZ8geQBHTU4YSeM1Itrsp2HAakepdYWxNA2o5igHZTwQtLjbKFeaekpAPcAIVzVjzo9nQfwlg8TVeqYFVgK5QpK23TXdXFEY64ApOQHVftVqBDoWdO3Kb4ZjCfswRR65QgfHU2X0qmAFJZwshQ62twn4T9ZNWh8anIGViG9tGG0Yi2L6drXN8n6rytWzjWtwSwiweuk3SCQtqSwTGKgFb7T/NGNQI9DjLueIBJAczmMtIJfGOO7/lNWxy2RaeZlwHtndoiT/RREuwzHLkw/8DtKuhmWSMqzDvsSLNMzaklQ85r2HCq5dMHT+k0YbtHcC4kcGqnpDjPw2n6AZFmBSNz6E4zAMrANJ4RozBFz0bHZcCth4Fgk/FZMK1QVGegftHmfaA+C2rBBmdMswUKiSgMWRQIAaY/Fg2gtySnMoIU3yQqJH1mFCmncsjgWHIVsrYKOqmT9nTGJsQmQBI/AKRVjOkHep+gMWePXLVeULIPUs7ZKcio1bAP23Ci7w+HlZ1bIqY9OskTfrOMAmuBGKoAheBtcabzBLCK/Mg+oI1zZES563koXITKzKdIVUWJqQ2WYkwsswr0YENJRpvSF+UElixCUoRnOFVuhSJFDtIAgsIU0Np6ucsrj7pDgNMnq0RMYA0ZcsiAvvBMpGB1qS9sNOq/DWAm5h/t5OddHrswEabujdWEOACMldEQp+nsAA2UxqSfdGvSlR5EuK5kHOR1YNNubRZs04KYePNbO7JPvlF9fKL14OYHpGjFpkDuaoHoeYhbOAjHyUs02LYeFPmkyOjp7xfiQVMbkvEZLBa6kC6n1XdL9GMfo13eB3QCPG7SWsOc5Bhgpx4ZmZmRDsy5PpStTXl9GRuikc486SVRINS0DwIuBcByOviF08KCjba8hdHdUEBUMORirVMQoZJ8gFGvGkLCi0D3joMmbtA4vaAu+NhOtSo78qpRj80QPZtdsSXWm5IROA5oX3n9ziz+807SbqKNScHayl+U8DIINhbbFRE8LjYYKfRU60UHqAuCF1gXg0E0PTL+Mi5XlFowFglE5fe85IjZgITxqilZPyWqzEEy6bDO0NAto1W4n5UyYmle9O5gHi8s9EvLDWyPXyFY8QjOT8loTXqf5deBwMrcg0WghNpYE9AxTcsh/uMpUgnpJIeaKHi1QBZubFgjUMsW2RefJjnSJfDfFM+gMLZWczgeNT1EWdIyxFDqhG5S9aQw5sGwSKUH8QDu2DqF1ISVPdIbB5VgcIETGWe4w5FA0CFqUFRyfBbo1kt8uPb1Q5pWbS0KA9h4XE9HfGnDqo2/mXkknA/QAv93dkKDBuLaSYjsjWeYWn6QJJEvQPrteGBLZGFz6bBkFYeLMyUgROmtyhhLfqdJJ5gnIBolXT0ALNwmAJWqNTp70+YoinQzTmXbu0BGHmpu8csi5XINLUfgGNdqAtYDtMm8PB1Lw0sGg4+nhoEUPzmmyyc4xAQMAFHCAsRwesApmg5yRvANCMyN95L+0AMzyWlyCiRaT2mJaB+RnDjRGwlXSUWI4sqOW6FB2gSGHSE1y7YIsOoYYmTA5zyYZMg9aeUiwZjQhmr4+WOQg2oZplpSUu6cWnRaGSvtyNzTNcNNDmCbHnWKH8aBwNOVgk5dfANc5sDRdleBrGjjoxcgoPY1U+dqERijbm3LuF/gcWvQnmxBzJXSSmWUALlBM8/MVsBTsOMwR774zZA0KRbLOzDu0hoSiDKAN8N8GBpQOlKwpngbxt0Fh0agJAAyqp5aTbY2IgcnrgPucwR0+uVegblVcROnerD6j2YIOGLw+44zMk2orCYmoS/T3dd6t/Hdj1sE66djSqbJdEpK9RP0IuJKddkbXqSxDpyUc7maXhYT9DpLRxn87npbgz6TGu0LdW8yarvDOL8CFCh3x/pQMMIhjQrcI0bIXPgDQjNSBMsFqM8LB1qJLodvhVGSi5ELmYCTQI1uPhyqHhFnvpQexBJDkAhisxLg9+foO2giqlwzrEigLJ9SlMoBHoSu8Ts2BcTBRNPAr4CQV5Jx4UNgMP1povUnGiWXWqPTkglOcbZs2zn6DaIA5glTcXEBeYe2GwhTAvOnX65GJghQNb3tauHzk1+DdrNARu2FdkO/Q/aEgnwZ0F+wg/4OxpAtjbB2jFxCfHBEZE1SyL+LhlxYqnY0ss6f9p5Of/wxKs6fzt0FvH03dlVF3sP80R59QQles0F61cL2NM6MFYNgiiAAgs9aRjrOU6HWDwHFf/0VUrp0CNsAUJMsowOQSpuIEvNaeFBkTKGnpQVkpWjjrp1VSjEnJcEQOxZkKuo6o99Ph4OArZI8UmdQMCFZK0LIXktuEAFWCrQ20SZljhxYuZWmWKWwNphXYj8CluX7LGGEyFGyCClKA5uxfgncUj77TguSSCDEYBk1BvwJU0+auzPyD7SWmn3iiBji6Bnj9khylBSOr6JamPF1pBjEIihyc7FMBNHUoj5hdud8iHyT6MIysMmyHIRmA6+GbdKZCagqaa4Je4G7Wo4T9Avz5ZLSdH+2WoqeI0LM7AwwDQo7YhAlb5udTtHWABlwGlE3mqDLwk8l/OGCAOJz6gZ8Jm4oPQLeGyV6SZZMvG5SkqyPFJnVNNxu03PBFWPMPQAANvBB0mZhbFhU3YcIz2qsLZcEDjqiBp2O/glso8jIMe4WU3fp0TKIOYD1m8hP9hPCzBJ8jBtgZStDy9Org1WbYwZ3yAebRmZueKW5atoQWU2HlhDFgw2SEcan7sS29kh31fapYuhotnc0hfOn95czpOMlXdoyWGMoVxioojeWFuZQw3ZYTJGRMrzL0G+AqPphfZjMeZEUyxHNLdXxEgfXJ0FHJsKVibjoBhFHX64manb9nwASw1HQK+QGMRIcdnm65Fa5ukCNxryNNmOAHTpFGGHDxUxWxlZiYLzGYiU5l1bmy0p+D0AvZGybhgCkh5KK0CD+kM2UMrqdNqdHQnY3XD+lOIcklvdPw/9zaI2/yDyewNY9UoLR0pKJqw1UtRkxRgk0mD0apusQ1nib/Lu1MmcEdZSh7c0AKplPPcM4nZn7CU7c64whob4HZjc9HdpyDjTZ6eTBH1l5HD08vFTM48E47yEn7+4TvwQ7iZ7Yxh68d+bqZ7WiTGA5Bgzmm3sVM9cQ4Mhu6F2YvZlBB01UfFDlNTEIHbwHTv9vEmKKIc4Wtc5UvUrsSXWaKx9ctf4qcJikvea3ytk0ekBkH0b1EeAErlZMi8H00WyxM03Akk3onSRyNU4xDtiFW0LgHNx5gYtfGQNMe02mAnCfrCjM1l/gCpKh7ec4aoHAtU0KCXZlEDjiA+6wlGi4BLs29MgEaCgzFoo53BTBtZywMc4n0EE4lMt5BqynLCdTDpiyCVzgagtPqktr6vBPTEN8WO16aQWuMsQRlhFRbhRyCDNkjPpbzbsO+F3KVfNH1TYaY4IdhEBWKOTQrtKGpMOMClJ2xHSByKowNLSp/droGcLDgHyG596lBIPIsgHtkonsTsrcDvIwVGlySoM54EQgwmhRikWi2c73QTBkokbCmPcjnF3OMFpGVywzUsa+VGIfHCDWa0h2CiJoa0EUqb8z/9BxBg/Hu2tzOQAPrkigGDHmF5tVZ5TVm2eBj0Ua1WibJkfQZQxipP1mCW9jaMnRGpDedg93g4WAoBuT81icIJmbwCeQWUWq+8M0sWdI0UqrDhbcgWaDnp0kixrruf5VWS6Yog+aADdDFgnLHSAtRggFOY3UqJDBUjGBUcpAbnJdSqdLB8WMbt6GKpttD95wOxATcqilYprt6mQ72r59HUTBprzHPdhhMJGgCgBEwVE0HesDTGiVO86AGYzvTGj4mlofD6oSPuEpaPSjAmbfnqYgXgLYxyc9TARCygzdTdENvmgvuqQL0Sc5Ut3ZT4SaVXFleQMm2N6dA8EGDQmOcr1SKazaMzacMBxu2Cxml0yvNDmBeaAdw4QhNMbS70djga1CYfirVJAuH8fqWQ+GUylQ0imaurNdncJVzFdfdwrZ13DrJIlnp1ZsJJjssR5ok+dnF5FYUOihmYZowyaLpyWoha+k5RqMVB/eavFYiWdFpy7NECGvQwkn7T3tLPafM+YTEF3/GoGHlTaQUgIc6ZPfdtDEUL0Oo8Gh60OG4r5IsLHRiKNKzbb4BiKV7mUIpUxucnBIEA42B3sIRMS4HZglEmyGBlmcqRjcOaGAb0HXnIAOQIL6cFXNqpI88HXAXGKQZI+ooI4hWg1Z5WVyEq3eSG89cQsYNusa08HsGLx7NZo4CdZCsZBr8Woqsr0kqL4c6SNZU2q2mq7+sB9Bw8JBWWLD8lE/YAuhtL0BUbPZ3IYDIoCepwbkzkkrIfZ40ZjokS0wAZp5G/URj0XoAcBK0AUGL6LriQCLi88nogJVwZ4TgoEpGg1TWNQVyV2CTzJBvjviNc0c9ZaWayGiDTzhHWqeC00320UUnK6TtPQi7mkNa9gMTFhktiBPZjcddDkPvzvgHALYOachscDDjjXmILTXXVyTZq1CEw5YKQMmyh+YYlQ2WZl2bR3xBs05rIqBM50boEzyDSq5KMbIfsllKNOHIODb386us80L7wWDEmStSLLLOsI5LWIBTeVQirdK/Z+B6Jgk31hiOVIvr6INNO7gEIUAZjnc7DBlT9zqlh+rn4wQRKlBPMoAGY4wdZ/AJqzoplnq4XcF7qjHF3pKEQU/TgyujOYdngbiVxpsYjrNYGQWSxAzATAbpE9O4jpxv0djuks8LeNgWjkQCZ+3yUcyGlA3FOaQZwhk8vGyKjXKlVjdGinPHt0rMVXeuARMrgm8cJgpZPI8fTNAlNMA5WixzmpnZ2uE9A3ewunnVeikiZyZAgOJzbEq00tKlF7hUP1SehHopUPSsMQXZYjKJiYjcmEDuqhkL+ecJgz9tn9PmGLNisobWUwwHNNBpU6DDM+a5r0GGYN24oGaVxZs4CNY+0zEeVJLyuY3eH4x1h6cFetzlPZniJsCegQvgsig+JYuMJMUKix2NLXYUX0adwSYmTwLOXZeP1ZmH7xKObLIyTv6Zd7UEhrQkN5tNYRnUCkzUXD6ZFItZQ8FSiGKz7AqDXFAhJpYCNns6Di1Gy3RYnhcn/7CpD45oUPNmx22iWLvQrtJJXTRMlUv0rNIpMMkyNDW7/GWS4a0QykMElF2mB36HshA+ZJombAEEJmpKRFqu1U7Skj3BSAWEAefc2bOUGOMHNHVOy5U0ItFNVAQy3KG3SR4yQgIondyU1eQv5J+CDIFqt4aPYl5fVg+uXyYUQtXnXNkKpdhgqKnWrBtNTVJWMTwDH+ksdfB5mLH19toC4sjqt6pBGU4vv55gmkRTgVWKhp3YsMUxXCSchMK0eqY4FhfGkZXnMUl1owls25C8CEbOpUFDffdhhyw1xZgJ4tE1n0c9G+LJSv+/7IVbgYr8AaaNSXKOiiUxTSsoAikXLyYztLIDjNBOaEuHegHzA5GBPkuYFudVwD3EdHvS/aur0S/6fMGcBElwMT/fwR00GKMK4+CN64lNizl6jUp1dxGaVAUUaEyzXmGXsUO/CSC1AJO2NccrBuKKcddRofeJ1hR5Y5k9xXwtuyminWAiy1cIiIzLCtKv2JsCv5VBzNn1SVccReBmMfRtGBQh/ZrQr0UihxjZrJPislmhsFeY7mqh7QDJOMmzHNljF0nKOarB2gPld/Nj3Qbt18yml8VspvoO+x6xYYzomI6BCh6elWpogm98OlY3iIwZu8Fgt+z6amHKiobqDltXs/ScxDIExywC6Ub39gvMzJEfKPQCm30KoOEkJQv0xEEPgkoADiaaYB2EtMhLoduf1u+yNDfEXqp/YcQwMwSYzuVqvMeaYeEsy7Mz8WE+BPEcg6KjFdXSfwEfWqjyyVFzlVNG3Xa6SqOv3bIb0QiZGQobKQ/HmNSOE38UdaZoAvXl6CWG7fSo2rnh6wpnJsR/kRFvpsBP4FfWSCQBUrKOX+RPyE0VJlkm1znWAJvK3DD4fUxHrhQYcoZqY5+A031igC/paOLO5MavS51r/zMksjRcuMivHmLGtNR/5FwsLp4G/awFkDpPBlsC5AundwAGSYtNjjAmMnpyPOUGAj1GJ0hopbryXlBuAO+N0SF9cc1TiiXo/CachsfDduuidIO6nSkeVplmWoQ7iFSiH4sIZhobEFryTQ7ljSWHFwPlw0gEy0CGgtIegcqTQnDbRB8K3GM1TIQlsMY1CHIaequNjgQP3muiaj4AmlrCHQC2M+q1a/1ENxwOLJDQBcp1OzimrDFkKwhnHHIbbhR9KNdU0aQzj5RiZBxB5eHvWK3P4KxMPWDC0+DbkWhRl35U5Kk9sPTlCoqAG6bw5R0eOtgUoxOgxvB6X7aiBDyoLjJv1hwoeoWhCWTI++LwwIqNB914MneAjf00dliM2E9AGDKS5pjC0jhh0eXe1Y9qmmh++scYdoHfZ3MOvcToykHE73OocMINuBLwO7w670DXO2XTYLEz+6pId2mMMYuhKKYUniLpURb6y1O1Det4vYSRMn7BVOHCY/wjHT6gvB4duQBgZWq0lG+16IJ6CF9bbiLVSwt0X0B35Zj3NktxxLsdBOIKjVGGXcBCi+BZGjW6Ahk16r5KLaIA2WMglKkHyplBTwbL4VLsnh5nV8a/NGan242S2FHtGdHk7cwUzROVAE1GoFVnUwhPwvDJ7aB1xLL5Su8o2iTeRbW4sYBrNLkU8DKxAjY4lC8ru1YDPOLXf1JdzzHqww+FqMG3xLCbxXFex0yYddAxXTgDdhQtrFQ0buUgDHGLj37StrKwjLuxWTQEmfUvESbtf1WCkoBMLFhKHVXPqkHnUnQiMWnFLT5dsPJ85CBUF3OsNOOtcruYS4GvtvtNSMwZr0Wn4qBtym4o4wZ7pFqLi3hDR0E/ENwfNt0PWlXBwRLDW5sFwBY6kODtpNBsUPHAECKEkkEBU+uzYjk4KhoTni3l0yHH0KAS/LzsqTf9Cxx7PUhljUAje7TLRfMCNL0WCYF4xjAikBMuLbcc4OPU5wzwcGlJWVMqLRkswOp7cSreZAaoS03iE6luSBkb4xFLdeyBDdLYwNTSNFQtCQR4uiODeRpu98m2KIKiWX+FZdLUuGEuDb4IuEAZYmEdZApsGV58+ECthgR0jctPhdsUxQqp9gg5GNllydYOlEzk9SVyQvDrOm+uAz6ErAR6JM8DQL6BQXmdFI0riYXLHXXmVO3U2EoXILqHLkxX5IwZTFr5eoS/7t8SOhfKMDGFrxkZoa8QfjmaWpkbYxELUjWyoAw27HKRnWsiaQNJuh7bcSzuXGs+AgsAz6I5yzTrUVtfYFns7iw1wPTRVxqIfscpgA9LnCMfTqfKmmZ+Hrg/zDvNf7XCwUxBXJpXIuhw5xDY0e0BV8PaXNOHIh7GgBAYgSqzjZXSo1CrJmao2o4bEl3cjZ1VEL243OmBU6Rob83BbO3bGSrgFpQJuXbT1Q0cgJS9QkTQp65dUaY0MTTmSM3tENrwv5Qg72utRS+6Dc9o110BqkLCYKr8NQjfmTlMUsjlr+jHwoNjMHDtDq6GiYADmRkOdcz36M8tXgFIbz6gu7elW/wNxmlOrJpngMmJt8KNyqXs8xpkNxt3UilCi7Lm0xwO9oYgDN7hBojaWQWA+IDjBj6+gaZCzkD/jv6VLKDRN/JzIIpFgQNjN4YOup/ZE8AHUkcOJtEg7wqqjYlPYFcbGRvQMygWcpN61gNeANAweGEc87PMQgOhAl0pG+NKSqQpE3WFwBub8AawK7RxbbLVrqoA+2vGZ6chjiY3y/IFoSgEiFBK+/wSGMJ1Bc0y5Dt4uhOaVOW16t+dApOTk5G9prCZlkQneMAjmCMvV8j6OA1KLvjyyEVB72j8thZuIwRvMSLNOU49YuXO9I/uOanoDqYXA3Cma7BZga4vC8Ufohs7mW5do1WzM5zQD3FlKHKAyejZK7YNE+5fYPaQ2TfLPCxFQxYCpo2FkqYbZ7WvkRhMVKDgqvRKOnQvfKtrC3qrMuwgSgj+cX5hrFgYJuT2MDO+iKxfTJCxHCCAvJgFFhyRDhHHyM4YVzkjTWAGI0FdvknOuiUajU70sgaIxBJ2MTSWyi0EG59om08HHV/8RKbBSTvb3m25KwAXmVznHHUQAQxPa8FB5YrXIKYLDKWhF7udtmPJuvHJoCdjYJrZmRVwvraa+sIkhnSPVnJe5ReCwnJA+vANgmixwb9vXhcROnIjQNmdjBZi+B9thlpBUDXG/rVwtyazwhQ3o2LsXuM+QHMaQxUt/ijaEqJi5+ZehPxC7Yr5rbbzPwfcNzCyjqR9wAwCqW401DtovGJM0m+VnvFabfGxBZgLWrbFTTQrkHZmwCzQ8tFv4pJLazAcoqnLJ+o6sNfAHwWQ31XTo8UAPt95hPHbKE9htb636m9cKxhqmm7lBdQzs0mdgiHtu0CKgSZ05eyMN0EOkNF7ydHOL9gTmDPB07jhOQyzYzyaXqcAunRYhsHhoA9r6rgZoYsRCvBwQl3ZHJKC7DsVQpmNshI7ePoShcEYVJIrrkzJTJyF3tOldOaeOcZ/HR/GjQW5bnMtsOUwoDZDgeBJGT4YuR3gVwhvY1iWRRGx9DI/DNnJ74fHnhvsfoiRFPQ3yVNyrJkI/kDdMGSmu3WiFQoWOQU4+PvdKZwOiJAZZa1Q1bFkUIm8ju48KOebEWVSt52WOYD5zAm0qUp4b1GhC2wVLq3a4SJsdJcyZ8nx49OuWiO61TL5GV3UiGl9B26YDOCmkylm6BcBJqMkvXuIq8BowuAycSE7RS9a0SAXJJSwqMQYBUz2O9kJ55CmsU3E4EwccE7YSka3xahlW/csLQZXR0Gf/KI1oUG5AdUM+RDH6MF0wMIkLgj2mlPmCXY1mW65lTov2QWmkFYdydVGjH21hQJQ8VXnTw+brC6Xp4wDoWAjQLRWSdDoQQ6oOLWbDsyt1PNBgRU96DYFA/EJaMeFC36ExwqpGezPcvAt5iMTmbH6GWIJa/MkxzI30Nlb94Xh9iUYeGmvqwZLAJ/EGpRh0vy035u1545rYEfpxLWuI6Rm9FXDfeEI6uWaSJfJK0oSu24z6uVAJYXCD0NZutE7oDeZyqJjh312XS46+aw7QIZoL/TsYrjWOM+KfYbDztegS4QhPPqCLAcndSREb4nRrFadLbAF9sSUN8azOBVNlxWDw+GPcg0pDFIImnQQ9vI57E61Upi4yekbniO+hL/ZYEiCDc+uP82nI0Hb1SyMI9OPwwBfYB/kO9z6gyFL8BgxzdOdqQW2asanEK7bYbsUQErMraag5IjoroWq5HXFSrr+0ihorsHdxRCf5HLQ0qiVgbh6OQZd2WQxA4Ehl6s1xgg59PZohMoyEEBpPeghbrXCFD8WR20sRxruU4WkFFeKQ/lThGFq/KRd2g45Zwzj5KSmYacpzGNaCDa4LqViHH5Sp5SqAM8mi02R9KdoAoL5YSaH8ZeeXJiFVPHRpnM78BD6wnYCCWeAso0zdaho3WQ2j3E68ZAyM6M6AzUs69XCfDMCI+oZi0NmLeA95MPkGKBbbQe8XgQDQeWfqWDmmwxiKgsFb/o8LGHhjLGiTA+W4XcpE/D6KaJ2HSsTamJNcM6lyZi8kGx3SSO7uRaYoSGKdToq5gMEVXVz/n6M42bgRzuiYt3OE2EH5b+c6WGSboDRccrA7DMt1X0z8klMkFlJNTtvVxsOlaoirm7jtwq+PjHbPjEs0J66QXIQUhwo1W0NZg1gs84w/qmxzuSARpBJg8dmFJpHL1FBz1Q96XE0ekynKcGMNuCTtzifTg+q4lykzhSytZ0dXnjYvCHUd/eE7hZCOEqOJrUkWarcLEjmpHbdbtIl0gK0TV+NJbIodJ5RqJLHZ8KMgC/gZgTZFp1qLmEVo60ZydJpRDSnU8c8GvlneDuW8COvjS65tQV3nB1YRn4ww/VEtcQiQqADlPsCdaIjsa80VDUJfKYMlB2TbEyClvqKCmo0lto82AojfwE9o/jA5RWZBxIUlym7xaf9JwiM8bSjqdm8FMTdswUlUvIsodBXTwh/FTzZ1l+K/Z30FkWwKGuadxqZlOqk8dv6GQ2aq8JERyh3F4PXH2BSOjWJhXqqAzeSeyb1itsizexGCCyHxvy3GZhBa+1iKgyQ7RkWyvKIQMdHI2vEJHBJuAVYmYKnoBDWGzeYAV3KnA9aeiC8clqiw03DyFt0hKndFJgHgMrCPKAgyoVP1D8TeDTkZHWzEuXmBrgKuKwd+dyYApeYAM8QAeicrXkitbJEpINKtVmzFQZ9GizoAbRhNo1senutVLMneoG+KjixtFraVjsl9Tj2ls4jbK/b0hg7yyRbWlac8wwHZqXleSbLsEdESiMlUgobral/FkYZjxgzQ1Ru83uwbqxzrBFCe3LZman7MBiFPknn6LZEwlTRVQASrTqNtHaQoSnIstNj6A3sMWmkdjc6Cr8sMYeOaa7JlV/Y0AGHyIyZ29bRZZxnpfxzBO+4bWIKXYwqYbSka5WQiSAenxAouQoA4sQ0oJnBDLpGAeZ2wKvGhCemktiW25hDkWgsAAe+/5iKHEAYrsGTbDuz54E+W6bbddhFXeULdCOkeivDGmn9dApqCVaEaH6pzpHI+njJQb8rAwE/utNlDWwf85l1Qly/P3O7IgcDkUbxczNo/KFFFCDm9MjeBLFpoom62eIX02gYhJAH/EHrJwj+0qAEBO5ndeXRTm82jEwrNje7ua+02/8uZaLnnDjujchAq2XLCmswBa9477ZLjHkBU4FQo6zkMlY08BOxaY8WSqVG5wdQHypEemnBhzloBRMQaBWDFYncoXHO5D1Ef4iUWUxEcHpvwL+8xHslN+KhHTKUpiu3pL7gzj7+KA2/MiRIqtPlILCB/cjtKtaR0uGfNEdjxMlEfWL+ph5VnvEqIbSNZ/PITx4cUsOWKjKsx9H1RFuXZYDVMw4MdDu66GahaHdntlvUVcyTBrdih+ylca7cjtKgGtxBK+M4qjN6TKLTxzO4jpJTUvA0M0MbvhtmLVi6gQIL3pj03IakuByglAOwr0mixbU/SPf+XghHZiQFCUMdQTwZl4ZPwVgqi5tAF9nY7KBIC16MyDF1d/7oOyZzAFgfKl4bGB83npYi2LbcQS2wMTI1jhmX9q46exJrmG21VeSjjAQyU3Iu80jA7/BxEsGqiJdBDvAuOXdiQQSkUyBBpa/JwasjgKbnnMytLapqnwr8STHgz1n0DGGvNpUph522DXes5oKTBm4ZXib3Tl1GagaFGsUNZ/sVcigkVrA1AbMajwYzTTO3vA+4xkwQD36LtteGRVXgY2uAJHlgGdT3oUcyqx/wocq4OEabOqoxec9AH+BHiHEZRvqD4SwBOqKw7DZfclrgTQ2mcBNvdjiJZHiYrDSY1WxzGPhzRIeUqh0qDFIqyFpBeoMMtpFpTD4Af9mLo1GIhSroJzYUwKQ5pz1HM2OHIAH2BedN638XxlQDsLcqlWoaJLQQmw9HIsFswcpUN0AAEn87KLoGbSf+bF5c4/nASs8FMMmAksqP2ZnkJBI9p83Ny2RiaYaYhzCGPtX9t2r6KgaV2R+RHXO/zzcbozLo0Hd99wfaE2X3GGgxixt/QWlHLzQCgdu72VNoS6NBljH1jvRAt2wkMRYogIsbxhTd2eCT6OfSIbBo72BipP1nLvabsJpnpvWSwJif4DohV46eSAH1d7IHchxIAUVwFx1E0VvGLGamuX2nryGhmhvMVS7FDPfzJB3J+D3jSKxApAfURWFMLEM+2pNMIM7RutqJylLeMUsbilEXvxNtgfCX2u8Mi7Pncy2kuKOkpDhin7OyQ8GLKh3QB3XH7ibjCC5sofrPU1g3CvprvVcBJO7omGYQUco3xJHygPwS08Q79beJ1+Fne/WA8eGagFW3j0oheXZ5kxA279+VzC0VjnXCb5g83o6BvpTegxLLcqZG1wrNzvDJ2xB6gWGB0Tg5ZjnZ5FWKGaUx9Mi13CIpiZm1ma4DO3Hn0Jh3Sg6DPGOzhMEdnBfnsy528mYPLybnUcORdb3+HGg6/1AlmXFOzjjSL0XjEEkMTxcYaGDOdMPjN+qkdB2YQUYKSJGZDrF71GAr0F4AgGXSa3b5fGYCky+Qlk/B0OmgvbQOYmLQSg44UhieUDtwmODns8heObcNilZAyw65AlZaWoFhk5XjZplMM1QdTI9s1JVs5aHQXT7g6ljcnGHpZJzFTGU6IiybqySrVWjmm573DJj2LCPR9eDD4ET1lqmdlEcdqQgIK+kECoTRfGZpLbSR5F5iaJEve8ljk0kiVacldfAa2rlibi+w0ezSqnQTBJtcjsc10SKTo3sAu1fwK67m6pw5wndosKWqIvnj/IkY50HkJZXh8q2dSeFQPFK3dfgPnWzGdAc1ymK9GZJTeS7RE5AoYZmEG5WAGI9ExJ9dDpnSWXAgKzaoLosAsCDGz/bZcBRdbpCKDGG8oj0tgpvTC/4khlSQGXKwS9xTkhKwSyc0ttlQegY7hTuYkSzBZD1Ec3xlPgyt6tamU7OblCMDyG+eFLArtasmWWequlsoBn1BtFZTpHGtm0gvu047JNtu85eg64PBaaFv2GQm1sNKMQq2FxjPHGADSAVcK4qMKAqbb4bNeVeKdfQMmRQPTGN0bDl0LqGx3KgxcAFkPOyQXoInWhLGaHDWuygKFsRWow9bX7AdBHJ7igIOCd8yXM+wrH9MXobhrqVPjJ0ZKdQIj7BYauvAHEN70cjkOS7KmKpL9pSp70Wusm05xLYy1Jel7Z7MIuin5U+VCsOkzeLCo0B7F+NgXcMe+nsyJKiBXTGqr0FQoJNPakSRrzvRoaPhJErkRpxDHzINYIE+F09zRdn+w1y/85Lx/KB25mMbJMQs90y3ay4M8nNQMZgYmXtfg5jJZNsC2ySpptJI0t+PUGRwoDSE/iJ1N9mXfFMOVvsU/RkOH13JzUTHr/T/NPkm/ORotejH4RrGcYSPs8i/TKQRZH+dl1UDVaUgca12WnG0TU+meDEY08JrpFMYHVkYe8UkLZtDi4kmSwyeSe6cyB+kdCuPFT6LZoBAAFRzJDtYfuPhxoikmKeB+nO9nfnY5UY1iGSXa1usMVRlYX5ipIZtqwszt+nJgrbY0ZsWOYAxfoTRR+8U71ZTOkpM7xTYw2r79WGCYyZcZdqskabEjE8o6+R0dVBQ7uAxhVQuDGkxmjOcKw4KoaMjYWJzWD0A/IzcYp54pGjc4kOXW+Sf4XVYZoUC+X6AtZh1utgZ6WtfsGUJ7kDnn0ArXfuMFA5hk8uIwxgGEW1Ak90opQPzedhTeliKM1BMT1QsoPgGWJNviWdKiJ6Srq2l28kXhcOUO+vPNCH3TthF/PJGwtHgO+hJybic0rpBhmoC6z7gDqrkbnXuTGqq1ANAOXKDkJFVTwTLzBOy4XAbuyFFEOyRXJd+AjfhWo3GYULUOY60LsM1Y5ZDcJBquYhvbX9v1abqnivM+zQHOacruNdpBV3IDrngAEIPKEAGgykdESKk2sxsHjFwz/lnk0bkhVhdDldzNAvUrWLEIzTU3XHvr4wuZcggjREjuabVcmBeqxQK82P1cr5yQWELgskGz5wF9TGOkWmUMF25ySsVm9sijSgdsLpJizTrjx4IYcZkOJkuR3SVxASHzqE2It/aSQ52glkLLYN/XFYU1ok1gDbm+AfskTIsE24dIcc8Yhwm00GqG2aEd47CbzrToMxM2bzR3Q1BBbkB2KmclYKxuQBmJ8FkpF+eBJKCcya11k1fiLzDUJBaqArXnDvSx4aopp1dcOds+xDZeFrBe9C/e4LHShooKJvlSFtOiRTDybSigE9dsaNHkw8guMZApU8QVg96AvWvw/VZxYT5wN5L8nN3O0UGp8pKwTwCV4fzPJYUpBsKIvRF2ij33woW4k7Njs6T1Y14J4k/l1VqdQ1mOOekwFuTA3YNo7+Dl4wCrTpFubzaUTYx/QA2LwYjZgfChPqKmn3jBOic+B6iSls3w6GYKuDeiYGQhBLaWPx0S6y84HRn+It8Yogu17RS5qWMtLim+RwNsUw+qCnOgTU+sEwOxqsv2ZawgLdJocuiQxdSTF1IkiIVpcOiPSjT5rVhWZp6UNCalBxtaSJHfwAEVI5mEmZ3qsDMfFLo47AQHe7MGWQ2EAsbd67QpUFOhpifNg3LFxKoQkadYq9sj3cD+hwOih7aJDDTkd1gDaio46FtB2bB1gUMqMTfHNLJiAzwWlH7cEx29Mfo3TPTtXGSXKIVdAlOwmhkBquJDUE3TGZIBfa8duvO0aGTOt3gEMvYqbQ5Jg5RY55+kCVc/QyV0D4RnTiHgrQoiTHwQiuazU55njmw2mDGbEco3eiJ6geSP+zYI0VdMbpVWp0Ssh+3ikNHp2e0lDgnEaAYLbaEx54PlM6PQqIzSKbdjHcGeVKzGFDgM5vWeSl0D/4eWvWA9+B0gFyBSnI3Psf1lCmjxbuR7nYvhawwoIaBx8NOvgkG/iWGyPUKzYAVlQ4FETKwmEhe5ryPGC4OgIPsmPt1+OTpkAKx5RIZJAYlJ1I/AHbdlJgCvx2T4wNqMewryUcNwsMGY/hiJz7q45JigGdlFr0D67cDxPfaK+jZ8jSQkBJIpFroVFnlWFkyCoiNE31s8r3eV2U22YqYqHFM4tIhaSfe0UBcgoRbqs2S0UpFQXk4g6NzcULF5zG4O1hgLL5KEjCRP9gTqFDY1HCSO7lARE9MZbslaGsoTD2c2gZbfu6QIRDLUewwVSGGcgeteo48nvG9qMswmBD+M3mffiI81RDmPAd/sTOTcT7gF+j6aDHahx6AEfofey6LYVX6OoOxnF7a5swf0dxQlCQZgzfZdWkFBj8FR5seo9u3KoQIs0WOinkRdqfgt6SeDmGZTbbjTeB7JAAFBojIzD/djjbNARrXDpQie99iSEl1yYQlIDGwRU267oxKUSxPp468zklu0nG21EMckEGnELhq80Y0NKHMqeyvTvcdYkgFXDT0Hn6KhWSi0Vec+mxhNiiShXkScEtbEmFZCWkuUL2jutzgxJOHNyIFjbB7o0mZQfFW0WO6PsYJs3U5phErs9mMgizU14+tP2ARnIGodL2tzBSQ5FmKvq4wF1LqHi6ty3Zm8kHEvBIlp0r0oHR04JzSpOjjDdL2VdYuM53GIqphAMGVyagdw/a7yOOjDCIXCaYuU2KhNbKsZDlrpKashGb45xmiUuH93X97Rk7BYxhU21CxOENGBIEiWRl2N30YVQHWJdyOdVo/ssREi1Xx/tA/3SwbBfGwGjHEjNHhRvLpfClhbGKAp/F5mORVo4lrgdauuoMP08ERq8pQ0NXRDwf6XU4EPE2LfH4bxxHFQDkY9KBO64d7KqvHBnCs3KEaBxlH8NzxT6d6FojtB7PhanB9W1eKVmdaaaG1K27qFK9VYNZCr61OBCEOIdO1BMCmuW57Gtqkd1FAOBTJpNHofcm0EhGlrLahbuLJ06bBkOdPjBxEo9JMETPM3a/DhAIKhi8Wk0Tq4CsztCAFZlqHrWIgtRwe5r3KP3TzYyV9irOLotMj8M0G8oBA5UJWaDddZogp6wz9yzB66u08pR4MUKUDLHb4lnQ4lm6oXTKZ0Zhy1N8SnZSK4u0QuwoMC9ZRfhoX0QWx0N41EuIKAbJlPiTWG/SSVttKJCcOl4TUKSREbkIPzONgIKhHIX/WiwQtTEhAF+9qKmILc3cgyKbA2zwfC2luvVZjQN7qJnge6KGApnCl69SDmzqYegbkwDnrog3GM0UrW46JVtmyN8c0Tqk82KOH63kFXIEqoRjJ1FEfxEqaqPN3EPYWhsM8SuIHfD7XcxzDd5gYThyXulORFFrWoI6JubzOkQPTxTTaBTYcO7kYfnqmrC5ghswpYRY2ri7BQ3FQReANDKNkoAhZYYsrGgxzQTuNWdyEFGiJq6S5hhs33CEhKpNySA1vxlI7HXmJG8E2FEeOi0dmf6XhV/ZWb4WqsL4Erm4mNZq6o34beMcw/NDOlF1juNzTsi4TZDKRnqPHB2a+RkJ2guG2iVZYJGMScYSQNtFChWEGJJpRrpbvNnH49e8yVNbl0NFfZ1DRjGCZt9ErzTSVKY/gmS0ZTJ/HPkYpKUefkKPCvQ753Pqay9wzOjQxCSVQFrgz1pLRjaCDmo+Uhs4+gS6hhRRkowMNtENwMkd5TwfVHqkBhSx2mczVNNtfD3pxRpushIfZwsrSQXoRPZHJnDqCJ2zECvY6R43FyJRcs+M4ZKmAWRyzWj8GfMxkxJcyCcF5SPRbEr2DFTM1e7Kx1PUYSAkTj5/HO0kvUI2Fb9OsKHiiGM+mp1i6UZIK9GdMi5FzpCAt+25H8PYzBgLQZ+IkmoSVdFnv1AN9JZzB6gHTD4yHBSwxbDDiGB7EOdtt9iAaHoFGs2Q4LLs2aWGKmvPOxgEORWqB0lS1m4UKou+YrbMEiaoDANJLuKTjCLECMcG+pDDlF7aq6MrOroszJucSF8LvlqtrPGOrAJfRJ1Dp0rQAyMkY4gR5SafU75JCCYIPRnskJrSYBaAAK6U36aSwNXsAtXJOoy+646Q4c1YZgQGBDhlBh8IiwYhAd6ZRuJsCvYYRhBRb4CWdQgUEpD0qPZKX5vRxnjHNrcXsWhfCDViA6OeEydbZSDke0riFuZiwHBnvVK8PCoKvrtDDutdnVgu08TQ80/jgkl01en0pstAV7RtkCnhyOWiTcUxOpIM9QSaa0qXn7NJqDrQOAyxdM9aMaI9pn2Q63ayjogg2XH146Lhgp0gS4naG8h57b60r+yEOw6NQ5BkyExEUZHYxrNRPy0QcgCWBtpvfX6ObkliS4MzyVnV8A74FK5TN31AEyTMG9jAZ1+UaGIjZmJquI2hiIzQPLy6Xh/mU0yH/KTDKnJJw4LX81PAVFA5EsfCHOWeWFNrA6ZpB2OlTqCmAx2Ags6VOibnRdKYV8I2u8yGIu2jix6NZpIMstinkKSaJVltgZTBrZapeX2PMhlPTnQoMUQrkEK6bKTj0Z6/Atkii2mxPNJYybBLH11SYgrCQ/mAEahSTGQGtmtFnUAgolvPNPFAu40pGftQpP3pJepBvBsuZLxuRkUeu5QXYGXTgupD+QRuwR9ZlvQzFICAz0/bn0YZ8AoqvBEnWTaOHsUjxrjReeqIpWOsy4M6IkB1ir4GBZgrVCmrEUgfRy0AjC0fa4WUVTbX4uBfSM24mNL18DNtDYVQ7FQ/fl1rxpL7dXAWDuANsRYNGgWYqe1cZKobSUmIcjsC/wwgl7580ax82N6Tf11bK8sPh300zHSlpphKz/oHysAcFvCLkRS48y7hIfFSCZsQDpgB16pYK+mBY8koSQC9UdB1yfLOgQXx9pI7JdGp4Iw3FVznOubHJ6xSYAixKocbrhJRGP/oTV9ioHLCrrwp14cbgDLr0LY1UMrxBs5Zw0W3+FEyfzMkEheg5ZTvA00S/diVS8ievM4eSW06HP+4wwkASzgFNrlyv3S8TCFaKnhbrzYEWXOhhS9rS4lKIneEtk0HXU9+3s8VA/sjd1TPQ+2VNhIwoawTTia2wLo1B0PRlL5CGOgeRxnFqzPTJ8PvOQ+IpCaKpRrgiH76MfpxZ0AO4hGUQkYMGBjEPFKrJNjZme4FrStF/4ECdwNQHQTTOcX3PLraBVcuH4NCX7SXd7QdsKiwliRj0/D7bRFsmCUmKd+aUpIgNF+BsddTqUAjExjBWKpbBpjoaNpQ+ujnTIcUAa+t0EUY1/E3SaBaBygGJAQ4L4zvcW8FNHIleOEuHQcCUQwoJpY2yTDdtYURTPEMaQbdZ9NVyiMnQQPvqtEPQcFBG4MogpJFGcfqEObTkRuFDc/0UCiNXaILRUNJBJuKLESstpl/K3XSt5owOaTBmMUKUkTQuOJEXFW1UKWDqVvjWGkWTTIbMNT7AMgXuvOL4U5mwcdTk/WV8GQXsLCQsE1SgU/AbDj8jmUQ/w93IS7r2SHkSFJdpKoDDwc3sGWjzynx36nyLMxJkPBSe0HY3V8mKH08efLHA1SIz7iL+2ei6igYAWzeNSQpAABTw0AJgBbXTScZEGLpTPUyW4uqEvWJUF/GvEJs2EL1oVYfoLuFyrrCmMHE+m5eiFj2jiYv6FWtmfn/oC0uZivkJ5N1EU20QqWF68pnxZxtZC82+jEDUQ3jafb0OcWQb3TLU43ZF60GG1hzv/BMBt/5NSjXA/9bvKYHuygon8+omBMAWHBC0GN1kw/gqN+HIvEQ4293MeVrYoW6bEaEVj6nkoMhOVuLJbLo05MziyxUInWg9sr48AyxSTDeTY+NUVTmQuW/hTC42kpWDTsJJT8lGNQOF6AdaSGNMKGN0LFM72SudJ12k7dC1XTL0gjoHeBGCNPtOeciUJ7AA3eAGZE+lxwal8xX+COefSuhGpe91IaSwzf7wpJNHOsI1repToDWj60Hqx+FEC5QocObJBJB2cDwTdhwIXIolDckneFeXtKGeh7MLVZqjqgtyasJwqiAQu9nKZpWKIRxkMoGb5gfWuIMPA2ss4+CUiJwy+gwgoCIlZculIBnoykhBAeRqwNxuoQyXp97KDUNCM7CNk7Y8gPQ2HI/y28pE+cWRRlTAzssoZKwz8EPPABgjqFYYk9wAskL3aqYfk5miduBvJXQnCT2lH7IDSa1BYw3iCx5r7xUOwAwJXEHTBrikMRBiCH9pH5tGgxa4qugca/DaFDvXi7sC/VgUapOPsUlbWrejf7Uz7sO1xcSMCQYRQSduLWjUVGWWkX2LkE3h7IGh7+C4LYm0/PxC7A5fiLNK5XBEO8o3YJesUwpHaK4QJXbPRJHkP9LeD/SERI+VKPpFqWoFL7untFzGGlMKMxxMbqPKIXKADc88rJM50onMHqSIMKB5vv2AUCZmIxASulBj0uEcPIuLM3VNH9O5yBpJXXgp7QzFlAWBmNny31DUWye4G4r1LhtAVmUNiJ50pW0wJvuKN7bAumtbbACFNqYNK2o0PnaKNWpV7hD3dFzPMBYw66AEgTe0Ke6ISo3LecbBJ8tgRf94mHMMU6ymUj1+NxdmP1B8h/FwkGFxSLoaHX70DGUpXufkEw+SLQ9KRtAqxneaJLgo1+GRUKu2R6/CAENlT6Gb8zTo2+1BI70wvcS2LRfIdxg4DfXrdBOHFwprC3SuFKsWSxkCrRGDBTvNYK4f8OiTMfNXgWN1w2HZAeJ8bDkZXoM4pgaL105pmTSPTS9DzgeHPzBVl7SNYq3szgTSsDIg3EUklZqWIo01Gs2cR5wQVD0mE64sAxWp6EJ/F3MeqtvVLCtBlRYKe4YTmJCo6q2oftWFmSzdDTuhhSfpf4Nmo23cVUEarBkL/fC0mrs2r8wY5wZME8p9Rgg5z5eSYuZ5qUJ7AUhpQIETCCyTkmk0eg0ZXdKXEkKbZJSPKj85AS2RHFjCKn2Cjex0JzlCZzTAh3bKufNL+LtLjNBpdrRkJ1cPXVrB83BuL7Nj6ANdesybt9WdFGQZhJmQSjqtXoAfAVZZmIzty3VMbsA3hubGnSk6AkY46D07pFA4Xkzgg3e2dDs6TDKdIcyYjNuGis1tKdjoSuPmEYLrlGoejLiC9pE5Qp8YdoHekZjm1h355ohReA32tc4Ye5c6QusnprHJY/AdiUzPqKSZSkouHwtpRaLBX8EUORxbNJHvIS8aQgRF5k5NMFkUWqEYNOZgamWRnEDURV/ecKAKkLc48gqMKP86htpOfEjhPdERlFxVWR7qEsTEGT6U7mp7gdQYFe5o0tYWnB/jBxMDwlNxfkrkDojQYWtjCK11VKLbAajkBK1qD0qQGcqdAf9RTeDBZPYRTPbEJ85MwoLUobWg4635dpcMPACyZyZD2GTYmB/SRTmRqpB2AJWo8L+tTlDrYcDLylkNWJu1JzF0euKBzuEYDoKklyJIGwxPcUJFy0Xw6ulIE1T5gVi0xYFqhNDULABjSSa8Pkyg1QZYJusjVWQLfq3F4h8oKMPAQYd5N5NdA6RaYjI7XAB+HByVEI7TCmWhOf0NLl94dRZmjVXHQgQPAfhk+khjGKtdU+oVpFs6U+dddqpFFhp+d5iTbMMTFbtGFgvqb2ujJxiRGrOCPUqNdLF2HiL4YcPOFCDZKK4xJcEVwcHwM2SowPrczYNOZszh+Baa0iy3Bgk/ZixFwW46xh5FvUTFTKwilWi0JCnjFgsl/ZcdSigRS8DNLYNLLdDx1XD2gjKIASbdZcbKYTBHfVDeBS/gB27QP0FjHozbNrtOR5JUCWHSGLbJXMaE9AnOSfFDhnKNCdEKJpvVO/qcqaKAj7Sv1phV5iviyQXsPltjOoKqbFmDBcfQFNJwojieFkZ8aUv2PlMq7NFAk7lUJzW4SfcazCbd9ZhrQ2vKwXUeEzv9dEP5sfIPgwXBzoDVksIRRBsHVVvjyCa4ophTDHt/h6fSkzO36LNtjJd0o+Aq5BIro4ag9pmW/fDYlcVi4SQb3RPdIfoemDcQuOaU4hwBUSLmTSbbth6kH37XOO8cfZbripIiP2MC7gKXMZNScRC1t0aX90OOxH2hi2y4htAoVrVonF3L8gl4Jj6fghN6nhY3AIQsVgdtvKKmhytWt9inqOjCWOSln4E8ieoW1WpL+qw7ydVew/N0FUjQL0xq5PjxsNaSgkyXloAg0Y7LlYpkHEXtOPOtu/5NyExxoxiKtEw7lAjwVwseAn3oMe8LpFZyJuhOGdkOQE4V/GyD56K58RFYcshWA54PCstlUOi/18d94vf40YqQRiQQLXMtn+pKBCdFYX9amj5yqAzBpBEZH9mJdD5wSoLPh7215A4rrGMxI2eRYreJAblxK8lD+BltWkge90JMwuFP2XU8gDiHwTtmksS8VPPVoJ3UYcnhHzk2T2pL3JFyrcE0JAgblhnYI4Jol+4F06BdgiMsxYHZF+lC375UGQD9NTn40UBSaAYvoNWSr0BXZlLQ5QxzjWPIJNupaEM/TII8GwctRQqbNqu1BMGBH7NDaYD0IdT43o/uWJ1ZKjNjrdelswz+oNDD4KB/MReAOWdrwZVPJofPsFrwHB0Gku6AKpQQKtRCJEWkWmzb/tqCP74cg3inUYAGVoVkuLQuJ1QCejTZ0tUdUskz2iGAZ2Cznc9DWAQ1GCOgu2tepGyLnw/znZS1nXGBzmnBzOtqkY24gIRwxjl10yBgn2EGHTR+NO7vZs7//ve/f/aft354c/W/fr16/d1v3+ofP3//6vWPt/6oT19d/fT9rT/eevLm1Y+vXl+8evO3n9+8fXj31me3frh6+fbXN1ffvn7516vzL3z77nZ89d2t//ryb9z19v1TKxP99MCxR/TBrr18duurZzkdH7TDAUcvGaBpAtbPbt355t790x9WuBUkp0TcOi2f3br3r/fiEp2lrdCMCHto7vqrR8+PdywMJJWwwmsHCfVntx7e+WLvQZ49PuWbACIDM6RjsSt00NpePDv9WXSRgKxbmMKedMfLr57s3fHx3RfH58jSmyTK5iqB11PyjM+/PF4b0GpRwhygYLTXesjnj/ce5MEXd49/JgcEuBhdIqBX9Rx/+nLvOe7ee7S3iE8fXhzvx7BuIvQS50YP+Oji692Hv3h45/Heetx79nBXRJ9//ej09Gcg7Ltf3t6747Mvnpy2cwR3R2DpAXi2z279+eHpKemFgoeC3gU8FK3wxRd7P3b7ye4Cf/7s4nQpQ1xMqEc2Tn905+mz4/3o+qLeqEcgZmFBnn51f++37jy/1mvnj/j1o8enV6ORXnEF5EmTmJ5nvK58n9/z6cOTpTp/ysdf3tn7q0fPdxfk8pujWGXmPcHj0gtMnPH8Tx/sSNwX90+Sz/z6NZCJofNZ4Puntdpa/IvrOtWG6D++93h3kZ9/dd0QefYod55f7q3j5bUYkH6GXLtDJabgQYJ1uasnHj+8zoCc79rlN8925fHLh6c1OT800i97j//Fs+d7B/TywcXept178Wz3hH5171pCztXBo4ePdy89ON2SKAMAhrTrgA8cJfLF3mL96Yvbe4Jwcfv/2RWEuy/u7L3153ee7CzVVw/v7W3n5Z1Hu1t28Xx3qW4/OZ7d8/e6+/zFrjBe3N39sccXd/cW8YuLaxGG8pJBbDJadBrr1+5fPtlb4DuP7u0+/uW9i92HvHN3Vy1982LXsN7+Yv+Otz8/afdcm4JFuhGg4ZYHJ7N1fZzOD+H9kxlP8A8VhlCB21mn3u3zFxe7EvL03p9PK5llFzrZjHVIVvUcJzt+fuXOtR08NyQXj49a4qOfgZFEe3b5dPcp7lxcx89n0vj40cO99/rmm3/dNT8PH+391e0Hj3d1y9O7X++u/f17aVdfffPlo70Vuf3o2c4yPr63a6ofX2vUDf195+lJBtpsM3I0EEjVVrHwz3Zdr7tf7on+o/sv9m746OJyV04fXBu0cwv/8NqFOnN5br/YF24ZhLKzVA8uv9r1eO5+fXtHdJ48+3z36R9ffrN73h9ea5ctXfDozu61+4+f7u7a0weP9s31o692JfLrh9/s3vPiywd7Avn8y0e7r/7k8tGe8nzwTiRvruXtL+7t/dGd+9eee+lkWBUeLfBP6TFeXLzY+6tnT+7sK9VrX29jQZ5/ebl77fL5oz0h//rB7Wvn/Uwb/+nzP+/92dOLa9dyI3S6vPv53t89e3hnV87vXyvCjTd4fOfh/ps/ufZuNmTh7qMHuz/4zZMXe2rhX5892Nu723d3F/Py89u7P3Z58dXutT9d7Do4t59c7qiMpy8e756cy8/345b7T/cdkruXj3evPX34fPeeD+88332Wx7cv917u/rPb+wb4wa4QPb6OHDeW68vPd1/g8Z/v7e7As8/v7l57/vRif1Ee7BvGi+tTt6Gcnzy7u/PmxxTJ25dvfrx6++1fr16+/p1Jku+vfnj5609vv/33lz/9esW9M8M0mZfBsCyJ+CfzKMff5Cd1u+sHOGZRTo+bo1WxoAYbfbv13UtuXDktzcaV04JuXDltw8aV0+ZtXDlt+dbfPNz7nZNwbVw5ieTW3Y5yvHHlJP1bv/Nw78rppG09wdO9vzmd6q3febF3t5P+2LhyUjpbv3NUVZtPsLc6J624ceWkSjeunPTv1uo82vuba2W/tUFHG7G1pEfLsiVwR3u09ap390Tk2vZtrenRYm5cubazW7+0e4RONn3jyskT2HqjJ3tvdHI6tu52f08UTu7NxpWTS7Rx5eRHbb7P3pWTy7a1cEdHb+vZHu2J6cmp3JKEx3uScHJgt473xa5Sutx7tpOLvSXaX+8doZMzv6nIjhHA1iK82BP6U7Cx9UPf7F05xTVbV+7vCc8pgtp61WPYtSVwuzru8a5WerwrcKdQckvD7ArcddS6JT139wzXKUTeuvJw74dOwfjWCz3a27rrsH9T5PYE+JRi2Lrdn/Z26JTL2FqEe3ua7JQ12VzTPaV0ys9sPcHne4twygVtLemLvd85ZZ22jve9vbudMlybZmPP3l4n0zYFeNdV2jWRp2zfpvk+vtB8l0jcerc7ezc+pSy3dvHO3rudcqNbL3DMqG7ZvS/2lNopd7ulUR7sndpTlnjrfU655Y1Lp5T01vI82Nv6U/J7S6k93nUzTnn2rR/6Zu8RrnP6W7+0ezQud1XhqeawZWG/2hfMe7vK61QW2bp0f++VTiWYTeW+Z8sv9w3P8121/+WeOF6XojaPzbGCteVPnApfm8u669g93fW3TrW5rSP2bE/uTkXATc2/tw6ncuOWBH2xe5S/3DuWp3Lo1jl6tqeQr0uvm37D3sM93Y3B7u7a88tde/Vg16c5Fa43d3Xvbqci+dYTfLW3pKdy/LbK2DtFD3fN7AkvsLUPJ4wBlOUf/uc9MmFLP54QDZsneUcz/H5Mxourl2//cvVmD5FxuuzxGM//8uvr76/e/OG//eHRqx//8vZ1/JCeioHe4zgreF0KebY7P/386/e/7Vx8cPXy33/7w+c/7/3xg5evftq5dPnr69d7t7378q8v9SY//uHFq9ff7z7X1cs3O9eevXz1evPS/0lW5/0yn+d0GvC6OSozYVKv9RNbYVI67x61TODUlTnFmdTWh294fu18hc6/836Fz6+925iNSx/t6dZjvROI84t7cnXzm8eN+Pn11bd/+fnt79oEvndas9PC3Fjk46fvn+/scnx8tnQ3vvbx1euFuvGl+PCjlbr5hXdXroXxxhfiw3dbdOPi8dOdxbzx3a3vfHpxP/+JL9+9+unlb89/+9vVx8v76OXbqz9cvHrz3ZuXP7z9Q3zp/E++3foWHvnl7l+8v6bv/bz/tetLn36Nu1e/vLUS8sEXzuXj44s70vHhl3Zk48OvbEjGR5fP5eLDyzek4sNLXiY+/OY/JhF3Xr558+rmMt67/Bft8Pur354+UKRx9fa2fu+XD669+0h+yM8//vL25S9/QT7+4+VvH37r7JIe7X9IKb7Rq199/+1ff/7+6id++ur1L1d//befruIZP9Ctutd/v3Xx7z8+f/Xd/7x6+/TNq++Q3o1nYEm2wYkfX/lIN7vd3tjmva3d2NNP7ZC+8UoL8/q7q8evfrriBT44F4/jFg5wua0KvWrb1Gn7euzTekeW8uVvT354cXX1P0OOfn3z7c8/fKvPbmmHv/vp5S+/vPrh1Xcv3776+fW3P738t6ufYjOTvps3vvEfV9yYr6QD/MFrdJJ1Wgjr8lk+pP/xzpa+RYf98cYNbt2QKu4k2//malOm/i/9/tXVt7+8ffPrd/xW/P5rPcq3Wv+r/y27+Nmt17/+9d+0mr+8/Ovf2PU/lpJlRbV9P1x7G/+SDyvjbNOAxBRe9PH3/3F0Y3Ze5XfI2v4uuxOwI5H/Jz91dqhuCP3eidqU1Q+lbed0bp8WL5r/H278L3/76dXbb08bGt87fvJj2Armtw0a00di7Av+1tu/vLn65S8//xQ+YHvvqv509cPbW3/UA1zx2XevfuHFTk/709tbiNgPb7/97i+v+Mv82a03vPL1vxek68PnzRvPq+Dl7HnzjeeFMxB8VXD2QhL0T3rgeuOBl5sPXM4fOFOX/vBg0RjMzCoo12eHwOLmXerGXdZUz167nG3TStspJBb0Ko3xT3rtduO1+80HXjYeeDkXq3rjeWlAGTlpFQA2TZAEHzxvLf+4YI0bT5znzUduG488Rjp75uVsjVMHm8NIu1Ra/yct8c0HPnvevvG8xH8fS1ZrkwaMUnRe25zrzbuMLfkEhXjjrdv5gcorPPkzZv+09k967fXmPqWbTzy3ROtcA/SPHzjR1zwgnolunJw/VlnQ3BwYrAvpBRz5/+Djl5vPX8+ef908Gv3sBcbZii9Mks+yA5jfdf6zdO5NpZvPte6Gmcj1fM3rzTVnbqdU28gnarqPHrkt//Azl5uno5wdj7xhKkBonz30vLHO+UDT1hqTFOmD/6fZtpu2Ip8Zi7xlLco4e+T1TG1KZrN0z5yZWVAfi8Y/rjXLmT0+F40t01TyuTjnGy7EelhW5n/SwA9/wj/LNOWbtimfGae8ZZ3ameqsDP+ilYXpM+PcKOcti5F59Rte84REAr7JRhtuO9PBeUuVp3PLk296NRBVrDHKqEHnk26uYUorlPvwstFUzXv/Y3Jwc03L+ZpuGZL3D/z+HW64KCXmdurZC4jwWj4+bSX/43JwUxOXM02cN0wJZ+djMSgZsDCDE2QdQPSd3WZLo29sX7mpHZlC1SFAXOXSz7X+s45Avalp6rlbuqXR8w3JhX8SdhFGpbUi7/ls18uGkm3nK0hH84SBpEAPfH6XDbW3oajPxX+J7m85aQkk5ZnwzzKZwX5kL1zrP6wFby5nOV/ODS3IEn+8DrBeQi6xjs5MyzOFUjb00nIjCFfQB+dF7ymmXNczaSwbWgmA6cePkgKcGqO1oFc7v8uGSur95l0YjzmBiOvcMrfi7C5bSgEk7I3oRzfJsDj0BDnT2V22jmk6k1WoT2EHn9r0Rqv9uZxtHtRPuo5S4JKhVZK0NgaRpuVjN0YizXCnJUnX0hz9j57am8a2nq1n3Ti1y5mYQUnE/JQMk4gcsHx2m41T29dzaQX5DxPIypufyXzdOLU344/MpOeKH8U8o9bONUjdODlrPhO0mdfcoYZY4Q47j483Ts7N7FViZkWCezjRtzMlbp9KX51ld3fqPP+knK9Lq36YKNpO636Uv/r/US6JaXdrCmqcBOvEDTO4NsZbLkwLnzkK1/9lmaW8tnMrfjMTBk8gTEShAhlr/vHTV9j5IKupbeJI/hfmmcqWDb259p3BXFOBg86Vnr7+VyWItsKGuREFnzlNdHTCoUX9tunJl/+yxMOGjmnLp2PgtGa4puGHW4dE6uYSM60dEYI8Yugr9Lr838kYbXgG/29tZ7eaQAwF4fs+Sy/yc7LZPI1IkUUoWIq+f+ezheKegCG0BW+qLGrck5lPdybF6sYkKboSKjCjTPPxAHgqbk8v2RJLtTbqmbxM6SiD7PTFSqB4WLh4l9w2d5AeCnLqM0gPpKIj0S4mHT/EY6Jnq+bgBjVVJSA5jDLR3brqWUeJZi0sSX55dlUn8YwM5/PBm6k41FQl2bpRdv5ovtA1kDJsGVvmrH0cgK9dWpM6WK+4zYPSHj3S6Har+2kgwdAoxb4niZKEMzuAZ+lN9RbYkckoR8AnpIZ7MPDuRZBt/X/OpcdvqmMY/IAJclEprJByiNW74N54TM+xJuXBmhQknpGd8GdfUYxwoM5AtOhGWaTetZCdSr69tvEhfhPNv4cNWS4Ja02KIKxDEMXr+0UnJQl1VPNC3kewhpkfB+5UMgpeaMpqqa3fEG+3U5H2yGWeC61eIU+fTANspjOWU/Xb7Z7ekju1kDNIll6Nj2qMKcB1+FYDV1inWas2wEW7gKVjsqzS31ZpbCDBegSwJMve/LZIEGkL7LjBOlig59aczyryRdgsgsTzam6v7HEOGUxv13S+pHtzQJYDGAIdtePoCRArNNuTrxuz4ddkU47b9nnajtfT4XK7ftyueLf3yyYDdH476B6tN8vHv39djxzO689NR9HfyxcUO/PXt88BAA==", "tags": [ diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/change_space_agent_policies.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/change_space_agent_policies.ts index df3aa6f8f257..519ae1109e51 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/change_space_agent_policies.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/change_space_agent_policies.ts @@ -6,7 +6,10 @@ */ import expect from '@kbn/expect'; +import { v4 as uuidV4 } from 'uuid'; +import { Client } from '@elastic/elasticsearch'; import { CreateAgentPolicyResponse, GetOnePackagePolicyResponse } from '@kbn/fleet-plugin/common'; +import { FleetServerAgentAction } from '@kbn/fleet-plugin/common/types'; import { FtrProviderContext } from '../../../api_integration/ftr_provider_context'; import { skipIfNoDockerRegistry } from '../../helpers'; import { SpaceTestApiClient } from './api_helper'; @@ -19,6 +22,33 @@ import { } from './helpers'; import { testUsers, setupTestUsers } from '../test_users'; +export async function createFleetAction(esClient: Client, agentId: string, spaceId?: string) { + const actionResponse = await esClient.index({ + index: '.fleet-actions', + refresh: 'wait_for', + body: { + '@timestamp': new Date().toISOString(), + expiration: new Date().toISOString(), + agents: [agentId], + action_id: uuidV4(), + data: {}, + type: 'UPGRADE', + namespaces: spaceId ? [spaceId] : undefined, + }, + }); + + return actionResponse._id; +} + +async function getFleetActionDoc(esClient: Client, actionId: string) { + const actionResponse = await esClient.get({ + index: '.fleet-actions', + id: actionId, + }); + + return actionResponse; +} + export default function (providerContext: FtrProviderContext) { const { getService } = providerContext; const supertest = getService('supertest'); @@ -39,6 +69,9 @@ export default function (providerContext: FtrProviderContext) { let policy1AgentId: string; let policy2AgentId: string; + let agent1ActionId: string; + let agent2ActionId: string; + before(async () => { TEST_SPACE_1 = spaces.getDefaultTestSpace(); await setupTestUsers(getService('security'), true); @@ -63,6 +96,9 @@ export default function (providerContext: FtrProviderContext) { policy1AgentId = await createFleetAgent(esClient, defaultSpacePolicy1.item.id); policy2AgentId = await createFleetAgent(esClient, defaultSpacePolicy2.item.id); + agent1ActionId = await createFleetAction(esClient, policy1AgentId, 'default'); + agent2ActionId = await createFleetAction(esClient, policy2AgentId, 'default'); + const packagePolicyRes = await apiClient.createPackagePolicy(undefined, { policy_ids: [defaultSpacePolicy1.item.id], name: `test-nginx-${Date.now()}`, @@ -172,6 +208,15 @@ export default function (providerContext: FtrProviderContext) { } } + async function assertActionSpaces(actionId: string, expectedSpaces: string[]) { + const actionDoc = await getFleetActionDoc(esClient, actionId); + if (expectedSpaces.length === 1 && expectedSpaces[0] === 'default') { + expect(actionDoc._source?.namespaces ?? ['default']).to.eql(expectedSpaces); + } else { + expect(actionDoc._source?.namespaces).to.eql(expectedSpaces); + } + } + it('should allow set policy in multiple space', async () => { await apiClient.putAgentPolicy(defaultSpacePolicy1.item.id, { name: 'tata', @@ -189,6 +234,9 @@ export default function (providerContext: FtrProviderContext) { await assertAgentSpaces(policy1AgentId, ['default', TEST_SPACE_1]); await assertAgentSpaces(policy2AgentId, ['default']); + await assertActionSpaces(agent1ActionId, ['default', TEST_SPACE_1]); + await assertActionSpaces(agent2ActionId, ['default']); + await assertEnrollemntApiKeysForSpace('default', [ defaultSpacePolicy1.item.id, defaultSpacePolicy2.item.id, @@ -213,6 +261,10 @@ export default function (providerContext: FtrProviderContext) { await assertPackagePolicyNotAvailableInSpace(); await assertAgentSpaces(policy1AgentId, [TEST_SPACE_1]); await assertAgentSpaces(policy2AgentId, ['default']); + + await assertActionSpaces(agent1ActionId, [TEST_SPACE_1]); + await assertActionSpaces(agent2ActionId, ['default']); + await assertEnrollemntApiKeysForSpace('default', [defaultSpacePolicy2.item.id]); await assertEnrollemntApiKeysForSpace(TEST_SPACE_1, [defaultSpacePolicy1.item.id]); // Ensure no side effect on other policies diff --git a/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts b/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts index 92f4e3a38767..e4e5ff2563cc 100644 --- a/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts +++ b/x-pack/test/fleet_api_integration/apis/space_awareness/helpers.ts @@ -49,6 +49,12 @@ export async function cleanFleetIndices(esClient: Client) { ignore_unavailable: true, refresh: true, }), + esClient.deleteByQuery({ + index: AGENT_ACTIONS_INDEX, + q: '*', + ignore_unavailable: true, + refresh: true, + }), ]); } diff --git a/x-pack/test/functional/apps/index_management/enrich_policies_tab/enrich_policies_tab.ts b/x-pack/test/functional/apps/index_management/enrich_policies_tab/enrich_policies_tab.ts index e74a14fe4f26..0d090835139d 100644 --- a/x-pack/test/functional/apps/index_management/enrich_policies_tab/enrich_policies_tab.ts +++ b/x-pack/test/functional/apps/index_management/enrich_policies_tab/enrich_policies_tab.ts @@ -100,16 +100,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(await successToast.getVisibleText()).to.contain(`Executed ${ENRICH_POLICY_NAME}`); }); - it('read only access', async () => { - await security.testUser.setRoles(['index_management_monitor_enrich_only']); - await pageObjects.common.navigateToApp('indexManagement'); - await pageObjects.indexManagement.changeTabs('enrich_policiesTab'); - await pageObjects.header.waitUntilLoadingHasFinished(); - - await testSubjects.missingOrFail('createPolicyButton'); - await testSubjects.missingOrFail('deletePolicyButton'); - }); - it('can delete a policy', async () => { await security.testUser.setRoles(['index_management_user']); await pageObjects.common.navigateToApp('indexManagement'); @@ -129,10 +119,23 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { expect(await successToast.getVisibleText()).to.contain(`Deleted ${ENRICH_POLICY_NAME}`); }); - it('no access', async () => { - await security.testUser.setRoles(['index_management_monitor_only']); - await pageObjects.common.navigateToApp('indexManagement'); - await testSubjects.missingOrFail('enrich_policiesTab'); + describe('access', function () { + this.tags('skipFIPS'); + it('read only access', async () => { + await security.testUser.setRoles(['index_management_monitor_enrich_only']); + await pageObjects.common.navigateToApp('indexManagement'); + await pageObjects.indexManagement.changeTabs('enrich_policiesTab'); + await pageObjects.header.waitUntilLoadingHasFinished(); + + await testSubjects.missingOrFail('createPolicyButton'); + await testSubjects.missingOrFail('deletePolicyButton'); + }); + + it('no access', async () => { + await security.testUser.setRoles(['index_management_monitor_only']); + await pageObjects.common.navigateToApp('indexManagement'); + await testSubjects.missingOrFail('enrich_policiesTab'); + }); }); }); }; diff --git a/x-pack/test/functional/apps/infra/node_details.ts b/x-pack/test/functional/apps/infra/node_details.ts index 0e70d974d6ed..7ab097b89d1d 100644 --- a/x-pack/test/functional/apps/infra/node_details.ts +++ b/x-pack/test/functional/apps/infra/node_details.ts @@ -477,7 +477,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('Processes Tab', () => { + // FLAKY: https://github.com/elastic/kibana/issues/192891 + describe.skip('Processes Tab', () => { before(async () => { await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_hosts_processes'); await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); @@ -536,7 +537,8 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('Logs Tab', () => { + // FLAKY: https://github.com/elastic/kibana/issues/203656 + describe.skip('Logs Tab', () => { before(async () => { await pageObjects.assetDetails.clickLogsTab(); await pageObjects.timePicker.setAbsoluteRange( @@ -662,16 +664,6 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { }); }); - describe('Metrics Tab', () => { - before(async () => { - await pageObjects.assetDetails.clickMetricsTab(); - }); - - it('should show add metrics callout', async () => { - await pageObjects.assetDetails.addMetricsCalloutExists(); - }); - }); - describe('Processes Tab', () => { before(async () => { await pageObjects.assetDetails.clickProcessesTab(); diff --git a/x-pack/test/functional/apps/lens/group4/color_mapping.ts b/x-pack/test/functional/apps/lens/group4/color_mapping.ts index 008ffa1cb53e..d14505fb0b14 100644 --- a/x-pack/test/functional/apps/lens/group4/color_mapping.ts +++ b/x-pack/test/functional/apps/lens/group4/color_mapping.ts @@ -6,17 +6,15 @@ */ import expect from '@kbn/expect'; -import { - EUI_AMSTERDAM_PALETTE_COLORS, - ELASTIC_BRAND_PALETTE_COLORS, - EUIAmsterdamColorBlindPalette, - ElasticBrandPalette, -} from '@kbn/coloring/src/shared_components/color_mapping/palettes'; +import { getKbnPalettes, KbnPalette } from '@kbn/palettes'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getService, getPageObjects }: FtrProviderContext) { const { visualize, lens } = getPageObjects(['visualize', 'lens']); const elasticChart = getService('elasticChart'); + const palettes = getKbnPalettes({ name: 'amsterdam', darkMode: false }); + const defaultPalette = palettes.get(KbnPalette.Default); + const classicPalette = palettes.get(KbnPalette.ElasticClassic); describe('lens color mapping', () => { before(async () => { @@ -34,7 +32,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', operation: 'terms', field: 'extension.raw', - palette: { mode: 'colorMapping', id: ElasticBrandPalette.id }, + palette: { mode: 'colorMapping', id: classicPalette.id }, keepOpen: true, }); }); @@ -43,18 +41,25 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const chart = await lens.getCurrentChartDebugState('xyVisChart'); const legendColors = chart?.legend?.items?.map((item) => item.color.toLowerCase()) ?? []; expect(legendColors).to.eql( - ELASTIC_BRAND_PALETTE_COLORS.slice(0, 5).map((c) => c.toLowerCase()) + classicPalette + .colors() + .slice(0, 5) + .map((c) => c.toLowerCase()) ); }); + it('should allow switching color mapping palette', async () => { await lens.changeColorMappingPalette( 'lnsXY_splitDimensionPanel > lnsLayerPanel-dimensionLink', - EUIAmsterdamColorBlindPalette.id + defaultPalette.id ); const chart = await lens.getCurrentChartDebugState('xyVisChart'); const legendColors = chart?.legend?.items?.map((item) => item.color.toLowerCase()) ?? []; expect(legendColors).to.eql( - EUI_AMSTERDAM_PALETTE_COLORS.slice(0, 5).map((c) => c.toLowerCase()) + defaultPalette + .colors() + .slice(0, 5) + .map((c) => c.toLowerCase()) ); }); @@ -66,7 +71,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { ); const chart = await lens.getCurrentChartDebugState('xyVisChart'); const firstLegendItemColor = chart?.legend?.items?.[0]?.color?.toLowerCase() ?? 'NONE'; - expect(firstLegendItemColor).to.eql(EUI_AMSTERDAM_PALETTE_COLORS[3].toLowerCase()); + expect(firstLegendItemColor).to.eql(defaultPalette.colors()[3].toLowerCase()); }); }); } diff --git a/x-pack/test/functional/apps/lens/group4/colors.ts b/x-pack/test/functional/apps/lens/group4/colors.ts index 5c5bbea4ba2c..68e0ce9f8856 100644 --- a/x-pack/test/functional/apps/lens/group4/colors.ts +++ b/x-pack/test/functional/apps/lens/group4/colors.ts @@ -4,7 +4,7 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { ElasticBrandPalette } from '@kbn/coloring'; +import { KbnPalette } from '@kbn/palettes'; import { FtrProviderContext } from '../../../ftr_provider_context'; export default function ({ getPageObjects }: FtrProviderContext) { @@ -57,25 +57,25 @@ export default function ({ getPageObjects }: FtrProviderContext) { dimension: 'lnsXY_splitDimensionPanel > lns-empty-dimension', operation: 'terms', field: '@message.raw', - palette: { mode: 'colorMapping', id: ElasticBrandPalette.id }, + palette: { mode: 'colorMapping', id: KbnPalette.ElasticClassic }, keepOpen: true, }); - await lens.assertPalette(ElasticBrandPalette.id, false); + await lens.assertPalette(KbnPalette.ElasticClassic, false); await lens.closeDimensionEditor(); }); it('should carry over palette to the pie chart', async () => { await lens.switchToVisualization('pie'); await lens.openDimensionEditor('lnsPie_sliceByDimensionPanel > lns-dimensionTrigger'); - await lens.assertPalette(ElasticBrandPalette.id, false); + await lens.assertPalette(KbnPalette.ElasticClassic, false); await lens.closeDimensionEditor(); }); it('should carry palette back to the bar chart', async () => { await lens.switchToVisualization('bar'); await lens.openDimensionEditor('lnsXY_splitDimensionPanel > lns-dimensionTrigger'); - await lens.assertPalette(ElasticBrandPalette.id, false); + await lens.assertPalette(KbnPalette.ElasticClassic, false); }); }); } diff --git a/x-pack/test/functional/apps/management/config.ts b/x-pack/test/functional/apps/management/config.ts index e4a06d30f260..7ca5d972aa06 100644 --- a/x-pack/test/functional/apps/management/config.ts +++ b/x-pack/test/functional/apps/management/config.ts @@ -15,10 +15,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [require.resolve('.')], kbnTestServer: { ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - '--xpack.spaces.experimental.forceSolutionVisibility=true', - ], + serverArgs: [...functionalConfig.get('kbnTestServer.serverArgs')], }, }; } diff --git a/x-pack/test/functional/apps/spaces/create_edit_space/create_edit_space.ts b/x-pack/test/functional/apps/spaces/create_edit_space/create_edit_space.ts index 4b100595a38c..a2c00647adf9 100644 --- a/x-pack/test/functional/apps/spaces/create_edit_space/create_edit_space.ts +++ b/x-pack/test/functional/apps/spaces/create_edit_space/create_edit_space.ts @@ -15,6 +15,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); const spacesServices = getService('spaces'); const log = getService('log'); + const find = getService('find'); describe('Spaces Management: Create and Edit', () => { before(async () => { @@ -43,6 +44,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('create a space with a given name', async () => { await PageObjects.spaceSelector.addSpaceName(spaceName); + await PageObjects.spaceSelector.changeSolutionView('classic'); await PageObjects.spaceSelector.clickSaveSpaceCreation(); await testSubjects.existOrFail(`spacesListTableRow-${spaceId}`); }); @@ -60,6 +62,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { name: spaceName, disabledFeatures: [], color: '#AABBCC', + solution: 'classic', }); await PageObjects.common.navigateToApp('spacesManagement'); @@ -103,14 +106,100 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { }); describe('solution view', () => { - it('does not show solution view panel', async () => { + it('does show the solution view panel', async () => { await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { shouldUseHashForSubUrl: false, }); await testSubjects.existOrFail('spaces-view-page'); await testSubjects.existOrFail('spaces-view-page > generalPanel'); - await testSubjects.missingOrFail('spaces-view-page > navigationPanel'); // xpack.spaces.allowSolutionVisibility is not enabled, so the solution view picker should not appear + await testSubjects.existOrFail('spaces-view-page > navigationPanel'); + }); + + it('changes the space solution and updates the side navigation', async () => { + await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { + shouldUseHashForSubUrl: false, + }); + + // Make sure we are on the classic side nav + await testSubjects.existOrFail('mgtSideBarNav'); + await testSubjects.missingOrFail('searchSideNav'); + + // change to Enterprise Search + await PageObjects.spaceSelector.changeSolutionView('es'); + await PageObjects.spaceSelector.clickSaveSpaceCreation(); + await PageObjects.spaceSelector.confirmModal(); + + await find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); + + // Search side nav is loaded + await testSubjects.existOrFail('searchSideNav'); + await testSubjects.missingOrFail('mgtSideBarNav'); + + // change back to classic + await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { + shouldUseHashForSubUrl: false, + }); + + await testSubjects.missingOrFail('space-edit-page-user-impact-warning'); + await PageObjects.spaceSelector.changeSolutionView('classic'); + await testSubjects.existOrFail('space-edit-page-user-impact-warning'); // Warn that the change will impact other users + + await PageObjects.spaceSelector.clickSaveSpaceCreation(); + await PageObjects.spaceSelector.confirmModal(); + + await testSubjects.existOrFail('mgtSideBarNav'); + await testSubjects.missingOrFail('searchSideNav'); + }); + }); + + describe('API-created Space', () => { + before(async () => { + await spacesServices.create({ + id: 'foo-space', + name: 'Foo Space', + disabledFeatures: [], + color: '#AABBCC', + }); + }); + + after(async () => { + await spacesServices.delete('foo-space'); + }); + + it('enabled features can be changed while the solution view remains unselected', async () => { + const securityFeatureCheckboxId = 'featureCategoryCheckbox_securitySolution'; + + await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/foo-space', { + shouldUseHashForSubUrl: false, + }); + + await testSubjects.existOrFail('spaces-view-page'); + + // ensure security feature is selected by default + expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(true); + + // Do not set a solution view first! + + await PageObjects.spaceSelector.toggleFeatureCategoryCheckbox('securitySolution'); + // + // ensure security feature now unselected + expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(false); + + await testSubjects.existOrFail('space-edit-page-user-impact-warning'); + + await PageObjects.spaceSelector.clickSaveSpaceCreation(); + + await testSubjects.click('confirmModalConfirmButton'); + + await testSubjects.existOrFail('spaces-view-page'); + + await testSubjects.click('foo-space-hyperlink'); + + await testSubjects.existOrFail('spaces-view-page'); + + // ensure security feature is still unselected + expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(false); }); }); }); diff --git a/x-pack/test/functional/apps/spaces/index.ts b/x-pack/test/functional/apps/spaces/index.ts index 3fe77a1a4528..4a9334ab3048 100644 --- a/x-pack/test/functional/apps/spaces/index.ts +++ b/x-pack/test/functional/apps/spaces/index.ts @@ -15,5 +15,6 @@ export default function spacesApp({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./enter_space')); loadTestFile(require.resolve('./create_edit_space')); loadTestFile(require.resolve('./spaces_grid')); + loadTestFile(require.resolve('./solution_tour')); }); } diff --git a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/solution_tour.ts b/x-pack/test/functional/apps/spaces/solution_tour.ts similarity index 98% rename from x-pack/test/functional/apps/spaces/solution_view_flag_enabled/solution_tour.ts rename to x-pack/test/functional/apps/spaces/solution_tour.ts index ac8281f45a56..862fe9146ee6 100644 --- a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/solution_tour.ts +++ b/x-pack/test/functional/apps/spaces/solution_tour.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import type { SolutionView, Space } from '@kbn/spaces-plugin/common'; -import { FtrProviderContext } from '../../../ftr_provider_context'; +import { FtrProviderContext } from '../../ftr_provider_context'; export default function ({ getPageObjects, getService }: FtrProviderContext) { const kibanaServer = getService('kibanaServer'); diff --git a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/config.ts b/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/config.ts deleted file mode 100644 index f99c2daf3896..000000000000 --- a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/config.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { FtrConfigProviderContext } from '@kbn/test'; - -/** - * NOTE: The solution view is currently only available in the cloud environment. - * This test suite fakes a cloud environement by setting the cloud.id and cloud.base_url - */ - -export default async function ({ readConfigFile }: FtrConfigProviderContext) { - const functionalConfig = await readConfigFile(require.resolve('../../../config.base.js')); - - return { - ...functionalConfig.getAll(), - testFiles: [require.resolve('.')], - kbnTestServer: { - ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - // Note: the base64 string in the cloud.id config contains the ES endpoint required in the functional tests - '--xpack.cloud.id=ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=', - '--xpack.cloud.base_url=https://cloud.elastic.co', - '--xpack.cloud.deployment_url=/deployments/deploymentId', - ], - }, - }; -} diff --git a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/create_edit_space.ts b/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/create_edit_space.ts deleted file mode 100644 index 8695077eae74..000000000000 --- a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/create_edit_space.ts +++ /dev/null @@ -1,125 +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 expect from '@kbn/expect'; -import { FtrProviderContext } from '../../../ftr_provider_context'; - -export default function ({ getPageObjects, getService }: FtrProviderContext) { - const kibanaServer = getService('kibanaServer'); - const PageObjects = getPageObjects(['common', 'settings', 'security', 'spaceSelector']); - const testSubjects = getService('testSubjects'); - const spacesService = getService('spaces'); - const find = getService('find'); - - describe('edit space', () => { - before(async () => { - await kibanaServer.savedObjects.cleanStandardList(); - }); - - after(async () => { - await kibanaServer.savedObjects.cleanStandardList(); - }); - - describe('solution view', () => { - it('does show the solution view panel', async () => { - await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { - shouldUseHashForSubUrl: false, - }); - - await testSubjects.existOrFail('spaces-view-page'); - await testSubjects.existOrFail('spaces-view-page > generalPanel'); - await testSubjects.existOrFail('spaces-view-page > navigationPanel'); - }); - - it('changes the space solution and updates the side navigation', async () => { - await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { - shouldUseHashForSubUrl: false, - }); - - // Make sure we are on the classic side nav - await testSubjects.existOrFail('mgtSideBarNav'); - await testSubjects.missingOrFail('searchSideNav'); - - // change to Enterprise Search - await PageObjects.spaceSelector.changeSolutionView('es'); - await PageObjects.spaceSelector.clickSaveSpaceCreation(); - await PageObjects.spaceSelector.confirmModal(); - - await find.waitForDeletedByCssSelector('.kibanaWelcomeLogo'); - - // Search side nav is loaded - await testSubjects.existOrFail('searchSideNav'); - await testSubjects.missingOrFail('mgtSideBarNav'); - - // change back to classic - await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/default', { - shouldUseHashForSubUrl: false, - }); - - await testSubjects.missingOrFail('space-edit-page-user-impact-warning'); - await PageObjects.spaceSelector.changeSolutionView('classic'); - await testSubjects.existOrFail('space-edit-page-user-impact-warning'); // Warn that the change will impact other users - - await PageObjects.spaceSelector.clickSaveSpaceCreation(); - await PageObjects.spaceSelector.confirmModal(); - - await testSubjects.existOrFail('mgtSideBarNav'); - await testSubjects.missingOrFail('searchSideNav'); - }); - }); - - describe('API-created Space', () => { - before(async () => { - await spacesService.create({ - id: 'foo-space', - name: 'Foo Space', - disabledFeatures: [], - color: '#AABBCC', - }); - }); - - after(async () => { - await spacesService.delete('foo-space'); - }); - - it('enabled features can be changed while the solution view remains unselected', async () => { - const securityFeatureCheckboxId = 'featureCategoryCheckbox_securitySolution'; - - await PageObjects.common.navigateToUrl('management', 'kibana/spaces/edit/foo-space', { - shouldUseHashForSubUrl: false, - }); - - await testSubjects.existOrFail('spaces-view-page'); - - // ensure security feature is selected by default - expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(true); - - // Do not set a solution view first! - - await PageObjects.spaceSelector.toggleFeatureCategoryCheckbox('securitySolution'); - // - // ensure security feature now unselected - expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(false); - - await testSubjects.existOrFail('space-edit-page-user-impact-warning'); - - await PageObjects.spaceSelector.clickSaveSpaceCreation(); - - await testSubjects.click('confirmModalConfirmButton'); - - await testSubjects.existOrFail('spaces-view-page'); - - await testSubjects.click('foo-space-hyperlink'); - - await testSubjects.existOrFail('spaces-view-page'); - - // ensure security feature is still unselected - expect(await testSubjects.isChecked(securityFeatureCheckboxId)).to.be(false); - }); - }); - }); -} diff --git a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/index.ts b/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/index.ts deleted file mode 100644 index 45a8f7838715..000000000000 --- a/x-pack/test/functional/apps/spaces/solution_view_flag_enabled/index.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 { FtrProviderContext } from '../../../ftr_provider_context'; - -export default function spacesApp({ loadTestFile }: FtrProviderContext) { - describe('Spaces app (with solution view)', function spacesAppTestSuite() { - loadTestFile(require.resolve('./create_edit_space')); - loadTestFile(require.resolve('./solution_tour')); - }); -} diff --git a/x-pack/test/functional/config.base.js b/x-pack/test/functional/config.base.js index d5c6d77785b8..eb13de1c0c9e 100644 --- a/x-pack/test/functional/config.base.js +++ b/x-pack/test/functional/config.base.js @@ -197,7 +197,7 @@ export default async function ({ readConfigFile }) { pathname: '/app/management/kibana/observabilityAiAssistantManagement', }, enterpriseSearch: { - pathname: '/app/enterprise_search/overview', + pathname: '/app/elasticsearch/overview', }, }, diff --git a/x-pack/test/functional_search/config.ts b/x-pack/test/functional_search/config.ts index c7708363766b..808edc73d97a 100644 --- a/x-pack/test/functional_search/config.ts +++ b/x-pack/test/functional_search/config.ts @@ -30,12 +30,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { }, kbnTestServer: { ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - // Note: the base64 string in the cloud.id config contains the ES endpoint required in the functional tests - '--xpack.cloud.id=ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=', - '--xpack.cloud.base_url=https://cloud.elastic.co', - ], + serverArgs: [...functionalConfig.get('kbnTestServer.serverArgs')], }, }; } diff --git a/x-pack/test/functional_solution_sidenav/config.ts b/x-pack/test/functional_solution_sidenav/config.ts index f997aaea7c5e..031fb55d192b 100644 --- a/x-pack/test/functional_solution_sidenav/config.ts +++ b/x-pack/test/functional_solution_sidenav/config.ts @@ -20,12 +20,7 @@ export default async function ({ readConfigFile }: FtrConfigProviderContext) { testFiles: [require.resolve('.')], kbnTestServer: { ...functionalConfig.get('kbnTestServer'), - serverArgs: [ - ...functionalConfig.get('kbnTestServer.serverArgs'), - // Note: the base64 string in the cloud.id config contains the ES endpoint required in the functional tests - '--xpack.cloud.id=ftr_fake_cloud_id:aGVsbG8uY29tOjQ0MyRFUzEyM2FiYyRrYm4xMjNhYmM=', - '--xpack.cloud.base_url=https://cloud.elastic.co', - ], + serverArgs: [...functionalConfig.get('kbnTestServer.serverArgs')], }, }; } diff --git a/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/search_source_alert.ts b/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/search_source_alert.ts index 97d59de76ce4..3ce3ea7ba12b 100644 --- a/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/search_source_alert.ts +++ b/x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/discover/search_source_alert.ts @@ -45,53 +45,59 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { let connectorId: string; const createSourceIndex = () => - es.index({ - index: SOURCE_DATA_VIEW, - body: { - settings: { number_of_shards: 1 }, - mappings: { - properties: { - '@timestamp': { type: 'date' }, - message: { type: 'keyword' }, - }, + retry.try(() => + createIndex(SOURCE_DATA_VIEW, { + '@timestamp': { type: 'date' }, + message: { type: 'keyword' }, + }) + ); + + const createOutputDataIndex = () => + retry.try(() => + createIndex(OUTPUT_DATA_VIEW, { + rule_id: { type: 'text' }, + rule_name: { type: 'text' }, + alert_id: { type: 'text' }, + context_link: { type: 'text' }, + }) + ); + + async function createIndex(index: string, properties: unknown) { + try { + await es.index({ + index, + body: { + settings: { number_of_shards: 1 }, + mappings: { properties }, }, - }, - }); + }); + } catch (e) { + log.error(`Failed to create index "${index}" with error "${e.message}"`); + } + } - const generateNewDocs = async (docsNumber: number) => { + async function generateNewDocs(docsNumber: number, index = SOURCE_DATA_VIEW) { const mockMessages = Array.from({ length: docsNumber }, (_, i) => `msg-${i}`); const dateNow = new Date(); const dateToSet = new Date(dateNow); dateToSet.setMinutes(dateNow.getMinutes() - 10); - for (const message of mockMessages) { - await es.transport.request({ - path: `/${SOURCE_DATA_VIEW}/_doc`, - method: 'POST', - body: { - '@timestamp': dateToSet.toISOString(), - message, - }, - }); + try { + await Promise.all( + mockMessages.map((message) => + es.transport.request({ + path: `/${index}/_doc`, + method: 'POST', + body: { + '@timestamp': dateToSet.toISOString(), + message, + }, + }) + ) + ); + } catch (e) { + log.error(`Failed to generate new docs in "${index}" with error "${e.message}"`); } - }; - - const createOutputDataIndex = () => - es.index({ - index: OUTPUT_DATA_VIEW, - body: { - settings: { - number_of_shards: 1, - }, - mappings: { - properties: { - rule_id: { type: 'text' }, - rule_name: { type: 'text' }, - alert_id: { type: 'text' }, - context_link: { type: 'text' }, - }, - }, - }, - }); + } const deleteAlerts = (alertIds: string[]) => asyncForEach(alertIds, async (alertId: string) => { diff --git a/x-pack/test/observability_ai_assistant_api_integration/tests/chat/chat.spec.ts b/x-pack/test/observability_ai_assistant_api_integration/tests/chat/chat.spec.ts index b1865f944f6a..04139a574a21 100644 --- a/x-pack/test/observability_ai_assistant_api_integration/tests/chat/chat.spec.ts +++ b/x-pack/test/observability_ai_assistant_api_integration/tests/chat/chat.spec.ts @@ -137,57 +137,6 @@ export default function ApiTest({ getService }: FtrProviderContext) { ]); }); - it.skip('returns a useful error if the request fails', async () => { - const interceptor = proxy.intercept('conversation', () => true); - - const passThrough = new PassThrough(); - - supertest - .post(CHAT_API_URL) - .set('kbn-xsrf', 'foo') - .send({ - name: 'my_api_call', - messages, - connectorId, - functions: [], - scopes: ['all'], - }) - .expect(200) - .pipe(passThrough); - - let data: string = ''; - - passThrough.on('data', (chunk) => { - data += chunk.toString('utf-8'); - }); - - const simulator = await interceptor.waitForIntercept(); - - await simulator.status(400); - - await simulator.rawWrite( - JSON.stringify({ - error: { - code: 'context_length_exceeded', - message: - "This model's maximum context length is 8192 tokens. However, your messages resulted in 11036 tokens. Please reduce the length of the messages.", - param: 'messages', - type: 'invalid_request_error', - }, - }) - ); - - await simulator.rawEnd(); - - await new Promise((resolve) => passThrough.on('end', () => resolve())); - - const response = JSON.parse(data.trim()); - - expect(response.error.message).to.be( - `Token limit reached. Token limit is 8192, but the current conversation has 11036 tokens.` - ); - }); - describe('security roles and access privileges', () => { it('should deny access for users without the ai_assistant privilege', async () => { try { diff --git a/x-pack/test/observability_ai_assistant_api_integration/tests/complete/functions/alerts.spec.ts b/x-pack/test/observability_ai_assistant_api_integration/tests/complete/functions/alerts.spec.ts new file mode 100644 index 000000000000..60c28aab6781 --- /dev/null +++ b/x-pack/test/observability_ai_assistant_api_integration/tests/complete/functions/alerts.spec.ts @@ -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 { MessageRole, MessageAddEvent } from '@kbn/observability-ai-assistant-plugin/common'; +import expect from '@kbn/expect'; +import { LlmProxy, createLlmProxy } from '../../../common/create_llm_proxy'; +import { FtrProviderContext } from '../../../common/ftr_provider_context'; +import { getMessageAddedEvents, invokeChatCompleteWithFunctionRequest } from './helpers'; +import { + createProxyActionConnector, + deleteActionConnector, +} from '../../../common/action_connectors'; + +export default function ApiTest({ getService }: FtrProviderContext) { + const supertest = getService('supertest'); + const log = getService('log'); + const observabilityAIAssistantAPIClient = getService('observabilityAIAssistantAPIClient'); + + describe('when calling the alerts function', () => { + let proxy: LlmProxy; + let connectorId: string; + let alertsEvents: MessageAddEvent[]; + + const start = 'now-100h'; + const end = 'now'; + + before(async () => { + proxy = await createLlmProxy(log); + connectorId = await createProxyActionConnector({ supertest, log, port: proxy.getPort() }); + + void proxy + .intercept('conversation', () => true, 'Hello from LLM Proxy') + .completeAfterIntercept(); + + const alertsResponseBody = await invokeChatCompleteWithFunctionRequest({ + connectorId, + observabilityAIAssistantAPIClient, + functionCall: { + name: 'alerts', + trigger: MessageRole.Assistant, + arguments: JSON.stringify({ start, end }), + }, + }); + + await proxy.waitForAllInterceptorsSettled(); + + alertsEvents = getMessageAddedEvents(alertsResponseBody); + }); + + after(async () => { + proxy.close(); + await deleteActionConnector({ supertest, connectorId, log }); + }); + + // This test ensures that invoking the alerts function does not result in an error. + it('should execute the function without any errors', async () => { + const alertsFunctionResponse = alertsEvents[0]; + expect(alertsFunctionResponse.message.message.name).to.be('alerts'); + + const parsedAlertsResponse = JSON.parse(alertsFunctionResponse.message.message.content!); + + expect(parsedAlertsResponse).not.to.have.property('error'); + expect(parsedAlertsResponse).to.have.property('total'); + expect(parsedAlertsResponse).to.have.property('alerts'); + expect(parsedAlertsResponse.alerts).to.be.an('array'); + expect(parsedAlertsResponse.total).to.be(0); + expect(parsedAlertsResponse.alerts.length).to.be(0); + }); + }); +} diff --git a/x-pack/test/observability_functional/apps/observability/index.ts b/x-pack/test/observability_functional/apps/observability/index.ts index f061fe68649d..dce84cee32df 100644 --- a/x-pack/test/observability_functional/apps/observability/index.ts +++ b/x-pack/test/observability_functional/apps/observability/index.ts @@ -17,6 +17,7 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./pages/alerts/rule_stats')); loadTestFile(require.resolve('./pages/alerts/state_synchronization')); loadTestFile(require.resolve('./pages/alerts/table_storage')); + loadTestFile(require.resolve('./pages/alerts/custom_threshold_preview_chart')); loadTestFile(require.resolve('./pages/alerts/custom_threshold')); loadTestFile(require.resolve('./pages/cases/case_details')); loadTestFile(require.resolve('./pages/overview/alert_table')); diff --git a/x-pack/test/observability_functional/apps/observability/pages/alerts/custom_threshold_preview_chart.ts b/x-pack/test/observability_functional/apps/observability/pages/alerts/custom_threshold_preview_chart.ts new file mode 100644 index 000000000000..6bc0564c711c --- /dev/null +++ b/x-pack/test/observability_functional/apps/observability/pages/alerts/custom_threshold_preview_chart.ts @@ -0,0 +1,89 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from 'expect'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; + +export default ({ getService, getPageObject }: FtrProviderContext) => { + const common = getPageObject('common'); + const esArchiver = getService('esArchiver'); + const testSubjects = getService('testSubjects'); + const kibanaServer = getService('kibanaServer'); + const supertest = getService('supertest'); + const find = getService('find'); + const logger = getService('log'); + const retry = getService('retry'); + + describe('Custom threshold preview chart', () => { + const observability = getService('observability'); + const DATA_VIEW_1 = 'metricbeat-*'; + const DATA_VIEW_1_ID = 'data-view-id_1'; + const DATA_VIEW_1_NAME = 'test-data-view-name_1'; + + before(async () => { + await esArchiver.load('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + await observability.alerts.common.createDataView({ + supertest, + name: DATA_VIEW_1_NAME, + id: DATA_VIEW_1_ID, + title: DATA_VIEW_1, + logger, + }); + await observability.alerts.common.navigateToRulesPage(); + }); + + after(async () => { + await esArchiver.unload('x-pack/test/functional/es_archives/infra/metrics_and_logs'); + // This also deletes the created data views + await kibanaServer.savedObjects.cleanStandardList(); + }); + + it('does render the empty chart only once at bootstrap', async () => { + await observability.alerts.rulesPage.clickCreateRuleButton(); + await observability.alerts.rulesPage.clickOnObservabilityCategory(); + await observability.alerts.rulesPage.clickOnCustomThresholdRule(); + await common.sleep(1000); + expect(await find.existsByCssSelector('[data-rendering-count="2"]')).toBe(true); + }); + + it('does render the correct error message', async () => { + await testSubjects.setValue('ruleNameInput', 'test custom threshold rule'); + + await testSubjects.click('customEquation'); + const customEquationField = await find.byCssSelector( + '[data-test-subj="thresholdRuleCustomEquationEditorFieldText"]' + ); + await customEquationField.click(); + // set an invalid equation + await customEquationField.type('A + '); + + await testSubjects.click('o11yClosablePopoverTitleButton'); + + await testSubjects.existOrFail('embeddable-lens-failure'); + const el = await find.byCssSelector('[data-test-subj="embeddable-lens-failure"] p'); + const textContent = await el.getVisibleText(); + expect(textContent).toBe('An error occurred while rendering the chart'); + }); + + it('does render the chart after fixing the error', async () => { + await testSubjects.click('customEquation'); + const customEquationField = await find.byCssSelector( + '[data-test-subj="thresholdRuleCustomEquationEditorFieldText"]' + ); + await customEquationField.click(); + // fix the equation + await customEquationField.type('A'); + await testSubjects.click('o11yClosablePopoverTitleButton'); + + // check no error is visible + await testSubjects.missingOrFail('embeddable-lens-failure'); + await retry.waitFor('Chart rendered correctly', () => { + return find.existsByCssSelector('[data-render-complete="true"]'); + }); + }); + }); +}; diff --git a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/_find.ts b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/_find.ts index 2ce44324f9bf..7209af7343d1 100644 --- a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/_find.ts +++ b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/_find.ts @@ -80,8 +80,9 @@ export default function (ftrContext: FtrProviderContext) { USERS.DEFAULT_SPACE_DASHBOARD_READ_USER, USERS.DEFAULT_SPACE_VISUALIZE_READ_USER, USERS.DEFAULT_SPACE_MAPS_READ_USER, + USERS.DEFAULT_SPACE_ADVANCED_SETTINGS_READ_USER, ], - noResults: [USERS.DEFAULT_SPACE_ADVANCED_SETTINGS_READ_USER], + noResults: [], unauthorized: [USERS.NOT_A_KIBANA_USER], }; diff --git a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get.ts b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get.ts index 25debcb2cc53..9348e458652e 100644 --- a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get.ts +++ b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get.ts @@ -69,7 +69,7 @@ export default function (ftrContext: FtrProviderContext) { USERS.DEFAULT_SPACE_VISUALIZE_READ_USER, USERS.DEFAULT_SPACE_MAPS_READ_USER, ], - unauthorized: [USERS.NOT_A_KIBANA_USER, USERS.DEFAULT_SPACE_ADVANCED_SETTINGS_READ_USER], + unauthorized: [USERS.NOT_A_KIBANA_USER], }; const createUserTest = ( diff --git a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get_all.ts b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get_all.ts index 124fcea644c7..2d344a7179d9 100644 --- a/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get_all.ts +++ b/x-pack/test/saved_object_tagging/api_integration/security_and_spaces/apis/get_all.ts @@ -86,7 +86,7 @@ export default function (ftrContext: FtrProviderContext) { USERS.DEFAULT_SPACE_VISUALIZE_READ_USER, USERS.DEFAULT_SPACE_MAPS_READ_USER, ], - unauthorized: [USERS.NOT_A_KIBANA_USER, USERS.DEFAULT_SPACE_ADVANCED_SETTINGS_READ_USER], + unauthorized: [USERS.NOT_A_KIBANA_USER], }; const createUserTest = ( diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/ess_specific_index_logic/migrations/delete_alerts_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/ess_specific_index_logic/migrations/delete_alerts_migrations.ts index 85911fc8ef7d..13c8ffc3c8ad 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/ess_specific_index_logic/migrations/delete_alerts_migrations.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/basic_license_essentials_tier/ess_specific_index_logic/migrations/delete_alerts_migrations.ts @@ -13,7 +13,7 @@ import { DETECTION_ENGINE_SIGNALS_MIGRATION_URL, } from '@kbn/security-solution-plugin/common/constants'; import { ROLES } from '@kbn/security-solution-plugin/common/test'; -import { deleteMigrations, getIndexNameFromLoad } from '../../../../../utils'; +import { deleteMigrationsIfExistent, getIndexNameFromLoad } from '../../../../../utils'; import { createAlertsIndex, deleteAllAlerts, @@ -84,10 +84,12 @@ export default ({ getService }: FtrProviderContext): void => { afterEach(async () => { await esArchiver.unload('x-pack/test/functional/es_archives/signals/outdated_signals_index'); - await deleteMigrations({ + await deleteMigrationsIfExistent({ kbnClient, ids: [createdMigration.migration_id], }); + // we need to delete migrated index, otherwise create migration call(in beforeEach hook) will fail + await es.indices.delete({ index: createdMigration.migration_index }); await deleteAllAlerts(supertest, log, es); }); @@ -99,6 +101,7 @@ export default ({ getService }: FtrProviderContext): void => { .expect(200); const deletedMigration = body.migrations[0]; + expect(deletedMigration.error).to.eql(undefined); expect(deletedMigration.id).to.eql(createdMigration.migration_id); expect(deletedMigration.sourceIndex).to.eql(outdatedAlertsIndexName); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts index b445c6f81f99..436ebc469c25 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/detection_engine/alerts/trial_license_complete_tier/assignments/assignments.ts @@ -65,7 +65,7 @@ export default ({ getService }: FtrProviderContext) => { expect(body).to.eql({ error: 'Bad Request', message: - '[request body]: ids.1: String must contain at least 1 character(s), ids.1: Invalid', + '[request body]: ids.1: String must contain at least 1 character(s), ids.1: No empty strings allowed', statusCode: 400, }); }); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/bootstrap_prebuilt_rules.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/bootstrap_prebuilt_rules.ts index 97287ef0cdb9..a437561ef0a0 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/bootstrap_prebuilt_rules.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/bootstrap_prebuilt_rules.ts @@ -18,7 +18,8 @@ export default ({ getService }: FtrProviderContext): void => { const supertest = getService('supertest'); const securitySolutionApi = getService('securitySolutionApi'); - describe('@ess @serverless @skipInServerlessMKI Bootstrap Prebuilt Rules', () => { + // FLAKY: https://github.com/elastic/kibana/issues/203632 + describe.skip('@ess @serverless @skipInServerlessMKI Bootstrap Prebuilt Rules', () => { beforeEach(async () => { await deletePrebuiltRulesFleetPackage(supertest); await deleteEndpointFleetPackage(supertest); diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.eql_query_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.eql_query_fields.ts index eef3e4b6b7ce..6c49f8722abd 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.eql_query_fields.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.eql_query_fields.ts @@ -80,6 +80,46 @@ export default ({ getService }: FtrProviderContext): void => { expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); }); + + it('should trim all whitespace before version comparison', async () => { + // Install base prebuilt detection rule + await createHistoricalPrebuiltRuleAssetSavedObjects(es, getRuleAssetSavedObjects()); + await installPrebuiltRules(es, supertest); + + // Customize an eql_query field on the installed rule + await updateRule(supertest, { + ...getPrebuiltRuleMock(), + rule_id: 'rule-1', + type: 'eql', + query: '\nquery where true\n', + language: 'eql', + filters: [], + } as RuleUpdateProps); + + // Add a v2 rule asset to make the upgrade possible, do NOT update the related eql_query field, and create the new rule assets + const updatedRuleAssetSavedObjects = [ + createRuleAssetSavedObject({ + rule_id: 'rule-1', + version: 2, + type: 'eql', + query: '\nquery where true', + language: 'eql', + filters: [], + }), + ]; + await createHistoricalPrebuiltRuleAssetSavedObjects(es, updatedRuleAssetSavedObjects); + + // Call the upgrade review prebuilt rules endpoint and check that there is 1 rule eligible for update but eql_query field is NOT returned + const reviewResponse = await reviewPrebuiltRulesToUpgrade(supertest); + const fieldDiffObject = reviewResponse.rules[0].diff.fields as AllFieldsDiff; + expect(fieldDiffObject.eql_query).toBeUndefined(); + + expect(reviewResponse.rules[0].diff.num_fields_with_updates).toBe(1); // `version` is considered an updated field + expect(reviewResponse.rules[0].diff.num_fields_with_conflicts).toBe(0); + expect(reviewResponse.rules[0].diff.num_fields_with_non_solvable_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); + }); }); describe("when rule field doesn't have an update but has a custom value - scenario ABA", () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.esql_query_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.esql_query_fields.ts index 9561393e8454..d8329ce023ea 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.esql_query_fields.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.esql_query_fields.ts @@ -78,6 +78,44 @@ export default ({ getService }: FtrProviderContext): void => { expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); }); + + it('should trim all whitespace before version comparison', async () => { + // Install base prebuilt detection rule + await createHistoricalPrebuiltRuleAssetSavedObjects(es, getRuleAssetSavedObjects()); + await installPrebuiltRules(es, supertest); + + // Customize an esql_query field on the installed rule + await updateRule(supertest, { + ...getPrebuiltRuleMock(), + rule_id: 'rule-1', + type: 'esql', + query: '\tFROM query WHERE true\t', + language: 'esql', + } as RuleUpdateProps); + + // Add a v2 rule asset to make the upgrade possible, do NOT update the related esql_query field, and create the new rule assets + const updatedRuleAssetSavedObjects = [ + createRuleAssetSavedObject({ + rule_id: 'rule-1', + version: 2, + type: 'esql', + query: '\n\nFROM query WHERE true\n\n', + language: 'esql', + }), + ]; + await createHistoricalPrebuiltRuleAssetSavedObjects(es, updatedRuleAssetSavedObjects); + + // Call the upgrade review prebuilt rules endpoint and check that there is 1 rule eligible for update but esql_query field is NOT returned + const reviewResponse = await reviewPrebuiltRulesToUpgrade(supertest); + const fieldDiffObject = reviewResponse.rules[0].diff.fields as AllFieldsDiff; + expect(fieldDiffObject.esql_query).toBeUndefined(); + + expect(reviewResponse.rules[0].diff.num_fields_with_updates).toBe(1); // `version` is considered an updated field + expect(reviewResponse.rules[0].diff.num_fields_with_conflicts).toBe(0); + expect(reviewResponse.rules[0].diff.num_fields_with_non_solvable_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); + }); }); describe("when rule field doesn't have an update but has a custom value - scenario ABA", () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.kql_query_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.kql_query_fields.ts index e8f9d2f48b9e..d00d2d842f2b 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.kql_query_fields.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.kql_query_fields.ts @@ -133,6 +133,52 @@ export default ({ getService }: FtrProviderContext): void => { expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); }); }); + + describe('when all query versions have different surrounding whitespace', () => { + it('should not show in the upgrade/_review API response', async () => { + // Install base prebuilt detection rule + await createHistoricalPrebuiltRuleAssetSavedObjects( + es, + getQueryRuleAssetSavedObjects() + ); + await installPrebuiltRules(es, supertest); + + // Customize a kql_query field on the installed rule + await updateRule(supertest, { + ...getPrebuiltRuleMock(), + rule_id: 'rule-1', + type: 'query', + query: '\nquery string = true', + language: 'kuery', + filters: [], + saved_id: undefined, + } as RuleUpdateProps); + + // Add a v2 rule asset to make the upgrade possible, do NOT update the related kql_query field, and create the new rule assets + const updatedRuleAssetSavedObjects = [ + createRuleAssetSavedObject({ + rule_id: 'rule-1', + version: 2, + type: 'query', + query: 'query string = true\n', + language: 'kuery', + filters: [], + }), + ]; + await createHistoricalPrebuiltRuleAssetSavedObjects(es, updatedRuleAssetSavedObjects); + + // Call the upgrade review prebuilt rules endpoint and check that there is 1 rule eligible for update but kql_query field is NOT returned + const reviewResponse = await reviewPrebuiltRulesToUpgrade(supertest); + const fieldDiffObject = reviewResponse.rules[0].diff.fields as AllFieldsDiff; + expect(fieldDiffObject.kql_query).toBeUndefined(); + + expect(reviewResponse.rules[0].diff.num_fields_with_updates).toBe(1); // `version` is considered an updated field + expect(reviewResponse.rules[0].diff.num_fields_with_conflicts).toBe(0); + expect(reviewResponse.rules[0].diff.num_fields_with_non_solvable_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); + }); + }); }); describe("when rule field doesn't have an update but has a custom value - scenario ABA", () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.single_line_string_fields.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.single_line_string_fields.ts index 6fe10b9fa601..6d32d8df7bc7 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.single_line_string_fields.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/rules_management/prebuilt_rules/management/trial_license_complete_tier/upgrade_review_prebuilt_rules.single_line_string_fields.ts @@ -69,6 +69,41 @@ export default ({ getService }: FtrProviderContext): void => { expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); }); + + it('should trim all whitespace before version comparison', async () => { + // Install base prebuilt detection rule + await createHistoricalPrebuiltRuleAssetSavedObjects(es, getRuleAssetSavedObjects()); + await installPrebuiltRules(es, supertest); + + // Customize a single line string field on the installed rule + await patchRule(supertest, log, { + rule_id: 'rule-1', + name: 'A\n', + }); + + // Increment the version of the installed rule, do NOT update the related single line string field, and create the new rule assets + const updatedRuleAssetSavedObjects = [ + createRuleAssetSavedObject({ + rule_id: 'rule-1', + name: '\nA', + version: 2, + }), + ]; + await createHistoricalPrebuiltRuleAssetSavedObjects(es, updatedRuleAssetSavedObjects); + + // Call the upgrade review prebuilt rules endpoint and check that there is 1 rule eligible for update + // but single line string field (name) is NOT returned + const reviewResponse = await reviewPrebuiltRulesToUpgrade(supertest); + expect(reviewResponse.rules[0].diff.fields.name).toBeUndefined(); + + expect(reviewResponse.rules[0].diff.num_fields_with_updates).toBe(1); + expect(reviewResponse.rules[0].diff.num_fields_with_conflicts).toBe(0); + expect(reviewResponse.rules[0].diff.num_fields_with_non_solvable_conflicts).toBe(0); + + expect(reviewResponse.stats.num_rules_to_upgrade_total).toBe(1); + expect(reviewResponse.stats.num_rules_with_conflicts).toBe(0); + expect(reviewResponse.stats.num_rules_with_non_solvable_conflicts).toBe(0); + }); }); describe("when rule field doesn't have an update but has a custom value - scenario ABA", () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/alerts/migrations/delete_migrations.ts b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/alerts/migrations/delete_migrations.ts index 9da2e76aba4f..da230c862889 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/alerts/migrations/delete_migrations.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/detections_response/utils/alerts/migrations/delete_migrations.ts @@ -25,3 +25,28 @@ export const deleteMigrations = async ({ ) ); }; + +export const deleteMigrationsIfExistent = async ({ + ids, + kbnClient, +}: { + ids: string[]; + kbnClient: KbnClient; +}): Promise => { + await Promise.all( + ids.map(async (id) => { + try { + const res = await kbnClient.savedObjects.delete({ + id, + type: signalsMigrationType, + }); + return res; + } catch (e) { + // do not throw error when migration already deleted/not found + if (e?.response?.status !== 404) { + throw e; + } + } + }) + ); +}; diff --git a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/endpoint_authz.ts b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/endpoint_authz.ts index df2f55ccb8d0..56b3328112e7 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/endpoint_authz.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/endpoint_authz.ts @@ -40,7 +40,9 @@ export default function ({ getService }: FtrProviderContext) { } // @skipInServerlessMKI - this test uses internal index manipulation in before/after hooks // @skipInServerlessMKI - if you are removing this annotation, make sure to add the test suite to the MKI pipeline in .buildkite/pipelines/security_solution_quality_gate/mki_periodic/mki_periodic_defend_workflows.yml - describe('@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api', function () { + // FLAKY: https://github.com/elastic/kibana/issues/203909 + // FLAKY: https://github.com/elastic/kibana/issues/203910 + describe.skip('@ess @serverless @skipInServerlessMKI When attempting to call an endpoint api', function () { let indexedData: IndexedHostsAndAlertsResponse; let actionId = ''; let agentId = ''; diff --git a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/policy_response/trial_license_complete_tier/policy_response.ts b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/policy_response/trial_license_complete_tier/policy_response.ts index f3f49ffbc7c1..a737b337faff 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/policy_response/trial_license_complete_tier/policy_response.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/policy_response/trial_license_complete_tier/policy_response.ts @@ -13,7 +13,9 @@ export default function ({ getService }: FtrProviderContext) { const utils = getService('securitySolutionUtils'); const endpointTestresources = getService('endpointTestResources'); - describe('@ess @serverless @skipInServerlessMKI Endpoint policy response api', function () { + // FLAKY: https://github.com/elastic/kibana/issues/203908 + // Failing: See https://github.com/elastic/kibana/issues/203903 + describe.skip('@ess @serverless @skipInServerlessMKI Endpoint policy response api', function () { let adminSupertest: TestAgent; before(async () => { diff --git a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/response_actions/trial_license_complete_tier/execute.ts b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/response_actions/trial_license_complete_tier/execute.ts index 13afbf6e4551..a82487c31eff 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/response_actions/trial_license_complete_tier/execute.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/response_actions/trial_license_complete_tier/execute.ts @@ -23,7 +23,9 @@ export default function ({ getService }: FtrProviderContext) { const utils = getService('securitySolutionUtils'); // @skipInServerlessMKI - this test uses internal index manipulation in before/after hooks - describe('@ess @serverless @skipInServerlessMKI Endpoint `execute` response action', function () { + // FLAKY: https://github.com/elastic/kibana/issues/203906 + // Failing: See https://github.com/elastic/kibana/issues/203897 + describe.skip('@ess @serverless @skipInServerlessMKI Endpoint `execute` response action', function () { let indexedData: IndexedHostsAndAlertsResponse; let agentId = ''; let t1AnalystSupertest: TestAgent; diff --git a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/spaces/trial_license_complete_tier/space_awareness.ts b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/spaces/trial_license_complete_tier/space_awareness.ts index 9c83451111f9..38710b65465c 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/spaces/trial_license_complete_tier/space_awareness.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/edr_workflows/spaces/trial_license_complete_tier/space_awareness.ts @@ -24,7 +24,9 @@ export default function ({ getService }: FtrProviderContext) { const kbnServer = getService('kibanaServer'); const log = getService('log'); - describe('@ess @serverless @skipInServerlessMKI Endpoint management space awareness support', function () { + // FLAKY: https://github.com/elastic/kibana/issues/203893 + // Failing: See https://github.com/elastic/kibana/issues/203898 + describe.skip('@ess @serverless @skipInServerlessMKI Endpoint management space awareness support', function () { let adminSupertest: TestAgent; let dataSpaceA: Awaited>; let dataSpaceB: Awaited>; diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/utils/ingest.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/utils/ingest.ts index 24f7d759190b..aec5812332ab 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/utils/ingest.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/utils/ingest.ts @@ -31,7 +31,6 @@ export const applyIngestProcessorToDoc = async ( const firstDoc = res.docs?.[0]; - // @ts-expect-error error is not in the types const error = firstDoc?.error; if (error) { log.error('Full painless error below: '); diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts index 2aa04a898a44..3aee9687843b 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/index.ts @@ -21,5 +21,6 @@ export default function ({ loadTestFile }: FtrProviderContext) { loadTestFile(require.resolve('./asset_criticality_csv_upload')); loadTestFile(require.resolve('./risk_score_entity_calculation')); loadTestFile(require.resolve('./risk_engine_schedule_now')); + loadTestFile(require.resolve('./risk_engine_so_config')); }); } diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_so_config.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_so_config.ts new file mode 100644 index 000000000000..8b780d0540dc --- /dev/null +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/risk_engine_so_config.ts @@ -0,0 +1,143 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import expect from '@kbn/expect'; +import { riskEngineConfigurationTypeName } from '@kbn/security-solution-plugin/server/lib/entity_analytics/risk_engine/saved_object'; +import { FtrProviderContext } from '../../../../ftr_provider_context'; +import { + riskEngineRouteHelpersFactory, + getRiskEngineConfigSO, + waitForRiskEngineRun, + waitForRiskEngineTaskToBeGone, +} from '../../utils'; + +export default ({ getService }: FtrProviderContext) => { + const spaceName = 'space1'; + const supertest = getService('supertest'); + const riskEngineRoutes = riskEngineRouteHelpersFactory(supertest); + const riskEngineRoutesForNamespace = riskEngineRouteHelpersFactory(supertest, spaceName); + const kibanaServer = getService('kibanaServer'); + const esArchiver = getService('esArchiver'); + + describe('@ess @ serverless @serverless QA risk_engine_so_update_config', () => { + before(async () => { + const soId = await kibanaServer.savedObjects.find({ + type: riskEngineConfigurationTypeName, + space: spaceName, + }); + if (soId.saved_objects.length !== 0) { + await kibanaServer.savedObjects.delete({ + type: riskEngineConfigurationTypeName, + space: spaceName, + id: soId.saved_objects[0].id, + }); + } + const soId2 = await kibanaServer.savedObjects.find({ + type: riskEngineConfigurationTypeName, + }); + if (soId2.saved_objects.length !== 0) { + await kibanaServer.savedObjects.delete({ + type: riskEngineConfigurationTypeName, + id: soId2.saved_objects[0].id, + }); + } + await esArchiver.load('x-pack/test/functional/es_archives/security_solution/ecs_compliant'); + }); + + after(async () => { + const soId = await kibanaServer.savedObjects.find({ + type: riskEngineConfigurationTypeName, + space: spaceName, + }); + if (soId.saved_objects.length !== 0) { + await kibanaServer.savedObjects.delete({ + type: riskEngineConfigurationTypeName, + space: spaceName, + id: soId.saved_objects[0].id, + }); + } + const soId2 = await kibanaServer.savedObjects.find({ + type: riskEngineConfigurationTypeName, + }); + if (soId2.saved_objects.length !== 0) { + await kibanaServer.savedObjects.delete({ + type: riskEngineConfigurationTypeName, + id: soId2.saved_objects[0].id, + }); + } + await esArchiver.unload('x-pack/test/functional/es_archives/security_solution/ecs_compliant'); + }); + + it('should include the right keys as per the update', async () => { + await riskEngineRoutes.init(); + await waitForRiskEngineRun; + + const currentSoConfig = await getRiskEngineConfigSO({ kibanaServer }); + + expect(currentSoConfig.attributes).to.not.have.property('excludeAlertTags'); + expect(currentSoConfig.attributes).to.not.have.property('excludeAlertStatuses'); + + const updatedSoBody = { + exclude_alert_tags: ['False Positive'], + exclude_alert_statuses: ['open'], + }; + + await riskEngineRoutes.soConfig(updatedSoBody, 200); + const currentSoConfig2 = await getRiskEngineConfigSO({ kibanaServer }); + + expect(currentSoConfig2.attributes).to.have.property('excludeAlertTags'); + expect(currentSoConfig2.attributes).to.have.property('excludeAlertStatuses'); + + await riskEngineRoutes.disable(); + await waitForRiskEngineTaskToBeGone; + + updatedSoBody.exclude_alert_statuses = []; + + await riskEngineRoutes.soConfig(updatedSoBody, 200); + + await riskEngineRoutes.enable(); + await waitForRiskEngineRun; + + const currentSoConfig3 = await getRiskEngineConfigSO({ kibanaServer }); + expect(JSON.stringify(currentSoConfig3.attributes.excludeAlertStatuses)).to.equal( + JSON.stringify(updatedSoBody.exclude_alert_statuses) + ); + }); + + it('should succeed while updating the saved object', async () => { + await riskEngineRoutes.init(); + await waitForRiskEngineRun; + + const updatedSoBody = { + exclude_alert_tags: ['False Positive'], + exclude_alert_statuses: ['open'], + }; + const response = await riskEngineRoutes.soConfig(updatedSoBody); + expect(response.status).to.equal(200); + }); + + it('should update the config in the right space', async () => { + await riskEngineRoutesForNamespace.init(); + await riskEngineRoutes.init(); + await waitForRiskEngineRun; + + const updatedSoBody = { + exclude_alert_tags: ['False Positive'], + exclude_alert_statuses: ['open', 'closed'], + }; + + await riskEngineRoutesForNamespace.soConfig(updatedSoBody, 200); + const currentSoConfig = await getRiskEngineConfigSO({ kibanaServer, space: 'space1' }); + + expect(currentSoConfig.namespaces).to.eql(['space1']); + expect(currentSoConfig.attributes.excludeAlertTags).to.eql(updatedSoBody.exclude_alert_tags); + expect(currentSoConfig.attributes.excludeAlertStatuses).to.eql( + updatedSoBody.exclude_alert_statuses + ); + }); + }); +}; diff --git a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/risk_engine.ts b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/risk_engine.ts index 0a88e9fbe251..b90ef13a735f 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/risk_engine.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/entity_analytics/utils/risk_engine.ts @@ -24,6 +24,7 @@ import { RISK_ENGINE_PRIVILEGES_URL, RISK_ENGINE_CLEANUP_URL, RISK_ENGINE_SCHEDULE_NOW_URL, + RISK_ENGINE_CONFIGURE_SO_URL, } from '@kbn/security-solution-plugin/common/constants'; import { MappingTypeMapping } from '@elastic/elasticsearch/lib/api/types'; import { removeLegacyTransforms } from '@kbn/security-solution-plugin/server/lib/entity_analytics/utils/transforms'; @@ -365,9 +366,16 @@ export const waitForRiskScoresToBeGone = async ({ ); }; -export const getRiskEngineConfigSO = async ({ kibanaServer }: { kibanaServer: KbnClient }) => { +export const getRiskEngineConfigSO = async ({ + kibanaServer, + space, +}: { + kibanaServer: KbnClient; + space?: string; +}) => { const soResponse = await kibanaServer.savedObjects.find({ type: riskEngineConfigurationTypeName, + space, }); return soResponse?.saved_objects?.[0]; @@ -580,6 +588,17 @@ export const riskEngineRouteHelpersFactory = (supertest: SuperTest.Agent, namesp assertStatusCode(expectStatusCode, response); return response; }, + + soConfig: async (configParams: {}, expectStatusCode: number = 200) => { + const response = await supertest + .put(routeWithNamespace(RISK_ENGINE_CONFIGURE_SO_URL, namespace)) + .set('kbn-xsrf', 'true') + .set('elastic-api-version', '2023-10-31') + .set(X_ELASTIC_INTERNAL_ORIGIN_REQUEST, 'kibana') + .send(configParams); + assertStatusCode(expectStatusCode, response); + return response; + }, }; }; diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts index b9a602c9fbaa..4eed89e8d83c 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/create_exception_list_items.ts @@ -68,6 +68,86 @@ export default ({ getService }: FtrProviderContext) => { ); }); + it('should create a simple exception list item with a list item id and a comment containing newline chars', async () => { + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListMinimalSchemaMock()) + .expect(200); + + const { body } = await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMock(), + comments: [{ comment: 'hello\nworld' }], + }) + .expect(200); + + const { comments } = removeExceptionListItemServerGeneratedProperties(body); + + expect(comments?.[0]?.comment).to.eql('hello\nworld'); + }); + + it('should not create an item when the comment is empty', async () => { + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListMinimalSchemaMock()) + .expect(200); + + const { body } = await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMock(), + comments: [{ comment: '' }], + }) + .expect(400); + expect(body.message).to.contain('No empty strings allowed'); + }); + + it('should not create an item when the comment is only newline chars', async () => { + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListMinimalSchemaMock()) + .expect(200); + + const { body } = await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMock(), + comments: [{ comment: '\n\n\n\n' }], + }) + .expect(400); + expect(body.message).to.contain('No empty strings allowed'); + }); + + it('should create an item when the comments array is empty', async () => { + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListMinimalSchemaMock()) + .expect(200); + + const { body } = await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMock(), + comments: [], + }) + .expect(200); + + const bodyToCompare = removeExceptionListItemServerGeneratedProperties(body); + + expect(bodyToCompare).to.eql( + getExceptionListItemResponseMockWithoutAutoGeneratedValues(await utils.getUsername()) + ); + }); + it('should create a match any exception item with multiple case sensitive values', async () => { const entries = [ { diff --git a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts index 3753c63ff769..a13f339cac37 100644 --- a/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts +++ b/x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/items/find_exception_list_items.ts @@ -135,6 +135,53 @@ export default ({ getService }: FtrProviderContext): void => { }); }); + it('should return matching items when search is passed in and comments have newline chars', async () => { + // create exception list + await supertest + .post(EXCEPTION_LIST_URL) + .set('kbn-xsrf', 'true') + .send(getCreateExceptionListDetectionSchemaMock()) + .expect(200); + + // create exception list items + await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMockWithoutId(), + list_id: getCreateExceptionListDetectionSchemaMock().list_id, + item_id: '1', + entries: [ + { field: 'host.name', value: 'some host', operator: 'included', type: 'match' }, + ], + comments: [{ comment: 'hello\nworld' }], + }) + .expect(200); + await supertest + .post(EXCEPTION_LIST_ITEM_URL) + .set('kbn-xsrf', 'true') + .send({ + ...getCreateExceptionListItemMinimalSchemaMockWithoutId(), + item_id: '2', + list_id: getCreateExceptionListDetectionSchemaMock().list_id, + entries: [{ field: 'foo', operator: 'included', type: 'exists' }], + }) + .expect(200); + + const { body } = await supertest + .get( + `${EXCEPTION_LIST_ITEM_URL}/_find?list_id=${ + getCreateExceptionListMinimalSchemaMock().list_id + }&namespace_type=single&page=1&per_page=25&search=host&sort_field=exception-list.created_at&sort_order=desc` + ) + .set('kbn-xsrf', 'true') + .send() + .expect(200); + + body.data = [removeExceptionListItemServerGeneratedProperties(body.data[0])]; + expect(body.data[0].comments[0].comment).to.eql('hello\nworld'); + }); + it('should return 404 if given a list_id that does not exist', async () => { const { body } = await supertest .get(`${EXCEPTION_LIST_ITEM_URL}/_find?list_id=non_exist`) diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts index b8d222471c87..5059eab2cfb4 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/entity_analytics/entity_analytics_management_page.cy.ts @@ -7,15 +7,9 @@ import { PAGE_TITLE, - HOST_RISK_PREVIEW_TABLE, - HOST_RISK_PREVIEW_TABLE_ROWS, - USER_RISK_PREVIEW_TABLE, - USER_RISK_PREVIEW_TABLE_ROWS, RISK_PREVIEW_ERROR, - LOCAL_QUERY_BAR_SELECTOR, RISK_SCORE_ERROR_PANEL, RISK_SCORE_STATUS, - LOCAL_QUERY_BAR_SEARCH_INPUT_SELECTOR, } from '../../screens/entity_analytics_management'; import { deleteRiskScore, installRiskScoreModule } from '../../tasks/api_calls/risk_scores'; @@ -31,8 +25,6 @@ import { interceptRiskPreviewSuccess, interceptRiskInitError, } from '../../tasks/api_calls/risk_engine'; -import { updateDateRangeInLocalDatePickers } from '../../tasks/date_picker'; -import { submitLocalSearch } from '../../tasks/search_bar'; import { riskEngineStatusChange, upgradeRiskEngine, @@ -65,31 +57,6 @@ describe( }); describe('Risk preview', () => { - it('risk scores reacts on change in datepicker', () => { - const START_DATE = 'Jan 18, 2019 @ 20:33:29.186'; - const END_DATE = 'Jan 19, 2019 @ 20:33:29.186'; - - cy.get(HOST_RISK_PREVIEW_TABLE_ROWS).should('have.length', 5); - cy.get(USER_RISK_PREVIEW_TABLE_ROWS).should('have.length', 5); - - updateDateRangeInLocalDatePickers(LOCAL_QUERY_BAR_SELECTOR, START_DATE, END_DATE); - - cy.get(HOST_RISK_PREVIEW_TABLE).contains('No items found'); - cy.get(USER_RISK_PREVIEW_TABLE).contains('No items found'); - }); - - it('risk scores reacts on change in search bar query', () => { - cy.get(HOST_RISK_PREVIEW_TABLE_ROWS).should('have.length', 5); - cy.get(USER_RISK_PREVIEW_TABLE_ROWS).should('have.length', 5); - cy.get(LOCAL_QUERY_BAR_SEARCH_INPUT_SELECTOR).type('host.name: "test-host1"'); - submitLocalSearch(LOCAL_QUERY_BAR_SELECTOR); - - cy.get(HOST_RISK_PREVIEW_TABLE_ROWS).should('have.length', 1); - cy.get(HOST_RISK_PREVIEW_TABLE_ROWS).contains('test-host1'); - cy.get(USER_RISK_PREVIEW_TABLE_ROWS).should('have.length', 1); - cy.get(USER_RISK_PREVIEW_TABLE_ROWS).contains('test1'); - }); - it('show error panel if API returns error and then try to refetch data', () => { interceptRiskPreviewError(); diff --git a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/sourcerer/sourcerer_timeline.cy.ts b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/sourcerer/sourcerer_timeline.cy.ts index 9d5b77919d54..efd8635d78cd 100644 --- a/x-pack/test/security_solution_cypress/cypress/e2e/investigations/sourcerer/sourcerer_timeline.cy.ts +++ b/x-pack/test/security_solution_cypress/cypress/e2e/investigations/sourcerer/sourcerer_timeline.cy.ts @@ -40,7 +40,8 @@ import { closeTimeline, openTimelineById } from '../../../tasks/timeline'; const siemDataViewTitle = 'Security Default Data View'; const dataViews = ['logs-*', 'metrics-*', '.kibana-event-log-*']; -describe('Timeline scope', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { +// FLAKY: https://github.com/elastic/kibana/issues/198944 +describe.skip('Timeline scope', { tags: ['@ess', '@serverless', '@skipInServerless'] }, () => { before(() => { waitForRulesBootstrap(); }); diff --git a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts index f11b032d6351..f25d362f0d79 100644 --- a/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/endpoint/index.ts @@ -12,7 +12,9 @@ import { FtrProviderContext } from '../../configs/ftr_provider_context'; export default function (providerContext: FtrProviderContext) { const { loadTestFile, getService, getPageObjects } = providerContext; - describe('endpoint', function () { + // FLAKY: https://github.com/elastic/kibana/issues/180401 + // FLAKY: https://github.com/elastic/kibana/issues/203894 + describe.skip('endpoint', function () { const ingestManager = getService('ingestManager'); const log = getService('log'); const endpointTestResources = getService('endpointTestResources'); diff --git a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts index 037ee3d60ec3..5024b6d16739 100644 --- a/x-pack/test/security_solution_endpoint/apps/integrations/index.ts +++ b/x-pack/test/security_solution_endpoint/apps/integrations/index.ts @@ -12,7 +12,9 @@ import { FtrProviderContext } from '../../configs/ftr_provider_context'; export default function (providerContext: FtrProviderContext) { const { loadTestFile, getService, getPageObjects } = providerContext; - describe('integrations', function () { + // FLAKY: https://github.com/elastic/kibana/issues/203916 + // FLAKY: https://github.com/elastic/kibana/issues/180401 + describe.skip('integrations', function () { const ingestManager = getService('ingestManager'); const log = getService('log'); const endpointTestResources = getService('endpointTestResources'); diff --git a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts index 1e18525df2ec..1af3b0e593e0 100644 --- a/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts +++ b/x-pack/test/spaces_api_integration/spaces_only/telemetry/telemetry.ts @@ -83,6 +83,8 @@ export default function ({ getService }: FtrProviderContext) { monitoring: 0, apm: 0, enterpriseSearch: 0, + enterpriseSearchApplications: 0, + enterpriseSearchAnalytics: 0, searchInferenceEndpoints: 0, searchPlayground: 0, siem: 0, diff --git a/x-pack/test/tsconfig.json b/x-pack/test/tsconfig.json index 95178eca8317..ce202abc9738 100644 --- a/x-pack/test/tsconfig.json +++ b/x-pack/test/tsconfig.json @@ -137,10 +137,8 @@ "@kbn/stack-connectors-plugin", "@kbn/stack-alerts-plugin", "@kbn/apm-data-access-plugin", - "@kbn/coloring", "@kbn/profiling-utils", "@kbn/profiling-data-access-plugin", - "@kbn/coloring", "@kbn/es", "@kbn/metrics-data-access-plugin", "@kbn/dataset-quality-plugin", @@ -188,8 +186,10 @@ "@kbn/ai-assistant-common", "@kbn/core-deprecations-common", "@kbn/usage-collection-plugin", + "@kbn/palettes", "@kbn/sse-utils-server", "@kbn/gen-ai-functional-testing", - "@kbn/integration-assistant-plugin" + "@kbn/integration-assistant-plugin", + "@kbn/core-elasticsearch-server" ] } diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts index ffe278d15252..71324846b216 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/catalogue.ts @@ -59,15 +59,9 @@ export default function catalogueTests({ getService }: FtrProviderContext) { case 'everything_space_all at everything_space': { expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('catalogue'); - // everything except spaces, monitoring, the classic enterprise search suite (app search/workplace search), and ES features are enabled + // everything except spaces, monitoring, and ES features are enabled // (easier to say: all "proper" Kibana features are enabled) - const exceptions = [ - 'monitoring', - 'appSearch', - 'workplaceSearch', - 'spaces', - ...esFeatureExceptions, - ]; + const exceptions = ['monitoring', 'spaces', ...esFeatureExceptions]; const expected = mapValues( uiCapabilities.value!.catalogue, (enabled, catalogueId) => !exceptions.includes(catalogueId) diff --git a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts index 934f9af8d6b8..75408726ab8c 100644 --- a/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/security_and_spaces/tests/nav_links.ts @@ -47,12 +47,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { case 'everything_space_all at everything_space': expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('navLinks'); - expect(uiCapabilities.value!.navLinks).to.eql( - navLinksBuilder.except('monitoring', { - feature: 'enterpriseSearch', - apps: ['appSearch', 'workplaceSearch'], - }) - ); + expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.except('monitoring')); break; case 'global_read at everything_space': case 'dual_privileges_read at everything_space': @@ -64,6 +59,8 @@ export default function navLinksTests({ getService }: FtrProviderContext) { 'monitoring', 'observabilityAIAssistant', 'enterpriseSearch', + 'enterpriseSearchApplications', + 'enterpriseSearchAnalytics', 'searchPlayground', 'searchInferenceEndpoints', 'guidedOnboardingFeature', diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts index d5933895d4e8..d8ddaa72026a 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/catalogue.ts @@ -25,13 +25,6 @@ export default function catalogueTests({ getService }: FtrProviderContext) { 'watcher', ]; - const uiCapabilitiesExceptions = [ - // appSearch and workplace Search are loaded but disabled because the ent-search application isn't running. - // That means the following capabilities are disabled: - 'appSearch', - 'workplaceSearch', - ]; - describe('catalogue', () => { SpaceScenarios.forEach((scenario) => { it(`${scenario.name}`, async () => { @@ -41,10 +34,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('catalogue'); // everything is enabled - const expected = mapValues( - uiCapabilities.value!.catalogue, - (enabled, catalogueId) => !uiCapabilitiesExceptions.includes(catalogueId) - ); + const expected = mapValues(uiCapabilities.value!.catalogue, (enabled) => enabled); expect(uiCapabilities.value!.catalogue).to.eql(expected); break; } @@ -66,8 +56,7 @@ export default function catalogueTests({ getService }: FtrProviderContext) { // only foo is disabled const expected = mapValues( uiCapabilities.value!.catalogue, - (enabled, catalogueId) => - !uiCapabilitiesExceptions.includes(catalogueId) && catalogueId !== 'foo' + (enabled, catalogueId) => catalogueId !== 'foo' && enabled ); expect(uiCapabilities.value!.catalogue).to.eql(expected); break; diff --git a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts index 30f7cd8c5c87..9be243d1cf7c 100644 --- a/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts +++ b/x-pack/test/ui_capabilities/spaces_only/tests/nav_links.ts @@ -17,13 +17,6 @@ export default function navLinksTests({ getService }: FtrProviderContext) { const uiCapabilitiesService: UICapabilitiesService = getService('uiCapabilities'); const featuresService: FeaturesService = getService('features'); - const uiCapabilitiesExceptions = { - // appSearch and workplace Search are loaded but disabled because the ent-search application isn't running. - // That means the following capabilities are disabled: - feature: 'enterpriseSearch', - apps: ['appSearch', 'workplaceSearch'], - }; - describe('navLinks', () => { let navLinksBuilder: NavLinksBuilder; before(async () => { @@ -38,9 +31,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { case 'everything_space': expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('navLinks'); - expect(uiCapabilities.value!.navLinks).to.eql( - navLinksBuilder.except(uiCapabilitiesExceptions) - ); + expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.all()); break; case 'nothing_space': expect(uiCapabilities.success).to.be(true); @@ -50,9 +41,7 @@ export default function navLinksTests({ getService }: FtrProviderContext) { case 'foo_disabled_space': expect(uiCapabilities.success).to.be(true); expect(uiCapabilities.value).to.have.property('navLinks'); - expect(uiCapabilities.value!.navLinks).to.eql( - navLinksBuilder.except('foo', uiCapabilitiesExceptions) - ); + expect(uiCapabilities.value!.navLinks).to.eql(navLinksBuilder.except('foo')); break; default: throw new UnreachableError(scenario); diff --git a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/api_deprecations.ts b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/api_deprecations.ts index 74c3064f9341..6a0f8aad4686 100644 --- a/x-pack/test/upgrade_assistant_integration/upgrade_assistant/api_deprecations.ts +++ b/x-pack/test/upgrade_assistant_integration/upgrade_assistant/api_deprecations.ts @@ -17,9 +17,15 @@ import type { import { FtrProviderContext } from '../../common/ftr_provider_context'; const getApiDeprecations = (allDeprecations: DomainDeprecationDetails[]) => { - return allDeprecations.filter( - (deprecation) => deprecation.deprecationType === 'api' - ) as unknown as Array>; + return ( + allDeprecations + .filter( + (deprecation): deprecation is DomainDeprecationDetails => + deprecation.deprecationType === 'api' + ) + // Ensure consistent sorting + .sort((a, b) => a.title.localeCompare(b.title)) + ); }; export default function ({ getService }: FtrProviderContext) { @@ -28,8 +34,7 @@ export default function ({ getService }: FtrProviderContext) { const retry = getService('retry'); const es = getService('es'); - // FLAKY: https://github.com/elastic/kibana/issues/199782 - describe.skip('Kibana API Deprecations', function () { + describe('Kibana API Deprecations', function () { // bail on first error in this suite since cases sequentially depend on each other this.bail(true); diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_usage/mock_data.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_usage/mock_data.ts index 7bd4b7f3e7a2..e0f6c5d43e78 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_usage/mock_data.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_usage/mock_data.ts @@ -15,6 +15,14 @@ export const mockAutoOpsResponse = { [1726862130000, 14657904], ], }, + { + name: 'metrics-system.core.total.pct-default', + error: null, + data: [ + [1726858530000, 13756849], + [1726862130000, 14657904], + ], + }, { name: 'logs-nginx.access-default', error: null, @@ -33,6 +41,14 @@ export const mockAutoOpsResponse = { [1726862130000, 13956423], ], }, + { + name: 'metrics-system.core.total.pct-default', + error: null, + data: [ + [1726858530000, 13756849], + [1726862130000, 14657904], + ], + }, { name: 'logs-nginx.access-default', error: null, diff --git a/x-pack/test_serverless/api_integration/test_suites/common/data_usage/tests/metrics.ts b/x-pack/test_serverless/api_integration/test_suites/common/data_usage/tests/metrics.ts index 5460b750a5b2..6a0774ea2e8f 100644 --- a/x-pack/test_serverless/api_integration/test_suites/common/data_usage/tests/metrics.ts +++ b/x-pack/test_serverless/api_integration/test_suites/common/data_usage/tests/metrics.ts @@ -29,7 +29,7 @@ export default function ({ getService }: FtrProviderContext) { const mockAutoopsApiService = setupMockServer(); describe('Metrics', function () { let mockApiServer: http.Server; - // due to the plugin depending on yml config (xpack.dataUsage.enabled), we cannot test in MKI until it is on by default + // MKI has a different config in the QA environment and will ignore the mock service this.tags(['skipMKI']); before(async () => { diff --git a/x-pack/test_serverless/api_integration/test_suites/observability/platform_security/authorization.ts b/x-pack/test_serverless/api_integration/test_suites/observability/platform_security/authorization.ts index 04f0110527c7..f3a3acb9f805 100644 --- a/x-pack/test_serverless/api_integration/test_suites/observability/platform_security/authorization.ts +++ b/x-pack/test_serverless/api_integration/test_suites/observability/platform_security/authorization.ts @@ -94,6 +94,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:apm/show", "ui:apm/save", "ui:apm/alerting:show", @@ -1572,6 +1577,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:apm/show", "ui:apm/save", "ui:apm/alerting:show", @@ -3041,6 +3051,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:apm/show", "ui:apm/alerting:show", "alerting:apm.error_rate/apm/rule/get", @@ -3651,6 +3666,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:apm/show", "ui:apm/alerting:show", "alerting:apm.error_rate/apm/rule/get", @@ -4896,6 +4916,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:config-global/find", "saved_object:config-global/open_point_in_time", "saved_object:config-global/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/save", "ui:discover/saveQuery", @@ -6103,6 +6128,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/save", "ui:discover/saveQuery", @@ -7278,6 +7308,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "api:rac", "app:observability", @@ -7777,6 +7812,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:telemetry/find", "saved_object:telemetry/open_point_in_time", "saved_object:telemetry/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/createShortUrl", "api:rac", @@ -8879,6 +8919,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:fleetv2/read", "ui:fleetv2/all", "ui:fleetv2/agents_read", @@ -9370,6 +9415,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:fleetv2/read", "ui:fleetv2/all", "api:infra", @@ -9763,6 +9813,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:fleetv2/read", "api:infra", "api:rac", @@ -9982,6 +10037,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:fleetv2/read", "ui:fleetv2/agents_read", "ui:fleetv2/agent_policies_read", @@ -10402,6 +10462,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:infrastructure/show", "ui:infrastructure/configureSource", "ui:infrastructure/save", @@ -11920,6 +11985,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:infrastructure/show", "ui:infrastructure/configureSource", "ui:infrastructure/save", @@ -13417,6 +13487,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:infrastructure/show", "alerting:metrics.alert.threshold/infrastructure/rule/get", "alerting:metrics.alert.threshold/infrastructure/rule/getRuleState", @@ -14042,6 +14117,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:infrastructure/show", "alerting:metrics.alert.threshold/infrastructure/rule/get", "alerting:metrics.alert.threshold/infrastructure/rule/getRuleState", @@ -14650,6 +14730,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -14685,6 +14770,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -14713,6 +14803,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], "read": Array [ "login:", @@ -14736,6 +14831,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], }, "slo": Object { @@ -14801,6 +14901,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:slo/read", "ui:slo/write", "alerting:slo.rules.burnRate/slo/rule/get", @@ -16025,6 +16130,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:slo/read", "ui:slo/write", "alerting:slo.rules.burnRate/slo/rule/get", @@ -17227,6 +17337,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:slo/read", "alerting:slo.rules.burnRate/slo/rule/get", "alerting:slo.rules.burnRate/slo/rule/getRuleState", @@ -17727,6 +17842,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:slo/read", "alerting:slo.rules.burnRate/slo/rule/get", "alerting:slo.rules.burnRate/slo/rule/getRuleState", @@ -18315,6 +18435,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:uptime/save", "ui:uptime/configureSettings", "ui:uptime/show", @@ -19791,6 +19916,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:uptime/save", "ui:uptime/configureSettings", "ui:uptime/show", @@ -21189,6 +21319,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:uptime/show", "ui:uptime/alerting:save", "alerting:xpack.uptime.alerts.tls/uptime/rule/get", @@ -21784,6 +21919,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:uptime/show", "ui:uptime/alerting:save", "alerting:xpack.uptime.alerts.tls/uptime/rule/get", diff --git a/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts b/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts index ed9fdd30cbda..c3fad6aa67ca 100644 --- a/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts +++ b/x-pack/test_serverless/api_integration/test_suites/search/platform_security/authorization.ts @@ -703,6 +703,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:config-global/find", "saved_object:config-global/open_point_in_time", "saved_object:config-global/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/save", "ui:discover/saveQuery", @@ -782,6 +787,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/save", "ui:discover/saveQuery", @@ -829,6 +839,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", ], "read": Array [ @@ -881,6 +896,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:telemetry/find", "saved_object:telemetry/open_point_in_time", "saved_object:telemetry/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:discover/show", "ui:discover/createShortUrl", ], @@ -949,6 +969,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -984,6 +1009,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -1012,6 +1042,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], "read": Array [ "login:", @@ -1035,6 +1070,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], }, } diff --git a/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts b/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts index 1f9a7f74fd57..dac4ff0604a1 100644 --- a/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts +++ b/x-pack/test_serverless/api_integration/test_suites/security/platform_security/authorization.ts @@ -67,6 +67,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -102,6 +107,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "api:downloadCsv", "ui:management/insightsAndAlerting/reporting", "ui:dashboard/downloadCsv", @@ -130,6 +140,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], "read": Array [ "login:", @@ -153,6 +168,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", ], }, "siem": Object { @@ -436,6 +456,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:siem/show", "ui:siem/crud", "ui:siem/entity-analytics", @@ -843,11 +868,6 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:map/find", "saved_object:map/open_point_in_time", "saved_object:map/close_point_in_time", - "saved_object:tag/bulk_get", - "saved_object:tag/get", - "saved_object:tag/find", - "saved_object:tag/open_point_in_time", - "saved_object:tag/close_point_in_time", "ui:dashboard/createNew", "ui:dashboard/show", "ui:dashboard/showWriteControls", @@ -1295,6 +1315,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:siem/show", "ui:siem/crud", "ui:siem/entity-analytics", @@ -1700,11 +1725,6 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:map/find", "saved_object:map/open_point_in_time", "saved_object:map/close_point_in_time", - "saved_object:tag/bulk_get", - "saved_object:tag/get", - "saved_object:tag/find", - "saved_object:tag/open_point_in_time", - "saved_object:tag/close_point_in_time", "ui:dashboard/createNew", "ui:dashboard/show", "ui:dashboard/showWriteControls", @@ -1876,6 +1896,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:siem/show", "ui:siem/entity-analytics", "ui:siem/investigation-guide", @@ -2065,11 +2090,6 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:dashboard/find", "saved_object:dashboard/open_point_in_time", "saved_object:dashboard/close_point_in_time", - "saved_object:tag/bulk_get", - "saved_object:tag/get", - "saved_object:tag/find", - "saved_object:tag/open_point_in_time", - "saved_object:tag/close_point_in_time", "ui:dashboard/show", "ui:dashboard/createShortUrl", "app:visualize", @@ -2243,6 +2263,11 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:url/find", "saved_object:url/open_point_in_time", "saved_object:url/close_point_in_time", + "saved_object:tag/bulk_get", + "saved_object:tag/get", + "saved_object:tag/find", + "saved_object:tag/open_point_in_time", + "saved_object:tag/close_point_in_time", "ui:siem/show", "ui:siem/entity-analytics", "ui:siem/investigation-guide", @@ -2433,11 +2458,6 @@ export default function ({ getService }: FtrProviderContext) { "saved_object:dashboard/find", "saved_object:dashboard/open_point_in_time", "saved_object:dashboard/close_point_in_time", - "saved_object:tag/bulk_get", - "saved_object:tag/get", - "saved_object:tag/find", - "saved_object:tag/open_point_in_time", - "saved_object:tag/close_point_in_time", "ui:dashboard/show", "ui:dashboard/createShortUrl", "app:visualize", diff --git a/x-pack/test_serverless/functional/page_objects/index.ts b/x-pack/test_serverless/functional/page_objects/index.ts index e10e98529b8b..5c00c95b73a1 100644 --- a/x-pack/test_serverless/functional/page_objects/index.ts +++ b/x-pack/test_serverless/functional/page_objects/index.ts @@ -26,6 +26,7 @@ import { SvlSearchElasticsearchStartPageProvider } from './svl_search_elasticsea import { SvlApiKeysProvider } from './svl_api_keys'; import { SvlSearchCreateIndexPageProvider } from './svl_search_create_index_page'; import { SvlSearchInferenceManagementPageProvider } from './svl_search_inference_management_page'; +import { SvlDataUsagePageProvider } from './svl_data_usage'; export const pageObjects = { ...xpackFunctionalPageObjects, @@ -49,4 +50,5 @@ export const pageObjects = { svlApiKeys: SvlApiKeysProvider, svlSearchCreateIndexPage: SvlSearchCreateIndexPageProvider, svlSearchInferenceManagementPage: SvlSearchInferenceManagementPageProvider, + svlDataUsagePage: SvlDataUsagePageProvider, }; diff --git a/x-pack/test_serverless/functional/page_objects/svl_data_usage.ts b/x-pack/test_serverless/functional/page_objects/svl_data_usage.ts new file mode 100644 index 000000000000..ccece1e10e11 --- /dev/null +++ b/x-pack/test_serverless/functional/page_objects/svl_data_usage.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 { WebElementWrapper } from '@kbn/ftr-common-functional-ui-services'; +import { FtrProviderContext } from '../ftr_provider_context'; + +export function SvlDataUsagePageProvider({ getService }: FtrProviderContext) { + const testSubjects = getService('testSubjects'); + + return { + async assertDataUsagePageExists(): Promise { + return await testSubjects.exists('data-usage-page'); + }, + async clickDatastreamsDropdown() { + await testSubjects.click('data-usage-metrics-filter-dataStreams-popoverButton'); + }, + async findDatastreamsDropdownOptions() { + return await testSubjects.findAll('dataStreams-filter-option'); + }, + async findDatastreamsDropdownFilterButton() { + return await testSubjects.find('data-usage-metrics-filter-dataStreams-popoverButton'); + }, + async findIngestRateChart() { + return await testSubjects.find('ingest_rate-chart'); + }, + async storageRetainedChart() { + return await testSubjects.find('storage_retained-chart'); + }, + async findLegendItemsInChart(chartElement: WebElementWrapper) { + return await chartElement.findAllByCssSelector('li.echLegendItem'); + }, + async findLegendActionButton(legendItemElement: WebElementWrapper) { + return legendItemElement.findByTestSubject('legendActionButton'); + }, + async clickLegendActionButtonAtIndex(chartElement: WebElementWrapper, index: number) { + const legendItems = await this.findLegendItemsInChart(chartElement); + if (index < 0 || index >= legendItems.length) { + throw new Error( + `Invalid legend item index: ${index}. There are only ${legendItems.length} legend items.` + ); + } + const legendItem = legendItems[index]; + const actionButton = await this.findLegendActionButton(legendItem); + await actionButton.click(); + }, + + async assertLegendActionPopoverExists() { + await testSubjects.existOrFail('legendActionPopover'); + }, + }; +} diff --git a/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts b/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts index 2e754337c03f..96155e592ee9 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_search_connectors_page.ts @@ -12,6 +12,7 @@ export function SvlSearchConnectorsPageProvider({ getService }: FtrProviderConte const browser = getService('browser'); const retry = getService('retry'); const es = getService('es'); + const comboBox = getService('comboBox'); return { helpers: { async deleteAllConnectors() { @@ -63,10 +64,7 @@ export function SvlSearchConnectorsPageProvider({ getService }: FtrProviderConte async editType(type: string) { await testSubjects.existOrFail('serverlessSearchEditConnectorType'); await testSubjects.existOrFail('serverlessSearchEditConnectorTypeChoices'); - await testSubjects.click('serverlessSearchEditConnectorTypeChoices'); - await testSubjects.setValue('serverlessSearchEditConnectorTypeChoices', type); - await testSubjects.exists(`serverlessSearchConnectorServiceType-${type}`); - await testSubjects.click(`serverlessSearchConnectorServiceType-${type}`); + await comboBox.filterOptionsList('serverlessSearchEditConnectorTypeChoices', type); }, async expectConnectorIdToMatchUrl(connectorId: string) { expect(await browser.getCurrentUrl()).contain(`/app/connectors/${connectorId}`); diff --git a/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts b/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts index 4424238a9c80..4e4c6147e8f7 100644 --- a/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts +++ b/x-pack/test_serverless/functional/page_objects/svl_search_inference_management_page.ts @@ -27,53 +27,29 @@ export function SvlSearchInferenceManagementPageProvider({ getService }: FtrProv const table = await testSubjects.find('inferenceEndpointTable'); const rows = await table.findAllByClassName('euiTableRow'); - expect(rows.length).to.equal(2); + // we need at least one (ELSER) otherwise index_mapping might experience some issues + expect(rows.length).to.greaterThan(1); - const elserEndpointCell = await rows[0].findByTestSubject('endpointCell'); - const elserEndpointName = await elserEndpointCell.getVisibleText(); - expect(elserEndpointName).to.contain('.elser-2-elasticsearch'); + const texts = await Promise.all(rows.map((row) => row.getVisibleText())); + const hasElser2 = texts.some((text) => text.includes('.elser-2')); + const hasE5 = texts.some((text) => text.includes('.multilingual-e5')); - const elserProviderCell = await rows[0].findByTestSubject('providerCell'); - const elserProviderName = await elserProviderCell.getVisibleText(); - expect(elserProviderName).to.contain('Elasticsearch'); - expect(elserProviderName).to.contain('.elser_model_2'); - - const elserTypeCell = await rows[0].findByTestSubject('typeCell'); - const elserTypeName = await elserTypeCell.getVisibleText(); - expect(elserTypeName).to.contain('sparse_embedding'); - - const e5EndpointCell = await rows[1].findByTestSubject('endpointCell'); - const e5EndpointName = await e5EndpointCell.getVisibleText(); - expect(e5EndpointName).to.contain('.multilingual-e5-small-elasticsearch'); - - const e5ProviderCell = await rows[1].findByTestSubject('providerCell'); - const e5ProviderName = await e5ProviderCell.getVisibleText(); - expect(e5ProviderName).to.contain('Elasticsearch'); - expect(e5ProviderName).to.contain('.multilingual-e5-small'); - - const e5TypeCell = await rows[1].findByTestSubject('typeCell'); - const e5TypeName = await e5TypeCell.getVisibleText(); - expect(e5TypeName).to.contain('text_embedding'); + expect(hasElser2).to.be(true); + expect(hasE5).to.be(true); }, async expectPreconfiguredEndpointsCannotBeDeleted() { - const table = await testSubjects.find('inferenceEndpointTable'); - const rows = await table.findAllByClassName('euiTableRow'); - - const elserDeleteAction = await rows[0].findByTestSubject('inferenceUIDeleteAction'); - const e5DeleteAction = await rows[1].findByTestSubject('inferenceUIDeleteAction'); - - expect(await elserDeleteAction.isEnabled()).to.be(false); - expect(await e5DeleteAction.isEnabled()).to.be(false); + const preconfigureEndpoints = await testSubjects.findAll( + 'inferenceUIDeleteAction-preconfigured' + ); + for (const endpoint of preconfigureEndpoints) { + expect(await endpoint.isEnabled()).to.be(false); + } }, async expectEndpointWithoutUsageTobeDelete() { - const table = await testSubjects.find('inferenceEndpointTable'); - const rows = await table.findAllByClassName('euiTableRow'); - - const userCreatedEndpoint = await rows[2].findByTestSubject('inferenceUIDeleteAction'); - - await userCreatedEndpoint.click(); + const userDefinedEdnpoint = await testSubjects.find('inferenceUIDeleteAction-user-defined'); + await userDefinedEdnpoint.click(); await testSubjects.existOrFail('deleteModalForInferenceUI'); await testSubjects.existOrFail('deleteModalInferenceEndpointName'); @@ -83,12 +59,8 @@ export function SvlSearchInferenceManagementPageProvider({ getService }: FtrProv }, async expectEndpointWithUsageTobeDelete() { - const table = await testSubjects.find('inferenceEndpointTable'); - const rows = await table.findAllByClassName('euiTableRow'); - - const userCreatedEndpoint = await rows[2].findByTestSubject('inferenceUIDeleteAction'); - - await userCreatedEndpoint.click(); + const userDefinedEdnpoint = await testSubjects.find('inferenceUIDeleteAction-user-defined'); + await userDefinedEdnpoint.click(); await testSubjects.existOrFail('deleteModalForInferenceUI'); await testSubjects.existOrFail('deleteModalInferenceEndpointName'); diff --git a/x-pack/test_serverless/functional/services/index.ts b/x-pack/test_serverless/functional/services/index.ts index 770cdbb88c97..198b6be56934 100644 --- a/x-pack/test_serverless/functional/services/index.ts +++ b/x-pack/test_serverless/functional/services/index.ts @@ -5,6 +5,7 @@ * 2.0. */ +import { ComboBoxService } from '@kbn/test-suites-src/functional/services/combo_box'; import { services as deploymentAgnosticFunctionalServices } from './deployment_agnostic_services'; import { services as svlSharedServices } from '../../shared/services'; import { SvlCommonNavigationServiceProvider } from './svl_common_navigation'; @@ -35,4 +36,6 @@ export const services = { // log services svlLogsSynthtraceClient: LogsSynthtraceProvider, alertingApi: SvlApiIntegrationSvcs.alertingApi, + // EUI components + comboBox: ComboBoxService, }; diff --git a/x-pack/test_serverless/functional/test_suites/common/data_usage/main.ts b/x-pack/test_serverless/functional/test_suites/common/data_usage/main.ts index 0b59557229cd..438bf5ab7ee8 100644 --- a/x-pack/test_serverless/functional/test_suites/common/data_usage/main.ts +++ b/x-pack/test_serverless/functional/test_suites/common/data_usage/main.ts @@ -4,30 +4,200 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ - +import expect from '@kbn/expect'; +import http from 'http'; +import { InterceptResponseFactory } from '@kbn/ftr-common-functional-ui-services'; import { FtrProviderContext } from '../../../ftr_provider_context'; +import { setupMockServer } from '../../../../api_integration/test_suites/common/data_usage/mock_api'; export default ({ getPageObjects, getService }: FtrProviderContext) => { - const pageObjects = getPageObjects(['svlCommonPage', 'svlManagementPage', 'common']); + const pageObjects = getPageObjects([ + 'svlDataUsagePage', + 'svlCommonPage', + 'svlManagementPage', + 'common', + ]); const testSubjects = getService('testSubjects'); const retry = getService('retry'); + const mockAutoopsApiService = setupMockServer(); + const es = getService('es'); + const browser = getService('browser'); + let mockApiServer: http.Server; + const dataStreamsMockResponse = [ + { + name: 'metrics-system.cpu-default', + storageSizeBytes: 6197, + }, + { + name: 'metrics-system.core.total.pct-default', + storageSizeBytes: 5197, + }, + { + name: 'logs-nginx.access-default', + storageSizeBytes: 1938, + }, + ]; describe('Main page', function () { this.tags(['skipMKI']); before(async () => { + // create test data streams from the mock data streams response + // so the metrics api can verify they exist + for (const { name } of dataStreamsMockResponse) { + await es.indices.putIndexTemplate({ + name, + body: { + index_patterns: [name], + data_stream: {}, + priority: 200, + }, + }); + await es.indices.createDataStream({ name }); + } await pageObjects.svlCommonPage.loginAsAdmin(); await pageObjects.common.navigateToApp('management'); await retry.waitFor('page to be visible', async () => { return await testSubjects.exists('cards-navigation-page'); }); await pageObjects.svlManagementPage.assertDataUsageManagementCardExists(); - await pageObjects.svlManagementPage.clickDataUsageManagementCard(); + + // mock external API request to autoops + mockApiServer = mockAutoopsApiService.listen(9000); + + // intercept the data_streams request to bypass waiting for the metering api to aggregate a response + // otherwise storage sizes get filtered out if they are 0 + await browser.interceptRequest( + '*data_streams*', + (responseFactory: InterceptResponseFactory) => { + return responseFactory.fulfill({ + responseCode: 200, + responseHeaders: [{ name: 'Content-Type', value: 'application/json' }], + body: Buffer.from(JSON.stringify(dataStreamsMockResponse)).toString('base64'), + }); + }, + async () => { + await pageObjects.svlManagementPage.clickDataUsageManagementCard(); + } + ); + }); + after(async () => { + mockApiServer.close(); + for (const { name } of dataStreamsMockResponse) { + await es.indices.deleteDataStream({ name }); + } }); it('renders data usage page', async () => { await retry.waitFor('page to be visible', async () => { - return await testSubjects.exists('DataUsagePage'); + return await pageObjects.svlDataUsagePage.assertDataUsagePageExists(); + }); + }); + it('shows 3 data streams in the filter dropdown', async () => { + // Click the dropdown button to show the options + await pageObjects.svlDataUsagePage.clickDatastreamsDropdown(); + + const options = await pageObjects.svlDataUsagePage.findDatastreamsDropdownOptions(); + + // Assert that exactly 3 elements are present + expect(options.length).to.eql(3); + + // Assert that each option is checked + for (const option of options) { + const ariaChecked = await option.getAttribute('aria-checked'); + expect(ariaChecked).to.be('true'); + } + + // Locate the filter button using its data-test-subj + const datastreamsDropdownFilterButton = + await pageObjects.svlDataUsagePage.findDatastreamsDropdownFilterButton(); + + // Find the badge element within the button (using its CSS class) + const notificationBadge = await datastreamsDropdownFilterButton.findByCssSelector( + '.euiNotificationBadge' + ); + + // Retrieve the text content of the badge + const activeFiltersCount = await notificationBadge.getVisibleText(); + + // Assert the badge displays the expected count + expect(activeFiltersCount).to.be('3'); + }); + it('renders charts', async () => { + // Data is coming from the mocked autoops API + const chartContainer = await testSubjects.find('data-usage-metrics'); + await testSubjects.existOrFail('data-usage-metrics'); + + // Check 2 charts rendered + await retry.waitFor('chart to render', async () => { + const chartStatus = await chartContainer.findAllByCssSelector( + '.echChartStatus[data-ech-render-complete="true"]' + ); + return chartStatus.length === 2; + }); + }); + it('renders legend', async () => { + const ingestRateChart = await pageObjects.svlDataUsagePage.findIngestRateChart(); + const storageRetainedChart = await pageObjects.svlDataUsagePage.storageRetainedChart(); + + const ingestLegendItems = await pageObjects.svlDataUsagePage.findLegendItemsInChart( + ingestRateChart + ); + + expect(ingestLegendItems.length).to.eql(4); // 3 data streams + 1 Total line series + + const storageLegendItems = await pageObjects.svlDataUsagePage.findLegendItemsInChart( + storageRetainedChart + ); + expect(storageLegendItems.length).to.eql(4); // same number of data streams + total line series + }); + it('renders actions popover with correct links', async () => { + // Open the first legend item actions popover + const ingestRateChart = await pageObjects.svlDataUsagePage.findIngestRateChart(); + await pageObjects.svlDataUsagePage.clickLegendActionButtonAtIndex(ingestRateChart, 0); + await pageObjects.svlDataUsagePage.assertLegendActionPopoverExists(); + // Check for links + await testSubjects.existOrFail('copyDataStreamNameAction'); + await testSubjects.existOrFail('manageDataStreamAction'); + await testSubjects.existOrFail('DatasetQualityAction'); + + const manageLink = await testSubjects.find('manageDataStreamAction'); + await manageLink.click(); + + // Wait for navigation to the data stream details page + await retry.waitFor('URL to update (index management)', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes( + `/app/management/data/index_management/data_streams/${dataStreamsMockResponse[0].name}` + ); + }); + await browser.goBack(); + // test second link to ensure state changed + await pageObjects.svlDataUsagePage.clickLegendActionButtonAtIndex(ingestRateChart, 1); + await pageObjects.svlDataUsagePage.assertLegendActionPopoverExists(); + + await manageLink.click(); + + // Wait for navigation to the data stream details page + await retry.waitFor('URL to update (index management)', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes( + `/app/management/data/index_management/data_streams/${dataStreamsMockResponse[1].name}` + ); + }); + await browser.goBack(); + + // Test navigation for the data quality link + await pageObjects.svlDataUsagePage.clickLegendActionButtonAtIndex(ingestRateChart, 0); + await pageObjects.svlDataUsagePage.assertLegendActionPopoverExists(); + const dataQualityLink = await testSubjects.find('DatasetQualityAction'); + await dataQualityLink.click(); + + // Wait for navigation to the data quality details page + await retry.waitFor('URL to update (data quality)', async () => { + const currentUrl = await browser.getCurrentUrl(); + return currentUrl.includes('/app/management/data/data_quality/details'); }); + await browser.goBack(); }); }); }; diff --git a/x-pack/test_serverless/functional/test_suites/common/data_usage/privileges.ts b/x-pack/test_serverless/functional/test_suites/common/data_usage/privileges.ts index 4efcdd2586a8..dab301dff34e 100644 --- a/x-pack/test_serverless/functional/test_suites/common/data_usage/privileges.ts +++ b/x-pack/test_serverless/functional/test_suites/common/data_usage/privileges.ts @@ -30,11 +30,11 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => { if (expectedVisible) { await pageObjects.svlManagementPage.assertDataUsageManagementCardExists(); await pageObjects.common.navigateToApp(dataUsageAppUrl); - await testSubjects.exists('DataUsagePage'); + await testSubjects.exists('data-usage-page'); } else { await pageObjects.svlManagementPage.assertDataUsageManagementCardDoesNotExist(); await pageObjects.common.navigateToApp(dataUsageAppUrl); - await testSubjects.missingOrFail('DataUsagePage'); + await testSubjects.missingOrFail('data-usage-page'); } }; diff --git a/x-pack/test_serverless/functional/test_suites/common/discover_ml_uptime/discover/search_source_alert.ts b/x-pack/test_serverless/functional/test_suites/common/discover_ml_uptime/discover/search_source_alert.ts index d4653ca02f6f..1007c89cb171 100644 --- a/x-pack/test_serverless/functional/test_suites/common/discover_ml_uptime/discover/search_source_alert.ts +++ b/x-pack/test_serverless/functional/test_suites/common/discover_ml_uptime/discover/search_source_alert.ts @@ -48,53 +48,59 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { let connectorId: string; const createSourceIndex = () => - es.index({ - index: SOURCE_DATA_VIEW, - body: { - settings: { number_of_shards: 1 }, - mappings: { - properties: { - '@timestamp': { type: 'date' }, - message: { type: 'keyword' }, - }, + retry.try(() => + createIndex(SOURCE_DATA_VIEW, { + '@timestamp': { type: 'date' }, + message: { type: 'keyword' }, + }) + ); + + const createOutputDataIndex = () => + retry.try(() => + createIndex(OUTPUT_DATA_VIEW, { + rule_id: { type: 'text' }, + rule_name: { type: 'text' }, + alert_id: { type: 'text' }, + context_link: { type: 'text' }, + }) + ); + + async function createIndex(index: string, properties: unknown) { + try { + await es.index({ + index, + body: { + settings: { number_of_shards: 1 }, + mappings: { properties }, }, - }, - }); + }); + } catch (e) { + log.error(`Failed to create index "${index}" with error "${e.message}"`); + } + } - const generateNewDocs = async (docsNumber: number) => { + async function generateNewDocs(docsNumber: number, index = SOURCE_DATA_VIEW) { const mockMessages = Array.from({ length: docsNumber }, (_, i) => `msg-${i}`); const dateNow = new Date(); const dateToSet = new Date(dateNow); dateToSet.setMinutes(dateNow.getMinutes() - 10); - for (const message of mockMessages) { - await es.transport.request({ - path: `/${SOURCE_DATA_VIEW}/_doc`, - method: 'POST', - body: { - '@timestamp': dateToSet.toISOString(), - message, - }, - }); + try { + await Promise.all( + mockMessages.map((message) => + es.transport.request({ + path: `/${index}/_doc`, + method: 'POST', + body: { + '@timestamp': dateToSet.toISOString(), + message, + }, + }) + ) + ); + } catch (e) { + log.error(`Failed to generate new docs in "${index}" with error "${e.message}"`); } - }; - - const createOutputDataIndex = () => - es.index({ - index: OUTPUT_DATA_VIEW, - body: { - settings: { - number_of_shards: 1, - }, - mappings: { - properties: { - rule_id: { type: 'text' }, - rule_name: { type: 'text' }, - alert_id: { type: 'text' }, - context_link: { type: 'text' }, - }, - }, - }, - }); + } const deleteAlerts = (alertIds: string[]) => asyncForEach(alertIds, async (alertId: string) => { @@ -216,7 +222,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const openDiscoverAlertFlyout = async () => { await testSubjects.click('discoverAlertsButton'); - await testSubjects.click('discoverCreateAlertButton'); + // Different create rule buttons in serverless + if (await testSubjects.exists('discoverCreateAlertButton')) { + await testSubjects.click('discoverCreateAlertButton'); + } else { + await testSubjects.click('discoverAppMenuCustomThresholdRule'); + } }; const openManagementAlertFlyout = async () => { @@ -366,8 +377,9 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { }; describe('Search source Alert', function () { - // see details: https://github.com/elastic/kibana/issues/193842 - this.tags(['failsOnMKI', 'skipSvlOblt']); + // Failing: https://github.com/elastic/kibana/issues/203045 + this.tags(['skipSvlOblt']); + before(async () => { await security.testUser.setRoles(['discover_alert']); await PageObjects.svlCommonPage.loginAsAdmin(); @@ -502,7 +514,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await testSubjects.click('thresholdPopover'); await testSubjects.setValue('alertThresholdInput0', '1'); - await testSubjects.click('saveEditedRuleButton'); + + // Different save buttons in serverless + if (await testSubjects.exists('saveEditedRuleButton')) { + await testSubjects.click('saveEditedRuleButton'); + } else { + await testSubjects.click('rulePageFooterSaveButton'); + } await PageObjects.header.waitUntilLoadingHasFinished(); await openAlertResults(RULE_NAME); @@ -652,8 +670,15 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await PageObjects.header.waitUntilLoadingHasFinished(); await retry.waitFor('rule name value is correct', async () => { - await testSubjects.setValue('ruleNameInput', newAlert); - const ruleName = await testSubjects.getAttribute('ruleNameInput', 'value'); + let ruleName; + // Rule name input is different in serverless + if (await testSubjects.exists('ruleNameInput')) { + await testSubjects.setValue('ruleNameInput', newAlert); + ruleName = await testSubjects.getAttribute('ruleNameInput', 'value'); + } else { + await testSubjects.setValue('ruleDetailsNameInput', newAlert); + ruleName = await testSubjects.getAttribute('ruleDetailsNameInput', 'value'); + } return ruleName === newAlert; }); @@ -677,7 +702,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await comboBox.set('ruleFormConsumerSelect', 'Stack Rules'); } - await testSubjects.click('saveRuleButton'); + // Save rule button is different in serverless + if (await testSubjects.exists('saveRuleButton')) { + await testSubjects.click('saveRuleButton'); + } else { + await testSubjects.click('rulePageFooterSaveButton'); + } await retry.waitFor('confirmation modal', async () => { return await testSubjects.exists('confirmModalConfirmButton'); diff --git a/x-pack/test_serverless/functional/test_suites/common/platform_security/user_profiles/user_profiles.ts b/x-pack/test_serverless/functional/test_suites/common/platform_security/user_profiles/user_profiles.ts index 71e278e59075..f6039a5c7050 100644 --- a/x-pack/test_serverless/functional/test_suites/common/platform_security/user_profiles/user_profiles.ts +++ b/x-pack/test_serverless/functional/test_suites/common/platform_security/user_profiles/user_profiles.ts @@ -29,8 +29,8 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { const actualFullname = await pageObjects.userProfiles.getProfileFullname(); const actualEmail = await pageObjects.userProfiles.getProfileEmail(); - expect(actualFullname).to.be(userData.full_name); - expect(actualEmail).to.be(userData.email); + expect(actualFullname).to.contain(userData.full_name); + expect(actualEmail).to.contain(userData.email); }); it('should not have edit actions', async () => { diff --git a/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/data/logs_data.ts b/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/data/logs_data.ts index 3692a17709a2..cd1668484337 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/data/logs_data.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/data/logs_data.ts @@ -217,3 +217,7 @@ export 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?'; export const ANOTHER_1024_CHARS = 'grape fig tangerine tangerine kiwi lemon papaya cherry nectarine papaya mango cherry nectarine fig cherry fig grape mango mango quince fig strawberry mango quince date kiwi quince raspberry apple kiwi banana quince fig papaya grape mango cherry banana mango cherry lemon cherry tangerine fig quince quince papaya tangerine grape strawberry banana kiwi grape mango papaya nectarine banana nectarine kiwi papaya lemon apple lemon orange fig cherry grape apple nectarine papaya orange fig papaya date mango papaya mango cherry tangerine papaya apple banana papaya cherry strawberry grape raspberry lemon date papaya mango kiwi cherry fig banana banana apple date strawberry mango tangerine date lemon kiwi quince date orange orange papaya date apple fig tangerine quince tangerine date papaya banana banana orange raspberry papaya apple nectarine lemon raspberry raspberry mango cherry kiwi cherry cherry nectarine cherry date strawberry banana orange mango mango tangerine quince papaya papaya kiwi papaya strawberry date mango'; + +export const CONSISTENT_TAGS = [ + 'this_is_here_to_remove_variance_introduced_by_the_geoip_processor', +]; diff --git a/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts b/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts index 7d12db16850c..4152a745d854 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/dataset_quality/degraded_field_flyout.ts @@ -9,11 +9,12 @@ import expect from '@kbn/expect'; import moment from 'moment'; import { generateShortId, log, timerange } from '@kbn/apm-synthtrace-client'; import { + ANOTHER_1024_CHARS, + CONSISTENT_TAGS, + MORE_THAN_1024_CHARS, createDegradedFieldsRecord, defaultNamespace, getInitialTestLogs, - ANOTHER_1024_CHARS, - MORE_THAN_1024_CHARS, } from './data'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { logsSynthMappings } from './custom_mappings/custom_synth_mappings'; @@ -55,8 +56,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const apmAppDataStreamName = `${type}-${apmAppDatasetName}-${defaultNamespace}`; describe('Degraded fields flyout', function () { - // see details: https://github.com/elastic/kibana/issues/202641 - this.tags(['failsOnMKI']); describe('degraded field flyout open-close', () => { before(async () => { await synthtrace.index([ @@ -207,6 +206,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'service.name': serviceName, 'trace.id': generateShortId(), test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS], + // this works around a geoip limitation in CI + tags: CONSISTENT_TAGS, }) .timestamp(timestamp) ); @@ -300,6 +301,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'trace.id': generateShortId(), test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS], 'cloud.project.id': generateShortId(), + // this works around a geoip limitation in CI + tags: CONSISTENT_TAGS, }) .timestamp(timestamp) ); @@ -410,6 +413,8 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'trace.id': generateShortId(), test_field: [MORE_THAN_1024_CHARS, ANOTHER_1024_CHARS], 'cloud.project.id': generateShortId(), + // this works around a geoip limitation in CI + tags: CONSISTENT_TAGS, }) .timestamp(timestamp) ); diff --git a/x-pack/test_serverless/functional/test_suites/observability/discover/context_awareness/_get_row_indicator_provider.ts b/x-pack/test_serverless/functional/test_suites/observability/discover/context_awareness/_get_row_indicator_provider.ts index 2c7338627ddf..cf4658c52a9b 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/discover/context_awareness/_get_row_indicator_provider.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/discover/context_awareness/_get_row_indicator_provider.ts @@ -85,9 +85,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const firstColorIndicator = await firstCell.findByTestSubject( 'unifiedDataTableRowColorIndicatorCell' ); - expect(await firstColorIndicator.getComputedStyle('background-color')).to.be( - 'rgba(190, 207, 227, 1)' - ); expect(await firstColorIndicator.getAttribute('title')).to.be('Debug'); }); @@ -105,18 +102,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'unifiedDataTableRowColorIndicatorCell' ); expect(await anchorColorIndicator.getAttribute('title')).to.be('Debug'); - expect(await anchorColorIndicator.getComputedStyle('background-color')).to.be( - 'rgba(190, 207, 227, 1)' - ); let nextCell = await dataGrid.getCellElement(1, 0); let nextColorIndicator = await nextCell.findByTestSubject( 'unifiedDataTableRowColorIndicatorCell' ); expect(await nextColorIndicator.getAttribute('title')).to.be('Error'); - expect(await nextColorIndicator.getComputedStyle('background-color')).to.be( - 'rgba(223, 147, 82, 1)' - ); await browser.refresh(); await PageObjects.header.waitUntilLoadingHasFinished(); @@ -127,18 +118,12 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { 'unifiedDataTableRowColorIndicatorCell' ); expect(await anchorColorIndicator.getAttribute('title')).to.be('Debug'); - expect(await anchorColorIndicator.getComputedStyle('background-color')).to.be( - 'rgba(190, 207, 227, 1)' - ); nextCell = await dataGrid.getCellElement(1, 0); nextColorIndicator = await nextCell.findByTestSubject( 'unifiedDataTableRowColorIndicatorCell' ); expect(await nextColorIndicator.getAttribute('title')).to.be('Error'); - expect(await nextColorIndicator.getComputedStyle('background-color')).to.be( - 'rgba(223, 147, 82, 1)' - ); }); }); } diff --git a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts index 0f8df9e7bc78..428d346386b9 100644 --- a/x-pack/test_serverless/functional/test_suites/observability/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/observability/navigation.ts @@ -132,5 +132,15 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'fleet' }); await svlCommonNavigation.breadcrumbs.expectBreadcrumbTexts(['Fleet', 'Agents']); }); + + it('navigates to maintenance windows', async () => { + await svlCommonNavigation.sidenav.openSection('project_settings_project_nav'); + await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'management' }); + await testSubjects.click('app-card-maintenanceWindows'); + await svlCommonNavigation.breadcrumbs.expectBreadcrumbTexts([ + 'Management', + 'Maintenance Windows', + ]); + }); }); } diff --git a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts index 5293655ef092..ecb49911edb1 100644 --- a/x-pack/test_serverless/functional/test_suites/search/inference_management.ts +++ b/x-pack/test_serverless/functional/test_suites/search/inference_management.ts @@ -37,10 +37,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { await pageObjects.svlCommonPage.loginWithRole('developer'); }); - after(async () => { - await ml.api.cleanMlIndices(); - }); - beforeEach(async () => { await svlSearchNavigation.navigateToInferenceManagementPage(); }); diff --git a/x-pack/test_serverless/functional/test_suites/security/ftr/navigation.ts b/x-pack/test_serverless/functional/test_suites/security/ftr/navigation.ts index 9f9580c226c6..b7d7ef5c6dbb 100644 --- a/x-pack/test_serverless/functional/test_suites/security/ftr/navigation.ts +++ b/x-pack/test_serverless/functional/test_suites/security/ftr/navigation.ts @@ -74,5 +74,16 @@ export default function ({ getPageObject, getService }: FtrProviderContext) { await testSubjects.existOrFail('cases-all-title'); }); }); + it('navigates to maintenance windows', async () => { + await svlCommonPage.loginAsAdmin(); + await svlSecNavigation.navigateToLandingPage(); + await svlCommonNavigation.sidenav.openSection('category-management'); + await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'management' }); + await testSubjects.click('app-card-maintenanceWindows'); + await svlCommonNavigation.breadcrumbs.expectBreadcrumbTexts([ + 'Stack Management', + 'Maintenance Windows', + ]); + }); }); } diff --git a/yarn.lock b/yarn.lock index 860efbbc2c5c..b3528fb1c1b6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2277,12 +2277,13 @@ "@elastic/transport" "^8.3.1" tslib "^2.4.0" -"@elastic/elasticsearch@^8.15.2": - version "8.15.2" - resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-8.15.2.tgz#024e3617b0d1db6425b369a7176d3514598e4c9e" - integrity sha512-DTvjK4bs4WkgdQkXZJx2eVcwKzF1it/PyGT3rl1ReUNIWbkzMEKksiDQK3wY1U3WHT4zTuWQi4GrDOC1w5ej8Q== +"@elastic/elasticsearch@^8.16.0": + version "8.16.0" + resolved "https://registry.yarnpkg.com/@elastic/elasticsearch/-/elasticsearch-8.16.0.tgz#35c6729e15684154b8b3c391cfad34877d771cf0" + integrity sha512-uiPC6AePESl/jakx+ZLarLsLdxDHiCSrpAkkXJ5Q8A78vadEQsTGXRUVFwWWkS8gfGthnT3O+QK6BHXuszd0KQ== dependencies: - "@elastic/transport" "^8.8.1" + "@elastic/transport" "^8.9.1" + apache-arrow "^18.0.0" tslib "^2.4.0" "@elastic/ems-client@8.5.3": @@ -2475,10 +2476,10 @@ undici "^5.28.3" yaml "^2.2.2" -"@elastic/transport@^8.3.1", "@elastic/transport@^8.8.1": - version "8.8.1" - resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.8.1.tgz#d64244907bccdad5626c860b492faeef12194b1f" - integrity sha512-4RQIiChwNIx3B0O+2JdmTq/Qobj6+1g2RQnSv1gt4V2SVfAYjGwOKu0ZMKEHQOXYNG6+j/Chero2G9k3/wXLEw== +"@elastic/transport@^8.3.1", "@elastic/transport@^8.9.1": + version "8.9.1" + resolved "https://registry.yarnpkg.com/@elastic/transport/-/transport-8.9.1.tgz#1acc090ac45903a3d5a8b7269f6ba6410108dc0a" + integrity sha512-jasKNQeOb1vNf9aEYg+8zXmetaFjApDTSCC4QTl6aTixvyiRiSLcCiB8P6Q0lY9JIII/BhqNl8WbpFnsKitntw== dependencies: "@opentelemetry/api" "1.x" debug "^4.3.4" @@ -3848,7 +3849,7 @@ version "0.0.0" uid "" -"@kbn/ai-assistant-management-plugin@link:src/plugins/ai_assistant_management/selection": +"@kbn/ai-assistant-management-plugin@link:src/platform/plugins/shared/ai_assistant_management/selection": version "0.0.0" uid "" @@ -5216,7 +5217,7 @@ version "0.0.0" uid "" -"@kbn/data-forge@link:x-pack/packages/kbn-data-forge": +"@kbn/data-forge@link:x-pack/platform/packages/shared/kbn-data-forge": version "0.0.0" uid "" @@ -5236,11 +5237,11 @@ version "0.0.0" uid "" -"@kbn/data-stream-adapter@link:packages/kbn-data-stream-adapter": +"@kbn/data-stream-adapter@link:x-pack/solutions/security/packages/data-stream-adapter": version "0.0.0" uid "" -"@kbn/data-usage-plugin@link:x-pack/plugins/data_usage": +"@kbn/data-usage-plugin@link:x-pack/platform/plugins/private/data_usage": version "0.0.0" uid "" @@ -5300,7 +5301,7 @@ version "0.0.0" uid "" -"@kbn/deeplinks-observability@link:packages/deeplinks/observability": +"@kbn/deeplinks-observability@link:src/platform/packages/shared/deeplinks/observability": version "0.0.0" uid "" @@ -5408,7 +5409,7 @@ version "0.0.0" uid "" -"@kbn/ecs-data-quality-dashboard@link:x-pack/packages/security-solution/ecs_data_quality_dashboard": +"@kbn/ecs-data-quality-dashboard@link:x-pack/solutions/security/packages/ecs_data_quality_dashboard": version "0.0.0" uid "" @@ -5600,7 +5601,7 @@ version "0.0.0" uid "" -"@kbn/expandable-flyout@link:packages/kbn-expandable-flyout": +"@kbn/expandable-flyout@link:x-pack/solutions/security/packages/expandable-flyout": version "0.0.0" uid "" @@ -5612,7 +5613,7 @@ version "0.0.0" uid "" -"@kbn/exploratory-view-plugin@link:x-pack/plugins/observability_solution/exploratory_view": +"@kbn/exploratory-view-plugin@link:x-pack/solutions/observability/plugins/exploratory_view": version "0.0.0" uid "" @@ -5912,7 +5913,7 @@ version "0.0.0" uid "" -"@kbn/index-adapter@link:packages/kbn-index-adapter": +"@kbn/index-adapter@link:x-pack/solutions/security/packages/index-adapter": version "0.0.0" uid "" @@ -5948,7 +5949,7 @@ version "0.0.0" uid "" -"@kbn/infra-forge@link:x-pack/packages/kbn-infra-forge": +"@kbn/infra-forge@link:x-pack/platform/packages/private/kbn-infra-forge": version "0.0.0" uid "" @@ -5992,15 +5993,15 @@ version "0.0.0" uid "" -"@kbn/investigate-app-plugin@link:x-pack/plugins/observability_solution/investigate_app": +"@kbn/investigate-app-plugin@link:x-pack/solutions/observability/plugins/investigate_app": version "0.0.0" uid "" -"@kbn/investigate-plugin@link:x-pack/plugins/observability_solution/investigate": +"@kbn/investigate-plugin@link:x-pack/solutions/observability/plugins/investigate": version "0.0.0" uid "" -"@kbn/investigation-shared@link:packages/kbn-investigation-shared": +"@kbn/investigation-shared@link:x-pack/solutions/observability/packages/kbn-investigation-shared": version "0.0.0" uid "" @@ -6448,27 +6449,35 @@ version "0.0.0" uid "" -"@kbn/observability-ai-assistant-app-plugin@link:x-pack/plugins/observability_solution/observability_ai_assistant_app": +"@kbn/observability-ai-assistant-app-plugin@link:x-pack/solutions/observability/plugins/observability_ai_assistant_app": version "0.0.0" uid "" -"@kbn/observability-ai-assistant-management-plugin@link:x-pack/plugins/observability_solution/observability_ai_assistant_management": +"@kbn/observability-ai-assistant-management-plugin@link:x-pack/solutions/observability/plugins/observability_ai_assistant_management": version "0.0.0" uid "" -"@kbn/observability-ai-assistant-plugin@link:x-pack/plugins/observability_solution/observability_ai_assistant": +"@kbn/observability-ai-assistant-plugin@link:x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant": version "0.0.0" uid "" -"@kbn/observability-alert-details@link:x-pack/packages/observability/alert_details": +"@kbn/observability-ai-common@link:x-pack/solutions/observability/packages/observability_ai/observability_ai_common": version "0.0.0" uid "" -"@kbn/observability-alerting-rule-utils@link:x-pack/packages/observability/alerting_rule_utils": +"@kbn/observability-ai-server@link:x-pack/solutions/observability/packages/observability_ai/observability_ai_server": version "0.0.0" uid "" -"@kbn/observability-alerting-test-data@link:x-pack/packages/observability/alerting_test_data": +"@kbn/observability-alert-details@link:x-pack/solutions/observability/packages/alert_details": + version "0.0.0" + uid "" + +"@kbn/observability-alerting-rule-utils@link:x-pack/platform/packages/shared/observability/alerting_rule_utils": + version "0.0.0" + uid "" + +"@kbn/observability-alerting-test-data@link:x-pack/solutions/observability/packages/alerting_test_data": version "0.0.0" uid "" @@ -6476,7 +6485,7 @@ version "0.0.0" uid "" -"@kbn/observability-get-padded-alert-time-range-util@link:x-pack/packages/observability/get_padded_alert_time_range_util": +"@kbn/observability-get-padded-alert-time-range-util@link:x-pack/solutions/observability/packages/get_padded_alert_time_range_util": version "0.0.0" uid "" @@ -6496,7 +6505,7 @@ version "0.0.0" uid "" -"@kbn/observability-plugin@link:x-pack/plugins/observability_solution/observability": +"@kbn/observability-plugin@link:x-pack/solutions/observability/plugins/observability": version "0.0.0" uid "" @@ -6504,7 +6513,7 @@ version "0.0.0" uid "" -"@kbn/observability-synthetics-test-data@link:x-pack/packages/observability/synthetics_test_data": +"@kbn/observability-synthetics-test-data@link:x-pack/solutions/observability/packages/synthetics_test_data": version "0.0.0" uid "" @@ -6564,6 +6573,10 @@ version "0.0.0" uid "" +"@kbn/palettes@link:packages/kbn-palettes": + version "0.0.0" + uid "" + "@kbn/panel-loader@link:packages/kbn-panel-loader": version "0.0.0" uid "" @@ -6688,6 +6701,10 @@ version "0.0.0" uid "" +"@kbn/relocate@link:packages/kbn-relocate": + version "0.0.0" + uid "" + "@kbn/remote-clusters-plugin@link:x-pack/plugins/remote_clusters": version "0.0.0" uid "" @@ -7060,7 +7077,7 @@ version "0.0.0" uid "" -"@kbn/security-solution-distribution-bar@link:x-pack/packages/security-solution/distribution_bar": +"@kbn/security-solution-distribution-bar@link:x-pack/solutions/security/packages/distribution_bar": version "0.0.0" uid "" @@ -7068,7 +7085,7 @@ version "0.0.0" uid "" -"@kbn/security-solution-features@link:x-pack/packages/security-solution/features": +"@kbn/security-solution-features@link:x-pack/solutions/security/packages/features": version "0.0.0" uid "" @@ -7076,7 +7093,7 @@ version "0.0.0" uid "" -"@kbn/security-solution-navigation@link:x-pack/packages/security-solution/navigation": +"@kbn/security-solution-navigation@link:x-pack/solutions/security/packages/navigation": version "0.0.0" uid "" @@ -7088,15 +7105,15 @@ version "0.0.0" uid "" -"@kbn/security-solution-side-nav@link:x-pack/packages/security-solution/side_nav": +"@kbn/security-solution-side-nav@link:x-pack/solutions/security/packages/side_nav": version "0.0.0" uid "" -"@kbn/security-solution-storybook-config@link:x-pack/packages/security-solution/storybook/config": +"@kbn/security-solution-storybook-config@link:x-pack/solutions/security/packages/storybook/config": version "0.0.0" uid "" -"@kbn/security-solution-upselling@link:x-pack/packages/security-solution/upselling": +"@kbn/security-solution-upselling@link:x-pack/solutions/security/packages/upselling": version "0.0.0" uid "" @@ -7112,7 +7129,7 @@ version "0.0.0" uid "" -"@kbn/securitysolution-data-table@link:x-pack/packages/security-solution/data_table": +"@kbn/securitysolution-data-table@link:x-pack/solutions/security/packages/data_table": version "0.0.0" uid "" @@ -7212,7 +7229,7 @@ version "0.0.0" uid "" -"@kbn/serverless-observability@link:x-pack/plugins/serverless_observability": +"@kbn/serverless-observability@link:x-pack/solutions/observability/plugins/serverless_observability": version "0.0.0" uid "" @@ -7472,7 +7489,7 @@ version "0.0.0" uid "" -"@kbn/slo-schema@link:x-pack/packages/kbn-slo-schema": +"@kbn/slo-schema@link:x-pack/platform/packages/shared/kbn-slo-schema": version "0.0.0" uid "" @@ -7548,19 +7565,19 @@ version "0.0.0" uid "" -"@kbn/streams-app-plugin@link:x-pack/plugins/streams_app": +"@kbn/streams-app-plugin@link:x-pack/solutions/observability/plugins/streams_app": version "0.0.0" uid "" -"@kbn/streams-plugin@link:x-pack/plugins/streams": +"@kbn/streams-plugin@link:x-pack/solutions/observability/plugins/streams": version "0.0.0" uid "" -"@kbn/synthetics-e2e@link:x-pack/plugins/observability_solution/synthetics/e2e": +"@kbn/synthetics-e2e@link:x-pack/solutions/observability/plugins/synthetics/e2e": version "0.0.0" uid "" -"@kbn/synthetics-plugin@link:x-pack/plugins/observability_solution/synthetics": +"@kbn/synthetics-plugin@link:x-pack/solutions/observability/plugins/synthetics": version "0.0.0" uid "" @@ -7652,11 +7669,11 @@ version "0.0.0" uid "" -"@kbn/threat-intelligence-plugin@link:x-pack/plugins/threat_intelligence": +"@kbn/threat-intelligence-plugin@link:x-pack/solutions/security/plugins/threat_intelligence": version "0.0.0" uid "" -"@kbn/timelines-plugin@link:x-pack/plugins/timelines": +"@kbn/timelines-plugin@link:x-pack/solutions/security/plugins/timelines": version "0.0.0" uid "" @@ -7800,7 +7817,7 @@ version "0.0.0" uid "" -"@kbn/uptime-plugin@link:x-pack/plugins/observability_solution/uptime": +"@kbn/uptime-plugin@link:x-pack/solutions/observability/plugins/uptime": version "0.0.0" uid "" @@ -7848,7 +7865,7 @@ version "0.0.0" uid "" -"@kbn/ux-plugin@link:x-pack/plugins/observability_solution/ux": +"@kbn/ux-plugin@link:x-pack/solutions/observability/plugins/ux": version "0.0.0" uid "" @@ -8128,6 +8145,21 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== +"@ljharb/resumer@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@ljharb/resumer/-/resumer-0.1.3.tgz#5ef4a4958da1b4e71ffea8ef33499cc622672d89" + integrity sha512-d+tsDgfkj9X5QTriqM4lKesCkMMJC3IrbPKHvayP00ELx2axdXvDfWkqjxrLXIzGcQzmj7VAUT1wopqARTvafw== + dependencies: + "@ljharb/through" "^2.3.13" + call-bind "^1.0.7" + +"@ljharb/through@^2.3.13": + version "2.3.13" + resolved "https://registry.yarnpkg.com/@ljharb/through/-/through-2.3.13.tgz#b7e4766e0b65aa82e529be945ab078de79874edc" + integrity sha512-/gKJun8NNiWGZJkGzI/Ragc53cOdcLNdzjLaIa+GEjguQs0ulsurx8WN0jijdK9yPqDvziX995sMRLyLt1uZMQ== + dependencies: + call-bind "^1.0.7" + "@lmdb/lmdb-darwin-arm64@2.9.2": version "2.9.2" resolved "https://registry.yarnpkg.com/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.9.2.tgz#da42cda48018eabfd678b9698e68a0102221b4ba" @@ -10811,6 +10843,13 @@ regenerator-runtime "^0.13.7" resolve-from "^5.0.0" +"@swc/helpers@^0.5.11": + version "0.5.15" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.5.15.tgz#79efab344c5819ecf83a43f3f9f811fc84b516d7" + integrity sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g== + dependencies: + tslib "^2.8.0" + "@szmarczak/http-timer@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.5.tgz#bfbd50211e9dfa51ba07da58a14cdfd333205152" @@ -11267,6 +11306,16 @@ dependencies: "@types/color-convert" "*" +"@types/command-line-args@^5.2.3": + version "5.2.3" + resolved "https://registry.yarnpkg.com/@types/command-line-args/-/command-line-args-5.2.3.tgz#553ce2fd5acf160b448d307649b38ffc60d39639" + integrity sha512-uv0aG6R0Y8WHZLTamZwtfsDLVRnOa+n+n5rEvFWL5Na5gZ8V2Teab/duDPFzIIIhs9qizDpcavCusCLJZu62Kw== + +"@types/command-line-usage@^5.0.4": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/command-line-usage/-/command-line-usage-5.0.4.tgz#374e4c62d78fbc5a670a0f36da10235af879a0d5" + integrity sha512-BwR5KP3Es/CSht0xqBcUXS3qCAUVXwpRKsV2+arxeb65atasuXG9LykC9Ab10Cw3s2raH92ZqOeILaQbsB2ACg== + "@types/connect-history-api-fallback@^1.3.5": version "1.3.5" resolved "https://registry.yarnpkg.com/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.3.5.tgz#d1f7a8a09d0ed5a57aee5ae9c18ab9b803205dae" @@ -11887,10 +11936,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a" integrity sha1-UALhT3Xi1x5WQoHfBDHIwbSio2o= -"@types/minimist@^1.2.0", "@types/minimist@^1.2.2": - version "1.2.2" - resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" - integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/minimist@^1.2.0", "@types/minimist@^1.2.5": + version "1.2.5" + resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.5.tgz#ec10755e871497bcd83efe927e43ec46e8c0747e" + integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== "@types/mock-fs@^4.13.1": version "4.13.1" @@ -11906,13 +11955,6 @@ dependencies: moment ">=2.14.0" -"@types/multistream@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@types/multistream/-/multistream-4.1.0.tgz#517770a32e5715fdda87904a6da7d179142feba4" - integrity sha512-KiMkWve/Uu0qwCtNO6ZflMLjglkXsAdLdIwb31o5YQBbevdH2DF7inqebCli+F9am8McvEqCE4GXNOUZe8jOAg== - dependencies: - "@types/node" "*" - "@types/mustache@^0.8.31": version "0.8.31" resolved "https://registry.yarnpkg.com/@types/mustache/-/mustache-0.8.31.tgz#7c86cbf74f7733f9e3bdc28817623927eb386616" @@ -11955,7 +11997,7 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@14 || 16 || 17", "@types/node@20.10.5", "@types/node@>= 8", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@>=18.0.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.0.0", "@types/node@^18.11.18": +"@types/node@*", "@types/node@14 || 16 || 17", "@types/node@20.10.5", "@types/node@>= 8", "@types/node@>=12.12.47", "@types/node@>=13.7.0", "@types/node@>=18.0.0", "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0", "@types/node@^18.0.0", "@types/node@^18.11.18", "@types/node@^20.13.0": version "20.10.5" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== @@ -13354,11 +13396,6 @@ ansi-align@^3.0.0: dependencies: string-width "^4.1.0" -ansi-colors@4.1.1, ansi-colors@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" - integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== - ansi-colors@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-1.1.0.tgz#6374b4dd5d4718ff3ce27a671a3b1cad077132a9" @@ -13371,6 +13408,11 @@ ansi-colors@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf" integrity sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA== +ansi-colors@^4.1.1, ansi-colors@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== + ansi-escapes@^4.2.1, ansi-escapes@^4.3.0, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -13479,6 +13521,21 @@ anymatch@^3.0.0, anymatch@^3.0.3, anymatch@^3.1.3, anymatch@~3.1.2: normalize-path "^3.0.0" picomatch "^2.0.4" +apache-arrow@^18.0.0: + version "18.0.0" + resolved "https://registry.yarnpkg.com/apache-arrow/-/apache-arrow-18.0.0.tgz#a187bd55318a7a68b6ff09835d05e89e019eba2e" + integrity sha512-gFlPaqN9osetbB83zC29AbbZqGiCuFH1vyyPseJ+B7SIbfBtESV62mMT/CkiIt77W6ykC/nTWFzTXFs0Uldg4g== + dependencies: + "@swc/helpers" "^0.5.11" + "@types/command-line-args" "^5.2.3" + "@types/command-line-usage" "^5.0.4" + "@types/node" "^20.13.0" + command-line-args "^5.2.1" + command-line-usage "^7.0.1" + flatbuffers "^24.3.25" + json-bignum "^0.0.3" + tslib "^2.6.2" + app-module-path@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/app-module-path/-/app-module-path-2.2.0.tgz#641aa55dfb7d6a6f0a8141c4b9c0aa50b6c24dd5" @@ -13611,6 +13668,16 @@ arr-union@^3.1.0: resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= +array-back@^3.0.1, array-back@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" + integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== + +array-back@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/array-back/-/array-back-6.2.2.tgz#f567d99e9af88a6d3d2f9dfcc21db6f9ba9fd157" + integrity sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw== + array-buffer-byte-length@^1.0.0, array-buffer-byte-length@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz#1e5583ec16763540a27ae52eed99ff899223568f" @@ -13682,6 +13749,17 @@ array-unique@^0.3.2: resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= +array.prototype.every@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/array.prototype.every/-/array.prototype.every-1.1.6.tgz#1717b407d019913250317300d814a1b6660f10d7" + integrity sha512-gNEqZD97w6bfQRNmHkFv7rNnGM+VWyHZT+h/rf9C+22owcXuENr66Lfo0phItpU5KoXW6Owb34q2+8MnSIZ57w== + dependencies: + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.0" + es-object-atoms "^1.0.0" + is-string "^1.0.7" + array.prototype.findlastindex@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.2.tgz#bc229aef98f6bd0533a2bc61ff95209875526c9b" @@ -14571,7 +14649,7 @@ brotli@^1.2.0: dependencies: base64-js "^1.1.2" -browser-stdout@1.3.1: +browser-stdout@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== @@ -14999,6 +15077,13 @@ ccount@^1.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17" integrity sha512-MOli1W+nfbPLlKEhInaxhRdp7KVLFxLN5ykwzHgLsLI3H3gs5jjFAK4Eoj3OzzcxCtumDaI8onoVDeQyWaNTkw== +chalk-template@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/chalk-template/-/chalk-template-0.4.0.tgz#692c034d0ed62436b9062c1707fadcd0f753204b" + integrity sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg== + dependencies: + chalk "^4.1.2" + chalk@2.4.2, chalk@^2.3.0, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -15115,7 +15200,7 @@ cheerio@^1.0.0-rc.12, cheerio@^1.0.0-rc.3: parse5 "^7.0.0" parse5-htmlparser2-tree-adapter "^7.0.0" -chokidar@3.5.3, chokidar@^2.1.2, chokidar@^2.1.8, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.1, chokidar@^3.5.3: +chokidar@^2.1.2, chokidar@^2.1.8, chokidar@^3.4.0, chokidar@^3.4.1, chokidar@^3.4.2, chokidar@^3.5.1, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -15583,6 +15668,26 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== +command-line-args@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" + integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== + dependencies: + array-back "^3.1.0" + find-replace "^3.0.0" + lodash.camelcase "^4.3.0" + typical "^4.0.0" + +command-line-usage@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-7.0.3.tgz#6bce992354f6af10ecea2b631bfdf0c8b3bfaea3" + integrity sha512-PqMLy5+YGwhMh1wS04mVG44oqDsgyLRSKJBdOo1bnYhMKBW65gZF1dRp2OZRhiTjgUHljy99qkO7bsctLaw35Q== + dependencies: + array-back "^6.2.2" + chalk-template "^0.4.0" + table-layout "^4.1.0" + typical "^7.1.1" + commander@2, commander@^2.15.0, commander@^2.19.0, commander@^2.20.0, commander@^2.7.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -15997,9 +16102,9 @@ cronstrue@^1.51.0: integrity sha512-fSRAz/MV0TRjeNZKAsovmH/MSsly7+8np4XsfsrjOOz7sjxLrE9SmedRYAs3nPAtLLC5UsMpvenjXYRz463bMA== cross-spawn@^6.0.0: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + version "6.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.6.tgz#30d0efa0712ddb7eb5a76e1e8721bffafa6b5d57" + integrity sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw== dependencies: nice-try "^1.0.4" path-key "^2.0.1" @@ -16008,9 +16113,9 @@ cross-spawn@^6.0.0: which "^1.2.9" cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.5.tgz#910aac880ff5243da96b728bc6521a5f6c2f2f82" - integrity sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -16836,7 +16941,7 @@ deep-equal@^1.0.0, deep-equal@^1.0.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" -deep-equal@^2.0.3, deep-equal@^2.2.3: +deep-equal@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1" integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA== @@ -16965,10 +17070,10 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= +defined@^1.0.0, defined@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.1.tgz#c0b9db27bfaffd95d6f61399419b893df0f91ebf" + integrity sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q== degenerator@^5.0.0: version "5.0.1" @@ -17268,11 +17373,6 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -diff@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - diff@^3.5.0: version "3.5.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12" @@ -17283,10 +17383,10 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -diff@^5.0.0, diff@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40" - integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw== +diff@^5.0.0, diff@^5.1.0, diff@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-5.2.0.tgz#26ded047cd1179b78b9537d5ef725503ce1ae531" + integrity sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A== diffie-hellman@^5.0.0: version "5.0.2" @@ -17617,10 +17717,10 @@ elastic-apm-node@3.46.0: traverse "^0.6.6" unicode-byte-truncate "^1.0.0" -elastic-apm-node@^4.8.1: - version "4.8.1" - resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-4.8.1.tgz#b0ff8e04d7109c64b98608de73936c8740849f60" - integrity sha512-gryl5pJWd9Cp7qK+McHIFm9VlsqKipoXWIsKOGyPGzrddIVKKA8ONnLBwymQ1A2x4uXuk1HnIVwBvyk56vukaw== +elastic-apm-node@^4.9.0: + version "4.9.0" + resolved "https://registry.yarnpkg.com/elastic-apm-node/-/elastic-apm-node-4.9.0.tgz#8ca807fdf64404b615b60c4090bd9c9aad5b78ed" + integrity sha512-VUbrahqHmqpfwGHtUysWJ7aeCIUm61hAw8tSu0gE9AYdriVSPod4Ki11X4K8sBri0bIc/FTHxOrg7kudhGoqHQ== dependencies: "@elastic/ecs-pino-format" "^1.5.0" "@opentelemetry/api" "^1.4.1" @@ -17640,7 +17740,7 @@ elastic-apm-node@^4.8.1: fast-safe-stringify "^2.0.7" fast-stream-to-buffer "^1.0.0" http-headers "^3.0.2" - import-in-the-middle "1.11.2" + import-in-the-middle "1.11.3" json-bigint "^1.0.0" lru-cache "10.2.0" measured-reporting "^1.51.1" @@ -18119,11 +18219,6 @@ escape-html@^1.0.3, escape-html@~1.0.3: resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= -escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -18134,6 +18229,11 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + escodegen@^2.0.0, escodegen@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" @@ -18728,10 +18828,10 @@ expr-eval@^2.0.2: resolved "https://registry.yarnpkg.com/expr-eval/-/expr-eval-2.0.2.tgz#fa6f044a7b0c93fde830954eb9c5b0f7fbc7e201" integrity sha512-4EMSHGOPSwAfBiibw3ndnP0AvjDWLsMvGOvWEZ2F96IGk0bIVdjQisOHxReSkE13mHcfbuCiXw+G4y0zv6N8Eg== -express@^4.17.1, express@^4.17.3, express@^4.18.2, express@^4.21.1: - version "4.21.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.21.1.tgz#9dae5dda832f16b4eec941a4e44aa89ec481b281" - integrity sha512-YSFlK1Ee0/GC8QaO91tHcDxJiE/X4FbpAyQWkxAvG6AXCuR65YzK8ua6D9hvi/TzUfZMpc+BwuM1IPw8fmQBiQ== +express@^4.17.1, express@^4.17.3, express@^4.18.2, express@^4.21.2: + version "4.21.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" + integrity sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA== dependencies: accepts "~1.3.8" array-flatten "1.1.1" @@ -18752,7 +18852,7 @@ express@^4.17.1, express@^4.17.3, express@^4.18.2, express@^4.21.1: methods "~1.1.2" on-finished "2.4.1" parseurl "~1.3.3" - path-to-regexp "0.1.10" + path-to-regexp "0.1.12" proxy-addr "~2.0.7" qs "6.13.0" range-parser "~1.2.1" @@ -19181,6 +19281,13 @@ find-my-way-ts@^0.1.2: resolved "https://registry.yarnpkg.com/find-my-way-ts/-/find-my-way-ts-0.1.5.tgz#9de9494f19e0319d4f6366bb91d6bf7952af7874" integrity sha512-4GOTMrpGQVzsCH2ruUn2vmwzV/02zF4q+ybhCIrw/Rkt3L8KWcycdC6aJMctJzwN4fXD4SD5F/4B9Sksh5rE0A== +find-replace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" + integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== + dependencies: + array-back "^3.0.1" + find-root@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" @@ -19198,14 +19305,6 @@ find-test-names@1.28.18, find-test-names@^1.19.0: globby "^11.0.4" simple-bin-help "^1.8.0" -find-up@5.0.0, find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - find-up@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" @@ -19229,6 +19328,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -19242,6 +19349,11 @@ flat@^5.0.2: resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== +flatbuffers@^24.3.25: + version "24.3.25" + resolved "https://registry.yarnpkg.com/flatbuffers/-/flatbuffers-24.3.25.tgz#e2f92259ba8aa53acd0af7844afb7c7eb95e7089" + integrity sha512-3HDgPbgiwWMI9zVB7VYBHaMrbOO7Gm0v+yD2FV/sCKj+9NDeVL7BOBYUuhWAQGKWOzBo8S9WdMvV0eixO233XQ== + flatstr@^1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/flatstr/-/flatstr-1.0.12.tgz#c2ba6a08173edbb6c9640e3055b95e287ceb5931" @@ -19586,6 +19698,11 @@ functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== +fuse.js@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/fuse.js/-/fuse.js-7.0.0.tgz#6573c9fcd4c8268e403b4fc7d7131ffcf99a9eb2" + integrity sha512-14F4hBIxqKvD4Zz/XjDc3y94mNZN6pRv3U13Udo0lNLCWRBUsrMv2xwcF/y/Z5sV6+FQW+/ow68cHpm4sunt8Q== + gauge@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" @@ -19898,19 +20015,7 @@ glob@7.1.6: once "^1.3.0" path-is-absolute "^1.0.0" -glob@7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@8.1.0: +glob@8.1.0, glob@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== @@ -20269,6 +20374,14 @@ has-bigints@^1.0.2: resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== +has-dynamic-import@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/has-dynamic-import/-/has-dynamic-import-2.1.0.tgz#06359ad7672b9e764aea93a54bb9d6e17542d34c" + integrity sha512-su0anMkNEnJKZ/rB99jn3y6lV/J8Ro96hBJ28YAeVzj5rWxH+YL/AdCyiYYA1HDLV9YhmvqpWSJJj2KLo1MX6g== + dependencies: + call-bind "^1.0.5" + get-intrinsic "^1.2.2" + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -20529,7 +20642,7 @@ hdr-histogram-percentiles-obj@^3.0.0: resolved "https://registry.yarnpkg.com/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz#9409f4de0c2dda78e61de2d9d78b1e9f3cba283c" integrity sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw== -he@1.2.0, he@^1.2.0: +he@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== @@ -20988,10 +21101,10 @@ import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-in-the-middle@1.11.2: - version "1.11.2" - resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.11.2.tgz#dd848e72b63ca6cd7c34df8b8d97fc9baee6174f" - integrity sha512-gK6Rr6EykBcc6cVWRSBR5TWf8nn6hZMYSRYqCcHa0l0d1fPK7JSYo6+Mlmck76jIX9aL/IZ71c06U2VpFwl1zA== +import-in-the-middle@1.11.3: + version "1.11.3" + resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.11.3.tgz#08559f2c05fd65ba7062e747af056ed18a80120c" + integrity sha512-tNpKEb4AjZrCyrxi+Eyu43h5ig0O8ZRFSXPHh/00/o+4P4pKzVEW/m5lsVtsAT7fCIgmQOAPjdqecGDsBXRxsw== dependencies: acorn "^8.8.2" acorn-import-attributes "^1.9.5" @@ -22599,10 +22712,10 @@ js-search@^1.4.3: resolved "https://registry.yarnpkg.com/js-search/-/js-search-1.4.3.tgz#23a86d7e064ca53a473930edc48615b6b1c1954a" integrity sha512-Sny5pf00kX1sM1KzvUC9nGYWXOvBfy30rmvZWeRktpg+esQKedIXrXNee/I2CAnsouCyaTjitZpRflDACx4toA== -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== +js-sha256@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.11.0.tgz#256a921d9292f7fe98905face82e367abaca9576" + integrity sha512-6xNlKayMZvds9h1Y1VWc0fQHQ82BxTXizWPEtEeGvmOUYpBRy4gbWroHLpzowe6xiQhHpelCQiE7HEdznyBL9Q== js-string-escape@^1.0.1: version "1.0.1" @@ -22621,13 +22734,6 @@ js-tiktoken@^1.0.12, js-tiktoken@^1.0.14: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@4.1.0, js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" @@ -22636,6 +22742,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsbn@1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-1.1.0.tgz#b01307cb29b618a1ed26ec79e911f803c4da0040" @@ -22695,6 +22808,11 @@ json-bigint@^1.0.0: dependencies: bignumber.js "^9.0.0" +json-bignum@^0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/json-bignum/-/json-bignum-0.0.3.tgz#41163b50436c773d82424dbc20ed70db7604b8d7" + integrity sha512-2WHyXj3OfHSgNyuzDbSxI1w2jgw5gkWSWhS7Qg4bWXx1nLk3jnbwfUeS0PSba3IzpTUWdHxBieELUzXRjQB2zg== + json-buffer@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" @@ -23447,14 +23565,6 @@ lodash@^4.17.10, lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17 resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@4.1.0, log-symbols@^4.0.0, log-symbols@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" - integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== - dependencies: - chalk "^4.1.0" - is-unicode-supported "^0.1.0" - log-symbols@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4" @@ -23462,6 +23572,14 @@ log-symbols@^3.0.0: dependencies: chalk "^2.4.2" +log-symbols@^4.0.0, log-symbols@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== + dependencies: + chalk "^4.1.0" + is-unicode-supported "^0.1.0" + log-update@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/log-update/-/log-update-4.0.0.tgz#589ecd352471f2a1c0c570287543a64dfd20e0a1" @@ -24261,13 +24379,6 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo= -minimatch@5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -24275,7 +24386,7 @@ minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatc dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1, minimatch@^5.1.0: +minimatch@^5.0.1, minimatch@^5.1.0, minimatch@^5.1.6: version "5.1.6" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== @@ -24446,32 +24557,31 @@ mocha-multi-reporters@^1.5.1: debug "^4.1.1" lodash "^4.17.15" -mocha@^10.1.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.1.0.tgz#dbf1114b7c3f9d0ca5de3133906aea3dfc89ef7a" - integrity sha512-vUF7IYxEoN7XhQpFLxQAEMtE4W91acW4B6En9l97MwE9stL1A9gusXfoHZCLVHDUJ/7V5+lbCM6yMqzo5vNymg== +mocha@^10.3.0: + version "10.8.2" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.8.2.tgz#8d8342d016ed411b12a429eb731b825f961afb96" + integrity sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg== dependencies: - ansi-colors "4.1.1" - browser-stdout "1.3.1" - chokidar "3.5.3" - debug "4.3.4" - diff "5.0.0" - escape-string-regexp "4.0.0" - find-up "5.0.0" - glob "7.2.0" - he "1.2.0" - js-yaml "4.1.0" - log-symbols "4.1.0" - minimatch "5.0.1" - ms "2.1.3" - nanoid "3.3.3" - serialize-javascript "6.0.0" - strip-json-comments "3.1.1" - supports-color "8.1.1" - workerpool "6.2.1" - yargs "16.2.0" - yargs-parser "20.2.4" - yargs-unparser "2.0.0" + ansi-colors "^4.1.3" + browser-stdout "^1.3.1" + chokidar "^3.5.3" + debug "^4.3.5" + diff "^5.2.0" + escape-string-regexp "^4.0.0" + find-up "^5.0.0" + glob "^8.1.0" + he "^1.2.0" + js-yaml "^4.1.0" + log-symbols "^4.1.0" + minimatch "^5.1.6" + ms "^2.1.3" + serialize-javascript "^6.0.2" + strip-json-comments "^3.1.1" + supports-color "^8.1.1" + workerpool "^6.5.1" + yargs "^16.2.0" + yargs-parser "^20.2.9" + yargs-unparser "^2.0.0" mochawesome-merge@^4.3.0: version "4.3.0" @@ -24521,6 +24631,19 @@ mock-fs@^5.1.2: resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-5.1.2.tgz#6fa486e06d00f8793a8d2228de980eff93ce6db7" integrity sha512-YkjQkdLulFrz0vD4BfNQdQRVmgycXTV7ykuHMlyv+C8WCHazpkiQRDthwa02kSyo8wKnY9wRptHfQLgmf0eR+A== +mock-property@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/mock-property/-/mock-property-1.1.0.tgz#b38b9961476d2e54cde2033b62847b9546b3670d" + integrity sha512-1/JjbLoGwv87xVsutkX0XJc0M0W4kb40cZl/K41xtTViBOD9JuFPKfyMNTrLJ/ivYAd0aPqu/vduamXO0emTFQ== + dependencies: + define-data-property "^1.1.4" + functions-have-names "^1.2.3" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + hasown "^2.0.2" + isarray "^2.0.5" + object-inspect "^1.13.2" + module-definition@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/module-definition/-/module-definition-5.0.1.tgz#62d1194e5d5ea6176b7dc7730f818f466aefa32f" @@ -24753,14 +24876,6 @@ multipipe@^1.0.2: duplexer2 "^0.1.2" object-assign "^4.1.0" -multistream@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/multistream/-/multistream-4.1.0.tgz#7bf00dfd119556fbc153cff3de4c6d477909f5a8" - integrity sha512-J1XDiAmmNpRCBfIWJv+n0ymC4ABcf/Pl+5YvC5B/D2f/2+8PtHvCNxMPKiQcZyi922Hq69J2YOpb1pTywfifyw== - dependencies: - once "^1.4.0" - readable-stream "^3.6.0" - murmurhash-js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/murmurhash-js/-/murmurhash-js-1.0.0.tgz#b06278e21fc6c37fa5313732b0412bcb6ae15f51" @@ -24810,11 +24925,6 @@ nano-css@^5.2.1: stacktrace-js "^2.0.0" stylis "3.5.0" -nanoid@3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.3.tgz#fd8e8b7aa761fe807dba2d1b98fb7241bb724a25" - integrity sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w== - nanoid@3.3.6: version "3.3.6" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.6.tgz#443380c856d6e9f9824267d960b4236ad583ea4c" @@ -25360,18 +25470,18 @@ object-identity-map@^1.0.2: dependencies: object.entries "^1.1.0" -object-inspect@^1.13.1, object-inspect@^1.7.0: - version "1.13.2" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" - integrity sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g== +object-inspect@^1.13.1, object-inspect@^1.13.2, object-inspect@^1.7.0: + version "1.13.3" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.3.tgz#f14c183de51130243d6d18ae149375ff50ea488a" + integrity sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA== -object-is@^1.0.1, object-is@^1.0.2, object-is@^1.1.2, object-is@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" - integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== +object-is@^1.0.1, object-is@^1.0.2, object-is@^1.1.2, object-is@^1.1.5, object-is@^1.1.6: + version "1.1.6" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" + integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== dependencies: - call-bind "^1.0.2" - define-properties "^1.1.3" + call-bind "^1.0.7" + define-properties "^1.2.1" object-keys@^1.1.1: version "1.1.1" @@ -26062,10 +26172,10 @@ path-scurry@^1.11.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" -path-to-regexp@0.1.10: - version "0.1.10" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.10.tgz#67e9108c5c0551b9e5326064387de4763c4d5f8b" - integrity sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w== +path-to-regexp@0.1.12: + version "0.1.12" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz#d5e1a12e478a976d432ef3c58d534b9923164bb7" + integrity sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ== path-to-regexp@^1.7.0: version "1.9.0" @@ -28691,7 +28801,7 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.10.0, resolve@^1.10.1, resolve@^1.12. path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -resolve@^2.0.0-next.4: +resolve@^2.0.0-next.4, resolve@^2.0.0-next.5: version "2.0.0-next.5" resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c" integrity sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA== @@ -28723,13 +28833,6 @@ restore-cursor@^5.0.0: onetime "^7.0.0" signal-exit "^4.1.0" -resumer@^0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" - integrity sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k= - dependencies: - through "~2.3.4" - ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" @@ -29284,13 +29387,6 @@ send@0.19.0: range-parser "~1.2.1" statuses "2.0.1" -serialize-javascript@6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== - dependencies: - randombytes "^2.1.0" - serialize-javascript@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" @@ -29305,7 +29401,7 @@ serialize-javascript@^5.0.1: dependencies: randombytes "^2.1.0" -serialize-javascript@^6.0.1: +serialize-javascript@^6.0.1, serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== @@ -30499,7 +30595,7 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" -strip-json-comments@3.1.1, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== @@ -30704,13 +30800,6 @@ supertest@^7.0.0: methods "^1.1.2" superagent "^9.0.1" -supports-color@8.1.1, supports-color@^8.0.0, supports-color@^8.1.1: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -30730,6 +30819,13 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.0.0, supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.2.0.tgz#4f77b42488765891774b70c79babd87f9bd594bb" @@ -30885,6 +30981,14 @@ tabbable@^5.3.3: resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-5.3.3.tgz#aac0ff88c73b22d6c3c5a50b1586310006b47fbf" integrity sha512-QD9qKY3StfbZqWOPLp0++pOrAVb/HbUi5xCc8cUo4XjP19808oaMiDzn0leBY5mCespIBM0CIZePzZjgzR83kA== +table-layout@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-4.1.1.tgz#0f72965de1a5c0c1419c9ba21cae4e73a2f73a42" + integrity sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA== + dependencies: + array-back "^6.2.2" + wordwrapjs "^5.1.0" + table@^6.8.0, table@^6.8.2: version "6.8.2" resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" @@ -30906,28 +31010,33 @@ tapable@^2.1.1, tapable@^2.2.0: resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== -tape@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/tape/-/tape-5.0.1.tgz#0d70ce90a586387c4efda4393e72872672a416a3" - integrity sha512-wVsOl2shKPcjdJdc8a+PwacvrOdJZJ57cLUXlxW4TQ2R6aihXwG0m0bKm4mA4wjtQNTaLMCrYNEb4f9fjHKUYQ== +tape@^5.9.0: + version "5.9.0" + resolved "https://registry.yarnpkg.com/tape/-/tape-5.9.0.tgz#8d1a7472c6a154b82ce23b20dd9dc70ec0729b46" + integrity sha512-czbGgxSVwRlbB3Ly/aqQrNwrDAzKHDW/kVXegp4hSFmR2c8qqm3hCgZbUy1+3QAQFGhPDG7J56UsV1uNilBFCA== dependencies: - deep-equal "^2.0.3" - defined "^1.0.0" + "@ljharb/resumer" "^0.1.3" + "@ljharb/through" "^2.3.13" + array.prototype.every "^1.1.6" + call-bind "^1.0.7" + deep-equal "^2.2.3" + defined "^1.0.1" dotignore "^0.1.2" for-each "^0.3.3" - function-bind "^1.1.1" - glob "^7.1.6" - has "^1.0.3" + get-package-type "^0.1.0" + glob "^7.2.3" + has-dynamic-import "^2.1.0" + hasown "^2.0.2" inherits "^2.0.4" - is-regex "^1.0.5" - minimist "^1.2.5" - object-inspect "^1.7.0" - object-is "^1.1.2" - object.assign "^4.1.0" - resolve "^1.17.0" - resumer "^0.0.0" - string.prototype.trim "^1.2.1" - through "^2.3.8" + is-regex "^1.1.4" + minimist "^1.2.8" + mock-property "^1.1.0" + object-inspect "^1.13.2" + object-is "^1.1.6" + object-keys "^1.1.1" + object.assign "^4.1.5" + resolve "^2.0.0-next.5" + string.prototype.trim "^1.2.9" tar-fs@^2.0.0: version "2.1.1" @@ -31197,7 +31306,7 @@ through2@~0.4.1: readable-stream "~1.0.17" xtend "~2.1.1" -through@^2.3.6, through@^2.3.8, through@~2.3.4: +through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -31577,7 +31686,7 @@ tslib@2.5.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== -tslib@2.6.2, tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2: +tslib@2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== @@ -31587,6 +31696,11 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.5.0, tslib@^2.6.2, tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== + tslib@~2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" @@ -31788,6 +31902,16 @@ typewise@^1.0.3: dependencies: typewise-core "^1.2.0" +typical@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" + integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== + +typical@^7.1.1: + version "7.3.0" + resolved "https://registry.yarnpkg.com/typical/-/typical-7.3.0.tgz#930376be344228709f134613911fa22aa09617a4" + integrity sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw== + uc.micro@^2.0.0, uc.micro@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-2.1.0.tgz#f8d3f7d0ec4c3dea35a7e3c8efa4cb8b45c9e7ee" @@ -33381,6 +33505,11 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== +wordwrapjs@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-5.1.0.tgz#4c4d20446dcc670b14fa115ef4f8fd9947af2b3a" + integrity sha512-JNjcULU2e4KJwUNv6CHgI46UvDGitb6dGryHajXTDiLgg1/RiGoPSDw4kZfYnwGtEXf2ZMeIewDQgFGzkCB2Sg== + worker-farm@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/worker-farm/-/worker-farm-1.7.0.tgz#26a94c5391bbca926152002f69b84a4bf772e5a8" @@ -33395,10 +33524,10 @@ worker-rpc@^0.1.0: dependencies: microevent.ts "~0.1.1" -workerpool@6.2.1: - version "6.2.1" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" - integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== +workerpool@^6.5.1: + version "6.5.1" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.5.1.tgz#060f73b39d0caf97c6db64da004cd01b4c099544" + integrity sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA== "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" @@ -33625,11 +33754,6 @@ yaml@^2.5.1: resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.5.1.tgz#c9772aacf62cb7494a95b0c4f1fb065b563db130" integrity sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q== -yargs-parser@20.2.4, yargs-parser@^20.2.2, yargs-parser@^20.2.3: - version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -33638,12 +33762,17 @@ yargs-parser@^18.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^20.2.2, yargs-parser@^20.2.3, yargs-parser@^20.2.9: + version "20.2.9" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== + yargs-parser@^21.0.0, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-unparser@2.0.0: +yargs-unparser@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== @@ -33653,19 +33782,6 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@17.0.1: version "17.0.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb" @@ -33696,6 +33812,19 @@ yargs@^15.0.2, yargs@^15.3.1, yargs@^15.4.1: y18n "^4.0.0" yargs-parser "^18.1.2" +yargs@^16.2.0: + version "16.2.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yargs@^17.0.1, yargs@^17.2.1, yargs@^17.3.1, yargs@^17.7.1, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"